var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __reflectGet = Reflect.get;
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b ||= {})
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
  if (typeof require !== "undefined") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + x + '" is not supported');
});
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var __commonJS = (cb, mod) => function __require2() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from2, except, desc) => {
  if (from2 && typeof from2 === "object" || typeof from2 === "function") {
    for (let key of __getOwnPropNames(from2))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);

// node_modules/jquery/dist/jquery.js
var require_jquery = __commonJS({
  "node_modules/jquery/dist/jquery.js"(exports4, module2) {
    (function(global2, factory2) {
      "use strict";
      if (typeof module2 === "object" && typeof module2.exports === "object") {
        module2.exports = global2.document ? factory2(global2, true) : function(w) {
          if (!w.document) {
            throw new Error("jQuery requires a window with a document");
          }
          return factory2(w);
        };
      } else {
        factory2(global2);
      }
    })(typeof window !== "undefined" ? window : exports4, function(window2, noGlobal) {
      "use strict";
      var arr = [];
      var getProto = Object.getPrototypeOf;
      var slice = arr.slice;
      var flat = arr.flat ? function(array2) {
        return arr.flat.call(array2);
      } : function(array2) {
        return arr.concat.apply([], array2);
      };
      var push = arr.push;
      var indexOf2 = arr.indexOf;
      var class2type = {};
      var toString7 = class2type.toString;
      var hasOwn = class2type.hasOwnProperty;
      var fnToString = hasOwn.toString;
      var ObjectFunctionString = fnToString.call(Object);
      var support = {};
      var isFunction5 = function isFunction6(obj) {
        return typeof obj === "function" && typeof obj.nodeType !== "number";
      };
      var isWindow = function isWindow2(obj) {
        return obj != null && obj === obj.window;
      };
      var document2 = window2.document;
      var preservedScriptAttributes = {
        type: true,
        src: true,
        nonce: true,
        noModule: true
      };
      function DOMEval(code, node, doc) {
        doc = doc || document2;
        var i2, val, script = doc.createElement("script");
        script.text = code;
        if (node) {
          for (i2 in preservedScriptAttributes) {
            val = node[i2] || node.getAttribute && node.getAttribute(i2);
            if (val) {
              script.setAttribute(i2, val);
            }
          }
        }
        doc.head.appendChild(script).parentNode.removeChild(script);
      }
      function toType(obj) {
        if (obj == null) {
          return obj + "";
        }
        return typeof obj === "object" || typeof obj === "function" ? class2type[toString7.call(obj)] || "object" : typeof obj;
      }
      var version = "3.5.1", jQuery = function(selector, context2) {
        return new jQuery.fn.init(selector, context2);
      };
      jQuery.fn = jQuery.prototype = {
        // The current version of jQuery being used
        jquery: version,
        constructor: jQuery,
        // The default length of a jQuery object is 0
        length: 0,
        toArray: function() {
          return slice.call(this);
        },
        // Get the Nth element in the matched element set OR
        // Get the whole matched element set as a clean array
        get: function(num) {
          if (num == null) {
            return slice.call(this);
          }
          return num < 0 ? this[num + this.length] : this[num];
        },
        // Take an array of elements and push it onto the stack
        // (returning the new matched element set)
        pushStack: function(elems) {
          var ret = jQuery.merge(this.constructor(), elems);
          ret.prevObject = this;
          return ret;
        },
        // Execute a callback for every element in the matched set.
        each: function(callback) {
          return jQuery.each(this, callback);
        },
        map: function(callback) {
          return this.pushStack(jQuery.map(this, function(elem, i2) {
            return callback.call(elem, i2, elem);
          }));
        },
        slice: function() {
          return this.pushStack(slice.apply(this, arguments));
        },
        first: function() {
          return this.eq(0);
        },
        last: function() {
          return this.eq(-1);
        },
        even: function() {
          return this.pushStack(jQuery.grep(this, function(_elem, i2) {
            return (i2 + 1) % 2;
          }));
        },
        odd: function() {
          return this.pushStack(jQuery.grep(this, function(_elem, i2) {
            return i2 % 2;
          }));
        },
        eq: function(i2) {
          var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
          return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
        },
        end: function() {
          return this.prevObject || this.constructor();
        },
        // For internal use only.
        // Behaves like an Array's method, not like a jQuery method.
        push,
        sort: arr.sort,
        splice: arr.splice
      };
      jQuery.extend = jQuery.fn.extend = function() {
        var options, name, src, copy, copyIsArray, clone2, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
        if (typeof target === "boolean") {
          deep = target;
          target = arguments[i2] || {};
          i2++;
        }
        if (typeof target !== "object" && !isFunction5(target)) {
          target = {};
        }
        if (i2 === length) {
          target = this;
          i2--;
        }
        for (; i2 < length; i2++) {
          if ((options = arguments[i2]) != null) {
            for (name in options) {
              copy = options[name];
              if (name === "__proto__" || target === copy) {
                continue;
              }
              if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
                src = target[name];
                if (copyIsArray && !Array.isArray(src)) {
                  clone2 = [];
                } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
                  clone2 = {};
                } else {
                  clone2 = src;
                }
                copyIsArray = false;
                target[name] = jQuery.extend(deep, clone2, copy);
              } else if (copy !== void 0) {
                target[name] = copy;
              }
            }
          }
        }
        return target;
      };
      jQuery.extend({
        // Unique for each copy of jQuery on the page
        expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
        // Assume jQuery is ready without the ready module
        isReady: true,
        error: function(msg) {
          throw new Error(msg);
        },
        noop: function() {
        },
        isPlainObject: function(obj) {
          var proto, Ctor;
          if (!obj || toString7.call(obj) !== "[object Object]") {
            return false;
          }
          proto = getProto(obj);
          if (!proto) {
            return true;
          }
          Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
          return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
        },
        isEmptyObject: function(obj) {
          var name;
          for (name in obj) {
            return false;
          }
          return true;
        },
        // Evaluates a script in a provided context; falls back to the global one
        // if not specified.
        globalEval: function(code, options, doc) {
          DOMEval(code, { nonce: options && options.nonce }, doc);
        },
        each: function(obj, callback) {
          var length, i2 = 0;
          if (isArrayLike2(obj)) {
            length = obj.length;
            for (; i2 < length; i2++) {
              if (callback.call(obj[i2], i2, obj[i2]) === false) {
                break;
              }
            }
          } else {
            for (i2 in obj) {
              if (callback.call(obj[i2], i2, obj[i2]) === false) {
                break;
              }
            }
          }
          return obj;
        },
        // results is for internal usage only
        makeArray: function(arr2, results) {
          var ret = results || [];
          if (arr2 != null) {
            if (isArrayLike2(Object(arr2))) {
              jQuery.merge(
                ret,
                typeof arr2 === "string" ? [arr2] : arr2
              );
            } else {
              push.call(ret, arr2);
            }
          }
          return ret;
        },
        inArray: function(elem, arr2, i2) {
          return arr2 == null ? -1 : indexOf2.call(arr2, elem, i2);
        },
        // Support: Android <=4.0 only, PhantomJS 1 only
        // push.apply(_, arraylike) throws on ancient WebKit
        merge: function(first2, second) {
          var len = +second.length, j = 0, i2 = first2.length;
          for (; j < len; j++) {
            first2[i2++] = second[j];
          }
          first2.length = i2;
          return first2;
        },
        grep: function(elems, callback, invert) {
          var callbackInverse, matches = [], i2 = 0, length = elems.length, callbackExpect = !invert;
          for (; i2 < length; i2++) {
            callbackInverse = !callback(elems[i2], i2);
            if (callbackInverse !== callbackExpect) {
              matches.push(elems[i2]);
            }
          }
          return matches;
        },
        // arg is for internal usage only
        map: function(elems, callback, arg) {
          var length, value, i2 = 0, ret = [];
          if (isArrayLike2(elems)) {
            length = elems.length;
            for (; i2 < length; i2++) {
              value = callback(elems[i2], i2, arg);
              if (value != null) {
                ret.push(value);
              }
            }
          } else {
            for (i2 in elems) {
              value = callback(elems[i2], i2, arg);
              if (value != null) {
                ret.push(value);
              }
            }
          }
          return flat(ret);
        },
        // A global GUID counter for objects
        guid: 1,
        // jQuery.support is not used in Core but other projects attach their
        // properties to it so it needs to exist.
        support
      });
      if (typeof Symbol === "function") {
        jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
      }
      jQuery.each(
        "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
        function(_i, name) {
          class2type["[object " + name + "]"] = name.toLowerCase();
        }
      );
      function isArrayLike2(obj) {
        var length = !!obj && "length" in obj && obj.length, type = toType(obj);
        if (isFunction5(obj) || isWindow(obj)) {
          return false;
        }
        return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
      }
      var Sizzle = (
        /*!
         * Sizzle CSS Selector Engine v2.3.5
         * https://sizzlejs.com/
         *
         * Copyright JS Foundation and other contributors
         * Released under the MIT license
         * https://js.foundation/
         *
         * Date: 2020-03-14
         */
        function(window3) {
          var i2, support2, Expr, getText, isXML, tokenize, compile4, select2, outermostContext, sortInput, hasDuplicate, setDocument2, document3, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + 1 * /* @__PURE__ */ new Date(), preferredDoc = window3.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
            if (a === b) {
              hasDuplicate = true;
            }
            return 0;
          }, hasOwn2 = {}.hasOwnProperty, arr2 = [], pop = arr2.pop, pushNative = arr2.push, push2 = arr2.push, slice2 = arr2.slice, indexOf3 = function(list, elem) {
            var i3 = 0, len = list.length;
            for (; i3 < len; i3++) {
              if (list[i3] === elem) {
                return i3;
              }
            }
            return -1;
          }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace2 = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace2 + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace2 + "*(" + identifier + ")(?:" + whitespace2 + // Operator (capture 2)
          "*([*^$|!~]?=)" + whitespace2 + // "Attribute values must be CSS identifiers [capture 5]
          // or strings [capture 3 or capture 4]"
          `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace2 + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace2 + "+", "g"), rtrim2 = new RegExp("^" + whitespace2 + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace2 + "+$", "g"), rcomma = new RegExp("^" + whitespace2 + "*," + whitespace2 + "*"), rcombinators = new RegExp("^" + whitespace2 + "*([>+~]|" + whitespace2 + ")" + whitespace2 + "*"), rdescend = new RegExp(whitespace2 + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
            "ID": new RegExp("^#(" + identifier + ")"),
            "CLASS": new RegExp("^\\.(" + identifier + ")"),
            "TAG": new RegExp("^(" + identifier + "|[*])"),
            "ATTR": new RegExp("^" + attributes),
            "PSEUDO": new RegExp("^" + pseudos),
            "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace2 + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace2 + "*(?:([+-]|)" + whitespace2 + "*(\\d+)|))" + whitespace2 + "*\\)|)", "i"),
            "bool": new RegExp("^(?:" + booleans + ")$", "i"),
            // For use in libraries implementing .is()
            // We use this for POS matching in `select`
            "needsContext": new RegExp("^" + whitespace2 + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace2 + "*((?:-\\d)?\\d*)" + whitespace2 + "*\\)|)(?=[^-]|$)", "i")
          }, rhtml2 = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace2 + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape, nonHex) {
            var high = "0x" + escape.slice(1) - 65536;
            return nonHex ? (
              // Strip the backslash prefix from a non-hex escape sequence
              nonHex
            ) : (
              // Replace a hexadecimal escape sequence with the encoded Unicode code point
              // Support: IE <=11+
              // For values outside the Basic Multilingual Plane (BMP), manually construct a
              // surrogate pair
              high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
            );
          }, rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function(ch, asCodePoint) {
            if (asCodePoint) {
              if (ch === "\0") {
                return "\uFFFD";
              }
              return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
            }
            return "\\" + ch;
          }, unloadHandler = function() {
            setDocument2();
          }, inDisabledFieldset = addCombinator(
            function(elem) {
              return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
            },
            { dir: "parentNode", next: "legend" }
          );
          try {
            push2.apply(
              arr2 = slice2.call(preferredDoc.childNodes),
              preferredDoc.childNodes
            );
            arr2[preferredDoc.childNodes.length].nodeType;
          } catch (e) {
            push2 = {
              apply: arr2.length ? (
                // Leverage slice if possible
                function(target, els) {
                  pushNative.apply(target, slice2.call(els));
                }
              ) : (
                // Support: IE<9
                // Otherwise append directly
                function(target, els) {
                  var j = target.length, i3 = 0;
                  while (target[j++] = els[i3++]) {
                  }
                  target.length = j - 1;
                }
              )
            };
          }
          function Sizzle2(selector, context2, results, seed) {
            var m, i3, elem, nid, match2, groups, newSelector, newContext = context2 && context2.ownerDocument, nodeType = context2 ? context2.nodeType : 9;
            results = results || [];
            if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
              return results;
            }
            if (!seed) {
              setDocument2(context2);
              context2 = context2 || document3;
              if (documentIsHTML) {
                if (nodeType !== 11 && (match2 = rquickExpr2.exec(selector))) {
                  if (m = match2[1]) {
                    if (nodeType === 9) {
                      if (elem = context2.getElementById(m)) {
                        if (elem.id === m) {
                          results.push(elem);
                          return results;
                        }
                      } else {
                        return results;
                      }
                    } else {
                      if (newContext && (elem = newContext.getElementById(m)) && contains(context2, elem) && elem.id === m) {
                        results.push(elem);
                        return results;
                      }
                    }
                  } else if (match2[2]) {
                    push2.apply(results, context2.getElementsByTagName(selector));
                    return results;
                  } else if ((m = match2[3]) && support2.getElementsByClassName && context2.getElementsByClassName) {
                    push2.apply(results, context2.getElementsByClassName(m));
                    return results;
                  }
                }
                if (support2.qsa && !nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector)) && // Support: IE 8 only
                // Exclude object elements
                (nodeType !== 1 || context2.nodeName.toLowerCase() !== "object")) {
                  newSelector = selector;
                  newContext = context2;
                  if (nodeType === 1 && (rdescend.test(selector) || rcombinators.test(selector))) {
                    newContext = rsibling.test(selector) && testContext(context2.parentNode) || context2;
                    if (newContext !== context2 || !support2.scope) {
                      if (nid = context2.getAttribute("id")) {
                        nid = nid.replace(rcssescape, fcssescape);
                      } else {
                        context2.setAttribute("id", nid = expando);
                      }
                    }
                    groups = tokenize(selector);
                    i3 = groups.length;
                    while (i3--) {
                      groups[i3] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i3]);
                    }
                    newSelector = groups.join(",");
                  }
                  try {
                    push2.apply(
                      results,
                      newContext.querySelectorAll(newSelector)
                    );
                    return results;
                  } catch (qsaError) {
                    nonnativeSelectorCache(selector, true);
                  } finally {
                    if (nid === expando) {
                      context2.removeAttribute("id");
                    }
                  }
                }
              }
            }
            return select2(selector.replace(rtrim2, "$1"), context2, results, seed);
          }
          function createCache() {
            var keys = [];
            function cache2(key, value) {
              if (keys.push(key + " ") > Expr.cacheLength) {
                delete cache2[keys.shift()];
              }
              return cache2[key + " "] = value;
            }
            return cache2;
          }
          function markFunction(fn) {
            fn[expando] = true;
            return fn;
          }
          function assert2(fn) {
            var el = document3.createElement("fieldset");
            try {
              return !!fn(el);
            } catch (e) {
              return false;
            } finally {
              if (el.parentNode) {
                el.parentNode.removeChild(el);
              }
              el = null;
            }
          }
          function addHandle(attrs, handler) {
            var arr3 = attrs.split("|"), i3 = arr3.length;
            while (i3--) {
              Expr.attrHandle[arr3[i3]] = handler;
            }
          }
          function siblingCheck(a, b) {
            var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex;
            if (diff) {
              return diff;
            }
            if (cur) {
              while (cur = cur.nextSibling) {
                if (cur === b) {
                  return -1;
                }
              }
            }
            return a ? 1 : -1;
          }
          function createInputPseudo(type) {
            return function(elem) {
              var name = elem.nodeName.toLowerCase();
              return name === "input" && elem.type === type;
            };
          }
          function createButtonPseudo(type) {
            return function(elem) {
              var name = elem.nodeName.toLowerCase();
              return (name === "input" || name === "button") && elem.type === type;
            };
          }
          function createDisabledPseudo(disabled) {
            return function(elem) {
              if ("form" in elem) {
                if (elem.parentNode && elem.disabled === false) {
                  if ("label" in elem) {
                    if ("label" in elem.parentNode) {
                      return elem.parentNode.disabled === disabled;
                    } else {
                      return elem.disabled === disabled;
                    }
                  }
                  return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
                  /* jshint -W018 */
                  elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
                }
                return elem.disabled === disabled;
              } else if ("label" in elem) {
                return elem.disabled === disabled;
              }
              return false;
            };
          }
          function createPositionalPseudo(fn) {
            return markFunction(function(argument) {
              argument = +argument;
              return markFunction(function(seed, matches2) {
                var j, matchIndexes = fn([], seed.length, argument), i3 = matchIndexes.length;
                while (i3--) {
                  if (seed[j = matchIndexes[i3]]) {
                    seed[j] = !(matches2[j] = seed[j]);
                  }
                }
              });
            });
          }
          function testContext(context2) {
            return context2 && typeof context2.getElementsByTagName !== "undefined" && context2;
          }
          support2 = Sizzle2.support = {};
          isXML = Sizzle2.isXML = function(elem) {
            var namespace = elem.namespaceURI, docElem2 = (elem.ownerDocument || elem).documentElement;
            return !rhtml2.test(namespace || docElem2 && docElem2.nodeName || "HTML");
          };
          setDocument2 = Sizzle2.setDocument = function(node) {
            var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
            if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
              return document3;
            }
            document3 = doc;
            docElem = document3.documentElement;
            documentIsHTML = !isXML(document3);
            if (preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
              if (subWindow.addEventListener) {
                subWindow.addEventListener("unload", unloadHandler, false);
              } else if (subWindow.attachEvent) {
                subWindow.attachEvent("onunload", unloadHandler);
              }
            }
            support2.scope = assert2(function(el) {
              docElem.appendChild(el).appendChild(document3.createElement("div"));
              return typeof el.querySelectorAll !== "undefined" && !el.querySelectorAll(":scope fieldset div").length;
            });
            support2.attributes = assert2(function(el) {
              el.className = "i";
              return !el.getAttribute("className");
            });
            support2.getElementsByTagName = assert2(function(el) {
              el.appendChild(document3.createComment(""));
              return !el.getElementsByTagName("*").length;
            });
            support2.getElementsByClassName = rnative.test(document3.getElementsByClassName);
            support2.getById = assert2(function(el) {
              docElem.appendChild(el).id = expando;
              return !document3.getElementsByName || !document3.getElementsByName(expando).length;
            });
            if (support2.getById) {
              Expr.filter["ID"] = function(id2) {
                var attrId = id2.replace(runescape, funescape);
                return function(elem) {
                  return elem.getAttribute("id") === attrId;
                };
              };
              Expr.find["ID"] = function(id2, context2) {
                if (typeof context2.getElementById !== "undefined" && documentIsHTML) {
                  var elem = context2.getElementById(id2);
                  return elem ? [elem] : [];
                }
              };
            } else {
              Expr.filter["ID"] = function(id2) {
                var attrId = id2.replace(runescape, funescape);
                return function(elem) {
                  var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
                  return node2 && node2.value === attrId;
                };
              };
              Expr.find["ID"] = function(id2, context2) {
                if (typeof context2.getElementById !== "undefined" && documentIsHTML) {
                  var node2, i3, elems, elem = context2.getElementById(id2);
                  if (elem) {
                    node2 = elem.getAttributeNode("id");
                    if (node2 && node2.value === id2) {
                      return [elem];
                    }
                    elems = context2.getElementsByName(id2);
                    i3 = 0;
                    while (elem = elems[i3++]) {
                      node2 = elem.getAttributeNode("id");
                      if (node2 && node2.value === id2) {
                        return [elem];
                      }
                    }
                  }
                  return [];
                }
              };
            }
            Expr.find["TAG"] = support2.getElementsByTagName ? function(tag, context2) {
              if (typeof context2.getElementsByTagName !== "undefined") {
                return context2.getElementsByTagName(tag);
              } else if (support2.qsa) {
                return context2.querySelectorAll(tag);
              }
            } : function(tag, context2) {
              var elem, tmp = [], i3 = 0, results = context2.getElementsByTagName(tag);
              if (tag === "*") {
                while (elem = results[i3++]) {
                  if (elem.nodeType === 1) {
                    tmp.push(elem);
                  }
                }
                return tmp;
              }
              return results;
            };
            Expr.find["CLASS"] = support2.getElementsByClassName && function(className, context2) {
              if (typeof context2.getElementsByClassName !== "undefined" && documentIsHTML) {
                return context2.getElementsByClassName(className);
              }
            };
            rbuggyMatches = [];
            rbuggyQSA = [];
            if (support2.qsa = rnative.test(document3.querySelectorAll)) {
              assert2(function(el) {
                var input2;
                docElem.appendChild(el).innerHTML = "<a id='" + expando + "'></a><select id='" + expando + "-\r\\' msallowcapture=''><option selected=''></option></select>";
                if (el.querySelectorAll("[msallowcapture^='']").length) {
                  rbuggyQSA.push("[*^$]=" + whitespace2 + `*(?:''|"")`);
                }
                if (!el.querySelectorAll("[selected]").length) {
                  rbuggyQSA.push("\\[" + whitespace2 + "*(?:value|" + booleans + ")");
                }
                if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
                  rbuggyQSA.push("~=");
                }
                input2 = document3.createElement("input");
                input2.setAttribute("name", "");
                el.appendChild(input2);
                if (!el.querySelectorAll("[name='']").length) {
                  rbuggyQSA.push("\\[" + whitespace2 + "*name" + whitespace2 + "*=" + whitespace2 + `*(?:''|"")`);
                }
                if (!el.querySelectorAll(":checked").length) {
                  rbuggyQSA.push(":checked");
                }
                if (!el.querySelectorAll("a#" + expando + "+*").length) {
                  rbuggyQSA.push(".#.+[+~]");
                }
                el.querySelectorAll("\\\f");
                rbuggyQSA.push("[\\r\\n\\f]");
              });
              assert2(function(el) {
                el.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";
                var input2 = document3.createElement("input");
                input2.setAttribute("type", "hidden");
                el.appendChild(input2).setAttribute("name", "D");
                if (el.querySelectorAll("[name=d]").length) {
                  rbuggyQSA.push("name" + whitespace2 + "*[*^$|!~]?=");
                }
                if (el.querySelectorAll(":enabled").length !== 2) {
                  rbuggyQSA.push(":enabled", ":disabled");
                }
                docElem.appendChild(el).disabled = true;
                if (el.querySelectorAll(":disabled").length !== 2) {
                  rbuggyQSA.push(":enabled", ":disabled");
                }
                el.querySelectorAll("*,:x");
                rbuggyQSA.push(",.*:");
              });
            }
            if (support2.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) {
              assert2(function(el) {
                support2.disconnectedMatch = matches.call(el, "*");
                matches.call(el, "[s!='']:x");
                rbuggyMatches.push("!=", pseudos);
              });
            }
            rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
            rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
            hasCompare = rnative.test(docElem.compareDocumentPosition);
            contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) {
              var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
              return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
            } : function(a, b) {
              if (b) {
                while (b = b.parentNode) {
                  if (b === a) {
                    return true;
                  }
                }
              }
              return false;
            };
            sortOrder = hasCompare ? function(a, b) {
              if (a === b) {
                hasDuplicate = true;
                return 0;
              }
              var compare3 = !a.compareDocumentPosition - !b.compareDocumentPosition;
              if (compare3) {
                return compare3;
              }
              compare3 = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
                // Otherwise we know they are disconnected
                1
              );
              if (compare3 & 1 || !support2.sortDetached && b.compareDocumentPosition(a) === compare3) {
                if (a == document3 || a.ownerDocument == preferredDoc && contains(preferredDoc, a)) {
                  return -1;
                }
                if (b == document3 || b.ownerDocument == preferredDoc && contains(preferredDoc, b)) {
                  return 1;
                }
                return sortInput ? indexOf3(sortInput, a) - indexOf3(sortInput, b) : 0;
              }
              return compare3 & 4 ? -1 : 1;
            } : function(a, b) {
              if (a === b) {
                hasDuplicate = true;
                return 0;
              }
              var cur, i3 = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
              if (!aup || !bup) {
                return a == document3 ? -1 : b == document3 ? 1 : (
                  /* eslint-enable eqeqeq */
                  aup ? -1 : bup ? 1 : sortInput ? indexOf3(sortInput, a) - indexOf3(sortInput, b) : 0
                );
              } else if (aup === bup) {
                return siblingCheck(a, b);
              }
              cur = a;
              while (cur = cur.parentNode) {
                ap.unshift(cur);
              }
              cur = b;
              while (cur = cur.parentNode) {
                bp.unshift(cur);
              }
              while (ap[i3] === bp[i3]) {
                i3++;
              }
              return i3 ? (
                // Do a sibling check if the nodes have a common ancestor
                siblingCheck(ap[i3], bp[i3])
              ) : (
                // Otherwise nodes in our document sort first
                // Support: IE 11+, Edge 17 - 18+
                // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
                // two documents; shallow comparisons work.
                /* eslint-disable eqeqeq */
                ap[i3] == preferredDoc ? -1 : bp[i3] == preferredDoc ? 1 : (
                  /* eslint-enable eqeqeq */
                  0
                )
              );
            };
            return document3;
          };
          Sizzle2.matches = function(expr, elements) {
            return Sizzle2(expr, null, null, elements);
          };
          Sizzle2.matchesSelector = function(elem, expr) {
            setDocument2(elem);
            if (support2.matchesSelector && documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
              try {
                var ret = matches.call(elem, expr);
                if (ret || support2.disconnectedMatch || // As well, disconnected nodes are said to be in a document
                // fragment in IE 9
                elem.document && elem.document.nodeType !== 11) {
                  return ret;
                }
              } catch (e) {
                nonnativeSelectorCache(expr, true);
              }
            }
            return Sizzle2(expr, document3, null, [elem]).length > 0;
          };
          Sizzle2.contains = function(context2, elem) {
            if ((context2.ownerDocument || context2) != document3) {
              setDocument2(context2);
            }
            return contains(context2, elem);
          };
          Sizzle2.attr = function(elem, name) {
            if ((elem.ownerDocument || elem) != document3) {
              setDocument2(elem);
            }
            var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn2.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
            return val !== void 0 ? val : support2.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
          };
          Sizzle2.escape = function(sel) {
            return (sel + "").replace(rcssescape, fcssescape);
          };
          Sizzle2.error = function(msg) {
            throw new Error("Syntax error, unrecognized expression: " + msg);
          };
          Sizzle2.uniqueSort = function(results) {
            var elem, duplicates = [], j = 0, i3 = 0;
            hasDuplicate = !support2.detectDuplicates;
            sortInput = !support2.sortStable && results.slice(0);
            results.sort(sortOrder);
            if (hasDuplicate) {
              while (elem = results[i3++]) {
                if (elem === results[i3]) {
                  j = duplicates.push(i3);
                }
              }
              while (j--) {
                results.splice(duplicates[j], 1);
              }
            }
            sortInput = null;
            return results;
          };
          getText = Sizzle2.getText = function(elem) {
            var node, ret = "", i3 = 0, nodeType = elem.nodeType;
            if (!nodeType) {
              while (node = elem[i3++]) {
                ret += getText(node);
              }
            } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
              if (typeof elem.textContent === "string") {
                return elem.textContent;
              } else {
                for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
                  ret += getText(elem);
                }
              }
            } else if (nodeType === 3 || nodeType === 4) {
              return elem.nodeValue;
            }
            return ret;
          };
          Expr = Sizzle2.selectors = {
            // Can be adjusted by the user
            cacheLength: 50,
            createPseudo: markFunction,
            match: matchExpr,
            attrHandle: {},
            find: {},
            relative: {
              ">": { dir: "parentNode", first: true },
              " ": { dir: "parentNode" },
              "+": { dir: "previousSibling", first: true },
              "~": { dir: "previousSibling" }
            },
            preFilter: {
              "ATTR": function(match2) {
                match2[1] = match2[1].replace(runescape, funescape);
                match2[3] = (match2[3] || match2[4] || match2[5] || "").replace(runescape, funescape);
                if (match2[2] === "~=") {
                  match2[3] = " " + match2[3] + " ";
                }
                return match2.slice(0, 4);
              },
              "CHILD": function(match2) {
                match2[1] = match2[1].toLowerCase();
                if (match2[1].slice(0, 3) === "nth") {
                  if (!match2[3]) {
                    Sizzle2.error(match2[0]);
                  }
                  match2[4] = +(match2[4] ? match2[5] + (match2[6] || 1) : 2 * (match2[3] === "even" || match2[3] === "odd"));
                  match2[5] = +(match2[7] + match2[8] || match2[3] === "odd");
                } else if (match2[3]) {
                  Sizzle2.error(match2[0]);
                }
                return match2;
              },
              "PSEUDO": function(match2) {
                var excess, unquoted = !match2[6] && match2[2];
                if (matchExpr["CHILD"].test(match2[0])) {
                  return null;
                }
                if (match2[3]) {
                  match2[2] = match2[4] || match2[5] || "";
                } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
                (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
                (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
                  match2[0] = match2[0].slice(0, excess);
                  match2[2] = unquoted.slice(0, excess);
                }
                return match2.slice(0, 3);
              }
            },
            filter: {
              "TAG": function(nodeNameSelector) {
                var nodeName2 = nodeNameSelector.replace(runescape, funescape).toLowerCase();
                return nodeNameSelector === "*" ? function() {
                  return true;
                } : function(elem) {
                  return elem.nodeName && elem.nodeName.toLowerCase() === nodeName2;
                };
              },
              "CLASS": function(className) {
                var pattern = classCache[className + " "];
                return pattern || (pattern = new RegExp("(^|" + whitespace2 + ")" + className + "(" + whitespace2 + "|$)")) && classCache(
                  className,
                  function(elem) {
                    return pattern.test(
                      typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
                    );
                  }
                );
              },
              "ATTR": function(name, operator, check) {
                return function(elem) {
                  var result = Sizzle2.attr(elem, name);
                  if (result == null) {
                    return operator === "!=";
                  }
                  if (!operator) {
                    return true;
                  }
                  result += "";
                  return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false;
                };
              },
              "CHILD": function(type, what, _argument, first2, last2) {
                var simple = type.slice(0, 3) !== "nth", forward30 = type.slice(-4) !== "last", ofType = what === "of-type";
                return first2 === 1 && last2 === 0 ? (
                  // Shortcut for :nth-*(n)
                  function(elem) {
                    return !!elem.parentNode;
                  }
                ) : function(elem, _context, xml) {
                  var cache2, uniqueCache, outerCache, node, nodeIndex, start2, dir2 = simple !== forward30 ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
                  if (parent) {
                    if (simple) {
                      while (dir2) {
                        node = elem;
                        while (node = node[dir2]) {
                          if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
                            return false;
                          }
                        }
                        start2 = dir2 = type === "only" && !start2 && "nextSibling";
                      }
                      return true;
                    }
                    start2 = [forward30 ? parent.firstChild : parent.lastChild];
                    if (forward30 && useCache) {
                      node = parent;
                      outerCache = node[expando] || (node[expando] = {});
                      uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
                      cache2 = uniqueCache[type] || [];
                      nodeIndex = cache2[0] === dirruns && cache2[1];
                      diff = nodeIndex && cache2[2];
                      node = nodeIndex && parent.childNodes[nodeIndex];
                      while (node = ++nodeIndex && node && node[dir2] || // Fallback to seeking `elem` from the start
                      (diff = nodeIndex = 0) || start2.pop()) {
                        if (node.nodeType === 1 && ++diff && node === elem) {
                          uniqueCache[type] = [dirruns, nodeIndex, diff];
                          break;
                        }
                      }
                    } else {
                      if (useCache) {
                        node = elem;
                        outerCache = node[expando] || (node[expando] = {});
                        uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
                        cache2 = uniqueCache[type] || [];
                        nodeIndex = cache2[0] === dirruns && cache2[1];
                        diff = nodeIndex;
                      }
                      if (diff === false) {
                        while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
                          if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
                            if (useCache) {
                              outerCache = node[expando] || (node[expando] = {});
                              uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {});
                              uniqueCache[type] = [dirruns, diff];
                            }
                            if (node === elem) {
                              break;
                            }
                          }
                        }
                      }
                    }
                    diff -= last2;
                    return diff === first2 || diff % first2 === 0 && diff / first2 >= 0;
                  }
                };
              },
              "PSEUDO": function(pseudo, argument) {
                var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle2.error("unsupported pseudo: " + pseudo);
                if (fn[expando]) {
                  return fn(argument);
                }
                if (fn.length > 1) {
                  args = [pseudo, pseudo, "", argument];
                  return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
                    var idx, matched = fn(seed, argument), i3 = matched.length;
                    while (i3--) {
                      idx = indexOf3(seed, matched[i3]);
                      seed[idx] = !(matches2[idx] = matched[i3]);
                    }
                  }) : function(elem) {
                    return fn(elem, 0, args);
                  };
                }
                return fn;
              }
            },
            pseudos: {
              // Potentially complex pseudos
              "not": markFunction(function(selector) {
                var input2 = [], results = [], matcher = compile4(selector.replace(rtrim2, "$1"));
                return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
                  var elem, unmatched = matcher(seed, null, xml, []), i3 = seed.length;
                  while (i3--) {
                    if (elem = unmatched[i3]) {
                      seed[i3] = !(matches2[i3] = elem);
                    }
                  }
                }) : function(elem, _context, xml) {
                  input2[0] = elem;
                  matcher(input2, null, xml, results);
                  input2[0] = null;
                  return !results.pop();
                };
              }),
              "has": markFunction(function(selector) {
                return function(elem) {
                  return Sizzle2(selector, elem).length > 0;
                };
              }),
              "contains": markFunction(function(text) {
                text = text.replace(runescape, funescape);
                return function(elem) {
                  return (elem.textContent || getText(elem)).indexOf(text) > -1;
                };
              }),
              // "Whether an element is represented by a :lang() selector
              // is based solely on the element's language value
              // being equal to the identifier C,
              // or beginning with the identifier C immediately followed by "-".
              // The matching of C against the element's language value is performed case-insensitively.
              // The identifier C does not have to be a valid language name."
              // http://www.w3.org/TR/selectors/#lang-pseudo
              "lang": markFunction(function(lang) {
                if (!ridentifier.test(lang || "")) {
                  Sizzle2.error("unsupported lang: " + lang);
                }
                lang = lang.replace(runescape, funescape).toLowerCase();
                return function(elem) {
                  var elemLang;
                  do {
                    if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
                      elemLang = elemLang.toLowerCase();
                      return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
                    }
                  } while ((elem = elem.parentNode) && elem.nodeType === 1);
                  return false;
                };
              }),
              // Miscellaneous
              "target": function(elem) {
                var hash2 = window3.location && window3.location.hash;
                return hash2 && hash2.slice(1) === elem.id;
              },
              "root": function(elem) {
                return elem === docElem;
              },
              "focus": function(elem) {
                return elem === document3.activeElement && (!document3.hasFocus || document3.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
              },
              // Boolean properties
              "enabled": createDisabledPseudo(false),
              "disabled": createDisabledPseudo(true),
              "checked": function(elem) {
                var nodeName2 = elem.nodeName.toLowerCase();
                return nodeName2 === "input" && !!elem.checked || nodeName2 === "option" && !!elem.selected;
              },
              "selected": function(elem) {
                if (elem.parentNode) {
                  elem.parentNode.selectedIndex;
                }
                return elem.selected === true;
              },
              // Contents
              "empty": function(elem) {
                for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
                  if (elem.nodeType < 6) {
                    return false;
                  }
                }
                return true;
              },
              "parent": function(elem) {
                return !Expr.pseudos["empty"](elem);
              },
              // Element/input types
              "header": function(elem) {
                return rheader.test(elem.nodeName);
              },
              "input": function(elem) {
                return rinputs.test(elem.nodeName);
              },
              "button": function(elem) {
                var name = elem.nodeName.toLowerCase();
                return name === "input" && elem.type === "button" || name === "button";
              },
              "text": function(elem) {
                var attr;
                return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8
                // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
                ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
              },
              // Position-in-collection
              "first": createPositionalPseudo(function() {
                return [0];
              }),
              "last": createPositionalPseudo(function(_matchIndexes, length) {
                return [length - 1];
              }),
              "eq": createPositionalPseudo(function(_matchIndexes, length, argument) {
                return [argument < 0 ? argument + length : argument];
              }),
              "even": createPositionalPseudo(function(matchIndexes, length) {
                var i3 = 0;
                for (; i3 < length; i3 += 2) {
                  matchIndexes.push(i3);
                }
                return matchIndexes;
              }),
              "odd": createPositionalPseudo(function(matchIndexes, length) {
                var i3 = 1;
                for (; i3 < length; i3 += 2) {
                  matchIndexes.push(i3);
                }
                return matchIndexes;
              }),
              "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
                var i3 = argument < 0 ? argument + length : argument > length ? length : argument;
                for (; --i3 >= 0; ) {
                  matchIndexes.push(i3);
                }
                return matchIndexes;
              }),
              "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
                var i3 = argument < 0 ? argument + length : argument;
                for (; ++i3 < length; ) {
                  matchIndexes.push(i3);
                }
                return matchIndexes;
              })
            }
          };
          Expr.pseudos["nth"] = Expr.pseudos["eq"];
          for (i2 in { radio: true, checkbox: true, file: true, password: true, image: true }) {
            Expr.pseudos[i2] = createInputPseudo(i2);
          }
          for (i2 in { submit: true, reset: true }) {
            Expr.pseudos[i2] = createButtonPseudo(i2);
          }
          function setFilters() {
          }
          setFilters.prototype = Expr.filters = Expr.pseudos;
          Expr.setFilters = new setFilters();
          tokenize = Sizzle2.tokenize = function(selector, parseOnly) {
            var matched, match2, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
            if (cached) {
              return parseOnly ? 0 : cached.slice(0);
            }
            soFar = selector;
            groups = [];
            preFilters = Expr.preFilter;
            while (soFar) {
              if (!matched || (match2 = rcomma.exec(soFar))) {
                if (match2) {
                  soFar = soFar.slice(match2[0].length) || soFar;
                }
                groups.push(tokens = []);
              }
              matched = false;
              if (match2 = rcombinators.exec(soFar)) {
                matched = match2.shift();
                tokens.push({
                  value: matched,
                  // Cast descendant combinators to space
                  type: match2[0].replace(rtrim2, " ")
                });
                soFar = soFar.slice(matched.length);
              }
              for (type in Expr.filter) {
                if ((match2 = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match2 = preFilters[type](match2)))) {
                  matched = match2.shift();
                  tokens.push({
                    value: matched,
                    type,
                    matches: match2
                  });
                  soFar = soFar.slice(matched.length);
                }
              }
              if (!matched) {
                break;
              }
            }
            return parseOnly ? soFar.length : soFar ? Sizzle2.error(selector) : (
              // Cache the tokens
              tokenCache(selector, groups).slice(0)
            );
          };
          function toSelector(tokens) {
            var i3 = 0, len = tokens.length, selector = "";
            for (; i3 < len; i3++) {
              selector += tokens[i3].value;
            }
            return selector;
          }
          function addCombinator(matcher, combinator, base) {
            var dir2 = combinator.dir, skip2 = combinator.next, key = skip2 || dir2, checkNonElements = base && key === "parentNode", doneName = done++;
            return combinator.first ? (
              // Check against closest ancestor/preceding element
              function(elem, context2, xml) {
                while (elem = elem[dir2]) {
                  if (elem.nodeType === 1 || checkNonElements) {
                    return matcher(elem, context2, xml);
                  }
                }
                return false;
              }
            ) : (
              // Check against all ancestor/preceding elements
              function(elem, context2, xml) {
                var oldCache, uniqueCache, outerCache, newCache = [dirruns, doneName];
                if (xml) {
                  while (elem = elem[dir2]) {
                    if (elem.nodeType === 1 || checkNonElements) {
                      if (matcher(elem, context2, xml)) {
                        return true;
                      }
                    }
                  }
                } else {
                  while (elem = elem[dir2]) {
                    if (elem.nodeType === 1 || checkNonElements) {
                      outerCache = elem[expando] || (elem[expando] = {});
                      uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {});
                      if (skip2 && skip2 === elem.nodeName.toLowerCase()) {
                        elem = elem[dir2] || elem;
                      } else if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
                        return newCache[2] = oldCache[2];
                      } else {
                        uniqueCache[key] = newCache;
                        if (newCache[2] = matcher(elem, context2, xml)) {
                          return true;
                        }
                      }
                    }
                  }
                }
                return false;
              }
            );
          }
          function elementMatcher(matchers) {
            return matchers.length > 1 ? function(elem, context2, xml) {
              var i3 = matchers.length;
              while (i3--) {
                if (!matchers[i3](elem, context2, xml)) {
                  return false;
                }
              }
              return true;
            } : matchers[0];
          }
          function multipleContexts(selector, contexts, results) {
            var i3 = 0, len = contexts.length;
            for (; i3 < len; i3++) {
              Sizzle2(selector, contexts[i3], results);
            }
            return results;
          }
          function condense(unmatched, map2, filter2, context2, xml) {
            var elem, newUnmatched = [], i3 = 0, len = unmatched.length, mapped = map2 != null;
            for (; i3 < len; i3++) {
              if (elem = unmatched[i3]) {
                if (!filter2 || filter2(elem, context2, xml)) {
                  newUnmatched.push(elem);
                  if (mapped) {
                    map2.push(i3);
                  }
                }
              }
            }
            return newUnmatched;
          }
          function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
            if (postFilter && !postFilter[expando]) {
              postFilter = setMatcher(postFilter);
            }
            if (postFinder && !postFinder[expando]) {
              postFinder = setMatcher(postFinder, postSelector);
            }
            return markFunction(function(seed, results, context2, xml) {
              var temp, i3, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
                selector || "*",
                context2.nodeType ? [context2] : context2,
                []
              ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context2, xml) : elems, matcherOut = matcher ? (
                // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
                postFinder || (seed ? preFilter : preexisting || postFilter) ? (
                  // ...intermediate processing is necessary
                  []
                ) : (
                  // ...otherwise use results directly
                  results
                )
              ) : matcherIn;
              if (matcher) {
                matcher(matcherIn, matcherOut, context2, xml);
              }
              if (postFilter) {
                temp = condense(matcherOut, postMap);
                postFilter(temp, [], context2, xml);
                i3 = temp.length;
                while (i3--) {
                  if (elem = temp[i3]) {
                    matcherOut[postMap[i3]] = !(matcherIn[postMap[i3]] = elem);
                  }
                }
              }
              if (seed) {
                if (postFinder || preFilter) {
                  if (postFinder) {
                    temp = [];
                    i3 = matcherOut.length;
                    while (i3--) {
                      if (elem = matcherOut[i3]) {
                        temp.push(matcherIn[i3] = elem);
                      }
                    }
                    postFinder(null, matcherOut = [], temp, xml);
                  }
                  i3 = matcherOut.length;
                  while (i3--) {
                    if ((elem = matcherOut[i3]) && (temp = postFinder ? indexOf3(seed, elem) : preMap[i3]) > -1) {
                      seed[temp] = !(results[temp] = elem);
                    }
                  }
                }
              } else {
                matcherOut = condense(
                  matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
                );
                if (postFinder) {
                  postFinder(null, results, matcherOut, xml);
                } else {
                  push2.apply(results, matcherOut);
                }
              }
            });
          }
          function matcherFromTokens(tokens) {
            var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i3 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
              return elem === checkContext;
            }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
              return indexOf3(checkContext, elem) > -1;
            }, implicitRelative, true), matchers = [function(elem, context2, xml) {
              var ret = !leadingRelative && (xml || context2 !== outermostContext) || ((checkContext = context2).nodeType ? matchContext(elem, context2, xml) : matchAnyContext(elem, context2, xml));
              checkContext = null;
              return ret;
            }];
            for (; i3 < len; i3++) {
              if (matcher = Expr.relative[tokens[i3].type]) {
                matchers = [addCombinator(elementMatcher(matchers), matcher)];
              } else {
                matcher = Expr.filter[tokens[i3].type].apply(null, tokens[i3].matches);
                if (matcher[expando]) {
                  j = ++i3;
                  for (; j < len; j++) {
                    if (Expr.relative[tokens[j].type]) {
                      break;
                    }
                  }
                  return setMatcher(
                    i3 > 1 && elementMatcher(matchers),
                    i3 > 1 && toSelector(
                      // If the preceding token was a descendant combinator, insert an implicit any-element `*`
                      tokens.slice(0, i3 - 1).concat({ value: tokens[i3 - 2].type === " " ? "*" : "" })
                    ).replace(rtrim2, "$1"),
                    matcher,
                    i3 < j && matcherFromTokens(tokens.slice(i3, j)),
                    j < len && matcherFromTokens(tokens = tokens.slice(j)),
                    j < len && toSelector(tokens)
                  );
                }
                matchers.push(matcher);
              }
            }
            return elementMatcher(matchers);
          }
          function matcherFromGroupMatchers(elementMatchers, setMatchers) {
            var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context2, xml, results, outermost) {
              var elem, j, matcher, matchedCount = 0, i3 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find["TAG"]("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
              if (outermost) {
                outermostContext = context2 == document3 || context2 || outermost;
              }
              for (; i3 !== len && (elem = elems[i3]) != null; i3++) {
                if (byElement && elem) {
                  j = 0;
                  if (!context2 && elem.ownerDocument != document3) {
                    setDocument2(elem);
                    xml = !documentIsHTML;
                  }
                  while (matcher = elementMatchers[j++]) {
                    if (matcher(elem, context2 || document3, xml)) {
                      results.push(elem);
                      break;
                    }
                  }
                  if (outermost) {
                    dirruns = dirrunsUnique;
                  }
                }
                if (bySet) {
                  if (elem = !matcher && elem) {
                    matchedCount--;
                  }
                  if (seed) {
                    unmatched.push(elem);
                  }
                }
              }
              matchedCount += i3;
              if (bySet && i3 !== matchedCount) {
                j = 0;
                while (matcher = setMatchers[j++]) {
                  matcher(unmatched, setMatched, context2, xml);
                }
                if (seed) {
                  if (matchedCount > 0) {
                    while (i3--) {
                      if (!(unmatched[i3] || setMatched[i3])) {
                        setMatched[i3] = pop.call(results);
                      }
                    }
                  }
                  setMatched = condense(setMatched);
                }
                push2.apply(results, setMatched);
                if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
                  Sizzle2.uniqueSort(results);
                }
              }
              if (outermost) {
                dirruns = dirrunsUnique;
                outermostContext = contextBackup;
              }
              return unmatched;
            };
            return bySet ? markFunction(superMatcher) : superMatcher;
          }
          compile4 = Sizzle2.compile = function(selector, match2) {
            var i3, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
            if (!cached) {
              if (!match2) {
                match2 = tokenize(selector);
              }
              i3 = match2.length;
              while (i3--) {
                cached = matcherFromTokens(match2[i3]);
                if (cached[expando]) {
                  setMatchers.push(cached);
                } else {
                  elementMatchers.push(cached);
                }
              }
              cached = compilerCache(
                selector,
                matcherFromGroupMatchers(elementMatchers, setMatchers)
              );
              cached.selector = selector;
            }
            return cached;
          };
          select2 = Sizzle2.select = function(selector, context2, results, seed) {
            var i3, tokens, token, type, find3, compiled = typeof selector === "function" && selector, match2 = !seed && tokenize(selector = compiled.selector || selector);
            results = results || [];
            if (match2.length === 1) {
              tokens = match2[0] = match2[0].slice(0);
              if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context2.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
                context2 = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context2) || [])[0];
                if (!context2) {
                  return results;
                } else if (compiled) {
                  context2 = context2.parentNode;
                }
                selector = selector.slice(tokens.shift().value.length);
              }
              i3 = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
              while (i3--) {
                token = tokens[i3];
                if (Expr.relative[type = token.type]) {
                  break;
                }
                if (find3 = Expr.find[type]) {
                  if (seed = find3(
                    token.matches[0].replace(runescape, funescape),
                    rsibling.test(tokens[0].type) && testContext(context2.parentNode) || context2
                  )) {
                    tokens.splice(i3, 1);
                    selector = seed.length && toSelector(tokens);
                    if (!selector) {
                      push2.apply(results, seed);
                      return results;
                    }
                    break;
                  }
                }
              }
            }
            (compiled || compile4(selector, match2))(
              seed,
              context2,
              !documentIsHTML,
              results,
              !context2 || rsibling.test(selector) && testContext(context2.parentNode) || context2
            );
            return results;
          };
          support2.sortStable = expando.split("").sort(sortOrder).join("") === expando;
          support2.detectDuplicates = !!hasDuplicate;
          setDocument2();
          support2.sortDetached = assert2(function(el) {
            return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
          });
          if (!assert2(function(el) {
            el.innerHTML = "<a href='#'></a>";
            return el.firstChild.getAttribute("href") === "#";
          })) {
            addHandle("type|href|height|width", function(elem, name, isXML2) {
              if (!isXML2) {
                return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
              }
            });
          }
          if (!support2.attributes || !assert2(function(el) {
            el.innerHTML = "<input/>";
            el.firstChild.setAttribute("value", "");
            return el.firstChild.getAttribute("value") === "";
          })) {
            addHandle("value", function(elem, _name, isXML2) {
              if (!isXML2 && elem.nodeName.toLowerCase() === "input") {
                return elem.defaultValue;
              }
            });
          }
          if (!assert2(function(el) {
            return el.getAttribute("disabled") == null;
          })) {
            addHandle(booleans, function(elem, name, isXML2) {
              var val;
              if (!isXML2) {
                return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
              }
            });
          }
          return Sizzle2;
        }(window2)
      );
      jQuery.find = Sizzle;
      jQuery.expr = Sizzle.selectors;
      jQuery.expr[":"] = jQuery.expr.pseudos;
      jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
      jQuery.text = Sizzle.getText;
      jQuery.isXMLDoc = Sizzle.isXML;
      jQuery.contains = Sizzle.contains;
      jQuery.escapeSelector = Sizzle.escape;
      var dir = function(elem, dir2, until) {
        var matched = [], truncate = until !== void 0;
        while ((elem = elem[dir2]) && elem.nodeType !== 9) {
          if (elem.nodeType === 1) {
            if (truncate && jQuery(elem).is(until)) {
              break;
            }
            matched.push(elem);
          }
        }
        return matched;
      };
      var siblings = function(n, elem) {
        var matched = [];
        for (; n; n = n.nextSibling) {
          if (n.nodeType === 1 && n !== elem) {
            matched.push(n);
          }
        }
        return matched;
      };
      var rneedsContext = jQuery.expr.match.needsContext;
      function nodeName(elem, name) {
        return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
      }
      ;
      var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
      function winnow(elements, qualifier, not) {
        if (isFunction5(qualifier)) {
          return jQuery.grep(elements, function(elem, i2) {
            return !!qualifier.call(elem, i2, elem) !== not;
          });
        }
        if (qualifier.nodeType) {
          return jQuery.grep(elements, function(elem) {
            return elem === qualifier !== not;
          });
        }
        if (typeof qualifier !== "string") {
          return jQuery.grep(elements, function(elem) {
            return indexOf2.call(qualifier, elem) > -1 !== not;
          });
        }
        return jQuery.filter(qualifier, elements, not);
      }
      jQuery.filter = function(expr, elems, not) {
        var elem = elems[0];
        if (not) {
          expr = ":not(" + expr + ")";
        }
        if (elems.length === 1 && elem.nodeType === 1) {
          return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
        }
        return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
          return elem2.nodeType === 1;
        }));
      };
      jQuery.fn.extend({
        find: function(selector) {
          var i2, ret, len = this.length, self2 = this;
          if (typeof selector !== "string") {
            return this.pushStack(jQuery(selector).filter(function() {
              for (i2 = 0; i2 < len; i2++) {
                if (jQuery.contains(self2[i2], this)) {
                  return true;
                }
              }
            }));
          }
          ret = this.pushStack([]);
          for (i2 = 0; i2 < len; i2++) {
            jQuery.find(selector, self2[i2], ret);
          }
          return len > 1 ? jQuery.uniqueSort(ret) : ret;
        },
        filter: function(selector) {
          return this.pushStack(winnow(this, selector || [], false));
        },
        not: function(selector) {
          return this.pushStack(winnow(this, selector || [], true));
        },
        is: function(selector) {
          return !!winnow(
            this,
            // If this is a positional/relative selector, check membership in the returned set
            // so $("p:first").is("p:last") won't return true for a doc with two "p".
            typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
            false
          ).length;
        }
      });
      var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init31 = jQuery.fn.init = function(selector, context2, root) {
        var match2, elem;
        if (!selector) {
          return this;
        }
        root = root || rootjQuery;
        if (typeof selector === "string") {
          if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
            match2 = [null, selector, null];
          } else {
            match2 = rquickExpr.exec(selector);
          }
          if (match2 && (match2[1] || !context2)) {
            if (match2[1]) {
              context2 = context2 instanceof jQuery ? context2[0] : context2;
              jQuery.merge(this, jQuery.parseHTML(
                match2[1],
                context2 && context2.nodeType ? context2.ownerDocument || context2 : document2,
                true
              ));
              if (rsingleTag.test(match2[1]) && jQuery.isPlainObject(context2)) {
                for (match2 in context2) {
                  if (isFunction5(this[match2])) {
                    this[match2](context2[match2]);
                  } else {
                    this.attr(match2, context2[match2]);
                  }
                }
              }
              return this;
            } else {
              elem = document2.getElementById(match2[2]);
              if (elem) {
                this[0] = elem;
                this.length = 1;
              }
              return this;
            }
          } else if (!context2 || context2.jquery) {
            return (context2 || root).find(selector);
          } else {
            return this.constructor(context2).find(selector);
          }
        } else if (selector.nodeType) {
          this[0] = selector;
          this.length = 1;
          return this;
        } else if (isFunction5(selector)) {
          return root.ready !== void 0 ? root.ready(selector) : (
            // Execute immediately if ready is not present
            selector(jQuery)
          );
        }
        return jQuery.makeArray(selector, this);
      };
      init31.prototype = jQuery.fn;
      rootjQuery = jQuery(document2);
      var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
        children: true,
        contents: true,
        next: true,
        prev: true
      };
      jQuery.fn.extend({
        has: function(target) {
          var targets = jQuery(target, this), l = targets.length;
          return this.filter(function() {
            var i2 = 0;
            for (; i2 < l; i2++) {
              if (jQuery.contains(this, targets[i2])) {
                return true;
              }
            }
          });
        },
        closest: function(selectors, context2) {
          var cur, i2 = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
          if (!rneedsContext.test(selectors)) {
            for (; i2 < l; i2++) {
              for (cur = this[i2]; cur && cur !== context2; cur = cur.parentNode) {
                if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : (
                  // Don't pass non-elements to Sizzle
                  cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)
                ))) {
                  matched.push(cur);
                  break;
                }
              }
            }
          }
          return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
        },
        // Determine the position of an element within the set
        index: function(elem) {
          if (!elem) {
            return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
          }
          if (typeof elem === "string") {
            return indexOf2.call(jQuery(elem), this[0]);
          }
          return indexOf2.call(
            this,
            // If it receives a jQuery object, the first element is used
            elem.jquery ? elem[0] : elem
          );
        },
        add: function(selector, context2) {
          return this.pushStack(
            jQuery.uniqueSort(
              jQuery.merge(this.get(), jQuery(selector, context2))
            )
          );
        },
        addBack: function(selector) {
          return this.add(
            selector == null ? this.prevObject : this.prevObject.filter(selector)
          );
        }
      });
      function sibling(cur, dir2) {
        while ((cur = cur[dir2]) && cur.nodeType !== 1) {
        }
        return cur;
      }
      jQuery.each({
        parent: function(elem) {
          var parent = elem.parentNode;
          return parent && parent.nodeType !== 11 ? parent : null;
        },
        parents: function(elem) {
          return dir(elem, "parentNode");
        },
        parentsUntil: function(elem, _i, until) {
          return dir(elem, "parentNode", until);
        },
        next: function(elem) {
          return sibling(elem, "nextSibling");
        },
        prev: function(elem) {
          return sibling(elem, "previousSibling");
        },
        nextAll: function(elem) {
          return dir(elem, "nextSibling");
        },
        prevAll: function(elem) {
          return dir(elem, "previousSibling");
        },
        nextUntil: function(elem, _i, until) {
          return dir(elem, "nextSibling", until);
        },
        prevUntil: function(elem, _i, until) {
          return dir(elem, "previousSibling", until);
        },
        siblings: function(elem) {
          return siblings((elem.parentNode || {}).firstChild, elem);
        },
        children: function(elem) {
          return siblings(elem.firstChild);
        },
        contents: function(elem) {
          if (elem.contentDocument != null && // Support: IE 11+
          // <object> elements with no `data` attribute has an object
          // `contentDocument` with a `null` prototype.
          getProto(elem.contentDocument)) {
            return elem.contentDocument;
          }
          if (nodeName(elem, "template")) {
            elem = elem.content || elem;
          }
          return jQuery.merge([], elem.childNodes);
        }
      }, function(name, fn) {
        jQuery.fn[name] = function(until, selector) {
          var matched = jQuery.map(this, fn, until);
          if (name.slice(-5) !== "Until") {
            selector = until;
          }
          if (selector && typeof selector === "string") {
            matched = jQuery.filter(selector, matched);
          }
          if (this.length > 1) {
            if (!guaranteedUnique[name]) {
              jQuery.uniqueSort(matched);
            }
            if (rparentsprev.test(name)) {
              matched.reverse();
            }
          }
          return this.pushStack(matched);
        };
      });
      var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
      function createOptions(options) {
        var object = {};
        jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) {
          object[flag] = true;
        });
        return object;
      }
      jQuery.Callbacks = function(options) {
        options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
        var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
          locked = locked || options.once;
          fired = firing = true;
          for (; queue.length; firingIndex = -1) {
            memory = queue.shift();
            while (++firingIndex < list.length) {
              if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
                firingIndex = list.length;
                memory = false;
              }
            }
          }
          if (!options.memory) {
            memory = false;
          }
          firing = false;
          if (locked) {
            if (memory) {
              list = [];
            } else {
              list = "";
            }
          }
        }, self2 = {
          // Add a callback or a collection of callbacks to the list
          add: function() {
            if (list) {
              if (memory && !firing) {
                firingIndex = list.length - 1;
                queue.push(memory);
              }
              (function add5(args) {
                jQuery.each(args, function(_, arg) {
                  if (isFunction5(arg)) {
                    if (!options.unique || !self2.has(arg)) {
                      list.push(arg);
                    }
                  } else if (arg && arg.length && toType(arg) !== "string") {
                    add5(arg);
                  }
                });
              })(arguments);
              if (memory && !firing) {
                fire();
              }
            }
            return this;
          },
          // Remove a callback from the list
          remove: function() {
            jQuery.each(arguments, function(_, arg) {
              var index;
              while ((index = jQuery.inArray(arg, list, index)) > -1) {
                list.splice(index, 1);
                if (index <= firingIndex) {
                  firingIndex--;
                }
              }
            });
            return this;
          },
          // Check if a given callback is in the list.
          // If no argument is given, return whether or not list has callbacks attached.
          has: function(fn) {
            return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
          },
          // Remove all callbacks from the list
          empty: function() {
            if (list) {
              list = [];
            }
            return this;
          },
          // Disable .fire and .add
          // Abort any current/pending executions
          // Clear all callbacks and values
          disable: function() {
            locked = queue = [];
            list = memory = "";
            return this;
          },
          disabled: function() {
            return !list;
          },
          // Disable .fire
          // Also disable .add unless we have memory (since it would have no effect)
          // Abort any pending executions
          lock: function() {
            locked = queue = [];
            if (!memory && !firing) {
              list = memory = "";
            }
            return this;
          },
          locked: function() {
            return !!locked;
          },
          // Call all callbacks with the given context and arguments
          fireWith: function(context2, args) {
            if (!locked) {
              args = args || [];
              args = [context2, args.slice ? args.slice() : args];
              queue.push(args);
              if (!firing) {
                fire();
              }
            }
            return this;
          },
          // Call all the callbacks with the given arguments
          fire: function() {
            self2.fireWith(this, arguments);
            return this;
          },
          // To know if the callbacks have already been called at least once
          fired: function() {
            return !!fired;
          }
        };
        return self2;
      };
      function Identity(v) {
        return v;
      }
      function Thrower(ex) {
        throw ex;
      }
      function adoptValue(value, resolve, reject, noValue) {
        var method;
        try {
          if (value && isFunction5(method = value.promise)) {
            method.call(value).done(resolve).fail(reject);
          } else if (value && isFunction5(method = value.then)) {
            method.call(value, resolve, reject);
          } else {
            resolve.apply(void 0, [value].slice(noValue));
          }
        } catch (value2) {
          reject.apply(void 0, [value2]);
        }
      }
      jQuery.extend({
        Deferred: function(func) {
          var tuples = [
            // action, add listener, callbacks,
            // ... .then handlers, argument index, [final state]
            [
              "notify",
              "progress",
              jQuery.Callbacks("memory"),
              jQuery.Callbacks("memory"),
              2
            ],
            [
              "resolve",
              "done",
              jQuery.Callbacks("once memory"),
              jQuery.Callbacks("once memory"),
              0,
              "resolved"
            ],
            [
              "reject",
              "fail",
              jQuery.Callbacks("once memory"),
              jQuery.Callbacks("once memory"),
              1,
              "rejected"
            ]
          ], state2 = "pending", promise = {
            state: function() {
              return state2;
            },
            always: function() {
              deferred.done(arguments).fail(arguments);
              return this;
            },
            "catch": function(fn) {
              return promise.then(null, fn);
            },
            // Keep pipe for back-compat
            pipe: function() {
              var fns = arguments;
              return jQuery.Deferred(function(newDefer) {
                jQuery.each(tuples, function(_i, tuple) {
                  var fn = isFunction5(fns[tuple[4]]) && fns[tuple[4]];
                  deferred[tuple[1]](function() {
                    var returned = fn && fn.apply(this, arguments);
                    if (returned && isFunction5(returned.promise)) {
                      returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
                    } else {
                      newDefer[tuple[0] + "With"](
                        this,
                        fn ? [returned] : arguments
                      );
                    }
                  });
                });
                fns = null;
              }).promise();
            },
            then: function(onFulfilled, onRejected, onProgress) {
              var maxDepth = 0;
              function resolve(depth, deferred2, handler, special) {
                return function() {
                  var that = this, args = arguments, mightThrow = function() {
                    var returned, then;
                    if (depth < maxDepth) {
                      return;
                    }
                    returned = handler.apply(that, args);
                    if (returned === deferred2.promise()) {
                      throw new TypeError("Thenable self-resolution");
                    }
                    then = returned && // Support: Promises/A+ section 2.3.4
                    // https://promisesaplus.com/#point-64
                    // Only check objects and functions for thenability
                    (typeof returned === "object" || typeof returned === "function") && returned.then;
                    if (isFunction5(then)) {
                      if (special) {
                        then.call(
                          returned,
                          resolve(maxDepth, deferred2, Identity, special),
                          resolve(maxDepth, deferred2, Thrower, special)
                        );
                      } else {
                        maxDepth++;
                        then.call(
                          returned,
                          resolve(maxDepth, deferred2, Identity, special),
                          resolve(maxDepth, deferred2, Thrower, special),
                          resolve(
                            maxDepth,
                            deferred2,
                            Identity,
                            deferred2.notifyWith
                          )
                        );
                      }
                    } else {
                      if (handler !== Identity) {
                        that = void 0;
                        args = [returned];
                      }
                      (special || deferred2.resolveWith)(that, args);
                    }
                  }, process3 = special ? mightThrow : function() {
                    try {
                      mightThrow();
                    } catch (e) {
                      if (jQuery.Deferred.exceptionHook) {
                        jQuery.Deferred.exceptionHook(
                          e,
                          process3.stackTrace
                        );
                      }
                      if (depth + 1 >= maxDepth) {
                        if (handler !== Thrower) {
                          that = void 0;
                          args = [e];
                        }
                        deferred2.rejectWith(that, args);
                      }
                    }
                  };
                  if (depth) {
                    process3();
                  } else {
                    if (jQuery.Deferred.getStackHook) {
                      process3.stackTrace = jQuery.Deferred.getStackHook();
                    }
                    window2.setTimeout(process3);
                  }
                };
              }
              return jQuery.Deferred(function(newDefer) {
                tuples[0][3].add(
                  resolve(
                    0,
                    newDefer,
                    isFunction5(onProgress) ? onProgress : Identity,
                    newDefer.notifyWith
                  )
                );
                tuples[1][3].add(
                  resolve(
                    0,
                    newDefer,
                    isFunction5(onFulfilled) ? onFulfilled : Identity
                  )
                );
                tuples[2][3].add(
                  resolve(
                    0,
                    newDefer,
                    isFunction5(onRejected) ? onRejected : Thrower
                  )
                );
              }).promise();
            },
            // Get a promise for this deferred
            // If obj is provided, the promise aspect is added to the object
            promise: function(obj) {
              return obj != null ? jQuery.extend(obj, promise) : promise;
            }
          }, deferred = {};
          jQuery.each(tuples, function(i2, tuple) {
            var list = tuple[2], stateString = tuple[5];
            promise[tuple[1]] = list.add;
            if (stateString) {
              list.add(
                function() {
                  state2 = stateString;
                },
                // rejected_callbacks.disable
                // fulfilled_callbacks.disable
                tuples[3 - i2][2].disable,
                // rejected_handlers.disable
                // fulfilled_handlers.disable
                tuples[3 - i2][3].disable,
                // progress_callbacks.lock
                tuples[0][2].lock,
                // progress_handlers.lock
                tuples[0][3].lock
              );
            }
            list.add(tuple[3].fire);
            deferred[tuple[0]] = function() {
              deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments);
              return this;
            };
            deferred[tuple[0] + "With"] = list.fireWith;
          });
          promise.promise(deferred);
          if (func) {
            func.call(deferred, deferred);
          }
          return deferred;
        },
        // Deferred helper
        when: function(singleValue) {
          var remaining = arguments.length, i2 = remaining, resolveContexts = Array(i2), resolveValues = slice.call(arguments), master = jQuery.Deferred(), updateFunc = function(i3) {
            return function(value) {
              resolveContexts[i3] = this;
              resolveValues[i3] = arguments.length > 1 ? slice.call(arguments) : value;
              if (!--remaining) {
                master.resolveWith(resolveContexts, resolveValues);
              }
            };
          };
          if (remaining <= 1) {
            adoptValue(
              singleValue,
              master.done(updateFunc(i2)).resolve,
              master.reject,
              !remaining
            );
            if (master.state() === "pending" || isFunction5(resolveValues[i2] && resolveValues[i2].then)) {
              return master.then();
            }
          }
          while (i2--) {
            adoptValue(resolveValues[i2], updateFunc(i2), master.reject);
          }
          return master.promise();
        }
      });
      var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
      jQuery.Deferred.exceptionHook = function(error3, stack) {
        if (window2.console && window2.console.warn && error3 && rerrorNames.test(error3.name)) {
          window2.console.warn("jQuery.Deferred exception: " + error3.message, error3.stack, stack);
        }
      };
      jQuery.readyException = function(error3) {
        window2.setTimeout(function() {
          throw error3;
        });
      };
      var readyList = jQuery.Deferred();
      jQuery.fn.ready = function(fn) {
        readyList.then(fn).catch(function(error3) {
          jQuery.readyException(error3);
        });
        return this;
      };
      jQuery.extend({
        // Is the DOM ready to be used? Set to true once it occurs.
        isReady: false,
        // A counter to track how many items to wait for before
        // the ready event fires. See #6781
        readyWait: 1,
        // Handle when the DOM is ready
        ready: function(wait) {
          if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
            return;
          }
          jQuery.isReady = true;
          if (wait !== true && --jQuery.readyWait > 0) {
            return;
          }
          readyList.resolveWith(document2, [jQuery]);
        }
      });
      jQuery.ready.then = readyList.then;
      function completed() {
        document2.removeEventListener("DOMContentLoaded", completed);
        window2.removeEventListener("load", completed);
        jQuery.ready();
      }
      if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
        window2.setTimeout(jQuery.ready);
      } else {
        document2.addEventListener("DOMContentLoaded", completed);
        window2.addEventListener("load", completed);
      }
      var access = function(elems, fn, key, value, chainable, emptyGet, raw) {
        var i2 = 0, len = elems.length, bulk = key == null;
        if (toType(key) === "object") {
          chainable = true;
          for (i2 in key) {
            access(elems, fn, i2, key[i2], true, emptyGet, raw);
          }
        } else if (value !== void 0) {
          chainable = true;
          if (!isFunction5(value)) {
            raw = true;
          }
          if (bulk) {
            if (raw) {
              fn.call(elems, value);
              fn = null;
            } else {
              bulk = fn;
              fn = function(elem, _key, value2) {
                return bulk.call(jQuery(elem), value2);
              };
            }
          }
          if (fn) {
            for (; i2 < len; i2++) {
              fn(
                elems[i2],
                key,
                raw ? value : value.call(elems[i2], i2, fn(elems[i2], key))
              );
            }
          }
        }
        if (chainable) {
          return elems;
        }
        if (bulk) {
          return fn.call(elems);
        }
        return len ? fn(elems[0], key) : emptyGet;
      };
      var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
      function fcamelCase(_all, letter) {
        return letter.toUpperCase();
      }
      function camelCase(string) {
        return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
      }
      var acceptData = function(owner) {
        return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
      };
      function Data() {
        this.expando = jQuery.expando + Data.uid++;
      }
      Data.uid = 1;
      Data.prototype = {
        cache: function(owner) {
          var value = owner[this.expando];
          if (!value) {
            value = {};
            if (acceptData(owner)) {
              if (owner.nodeType) {
                owner[this.expando] = value;
              } else {
                Object.defineProperty(owner, this.expando, {
                  value,
                  configurable: true
                });
              }
            }
          }
          return value;
        },
        set: function(owner, data, value) {
          var prop, cache2 = this.cache(owner);
          if (typeof data === "string") {
            cache2[camelCase(data)] = value;
          } else {
            for (prop in data) {
              cache2[camelCase(prop)] = data[prop];
            }
          }
          return cache2;
        },
        get: function(owner, key) {
          return key === void 0 ? this.cache(owner) : (
            // Always use camelCase key (gh-2257)
            owner[this.expando] && owner[this.expando][camelCase(key)]
          );
        },
        access: function(owner, key, value) {
          if (key === void 0 || key && typeof key === "string" && value === void 0) {
            return this.get(owner, key);
          }
          this.set(owner, key, value);
          return value !== void 0 ? value : key;
        },
        remove: function(owner, key) {
          var i2, cache2 = owner[this.expando];
          if (cache2 === void 0) {
            return;
          }
          if (key !== void 0) {
            if (Array.isArray(key)) {
              key = key.map(camelCase);
            } else {
              key = camelCase(key);
              key = key in cache2 ? [key] : key.match(rnothtmlwhite) || [];
            }
            i2 = key.length;
            while (i2--) {
              delete cache2[key[i2]];
            }
          }
          if (key === void 0 || jQuery.isEmptyObject(cache2)) {
            if (owner.nodeType) {
              owner[this.expando] = void 0;
            } else {
              delete owner[this.expando];
            }
          }
        },
        hasData: function(owner) {
          var cache2 = owner[this.expando];
          return cache2 !== void 0 && !jQuery.isEmptyObject(cache2);
        }
      };
      var dataPriv = new Data();
      var dataUser = new Data();
      var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
      function getData(data) {
        if (data === "true") {
          return true;
        }
        if (data === "false") {
          return false;
        }
        if (data === "null") {
          return null;
        }
        if (data === +data + "") {
          return +data;
        }
        if (rbrace.test(data)) {
          return JSON.parse(data);
        }
        return data;
      }
      function dataAttr(elem, key, data) {
        var name;
        if (data === void 0 && elem.nodeType === 1) {
          name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
          data = elem.getAttribute(name);
          if (typeof data === "string") {
            try {
              data = getData(data);
            } catch (e) {
            }
            dataUser.set(elem, key, data);
          } else {
            data = void 0;
          }
        }
        return data;
      }
      jQuery.extend({
        hasData: function(elem) {
          return dataUser.hasData(elem) || dataPriv.hasData(elem);
        },
        data: function(elem, name, data) {
          return dataUser.access(elem, name, data);
        },
        removeData: function(elem, name) {
          dataUser.remove(elem, name);
        },
        // TODO: Now that all calls to _data and _removeData have been replaced
        // with direct calls to dataPriv methods, these can be deprecated.
        _data: function(elem, name, data) {
          return dataPriv.access(elem, name, data);
        },
        _removeData: function(elem, name) {
          dataPriv.remove(elem, name);
        }
      });
      jQuery.fn.extend({
        data: function(key, value) {
          var i2, name, data, elem = this[0], attrs = elem && elem.attributes;
          if (key === void 0) {
            if (this.length) {
              data = dataUser.get(elem);
              if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
                i2 = attrs.length;
                while (i2--) {
                  if (attrs[i2]) {
                    name = attrs[i2].name;
                    if (name.indexOf("data-") === 0) {
                      name = camelCase(name.slice(5));
                      dataAttr(elem, name, data[name]);
                    }
                  }
                }
                dataPriv.set(elem, "hasDataAttrs", true);
              }
            }
            return data;
          }
          if (typeof key === "object") {
            return this.each(function() {
              dataUser.set(this, key);
            });
          }
          return access(this, function(value2) {
            var data2;
            if (elem && value2 === void 0) {
              data2 = dataUser.get(elem, key);
              if (data2 !== void 0) {
                return data2;
              }
              data2 = dataAttr(elem, key);
              if (data2 !== void 0) {
                return data2;
              }
              return;
            }
            this.each(function() {
              dataUser.set(this, key, value2);
            });
          }, null, value, arguments.length > 1, null, true);
        },
        removeData: function(key) {
          return this.each(function() {
            dataUser.remove(this, key);
          });
        }
      });
      jQuery.extend({
        queue: function(elem, type, data) {
          var queue;
          if (elem) {
            type = (type || "fx") + "queue";
            queue = dataPriv.get(elem, type);
            if (data) {
              if (!queue || Array.isArray(data)) {
                queue = dataPriv.access(elem, type, jQuery.makeArray(data));
              } else {
                queue.push(data);
              }
            }
            return queue || [];
          }
        },
        dequeue: function(elem, type) {
          type = type || "fx";
          var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function() {
            jQuery.dequeue(elem, type);
          };
          if (fn === "inprogress") {
            fn = queue.shift();
            startLength--;
          }
          if (fn) {
            if (type === "fx") {
              queue.unshift("inprogress");
            }
            delete hooks.stop;
            fn.call(elem, next, hooks);
          }
          if (!startLength && hooks) {
            hooks.empty.fire();
          }
        },
        // Not public - generate a queueHooks object, or return the current one
        _queueHooks: function(elem, type) {
          var key = type + "queueHooks";
          return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
            empty: jQuery.Callbacks("once memory").add(function() {
              dataPriv.remove(elem, [type + "queue", key]);
            })
          });
        }
      });
      jQuery.fn.extend({
        queue: function(type, data) {
          var setter = 2;
          if (typeof type !== "string") {
            data = type;
            type = "fx";
            setter--;
          }
          if (arguments.length < setter) {
            return jQuery.queue(this[0], type);
          }
          return data === void 0 ? this : this.each(function() {
            var queue = jQuery.queue(this, type, data);
            jQuery._queueHooks(this, type);
            if (type === "fx" && queue[0] !== "inprogress") {
              jQuery.dequeue(this, type);
            }
          });
        },
        dequeue: function(type) {
          return this.each(function() {
            jQuery.dequeue(this, type);
          });
        },
        clearQueue: function(type) {
          return this.queue(type || "fx", []);
        },
        // Get a promise resolved when queues of a certain type
        // are emptied (fx is the type by default)
        promise: function(type, obj) {
          var tmp, count = 1, defer2 = jQuery.Deferred(), elements = this, i2 = this.length, resolve = function() {
            if (!--count) {
              defer2.resolveWith(elements, [elements]);
            }
          };
          if (typeof type !== "string") {
            obj = type;
            type = void 0;
          }
          type = type || "fx";
          while (i2--) {
            tmp = dataPriv.get(elements[i2], type + "queueHooks");
            if (tmp && tmp.empty) {
              count++;
              tmp.empty.add(resolve);
            }
          }
          resolve();
          return defer2.promise(obj);
        }
      });
      var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
      var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
      var cssExpand = ["Top", "Right", "Bottom", "Left"];
      var documentElement2 = document2.documentElement;
      var isAttached = function(elem) {
        return jQuery.contains(elem.ownerDocument, elem);
      }, composed = { composed: true };
      if (documentElement2.getRootNode) {
        isAttached = function(elem) {
          return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
        };
      }
      var isHiddenWithinTree = function(elem, el) {
        elem = el || elem;
        return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style
        // Support: Firefox <=43 - 45
        // Disconnected elements can have computed display: none, so first confirm that elem is
        // in the document.
        isAttached(elem) && jQuery.css(elem, "display") === "none";
      };
      function adjustCSS(elem, prop, valueParts, tween) {
        var adjusted, scale5, maxIterations = 20, currentValue = tween ? function() {
          return tween.cur();
        } : function() {
          return jQuery.css(elem, prop, "");
        }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
        if (initialInUnit && initialInUnit[3] !== unit) {
          initial = initial / 2;
          unit = unit || initialInUnit[3];
          initialInUnit = +initial || 1;
          while (maxIterations--) {
            jQuery.style(elem, prop, initialInUnit + unit);
            if ((1 - scale5) * (1 - (scale5 = currentValue() / initial || 0.5)) <= 0) {
              maxIterations = 0;
            }
            initialInUnit = initialInUnit / scale5;
          }
          initialInUnit = initialInUnit * 2;
          jQuery.style(elem, prop, initialInUnit + unit);
          valueParts = valueParts || [];
        }
        if (valueParts) {
          initialInUnit = +initialInUnit || +initial || 0;
          adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
          if (tween) {
            tween.unit = unit;
            tween.start = initialInUnit;
            tween.end = adjusted;
          }
        }
        return adjusted;
      }
      var defaultDisplayMap = {};
      function getDefaultDisplay(elem) {
        var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
        if (display) {
          return display;
        }
        temp = doc.body.appendChild(doc.createElement(nodeName2));
        display = jQuery.css(temp, "display");
        temp.parentNode.removeChild(temp);
        if (display === "none") {
          display = "block";
        }
        defaultDisplayMap[nodeName2] = display;
        return display;
      }
      function showHide(elements, show) {
        var display, elem, values = [], index = 0, length = elements.length;
        for (; index < length; index++) {
          elem = elements[index];
          if (!elem.style) {
            continue;
          }
          display = elem.style.display;
          if (show) {
            if (display === "none") {
              values[index] = dataPriv.get(elem, "display") || null;
              if (!values[index]) {
                elem.style.display = "";
              }
            }
            if (elem.style.display === "" && isHiddenWithinTree(elem)) {
              values[index] = getDefaultDisplay(elem);
            }
          } else {
            if (display !== "none") {
              values[index] = "none";
              dataPriv.set(elem, "display", display);
            }
          }
        }
        for (index = 0; index < length; index++) {
          if (values[index] != null) {
            elements[index].style.display = values[index];
          }
        }
        return elements;
      }
      jQuery.fn.extend({
        show: function() {
          return showHide(this, true);
        },
        hide: function() {
          return showHide(this);
        },
        toggle: function(state2) {
          if (typeof state2 === "boolean") {
            return state2 ? this.show() : this.hide();
          }
          return this.each(function() {
            if (isHiddenWithinTree(this)) {
              jQuery(this).show();
            } else {
              jQuery(this).hide();
            }
          });
        }
      });
      var rcheckableType = /^(?:checkbox|radio)$/i;
      var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
      var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
      (function() {
        var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input2 = document2.createElement("input");
        input2.setAttribute("type", "radio");
        input2.setAttribute("checked", "checked");
        input2.setAttribute("name", "t");
        div.appendChild(input2);
        support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
        div.innerHTML = "<textarea>x</textarea>";
        support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
        div.innerHTML = "<option></option>";
        support.option = !!div.lastChild;
      })();
      var wrapMap = {
        // XHTML parsers do not magically insert elements in the
        // same way that tag soup parsers do. So we cannot shorten
        // this by omitting <tbody> or other required elements.
        thead: [1, "<table>", "</table>"],
        col: [2, "<table><colgroup>", "</colgroup></table>"],
        tr: [2, "<table><tbody>", "</tbody></table>"],
        td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
        _default: [0, "", ""]
      };
      wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
      wrapMap.th = wrapMap.td;
      if (!support.option) {
        wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
      }
      function getAll(context2, tag) {
        var ret;
        if (typeof context2.getElementsByTagName !== "undefined") {
          ret = context2.getElementsByTagName(tag || "*");
        } else if (typeof context2.querySelectorAll !== "undefined") {
          ret = context2.querySelectorAll(tag || "*");
        } else {
          ret = [];
        }
        if (tag === void 0 || tag && nodeName(context2, tag)) {
          return jQuery.merge([context2], ret);
        }
        return ret;
      }
      function setGlobalEval(elems, refElements) {
        var i2 = 0, l = elems.length;
        for (; i2 < l; i2++) {
          dataPriv.set(
            elems[i2],
            "globalEval",
            !refElements || dataPriv.get(refElements[i2], "globalEval")
          );
        }
      }
      var rhtml = /<|&#?\w+;/;
      function buildFragment(elems, context2, scripts, selection, ignored) {
        var elem, tmp, tag, wrap, attached, j, fragment = context2.createDocumentFragment(), nodes = [], i2 = 0, l = elems.length;
        for (; i2 < l; i2++) {
          elem = elems[i2];
          if (elem || elem === 0) {
            if (toType(elem) === "object") {
              jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
            } else if (!rhtml.test(elem)) {
              nodes.push(context2.createTextNode(elem));
            } else {
              tmp = tmp || fragment.appendChild(context2.createElement("div"));
              tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
              wrap = wrapMap[tag] || wrapMap._default;
              tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
              j = wrap[0];
              while (j--) {
                tmp = tmp.lastChild;
              }
              jQuery.merge(nodes, tmp.childNodes);
              tmp = fragment.firstChild;
              tmp.textContent = "";
            }
          }
        }
        fragment.textContent = "";
        i2 = 0;
        while (elem = nodes[i2++]) {
          if (selection && jQuery.inArray(elem, selection) > -1) {
            if (ignored) {
              ignored.push(elem);
            }
            continue;
          }
          attached = isAttached(elem);
          tmp = getAll(fragment.appendChild(elem), "script");
          if (attached) {
            setGlobalEval(tmp);
          }
          if (scripts) {
            j = 0;
            while (elem = tmp[j++]) {
              if (rscriptType.test(elem.type || "")) {
                scripts.push(elem);
              }
            }
          }
        }
        return fragment;
      }
      var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
      function returnTrue() {
        return true;
      }
      function returnFalse() {
        return false;
      }
      function expectSync(elem, type) {
        return elem === safeActiveElement() === (type === "focus");
      }
      function safeActiveElement() {
        try {
          return document2.activeElement;
        } catch (err) {
        }
      }
      function on(elem, types2, selector, data, fn, one) {
        var origFn, type;
        if (typeof types2 === "object") {
          if (typeof selector !== "string") {
            data = data || selector;
            selector = void 0;
          }
          for (type in types2) {
            on(elem, type, selector, data, types2[type], one);
          }
          return elem;
        }
        if (data == null && fn == null) {
          fn = selector;
          data = selector = void 0;
        } else if (fn == null) {
          if (typeof selector === "string") {
            fn = data;
            data = void 0;
          } else {
            fn = data;
            data = selector;
            selector = void 0;
          }
        }
        if (fn === false) {
          fn = returnFalse;
        } else if (!fn) {
          return elem;
        }
        if (one === 1) {
          origFn = fn;
          fn = function(event) {
            jQuery().off(event);
            return origFn.apply(this, arguments);
          };
          fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
        }
        return elem.each(function() {
          jQuery.event.add(this, types2, fn, data, selector);
        });
      }
      jQuery.event = {
        global: {},
        add: function(elem, types2, handler, data, selector) {
          var handleObjIn, eventHandle, tmp, events2, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem);
          if (!acceptData(elem)) {
            return;
          }
          if (handler.handler) {
            handleObjIn = handler;
            handler = handleObjIn.handler;
            selector = handleObjIn.selector;
          }
          if (selector) {
            jQuery.find.matchesSelector(documentElement2, selector);
          }
          if (!handler.guid) {
            handler.guid = jQuery.guid++;
          }
          if (!(events2 = elemData.events)) {
            events2 = elemData.events = /* @__PURE__ */ Object.create(null);
          }
          if (!(eventHandle = elemData.handle)) {
            eventHandle = elemData.handle = function(e) {
              return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
            };
          }
          types2 = (types2 || "").match(rnothtmlwhite) || [""];
          t = types2.length;
          while (t--) {
            tmp = rtypenamespace.exec(types2[t]) || [];
            type = origType = tmp[1];
            namespaces = (tmp[2] || "").split(".").sort();
            if (!type) {
              continue;
            }
            special = jQuery.event.special[type] || {};
            type = (selector ? special.delegateType : special.bindType) || type;
            special = jQuery.event.special[type] || {};
            handleObj = jQuery.extend({
              type,
              origType,
              data,
              handler,
              guid: handler.guid,
              selector,
              needsContext: selector && jQuery.expr.match.needsContext.test(selector),
              namespace: namespaces.join(".")
            }, handleObjIn);
            if (!(handlers = events2[type])) {
              handlers = events2[type] = [];
              handlers.delegateCount = 0;
              if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
                if (elem.addEventListener) {
                  elem.addEventListener(type, eventHandle);
                }
              }
            }
            if (special.add) {
              special.add.call(elem, handleObj);
              if (!handleObj.handler.guid) {
                handleObj.handler.guid = handler.guid;
              }
            }
            if (selector) {
              handlers.splice(handlers.delegateCount++, 0, handleObj);
            } else {
              handlers.push(handleObj);
            }
            jQuery.event.global[type] = true;
          }
        },
        // Detach an event or set of events from an element
        remove: function(elem, types2, handler, selector, mappedTypes) {
          var j, origCount, tmp, events2, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
          if (!elemData || !(events2 = elemData.events)) {
            return;
          }
          types2 = (types2 || "").match(rnothtmlwhite) || [""];
          t = types2.length;
          while (t--) {
            tmp = rtypenamespace.exec(types2[t]) || [];
            type = origType = tmp[1];
            namespaces = (tmp[2] || "").split(".").sort();
            if (!type) {
              for (type in events2) {
                jQuery.event.remove(elem, type + types2[t], handler, selector, true);
              }
              continue;
            }
            special = jQuery.event.special[type] || {};
            type = (selector ? special.delegateType : special.bindType) || type;
            handlers = events2[type] || [];
            tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
            origCount = j = handlers.length;
            while (j--) {
              handleObj = handlers[j];
              if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
                handlers.splice(j, 1);
                if (handleObj.selector) {
                  handlers.delegateCount--;
                }
                if (special.remove) {
                  special.remove.call(elem, handleObj);
                }
              }
            }
            if (origCount && !handlers.length) {
              if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
                jQuery.removeEvent(elem, type, elemData.handle);
              }
              delete events2[type];
            }
          }
          if (jQuery.isEmptyObject(events2)) {
            dataPriv.remove(elem, "handle events");
          }
        },
        dispatch: function(nativeEvent) {
          var i2, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event.type] || [], special = jQuery.event.special[event.type] || {};
          args[0] = event;
          for (i2 = 1; i2 < arguments.length; i2++) {
            args[i2] = arguments[i2];
          }
          event.delegateTarget = this;
          if (special.preDispatch && special.preDispatch.call(this, event) === false) {
            return;
          }
          handlerQueue = jQuery.event.handlers.call(this, event, handlers);
          i2 = 0;
          while ((matched = handlerQueue[i2++]) && !event.isPropagationStopped()) {
            event.currentTarget = matched.elem;
            j = 0;
            while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
              if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {
                event.handleObj = handleObj;
                event.data = handleObj.data;
                ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
                if (ret !== void 0) {
                  if ((event.result = ret) === false) {
                    event.preventDefault();
                    event.stopPropagation();
                  }
                }
              }
            }
          }
          if (special.postDispatch) {
            special.postDispatch.call(this, event);
          }
          return event.result;
        },
        handlers: function(event, handlers) {
          var i2, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target;
          if (delegateCount && // Support: IE <=9
          // Black-hole SVG <use> instance trees (trac-13180)
          cur.nodeType && // Support: Firefox <=42
          // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
          // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
          // Support: IE 11 only
          // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
          !(event.type === "click" && event.button >= 1)) {
            for (; cur !== this; cur = cur.parentNode || this) {
              if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
                matchedHandlers = [];
                matchedSelectors = {};
                for (i2 = 0; i2 < delegateCount; i2++) {
                  handleObj = handlers[i2];
                  sel = handleObj.selector + " ";
                  if (matchedSelectors[sel] === void 0) {
                    matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
                  }
                  if (matchedSelectors[sel]) {
                    matchedHandlers.push(handleObj);
                  }
                }
                if (matchedHandlers.length) {
                  handlerQueue.push({ elem: cur, handlers: matchedHandlers });
                }
              }
            }
          }
          cur = this;
          if (delegateCount < handlers.length) {
            handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
          }
          return handlerQueue;
        },
        addProp: function(name, hook) {
          Object.defineProperty(jQuery.Event.prototype, name, {
            enumerable: true,
            configurable: true,
            get: isFunction5(hook) ? function() {
              if (this.originalEvent) {
                return hook(this.originalEvent);
              }
            } : function() {
              if (this.originalEvent) {
                return this.originalEvent[name];
              }
            },
            set: function(value) {
              Object.defineProperty(this, name, {
                enumerable: true,
                configurable: true,
                writable: true,
                value
              });
            }
          });
        },
        fix: function(originalEvent) {
          return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
        },
        special: {
          load: {
            // Prevent triggered image.load events from bubbling to window.load
            noBubble: true
          },
          click: {
            // Utilize native event to ensure correct state for checkable inputs
            setup: function(data) {
              var el = this || data;
              if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
                leverageNative(el, "click", returnTrue);
              }
              return false;
            },
            trigger: function(data) {
              var el = this || data;
              if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
                leverageNative(el, "click");
              }
              return true;
            },
            // For cross-browser consistency, suppress native .click() on links
            // Also prevent it if we're currently inside a leveraged native-event stack
            _default: function(event) {
              var target = event.target;
              return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
            }
          },
          beforeunload: {
            postDispatch: function(event) {
              if (event.result !== void 0 && event.originalEvent) {
                event.originalEvent.returnValue = event.result;
              }
            }
          }
        }
      };
      function leverageNative(el, type, expectSync2) {
        if (!expectSync2) {
          if (dataPriv.get(el, type) === void 0) {
            jQuery.event.add(el, type, returnTrue);
          }
          return;
        }
        dataPriv.set(el, type, false);
        jQuery.event.add(el, type, {
          namespace: false,
          handler: function(event) {
            var notAsync, result, saved = dataPriv.get(this, type);
            if (event.isTrigger & 1 && this[type]) {
              if (!saved.length) {
                saved = slice.call(arguments);
                dataPriv.set(this, type, saved);
                notAsync = expectSync2(this, type);
                this[type]();
                result = dataPriv.get(this, type);
                if (saved !== result || notAsync) {
                  dataPriv.set(this, type, false);
                } else {
                  result = {};
                }
                if (saved !== result) {
                  event.stopImmediatePropagation();
                  event.preventDefault();
                  return result.value;
                }
              } else if ((jQuery.event.special[type] || {}).delegateType) {
                event.stopPropagation();
              }
            } else if (saved.length) {
              dataPriv.set(this, type, {
                value: jQuery.event.trigger(
                  // Support: IE <=9 - 11+
                  // Extend with the prototype to reset the above stopImmediatePropagation()
                  jQuery.extend(saved[0], jQuery.Event.prototype),
                  saved.slice(1),
                  this
                )
              });
              event.stopImmediatePropagation();
            }
          }
        });
      }
      jQuery.removeEvent = function(elem, type, handle) {
        if (elem.removeEventListener) {
          elem.removeEventListener(type, handle);
        }
      };
      jQuery.Event = function(src, props) {
        if (!(this instanceof jQuery.Event)) {
          return new jQuery.Event(src, props);
        }
        if (src && src.type) {
          this.originalEvent = src;
          this.type = src.type;
          this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only
          src.returnValue === false ? returnTrue : returnFalse;
          this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
          this.currentTarget = src.currentTarget;
          this.relatedTarget = src.relatedTarget;
        } else {
          this.type = src;
        }
        if (props) {
          jQuery.extend(this, props);
        }
        this.timeStamp = src && src.timeStamp || Date.now();
        this[jQuery.expando] = true;
      };
      jQuery.Event.prototype = {
        constructor: jQuery.Event,
        isDefaultPrevented: returnFalse,
        isPropagationStopped: returnFalse,
        isImmediatePropagationStopped: returnFalse,
        isSimulated: false,
        preventDefault: function() {
          var e = this.originalEvent;
          this.isDefaultPrevented = returnTrue;
          if (e && !this.isSimulated) {
            e.preventDefault();
          }
        },
        stopPropagation: function() {
          var e = this.originalEvent;
          this.isPropagationStopped = returnTrue;
          if (e && !this.isSimulated) {
            e.stopPropagation();
          }
        },
        stopImmediatePropagation: function() {
          var e = this.originalEvent;
          this.isImmediatePropagationStopped = returnTrue;
          if (e && !this.isSimulated) {
            e.stopImmediatePropagation();
          }
          this.stopPropagation();
        }
      };
      jQuery.each({
        altKey: true,
        bubbles: true,
        cancelable: true,
        changedTouches: true,
        ctrlKey: true,
        detail: true,
        eventPhase: true,
        metaKey: true,
        pageX: true,
        pageY: true,
        shiftKey: true,
        view: true,
        "char": true,
        code: true,
        charCode: true,
        key: true,
        keyCode: true,
        button: true,
        buttons: true,
        clientX: true,
        clientY: true,
        offsetX: true,
        offsetY: true,
        pointerId: true,
        pointerType: true,
        screenX: true,
        screenY: true,
        targetTouches: true,
        toElement: true,
        touches: true,
        which: function(event) {
          var button = event.button;
          if (event.which == null && rkeyEvent.test(event.type)) {
            return event.charCode != null ? event.charCode : event.keyCode;
          }
          if (!event.which && button !== void 0 && rmouseEvent.test(event.type)) {
            if (button & 1) {
              return 1;
            }
            if (button & 2) {
              return 3;
            }
            if (button & 4) {
              return 2;
            }
            return 0;
          }
          return event.which;
        }
      }, jQuery.event.addProp);
      jQuery.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) {
        jQuery.event.special[type] = {
          // Utilize native event if possible so blur/focus sequence is correct
          setup: function() {
            leverageNative(this, type, expectSync);
            return false;
          },
          trigger: function() {
            leverageNative(this, type);
            return true;
          },
          delegateType
        };
      });
      jQuery.each({
        mouseenter: "mouseover",
        mouseleave: "mouseout",
        pointerenter: "pointerover",
        pointerleave: "pointerout"
      }, function(orig, fix) {
        jQuery.event.special[orig] = {
          delegateType: fix,
          bindType: fix,
          handle: function(event) {
            var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj;
            if (!related || related !== target && !jQuery.contains(target, related)) {
              event.type = handleObj.origType;
              ret = handleObj.handler.apply(this, arguments);
              event.type = fix;
            }
            return ret;
          }
        };
      });
      jQuery.fn.extend({
        on: function(types2, selector, data, fn) {
          return on(this, types2, selector, data, fn);
        },
        one: function(types2, selector, data, fn) {
          return on(this, types2, selector, data, fn, 1);
        },
        off: function(types2, selector, fn) {
          var handleObj, type;
          if (types2 && types2.preventDefault && types2.handleObj) {
            handleObj = types2.handleObj;
            jQuery(types2.delegateTarget).off(
              handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
              handleObj.selector,
              handleObj.handler
            );
            return this;
          }
          if (typeof types2 === "object") {
            for (type in types2) {
              this.off(type, selector, types2[type]);
            }
            return this;
          }
          if (selector === false || typeof selector === "function") {
            fn = selector;
            selector = void 0;
          }
          if (fn === false) {
            fn = returnFalse;
          }
          return this.each(function() {
            jQuery.event.remove(this, types2, fn, selector);
          });
        }
      });
      var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
      function manipulationTarget(elem, content) {
        if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
          return jQuery(elem).children("tbody")[0] || elem;
        }
        return elem;
      }
      function disableScript(elem) {
        elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
        return elem;
      }
      function restoreScript(elem) {
        if ((elem.type || "").slice(0, 5) === "true/") {
          elem.type = elem.type.slice(5);
        } else {
          elem.removeAttribute("type");
        }
        return elem;
      }
      function cloneCopyEvent(src, dest) {
        var i2, l, type, pdataOld, udataOld, udataCur, events2;
        if (dest.nodeType !== 1) {
          return;
        }
        if (dataPriv.hasData(src)) {
          pdataOld = dataPriv.get(src);
          events2 = pdataOld.events;
          if (events2) {
            dataPriv.remove(dest, "handle events");
            for (type in events2) {
              for (i2 = 0, l = events2[type].length; i2 < l; i2++) {
                jQuery.event.add(dest, type, events2[type][i2]);
              }
            }
          }
        }
        if (dataUser.hasData(src)) {
          udataOld = dataUser.access(src);
          udataCur = jQuery.extend({}, udataOld);
          dataUser.set(dest, udataCur);
        }
      }
      function fixInput(src, dest) {
        var nodeName2 = dest.nodeName.toLowerCase();
        if (nodeName2 === "input" && rcheckableType.test(src.type)) {
          dest.checked = src.checked;
        } else if (nodeName2 === "input" || nodeName2 === "textarea") {
          dest.defaultValue = src.defaultValue;
        }
      }
      function domManip(collection, args, callback, ignored) {
        args = flat(args);
        var fragment, first2, scripts, hasScripts, node, doc, i2 = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction5(value);
        if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
          return collection.each(function(index) {
            var self2 = collection.eq(index);
            if (valueIsFunction) {
              args[0] = value.call(this, index, self2.html());
            }
            domManip(self2, args, callback, ignored);
          });
        }
        if (l) {
          fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
          first2 = fragment.firstChild;
          if (fragment.childNodes.length === 1) {
            fragment = first2;
          }
          if (first2 || ignored) {
            scripts = jQuery.map(getAll(fragment, "script"), disableScript);
            hasScripts = scripts.length;
            for (; i2 < l; i2++) {
              node = fragment;
              if (i2 !== iNoClone) {
                node = jQuery.clone(node, true, true);
                if (hasScripts) {
                  jQuery.merge(scripts, getAll(node, "script"));
                }
              }
              callback.call(collection[i2], node, i2);
            }
            if (hasScripts) {
              doc = scripts[scripts.length - 1].ownerDocument;
              jQuery.map(scripts, restoreScript);
              for (i2 = 0; i2 < hasScripts; i2++) {
                node = scripts[i2];
                if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
                  if (node.src && (node.type || "").toLowerCase() !== "module") {
                    if (jQuery._evalUrl && !node.noModule) {
                      jQuery._evalUrl(node.src, {
                        nonce: node.nonce || node.getAttribute("nonce")
                      }, doc);
                    }
                  } else {
                    DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
                  }
                }
              }
            }
          }
        }
        return collection;
      }
      function remove2(elem, selector, keepData) {
        var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i2 = 0;
        for (; (node = nodes[i2]) != null; i2++) {
          if (!keepData && node.nodeType === 1) {
            jQuery.cleanData(getAll(node));
          }
          if (node.parentNode) {
            if (keepData && isAttached(node)) {
              setGlobalEval(getAll(node, "script"));
            }
            node.parentNode.removeChild(node);
          }
        }
        return elem;
      }
      jQuery.extend({
        htmlPrefilter: function(html) {
          return html;
        },
        clone: function(elem, dataAndEvents, deepDataAndEvents) {
          var i2, l, srcElements, destElements, clone2 = elem.cloneNode(true), inPage = isAttached(elem);
          if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
            destElements = getAll(clone2);
            srcElements = getAll(elem);
            for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
              fixInput(srcElements[i2], destElements[i2]);
            }
          }
          if (dataAndEvents) {
            if (deepDataAndEvents) {
              srcElements = srcElements || getAll(elem);
              destElements = destElements || getAll(clone2);
              for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
                cloneCopyEvent(srcElements[i2], destElements[i2]);
              }
            } else {
              cloneCopyEvent(elem, clone2);
            }
          }
          destElements = getAll(clone2, "script");
          if (destElements.length > 0) {
            setGlobalEval(destElements, !inPage && getAll(elem, "script"));
          }
          return clone2;
        },
        cleanData: function(elems) {
          var data, elem, type, special = jQuery.event.special, i2 = 0;
          for (; (elem = elems[i2]) !== void 0; i2++) {
            if (acceptData(elem)) {
              if (data = elem[dataPriv.expando]) {
                if (data.events) {
                  for (type in data.events) {
                    if (special[type]) {
                      jQuery.event.remove(elem, type);
                    } else {
                      jQuery.removeEvent(elem, type, data.handle);
                    }
                  }
                }
                elem[dataPriv.expando] = void 0;
              }
              if (elem[dataUser.expando]) {
                elem[dataUser.expando] = void 0;
              }
            }
          }
        }
      });
      jQuery.fn.extend({
        detach: function(selector) {
          return remove2(this, selector, true);
        },
        remove: function(selector) {
          return remove2(this, selector);
        },
        text: function(value) {
          return access(this, function(value2) {
            return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
              if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
                this.textContent = value2;
              }
            });
          }, null, value, arguments.length);
        },
        append: function() {
          return domManip(this, arguments, function(elem) {
            if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
              var target = manipulationTarget(this, elem);
              target.appendChild(elem);
            }
          });
        },
        prepend: function() {
          return domManip(this, arguments, function(elem) {
            if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
              var target = manipulationTarget(this, elem);
              target.insertBefore(elem, target.firstChild);
            }
          });
        },
        before: function() {
          return domManip(this, arguments, function(elem) {
            if (this.parentNode) {
              this.parentNode.insertBefore(elem, this);
            }
          });
        },
        after: function() {
          return domManip(this, arguments, function(elem) {
            if (this.parentNode) {
              this.parentNode.insertBefore(elem, this.nextSibling);
            }
          });
        },
        empty: function() {
          var elem, i2 = 0;
          for (; (elem = this[i2]) != null; i2++) {
            if (elem.nodeType === 1) {
              jQuery.cleanData(getAll(elem, false));
              elem.textContent = "";
            }
          }
          return this;
        },
        clone: function(dataAndEvents, deepDataAndEvents) {
          dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
          deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
          return this.map(function() {
            return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
          });
        },
        html: function(value) {
          return access(this, function(value2) {
            var elem = this[0] || {}, i2 = 0, l = this.length;
            if (value2 === void 0 && elem.nodeType === 1) {
              return elem.innerHTML;
            }
            if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
              value2 = jQuery.htmlPrefilter(value2);
              try {
                for (; i2 < l; i2++) {
                  elem = this[i2] || {};
                  if (elem.nodeType === 1) {
                    jQuery.cleanData(getAll(elem, false));
                    elem.innerHTML = value2;
                  }
                }
                elem = 0;
              } catch (e) {
              }
            }
            if (elem) {
              this.empty().append(value2);
            }
          }, null, value, arguments.length);
        },
        replaceWith: function() {
          var ignored = [];
          return domManip(this, arguments, function(elem) {
            var parent = this.parentNode;
            if (jQuery.inArray(this, ignored) < 0) {
              jQuery.cleanData(getAll(this));
              if (parent) {
                parent.replaceChild(elem, this);
              }
            }
          }, ignored);
        }
      });
      jQuery.each({
        appendTo: "append",
        prependTo: "prepend",
        insertBefore: "before",
        insertAfter: "after",
        replaceAll: "replaceWith"
      }, function(name, original) {
        jQuery.fn[name] = function(selector) {
          var elems, ret = [], insert = jQuery(selector), last2 = insert.length - 1, i2 = 0;
          for (; i2 <= last2; i2++) {
            elems = i2 === last2 ? this : this.clone(true);
            jQuery(insert[i2])[original](elems);
            push.apply(ret, elems.get());
          }
          return this.pushStack(ret);
        };
      });
      var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
      var getStyles = function(elem) {
        var view = elem.ownerDocument.defaultView;
        if (!view || !view.opener) {
          view = window2;
        }
        return view.getComputedStyle(elem);
      };
      var swap2 = function(elem, options, callback) {
        var ret, name, old = {};
        for (name in options) {
          old[name] = elem.style[name];
          elem.style[name] = options[name];
        }
        ret = callback.call(elem);
        for (name in options) {
          elem.style[name] = old[name];
        }
        return ret;
      };
      var rboxStyle = new RegExp(cssExpand.join("|"), "i");
      (function() {
        function computeStyleTests() {
          if (!div) {
            return;
          }
          container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
          div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
          documentElement2.appendChild(container).appendChild(div);
          var divStyle = window2.getComputedStyle(div);
          pixelPositionVal = divStyle.top !== "1%";
          reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
          div.style.right = "60%";
          pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
          boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
          div.style.position = "absolute";
          scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
          documentElement2.removeChild(container);
          div = null;
        }
        function roundPixelMeasures(measure) {
          return Math.round(parseFloat(measure));
        }
        var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
        if (!div.style) {
          return;
        }
        div.style.backgroundClip = "content-box";
        div.cloneNode(true).style.backgroundClip = "";
        support.clearCloneStyle = div.style.backgroundClip === "content-box";
        jQuery.extend(support, {
          boxSizingReliable: function() {
            computeStyleTests();
            return boxSizingReliableVal;
          },
          pixelBoxStyles: function() {
            computeStyleTests();
            return pixelBoxStylesVal;
          },
          pixelPosition: function() {
            computeStyleTests();
            return pixelPositionVal;
          },
          reliableMarginLeft: function() {
            computeStyleTests();
            return reliableMarginLeftVal;
          },
          scrollboxSize: function() {
            computeStyleTests();
            return scrollboxSizeVal;
          },
          // Support: IE 9 - 11+, Edge 15 - 18+
          // IE/Edge misreport `getComputedStyle` of table rows with width/height
          // set in CSS while `offset*` properties report correct values.
          // Behavior in IE 9 is more subtle than in newer versions & it passes
          // some versions of this test; make sure not to make it pass there!
          reliableTrDimensions: function() {
            var table, tr, trChild, trStyle;
            if (reliableTrDimensionsVal == null) {
              table = document2.createElement("table");
              tr = document2.createElement("tr");
              trChild = document2.createElement("div");
              table.style.cssText = "position:absolute;left:-11111px";
              tr.style.height = "1px";
              trChild.style.height = "9px";
              documentElement2.appendChild(table).appendChild(tr).appendChild(trChild);
              trStyle = window2.getComputedStyle(tr);
              reliableTrDimensionsVal = parseInt(trStyle.height) > 3;
              documentElement2.removeChild(table);
            }
            return reliableTrDimensionsVal;
          }
        });
      })();
      function curCSS(elem, name, computed) {
        var width, minWidth, maxWidth, ret, style2 = elem.style;
        computed = computed || getStyles(elem);
        if (computed) {
          ret = computed.getPropertyValue(name) || computed[name];
          if (ret === "" && !isAttached(elem)) {
            ret = jQuery.style(elem, name);
          }
          if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
            width = style2.width;
            minWidth = style2.minWidth;
            maxWidth = style2.maxWidth;
            style2.minWidth = style2.maxWidth = style2.width = ret;
            ret = computed.width;
            style2.width = width;
            style2.minWidth = minWidth;
            style2.maxWidth = maxWidth;
          }
        }
        return ret !== void 0 ? (
          // Support: IE <=9 - 11 only
          // IE returns zIndex value as an integer.
          ret + ""
        ) : ret;
      }
      function addGetHookIf(conditionFn, hookFn) {
        return {
          get: function() {
            if (conditionFn()) {
              delete this.get;
              return;
            }
            return (this.get = hookFn).apply(this, arguments);
          }
        };
      }
      var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
      function vendorPropName(name) {
        var capName = name[0].toUpperCase() + name.slice(1), i2 = cssPrefixes.length;
        while (i2--) {
          name = cssPrefixes[i2] + capName;
          if (name in emptyStyle) {
            return name;
          }
        }
      }
      function finalPropName(name) {
        var final = jQuery.cssProps[name] || vendorProps[name];
        if (final) {
          return final;
        }
        if (name in emptyStyle) {
          return name;
        }
        return vendorProps[name] = vendorPropName(name) || name;
      }
      var rdisplayswap = /^(none|table(?!-c[ea]).+)/, rcustomProp = /^--/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
        letterSpacing: "0",
        fontWeight: "400"
      };
      function setPositiveNumber(_elem, value, subtract) {
        var matches = rcssNum.exec(value);
        return matches ? (
          // Guard against undefined "subtract", e.g., when used as in cssHooks
          Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px")
        ) : value;
      }
      function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
        var i2 = dimension === "width" ? 1 : 0, extra = 0, delta = 0;
        if (box === (isBorderBox ? "border" : "content")) {
          return 0;
        }
        for (; i2 < 4; i2 += 2) {
          if (box === "margin") {
            delta += jQuery.css(elem, box + cssExpand[i2], true, styles);
          }
          if (!isBorderBox) {
            delta += jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
            if (box !== "padding") {
              delta += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
            } else {
              extra += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
            }
          } else {
            if (box === "content") {
              delta -= jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
            }
            if (box !== "margin") {
              delta -= jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
            }
          }
        }
        if (!isBorderBox && computedVal >= 0) {
          delta += Math.max(0, Math.ceil(
            elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
            // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
            // Use an explicit zero to avoid NaN (gh-3964)
          )) || 0;
        }
        return delta;
      }
      function getWidthOrHeight(elem, dimension, extra) {
        var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
        if (rnumnonpx.test(val)) {
          if (!extra) {
            return val;
          }
          val = "auto";
        }
        if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+
        // IE/Edge misreport `getComputedStyle` of table rows with width/height
        // set in CSS while `offset*` properties report correct values.
        // Interestingly, in some cases IE 9 doesn't suffer from this issue.
        !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto"
        // This happens for inline elements with no explicit setting (gh-3571)
        val === "auto" || // Support: Android <=4.1 - 4.3 only
        // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
        !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected
        elem.getClientRects().length) {
          isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
          valueIsBorderBox = offsetProp in elem;
          if (valueIsBorderBox) {
            val = elem[offsetProp];
          }
        }
        val = parseFloat(val) || 0;
        return val + boxModelAdjustment(
          elem,
          dimension,
          extra || (isBorderBox ? "border" : "content"),
          valueIsBorderBox,
          styles,
          // Provide the current computed size to request scroll gutter calculation (gh-3589)
          val
        ) + "px";
      }
      jQuery.extend({
        // Add in style property hooks for overriding the default
        // behavior of getting and setting a style property
        cssHooks: {
          opacity: {
            get: function(elem, computed) {
              if (computed) {
                var ret = curCSS(elem, "opacity");
                return ret === "" ? "1" : ret;
              }
            }
          }
        },
        // Don't automatically add "px" to these possibly-unitless properties
        cssNumber: {
          "animationIterationCount": true,
          "columnCount": true,
          "fillOpacity": true,
          "flexGrow": true,
          "flexShrink": true,
          "fontWeight": true,
          "gridArea": true,
          "gridColumn": true,
          "gridColumnEnd": true,
          "gridColumnStart": true,
          "gridRow": true,
          "gridRowEnd": true,
          "gridRowStart": true,
          "lineHeight": true,
          "opacity": true,
          "order": true,
          "orphans": true,
          "widows": true,
          "zIndex": true,
          "zoom": true
        },
        // Add in properties whose names you wish to fix before
        // setting or getting the value
        cssProps: {},
        // Get and set the style property on a DOM Node
        style: function(elem, name, value, extra) {
          if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
            return;
          }
          var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style2 = elem.style;
          if (!isCustomProp) {
            name = finalPropName(origName);
          }
          hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
          if (value !== void 0) {
            type = typeof value;
            if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
              value = adjustCSS(elem, name, ret);
              type = "number";
            }
            if (value == null || value !== value) {
              return;
            }
            if (type === "number" && !isCustomProp) {
              value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
            }
            if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
              style2[name] = "inherit";
            }
            if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) {
              if (isCustomProp) {
                style2.setProperty(name, value);
              } else {
                style2[name] = value;
              }
            }
          } else {
            if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) {
              return ret;
            }
            return style2[name];
          }
        },
        css: function(elem, name, extra, styles) {
          var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name);
          if (!isCustomProp) {
            name = finalPropName(origName);
          }
          hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
          if (hooks && "get" in hooks) {
            val = hooks.get(elem, true, extra);
          }
          if (val === void 0) {
            val = curCSS(elem, name, styles);
          }
          if (val === "normal" && name in cssNormalTransform) {
            val = cssNormalTransform[name];
          }
          if (extra === "" || extra) {
            num = parseFloat(val);
            return extra === true || isFinite(num) ? num || 0 : val;
          }
          return val;
        }
      });
      jQuery.each(["height", "width"], function(_i, dimension) {
        jQuery.cssHooks[dimension] = {
          get: function(elem, computed, extra) {
            if (computed) {
              return rdisplayswap.test(jQuery.css(elem, "display")) && // Support: Safari 8+
              // Table columns in Safari have non-zero offsetWidth & zero
              // getBoundingClientRect().width unless display is changed.
              // Support: IE <=11 only
              // Running getBoundingClientRect on a disconnected node
              // in IE throws an error.
              (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap2(elem, cssShow, function() {
                return getWidthOrHeight(elem, dimension, extra);
              }) : getWidthOrHeight(elem, dimension, extra);
            }
          },
          set: function(elem, value, extra) {
            var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
              elem,
              dimension,
              extra,
              isBorderBox,
              styles
            ) : 0;
            if (isBorderBox && scrollboxSizeBuggy) {
              subtract -= Math.ceil(
                elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
              );
            }
            if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
              elem.style[dimension] = value;
              value = jQuery.css(elem, dimension);
            }
            return setPositiveNumber(elem, value, subtract);
          }
        };
      });
      jQuery.cssHooks.marginLeft = addGetHookIf(
        support.reliableMarginLeft,
        function(elem, computed) {
          if (computed) {
            return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap2(elem, { marginLeft: 0 }, function() {
              return elem.getBoundingClientRect().left;
            })) + "px";
          }
        }
      );
      jQuery.each({
        margin: "",
        padding: "",
        border: "Width"
      }, function(prefix, suffix) {
        jQuery.cssHooks[prefix + suffix] = {
          expand: function(value) {
            var i2 = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
            for (; i2 < 4; i2++) {
              expanded[prefix + cssExpand[i2] + suffix] = parts[i2] || parts[i2 - 2] || parts[0];
            }
            return expanded;
          }
        };
        if (prefix !== "margin") {
          jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
        }
      });
      jQuery.fn.extend({
        css: function(name, value) {
          return access(this, function(elem, name2, value2) {
            var styles, len, map2 = {}, i2 = 0;
            if (Array.isArray(name2)) {
              styles = getStyles(elem);
              len = name2.length;
              for (; i2 < len; i2++) {
                map2[name2[i2]] = jQuery.css(elem, name2[i2], false, styles);
              }
              return map2;
            }
            return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
          }, name, value, arguments.length > 1);
        }
      });
      function Tween(elem, options, prop, end, easing) {
        return new Tween.prototype.init(elem, options, prop, end, easing);
      }
      jQuery.Tween = Tween;
      Tween.prototype = {
        constructor: Tween,
        init: function(elem, options, prop, end, easing, unit) {
          this.elem = elem;
          this.prop = prop;
          this.easing = easing || jQuery.easing._default;
          this.options = options;
          this.start = this.now = this.cur();
          this.end = end;
          this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
        },
        cur: function() {
          var hooks = Tween.propHooks[this.prop];
          return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
        },
        run: function(percent) {
          var eased, hooks = Tween.propHooks[this.prop];
          if (this.options.duration) {
            this.pos = eased = jQuery.easing[this.easing](
              percent,
              this.options.duration * percent,
              0,
              1,
              this.options.duration
            );
          } else {
            this.pos = eased = percent;
          }
          this.now = (this.end - this.start) * eased + this.start;
          if (this.options.step) {
            this.options.step.call(this.elem, this.now, this);
          }
          if (hooks && hooks.set) {
            hooks.set(this);
          } else {
            Tween.propHooks._default.set(this);
          }
          return this;
        }
      };
      Tween.prototype.init.prototype = Tween.prototype;
      Tween.propHooks = {
        _default: {
          get: function(tween) {
            var result;
            if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
              return tween.elem[tween.prop];
            }
            result = jQuery.css(tween.elem, tween.prop, "");
            return !result || result === "auto" ? 0 : result;
          },
          set: function(tween) {
            if (jQuery.fx.step[tween.prop]) {
              jQuery.fx.step[tween.prop](tween);
            } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
              jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
            } else {
              tween.elem[tween.prop] = tween.now;
            }
          }
        }
      };
      Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
        set: function(tween) {
          if (tween.elem.nodeType && tween.elem.parentNode) {
            tween.elem[tween.prop] = tween.now;
          }
        }
      };
      jQuery.easing = {
        linear: function(p) {
          return p;
        },
        swing: function(p) {
          return 0.5 - Math.cos(p * Math.PI) / 2;
        },
        _default: "swing"
      };
      jQuery.fx = Tween.prototype.init;
      jQuery.fx.step = {};
      var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
      function schedule() {
        if (inProgress) {
          if (document2.hidden === false && window2.requestAnimationFrame) {
            window2.requestAnimationFrame(schedule);
          } else {
            window2.setTimeout(schedule, jQuery.fx.interval);
          }
          jQuery.fx.tick();
        }
      }
      function createFxNow() {
        window2.setTimeout(function() {
          fxNow = void 0;
        });
        return fxNow = Date.now();
      }
      function genFx(type, includeWidth) {
        var which, i2 = 0, attrs = { height: type };
        includeWidth = includeWidth ? 1 : 0;
        for (; i2 < 4; i2 += 2 - includeWidth) {
          which = cssExpand[i2];
          attrs["margin" + which] = attrs["padding" + which] = type;
        }
        if (includeWidth) {
          attrs.opacity = attrs.width = type;
        }
        return attrs;
      }
      function createTween(value, prop, animation) {
        var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length;
        for (; index < length; index++) {
          if (tween = collection[index].call(animation, prop, value)) {
            return tween;
          }
        }
      }
      function defaultPrefilter(elem, props, opts) {
        var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style2 = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
        if (!opts.queue) {
          hooks = jQuery._queueHooks(elem, "fx");
          if (hooks.unqueued == null) {
            hooks.unqueued = 0;
            oldfire = hooks.empty.fire;
            hooks.empty.fire = function() {
              if (!hooks.unqueued) {
                oldfire();
              }
            };
          }
          hooks.unqueued++;
          anim.always(function() {
            anim.always(function() {
              hooks.unqueued--;
              if (!jQuery.queue(elem, "fx").length) {
                hooks.empty.fire();
              }
            });
          });
        }
        for (prop in props) {
          value = props[prop];
          if (rfxtypes.test(value)) {
            delete props[prop];
            toggle = toggle || value === "toggle";
            if (value === (hidden ? "hide" : "show")) {
              if (value === "show" && dataShow && dataShow[prop] !== void 0) {
                hidden = true;
              } else {
                continue;
              }
            }
            orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
          }
        }
        propTween = !jQuery.isEmptyObject(props);
        if (!propTween && jQuery.isEmptyObject(orig)) {
          return;
        }
        if (isBox && elem.nodeType === 1) {
          opts.overflow = [style2.overflow, style2.overflowX, style2.overflowY];
          restoreDisplay = dataShow && dataShow.display;
          if (restoreDisplay == null) {
            restoreDisplay = dataPriv.get(elem, "display");
          }
          display = jQuery.css(elem, "display");
          if (display === "none") {
            if (restoreDisplay) {
              display = restoreDisplay;
            } else {
              showHide([elem], true);
              restoreDisplay = elem.style.display || restoreDisplay;
              display = jQuery.css(elem, "display");
              showHide([elem]);
            }
          }
          if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
            if (jQuery.css(elem, "float") === "none") {
              if (!propTween) {
                anim.done(function() {
                  style2.display = restoreDisplay;
                });
                if (restoreDisplay == null) {
                  display = style2.display;
                  restoreDisplay = display === "none" ? "" : display;
                }
              }
              style2.display = "inline-block";
            }
          }
        }
        if (opts.overflow) {
          style2.overflow = "hidden";
          anim.always(function() {
            style2.overflow = opts.overflow[0];
            style2.overflowX = opts.overflow[1];
            style2.overflowY = opts.overflow[2];
          });
        }
        propTween = false;
        for (prop in orig) {
          if (!propTween) {
            if (dataShow) {
              if ("hidden" in dataShow) {
                hidden = dataShow.hidden;
              }
            } else {
              dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
            }
            if (toggle) {
              dataShow.hidden = !hidden;
            }
            if (hidden) {
              showHide([elem], true);
            }
            anim.done(function() {
              if (!hidden) {
                showHide([elem]);
              }
              dataPriv.remove(elem, "fxshow");
              for (prop in orig) {
                jQuery.style(elem, prop, orig[prop]);
              }
            });
          }
          propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
          if (!(prop in dataShow)) {
            dataShow[prop] = propTween.start;
            if (hidden) {
              propTween.end = propTween.start;
              propTween.start = 0;
            }
          }
        }
      }
      function propFilter(props, specialEasing) {
        var index, name, easing, value, hooks;
        for (index in props) {
          name = camelCase(index);
          easing = specialEasing[name];
          value = props[index];
          if (Array.isArray(value)) {
            easing = value[1];
            value = props[index] = value[0];
          }
          if (index !== name) {
            props[name] = value;
            delete props[index];
          }
          hooks = jQuery.cssHooks[name];
          if (hooks && "expand" in hooks) {
            value = hooks.expand(value);
            delete props[name];
            for (index in value) {
              if (!(index in props)) {
                props[index] = value[index];
                specialEasing[index] = easing;
              }
            }
          } else {
            specialEasing[name] = easing;
          }
        }
      }
      function Animation(elem, properties2, options) {
        var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
          delete tick.elem;
        }), tick = function() {
          if (stopped) {
            return false;
          }
          var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index2 = 0, length2 = animation.tweens.length;
          for (; index2 < length2; index2++) {
            animation.tweens[index2].run(percent);
          }
          deferred.notifyWith(elem, [animation, percent, remaining]);
          if (percent < 1 && length2) {
            return remaining;
          }
          if (!length2) {
            deferred.notifyWith(elem, [animation, 1, 0]);
          }
          deferred.resolveWith(elem, [animation]);
          return false;
        }, animation = deferred.promise({
          elem,
          props: jQuery.extend({}, properties2),
          opts: jQuery.extend(true, {
            specialEasing: {},
            easing: jQuery.easing._default
          }, options),
          originalProperties: properties2,
          originalOptions: options,
          startTime: fxNow || createFxNow(),
          duration: options.duration,
          tweens: [],
          createTween: function(prop, end) {
            var tween = jQuery.Tween(
              elem,
              animation.opts,
              prop,
              end,
              animation.opts.specialEasing[prop] || animation.opts.easing
            );
            animation.tweens.push(tween);
            return tween;
          },
          stop: function(gotoEnd) {
            var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
            if (stopped) {
              return this;
            }
            stopped = true;
            for (; index2 < length2; index2++) {
              animation.tweens[index2].run(1);
            }
            if (gotoEnd) {
              deferred.notifyWith(elem, [animation, 1, 0]);
              deferred.resolveWith(elem, [animation, gotoEnd]);
            } else {
              deferred.rejectWith(elem, [animation, gotoEnd]);
            }
            return this;
          }
        }), props = animation.props;
        propFilter(props, animation.opts.specialEasing);
        for (; index < length; index++) {
          result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
          if (result) {
            if (isFunction5(result.stop)) {
              jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
            }
            return result;
          }
        }
        jQuery.map(props, createTween, animation);
        if (isFunction5(animation.opts.start)) {
          animation.opts.start.call(elem, animation);
        }
        animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
        jQuery.fx.timer(
          jQuery.extend(tick, {
            elem,
            anim: animation,
            queue: animation.opts.queue
          })
        );
        return animation;
      }
      jQuery.Animation = jQuery.extend(Animation, {
        tweeners: {
          "*": [function(prop, value) {
            var tween = this.createTween(prop, value);
            adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
            return tween;
          }]
        },
        tweener: function(props, callback) {
          if (isFunction5(props)) {
            callback = props;
            props = ["*"];
          } else {
            props = props.match(rnothtmlwhite);
          }
          var prop, index = 0, length = props.length;
          for (; index < length; index++) {
            prop = props[index];
            Animation.tweeners[prop] = Animation.tweeners[prop] || [];
            Animation.tweeners[prop].unshift(callback);
          }
        },
        prefilters: [defaultPrefilter],
        prefilter: function(callback, prepend) {
          if (prepend) {
            Animation.prefilters.unshift(callback);
          } else {
            Animation.prefilters.push(callback);
          }
        }
      });
      jQuery.speed = function(speed, easing, fn) {
        var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
          complete: fn || !fn && easing || isFunction5(speed) && speed,
          duration: speed,
          easing: fn && easing || easing && !isFunction5(easing) && easing
        };
        if (jQuery.fx.off) {
          opt.duration = 0;
        } else {
          if (typeof opt.duration !== "number") {
            if (opt.duration in jQuery.fx.speeds) {
              opt.duration = jQuery.fx.speeds[opt.duration];
            } else {
              opt.duration = jQuery.fx.speeds._default;
            }
          }
        }
        if (opt.queue == null || opt.queue === true) {
          opt.queue = "fx";
        }
        opt.old = opt.complete;
        opt.complete = function() {
          if (isFunction5(opt.old)) {
            opt.old.call(this);
          }
          if (opt.queue) {
            jQuery.dequeue(this, opt.queue);
          }
        };
        return opt;
      };
      jQuery.fn.extend({
        fadeTo: function(speed, to, easing, callback) {
          return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback);
        },
        animate: function(prop, speed, easing, callback) {
          var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() {
            var anim = Animation(this, jQuery.extend({}, prop), optall);
            if (empty || dataPriv.get(this, "finish")) {
              anim.stop(true);
            }
          };
          doAnimation.finish = doAnimation;
          return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
        },
        stop: function(type, clearQueue, gotoEnd) {
          var stopQueue = function(hooks) {
            var stop = hooks.stop;
            delete hooks.stop;
            stop(gotoEnd);
          };
          if (typeof type !== "string") {
            gotoEnd = clearQueue;
            clearQueue = type;
            type = void 0;
          }
          if (clearQueue) {
            this.queue(type || "fx", []);
          }
          return this.each(function() {
            var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
            if (index) {
              if (data[index] && data[index].stop) {
                stopQueue(data[index]);
              }
            } else {
              for (index in data) {
                if (data[index] && data[index].stop && rrun.test(index)) {
                  stopQueue(data[index]);
                }
              }
            }
            for (index = timers.length; index--; ) {
              if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
                timers[index].anim.stop(gotoEnd);
                dequeue = false;
                timers.splice(index, 1);
              }
            }
            if (dequeue || !gotoEnd) {
              jQuery.dequeue(this, type);
            }
          });
        },
        finish: function(type) {
          if (type !== false) {
            type = type || "fx";
          }
          return this.each(function() {
            var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
            data.finish = true;
            jQuery.queue(this, type, []);
            if (hooks && hooks.stop) {
              hooks.stop.call(this, true);
            }
            for (index = timers.length; index--; ) {
              if (timers[index].elem === this && timers[index].queue === type) {
                timers[index].anim.stop(true);
                timers.splice(index, 1);
              }
            }
            for (index = 0; index < length; index++) {
              if (queue[index] && queue[index].finish) {
                queue[index].finish.call(this);
              }
            }
            delete data.finish;
          });
        }
      });
      jQuery.each(["toggle", "show", "hide"], function(_i, name) {
        var cssFn = jQuery.fn[name];
        jQuery.fn[name] = function(speed, easing, callback) {
          return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
        };
      });
      jQuery.each({
        slideDown: genFx("show"),
        slideUp: genFx("hide"),
        slideToggle: genFx("toggle"),
        fadeIn: { opacity: "show" },
        fadeOut: { opacity: "hide" },
        fadeToggle: { opacity: "toggle" }
      }, function(name, props) {
        jQuery.fn[name] = function(speed, easing, callback) {
          return this.animate(props, speed, easing, callback);
        };
      });
      jQuery.timers = [];
      jQuery.fx.tick = function() {
        var timer2, i2 = 0, timers = jQuery.timers;
        fxNow = Date.now();
        for (; i2 < timers.length; i2++) {
          timer2 = timers[i2];
          if (!timer2() && timers[i2] === timer2) {
            timers.splice(i2--, 1);
          }
        }
        if (!timers.length) {
          jQuery.fx.stop();
        }
        fxNow = void 0;
      };
      jQuery.fx.timer = function(timer2) {
        jQuery.timers.push(timer2);
        jQuery.fx.start();
      };
      jQuery.fx.interval = 13;
      jQuery.fx.start = function() {
        if (inProgress) {
          return;
        }
        inProgress = true;
        schedule();
      };
      jQuery.fx.stop = function() {
        inProgress = null;
      };
      jQuery.fx.speeds = {
        slow: 600,
        fast: 200,
        // Default speed
        _default: 400
      };
      jQuery.fn.delay = function(time, type) {
        time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
        type = type || "fx";
        return this.queue(type, function(next, hooks) {
          var timeout = window2.setTimeout(next, time);
          hooks.stop = function() {
            window2.clearTimeout(timeout);
          };
        });
      };
      (function() {
        var input2 = document2.createElement("input"), select2 = document2.createElement("select"), opt = select2.appendChild(document2.createElement("option"));
        input2.type = "checkbox";
        support.checkOn = input2.value !== "";
        support.optSelected = opt.selected;
        input2 = document2.createElement("input");
        input2.value = "t";
        input2.type = "radio";
        support.radioValue = input2.value === "t";
      })();
      var boolHook, attrHandle = jQuery.expr.attrHandle;
      jQuery.fn.extend({
        attr: function(name, value) {
          return access(this, jQuery.attr, name, value, arguments.length > 1);
        },
        removeAttr: function(name) {
          return this.each(function() {
            jQuery.removeAttr(this, name);
          });
        }
      });
      jQuery.extend({
        attr: function(elem, name, value) {
          var ret, hooks, nType = elem.nodeType;
          if (nType === 3 || nType === 8 || nType === 2) {
            return;
          }
          if (typeof elem.getAttribute === "undefined") {
            return jQuery.prop(elem, name, value);
          }
          if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
            hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
          }
          if (value !== void 0) {
            if (value === null) {
              jQuery.removeAttr(elem, name);
              return;
            }
            if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
              return ret;
            }
            elem.setAttribute(name, value + "");
            return value;
          }
          if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
            return ret;
          }
          ret = jQuery.find.attr(elem, name);
          return ret == null ? void 0 : ret;
        },
        attrHooks: {
          type: {
            set: function(elem, value) {
              if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
                var val = elem.value;
                elem.setAttribute("type", value);
                if (val) {
                  elem.value = val;
                }
                return value;
              }
            }
          }
        },
        removeAttr: function(elem, value) {
          var name, i2 = 0, attrNames = value && value.match(rnothtmlwhite);
          if (attrNames && elem.nodeType === 1) {
            while (name = attrNames[i2++]) {
              elem.removeAttribute(name);
            }
          }
        }
      });
      boolHook = {
        set: function(elem, value, name) {
          if (value === false) {
            jQuery.removeAttr(elem, name);
          } else {
            elem.setAttribute(name, name);
          }
          return name;
        }
      };
      jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
        var getter = attrHandle[name] || jQuery.find.attr;
        attrHandle[name] = function(elem, name2, isXML) {
          var ret, handle, lowercaseName = name2.toLowerCase();
          if (!isXML) {
            handle = attrHandle[lowercaseName];
            attrHandle[lowercaseName] = ret;
            ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
            attrHandle[lowercaseName] = handle;
          }
          return ret;
        };
      });
      var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
      jQuery.fn.extend({
        prop: function(name, value) {
          return access(this, jQuery.prop, name, value, arguments.length > 1);
        },
        removeProp: function(name) {
          return this.each(function() {
            delete this[jQuery.propFix[name] || name];
          });
        }
      });
      jQuery.extend({
        prop: function(elem, name, value) {
          var ret, hooks, nType = elem.nodeType;
          if (nType === 3 || nType === 8 || nType === 2) {
            return;
          }
          if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
            name = jQuery.propFix[name] || name;
            hooks = jQuery.propHooks[name];
          }
          if (value !== void 0) {
            if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
              return ret;
            }
            return elem[name] = value;
          }
          if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
            return ret;
          }
          return elem[name];
        },
        propHooks: {
          tabIndex: {
            get: function(elem) {
              var tabindex = jQuery.find.attr(elem, "tabindex");
              if (tabindex) {
                return parseInt(tabindex, 10);
              }
              if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
                return 0;
              }
              return -1;
            }
          }
        },
        propFix: {
          "for": "htmlFor",
          "class": "className"
        }
      });
      if (!support.optSelected) {
        jQuery.propHooks.selected = {
          get: function(elem) {
            var parent = elem.parentNode;
            if (parent && parent.parentNode) {
              parent.parentNode.selectedIndex;
            }
            return null;
          },
          set: function(elem) {
            var parent = elem.parentNode;
            if (parent) {
              parent.selectedIndex;
              if (parent.parentNode) {
                parent.parentNode.selectedIndex;
              }
            }
          }
        };
      }
      jQuery.each([
        "tabIndex",
        "readOnly",
        "maxLength",
        "cellSpacing",
        "cellPadding",
        "rowSpan",
        "colSpan",
        "useMap",
        "frameBorder",
        "contentEditable"
      ], function() {
        jQuery.propFix[this.toLowerCase()] = this;
      });
      function stripAndCollapse(value) {
        var tokens = value.match(rnothtmlwhite) || [];
        return tokens.join(" ");
      }
      function getClass(elem) {
        return elem.getAttribute && elem.getAttribute("class") || "";
      }
      function classesToArray(value) {
        if (Array.isArray(value)) {
          return value;
        }
        if (typeof value === "string") {
          return value.match(rnothtmlwhite) || [];
        }
        return [];
      }
      jQuery.fn.extend({
        addClass: function(value) {
          var classes, elem, cur, curValue, clazz, j, finalValue, i2 = 0;
          if (isFunction5(value)) {
            return this.each(function(j2) {
              jQuery(this).addClass(value.call(this, j2, getClass(this)));
            });
          }
          classes = classesToArray(value);
          if (classes.length) {
            while (elem = this[i2++]) {
              curValue = getClass(elem);
              cur = elem.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
              if (cur) {
                j = 0;
                while (clazz = classes[j++]) {
                  if (cur.indexOf(" " + clazz + " ") < 0) {
                    cur += clazz + " ";
                  }
                }
                finalValue = stripAndCollapse(cur);
                if (curValue !== finalValue) {
                  elem.setAttribute("class", finalValue);
                }
              }
            }
          }
          return this;
        },
        removeClass: function(value) {
          var classes, elem, cur, curValue, clazz, j, finalValue, i2 = 0;
          if (isFunction5(value)) {
            return this.each(function(j2) {
              jQuery(this).removeClass(value.call(this, j2, getClass(this)));
            });
          }
          if (!arguments.length) {
            return this.attr("class", "");
          }
          classes = classesToArray(value);
          if (classes.length) {
            while (elem = this[i2++]) {
              curValue = getClass(elem);
              cur = elem.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
              if (cur) {
                j = 0;
                while (clazz = classes[j++]) {
                  while (cur.indexOf(" " + clazz + " ") > -1) {
                    cur = cur.replace(" " + clazz + " ", " ");
                  }
                }
                finalValue = stripAndCollapse(cur);
                if (curValue !== finalValue) {
                  elem.setAttribute("class", finalValue);
                }
              }
            }
          }
          return this;
        },
        toggleClass: function(value, stateVal) {
          var type = typeof value, isValidValue = type === "string" || Array.isArray(value);
          if (typeof stateVal === "boolean" && isValidValue) {
            return stateVal ? this.addClass(value) : this.removeClass(value);
          }
          if (isFunction5(value)) {
            return this.each(function(i2) {
              jQuery(this).toggleClass(
                value.call(this, i2, getClass(this), stateVal),
                stateVal
              );
            });
          }
          return this.each(function() {
            var className, i2, self2, classNames;
            if (isValidValue) {
              i2 = 0;
              self2 = jQuery(this);
              classNames = classesToArray(value);
              while (className = classNames[i2++]) {
                if (self2.hasClass(className)) {
                  self2.removeClass(className);
                } else {
                  self2.addClass(className);
                }
              }
            } else if (value === void 0 || type === "boolean") {
              className = getClass(this);
              if (className) {
                dataPriv.set(this, "__className__", className);
              }
              if (this.setAttribute) {
                this.setAttribute(
                  "class",
                  className || value === false ? "" : dataPriv.get(this, "__className__") || ""
                );
              }
            }
          });
        },
        hasClass: function(selector) {
          var className, elem, i2 = 0;
          className = " " + selector + " ";
          while (elem = this[i2++]) {
            if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
              return true;
            }
          }
          return false;
        }
      });
      var rreturn = /\r/g;
      jQuery.fn.extend({
        val: function(value) {
          var hooks, ret, valueIsFunction, elem = this[0];
          if (!arguments.length) {
            if (elem) {
              hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
              if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) {
                return ret;
              }
              ret = elem.value;
              if (typeof ret === "string") {
                return ret.replace(rreturn, "");
              }
              return ret == null ? "" : ret;
            }
            return;
          }
          valueIsFunction = isFunction5(value);
          return this.each(function(i2) {
            var val;
            if (this.nodeType !== 1) {
              return;
            }
            if (valueIsFunction) {
              val = value.call(this, i2, jQuery(this).val());
            } else {
              val = value;
            }
            if (val == null) {
              val = "";
            } else if (typeof val === "number") {
              val += "";
            } else if (Array.isArray(val)) {
              val = jQuery.map(val, function(value2) {
                return value2 == null ? "" : value2 + "";
              });
            }
            hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
            if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) {
              this.value = val;
            }
          });
        }
      });
      jQuery.extend({
        valHooks: {
          option: {
            get: function(elem) {
              var val = jQuery.find.attr(elem, "value");
              return val != null ? val : (
                // Support: IE <=10 - 11 only
                // option.text throws exceptions (#14686, #14858)
                // Strip and collapse whitespace
                // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
                stripAndCollapse(jQuery.text(elem))
              );
            }
          },
          select: {
            get: function(elem) {
              var value, option, i2, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length;
              if (index < 0) {
                i2 = max;
              } else {
                i2 = one ? index : 0;
              }
              for (; i2 < max; i2++) {
                option = options[i2];
                if ((option.selected || i2 === index) && // Don't return options that are disabled or in a disabled optgroup
                !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
                  value = jQuery(option).val();
                  if (one) {
                    return value;
                  }
                  values.push(value);
                }
              }
              return values;
            },
            set: function(elem, value) {
              var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i2 = options.length;
              while (i2--) {
                option = options[i2];
                if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
                  optionSet = true;
                }
              }
              if (!optionSet) {
                elem.selectedIndex = -1;
              }
              return values;
            }
          }
        }
      });
      jQuery.each(["radio", "checkbox"], function() {
        jQuery.valHooks[this] = {
          set: function(elem, value) {
            if (Array.isArray(value)) {
              return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
            }
          }
        };
        if (!support.checkOn) {
          jQuery.valHooks[this].get = function(elem) {
            return elem.getAttribute("value") === null ? "on" : elem.value;
          };
        }
      });
      support.focusin = "onfocusin" in window2;
      var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
        e.stopPropagation();
      };
      jQuery.extend(jQuery.event, {
        trigger: function(event, data, elem, onlyHandlers) {
          var i2, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
          cur = lastElement = tmp = elem = elem || document2;
          if (elem.nodeType === 3 || elem.nodeType === 8) {
            return;
          }
          if (rfocusMorph.test(type + jQuery.event.triggered)) {
            return;
          }
          if (type.indexOf(".") > -1) {
            namespaces = type.split(".");
            type = namespaces.shift();
            namespaces.sort();
          }
          ontype = type.indexOf(":") < 0 && "on" + type;
          event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);
          event.isTrigger = onlyHandlers ? 2 : 3;
          event.namespace = namespaces.join(".");
          event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
          event.result = void 0;
          if (!event.target) {
            event.target = elem;
          }
          data = data == null ? [event] : jQuery.makeArray(data, [event]);
          special = jQuery.event.special[type] || {};
          if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
            return;
          }
          if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
            bubbleType = special.delegateType || type;
            if (!rfocusMorph.test(bubbleType + type)) {
              cur = cur.parentNode;
            }
            for (; cur; cur = cur.parentNode) {
              eventPath.push(cur);
              tmp = cur;
            }
            if (tmp === (elem.ownerDocument || document2)) {
              eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
            }
          }
          i2 = 0;
          while ((cur = eventPath[i2++]) && !event.isPropagationStopped()) {
            lastElement = cur;
            event.type = i2 > 1 ? bubbleType : special.bindType || type;
            handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle");
            if (handle) {
              handle.apply(cur, data);
            }
            handle = ontype && cur[ontype];
            if (handle && handle.apply && acceptData(cur)) {
              event.result = handle.apply(cur, data);
              if (event.result === false) {
                event.preventDefault();
              }
            }
          }
          event.type = type;
          if (!onlyHandlers && !event.isDefaultPrevented()) {
            if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
              if (ontype && isFunction5(elem[type]) && !isWindow(elem)) {
                tmp = elem[ontype];
                if (tmp) {
                  elem[ontype] = null;
                }
                jQuery.event.triggered = type;
                if (event.isPropagationStopped()) {
                  lastElement.addEventListener(type, stopPropagationCallback);
                }
                elem[type]();
                if (event.isPropagationStopped()) {
                  lastElement.removeEventListener(type, stopPropagationCallback);
                }
                jQuery.event.triggered = void 0;
                if (tmp) {
                  elem[ontype] = tmp;
                }
              }
            }
          }
          return event.result;
        },
        // Piggyback on a donor event to simulate a different one
        // Used only for `focus(in | out)` events
        simulate: function(type, elem, event) {
          var e = jQuery.extend(
            new jQuery.Event(),
            event,
            {
              type,
              isSimulated: true
            }
          );
          jQuery.event.trigger(e, null, elem);
        }
      });
      jQuery.fn.extend({
        trigger: function(type, data) {
          return this.each(function() {
            jQuery.event.trigger(type, data, this);
          });
        },
        triggerHandler: function(type, data) {
          var elem = this[0];
          if (elem) {
            return jQuery.event.trigger(type, data, elem, true);
          }
        }
      });
      if (!support.focusin) {
        jQuery.each({ focus: "focusin", blur: "focusout" }, function(orig, fix) {
          var handler = function(event) {
            jQuery.event.simulate(fix, event.target, jQuery.event.fix(event));
          };
          jQuery.event.special[fix] = {
            setup: function() {
              var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access(doc, fix);
              if (!attaches) {
                doc.addEventListener(orig, handler, true);
              }
              dataPriv.access(doc, fix, (attaches || 0) + 1);
            },
            teardown: function() {
              var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access(doc, fix) - 1;
              if (!attaches) {
                doc.removeEventListener(orig, handler, true);
                dataPriv.remove(doc, fix);
              } else {
                dataPriv.access(doc, fix, attaches);
              }
            }
          };
        });
      }
      var location2 = window2.location;
      var nonce = { guid: Date.now() };
      var rquery = /\?/;
      jQuery.parseXML = function(data) {
        var xml;
        if (!data || typeof data !== "string") {
          return null;
        }
        try {
          xml = new window2.DOMParser().parseFromString(data, "text/xml");
        } catch (e) {
          xml = void 0;
        }
        if (!xml || xml.getElementsByTagName("parsererror").length) {
          jQuery.error("Invalid XML: " + data);
        }
        return xml;
      };
      var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
      function buildParams(prefix, obj, traditional, add5) {
        var name;
        if (Array.isArray(obj)) {
          jQuery.each(obj, function(i2, v) {
            if (traditional || rbracket.test(prefix)) {
              add5(prefix, v);
            } else {
              buildParams(
                prefix + "[" + (typeof v === "object" && v != null ? i2 : "") + "]",
                v,
                traditional,
                add5
              );
            }
          });
        } else if (!traditional && toType(obj) === "object") {
          for (name in obj) {
            buildParams(prefix + "[" + name + "]", obj[name], traditional, add5);
          }
        } else {
          add5(prefix, obj);
        }
      }
      jQuery.param = function(a, traditional) {
        var prefix, s = [], add5 = function(key, valueOrFunction) {
          var value = isFunction5(valueOrFunction) ? valueOrFunction() : valueOrFunction;
          s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
        };
        if (a == null) {
          return "";
        }
        if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
          jQuery.each(a, function() {
            add5(this.name, this.value);
          });
        } else {
          for (prefix in a) {
            buildParams(prefix, a[prefix], traditional, add5);
          }
        }
        return s.join("&");
      };
      jQuery.fn.extend({
        serialize: function() {
          return jQuery.param(this.serializeArray());
        },
        serializeArray: function() {
          return this.map(function() {
            var elements = jQuery.prop(this, "elements");
            return elements ? jQuery.makeArray(elements) : this;
          }).filter(function() {
            var type = this.type;
            return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
          }).map(function(_i, elem) {
            var val = jQuery(this).val();
            if (val == null) {
              return null;
            }
            if (Array.isArray(val)) {
              return jQuery.map(val, function(val2) {
                return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
              });
            }
            return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
          }).get();
        }
      });
      var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
      originAnchor.href = location2.href;
      function addToPrefiltersOrTransports(structure) {
        return function(dataTypeExpression, func) {
          if (typeof dataTypeExpression !== "string") {
            func = dataTypeExpression;
            dataTypeExpression = "*";
          }
          var dataType, i2 = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
          if (isFunction5(func)) {
            while (dataType = dataTypes[i2++]) {
              if (dataType[0] === "+") {
                dataType = dataType.slice(1) || "*";
                (structure[dataType] = structure[dataType] || []).unshift(func);
              } else {
                (structure[dataType] = structure[dataType] || []).push(func);
              }
            }
          }
        };
      }
      function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
        var inspected = {}, seekingTransport = structure === transports;
        function inspect(dataType) {
          var selected;
          inspected[dataType] = true;
          jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
            var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
            if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
              options.dataTypes.unshift(dataTypeOrTransport);
              inspect(dataTypeOrTransport);
              return false;
            } else if (seekingTransport) {
              return !(selected = dataTypeOrTransport);
            }
          });
          return selected;
        }
        return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
      }
      function ajaxExtend(target, src) {
        var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
        for (key in src) {
          if (src[key] !== void 0) {
            (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
          }
        }
        if (deep) {
          jQuery.extend(true, target, deep);
        }
        return target;
      }
      function ajaxHandleResponses(s, jqXHR, responses) {
        var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
        while (dataTypes[0] === "*") {
          dataTypes.shift();
          if (ct === void 0) {
            ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
          }
        }
        if (ct) {
          for (type in contents) {
            if (contents[type] && contents[type].test(ct)) {
              dataTypes.unshift(type);
              break;
            }
          }
        }
        if (dataTypes[0] in responses) {
          finalDataType = dataTypes[0];
        } else {
          for (type in responses) {
            if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
              finalDataType = type;
              break;
            }
            if (!firstDataType) {
              firstDataType = type;
            }
          }
          finalDataType = finalDataType || firstDataType;
        }
        if (finalDataType) {
          if (finalDataType !== dataTypes[0]) {
            dataTypes.unshift(finalDataType);
          }
          return responses[finalDataType];
        }
      }
      function ajaxConvert(s, response, jqXHR, isSuccess) {
        var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
        if (dataTypes[1]) {
          for (conv in s.converters) {
            converters[conv.toLowerCase()] = s.converters[conv];
          }
        }
        current = dataTypes.shift();
        while (current) {
          if (s.responseFields[current]) {
            jqXHR[s.responseFields[current]] = response;
          }
          if (!prev && isSuccess && s.dataFilter) {
            response = s.dataFilter(response, s.dataType);
          }
          prev = current;
          current = dataTypes.shift();
          if (current) {
            if (current === "*") {
              current = prev;
            } else if (prev !== "*" && prev !== current) {
              conv = converters[prev + " " + current] || converters["* " + current];
              if (!conv) {
                for (conv2 in converters) {
                  tmp = conv2.split(" ");
                  if (tmp[1] === current) {
                    conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
                    if (conv) {
                      if (conv === true) {
                        conv = converters[conv2];
                      } else if (converters[conv2] !== true) {
                        current = tmp[0];
                        dataTypes.unshift(tmp[1]);
                      }
                      break;
                    }
                  }
                }
              }
              if (conv !== true) {
                if (conv && s.throws) {
                  response = conv(response);
                } else {
                  try {
                    response = conv(response);
                  } catch (e) {
                    return {
                      state: "parsererror",
                      error: conv ? e : "No conversion from " + prev + " to " + current
                    };
                  }
                }
              }
            }
          }
        }
        return { state: "success", data: response };
      }
      jQuery.extend({
        // Counter for holding the number of active queries
        active: 0,
        // Last-Modified header cache for next request
        lastModified: {},
        etag: {},
        ajaxSettings: {
          url: location2.href,
          type: "GET",
          isLocal: rlocalProtocol.test(location2.protocol),
          global: true,
          processData: true,
          async: true,
          contentType: "application/x-www-form-urlencoded; charset=UTF-8",
          /*
          timeout: 0,
          data: null,
          dataType: null,
          username: null,
          password: null,
          cache: null,
          throws: false,
          traditional: false,
          headers: {},
          */
          accepts: {
            "*": allTypes,
            text: "text/plain",
            html: "text/html",
            xml: "application/xml, text/xml",
            json: "application/json, text/javascript"
          },
          contents: {
            xml: /\bxml\b/,
            html: /\bhtml/,
            json: /\bjson\b/
          },
          responseFields: {
            xml: "responseXML",
            text: "responseText",
            json: "responseJSON"
          },
          // Data converters
          // Keys separate source (or catchall "*") and destination types with a single space
          converters: {
            // Convert anything to text
            "* text": String,
            // Text to html (true = no transformation)
            "text html": true,
            // Evaluate text as a json expression
            "text json": JSON.parse,
            // Parse text as xml
            "text xml": jQuery.parseXML
          },
          // For options that shouldn't be deep extended:
          // you can add your own custom options here if
          // and when you create one that shouldn't be
          // deep extended (see ajaxExtend)
          flatOptions: {
            url: true,
            context: true
          }
        },
        // Creates a full fledged settings object into target
        // with both ajaxSettings and settings fields.
        // If target is omitted, writes into ajaxSettings.
        ajaxSetup: function(target, settings) {
          return settings ? (
            // Building a settings object
            ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings)
          ) : (
            // Extending ajaxSettings
            ajaxExtend(jQuery.ajaxSettings, target)
          );
        },
        ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
        ajaxTransport: addToPrefiltersOrTransports(transports),
        // Main method
        ajax: function(url, options) {
          if (typeof url === "object") {
            options = url;
            url = void 0;
          }
          options = options || {};
          var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i2, uncached, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
            readyState: 0,
            // Builds headers hashtable if needed
            getResponseHeader: function(key) {
              var match2;
              if (completed2) {
                if (!responseHeaders) {
                  responseHeaders = {};
                  while (match2 = rheaders.exec(responseHeadersString)) {
                    responseHeaders[match2[1].toLowerCase() + " "] = (responseHeaders[match2[1].toLowerCase() + " "] || []).concat(match2[2]);
                  }
                }
                match2 = responseHeaders[key.toLowerCase() + " "];
              }
              return match2 == null ? null : match2.join(", ");
            },
            // Raw string
            getAllResponseHeaders: function() {
              return completed2 ? responseHeadersString : null;
            },
            // Caches the header
            setRequestHeader: function(name, value) {
              if (completed2 == null) {
                name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
                requestHeaders[name] = value;
              }
              return this;
            },
            // Overrides response content-type header
            overrideMimeType: function(type) {
              if (completed2 == null) {
                s.mimeType = type;
              }
              return this;
            },
            // Status-dependent callbacks
            statusCode: function(map2) {
              var code;
              if (map2) {
                if (completed2) {
                  jqXHR.always(map2[jqXHR.status]);
                } else {
                  for (code in map2) {
                    statusCode[code] = [statusCode[code], map2[code]];
                  }
                }
              }
              return this;
            },
            // Cancel the request
            abort: function(statusText) {
              var finalText = statusText || strAbort;
              if (transport) {
                transport.abort(finalText);
              }
              done(0, finalText);
              return this;
            }
          };
          deferred.promise(jqXHR);
          s.url = ((url || s.url || location2.href) + "").replace(rprotocol, location2.protocol + "//");
          s.type = options.method || options.type || s.method || s.type;
          s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
          if (s.crossDomain == null) {
            urlAnchor = document2.createElement("a");
            try {
              urlAnchor.href = s.url;
              urlAnchor.href = urlAnchor.href;
              s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
            } catch (e) {
              s.crossDomain = true;
            }
          }
          if (s.data && s.processData && typeof s.data !== "string") {
            s.data = jQuery.param(s.data, s.traditional);
          }
          inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
          if (completed2) {
            return jqXHR;
          }
          fireGlobals = jQuery.event && s.global;
          if (fireGlobals && jQuery.active++ === 0) {
            jQuery.event.trigger("ajaxStart");
          }
          s.type = s.type.toUpperCase();
          s.hasContent = !rnoContent.test(s.type);
          cacheURL = s.url.replace(rhash, "");
          if (!s.hasContent) {
            uncached = s.url.slice(cacheURL.length);
            if (s.data && (s.processData || typeof s.data === "string")) {
              cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
              delete s.data;
            }
            if (s.cache === false) {
              cacheURL = cacheURL.replace(rantiCache, "$1");
              uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
            }
            s.url = cacheURL + uncached;
          } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
            s.data = s.data.replace(r20, "+");
          }
          if (s.ifModified) {
            if (jQuery.lastModified[cacheURL]) {
              jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
            }
            if (jQuery.etag[cacheURL]) {
              jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
            }
          }
          if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
            jqXHR.setRequestHeader("Content-Type", s.contentType);
          }
          jqXHR.setRequestHeader(
            "Accept",
            s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
          );
          for (i2 in s.headers) {
            jqXHR.setRequestHeader(i2, s.headers[i2]);
          }
          if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
            return jqXHR.abort();
          }
          strAbort = "abort";
          completeDeferred.add(s.complete);
          jqXHR.done(s.success);
          jqXHR.fail(s.error);
          transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
          if (!transport) {
            done(-1, "No Transport");
          } else {
            jqXHR.readyState = 1;
            if (fireGlobals) {
              globalEventContext.trigger("ajaxSend", [jqXHR, s]);
            }
            if (completed2) {
              return jqXHR;
            }
            if (s.async && s.timeout > 0) {
              timeoutTimer = window2.setTimeout(function() {
                jqXHR.abort("timeout");
              }, s.timeout);
            }
            try {
              completed2 = false;
              transport.send(requestHeaders, done);
            } catch (e) {
              if (completed2) {
                throw e;
              }
              done(-1, e);
            }
          }
          function done(status, nativeStatusText, responses, headers) {
            var isSuccess, success2, error3, response, modified, statusText = nativeStatusText;
            if (completed2) {
              return;
            }
            completed2 = true;
            if (timeoutTimer) {
              window2.clearTimeout(timeoutTimer);
            }
            transport = void 0;
            responseHeadersString = headers || "";
            jqXHR.readyState = status > 0 ? 4 : 0;
            isSuccess = status >= 200 && status < 300 || status === 304;
            if (responses) {
              response = ajaxHandleResponses(s, jqXHR, responses);
            }
            if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1) {
              s.converters["text script"] = function() {
              };
            }
            response = ajaxConvert(s, response, jqXHR, isSuccess);
            if (isSuccess) {
              if (s.ifModified) {
                modified = jqXHR.getResponseHeader("Last-Modified");
                if (modified) {
                  jQuery.lastModified[cacheURL] = modified;
                }
                modified = jqXHR.getResponseHeader("etag");
                if (modified) {
                  jQuery.etag[cacheURL] = modified;
                }
              }
              if (status === 204 || s.type === "HEAD") {
                statusText = "nocontent";
              } else if (status === 304) {
                statusText = "notmodified";
              } else {
                statusText = response.state;
                success2 = response.data;
                error3 = response.error;
                isSuccess = !error3;
              }
            } else {
              error3 = statusText;
              if (status || !statusText) {
                statusText = "error";
                if (status < 0) {
                  status = 0;
                }
              }
            }
            jqXHR.status = status;
            jqXHR.statusText = (nativeStatusText || statusText) + "";
            if (isSuccess) {
              deferred.resolveWith(callbackContext, [success2, statusText, jqXHR]);
            } else {
              deferred.rejectWith(callbackContext, [jqXHR, statusText, error3]);
            }
            jqXHR.statusCode(statusCode);
            statusCode = void 0;
            if (fireGlobals) {
              globalEventContext.trigger(
                isSuccess ? "ajaxSuccess" : "ajaxError",
                [jqXHR, s, isSuccess ? success2 : error3]
              );
            }
            completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
            if (fireGlobals) {
              globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
              if (!--jQuery.active) {
                jQuery.event.trigger("ajaxStop");
              }
            }
          }
          return jqXHR;
        },
        getJSON: function(url, data, callback) {
          return jQuery.get(url, data, callback, "json");
        },
        getScript: function(url, callback) {
          return jQuery.get(url, void 0, callback, "script");
        }
      });
      jQuery.each(["get", "post"], function(_i, method) {
        jQuery[method] = function(url, data, callback, type) {
          if (isFunction5(data)) {
            type = type || callback;
            callback = data;
            data = void 0;
          }
          return jQuery.ajax(jQuery.extend({
            url,
            type: method,
            dataType: type,
            data,
            success: callback
          }, jQuery.isPlainObject(url) && url));
        };
      });
      jQuery.ajaxPrefilter(function(s) {
        var i2;
        for (i2 in s.headers) {
          if (i2.toLowerCase() === "content-type") {
            s.contentType = s.headers[i2] || "";
          }
        }
      });
      jQuery._evalUrl = function(url, options, doc) {
        return jQuery.ajax({
          url,
          // Make this explicit, since user can override this through ajaxSetup (#11264)
          type: "GET",
          dataType: "script",
          cache: true,
          async: false,
          global: false,
          // Only evaluate the response if it is successful (gh-4126)
          // dataFilter is not invoked for failure responses, so using it instead
          // of the default converter is kludgy but it works.
          converters: {
            "text script": function() {
            }
          },
          dataFilter: function(response) {
            jQuery.globalEval(response, options, doc);
          }
        });
      };
      jQuery.fn.extend({
        wrapAll: function(html) {
          var wrap;
          if (this[0]) {
            if (isFunction5(html)) {
              html = html.call(this[0]);
            }
            wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
            if (this[0].parentNode) {
              wrap.insertBefore(this[0]);
            }
            wrap.map(function() {
              var elem = this;
              while (elem.firstElementChild) {
                elem = elem.firstElementChild;
              }
              return elem;
            }).append(this);
          }
          return this;
        },
        wrapInner: function(html) {
          if (isFunction5(html)) {
            return this.each(function(i2) {
              jQuery(this).wrapInner(html.call(this, i2));
            });
          }
          return this.each(function() {
            var self2 = jQuery(this), contents = self2.contents();
            if (contents.length) {
              contents.wrapAll(html);
            } else {
              self2.append(html);
            }
          });
        },
        wrap: function(html) {
          var htmlIsFunction = isFunction5(html);
          return this.each(function(i2) {
            jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i2) : html);
          });
        },
        unwrap: function(selector) {
          this.parent(selector).not("body").each(function() {
            jQuery(this).replaceWith(this.childNodes);
          });
          return this;
        }
      });
      jQuery.expr.pseudos.hidden = function(elem) {
        return !jQuery.expr.pseudos.visible(elem);
      };
      jQuery.expr.pseudos.visible = function(elem) {
        return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
      };
      jQuery.ajaxSettings.xhr = function() {
        try {
          return new window2.XMLHttpRequest();
        } catch (e) {
        }
      };
      var xhrSuccessStatus = {
        // File protocol always yields status code 0, assume 200
        0: 200,
        // Support: IE <=9 only
        // #1450: sometimes IE returns 1223 when it should be 204
        1223: 204
      }, xhrSupported = jQuery.ajaxSettings.xhr();
      support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
      support.ajax = xhrSupported = !!xhrSupported;
      jQuery.ajaxTransport(function(options) {
        var callback, errorCallback;
        if (support.cors || xhrSupported && !options.crossDomain) {
          return {
            send: function(headers, complete) {
              var i2, xhr2 = options.xhr();
              xhr2.open(
                options.type,
                options.url,
                options.async,
                options.username,
                options.password
              );
              if (options.xhrFields) {
                for (i2 in options.xhrFields) {
                  xhr2[i2] = options.xhrFields[i2];
                }
              }
              if (options.mimeType && xhr2.overrideMimeType) {
                xhr2.overrideMimeType(options.mimeType);
              }
              if (!options.crossDomain && !headers["X-Requested-With"]) {
                headers["X-Requested-With"] = "XMLHttpRequest";
              }
              for (i2 in headers) {
                xhr2.setRequestHeader(i2, headers[i2]);
              }
              callback = function(type) {
                return function() {
                  if (callback) {
                    callback = errorCallback = xhr2.onload = xhr2.onerror = xhr2.onabort = xhr2.ontimeout = xhr2.onreadystatechange = null;
                    if (type === "abort") {
                      xhr2.abort();
                    } else if (type === "error") {
                      if (typeof xhr2.status !== "number") {
                        complete(0, "error");
                      } else {
                        complete(
                          // File: protocol always yields status 0; see #8605, #14207
                          xhr2.status,
                          xhr2.statusText
                        );
                      }
                    } else {
                      complete(
                        xhrSuccessStatus[xhr2.status] || xhr2.status,
                        xhr2.statusText,
                        // Support: IE <=9 only
                        // IE9 has no XHR2 but throws on binary (trac-11426)
                        // For XHR2 non-text, let the caller handle it (gh-2498)
                        (xhr2.responseType || "text") !== "text" || typeof xhr2.responseText !== "string" ? { binary: xhr2.response } : { text: xhr2.responseText },
                        xhr2.getAllResponseHeaders()
                      );
                    }
                  }
                };
              };
              xhr2.onload = callback();
              errorCallback = xhr2.onerror = xhr2.ontimeout = callback("error");
              if (xhr2.onabort !== void 0) {
                xhr2.onabort = errorCallback;
              } else {
                xhr2.onreadystatechange = function() {
                  if (xhr2.readyState === 4) {
                    window2.setTimeout(function() {
                      if (callback) {
                        errorCallback();
                      }
                    });
                  }
                };
              }
              callback = callback("abort");
              try {
                xhr2.send(options.hasContent && options.data || null);
              } catch (e) {
                if (callback) {
                  throw e;
                }
              }
            },
            abort: function() {
              if (callback) {
                callback();
              }
            }
          };
        }
      });
      jQuery.ajaxPrefilter(function(s) {
        if (s.crossDomain) {
          s.contents.script = false;
        }
      });
      jQuery.ajaxSetup({
        accepts: {
          script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
        },
        contents: {
          script: /\b(?:java|ecma)script\b/
        },
        converters: {
          "text script": function(text) {
            jQuery.globalEval(text);
            return text;
          }
        }
      });
      jQuery.ajaxPrefilter("script", function(s) {
        if (s.cache === void 0) {
          s.cache = false;
        }
        if (s.crossDomain) {
          s.type = "GET";
        }
      });
      jQuery.ajaxTransport("script", function(s) {
        if (s.crossDomain || s.scriptAttrs) {
          var script, callback;
          return {
            send: function(_, complete) {
              script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback = function(evt) {
                script.remove();
                callback = null;
                if (evt) {
                  complete(evt.type === "error" ? 404 : 200, evt.type);
                }
              });
              document2.head.appendChild(script[0]);
            },
            abort: function() {
              if (callback) {
                callback();
              }
            }
          };
        }
      });
      var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
      jQuery.ajaxSetup({
        jsonp: "callback",
        jsonpCallback: function() {
          var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
          this[callback] = true;
          return callback;
        }
      });
      jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
        var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
        if (jsonProp || s.dataTypes[0] === "jsonp") {
          callbackName = s.jsonpCallback = isFunction5(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
          if (jsonProp) {
            s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
          } else if (s.jsonp !== false) {
            s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
          }
          s.converters["script json"] = function() {
            if (!responseContainer) {
              jQuery.error(callbackName + " was not called");
            }
            return responseContainer[0];
          };
          s.dataTypes[0] = "json";
          overwritten = window2[callbackName];
          window2[callbackName] = function() {
            responseContainer = arguments;
          };
          jqXHR.always(function() {
            if (overwritten === void 0) {
              jQuery(window2).removeProp(callbackName);
            } else {
              window2[callbackName] = overwritten;
            }
            if (s[callbackName]) {
              s.jsonpCallback = originalSettings.jsonpCallback;
              oldCallbacks.push(callbackName);
            }
            if (responseContainer && isFunction5(overwritten)) {
              overwritten(responseContainer[0]);
            }
            responseContainer = overwritten = void 0;
          });
          return "script";
        }
      });
      support.createHTMLDocument = function() {
        var body = document2.implementation.createHTMLDocument("").body;
        body.innerHTML = "<form></form><form></form>";
        return body.childNodes.length === 2;
      }();
      jQuery.parseHTML = function(data, context2, keepScripts) {
        if (typeof data !== "string") {
          return [];
        }
        if (typeof context2 === "boolean") {
          keepScripts = context2;
          context2 = false;
        }
        var base, parsed, scripts;
        if (!context2) {
          if (support.createHTMLDocument) {
            context2 = document2.implementation.createHTMLDocument("");
            base = context2.createElement("base");
            base.href = document2.location.href;
            context2.head.appendChild(base);
          } else {
            context2 = document2;
          }
        }
        parsed = rsingleTag.exec(data);
        scripts = !keepScripts && [];
        if (parsed) {
          return [context2.createElement(parsed[1])];
        }
        parsed = buildFragment([data], context2, scripts);
        if (scripts && scripts.length) {
          jQuery(scripts).remove();
        }
        return jQuery.merge([], parsed.childNodes);
      };
      jQuery.fn.load = function(url, params, callback) {
        var selector, type, response, self2 = this, off = url.indexOf(" ");
        if (off > -1) {
          selector = stripAndCollapse(url.slice(off));
          url = url.slice(0, off);
        }
        if (isFunction5(params)) {
          callback = params;
          params = void 0;
        } else if (params && typeof params === "object") {
          type = "POST";
        }
        if (self2.length > 0) {
          jQuery.ajax({
            url,
            // If "type" variable is undefined, then "GET" method will be used.
            // Make value of this field explicit since
            // user can override it through ajaxSetup method
            type: type || "GET",
            dataType: "html",
            data: params
          }).done(function(responseText) {
            response = arguments;
            self2.html(selector ? (
              // If a selector was specified, locate the right elements in a dummy div
              // Exclude scripts to avoid IE 'Permission Denied' errors
              jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector)
            ) : (
              // Otherwise use the full result
              responseText
            ));
          }).always(callback && function(jqXHR, status) {
            self2.each(function() {
              callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
            });
          });
        }
        return this;
      };
      jQuery.expr.pseudos.animated = function(elem) {
        return jQuery.grep(jQuery.timers, function(fn) {
          return elem === fn.elem;
        }).length;
      };
      jQuery.offset = {
        setOffset: function(elem, options, i2) {
          var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
          if (position === "static") {
            elem.style.position = "relative";
          }
          curOffset = curElem.offset();
          curCSSTop = jQuery.css(elem, "top");
          curCSSLeft = jQuery.css(elem, "left");
          calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
          if (calculatePosition) {
            curPosition = curElem.position();
            curTop = curPosition.top;
            curLeft = curPosition.left;
          } else {
            curTop = parseFloat(curCSSTop) || 0;
            curLeft = parseFloat(curCSSLeft) || 0;
          }
          if (isFunction5(options)) {
            options = options.call(elem, i2, jQuery.extend({}, curOffset));
          }
          if (options.top != null) {
            props.top = options.top - curOffset.top + curTop;
          }
          if (options.left != null) {
            props.left = options.left - curOffset.left + curLeft;
          }
          if ("using" in options) {
            options.using.call(elem, props);
          } else {
            if (typeof props.top === "number") {
              props.top += "px";
            }
            if (typeof props.left === "number") {
              props.left += "px";
            }
            curElem.css(props);
          }
        }
      };
      jQuery.fn.extend({
        // offset() relates an element's border box to the document origin
        offset: function(options) {
          if (arguments.length) {
            return options === void 0 ? this : this.each(function(i2) {
              jQuery.offset.setOffset(this, options, i2);
            });
          }
          var rect, win, elem = this[0];
          if (!elem) {
            return;
          }
          if (!elem.getClientRects().length) {
            return { top: 0, left: 0 };
          }
          rect = elem.getBoundingClientRect();
          win = elem.ownerDocument.defaultView;
          return {
            top: rect.top + win.pageYOffset,
            left: rect.left + win.pageXOffset
          };
        },
        // position() relates an element's margin box to its offset parent's padding box
        // This corresponds to the behavior of CSS absolute positioning
        position: function() {
          if (!this[0]) {
            return;
          }
          var offsetParent, offset2, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
          if (jQuery.css(elem, "position") === "fixed") {
            offset2 = elem.getBoundingClientRect();
          } else {
            offset2 = this.offset();
            doc = elem.ownerDocument;
            offsetParent = elem.offsetParent || doc.documentElement;
            while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
              offsetParent = offsetParent.parentNode;
            }
            if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
              parentOffset = jQuery(offsetParent).offset();
              parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
              parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
            }
          }
          return {
            top: offset2.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
            left: offset2.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
          };
        },
        // This method will return documentElement in the following cases:
        // 1) For the element inside the iframe without offsetParent, this method will return
        //    documentElement of the parent window
        // 2) For the hidden or detached element
        // 3) For body or html element, i.e. in case of the html node - it will return itself
        //
        // but those exceptions were never presented as a real life use-cases
        // and might be considered as more preferable results.
        //
        // This logic, however, is not guaranteed and can change at any point in the future
        offsetParent: function() {
          return this.map(function() {
            var offsetParent = this.offsetParent;
            while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
              offsetParent = offsetParent.offsetParent;
            }
            return offsetParent || documentElement2;
          });
        }
      });
      jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
        var top = "pageYOffset" === prop;
        jQuery.fn[method] = function(val) {
          return access(this, function(elem, method2, val2) {
            var win;
            if (isWindow(elem)) {
              win = elem;
            } else if (elem.nodeType === 9) {
              win = elem.defaultView;
            }
            if (val2 === void 0) {
              return win ? win[prop] : elem[method2];
            }
            if (win) {
              win.scrollTo(
                !top ? val2 : win.pageXOffset,
                top ? val2 : win.pageYOffset
              );
            } else {
              elem[method2] = val2;
            }
          }, method, val, arguments.length);
        };
      });
      jQuery.each(["top", "left"], function(_i, prop) {
        jQuery.cssHooks[prop] = addGetHookIf(
          support.pixelPosition,
          function(elem, computed) {
            if (computed) {
              computed = curCSS(elem, prop);
              return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
            }
          }
        );
      });
      jQuery.each({ Height: "height", Width: "width" }, function(name, type) {
        jQuery.each(
          { padding: "inner" + name, content: type, "": "outer" + name },
          function(defaultExtra, funcName) {
            jQuery.fn[funcName] = function(margin, value) {
              var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
              return access(this, function(elem, type2, value2) {
                var doc;
                if (isWindow(elem)) {
                  return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
                }
                if (elem.nodeType === 9) {
                  doc = elem.documentElement;
                  return Math.max(
                    elem.body["scroll" + name],
                    doc["scroll" + name],
                    elem.body["offset" + name],
                    doc["offset" + name],
                    doc["client" + name]
                  );
                }
                return value2 === void 0 ? (
                  // Get width or height on the element, requesting but not forcing parseFloat
                  jQuery.css(elem, type2, extra)
                ) : (
                  // Set width or height on the element
                  jQuery.style(elem, type2, value2, extra)
                );
              }, type, chainable ? margin : void 0, chainable);
            };
          }
        );
      });
      jQuery.each([
        "ajaxStart",
        "ajaxStop",
        "ajaxComplete",
        "ajaxError",
        "ajaxSuccess",
        "ajaxSend"
      ], function(_i, type) {
        jQuery.fn[type] = function(fn) {
          return this.on(type, fn);
        };
      });
      jQuery.fn.extend({
        bind: function(types2, data, fn) {
          return this.on(types2, null, data, fn);
        },
        unbind: function(types2, fn) {
          return this.off(types2, null, fn);
        },
        delegate: function(selector, types2, data, fn) {
          return this.on(types2, selector, data, fn);
        },
        undelegate: function(selector, types2, fn) {
          return arguments.length === 1 ? this.off(selector, "**") : this.off(types2, selector || "**", fn);
        },
        hover: function(fnOver, fnOut) {
          return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
        }
      });
      jQuery.each(
        "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
        function(_i, name) {
          jQuery.fn[name] = function(data, fn) {
            return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
          };
        }
      );
      var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
      jQuery.proxy = function(fn, context2) {
        var tmp, args, proxy;
        if (typeof context2 === "string") {
          tmp = fn[context2];
          context2 = fn;
          fn = tmp;
        }
        if (!isFunction5(fn)) {
          return void 0;
        }
        args = slice.call(arguments, 2);
        proxy = function() {
          return fn.apply(context2 || this, args.concat(slice.call(arguments)));
        };
        proxy.guid = fn.guid = fn.guid || jQuery.guid++;
        return proxy;
      };
      jQuery.holdReady = function(hold) {
        if (hold) {
          jQuery.readyWait++;
        } else {
          jQuery.ready(true);
        }
      };
      jQuery.isArray = Array.isArray;
      jQuery.parseJSON = JSON.parse;
      jQuery.nodeName = nodeName;
      jQuery.isFunction = isFunction5;
      jQuery.isWindow = isWindow;
      jQuery.camelCase = camelCase;
      jQuery.type = toType;
      jQuery.now = Date.now;
      jQuery.isNumeric = function(obj) {
        var type = jQuery.type(obj);
        return (type === "number" || type === "string") && // parseFloat NaNs numeric-cast false positives ("")
        // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
        // subtraction forces infinities to NaN
        !isNaN(obj - parseFloat(obj));
      };
      jQuery.trim = function(text) {
        return text == null ? "" : (text + "").replace(rtrim, "");
      };
      if (typeof define === "function" && define.amd) {
        define("jquery", [], function() {
          return jQuery;
        });
      }
      var _jQuery = window2.jQuery, _$ = window2.$;
      jQuery.noConflict = function(deep) {
        if (window2.$ === jQuery) {
          window2.$ = _$;
        }
        if (deep && window2.jQuery === jQuery) {
          window2.jQuery = _jQuery;
        }
        return jQuery;
      };
      if (typeof noGlobal === "undefined") {
        window2.jQuery = window2.$ = jQuery;
      }
      return jQuery;
    });
  }
});

// node_modules/rbush/rbush.min.js
var require_rbush_min = __commonJS({
  "node_modules/rbush/rbush.min.js"(exports4, module2) {
    !function(t, i2) {
      "object" == typeof exports4 && "undefined" != typeof module2 ? module2.exports = i2() : "function" == typeof define && define.amd ? define(i2) : (t = t || self).RBush = i2();
    }(exports4, function() {
      "use strict";
      function t(t4, r2, e2, a2, h2) {
        !function t5(n2, r3, e3, a3, h3) {
          for (; a3 > e3; ) {
            if (a3 - e3 > 600) {
              var o2 = a3 - e3 + 1, s2 = r3 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u3 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r3 - s2 * f2 / o2 + u3)), c2 = Math.min(a3, Math.floor(r3 + (o2 - s2) * f2 / o2 + u3));
              t5(n2, r3, m2, c2, h3);
            }
            var p5 = n2[r3], d2 = e3, x = a3;
            for (i2(n2, e3, r3), h3(n2[a3], p5) > 0 && i2(n2, e3, a3); d2 < x; ) {
              for (i2(n2, d2, x), d2++, x--; h3(n2[d2], p5) < 0; ) d2++;
              for (; h3(n2[x], p5) > 0; ) x--;
            }
            0 === h3(n2[e3], p5) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r3 && (e3 = x + 1), r3 <= x && (a3 = x - 1);
          }
        }(t4, r2, e2 || 0, a2 || t4.length - 1, h2 || n);
      }
      function i2(t4, i3, n2) {
        var r2 = t4[i3];
        t4[i3] = t4[n2], t4[n2] = r2;
      }
      function n(t4, i3) {
        return t4 < i3 ? -1 : t4 > i3 ? 1 : 0;
      }
      var r = function(t4) {
        void 0 === t4 && (t4 = 9), this._maxEntries = Math.max(4, t4), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
      };
      function e(t4, i3, n2) {
        if (!n2) return i3.indexOf(t4);
        for (var r2 = 0; r2 < i3.length; r2++) if (n2(t4, i3[r2])) return r2;
        return -1;
      }
      function a(t4, i3) {
        h(t4, 0, t4.children.length, i3, t4);
      }
      function h(t4, i3, n2, r2, e2) {
        e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
        for (var a2 = i3; a2 < n2; a2++) {
          var h2 = t4.children[a2];
          o(e2, t4.leaf ? r2(h2) : h2);
        }
        return e2;
      }
      function o(t4, i3) {
        return t4.minX = Math.min(t4.minX, i3.minX), t4.minY = Math.min(t4.minY, i3.minY), t4.maxX = Math.max(t4.maxX, i3.maxX), t4.maxY = Math.max(t4.maxY, i3.maxY), t4;
      }
      function s(t4, i3) {
        return t4.minX - i3.minX;
      }
      function l(t4, i3) {
        return t4.minY - i3.minY;
      }
      function f(t4) {
        return (t4.maxX - t4.minX) * (t4.maxY - t4.minY);
      }
      function u2(t4) {
        return t4.maxX - t4.minX + (t4.maxY - t4.minY);
      }
      function m(t4, i3) {
        return t4.minX <= i3.minX && t4.minY <= i3.minY && i3.maxX <= t4.maxX && i3.maxY <= t4.maxY;
      }
      function c(t4, i3) {
        return i3.minX <= t4.maxX && i3.minY <= t4.maxY && i3.maxX >= t4.minX && i3.maxY >= t4.minY;
      }
      function p(t4) {
        return { children: t4, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
      }
      function d(i3, n2, r2, e2, a2) {
        for (var h2 = [n2, r2]; h2.length; ) if (!((r2 = h2.pop()) - (n2 = h2.pop()) <= e2)) {
          var o2 = n2 + Math.ceil((r2 - n2) / e2 / 2) * e2;
          t(i3, o2, n2, r2, a2), h2.push(n2, o2, o2, r2);
        }
      }
      return r.prototype.all = function() {
        return this._all(this.data, []);
      }, r.prototype.search = function(t4) {
        var i3 = this.data, n2 = [];
        if (!c(t4, i3)) return n2;
        for (var r2 = this.toBBox, e2 = []; i3; ) {
          for (var a2 = 0; a2 < i3.children.length; a2++) {
            var h2 = i3.children[a2], o2 = i3.leaf ? r2(h2) : h2;
            c(t4, o2) && (i3.leaf ? n2.push(h2) : m(t4, o2) ? this._all(h2, n2) : e2.push(h2));
          }
          i3 = e2.pop();
        }
        return n2;
      }, r.prototype.collides = function(t4) {
        var i3 = this.data;
        if (!c(t4, i3)) return false;
        for (var n2 = []; i3; ) {
          for (var r2 = 0; r2 < i3.children.length; r2++) {
            var e2 = i3.children[r2], a2 = i3.leaf ? this.toBBox(e2) : e2;
            if (c(t4, a2)) {
              if (i3.leaf || m(t4, a2)) return true;
              n2.push(e2);
            }
          }
          i3 = n2.pop();
        }
        return false;
      }, r.prototype.load = function(t4) {
        if (!t4 || !t4.length) return this;
        if (t4.length < this._minEntries) {
          for (var i3 = 0; i3 < t4.length; i3++) this.insert(t4[i3]);
          return this;
        }
        var n2 = this._build(t4.slice(), 0, t4.length - 1, 0);
        if (this.data.children.length) if (this.data.height === n2.height) this._splitRoot(this.data, n2);
        else {
          if (this.data.height < n2.height) {
            var r2 = this.data;
            this.data = n2, n2 = r2;
          }
          this._insert(n2, this.data.height - n2.height - 1, true);
        }
        else this.data = n2;
        return this;
      }, r.prototype.insert = function(t4) {
        return t4 && this._insert(t4, this.data.height - 1), this;
      }, r.prototype.clear = function() {
        return this.data = p([]), this;
      }, r.prototype.remove = function(t4, i3) {
        if (!t4) return this;
        for (var n2, r2, a2, h2 = this.data, o2 = this.toBBox(t4), s2 = [], l2 = []; h2 || s2.length; ) {
          if (h2 || (h2 = s2.pop(), r2 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h2.leaf) {
            var f2 = e(t4, h2.children, i3);
            if (-1 !== f2) return h2.children.splice(f2, 1), s2.push(h2), this._condense(s2), this;
          }
          a2 || h2.leaf || !m(h2, o2) ? r2 ? (n2++, h2 = r2.children[n2], a2 = false) : h2 = null : (s2.push(h2), l2.push(n2), n2 = 0, r2 = h2, h2 = h2.children[0]);
        }
        return this;
      }, r.prototype.toBBox = function(t4) {
        return t4;
      }, r.prototype.compareMinX = function(t4, i3) {
        return t4.minX - i3.minX;
      }, r.prototype.compareMinY = function(t4, i3) {
        return t4.minY - i3.minY;
      }, r.prototype.toJSON = function() {
        return this.data;
      }, r.prototype.fromJSON = function(t4) {
        return this.data = t4, this;
      }, r.prototype._all = function(t4, i3) {
        for (var n2 = []; t4; ) t4.leaf ? i3.push.apply(i3, t4.children) : n2.push.apply(n2, t4.children), t4 = n2.pop();
        return i3;
      }, r.prototype._build = function(t4, i3, n2, r2) {
        var e2, h2 = n2 - i3 + 1, o2 = this._maxEntries;
        if (h2 <= o2) return a(e2 = p(t4.slice(i3, n2 + 1)), this.toBBox), e2;
        r2 || (r2 = Math.ceil(Math.log(h2) / Math.log(o2)), o2 = Math.ceil(h2 / Math.pow(o2, r2 - 1))), (e2 = p([])).leaf = false, e2.height = r2;
        var s2 = Math.ceil(h2 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
        d(t4, i3, n2, l2, this.compareMinX);
        for (var f2 = i3; f2 <= n2; f2 += l2) {
          var u3 = Math.min(f2 + l2 - 1, n2);
          d(t4, f2, u3, s2, this.compareMinY);
          for (var m2 = f2; m2 <= u3; m2 += s2) {
            var c2 = Math.min(m2 + s2 - 1, u3);
            e2.children.push(this._build(t4, m2, c2, r2 - 1));
          }
        }
        return a(e2, this.toBBox), e2;
      }, r.prototype._chooseSubtree = function(t4, i3, n2, r2) {
        for (; r2.push(i3), !i3.leaf && r2.length - 1 !== n2; ) {
          for (var e2 = 1 / 0, a2 = 1 / 0, h2 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
            var s2 = i3.children[o2], l2 = f(s2), u3 = (m2 = t4, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
            u3 < a2 ? (a2 = u3, e2 = l2 < e2 ? l2 : e2, h2 = s2) : u3 === a2 && l2 < e2 && (e2 = l2, h2 = s2);
          }
          i3 = h2 || i3.children[0];
        }
        var m2, c2;
        return i3;
      }, r.prototype._insert = function(t4, i3, n2) {
        var r2 = n2 ? t4 : this.toBBox(t4), e2 = [], a2 = this._chooseSubtree(r2, this.data, i3, e2);
        for (a2.children.push(t4), o(a2, r2); i3 >= 0 && e2[i3].children.length > this._maxEntries; ) this._split(e2, i3), i3--;
        this._adjustParentBBoxes(r2, e2, i3);
      }, r.prototype._split = function(t4, i3) {
        var n2 = t4[i3], r2 = n2.children.length, e2 = this._minEntries;
        this._chooseSplitAxis(n2, e2, r2);
        var h2 = this._chooseSplitIndex(n2, e2, r2), o2 = p(n2.children.splice(h2, n2.children.length - h2));
        o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t4[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
      }, r.prototype._splitRoot = function(t4, i3) {
        this.data = p([t4, i3]), this.data.height = t4.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
      }, r.prototype._chooseSplitIndex = function(t4, i3, n2) {
        for (var r2, e2, a2, o2, s2, l2, u3, m2 = 1 / 0, c2 = 1 / 0, p5 = i3; p5 <= n2 - i3; p5++) {
          var d2 = h(t4, 0, p5, this.toBBox), x = h(t4, p5, n2, this.toBBox), v = (e2 = d2, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u3 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u3 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u3 - s2)), M = f(d2) + f(x);
          v < m2 ? (m2 = v, r2 = p5, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r2 = p5);
        }
        return r2 || n2 - i3;
      }, r.prototype._chooseSplitAxis = function(t4, i3, n2) {
        var r2 = t4.leaf ? this.compareMinX : s, e2 = t4.leaf ? this.compareMinY : l;
        this._allDistMargin(t4, i3, n2, r2) < this._allDistMargin(t4, i3, n2, e2) && t4.children.sort(r2);
      }, r.prototype._allDistMargin = function(t4, i3, n2, r2) {
        t4.children.sort(r2);
        for (var e2 = this.toBBox, a2 = h(t4, 0, i3, e2), s2 = h(t4, n2 - i3, n2, e2), l2 = u2(a2) + u2(s2), f2 = i3; f2 < n2 - i3; f2++) {
          var m2 = t4.children[f2];
          o(a2, t4.leaf ? e2(m2) : m2), l2 += u2(a2);
        }
        for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
          var p5 = t4.children[c2];
          o(s2, t4.leaf ? e2(p5) : p5), l2 += u2(s2);
        }
        return l2;
      }, r.prototype._adjustParentBBoxes = function(t4, i3, n2) {
        for (var r2 = n2; r2 >= 0; r2--) o(i3[r2], t4);
      }, r.prototype._condense = function(t4) {
        for (var i3 = t4.length - 1, n2 = void 0; i3 >= 0; i3--) 0 === t4[i3].children.length ? i3 > 0 ? (n2 = t4[i3 - 1].children).splice(n2.indexOf(t4[i3]), 1) : this.clear() : a(t4[i3], this.toBBox);
      }, r;
    });
  }
});

// node_modules/ieee754/index.js
var require_ieee754 = __commonJS({
  "node_modules/ieee754/index.js"(exports4) {
    exports4.read = function(buffer3, offset2, isLE, mLen, nBytes) {
      var e, m;
      var eLen = nBytes * 8 - mLen - 1;
      var eMax = (1 << eLen) - 1;
      var eBias = eMax >> 1;
      var nBits = -7;
      var i2 = isLE ? nBytes - 1 : 0;
      var d = isLE ? -1 : 1;
      var s = buffer3[offset2 + i2];
      i2 += d;
      e = s & (1 << -nBits) - 1;
      s >>= -nBits;
      nBits += eLen;
      for (; nBits > 0; e = e * 256 + buffer3[offset2 + i2], i2 += d, nBits -= 8) {
      }
      m = e & (1 << -nBits) - 1;
      e >>= -nBits;
      nBits += mLen;
      for (; nBits > 0; m = m * 256 + buffer3[offset2 + i2], i2 += d, nBits -= 8) {
      }
      if (e === 0) {
        e = 1 - eBias;
      } else if (e === eMax) {
        return m ? NaN : (s ? -1 : 1) * Infinity;
      } else {
        m = m + Math.pow(2, mLen);
        e = e - eBias;
      }
      return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
    };
    exports4.write = function(buffer3, value, offset2, isLE, mLen, nBytes) {
      var e, m, c;
      var eLen = nBytes * 8 - mLen - 1;
      var eMax = (1 << eLen) - 1;
      var eBias = eMax >> 1;
      var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
      var i2 = isLE ? 0 : nBytes - 1;
      var d = isLE ? 1 : -1;
      var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
      value = Math.abs(value);
      if (isNaN(value) || value === Infinity) {
        m = isNaN(value) ? 1 : 0;
        e = eMax;
      } else {
        e = Math.floor(Math.log(value) / Math.LN2);
        if (value * (c = Math.pow(2, -e)) < 1) {
          e--;
          c *= 2;
        }
        if (e + eBias >= 1) {
          value += rt / c;
        } else {
          value += rt * Math.pow(2, 1 - eBias);
        }
        if (value * c >= 2) {
          e++;
          c /= 2;
        }
        if (e + eBias >= eMax) {
          m = 0;
          e = eMax;
        } else if (e + eBias >= 1) {
          m = (value * c - 1) * Math.pow(2, mLen);
          e = e + eBias;
        } else {
          m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
          e = 0;
        }
      }
      for (; mLen >= 8; buffer3[offset2 + i2] = m & 255, i2 += d, m /= 256, mLen -= 8) {
      }
      e = e << mLen | m;
      eLen += mLen;
      for (; eLen > 0; buffer3[offset2 + i2] = e & 255, i2 += d, e /= 256, eLen -= 8) {
      }
      buffer3[offset2 + i2 - d] |= s * 128;
    };
  }
});

// node_modules/pbf/index.js
var require_pbf = __commonJS({
  "node_modules/pbf/index.js"(exports4, module2) {
    "use strict";
    module2.exports = Pbf;
    var ieee754 = require_ieee754();
    function Pbf(buf) {
      this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);
      this.pos = 0;
      this.type = 0;
      this.length = this.buf.length;
    }
    Pbf.Varint = 0;
    Pbf.Fixed64 = 1;
    Pbf.Bytes = 2;
    Pbf.Fixed32 = 5;
    var SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
    var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
    var TEXT_DECODER_MIN_LENGTH = 12;
    var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf8");
    Pbf.prototype = {
      destroy: function() {
        this.buf = null;
      },
      // === READING =================================================================
      readFields: function(readField, result, end) {
        end = end || this.length;
        while (this.pos < end) {
          var val = this.readVarint(), tag = val >> 3, startPos = this.pos;
          this.type = val & 7;
          readField(tag, result, this);
          if (this.pos === startPos) this.skip(val);
        }
        return result;
      },
      readMessage: function(readField, result) {
        return this.readFields(readField, result, this.readVarint() + this.pos);
      },
      readFixed32: function() {
        var val = readUInt32(this.buf, this.pos);
        this.pos += 4;
        return val;
      },
      readSFixed32: function() {
        var val = readInt32(this.buf, this.pos);
        this.pos += 4;
        return val;
      },
      // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
      readFixed64: function() {
        var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
        this.pos += 8;
        return val;
      },
      readSFixed64: function() {
        var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
        this.pos += 8;
        return val;
      },
      readFloat: function() {
        var val = ieee754.read(this.buf, this.pos, true, 23, 4);
        this.pos += 4;
        return val;
      },
      readDouble: function() {
        var val = ieee754.read(this.buf, this.pos, true, 52, 8);
        this.pos += 8;
        return val;
      },
      readVarint: function(isSigned) {
        var buf = this.buf, val, b;
        b = buf[this.pos++];
        val = b & 127;
        if (b < 128) return val;
        b = buf[this.pos++];
        val |= (b & 127) << 7;
        if (b < 128) return val;
        b = buf[this.pos++];
        val |= (b & 127) << 14;
        if (b < 128) return val;
        b = buf[this.pos++];
        val |= (b & 127) << 21;
        if (b < 128) return val;
        b = buf[this.pos];
        val |= (b & 15) << 28;
        return readVarintRemainder(val, isSigned, this);
      },
      readVarint64: function() {
        return this.readVarint(true);
      },
      readSVarint: function() {
        var num = this.readVarint();
        return num % 2 === 1 ? (num + 1) / -2 : num / 2;
      },
      readBoolean: function() {
        return Boolean(this.readVarint());
      },
      readString: function() {
        var end = this.readVarint() + this.pos;
        var pos = this.pos;
        this.pos = end;
        if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
          return readUtf8TextDecoder(this.buf, pos, end);
        }
        return readUtf8(this.buf, pos, end);
      },
      readBytes: function() {
        var end = this.readVarint() + this.pos, buffer3 = this.buf.subarray(this.pos, end);
        this.pos = end;
        return buffer3;
      },
      // verbose for performance reasons; doesn't affect gzipped size
      readPackedVarint: function(arr, isSigned) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readVarint(isSigned));
        return arr;
      },
      readPackedSVarint: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readSVarint());
        return arr;
      },
      readPackedBoolean: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readBoolean());
        return arr;
      },
      readPackedFloat: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readFloat());
        return arr;
      },
      readPackedDouble: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readDouble());
        return arr;
      },
      readPackedFixed32: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readFixed32());
        return arr;
      },
      readPackedSFixed32: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readSFixed32());
        return arr;
      },
      readPackedFixed64: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readFixed64());
        return arr;
      },
      readPackedSFixed64: function(arr) {
        if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());
        var end = readPackedEnd(this);
        arr = arr || [];
        while (this.pos < end) arr.push(this.readSFixed64());
        return arr;
      },
      skip: function(val) {
        var type = val & 7;
        if (type === Pbf.Varint) while (this.buf[this.pos++] > 127) {
        }
        else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;
        else if (type === Pbf.Fixed32) this.pos += 4;
        else if (type === Pbf.Fixed64) this.pos += 8;
        else throw new Error("Unimplemented type: " + type);
      },
      // === WRITING =================================================================
      writeTag: function(tag, type) {
        this.writeVarint(tag << 3 | type);
      },
      realloc: function(min) {
        var length = this.length || 16;
        while (length < this.pos + min) length *= 2;
        if (length !== this.length) {
          var buf = new Uint8Array(length);
          buf.set(this.buf);
          this.buf = buf;
          this.length = length;
        }
      },
      finish: function() {
        this.length = this.pos;
        this.pos = 0;
        return this.buf.subarray(0, this.length);
      },
      writeFixed32: function(val) {
        this.realloc(4);
        writeInt32(this.buf, val, this.pos);
        this.pos += 4;
      },
      writeSFixed32: function(val) {
        this.realloc(4);
        writeInt32(this.buf, val, this.pos);
        this.pos += 4;
      },
      writeFixed64: function(val) {
        this.realloc(8);
        writeInt32(this.buf, val & -1, this.pos);
        writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
        this.pos += 8;
      },
      writeSFixed64: function(val) {
        this.realloc(8);
        writeInt32(this.buf, val & -1, this.pos);
        writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
        this.pos += 8;
      },
      writeVarint: function(val) {
        val = +val || 0;
        if (val > 268435455 || val < 0) {
          writeBigVarint(val, this);
          return;
        }
        this.realloc(4);
        this.buf[this.pos++] = val & 127 | (val > 127 ? 128 : 0);
        if (val <= 127) return;
        this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
        if (val <= 127) return;
        this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
        if (val <= 127) return;
        this.buf[this.pos++] = val >>> 7 & 127;
      },
      writeSVarint: function(val) {
        this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
      },
      writeBoolean: function(val) {
        this.writeVarint(Boolean(val));
      },
      writeString: function(str2) {
        str2 = String(str2);
        this.realloc(str2.length * 4);
        this.pos++;
        var startPos = this.pos;
        this.pos = writeUtf8(this.buf, str2, this.pos);
        var len = this.pos - startPos;
        if (len >= 128) makeRoomForExtraLength(startPos, len, this);
        this.pos = startPos - 1;
        this.writeVarint(len);
        this.pos += len;
      },
      writeFloat: function(val) {
        this.realloc(4);
        ieee754.write(this.buf, val, this.pos, true, 23, 4);
        this.pos += 4;
      },
      writeDouble: function(val) {
        this.realloc(8);
        ieee754.write(this.buf, val, this.pos, true, 52, 8);
        this.pos += 8;
      },
      writeBytes: function(buffer3) {
        var len = buffer3.length;
        this.writeVarint(len);
        this.realloc(len);
        for (var i2 = 0; i2 < len; i2++) this.buf[this.pos++] = buffer3[i2];
      },
      writeRawMessage: function(fn, obj) {
        this.pos++;
        var startPos = this.pos;
        fn(obj, this);
        var len = this.pos - startPos;
        if (len >= 128) makeRoomForExtraLength(startPos, len, this);
        this.pos = startPos - 1;
        this.writeVarint(len);
        this.pos += len;
      },
      writeMessage: function(tag, fn, obj) {
        this.writeTag(tag, Pbf.Bytes);
        this.writeRawMessage(fn, obj);
      },
      writePackedVarint: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedVarint, arr);
      },
      writePackedSVarint: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);
      },
      writePackedBoolean: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);
      },
      writePackedFloat: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedFloat, arr);
      },
      writePackedDouble: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedDouble, arr);
      },
      writePackedFixed32: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);
      },
      writePackedSFixed32: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);
      },
      writePackedFixed64: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);
      },
      writePackedSFixed64: function(tag, arr) {
        if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);
      },
      writeBytesField: function(tag, buffer3) {
        this.writeTag(tag, Pbf.Bytes);
        this.writeBytes(buffer3);
      },
      writeFixed32Field: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed32);
        this.writeFixed32(val);
      },
      writeSFixed32Field: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed32);
        this.writeSFixed32(val);
      },
      writeFixed64Field: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed64);
        this.writeFixed64(val);
      },
      writeSFixed64Field: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed64);
        this.writeSFixed64(val);
      },
      writeVarintField: function(tag, val) {
        this.writeTag(tag, Pbf.Varint);
        this.writeVarint(val);
      },
      writeSVarintField: function(tag, val) {
        this.writeTag(tag, Pbf.Varint);
        this.writeSVarint(val);
      },
      writeStringField: function(tag, str2) {
        this.writeTag(tag, Pbf.Bytes);
        this.writeString(str2);
      },
      writeFloatField: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed32);
        this.writeFloat(val);
      },
      writeDoubleField: function(tag, val) {
        this.writeTag(tag, Pbf.Fixed64);
        this.writeDouble(val);
      },
      writeBooleanField: function(tag, val) {
        this.writeVarintField(tag, Boolean(val));
      }
    };
    function readVarintRemainder(l, s, p) {
      var buf = p.buf, h, b;
      b = buf[p.pos++];
      h = (b & 112) >> 4;
      if (b < 128) return toNum(l, h, s);
      b = buf[p.pos++];
      h |= (b & 127) << 3;
      if (b < 128) return toNum(l, h, s);
      b = buf[p.pos++];
      h |= (b & 127) << 10;
      if (b < 128) return toNum(l, h, s);
      b = buf[p.pos++];
      h |= (b & 127) << 17;
      if (b < 128) return toNum(l, h, s);
      b = buf[p.pos++];
      h |= (b & 127) << 24;
      if (b < 128) return toNum(l, h, s);
      b = buf[p.pos++];
      h |= (b & 1) << 31;
      if (b < 128) return toNum(l, h, s);
      throw new Error("Expected varint not more than 10 bytes");
    }
    function readPackedEnd(pbf) {
      return pbf.type === Pbf.Bytes ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
    }
    function toNum(low, high, isSigned) {
      if (isSigned) {
        return high * 4294967296 + (low >>> 0);
      }
      return (high >>> 0) * 4294967296 + (low >>> 0);
    }
    function writeBigVarint(val, pbf) {
      var low, high;
      if (val >= 0) {
        low = val % 4294967296 | 0;
        high = val / 4294967296 | 0;
      } else {
        low = ~(-val % 4294967296);
        high = ~(-val / 4294967296);
        if (low ^ 4294967295) {
          low = low + 1 | 0;
        } else {
          low = 0;
          high = high + 1 | 0;
        }
      }
      if (val >= 18446744073709552e3 || val < -18446744073709552e3) {
        throw new Error("Given varint doesn't fit into 10 bytes");
      }
      pbf.realloc(10);
      writeBigVarintLow(low, high, pbf);
      writeBigVarintHigh(high, pbf);
    }
    function writeBigVarintLow(low, high, pbf) {
      pbf.buf[pbf.pos++] = low & 127 | 128;
      low >>>= 7;
      pbf.buf[pbf.pos++] = low & 127 | 128;
      low >>>= 7;
      pbf.buf[pbf.pos++] = low & 127 | 128;
      low >>>= 7;
      pbf.buf[pbf.pos++] = low & 127 | 128;
      low >>>= 7;
      pbf.buf[pbf.pos] = low & 127;
    }
    function writeBigVarintHigh(high, pbf) {
      var lsb = (high & 7) << 4;
      pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 128 : 0);
      if (!high) return;
      pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
      if (!high) return;
      pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
      if (!high) return;
      pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
      if (!high) return;
      pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
      if (!high) return;
      pbf.buf[pbf.pos++] = high & 127;
    }
    function makeRoomForExtraLength(startPos, len, pbf) {
      var extraLen = len <= 16383 ? 1 : len <= 2097151 ? 2 : len <= 268435455 ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
      pbf.realloc(extraLen);
      for (var i2 = pbf.pos - 1; i2 >= startPos; i2--) pbf.buf[i2 + extraLen] = pbf.buf[i2];
    }
    function writePackedVarint(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeVarint(arr[i2]);
    }
    function writePackedSVarint(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeSVarint(arr[i2]);
    }
    function writePackedFloat(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeFloat(arr[i2]);
    }
    function writePackedDouble(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeDouble(arr[i2]);
    }
    function writePackedBoolean(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeBoolean(arr[i2]);
    }
    function writePackedFixed32(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeFixed32(arr[i2]);
    }
    function writePackedSFixed32(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeSFixed32(arr[i2]);
    }
    function writePackedFixed64(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeFixed64(arr[i2]);
    }
    function writePackedSFixed64(arr, pbf) {
      for (var i2 = 0; i2 < arr.length; i2++) pbf.writeSFixed64(arr[i2]);
    }
    function readUInt32(buf, pos) {
      return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + buf[pos + 3] * 16777216;
    }
    function writeInt32(buf, val, pos) {
      buf[pos] = val;
      buf[pos + 1] = val >>> 8;
      buf[pos + 2] = val >>> 16;
      buf[pos + 3] = val >>> 24;
    }
    function readInt32(buf, pos) {
      return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + (buf[pos + 3] << 24);
    }
    function readUtf8(buf, pos, end) {
      var str2 = "";
      var i2 = pos;
      while (i2 < end) {
        var b0 = buf[i2];
        var c = null;
        var bytesPerSequence = b0 > 239 ? 4 : b0 > 223 ? 3 : b0 > 191 ? 2 : 1;
        if (i2 + bytesPerSequence > end) break;
        var b1, b2, b3;
        if (bytesPerSequence === 1) {
          if (b0 < 128) {
            c = b0;
          }
        } else if (bytesPerSequence === 2) {
          b1 = buf[i2 + 1];
          if ((b1 & 192) === 128) {
            c = (b0 & 31) << 6 | b1 & 63;
            if (c <= 127) {
              c = null;
            }
          }
        } else if (bytesPerSequence === 3) {
          b1 = buf[i2 + 1];
          b2 = buf[i2 + 2];
          if ((b1 & 192) === 128 && (b2 & 192) === 128) {
            c = (b0 & 15) << 12 | (b1 & 63) << 6 | b2 & 63;
            if (c <= 2047 || c >= 55296 && c <= 57343) {
              c = null;
            }
          }
        } else if (bytesPerSequence === 4) {
          b1 = buf[i2 + 1];
          b2 = buf[i2 + 2];
          b3 = buf[i2 + 3];
          if ((b1 & 192) === 128 && (b2 & 192) === 128 && (b3 & 192) === 128) {
            c = (b0 & 15) << 18 | (b1 & 63) << 12 | (b2 & 63) << 6 | b3 & 63;
            if (c <= 65535 || c >= 1114112) {
              c = null;
            }
          }
        }
        if (c === null) {
          c = 65533;
          bytesPerSequence = 1;
        } else if (c > 65535) {
          c -= 65536;
          str2 += String.fromCharCode(c >>> 10 & 1023 | 55296);
          c = 56320 | c & 1023;
        }
        str2 += String.fromCharCode(c);
        i2 += bytesPerSequence;
      }
      return str2;
    }
    function readUtf8TextDecoder(buf, pos, end) {
      return utf8TextDecoder.decode(buf.subarray(pos, end));
    }
    function writeUtf8(buf, str2, pos) {
      for (var i2 = 0, c, lead; i2 < str2.length; i2++) {
        c = str2.charCodeAt(i2);
        if (c > 55295 && c < 57344) {
          if (lead) {
            if (c < 56320) {
              buf[pos++] = 239;
              buf[pos++] = 191;
              buf[pos++] = 189;
              lead = c;
              continue;
            } else {
              c = lead - 55296 << 10 | c - 56320 | 65536;
              lead = null;
            }
          } else {
            if (c > 56319 || i2 + 1 === str2.length) {
              buf[pos++] = 239;
              buf[pos++] = 191;
              buf[pos++] = 189;
            } else {
              lead = c;
            }
            continue;
          }
        } else if (lead) {
          buf[pos++] = 239;
          buf[pos++] = 191;
          buf[pos++] = 189;
          lead = null;
        }
        if (c < 128) {
          buf[pos++] = c;
        } else {
          if (c < 2048) {
            buf[pos++] = c >> 6 | 192;
          } else {
            if (c < 65536) {
              buf[pos++] = c >> 12 | 224;
            } else {
              buf[pos++] = c >> 18 | 240;
              buf[pos++] = c >> 12 & 63 | 128;
            }
            buf[pos++] = c >> 6 & 63 | 128;
          }
          buf[pos++] = c & 63 | 128;
        }
      }
      return pos;
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/utils.js
var require_utils = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.extend = extend4;
    exports4.indexOf = indexOf2;
    exports4.escapeExpression = escapeExpression;
    exports4.isEmpty = isEmpty4;
    exports4.createFrame = createFrame;
    exports4.blockParams = blockParams;
    exports4.appendContextPath = appendContextPath;
    var escape = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#x27;",
      "`": "&#x60;",
      "=": "&#x3D;"
    };
    var badChars = /[&<>"'`=]/g;
    var possible = /[&<>"'`=]/;
    function escapeChar(chr) {
      return escape[chr];
    }
    function extend4(obj) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        for (var key in arguments[i2]) {
          if (Object.prototype.hasOwnProperty.call(arguments[i2], key)) {
            obj[key] = arguments[i2][key];
          }
        }
      }
      return obj;
    }
    var toString7 = Object.prototype.toString;
    exports4.toString = toString7;
    var isFunction5 = function isFunction6(value) {
      return typeof value === "function";
    };
    if (isFunction5(/x/)) {
      exports4.isFunction = isFunction5 = function(value) {
        return typeof value === "function" && toString7.call(value) === "[object Function]";
      };
    }
    exports4.isFunction = isFunction5;
    var isArray4 = Array.isArray || function(value) {
      return value && typeof value === "object" ? toString7.call(value) === "[object Array]" : false;
    };
    exports4.isArray = isArray4;
    function indexOf2(array2, value) {
      for (var i2 = 0, len = array2.length; i2 < len; i2++) {
        if (array2[i2] === value) {
          return i2;
        }
      }
      return -1;
    }
    function escapeExpression(string) {
      if (typeof string !== "string") {
        if (string && string.toHTML) {
          return string.toHTML();
        } else if (string == null) {
          return "";
        } else if (!string) {
          return string + "";
        }
        string = "" + string;
      }
      if (!possible.test(string)) {
        return string;
      }
      return string.replace(badChars, escapeChar);
    }
    function isEmpty4(value) {
      if (!value && value !== 0) {
        return true;
      } else if (isArray4(value) && value.length === 0) {
        return true;
      } else {
        return false;
      }
    }
    function createFrame(object) {
      var frame = extend4({}, object);
      frame._parent = object;
      return frame;
    }
    function blockParams(params, ids) {
      params.path = ids;
      return params;
    }
    function appendContextPath(contextPath, id2) {
      return (contextPath ? contextPath + "." : "") + id2;
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/exception.js
var require_exception = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/exception.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var errorProps = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"];
    function Exception(message, node) {
      var loc = node && node.loc, line = void 0, endLineNumber = void 0, column = void 0, endColumn = void 0;
      if (loc) {
        line = loc.start.line;
        endLineNumber = loc.end.line;
        column = loc.start.column;
        endColumn = loc.end.column;
        message += " - " + line + ":" + column;
      }
      var tmp = Error.prototype.constructor.call(this, message);
      for (var idx = 0; idx < errorProps.length; idx++) {
        this[errorProps[idx]] = tmp[errorProps[idx]];
      }
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this, Exception);
      }
      try {
        if (loc) {
          this.lineNumber = line;
          this.endLineNumber = endLineNumber;
          if (Object.defineProperty) {
            Object.defineProperty(this, "column", {
              value: column,
              enumerable: true
            });
            Object.defineProperty(this, "endColumn", {
              value: endColumn,
              enumerable: true
            });
          } else {
            this.column = column;
            this.endColumn = endColumn;
          }
        }
      } catch (nop) {
      }
    }
    Exception.prototype = new Error();
    exports4["default"] = Exception;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js
var require_block_helper_missing = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var _utils = require_utils();
    exports4["default"] = function(instance) {
      instance.registerHelper("blockHelperMissing", function(context2, options) {
        var inverse30 = options.inverse, fn = options.fn;
        if (context2 === true) {
          return fn(this);
        } else if (context2 === false || context2 == null) {
          return inverse30(this);
        } else if (_utils.isArray(context2)) {
          if (context2.length > 0) {
            if (options.ids) {
              options.ids = [options.name];
            }
            return instance.helpers.each(context2, options);
          } else {
            return inverse30(this);
          }
        } else {
          if (options.data && options.ids) {
            var data = _utils.createFrame(options.data);
            data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
            options = { data };
          }
          return fn(context2, options);
        }
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/each.js
var require_each = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _utils = require_utils();
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    exports4["default"] = function(instance) {
      instance.registerHelper("each", function(context2, options) {
        if (!options) {
          throw new _exception2["default"]("Must pass iterator to #each");
        }
        var fn = options.fn, inverse30 = options.inverse, i2 = 0, ret = "", data = void 0, contextPath = void 0;
        if (options.data && options.ids) {
          contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + ".";
        }
        if (_utils.isFunction(context2)) {
          context2 = context2.call(this);
        }
        if (options.data) {
          data = _utils.createFrame(options.data);
        }
        function execIteration(field, index, last2) {
          if (data) {
            data.key = field;
            data.index = index;
            data.first = index === 0;
            data.last = !!last2;
            if (contextPath) {
              data.contextPath = contextPath + field;
            }
          }
          ret = ret + fn(context2[field], {
            data,
            blockParams: _utils.blockParams([context2[field], field], [contextPath + field, null])
          });
        }
        if (context2 && typeof context2 === "object") {
          if (_utils.isArray(context2)) {
            for (var j = context2.length; i2 < j; i2++) {
              if (i2 in context2) {
                execIteration(i2, i2, i2 === context2.length - 1);
              }
            }
          } else if (typeof Symbol === "function" && context2[Symbol.iterator]) {
            var newContext = [];
            var iterator2 = context2[Symbol.iterator]();
            for (var it = iterator2.next(); !it.done; it = iterator2.next()) {
              newContext.push(it.value);
            }
            context2 = newContext;
            for (var j = context2.length; i2 < j; i2++) {
              execIteration(i2, i2, i2 === context2.length - 1);
            }
          } else {
            (function() {
              var priorKey = void 0;
              Object.keys(context2).forEach(function(key) {
                if (priorKey !== void 0) {
                  execIteration(priorKey, i2 - 1);
                }
                priorKey = key;
                i2++;
              });
              if (priorKey !== void 0) {
                execIteration(priorKey, i2 - 1, true);
              }
            })();
          }
        }
        if (i2 === 0) {
          ret = inverse30(this);
        }
        return ret;
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js
var require_helper_missing = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    exports4["default"] = function(instance) {
      instance.registerHelper("helperMissing", function() {
        if (arguments.length === 1) {
          return void 0;
        } else {
          throw new _exception2["default"]('Missing helper: "' + arguments[arguments.length - 1].name + '"');
        }
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/if.js
var require_if = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _utils = require_utils();
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    exports4["default"] = function(instance) {
      instance.registerHelper("if", function(conditional, options) {
        if (arguments.length != 2) {
          throw new _exception2["default"]("#if requires exactly one argument");
        }
        if (_utils.isFunction(conditional)) {
          conditional = conditional.call(this);
        }
        if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
          return options.inverse(this);
        } else {
          return options.fn(this);
        }
      });
      instance.registerHelper("unless", function(conditional, options) {
        if (arguments.length != 2) {
          throw new _exception2["default"]("#unless requires exactly one argument");
        }
        return instance.helpers["if"].call(this, conditional, {
          fn: options.inverse,
          inverse: options.fn,
          hash: options.hash
        });
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/log.js
var require_log = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    exports4["default"] = function(instance) {
      instance.registerHelper("log", function() {
        var args = [void 0], options = arguments[arguments.length - 1];
        for (var i2 = 0; i2 < arguments.length - 1; i2++) {
          args.push(arguments[i2]);
        }
        var level = 1;
        if (options.hash.level != null) {
          level = options.hash.level;
        } else if (options.data && options.data.level != null) {
          level = options.data.level;
        }
        args[0] = level;
        instance.log.apply(instance, args);
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js
var require_lookup = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    exports4["default"] = function(instance) {
      instance.registerHelper("lookup", function(obj, field, options) {
        if (!obj) {
          return obj;
        }
        return options.lookupProperty(obj, field);
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers/with.js
var require_with = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _utils = require_utils();
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    exports4["default"] = function(instance) {
      instance.registerHelper("with", function(context2, options) {
        if (arguments.length != 2) {
          throw new _exception2["default"]("#with requires exactly one argument");
        }
        if (_utils.isFunction(context2)) {
          context2 = context2.call(this);
        }
        var fn = options.fn;
        if (!_utils.isEmpty(context2)) {
          var data = options.data;
          if (options.data && options.ids) {
            data = _utils.createFrame(options.data);
            data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
          }
          return fn(context2, {
            data,
            blockParams: _utils.blockParams([context2], [data && data.contextPath])
          });
        } else {
          return options.inverse(this);
        }
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/helpers.js
var require_helpers = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/helpers.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.registerDefaultHelpers = registerDefaultHelpers;
    exports4.moveHelperToHooks = moveHelperToHooks;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _helpersBlockHelperMissing = require_block_helper_missing();
    var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
    var _helpersEach = require_each();
    var _helpersEach2 = _interopRequireDefault(_helpersEach);
    var _helpersHelperMissing = require_helper_missing();
    var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
    var _helpersIf = require_if();
    var _helpersIf2 = _interopRequireDefault(_helpersIf);
    var _helpersLog = require_log();
    var _helpersLog2 = _interopRequireDefault(_helpersLog);
    var _helpersLookup = require_lookup();
    var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
    var _helpersWith = require_with();
    var _helpersWith2 = _interopRequireDefault(_helpersWith);
    function registerDefaultHelpers(instance) {
      _helpersBlockHelperMissing2["default"](instance);
      _helpersEach2["default"](instance);
      _helpersHelperMissing2["default"](instance);
      _helpersIf2["default"](instance);
      _helpersLog2["default"](instance);
      _helpersLookup2["default"](instance);
      _helpersWith2["default"](instance);
    }
    function moveHelperToHooks(instance, helperName, keepHelper) {
      if (instance.helpers[helperName]) {
        instance.hooks[helperName] = instance.helpers[helperName];
        if (!keepHelper) {
          delete instance.helpers[helperName];
        }
      }
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js
var require_inline = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var _utils = require_utils();
    exports4["default"] = function(instance) {
      instance.registerDecorator("inline", function(fn, props, container, options) {
        var ret = fn;
        if (!props.partials) {
          props.partials = {};
          ret = function(context2, options2) {
            var original = container.partials;
            container.partials = _utils.extend({}, original, props.partials);
            var ret2 = fn(context2, options2);
            container.partials = original;
            return ret2;
          };
        }
        props.partials[options.args[0]] = options.fn;
        return ret;
      });
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/decorators.js
var require_decorators = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/decorators.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.registerDefaultDecorators = registerDefaultDecorators;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _decoratorsInline = require_inline();
    var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
    function registerDefaultDecorators(instance) {
      _decoratorsInline2["default"](instance);
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/logger.js
var require_logger = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/logger.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var _utils = require_utils();
    var logger2 = {
      methodMap: ["debug", "info", "warn", "error"],
      level: "info",
      // Maps a given level value to the `methodMap` indexes above.
      lookupLevel: function lookupLevel(level) {
        if (typeof level === "string") {
          var levelMap = _utils.indexOf(logger2.methodMap, level.toLowerCase());
          if (levelMap >= 0) {
            level = levelMap;
          } else {
            level = parseInt(level, 10);
          }
        }
        return level;
      },
      // Can be overridden in the host environment
      log: function log(level) {
        level = logger2.lookupLevel(level);
        if (typeof console !== "undefined" && logger2.lookupLevel(logger2.level) <= level) {
          var method = logger2.methodMap[level];
          if (!console[method]) {
            method = "log";
          }
          for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            message[_key - 1] = arguments[_key];
          }
          console[method].apply(console, message);
        }
      }
    };
    exports4["default"] = logger2;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js
var require_create_new_lookup_object = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.createNewLookupObject = createNewLookupObject;
    var _utils = require_utils();
    function createNewLookupObject() {
      for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
        sources[_key] = arguments[_key];
      }
      return _utils.extend.apply(void 0, [/* @__PURE__ */ Object.create(null)].concat(sources));
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
var require_proto_access = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.createProtoAccessControl = createProtoAccessControl;
    exports4.resultIsAllowed = resultIsAllowed;
    exports4.resetLoggedProperties = resetLoggedProperties;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _createNewLookupObject = require_create_new_lookup_object();
    var _logger = require_logger();
    var _logger2 = _interopRequireDefault(_logger);
    var loggedProperties = /* @__PURE__ */ Object.create(null);
    function createProtoAccessControl(runtimeOptions) {
      var defaultMethodWhiteList = /* @__PURE__ */ Object.create(null);
      defaultMethodWhiteList["constructor"] = false;
      defaultMethodWhiteList["__defineGetter__"] = false;
      defaultMethodWhiteList["__defineSetter__"] = false;
      defaultMethodWhiteList["__lookupGetter__"] = false;
      var defaultPropertyWhiteList = /* @__PURE__ */ Object.create(null);
      defaultPropertyWhiteList["__proto__"] = false;
      return {
        properties: {
          whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
          defaultValue: runtimeOptions.allowProtoPropertiesByDefault
        },
        methods: {
          whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
          defaultValue: runtimeOptions.allowProtoMethodsByDefault
        }
      };
    }
    function resultIsAllowed(result, protoAccessControl, propertyName) {
      if (typeof result === "function") {
        return checkWhiteList(protoAccessControl.methods, propertyName);
      } else {
        return checkWhiteList(protoAccessControl.properties, propertyName);
      }
    }
    function checkWhiteList(protoAccessControlForType, propertyName) {
      if (protoAccessControlForType.whitelist[propertyName] !== void 0) {
        return protoAccessControlForType.whitelist[propertyName] === true;
      }
      if (protoAccessControlForType.defaultValue !== void 0) {
        return protoAccessControlForType.defaultValue;
      }
      logUnexpecedPropertyAccessOnce(propertyName);
      return false;
    }
    function logUnexpecedPropertyAccessOnce(propertyName) {
      if (loggedProperties[propertyName] !== true) {
        loggedProperties[propertyName] = true;
        _logger2["default"].log("error", 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
      }
    }
    function resetLoggedProperties() {
      Object.keys(loggedProperties).forEach(function(propertyName) {
        delete loggedProperties[propertyName];
      });
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/base.js
var require_base = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/base.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.HandlebarsEnvironment = HandlebarsEnvironment;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _utils = require_utils();
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    var _helpers = require_helpers();
    var _decorators = require_decorators();
    var _logger = require_logger();
    var _logger2 = _interopRequireDefault(_logger);
    var _internalProtoAccess = require_proto_access();
    var VERSION10 = "4.7.8";
    exports4.VERSION = VERSION10;
    var COMPILER_REVISION = 8;
    exports4.COMPILER_REVISION = COMPILER_REVISION;
    var LAST_COMPATIBLE_COMPILER_REVISION = 7;
    exports4.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
    var REVISION_CHANGES = {
      1: "<= 1.0.rc.2",
      // 1.0.rc.2 is actually rev2 but doesn't report it
      2: "== 1.0.0-rc.3",
      3: "== 1.0.0-rc.4",
      4: "== 1.x.x",
      5: "== 2.0.0-alpha.x",
      6: ">= 2.0.0-beta.1",
      7: ">= 4.0.0 <4.3.0",
      8: ">= 4.3.0"
    };
    exports4.REVISION_CHANGES = REVISION_CHANGES;
    var objectType = "[object Object]";
    function HandlebarsEnvironment(helpers5, partials, decorators) {
      this.helpers = helpers5 || {};
      this.partials = partials || {};
      this.decorators = decorators || {};
      _helpers.registerDefaultHelpers(this);
      _decorators.registerDefaultDecorators(this);
    }
    HandlebarsEnvironment.prototype = {
      constructor: HandlebarsEnvironment,
      logger: _logger2["default"],
      log: _logger2["default"].log,
      registerHelper: function registerHelper4(name, fn) {
        if (_utils.toString.call(name) === objectType) {
          if (fn) {
            throw new _exception2["default"]("Arg not supported with multiple helpers");
          }
          _utils.extend(this.helpers, name);
        } else {
          this.helpers[name] = fn;
        }
      },
      unregisterHelper: function unregisterHelper(name) {
        delete this.helpers[name];
      },
      registerPartial: function registerPartial(name, partial) {
        if (_utils.toString.call(name) === objectType) {
          _utils.extend(this.partials, name);
        } else {
          if (typeof partial === "undefined") {
            throw new _exception2["default"]('Attempting to register a partial called "' + name + '" as undefined');
          }
          this.partials[name] = partial;
        }
      },
      unregisterPartial: function unregisterPartial(name) {
        delete this.partials[name];
      },
      registerDecorator: function registerDecorator(name, fn) {
        if (_utils.toString.call(name) === objectType) {
          if (fn) {
            throw new _exception2["default"]("Arg not supported with multiple decorators");
          }
          _utils.extend(this.decorators, name);
        } else {
          this.decorators[name] = fn;
        }
      },
      unregisterDecorator: function unregisterDecorator(name) {
        delete this.decorators[name];
      },
      /**
       * Reset the memory of illegal property accesses that have already been logged.
       * @deprecated should only be used in handlebars test-cases
       */
      resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
        _internalProtoAccess.resetLoggedProperties();
      }
    };
    var log = _logger2["default"].log;
    exports4.log = log;
    exports4.createFrame = _utils.createFrame;
    exports4.logger = _logger2["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/safe-string.js
var require_safe_string = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function SafeString(string) {
      this.string = string;
    }
    SafeString.prototype.toString = SafeString.prototype.toHTML = function() {
      return "" + this.string;
    };
    exports4["default"] = SafeString;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js
var require_wrapHelper = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.wrapHelper = wrapHelper;
    function wrapHelper(helper, transformOptionsFn) {
      if (typeof helper !== "function") {
        return helper;
      }
      var wrapper = function wrapper2() {
        var options = arguments[arguments.length - 1];
        arguments[arguments.length - 1] = transformOptionsFn(options);
        return helper.apply(this, arguments);
      };
      return wrapper;
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/runtime.js
var require_runtime = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/runtime.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.checkRevision = checkRevision;
    exports4.template = template;
    exports4.wrapProgram = wrapProgram;
    exports4.resolvePartial = resolvePartial;
    exports4.invokePartial = invokePartial;
    exports4.noop = noop5;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      } else {
        var newObj = {};
        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
          }
        }
        newObj["default"] = obj;
        return newObj;
      }
    }
    var _utils = require_utils();
    var Utils = _interopRequireWildcard(_utils);
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    var _base = require_base();
    var _helpers = require_helpers();
    var _internalWrapHelper = require_wrapHelper();
    var _internalProtoAccess = require_proto_access();
    function checkRevision(compilerInfo) {
      var compilerRevision = compilerInfo && compilerInfo[0] || 1, currentRevision = _base.COMPILER_REVISION;
      if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
        return;
      }
      if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
        var runtimeVersions = _base.REVISION_CHANGES[currentRevision], compilerVersions = _base.REVISION_CHANGES[compilerRevision];
        throw new _exception2["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + runtimeVersions + ") or downgrade your runtime to an older version (" + compilerVersions + ").");
      } else {
        throw new _exception2["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + compilerInfo[1] + ").");
      }
    }
    function template(templateSpec, env) {
      if (!env) {
        throw new _exception2["default"]("No environment passed to template");
      }
      if (!templateSpec || !templateSpec.main) {
        throw new _exception2["default"]("Unknown template object: " + typeof templateSpec);
      }
      templateSpec.main.decorator = templateSpec.main_d;
      env.VM.checkRevision(templateSpec.compiler);
      var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
      function invokePartialWrapper(partial, context2, options) {
        if (options.hash) {
          context2 = Utils.extend({}, context2, options.hash);
          if (options.ids) {
            options.ids[0] = true;
          }
        }
        partial = env.VM.resolvePartial.call(this, partial, context2, options);
        var extendedOptions = Utils.extend({}, options, {
          hooks: this.hooks,
          protoAccessControl: this.protoAccessControl
        });
        var result = env.VM.invokePartial.call(this, partial, context2, extendedOptions);
        if (result == null && env.compile) {
          options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
          result = options.partials[options.name](context2, extendedOptions);
        }
        if (result != null) {
          if (options.indent) {
            var lines = result.split("\n");
            for (var i2 = 0, l = lines.length; i2 < l; i2++) {
              if (!lines[i2] && i2 + 1 === l) {
                break;
              }
              lines[i2] = options.indent + lines[i2];
            }
            result = lines.join("\n");
          }
          return result;
        } else {
          throw new _exception2["default"]("The partial " + options.name + " could not be compiled when running in runtime-only mode");
        }
      }
      var container = {
        strict: function strict(obj, name, loc) {
          if (!obj || !(name in obj)) {
            throw new _exception2["default"]('"' + name + '" not defined in ' + obj, {
              loc
            });
          }
          return container.lookupProperty(obj, name);
        },
        lookupProperty: function lookupProperty(parent, propertyName) {
          var result = parent[propertyName];
          if (result == null) {
            return result;
          }
          if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
            return result;
          }
          if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
            return result;
          }
          return void 0;
        },
        lookup: function lookup(depths, name) {
          var len = depths.length;
          for (var i2 = 0; i2 < len; i2++) {
            var result = depths[i2] && container.lookupProperty(depths[i2], name);
            if (result != null) {
              return depths[i2][name];
            }
          }
        },
        lambda: function lambda(current, context2) {
          return typeof current === "function" ? current.call(context2) : current;
        },
        escapeExpression: Utils.escapeExpression,
        invokePartial: invokePartialWrapper,
        fn: function fn(i2) {
          var ret2 = templateSpec[i2];
          ret2.decorator = templateSpec[i2 + "_d"];
          return ret2;
        },
        programs: [],
        program: function program(i2, data, declaredBlockParams, blockParams, depths) {
          var programWrapper = this.programs[i2], fn = this.fn(i2);
          if (data || depths || blockParams || declaredBlockParams) {
            programWrapper = wrapProgram(this, i2, fn, data, declaredBlockParams, blockParams, depths);
          } else if (!programWrapper) {
            programWrapper = this.programs[i2] = wrapProgram(this, i2, fn);
          }
          return programWrapper;
        },
        data: function data(value, depth) {
          while (value && depth--) {
            value = value._parent;
          }
          return value;
        },
        mergeIfNeeded: function mergeIfNeeded(param, common) {
          var obj = param || common;
          if (param && common && param !== common) {
            obj = Utils.extend({}, common, param);
          }
          return obj;
        },
        // An empty object to use as replacement for null-contexts
        nullContext: Object.seal({}),
        noop: env.VM.noop,
        compilerInfo: templateSpec.compiler
      };
      function ret(context2) {
        var options = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
        var data = options.data;
        ret._setup(options);
        if (!options.partial && templateSpec.useData) {
          data = initData(context2, data);
        }
        var depths = void 0, blockParams = templateSpec.useBlockParams ? [] : void 0;
        if (templateSpec.useDepths) {
          if (options.depths) {
            depths = context2 != options.depths[0] ? [context2].concat(options.depths) : options.depths;
          } else {
            depths = [context2];
          }
        }
        function main(context3) {
          return "" + templateSpec.main(container, context3, container.helpers, container.partials, data, blockParams, depths);
        }
        main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
        return main(context2, options);
      }
      ret.isTop = true;
      ret._setup = function(options) {
        if (!options.partial) {
          var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
          wrapHelpersToPassLookupProperty(mergedHelpers, container);
          container.helpers = mergedHelpers;
          if (templateSpec.usePartial) {
            container.partials = container.mergeIfNeeded(options.partials, env.partials);
          }
          if (templateSpec.usePartial || templateSpec.useDecorators) {
            container.decorators = Utils.extend({}, env.decorators, options.decorators);
          }
          container.hooks = {};
          container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
          var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
          _helpers.moveHelperToHooks(container, "helperMissing", keepHelperInHelpers);
          _helpers.moveHelperToHooks(container, "blockHelperMissing", keepHelperInHelpers);
        } else {
          container.protoAccessControl = options.protoAccessControl;
          container.helpers = options.helpers;
          container.partials = options.partials;
          container.decorators = options.decorators;
          container.hooks = options.hooks;
        }
      };
      ret._child = function(i2, data, blockParams, depths) {
        if (templateSpec.useBlockParams && !blockParams) {
          throw new _exception2["default"]("must pass block params");
        }
        if (templateSpec.useDepths && !depths) {
          throw new _exception2["default"]("must pass parent depths");
        }
        return wrapProgram(container, i2, templateSpec[i2], data, 0, blockParams, depths);
      };
      return ret;
    }
    function wrapProgram(container, i2, fn, data, declaredBlockParams, blockParams, depths) {
      function prog(context2) {
        var options = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
        var currentDepths = depths;
        if (depths && context2 != depths[0] && !(context2 === container.nullContext && depths[0] === null)) {
          currentDepths = [context2].concat(depths);
        }
        return fn(container, context2, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
      }
      prog = executeDecorators(fn, prog, container, depths, data, blockParams);
      prog.program = i2;
      prog.depth = depths ? depths.length : 0;
      prog.blockParams = declaredBlockParams || 0;
      return prog;
    }
    function resolvePartial(partial, context2, options) {
      if (!partial) {
        if (options.name === "@partial-block") {
          partial = options.data["partial-block"];
        } else {
          partial = options.partials[options.name];
        }
      } else if (!partial.call && !options.name) {
        options.name = partial;
        partial = options.partials[partial];
      }
      return partial;
    }
    function invokePartial(partial, context2, options) {
      var currentPartialBlock = options.data && options.data["partial-block"];
      options.partial = true;
      if (options.ids) {
        options.data.contextPath = options.ids[0] || options.data.contextPath;
      }
      var partialBlock = void 0;
      if (options.fn && options.fn !== noop5) {
        (function() {
          options.data = _base.createFrame(options.data);
          var fn = options.fn;
          partialBlock = options.data["partial-block"] = function partialBlockWrapper(context3) {
            var options2 = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
            options2.data = _base.createFrame(options2.data);
            options2.data["partial-block"] = currentPartialBlock;
            return fn(context3, options2);
          };
          if (fn.partials) {
            options.partials = Utils.extend({}, options.partials, fn.partials);
          }
        })();
      }
      if (partial === void 0 && partialBlock) {
        partial = partialBlock;
      }
      if (partial === void 0) {
        throw new _exception2["default"]("The partial " + options.name + " could not be found");
      } else if (partial instanceof Function) {
        return partial(context2, options);
      }
    }
    function noop5() {
      return "";
    }
    function initData(context2, data) {
      if (!data || !("root" in data)) {
        data = data ? _base.createFrame(data) : {};
        data.root = context2;
      }
      return data;
    }
    function executeDecorators(fn, prog, container, depths, data, blockParams) {
      if (fn.decorator) {
        var props = {};
        prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
        Utils.extend(prog, props);
      }
      return prog;
    }
    function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
      Object.keys(mergedHelpers).forEach(function(helperName) {
        var helper = mergedHelpers[helperName];
        mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
      });
    }
    function passLookupPropertyOption(helper, container) {
      var lookupProperty = container.lookupProperty;
      return _internalWrapHelper.wrapHelper(helper, function(options) {
        return Utils.extend({ lookupProperty }, options);
      });
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/no-conflict.js
var require_no_conflict = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    exports4["default"] = function(Handlebars5) {
      (function() {
        if (typeof globalThis === "object") return;
        Object.prototype.__defineGetter__("__magic__", function() {
          return this;
        });
        __magic__.globalThis = __magic__;
        delete Object.prototype.__magic__;
      })();
      var $Handlebars = globalThis.Handlebars;
      Handlebars5.noConflict = function() {
        if (globalThis.Handlebars === Handlebars5) {
          globalThis.Handlebars = $Handlebars;
        }
        return Handlebars5;
      };
    };
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars.runtime.js
var require_handlebars_runtime = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars.runtime.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      } else {
        var newObj = {};
        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
          }
        }
        newObj["default"] = obj;
        return newObj;
      }
    }
    var _handlebarsBase = require_base();
    var base = _interopRequireWildcard(_handlebarsBase);
    var _handlebarsSafeString = require_safe_string();
    var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
    var _handlebarsException = require_exception();
    var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
    var _handlebarsUtils = require_utils();
    var Utils = _interopRequireWildcard(_handlebarsUtils);
    var _handlebarsRuntime = require_runtime();
    var runtime = _interopRequireWildcard(_handlebarsRuntime);
    var _handlebarsNoConflict = require_no_conflict();
    var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
    function create4() {
      var hb = new base.HandlebarsEnvironment();
      Utils.extend(hb, base);
      hb.SafeString = _handlebarsSafeString2["default"];
      hb.Exception = _handlebarsException2["default"];
      hb.Utils = Utils;
      hb.escapeExpression = Utils.escapeExpression;
      hb.VM = runtime;
      hb.template = function(spec2) {
        return runtime.template(spec2, hb);
      };
      return hb;
    }
    var inst = create4();
    inst.create = create4;
    _handlebarsNoConflict2["default"](inst);
    inst["default"] = inst;
    exports4["default"] = inst;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js
var require_ast = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var AST = {
      // Public API used to evaluate derived attributes regarding AST nodes
      helpers: {
        // a mustache is definitely a helper if:
        // * it is an eligible helper, and
        // * it has at least one parameter or hash segment
        helperExpression: function helperExpression(node) {
          return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
        },
        scopedId: function scopedId(path) {
          return /^\.|this\b/.test(path.original);
        },
        // an ID is simple if it only has one part, and that part is not
        // `..` or `this`.
        simpleId: function simpleId(path) {
          return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
        }
      }
    };
    exports4["default"] = AST;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js
var require_parser = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var handlebars = function() {
      var parser = {
        trace: function trace() {
        },
        yy: {},
        symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
        terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
        productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
        performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
          var $0 = $$.length - 1;
          switch (yystate) {
            case 1:
              return $$[$0 - 1];
              break;
            case 2:
              this.$ = yy.prepareProgram($$[$0]);
              break;
            case 3:
              this.$ = $$[$0];
              break;
            case 4:
              this.$ = $$[$0];
              break;
            case 5:
              this.$ = $$[$0];
              break;
            case 6:
              this.$ = $$[$0];
              break;
            case 7:
              this.$ = $$[$0];
              break;
            case 8:
              this.$ = $$[$0];
              break;
            case 9:
              this.$ = {
                type: "CommentStatement",
                value: yy.stripComment($$[$0]),
                strip: yy.stripFlags($$[$0], $$[$0]),
                loc: yy.locInfo(this._$)
              };
              break;
            case 10:
              this.$ = {
                type: "ContentStatement",
                original: $$[$0],
                value: $$[$0],
                loc: yy.locInfo(this._$)
              };
              break;
            case 11:
              this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
              break;
            case 12:
              this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
              break;
            case 13:
              this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
              break;
            case 14:
              this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
              break;
            case 15:
              this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
              break;
            case 16:
              this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
              break;
            case 17:
              this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
              break;
            case 18:
              this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
              break;
            case 19:
              var inverse30 = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), program = yy.prepareProgram([inverse30], $$[$0 - 1].loc);
              program.chained = true;
              this.$ = { strip: $$[$0 - 2].strip, program, chain: true };
              break;
            case 20:
              this.$ = $$[$0];
              break;
            case 21:
              this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
              break;
            case 22:
              this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
              break;
            case 23:
              this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
              break;
            case 24:
              this.$ = {
                type: "PartialStatement",
                name: $$[$0 - 3],
                params: $$[$0 - 2],
                hash: $$[$0 - 1],
                indent: "",
                strip: yy.stripFlags($$[$0 - 4], $$[$0]),
                loc: yy.locInfo(this._$)
              };
              break;
            case 25:
              this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
              break;
            case 26:
              this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
              break;
            case 27:
              this.$ = $$[$0];
              break;
            case 28:
              this.$ = $$[$0];
              break;
            case 29:
              this.$ = {
                type: "SubExpression",
                path: $$[$0 - 3],
                params: $$[$0 - 2],
                hash: $$[$0 - 1],
                loc: yy.locInfo(this._$)
              };
              break;
            case 30:
              this.$ = { type: "Hash", pairs: $$[$0], loc: yy.locInfo(this._$) };
              break;
            case 31:
              this.$ = { type: "HashPair", key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
              break;
            case 32:
              this.$ = yy.id($$[$0 - 1]);
              break;
            case 33:
              this.$ = $$[$0];
              break;
            case 34:
              this.$ = $$[$0];
              break;
            case 35:
              this.$ = { type: "StringLiteral", value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
              break;
            case 36:
              this.$ = { type: "NumberLiteral", value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
              break;
            case 37:
              this.$ = { type: "BooleanLiteral", value: $$[$0] === "true", original: $$[$0] === "true", loc: yy.locInfo(this._$) };
              break;
            case 38:
              this.$ = { type: "UndefinedLiteral", original: void 0, value: void 0, loc: yy.locInfo(this._$) };
              break;
            case 39:
              this.$ = { type: "NullLiteral", original: null, value: null, loc: yy.locInfo(this._$) };
              break;
            case 40:
              this.$ = $$[$0];
              break;
            case 41:
              this.$ = $$[$0];
              break;
            case 42:
              this.$ = yy.preparePath(true, $$[$0], this._$);
              break;
            case 43:
              this.$ = yy.preparePath(false, $$[$0], this._$);
              break;
            case 44:
              $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });
              this.$ = $$[$0 - 2];
              break;
            case 45:
              this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
              break;
            case 46:
              this.$ = [];
              break;
            case 47:
              $$[$0 - 1].push($$[$0]);
              break;
            case 48:
              this.$ = [];
              break;
            case 49:
              $$[$0 - 1].push($$[$0]);
              break;
            case 50:
              this.$ = [];
              break;
            case 51:
              $$[$0 - 1].push($$[$0]);
              break;
            case 58:
              this.$ = [];
              break;
            case 59:
              $$[$0 - 1].push($$[$0]);
              break;
            case 64:
              this.$ = [];
              break;
            case 65:
              $$[$0 - 1].push($$[$0]);
              break;
            case 70:
              this.$ = [];
              break;
            case 71:
              $$[$0 - 1].push($$[$0]);
              break;
            case 78:
              this.$ = [];
              break;
            case 79:
              $$[$0 - 1].push($$[$0]);
              break;
            case 82:
              this.$ = [];
              break;
            case 83:
              $$[$0 - 1].push($$[$0]);
              break;
            case 86:
              this.$ = [];
              break;
            case 87:
              $$[$0 - 1].push($$[$0]);
              break;
            case 90:
              this.$ = [];
              break;
            case 91:
              $$[$0 - 1].push($$[$0]);
              break;
            case 94:
              this.$ = [];
              break;
            case 95:
              $$[$0 - 1].push($$[$0]);
              break;
            case 98:
              this.$ = [$$[$0]];
              break;
            case 99:
              $$[$0 - 1].push($$[$0]);
              break;
            case 100:
              this.$ = [$$[$0]];
              break;
            case 101:
              $$[$0 - 1].push($$[$0]);
              break;
          }
        },
        table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
        defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
        parseError: function parseError(str2, hash2) {
          throw new Error(str2);
        },
        parse: function parse25(input2) {
          var self2 = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
          this.lexer.setInput(input2);
          this.lexer.yy = this.yy;
          this.yy.lexer = this.lexer;
          this.yy.parser = this;
          if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
          var yyloc = this.lexer.yylloc;
          lstack.push(yyloc);
          var ranges = this.lexer.options && this.lexer.options.ranges;
          if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
          function popStack(n) {
            stack.length = stack.length - 2 * n;
            vstack.length = vstack.length - n;
            lstack.length = lstack.length - n;
          }
          function lex() {
            var token;
            token = self2.lexer.lex() || 1;
            if (typeof token !== "number") {
              token = self2.symbols_[token] || token;
            }
            return token;
          }
          var symbol, preErrorSymbol, state2, action, a, r, yyval = {}, p, len, newState, expected;
          while (true) {
            state2 = stack[stack.length - 1];
            if (this.defaultActions[state2]) {
              action = this.defaultActions[state2];
            } else {
              if (symbol === null || typeof symbol == "undefined") {
                symbol = lex();
              }
              action = table[state2] && table[state2][symbol];
            }
            if (typeof action === "undefined" || !action.length || !action[0]) {
              var errStr2 = "";
              if (!recovering) {
                expected = [];
                for (p in table[state2]) if (this.terminals_[p] && p > 2) {
                  expected.push("'" + this.terminals_[p] + "'");
                }
                if (this.lexer.showPosition) {
                  errStr2 = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
                } else {
                  errStr2 = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
                }
                this.parseError(errStr2, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected });
              }
            }
            if (action[0] instanceof Array && action.length > 1) {
              throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol);
            }
            switch (action[0]) {
              case 1:
                stack.push(symbol);
                vstack.push(this.lexer.yytext);
                lstack.push(this.lexer.yylloc);
                stack.push(action[1]);
                symbol = null;
                if (!preErrorSymbol) {
                  yyleng = this.lexer.yyleng;
                  yytext = this.lexer.yytext;
                  yylineno = this.lexer.yylineno;
                  yyloc = this.lexer.yylloc;
                  if (recovering > 0) recovering--;
                } else {
                  symbol = preErrorSymbol;
                  preErrorSymbol = null;
                }
                break;
              case 2:
                len = this.productions_[action[1]][1];
                yyval.$ = vstack[vstack.length - len];
                yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
                if (ranges) {
                  yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
                }
                r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
                if (typeof r !== "undefined") {
                  return r;
                }
                if (len) {
                  stack = stack.slice(0, -1 * len * 2);
                  vstack = vstack.slice(0, -1 * len);
                  lstack = lstack.slice(0, -1 * len);
                }
                stack.push(this.productions_[action[1]][0]);
                vstack.push(yyval.$);
                lstack.push(yyval._$);
                newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
                stack.push(newState);
                break;
              case 3:
                return true;
            }
          }
          return true;
        }
      };
      var lexer = function() {
        var lexer2 = {
          EOF: 1,
          parseError: function parseError(str2, hash2) {
            if (this.yy.parser) {
              this.yy.parser.parseError(str2, hash2);
            } else {
              throw new Error(str2);
            }
          },
          setInput: function setInput(input2) {
            this._input = input2;
            this._more = this._less = this.done = false;
            this.yylineno = this.yyleng = 0;
            this.yytext = this.matched = this.match = "";
            this.conditionStack = ["INITIAL"];
            this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
            if (this.options.ranges) this.yylloc.range = [0, 0];
            this.offset = 0;
            return this;
          },
          input: function input2() {
            var ch = this._input[0];
            this.yytext += ch;
            this.yyleng++;
            this.offset++;
            this.match += ch;
            this.matched += ch;
            var lines = ch.match(/(?:\r\n?|\n).*/g);
            if (lines) {
              this.yylineno++;
              this.yylloc.last_line++;
            } else {
              this.yylloc.last_column++;
            }
            if (this.options.ranges) this.yylloc.range[1]++;
            this._input = this._input.slice(1);
            return ch;
          },
          unput: function unput(ch) {
            var len = ch.length;
            var lines = ch.split(/(?:\r\n?|\n)/g);
            this._input = ch + this._input;
            this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
            this.offset -= len;
            var oldLines = this.match.split(/(?:\r\n?|\n)/g);
            this.match = this.match.substr(0, this.match.length - 1);
            this.matched = this.matched.substr(0, this.matched.length - 1);
            if (lines.length - 1) this.yylineno -= lines.length - 1;
            var r = this.yylloc.range;
            this.yylloc = {
              first_line: this.yylloc.first_line,
              last_line: this.yylineno + 1,
              first_column: this.yylloc.first_column,
              last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
            };
            if (this.options.ranges) {
              this.yylloc.range = [r[0], r[0] + this.yyleng - len];
            }
            return this;
          },
          more: function more() {
            this._more = true;
            return this;
          },
          less: function less(n) {
            this.unput(this.match.slice(n));
          },
          pastInput: function pastInput() {
            var past = this.matched.substr(0, this.matched.length - this.match.length);
            return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
          },
          upcomingInput: function upcomingInput() {
            var next = this.match;
            if (next.length < 20) {
              next += this._input.substr(0, 20 - next.length);
            }
            return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
          },
          showPosition: function showPosition() {
            var pre = this.pastInput();
            var c = new Array(pre.length + 1).join("-");
            return pre + this.upcomingInput() + "\n" + c + "^";
          },
          next: function next() {
            if (this.done) {
              return this.EOF;
            }
            if (!this._input) this.done = true;
            var token, match2, tempMatch, index, col, lines;
            if (!this._more) {
              this.yytext = "";
              this.match = "";
            }
            var rules = this._currentRules();
            for (var i2 = 0; i2 < rules.length; i2++) {
              tempMatch = this._input.match(this.rules[rules[i2]]);
              if (tempMatch && (!match2 || tempMatch[0].length > match2[0].length)) {
                match2 = tempMatch;
                index = i2;
                if (!this.options.flex) break;
              }
            }
            if (match2) {
              lines = match2[0].match(/(?:\r\n?|\n).*/g);
              if (lines) this.yylineno += lines.length;
              this.yylloc = {
                first_line: this.yylloc.last_line,
                last_line: this.yylineno + 1,
                first_column: this.yylloc.last_column,
                last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match2[0].length
              };
              this.yytext += match2[0];
              this.match += match2[0];
              this.matches = match2;
              this.yyleng = this.yytext.length;
              if (this.options.ranges) {
                this.yylloc.range = [this.offset, this.offset += this.yyleng];
              }
              this._more = false;
              this._input = this._input.slice(match2[0].length);
              this.matched += match2[0];
              token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
              if (this.done && this._input) this.done = false;
              if (token) return token;
              else return;
            }
            if (this._input === "") {
              return this.EOF;
            } else {
              return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno });
            }
          },
          lex: function lex() {
            var r = this.next();
            if (typeof r !== "undefined") {
              return r;
            } else {
              return this.lex();
            }
          },
          begin: function begin(condition) {
            this.conditionStack.push(condition);
          },
          popState: function popState() {
            return this.conditionStack.pop();
          },
          _currentRules: function _currentRules() {
            return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
          },
          topState: function topState() {
            return this.conditionStack[this.conditionStack.length - 2];
          },
          pushState: function begin(condition) {
            this.begin(condition);
          }
        };
        lexer2.options = {};
        lexer2.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
          function strip(start2, end) {
            return yy_.yytext = yy_.yytext.substring(start2, yy_.yyleng - end + start2);
          }
          var YYSTATE = YY_START;
          switch ($avoiding_name_collisions) {
            case 0:
              if (yy_.yytext.slice(-2) === "\\\\") {
                strip(0, 1);
                this.begin("mu");
              } else if (yy_.yytext.slice(-1) === "\\") {
                strip(0, 1);
                this.begin("emu");
              } else {
                this.begin("mu");
              }
              if (yy_.yytext) return 15;
              break;
            case 1:
              return 15;
              break;
            case 2:
              this.popState();
              return 15;
              break;
            case 3:
              this.begin("raw");
              return 15;
              break;
            case 4:
              this.popState();
              if (this.conditionStack[this.conditionStack.length - 1] === "raw") {
                return 15;
              } else {
                strip(5, 9);
                return "END_RAW_BLOCK";
              }
              break;
            case 5:
              return 15;
              break;
            case 6:
              this.popState();
              return 14;
              break;
            case 7:
              return 65;
              break;
            case 8:
              return 68;
              break;
            case 9:
              return 19;
              break;
            case 10:
              this.popState();
              this.begin("raw");
              return 23;
              break;
            case 11:
              return 55;
              break;
            case 12:
              return 60;
              break;
            case 13:
              return 29;
              break;
            case 14:
              return 47;
              break;
            case 15:
              this.popState();
              return 44;
              break;
            case 16:
              this.popState();
              return 44;
              break;
            case 17:
              return 34;
              break;
            case 18:
              return 39;
              break;
            case 19:
              return 51;
              break;
            case 20:
              return 48;
              break;
            case 21:
              this.unput(yy_.yytext);
              this.popState();
              this.begin("com");
              break;
            case 22:
              this.popState();
              return 14;
              break;
            case 23:
              return 48;
              break;
            case 24:
              return 73;
              break;
            case 25:
              return 72;
              break;
            case 26:
              return 72;
              break;
            case 27:
              return 87;
              break;
            case 28:
              break;
            case 29:
              this.popState();
              return 54;
              break;
            case 30:
              this.popState();
              return 33;
              break;
            case 31:
              yy_.yytext = strip(1, 2).replace(/\\"/g, '"');
              return 80;
              break;
            case 32:
              yy_.yytext = strip(1, 2).replace(/\\'/g, "'");
              return 80;
              break;
            case 33:
              return 85;
              break;
            case 34:
              return 82;
              break;
            case 35:
              return 82;
              break;
            case 36:
              return 83;
              break;
            case 37:
              return 84;
              break;
            case 38:
              return 81;
              break;
            case 39:
              return 75;
              break;
            case 40:
              return 77;
              break;
            case 41:
              return 72;
              break;
            case 42:
              yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, "$1");
              return 72;
              break;
            case 43:
              return "INVALID";
              break;
            case 44:
              return 5;
              break;
          }
        };
        lexer2.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
        lexer2.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
        return lexer2;
      }();
      parser.lexer = lexer;
      function Parser2() {
        this.yy = {};
      }
      Parser2.prototype = parser;
      parser.Parser = Parser2;
      return new Parser2();
    }();
    exports4["default"] = handlebars;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js
var require_visitor = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    function Visitor() {
      this.parents = [];
    }
    Visitor.prototype = {
      constructor: Visitor,
      mutating: false,
      // Visits a given value. If mutating, will replace the value if necessary.
      acceptKey: function acceptKey(node, name) {
        var value = this.accept(node[name]);
        if (this.mutating) {
          if (value && !Visitor.prototype[value.type]) {
            throw new _exception2["default"]('Unexpected node type "' + value.type + '" found when accepting ' + name + " on " + node.type);
          }
          node[name] = value;
        }
      },
      // Performs an accept operation with added sanity check to ensure
      // required keys are not removed.
      acceptRequired: function acceptRequired(node, name) {
        this.acceptKey(node, name);
        if (!node[name]) {
          throw new _exception2["default"](node.type + " requires " + name);
        }
      },
      // Traverses a given array. If mutating, empty respnses will be removed
      // for child elements.
      acceptArray: function acceptArray(array2) {
        for (var i2 = 0, l = array2.length; i2 < l; i2++) {
          this.acceptKey(array2, i2);
          if (!array2[i2]) {
            array2.splice(i2, 1);
            i2--;
            l--;
          }
        }
      },
      accept: function accept(object) {
        if (!object) {
          return;
        }
        if (!this[object.type]) {
          throw new _exception2["default"]("Unknown type: " + object.type, object);
        }
        if (this.current) {
          this.parents.unshift(this.current);
        }
        this.current = object;
        var ret = this[object.type](object);
        this.current = this.parents.shift();
        if (!this.mutating || ret) {
          return ret;
        } else if (ret !== false) {
          return object;
        }
      },
      Program: function Program(program) {
        this.acceptArray(program.body);
      },
      MustacheStatement: visitSubExpression,
      Decorator: visitSubExpression,
      BlockStatement: visitBlock,
      DecoratorBlock: visitBlock,
      PartialStatement: visitPartial,
      PartialBlockStatement: function PartialBlockStatement(partial) {
        visitPartial.call(this, partial);
        this.acceptKey(partial, "program");
      },
      ContentStatement: function ContentStatement() {
      },
      CommentStatement: function CommentStatement() {
      },
      SubExpression: visitSubExpression,
      PathExpression: function PathExpression() {
      },
      StringLiteral: function StringLiteral() {
      },
      NumberLiteral: function NumberLiteral() {
      },
      BooleanLiteral: function BooleanLiteral() {
      },
      UndefinedLiteral: function UndefinedLiteral() {
      },
      NullLiteral: function NullLiteral() {
      },
      Hash: function Hash(hash2) {
        this.acceptArray(hash2.pairs);
      },
      HashPair: function HashPair(pair) {
        this.acceptRequired(pair, "value");
      }
    };
    function visitSubExpression(mustache) {
      this.acceptRequired(mustache, "path");
      this.acceptArray(mustache.params);
      this.acceptKey(mustache, "hash");
    }
    function visitBlock(block) {
      visitSubExpression.call(this, block);
      this.acceptKey(block, "program");
      this.acceptKey(block, "inverse");
    }
    function visitPartial(partial) {
      this.acceptRequired(partial, "name");
      this.acceptArray(partial.params);
      this.acceptKey(partial, "hash");
    }
    exports4["default"] = Visitor;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js
var require_whitespace_control = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _visitor = require_visitor();
    var _visitor2 = _interopRequireDefault(_visitor);
    function WhitespaceControl() {
      var options = arguments.length <= 0 || arguments[0] === void 0 ? {} : arguments[0];
      this.options = options;
    }
    WhitespaceControl.prototype = new _visitor2["default"]();
    WhitespaceControl.prototype.Program = function(program) {
      var doStandalone = !this.options.ignoreStandalone;
      var isRoot = !this.isRootSeen;
      this.isRootSeen = true;
      var body = program.body;
      for (var i2 = 0, l = body.length; i2 < l; i2++) {
        var current = body[i2], strip = this.accept(current);
        if (!strip) {
          continue;
        }
        var _isPrevWhitespace = isPrevWhitespace(body, i2, isRoot), _isNextWhitespace = isNextWhitespace(body, i2, isRoot), openStandalone = strip.openStandalone && _isPrevWhitespace, closeStandalone = strip.closeStandalone && _isNextWhitespace, inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
        if (strip.close) {
          omitRight(body, i2, true);
        }
        if (strip.open) {
          omitLeft(body, i2, true);
        }
        if (doStandalone && inlineStandalone) {
          omitRight(body, i2);
          if (omitLeft(body, i2)) {
            if (current.type === "PartialStatement") {
              current.indent = /([ \t]+$)/.exec(body[i2 - 1].original)[1];
            }
          }
        }
        if (doStandalone && openStandalone) {
          omitRight((current.program || current.inverse).body);
          omitLeft(body, i2);
        }
        if (doStandalone && closeStandalone) {
          omitRight(body, i2);
          omitLeft((current.inverse || current.program).body);
        }
      }
      return program;
    };
    WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function(block) {
      this.accept(block.program);
      this.accept(block.inverse);
      var program = block.program || block.inverse, inverse30 = block.program && block.inverse, firstInverse = inverse30, lastInverse = inverse30;
      if (inverse30 && inverse30.chained) {
        firstInverse = inverse30.body[0].program;
        while (lastInverse.chained) {
          lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
        }
      }
      var strip = {
        open: block.openStrip.open,
        close: block.closeStrip.close,
        // Determine the standalone candiacy. Basically flag our content as being possibly standalone
        // so our parent can determine if we actually are standalone
        openStandalone: isNextWhitespace(program.body),
        closeStandalone: isPrevWhitespace((firstInverse || program).body)
      };
      if (block.openStrip.close) {
        omitRight(program.body, null, true);
      }
      if (inverse30) {
        var inverseStrip = block.inverseStrip;
        if (inverseStrip.open) {
          omitLeft(program.body, null, true);
        }
        if (inverseStrip.close) {
          omitRight(firstInverse.body, null, true);
        }
        if (block.closeStrip.open) {
          omitLeft(lastInverse.body, null, true);
        }
        if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
          omitLeft(program.body);
          omitRight(firstInverse.body);
        }
      } else if (block.closeStrip.open) {
        omitLeft(program.body, null, true);
      }
      return strip;
    };
    WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function(mustache) {
      return mustache.strip;
    };
    WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function(node) {
      var strip = node.strip || {};
      return {
        inlineStandalone: true,
        open: strip.open,
        close: strip.close
      };
    };
    function isPrevWhitespace(body, i2, isRoot) {
      if (i2 === void 0) {
        i2 = body.length;
      }
      var prev = body[i2 - 1], sibling = body[i2 - 2];
      if (!prev) {
        return isRoot;
      }
      if (prev.type === "ContentStatement") {
        return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
      }
    }
    function isNextWhitespace(body, i2, isRoot) {
      if (i2 === void 0) {
        i2 = -1;
      }
      var next = body[i2 + 1], sibling = body[i2 + 2];
      if (!next) {
        return isRoot;
      }
      if (next.type === "ContentStatement") {
        return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
      }
    }
    function omitRight(body, i2, multiple) {
      var current = body[i2 == null ? 0 : i2 + 1];
      if (!current || current.type !== "ContentStatement" || !multiple && current.rightStripped) {
        return;
      }
      var original = current.value;
      current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, "");
      current.rightStripped = current.value !== original;
    }
    function omitLeft(body, i2, multiple) {
      var current = body[i2 == null ? body.length - 1 : i2 - 1];
      if (!current || current.type !== "ContentStatement" || !multiple && current.leftStripped) {
        return;
      }
      var original = current.value;
      current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, "");
      current.leftStripped = current.value !== original;
      return current.leftStripped;
    }
    exports4["default"] = WhitespaceControl;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js
var require_helpers2 = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.SourceLocation = SourceLocation;
    exports4.id = id2;
    exports4.stripFlags = stripFlags;
    exports4.stripComment = stripComment;
    exports4.preparePath = preparePath;
    exports4.prepareMustache = prepareMustache;
    exports4.prepareRawBlock = prepareRawBlock;
    exports4.prepareBlock = prepareBlock;
    exports4.prepareProgram = prepareProgram;
    exports4.preparePartialBlock = preparePartialBlock;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    function validateClose(open, close) {
      close = close.path ? close.path.original : close;
      if (open.path.original !== close) {
        var errorNode = { loc: open.path.loc };
        throw new _exception2["default"](open.path.original + " doesn't match " + close, errorNode);
      }
    }
    function SourceLocation(source, locInfo) {
      this.source = source;
      this.start = {
        line: locInfo.first_line,
        column: locInfo.first_column
      };
      this.end = {
        line: locInfo.last_line,
        column: locInfo.last_column
      };
    }
    function id2(token) {
      if (/^\[.*\]$/.test(token)) {
        return token.substring(1, token.length - 1);
      } else {
        return token;
      }
    }
    function stripFlags(open, close) {
      return {
        open: open.charAt(2) === "~",
        close: close.charAt(close.length - 3) === "~"
      };
    }
    function stripComment(comment) {
      return comment.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
    }
    function preparePath(data, parts, loc) {
      loc = this.locInfo(loc);
      var original = data ? "@" : "", dig = [], depth = 0;
      for (var i2 = 0, l = parts.length; i2 < l; i2++) {
        var part = parts[i2].part, isLiteral = parts[i2].original !== part;
        original += (parts[i2].separator || "") + part;
        if (!isLiteral && (part === ".." || part === "." || part === "this")) {
          if (dig.length > 0) {
            throw new _exception2["default"]("Invalid path: " + original, { loc });
          } else if (part === "..") {
            depth++;
          }
        } else {
          dig.push(part);
        }
      }
      return {
        type: "PathExpression",
        data,
        depth,
        parts: dig,
        original,
        loc
      };
    }
    function prepareMustache(path, params, hash2, open, strip, locInfo) {
      var escapeFlag = open.charAt(3) || open.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
      var decorator = /\*/.test(open);
      return {
        type: decorator ? "Decorator" : "MustacheStatement",
        path,
        params,
        hash: hash2,
        escaped,
        strip,
        loc: this.locInfo(locInfo)
      };
    }
    function prepareRawBlock(openRawBlock, contents, close, locInfo) {
      validateClose(openRawBlock, close);
      locInfo = this.locInfo(locInfo);
      var program = {
        type: "Program",
        body: contents,
        strip: {},
        loc: locInfo
      };
      return {
        type: "BlockStatement",
        path: openRawBlock.path,
        params: openRawBlock.params,
        hash: openRawBlock.hash,
        program,
        openStrip: {},
        inverseStrip: {},
        closeStrip: {},
        loc: locInfo
      };
    }
    function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
      if (close && close.path) {
        validateClose(openBlock, close);
      }
      var decorator = /\*/.test(openBlock.open);
      program.blockParams = openBlock.blockParams;
      var inverse30 = void 0, inverseStrip = void 0;
      if (inverseAndProgram) {
        if (decorator) {
          throw new _exception2["default"]("Unexpected inverse block on decorator", inverseAndProgram);
        }
        if (inverseAndProgram.chain) {
          inverseAndProgram.program.body[0].closeStrip = close.strip;
        }
        inverseStrip = inverseAndProgram.strip;
        inverse30 = inverseAndProgram.program;
      }
      if (inverted) {
        inverted = inverse30;
        inverse30 = program;
        program = inverted;
      }
      return {
        type: decorator ? "DecoratorBlock" : "BlockStatement",
        path: openBlock.path,
        params: openBlock.params,
        hash: openBlock.hash,
        program,
        inverse: inverse30,
        openStrip: openBlock.strip,
        inverseStrip,
        closeStrip: close && close.strip,
        loc: this.locInfo(locInfo)
      };
    }
    function prepareProgram(statements, loc) {
      if (!loc && statements.length) {
        var firstLoc = statements[0].loc, lastLoc = statements[statements.length - 1].loc;
        if (firstLoc && lastLoc) {
          loc = {
            source: firstLoc.source,
            start: {
              line: firstLoc.start.line,
              column: firstLoc.start.column
            },
            end: {
              line: lastLoc.end.line,
              column: lastLoc.end.column
            }
          };
        }
      }
      return {
        type: "Program",
        body: statements,
        strip: {},
        loc
      };
    }
    function preparePartialBlock(open, program, close, locInfo) {
      validateClose(open, close);
      return {
        type: "PartialBlockStatement",
        name: open.path,
        params: open.params,
        hash: open.hash,
        program,
        openStrip: open.strip,
        closeStrip: close && close.strip,
        loc: this.locInfo(locInfo)
      };
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/base.js
var require_base2 = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.parseWithoutProcessing = parseWithoutProcessing;
    exports4.parse = parse25;
    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      } else {
        var newObj = {};
        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
          }
        }
        newObj["default"] = obj;
        return newObj;
      }
    }
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _parser = require_parser();
    var _parser2 = _interopRequireDefault(_parser);
    var _whitespaceControl = require_whitespace_control();
    var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
    var _helpers = require_helpers2();
    var Helpers = _interopRequireWildcard(_helpers);
    var _utils = require_utils();
    exports4.parser = _parser2["default"];
    var yy = {};
    _utils.extend(yy, Helpers);
    function parseWithoutProcessing(input2, options) {
      if (input2.type === "Program") {
        return input2;
      }
      _parser2["default"].yy = yy;
      yy.locInfo = function(locInfo) {
        return new yy.SourceLocation(options && options.srcName, locInfo);
      };
      var ast = _parser2["default"].parse(input2);
      return ast;
    }
    function parse25(input2, options) {
      var ast = parseWithoutProcessing(input2, options);
      var strip = new _whitespaceControl2["default"](options);
      return strip.accept(ast);
    }
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js
var require_compiler = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(exports4) {
    "use strict";
    exports4.__esModule = true;
    exports4.Compiler = Compiler2;
    exports4.precompile = precompile;
    exports4.compile = compile4;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    var _utils = require_utils();
    var _ast = require_ast();
    var _ast2 = _interopRequireDefault(_ast);
    var slice = [].slice;
    function Compiler2() {
    }
    Compiler2.prototype = {
      compiler: Compiler2,
      equals: function equals4(other) {
        var len = this.opcodes.length;
        if (other.opcodes.length !== len) {
          return false;
        }
        for (var i2 = 0; i2 < len; i2++) {
          var opcode = this.opcodes[i2], otherOpcode = other.opcodes[i2];
          if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
            return false;
          }
        }
        len = this.children.length;
        for (var i2 = 0; i2 < len; i2++) {
          if (!this.children[i2].equals(other.children[i2])) {
            return false;
          }
        }
        return true;
      },
      guid: 0,
      compile: function compile5(program, options) {
        this.sourceNode = [];
        this.opcodes = [];
        this.children = [];
        this.options = options;
        this.stringParams = options.stringParams;
        this.trackIds = options.trackIds;
        options.blockParams = options.blockParams || [];
        options.knownHelpers = _utils.extend(/* @__PURE__ */ Object.create(null), {
          helperMissing: true,
          blockHelperMissing: true,
          each: true,
          "if": true,
          unless: true,
          "with": true,
          log: true,
          lookup: true
        }, options.knownHelpers);
        return this.accept(program);
      },
      compileProgram: function compileProgram(program) {
        var childCompiler = new this.compiler(), result = childCompiler.compile(program, this.options), guid = this.guid++;
        this.usePartial = this.usePartial || result.usePartial;
        this.children[guid] = result;
        this.useDepths = this.useDepths || result.useDepths;
        return guid;
      },
      accept: function accept(node) {
        if (!this[node.type]) {
          throw new _exception2["default"]("Unknown type: " + node.type, node);
        }
        this.sourceNode.unshift(node);
        var ret = this[node.type](node);
        this.sourceNode.shift();
        return ret;
      },
      Program: function Program(program) {
        this.options.blockParams.unshift(program.blockParams);
        var body = program.body, bodyLength = body.length;
        for (var i2 = 0; i2 < bodyLength; i2++) {
          this.accept(body[i2]);
        }
        this.options.blockParams.shift();
        this.isSimple = bodyLength === 1;
        this.blockParams = program.blockParams ? program.blockParams.length : 0;
        return this;
      },
      BlockStatement: function BlockStatement(block) {
        transformLiteralToPath(block);
        var program = block.program, inverse30 = block.inverse;
        program = program && this.compileProgram(program);
        inverse30 = inverse30 && this.compileProgram(inverse30);
        var type = this.classifySexpr(block);
        if (type === "helper") {
          this.helperSexpr(block, program, inverse30);
        } else if (type === "simple") {
          this.simpleSexpr(block);
          this.opcode("pushProgram", program);
          this.opcode("pushProgram", inverse30);
          this.opcode("emptyHash");
          this.opcode("blockValue", block.path.original);
        } else {
          this.ambiguousSexpr(block, program, inverse30);
          this.opcode("pushProgram", program);
          this.opcode("pushProgram", inverse30);
          this.opcode("emptyHash");
          this.opcode("ambiguousBlockValue");
        }
        this.opcode("append");
      },
      DecoratorBlock: function DecoratorBlock(decorator) {
        var program = decorator.program && this.compileProgram(decorator.program);
        var params = this.setupFullMustacheParams(decorator, program, void 0), path = decorator.path;
        this.useDecorators = true;
        this.opcode("registerDecorator", params.length, path.original);
      },
      PartialStatement: function PartialStatement(partial) {
        this.usePartial = true;
        var program = partial.program;
        if (program) {
          program = this.compileProgram(partial.program);
        }
        var params = partial.params;
        if (params.length > 1) {
          throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial);
        } else if (!params.length) {
          if (this.options.explicitPartialContext) {
            this.opcode("pushLiteral", "undefined");
          } else {
            params.push({ type: "PathExpression", parts: [], depth: 0 });
          }
        }
        var partialName = partial.name.original, isDynamic = partial.name.type === "SubExpression";
        if (isDynamic) {
          this.accept(partial.name);
        }
        this.setupFullMustacheParams(partial, program, void 0, true);
        var indent = partial.indent || "";
        if (this.options.preventIndent && indent) {
          this.opcode("appendContent", indent);
          indent = "";
        }
        this.opcode("invokePartial", isDynamic, partialName, indent);
        this.opcode("append");
      },
      PartialBlockStatement: function PartialBlockStatement(partialBlock) {
        this.PartialStatement(partialBlock);
      },
      MustacheStatement: function MustacheStatement(mustache) {
        this.SubExpression(mustache);
        if (mustache.escaped && !this.options.noEscape) {
          this.opcode("appendEscaped");
        } else {
          this.opcode("append");
        }
      },
      Decorator: function Decorator(decorator) {
        this.DecoratorBlock(decorator);
      },
      ContentStatement: function ContentStatement(content) {
        if (content.value) {
          this.opcode("appendContent", content.value);
        }
      },
      CommentStatement: function CommentStatement() {
      },
      SubExpression: function SubExpression(sexpr) {
        transformLiteralToPath(sexpr);
        var type = this.classifySexpr(sexpr);
        if (type === "simple") {
          this.simpleSexpr(sexpr);
        } else if (type === "helper") {
          this.helperSexpr(sexpr);
        } else {
          this.ambiguousSexpr(sexpr);
        }
      },
      ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse30) {
        var path = sexpr.path, name = path.parts[0], isBlock = program != null || inverse30 != null;
        this.opcode("getContext", path.depth);
        this.opcode("pushProgram", program);
        this.opcode("pushProgram", inverse30);
        path.strict = true;
        this.accept(path);
        this.opcode("invokeAmbiguous", name, isBlock);
      },
      simpleSexpr: function simpleSexpr(sexpr) {
        var path = sexpr.path;
        path.strict = true;
        this.accept(path);
        this.opcode("resolvePossibleLambda");
      },
      helperSexpr: function helperSexpr(sexpr, program, inverse30) {
        var params = this.setupFullMustacheParams(sexpr, program, inverse30), path = sexpr.path, name = path.parts[0];
        if (this.options.knownHelpers[name]) {
          this.opcode("invokeKnownHelper", params.length, name);
        } else if (this.options.knownHelpersOnly) {
          throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
        } else {
          path.strict = true;
          path.falsy = true;
          this.accept(path);
          this.opcode("invokeHelper", params.length, path.original, _ast2["default"].helpers.simpleId(path));
        }
      },
      PathExpression: function PathExpression(path) {
        this.addDepth(path.depth);
        this.opcode("getContext", path.depth);
        var name = path.parts[0], scoped = _ast2["default"].helpers.scopedId(path), blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
        if (blockParamId) {
          this.opcode("lookupBlockParam", blockParamId, path.parts);
        } else if (!name) {
          this.opcode("pushContext");
        } else if (path.data) {
          this.options.data = true;
          this.opcode("lookupData", path.depth, path.parts, path.strict);
        } else {
          this.opcode("lookupOnContext", path.parts, path.falsy, path.strict, scoped);
        }
      },
      StringLiteral: function StringLiteral(string) {
        this.opcode("pushString", string.value);
      },
      NumberLiteral: function NumberLiteral(number2) {
        this.opcode("pushLiteral", number2.value);
      },
      BooleanLiteral: function BooleanLiteral(bool) {
        this.opcode("pushLiteral", bool.value);
      },
      UndefinedLiteral: function UndefinedLiteral() {
        this.opcode("pushLiteral", "undefined");
      },
      NullLiteral: function NullLiteral() {
        this.opcode("pushLiteral", "null");
      },
      Hash: function Hash(hash2) {
        var pairs = hash2.pairs, i2 = 0, l = pairs.length;
        this.opcode("pushHash");
        for (; i2 < l; i2++) {
          this.pushParam(pairs[i2].value);
        }
        while (i2--) {
          this.opcode("assignToHash", pairs[i2].key);
        }
        this.opcode("popHash");
      },
      // HELPERS
      opcode: function opcode(name) {
        this.opcodes.push({
          opcode: name,
          args: slice.call(arguments, 1),
          loc: this.sourceNode[0].loc
        });
      },
      addDepth: function addDepth(depth) {
        if (!depth) {
          return;
        }
        this.useDepths = true;
      },
      classifySexpr: function classifySexpr(sexpr) {
        var isSimple = _ast2["default"].helpers.simpleId(sexpr.path);
        var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
        var isHelper = !isBlockParam && _ast2["default"].helpers.helperExpression(sexpr);
        var isEligible = !isBlockParam && (isHelper || isSimple);
        if (isEligible && !isHelper) {
          var _name = sexpr.path.parts[0], options = this.options;
          if (options.knownHelpers[_name]) {
            isHelper = true;
          } else if (options.knownHelpersOnly) {
            isEligible = false;
          }
        }
        if (isHelper) {
          return "helper";
        } else if (isEligible) {
          return "ambiguous";
        } else {
          return "simple";
        }
      },
      pushParams: function pushParams(params) {
        for (var i2 = 0, l = params.length; i2 < l; i2++) {
          this.pushParam(params[i2]);
        }
      },
      pushParam: function pushParam(val) {
        var value = val.value != null ? val.value : val.original || "";
        if (this.stringParams) {
          if (value.replace) {
            value = value.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".");
          }
          if (val.depth) {
            this.addDepth(val.depth);
          }
          this.opcode("getContext", val.depth || 0);
          this.opcode("pushStringParam", value, val.type);
          if (val.type === "SubExpression") {
            this.accept(val);
          }
        } else {
          if (this.trackIds) {
            var blockParamIndex = void 0;
            if (val.parts && !_ast2["default"].helpers.scopedId(val) && !val.depth) {
              blockParamIndex = this.blockParamIndex(val.parts[0]);
            }
            if (blockParamIndex) {
              var blockParamChild = val.parts.slice(1).join(".");
              this.opcode("pushId", "BlockParam", blockParamIndex, blockParamChild);
            } else {
              value = val.original || value;
              if (value.replace) {
                value = value.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "");
              }
              this.opcode("pushId", val.type, value);
            }
          }
          this.accept(val);
        }
      },
      setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse30, omitEmpty) {
        var params = sexpr.params;
        this.pushParams(params);
        this.opcode("pushProgram", program);
        this.opcode("pushProgram", inverse30);
        if (sexpr.hash) {
          this.accept(sexpr.hash);
        } else {
          this.opcode("emptyHash", omitEmpty);
        }
        return params;
      },
      blockParamIndex: function blockParamIndex(name) {
        for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
          var blockParams = this.options.blockParams[depth], param = blockParams && _utils.indexOf(blockParams, name);
          if (blockParams && param >= 0) {
            return [depth, param];
          }
        }
      }
    };
    function precompile(input2, options, env) {
      if (input2 == null || typeof input2 !== "string" && input2.type !== "Program") {
        throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input2);
      }
      options = options || {};
      if (!("data" in options)) {
        options.data = true;
      }
      if (options.compat) {
        options.useDepths = true;
      }
      var ast = env.parse(input2, options), environment2 = new env.Compiler().compile(ast, options);
      return new env.JavaScriptCompiler().compile(environment2, options);
    }
    function compile4(input2, options, env) {
      if (options === void 0) options = {};
      if (input2 == null || typeof input2 !== "string" && input2.type !== "Program") {
        throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input2);
      }
      options = _utils.extend({}, options);
      if (!("data" in options)) {
        options.data = true;
      }
      if (options.compat) {
        options.useDepths = true;
      }
      var compiled = void 0;
      function compileInput() {
        var ast = env.parse(input2, options), environment2 = new env.Compiler().compile(ast, options), templateSpec = new env.JavaScriptCompiler().compile(environment2, options, void 0, true);
        return env.template(templateSpec);
      }
      function ret(context2, execOptions) {
        if (!compiled) {
          compiled = compileInput();
        }
        return compiled.call(this, context2, execOptions);
      }
      ret._setup = function(setupOptions) {
        if (!compiled) {
          compiled = compileInput();
        }
        return compiled._setup(setupOptions);
      };
      ret._child = function(i2, data, blockParams, depths) {
        if (!compiled) {
          compiled = compileInput();
        }
        return compiled._child(i2, data, blockParams, depths);
      };
      return ret;
    }
    function argEquals(a, b) {
      if (a === b) {
        return true;
      }
      if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
        for (var i2 = 0; i2 < a.length; i2++) {
          if (!argEquals(a[i2], b[i2])) {
            return false;
          }
        }
        return true;
      }
    }
    function transformLiteralToPath(sexpr) {
      if (!sexpr.path.parts) {
        var literal = sexpr.path;
        sexpr.path = {
          type: "PathExpression",
          data: false,
          depth: 0,
          parts: [literal.original + ""],
          original: literal.original + "",
          loc: literal.loc
        };
      }
    }
  }
});

// node_modules/source-map/lib/base64.js
var require_base64 = __commonJS({
  "node_modules/source-map/lib/base64.js"(exports4) {
    var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
    exports4.encode = function(number2) {
      if (0 <= number2 && number2 < intToCharMap.length) {
        return intToCharMap[number2];
      }
      throw new TypeError("Must be between 0 and 63: " + number2);
    };
    exports4.decode = function(charCode) {
      var bigA = 65;
      var bigZ = 90;
      var littleA = 97;
      var littleZ = 122;
      var zero = 48;
      var nine = 57;
      var plus = 43;
      var slash = 47;
      var littleOffset = 26;
      var numberOffset = 52;
      if (bigA <= charCode && charCode <= bigZ) {
        return charCode - bigA;
      }
      if (littleA <= charCode && charCode <= littleZ) {
        return charCode - littleA + littleOffset;
      }
      if (zero <= charCode && charCode <= nine) {
        return charCode - zero + numberOffset;
      }
      if (charCode == plus) {
        return 62;
      }
      if (charCode == slash) {
        return 63;
      }
      return -1;
    };
  }
});

// node_modules/source-map/lib/base64-vlq.js
var require_base64_vlq = __commonJS({
  "node_modules/source-map/lib/base64-vlq.js"(exports4) {
    var base64 = require_base64();
    var VLQ_BASE_SHIFT = 5;
    var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
    var VLQ_BASE_MASK = VLQ_BASE - 1;
    var VLQ_CONTINUATION_BIT = VLQ_BASE;
    function toVLQSigned(aValue) {
      return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
    }
    function fromVLQSigned(aValue) {
      var isNegative = (aValue & 1) === 1;
      var shifted = aValue >> 1;
      return isNegative ? -shifted : shifted;
    }
    exports4.encode = function base64VLQ_encode(aValue) {
      var encoded = "";
      var digit;
      var vlq = toVLQSigned(aValue);
      do {
        digit = vlq & VLQ_BASE_MASK;
        vlq >>>= VLQ_BASE_SHIFT;
        if (vlq > 0) {
          digit |= VLQ_CONTINUATION_BIT;
        }
        encoded += base64.encode(digit);
      } while (vlq > 0);
      return encoded;
    };
    exports4.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
      var strLen = aStr.length;
      var result = 0;
      var shift = 0;
      var continuation, digit;
      do {
        if (aIndex >= strLen) {
          throw new Error("Expected more digits in base 64 VLQ value.");
        }
        digit = base64.decode(aStr.charCodeAt(aIndex++));
        if (digit === -1) {
          throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
        }
        continuation = !!(digit & VLQ_CONTINUATION_BIT);
        digit &= VLQ_BASE_MASK;
        result = result + (digit << shift);
        shift += VLQ_BASE_SHIFT;
      } while (continuation);
      aOutParam.value = fromVLQSigned(result);
      aOutParam.rest = aIndex;
    };
  }
});

// node_modules/source-map/lib/util.js
var require_util = __commonJS({
  "node_modules/source-map/lib/util.js"(exports4) {
    function getArg(aArgs, aName, aDefaultValue) {
      if (aName in aArgs) {
        return aArgs[aName];
      } else if (arguments.length === 3) {
        return aDefaultValue;
      } else {
        throw new Error('"' + aName + '" is a required argument.');
      }
    }
    exports4.getArg = getArg;
    var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
    var dataUrlRegexp = /^data:.+\,.+$/;
    function urlParse(aUrl) {
      var match2 = aUrl.match(urlRegexp);
      if (!match2) {
        return null;
      }
      return {
        scheme: match2[1],
        auth: match2[2],
        host: match2[3],
        port: match2[4],
        path: match2[5]
      };
    }
    exports4.urlParse = urlParse;
    function urlGenerate(aParsedUrl) {
      var url = "";
      if (aParsedUrl.scheme) {
        url += aParsedUrl.scheme + ":";
      }
      url += "//";
      if (aParsedUrl.auth) {
        url += aParsedUrl.auth + "@";
      }
      if (aParsedUrl.host) {
        url += aParsedUrl.host;
      }
      if (aParsedUrl.port) {
        url += ":" + aParsedUrl.port;
      }
      if (aParsedUrl.path) {
        url += aParsedUrl.path;
      }
      return url;
    }
    exports4.urlGenerate = urlGenerate;
    function normalize2(aPath) {
      var path = aPath;
      var url = urlParse(aPath);
      if (url) {
        if (!url.path) {
          return aPath;
        }
        path = url.path;
      }
      var isAbsolute = exports4.isAbsolute(path);
      var parts = path.split(/\/+/);
      for (var part, up = 0, i2 = parts.length - 1; i2 >= 0; i2--) {
        part = parts[i2];
        if (part === ".") {
          parts.splice(i2, 1);
        } else if (part === "..") {
          up++;
        } else if (up > 0) {
          if (part === "") {
            parts.splice(i2 + 1, up);
            up = 0;
          } else {
            parts.splice(i2, 2);
            up--;
          }
        }
      }
      path = parts.join("/");
      if (path === "") {
        path = isAbsolute ? "/" : ".";
      }
      if (url) {
        url.path = path;
        return urlGenerate(url);
      }
      return path;
    }
    exports4.normalize = normalize2;
    function join(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      if (aPath === "") {
        aPath = ".";
      }
      var aPathUrl = urlParse(aPath);
      var aRootUrl = urlParse(aRoot);
      if (aRootUrl) {
        aRoot = aRootUrl.path || "/";
      }
      if (aPathUrl && !aPathUrl.scheme) {
        if (aRootUrl) {
          aPathUrl.scheme = aRootUrl.scheme;
        }
        return urlGenerate(aPathUrl);
      }
      if (aPathUrl || aPath.match(dataUrlRegexp)) {
        return aPath;
      }
      if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
        aRootUrl.host = aPath;
        return urlGenerate(aRootUrl);
      }
      var joined = aPath.charAt(0) === "/" ? aPath : normalize2(aRoot.replace(/\/+$/, "") + "/" + aPath);
      if (aRootUrl) {
        aRootUrl.path = joined;
        return urlGenerate(aRootUrl);
      }
      return joined;
    }
    exports4.join = join;
    exports4.isAbsolute = function(aPath) {
      return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
    };
    function relative(aRoot, aPath) {
      if (aRoot === "") {
        aRoot = ".";
      }
      aRoot = aRoot.replace(/\/$/, "");
      var level = 0;
      while (aPath.indexOf(aRoot + "/") !== 0) {
        var index = aRoot.lastIndexOf("/");
        if (index < 0) {
          return aPath;
        }
        aRoot = aRoot.slice(0, index);
        if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
          return aPath;
        }
        ++level;
      }
      return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
    }
    exports4.relative = relative;
    var supportsNullProto = function() {
      var obj = /* @__PURE__ */ Object.create(null);
      return !("__proto__" in obj);
    }();
    function identity3(s) {
      return s;
    }
    function toSetString(aStr) {
      if (isProtoString(aStr)) {
        return "$" + aStr;
      }
      return aStr;
    }
    exports4.toSetString = supportsNullProto ? identity3 : toSetString;
    function fromSetString(aStr) {
      if (isProtoString(aStr)) {
        return aStr.slice(1);
      }
      return aStr;
    }
    exports4.fromSetString = supportsNullProto ? identity3 : fromSetString;
    function isProtoString(s) {
      if (!s) {
        return false;
      }
      var length = s.length;
      if (length < 9) {
        return false;
      }
      if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
        return false;
      }
      for (var i2 = length - 10; i2 >= 0; i2--) {
        if (s.charCodeAt(i2) !== 36) {
          return false;
        }
      }
      return true;
    }
    function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
      var cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0 || onlyCompareOriginal) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports4.compareByOriginalPositions = compareByOriginalPositions;
    function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0 || onlyCompareGenerated) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports4.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
    function strcmp(aStr1, aStr2) {
      if (aStr1 === aStr2) {
        return 0;
      }
      if (aStr1 === null) {
        return 1;
      }
      if (aStr2 === null) {
        return -1;
      }
      if (aStr1 > aStr2) {
        return 1;
      }
      return -1;
    }
    function compareByGeneratedPositionsInflated(mappingA, mappingB) {
      var cmp = mappingA.generatedLine - mappingB.generatedLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.generatedColumn - mappingB.generatedColumn;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = strcmp(mappingA.source, mappingB.source);
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalLine - mappingB.originalLine;
      if (cmp !== 0) {
        return cmp;
      }
      cmp = mappingA.originalColumn - mappingB.originalColumn;
      if (cmp !== 0) {
        return cmp;
      }
      return strcmp(mappingA.name, mappingB.name);
    }
    exports4.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
    function parseSourceMapInput(str2) {
      return JSON.parse(str2.replace(/^\)]}'[^\n]*\n/, ""));
    }
    exports4.parseSourceMapInput = parseSourceMapInput;
    function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
      sourceURL = sourceURL || "";
      if (sourceRoot) {
        if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
          sourceRoot += "/";
        }
        sourceURL = sourceRoot + sourceURL;
      }
      if (sourceMapURL) {
        var parsed = urlParse(sourceMapURL);
        if (!parsed) {
          throw new Error("sourceMapURL could not be parsed");
        }
        if (parsed.path) {
          var index = parsed.path.lastIndexOf("/");
          if (index >= 0) {
            parsed.path = parsed.path.substring(0, index + 1);
          }
        }
        sourceURL = join(urlGenerate(parsed), sourceURL);
      }
      return normalize2(sourceURL);
    }
    exports4.computeSourceURL = computeSourceURL;
  }
});

// node_modules/source-map/lib/array-set.js
var require_array_set = __commonJS({
  "node_modules/source-map/lib/array-set.js"(exports4) {
    var util = require_util();
    var has3 = Object.prototype.hasOwnProperty;
    var hasNativeMap = typeof Map !== "undefined";
    function ArraySet() {
      this._array = [];
      this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
    }
    ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
      var set2 = new ArraySet();
      for (var i2 = 0, len = aArray.length; i2 < len; i2++) {
        set2.add(aArray[i2], aAllowDuplicates);
      }
      return set2;
    };
    ArraySet.prototype.size = function ArraySet_size() {
      return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
    };
    ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
      var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
      var isDuplicate = hasNativeMap ? this.has(aStr) : has3.call(this._set, sStr);
      var idx = this._array.length;
      if (!isDuplicate || aAllowDuplicates) {
        this._array.push(aStr);
      }
      if (!isDuplicate) {
        if (hasNativeMap) {
          this._set.set(aStr, idx);
        } else {
          this._set[sStr] = idx;
        }
      }
    };
    ArraySet.prototype.has = function ArraySet_has(aStr) {
      if (hasNativeMap) {
        return this._set.has(aStr);
      } else {
        var sStr = util.toSetString(aStr);
        return has3.call(this._set, sStr);
      }
    };
    ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
      if (hasNativeMap) {
        var idx = this._set.get(aStr);
        if (idx >= 0) {
          return idx;
        }
      } else {
        var sStr = util.toSetString(aStr);
        if (has3.call(this._set, sStr)) {
          return this._set[sStr];
        }
      }
      throw new Error('"' + aStr + '" is not in the set.');
    };
    ArraySet.prototype.at = function ArraySet_at(aIdx) {
      if (aIdx >= 0 && aIdx < this._array.length) {
        return this._array[aIdx];
      }
      throw new Error("No element indexed by " + aIdx);
    };
    ArraySet.prototype.toArray = function ArraySet_toArray() {
      return this._array.slice();
    };
    exports4.ArraySet = ArraySet;
  }
});

// node_modules/source-map/lib/mapping-list.js
var require_mapping_list = __commonJS({
  "node_modules/source-map/lib/mapping-list.js"(exports4) {
    var util = require_util();
    function generatedPositionAfter(mappingA, mappingB) {
      var lineA = mappingA.generatedLine;
      var lineB = mappingB.generatedLine;
      var columnA = mappingA.generatedColumn;
      var columnB = mappingB.generatedColumn;
      return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
    }
    function MappingList() {
      this._array = [];
      this._sorted = true;
      this._last = { generatedLine: -1, generatedColumn: 0 };
    }
    MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
      this._array.forEach(aCallback, aThisArg);
    };
    MappingList.prototype.add = function MappingList_add(aMapping) {
      if (generatedPositionAfter(this._last, aMapping)) {
        this._last = aMapping;
        this._array.push(aMapping);
      } else {
        this._sorted = false;
        this._array.push(aMapping);
      }
    };
    MappingList.prototype.toArray = function MappingList_toArray() {
      if (!this._sorted) {
        this._array.sort(util.compareByGeneratedPositionsInflated);
        this._sorted = true;
      }
      return this._array;
    };
    exports4.MappingList = MappingList;
  }
});

// node_modules/source-map/lib/source-map-generator.js
var require_source_map_generator = __commonJS({
  "node_modules/source-map/lib/source-map-generator.js"(exports4) {
    var base64VLQ = require_base64_vlq();
    var util = require_util();
    var ArraySet = require_array_set().ArraySet;
    var MappingList = require_mapping_list().MappingList;
    function SourceMapGenerator(aArgs) {
      if (!aArgs) {
        aArgs = {};
      }
      this._file = util.getArg(aArgs, "file", null);
      this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
      this._skipValidation = util.getArg(aArgs, "skipValidation", false);
      this._sources = new ArraySet();
      this._names = new ArraySet();
      this._mappings = new MappingList();
      this._sourcesContents = null;
    }
    SourceMapGenerator.prototype._version = 3;
    SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
      var sourceRoot = aSourceMapConsumer.sourceRoot;
      var generator = new SourceMapGenerator({
        file: aSourceMapConsumer.file,
        sourceRoot
      });
      aSourceMapConsumer.eachMapping(function(mapping) {
        var newMapping = {
          generated: {
            line: mapping.generatedLine,
            column: mapping.generatedColumn
          }
        };
        if (mapping.source != null) {
          newMapping.source = mapping.source;
          if (sourceRoot != null) {
            newMapping.source = util.relative(sourceRoot, newMapping.source);
          }
          newMapping.original = {
            line: mapping.originalLine,
            column: mapping.originalColumn
          };
          if (mapping.name != null) {
            newMapping.name = mapping.name;
          }
        }
        generator.addMapping(newMapping);
      });
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var sourceRelative = sourceFile;
        if (sourceRoot !== null) {
          sourceRelative = util.relative(sourceRoot, sourceFile);
        }
        if (!generator._sources.has(sourceRelative)) {
          generator._sources.add(sourceRelative);
        }
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          generator.setSourceContent(sourceFile, content);
        }
      });
      return generator;
    };
    SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
      var generated = util.getArg(aArgs, "generated");
      var original = util.getArg(aArgs, "original", null);
      var source = util.getArg(aArgs, "source", null);
      var name = util.getArg(aArgs, "name", null);
      if (!this._skipValidation) {
        this._validateMapping(generated, original, source, name);
      }
      if (source != null) {
        source = String(source);
        if (!this._sources.has(source)) {
          this._sources.add(source);
        }
      }
      if (name != null) {
        name = String(name);
        if (!this._names.has(name)) {
          this._names.add(name);
        }
      }
      this._mappings.add({
        generatedLine: generated.line,
        generatedColumn: generated.column,
        originalLine: original != null && original.line,
        originalColumn: original != null && original.column,
        source,
        name
      });
    };
    SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
      var source = aSourceFile;
      if (this._sourceRoot != null) {
        source = util.relative(this._sourceRoot, source);
      }
      if (aSourceContent != null) {
        if (!this._sourcesContents) {
          this._sourcesContents = /* @__PURE__ */ Object.create(null);
        }
        this._sourcesContents[util.toSetString(source)] = aSourceContent;
      } else if (this._sourcesContents) {
        delete this._sourcesContents[util.toSetString(source)];
        if (Object.keys(this._sourcesContents).length === 0) {
          this._sourcesContents = null;
        }
      }
    };
    SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
      var sourceFile = aSourceFile;
      if (aSourceFile == null) {
        if (aSourceMapConsumer.file == null) {
          throw new Error(
            `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
          );
        }
        sourceFile = aSourceMapConsumer.file;
      }
      var sourceRoot = this._sourceRoot;
      if (sourceRoot != null) {
        sourceFile = util.relative(sourceRoot, sourceFile);
      }
      var newSources = new ArraySet();
      var newNames = new ArraySet();
      this._mappings.unsortedForEach(function(mapping) {
        if (mapping.source === sourceFile && mapping.originalLine != null) {
          var original = aSourceMapConsumer.originalPositionFor({
            line: mapping.originalLine,
            column: mapping.originalColumn
          });
          if (original.source != null) {
            mapping.source = original.source;
            if (aSourceMapPath != null) {
              mapping.source = util.join(aSourceMapPath, mapping.source);
            }
            if (sourceRoot != null) {
              mapping.source = util.relative(sourceRoot, mapping.source);
            }
            mapping.originalLine = original.line;
            mapping.originalColumn = original.column;
            if (original.name != null) {
              mapping.name = original.name;
            }
          }
        }
        var source = mapping.source;
        if (source != null && !newSources.has(source)) {
          newSources.add(source);
        }
        var name = mapping.name;
        if (name != null && !newNames.has(name)) {
          newNames.add(name);
        }
      }, this);
      this._sources = newSources;
      this._names = newNames;
      aSourceMapConsumer.sources.forEach(function(sourceFile2) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
        if (content != null) {
          if (aSourceMapPath != null) {
            sourceFile2 = util.join(aSourceMapPath, sourceFile2);
          }
          if (sourceRoot != null) {
            sourceFile2 = util.relative(sourceRoot, sourceFile2);
          }
          this.setSourceContent(sourceFile2, content);
        }
      }, this);
    };
    SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
      if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
        throw new Error(
          "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
        );
      }
      if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
        return;
      } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
        return;
      } else {
        throw new Error("Invalid mapping: " + JSON.stringify({
          generated: aGenerated,
          source: aSource,
          original: aOriginal,
          name: aName
        }));
      }
    };
    SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
      var previousGeneratedColumn = 0;
      var previousGeneratedLine = 1;
      var previousOriginalColumn = 0;
      var previousOriginalLine = 0;
      var previousName = 0;
      var previousSource = 0;
      var result = "";
      var next;
      var mapping;
      var nameIdx;
      var sourceIdx;
      var mappings = this._mappings.toArray();
      for (var i2 = 0, len = mappings.length; i2 < len; i2++) {
        mapping = mappings[i2];
        next = "";
        if (mapping.generatedLine !== previousGeneratedLine) {
          previousGeneratedColumn = 0;
          while (mapping.generatedLine !== previousGeneratedLine) {
            next += ";";
            previousGeneratedLine++;
          }
        } else {
          if (i2 > 0) {
            if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i2 - 1])) {
              continue;
            }
            next += ",";
          }
        }
        next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
        previousGeneratedColumn = mapping.generatedColumn;
        if (mapping.source != null) {
          sourceIdx = this._sources.indexOf(mapping.source);
          next += base64VLQ.encode(sourceIdx - previousSource);
          previousSource = sourceIdx;
          next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
          previousOriginalLine = mapping.originalLine - 1;
          next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
          previousOriginalColumn = mapping.originalColumn;
          if (mapping.name != null) {
            nameIdx = this._names.indexOf(mapping.name);
            next += base64VLQ.encode(nameIdx - previousName);
            previousName = nameIdx;
          }
        }
        result += next;
      }
      return result;
    };
    SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
      return aSources.map(function(source) {
        if (!this._sourcesContents) {
          return null;
        }
        if (aSourceRoot != null) {
          source = util.relative(aSourceRoot, source);
        }
        var key = util.toSetString(source);
        return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
      }, this);
    };
    SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
      var map2 = {
        version: this._version,
        sources: this._sources.toArray(),
        names: this._names.toArray(),
        mappings: this._serializeMappings()
      };
      if (this._file != null) {
        map2.file = this._file;
      }
      if (this._sourceRoot != null) {
        map2.sourceRoot = this._sourceRoot;
      }
      if (this._sourcesContents) {
        map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
      }
      return map2;
    };
    SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
      return JSON.stringify(this.toJSON());
    };
    exports4.SourceMapGenerator = SourceMapGenerator;
  }
});

// node_modules/source-map/lib/binary-search.js
var require_binary_search = __commonJS({
  "node_modules/source-map/lib/binary-search.js"(exports4) {
    exports4.GREATEST_LOWER_BOUND = 1;
    exports4.LEAST_UPPER_BOUND = 2;
    function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
      var mid = Math.floor((aHigh - aLow) / 2) + aLow;
      var cmp = aCompare(aNeedle, aHaystack[mid], true);
      if (cmp === 0) {
        return mid;
      } else if (cmp > 0) {
        if (aHigh - mid > 1) {
          return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports4.LEAST_UPPER_BOUND) {
          return aHigh < aHaystack.length ? aHigh : -1;
        } else {
          return mid;
        }
      } else {
        if (mid - aLow > 1) {
          return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
        }
        if (aBias == exports4.LEAST_UPPER_BOUND) {
          return mid;
        } else {
          return aLow < 0 ? -1 : aLow;
        }
      }
    }
    exports4.search = function search(aNeedle, aHaystack, aCompare, aBias) {
      if (aHaystack.length === 0) {
        return -1;
      }
      var index = recursiveSearch(
        -1,
        aHaystack.length,
        aNeedle,
        aHaystack,
        aCompare,
        aBias || exports4.GREATEST_LOWER_BOUND
      );
      if (index < 0) {
        return -1;
      }
      while (index - 1 >= 0) {
        if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
          break;
        }
        --index;
      }
      return index;
    };
  }
});

// node_modules/source-map/lib/quick-sort.js
var require_quick_sort = __commonJS({
  "node_modules/source-map/lib/quick-sort.js"(exports4) {
    function swap2(ary, x, y) {
      var temp = ary[x];
      ary[x] = ary[y];
      ary[y] = temp;
    }
    function randomIntInRange(low, high) {
      return Math.round(low + Math.random() * (high - low));
    }
    function doQuickSort(ary, comparator, p, r) {
      if (p < r) {
        var pivotIndex = randomIntInRange(p, r);
        var i2 = p - 1;
        swap2(ary, pivotIndex, r);
        var pivot = ary[r];
        for (var j = p; j < r; j++) {
          if (comparator(ary[j], pivot) <= 0) {
            i2 += 1;
            swap2(ary, i2, j);
          }
        }
        swap2(ary, i2 + 1, j);
        var q = i2 + 1;
        doQuickSort(ary, comparator, p, q - 1);
        doQuickSort(ary, comparator, q + 1, r);
      }
    }
    exports4.quickSort = function(ary, comparator) {
      doQuickSort(ary, comparator, 0, ary.length - 1);
    };
  }
});

// node_modules/source-map/lib/source-map-consumer.js
var require_source_map_consumer = __commonJS({
  "node_modules/source-map/lib/source-map-consumer.js"(exports4) {
    var util = require_util();
    var binarySearch3 = require_binary_search();
    var ArraySet = require_array_set().ArraySet;
    var base64VLQ = require_base64_vlq();
    var quickSort = require_quick_sort().quickSort;
    function SourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
    }
    SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
      return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
    };
    SourceMapConsumer.prototype._version = 3;
    SourceMapConsumer.prototype.__generatedMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__generatedMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__generatedMappings;
      }
    });
    SourceMapConsumer.prototype.__originalMappings = null;
    Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
      configurable: true,
      enumerable: true,
      get: function() {
        if (!this.__originalMappings) {
          this._parseMappings(this._mappings, this.sourceRoot);
        }
        return this.__originalMappings;
      }
    });
    SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
      var c = aStr.charAt(index);
      return c === ";" || c === ",";
    };
    SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      throw new Error("Subclasses must implement _parseMappings");
    };
    SourceMapConsumer.GENERATED_ORDER = 1;
    SourceMapConsumer.ORIGINAL_ORDER = 2;
    SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
    SourceMapConsumer.LEAST_UPPER_BOUND = 2;
    SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
      var context2 = aContext || null;
      var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
      var mappings;
      switch (order) {
        case SourceMapConsumer.GENERATED_ORDER:
          mappings = this._generatedMappings;
          break;
        case SourceMapConsumer.ORIGINAL_ORDER:
          mappings = this._originalMappings;
          break;
        default:
          throw new Error("Unknown order of iteration.");
      }
      var sourceRoot = this.sourceRoot;
      mappings.map(function(mapping) {
        var source = mapping.source === null ? null : this._sources.at(mapping.source);
        source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
        return {
          source,
          generatedLine: mapping.generatedLine,
          generatedColumn: mapping.generatedColumn,
          originalLine: mapping.originalLine,
          originalColumn: mapping.originalColumn,
          name: mapping.name === null ? null : this._names.at(mapping.name)
        };
      }, this).forEach(aCallback, context2);
    };
    SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
      var line = util.getArg(aArgs, "line");
      var needle = {
        source: util.getArg(aArgs, "source"),
        originalLine: line,
        originalColumn: util.getArg(aArgs, "column", 0)
      };
      needle.source = this._findSourceIndex(needle.source);
      if (needle.source < 0) {
        return [];
      }
      var mappings = [];
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util.compareByOriginalPositions,
        binarySearch3.LEAST_UPPER_BOUND
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (aArgs.column === void 0) {
          var originalLine = mapping.originalLine;
          while (mapping && mapping.originalLine === originalLine) {
            mappings.push({
              line: util.getArg(mapping, "generatedLine", null),
              column: util.getArg(mapping, "generatedColumn", null),
              lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        } else {
          var originalColumn = mapping.originalColumn;
          while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
            mappings.push({
              line: util.getArg(mapping, "generatedLine", null),
              column: util.getArg(mapping, "generatedColumn", null),
              lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
            });
            mapping = this._originalMappings[++index];
          }
        }
      }
      return mappings;
    };
    exports4.SourceMapConsumer = SourceMapConsumer;
    function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      var version = util.getArg(sourceMap, "version");
      var sources = util.getArg(sourceMap, "sources");
      var names32 = util.getArg(sourceMap, "names", []);
      var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
      var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
      var mappings = util.getArg(sourceMap, "mappings");
      var file = util.getArg(sourceMap, "file", null);
      if (version != this._version) {
        throw new Error("Unsupported version: " + version);
      }
      if (sourceRoot) {
        sourceRoot = util.normalize(sourceRoot);
      }
      sources = sources.map(String).map(util.normalize).map(function(source) {
        return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
      });
      this._names = ArraySet.fromArray(names32.map(String), true);
      this._sources = ArraySet.fromArray(sources, true);
      this._absoluteSources = this._sources.toArray().map(function(s) {
        return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
      });
      this.sourceRoot = sourceRoot;
      this.sourcesContent = sourcesContent;
      this._mappings = mappings;
      this._sourceMapURL = aSourceMapURL;
      this.file = file;
    }
    BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
    BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util.relative(this.sourceRoot, relativeSource);
      }
      if (this._sources.has(relativeSource)) {
        return this._sources.indexOf(relativeSource);
      }
      var i2;
      for (i2 = 0; i2 < this._absoluteSources.length; ++i2) {
        if (this._absoluteSources[i2] == aSource) {
          return i2;
        }
      }
      return -1;
    };
    BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
      var smc = Object.create(BasicSourceMapConsumer.prototype);
      var names32 = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
      var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
      smc.sourceRoot = aSourceMap._sourceRoot;
      smc.sourcesContent = aSourceMap._generateSourcesContent(
        smc._sources.toArray(),
        smc.sourceRoot
      );
      smc.file = aSourceMap._file;
      smc._sourceMapURL = aSourceMapURL;
      smc._absoluteSources = smc._sources.toArray().map(function(s) {
        return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
      });
      var generatedMappings = aSourceMap._mappings.toArray().slice();
      var destGeneratedMappings = smc.__generatedMappings = [];
      var destOriginalMappings = smc.__originalMappings = [];
      for (var i2 = 0, length = generatedMappings.length; i2 < length; i2++) {
        var srcMapping = generatedMappings[i2];
        var destMapping = new Mapping();
        destMapping.generatedLine = srcMapping.generatedLine;
        destMapping.generatedColumn = srcMapping.generatedColumn;
        if (srcMapping.source) {
          destMapping.source = sources.indexOf(srcMapping.source);
          destMapping.originalLine = srcMapping.originalLine;
          destMapping.originalColumn = srcMapping.originalColumn;
          if (srcMapping.name) {
            destMapping.name = names32.indexOf(srcMapping.name);
          }
          destOriginalMappings.push(destMapping);
        }
        destGeneratedMappings.push(destMapping);
      }
      quickSort(smc.__originalMappings, util.compareByOriginalPositions);
      return smc;
    };
    BasicSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
      get: function() {
        return this._absoluteSources.slice();
      }
    });
    function Mapping() {
      this.generatedLine = 0;
      this.generatedColumn = 0;
      this.source = null;
      this.originalLine = null;
      this.originalColumn = null;
      this.name = null;
    }
    BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      var generatedLine = 1;
      var previousGeneratedColumn = 0;
      var previousOriginalLine = 0;
      var previousOriginalColumn = 0;
      var previousSource = 0;
      var previousName = 0;
      var length = aStr.length;
      var index = 0;
      var cachedSegments = {};
      var temp = {};
      var originalMappings = [];
      var generatedMappings = [];
      var mapping, str2, segment, end, value;
      while (index < length) {
        if (aStr.charAt(index) === ";") {
          generatedLine++;
          index++;
          previousGeneratedColumn = 0;
        } else if (aStr.charAt(index) === ",") {
          index++;
        } else {
          mapping = new Mapping();
          mapping.generatedLine = generatedLine;
          for (end = index; end < length; end++) {
            if (this._charIsMappingSeparator(aStr, end)) {
              break;
            }
          }
          str2 = aStr.slice(index, end);
          segment = cachedSegments[str2];
          if (segment) {
            index += str2.length;
          } else {
            segment = [];
            while (index < end) {
              base64VLQ.decode(aStr, index, temp);
              value = temp.value;
              index = temp.rest;
              segment.push(value);
            }
            if (segment.length === 2) {
              throw new Error("Found a source, but no line and column");
            }
            if (segment.length === 3) {
              throw new Error("Found a source and line, but no column");
            }
            cachedSegments[str2] = segment;
          }
          mapping.generatedColumn = previousGeneratedColumn + segment[0];
          previousGeneratedColumn = mapping.generatedColumn;
          if (segment.length > 1) {
            mapping.source = previousSource + segment[1];
            previousSource += segment[1];
            mapping.originalLine = previousOriginalLine + segment[2];
            previousOriginalLine = mapping.originalLine;
            mapping.originalLine += 1;
            mapping.originalColumn = previousOriginalColumn + segment[3];
            previousOriginalColumn = mapping.originalColumn;
            if (segment.length > 4) {
              mapping.name = previousName + segment[4];
              previousName += segment[4];
            }
          }
          generatedMappings.push(mapping);
          if (typeof mapping.originalLine === "number") {
            originalMappings.push(mapping);
          }
        }
      }
      quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
      this.__generatedMappings = generatedMappings;
      quickSort(originalMappings, util.compareByOriginalPositions);
      this.__originalMappings = originalMappings;
    };
    BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
      if (aNeedle[aLineName] <= 0) {
        throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
      }
      if (aNeedle[aColumnName] < 0) {
        throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
      }
      return binarySearch3.search(aNeedle, aMappings, aComparator, aBias);
    };
    BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
      for (var index = 0; index < this._generatedMappings.length; ++index) {
        var mapping = this._generatedMappings[index];
        if (index + 1 < this._generatedMappings.length) {
          var nextMapping = this._generatedMappings[index + 1];
          if (mapping.generatedLine === nextMapping.generatedLine) {
            mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
            continue;
          }
        }
        mapping.lastGeneratedColumn = Infinity;
      }
    };
    BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util.getArg(aArgs, "line"),
        generatedColumn: util.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._generatedMappings,
        "generatedLine",
        "generatedColumn",
        util.compareByGeneratedPositionsDeflated,
        util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._generatedMappings[index];
        if (mapping.generatedLine === needle.generatedLine) {
          var source = util.getArg(mapping, "source", null);
          if (source !== null) {
            source = this._sources.at(source);
            source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
          }
          var name = util.getArg(mapping, "name", null);
          if (name !== null) {
            name = this._names.at(name);
          }
          return {
            source,
            line: util.getArg(mapping, "originalLine", null),
            column: util.getArg(mapping, "originalColumn", null),
            name
          };
        }
      }
      return {
        source: null,
        line: null,
        column: null,
        name: null
      };
    };
    BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
      if (!this.sourcesContent) {
        return false;
      }
      return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
        return sc == null;
      });
    };
    BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      if (!this.sourcesContent) {
        return null;
      }
      var index = this._findSourceIndex(aSource);
      if (index >= 0) {
        return this.sourcesContent[index];
      }
      var relativeSource = aSource;
      if (this.sourceRoot != null) {
        relativeSource = util.relative(this.sourceRoot, relativeSource);
      }
      var url;
      if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
        var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
        if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
          return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
        }
        if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
          return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + relativeSource + '" is not in the SourceMap.');
      }
    };
    BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
      var source = util.getArg(aArgs, "source");
      source = this._findSourceIndex(source);
      if (source < 0) {
        return {
          line: null,
          column: null,
          lastColumn: null
        };
      }
      var needle = {
        source,
        originalLine: util.getArg(aArgs, "line"),
        originalColumn: util.getArg(aArgs, "column")
      };
      var index = this._findMapping(
        needle,
        this._originalMappings,
        "originalLine",
        "originalColumn",
        util.compareByOriginalPositions,
        util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
      );
      if (index >= 0) {
        var mapping = this._originalMappings[index];
        if (mapping.source === needle.source) {
          return {
            line: util.getArg(mapping, "generatedLine", null),
            column: util.getArg(mapping, "generatedColumn", null),
            lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
          };
        }
      }
      return {
        line: null,
        column: null,
        lastColumn: null
      };
    };
    exports4.BasicSourceMapConsumer = BasicSourceMapConsumer;
    function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
      var sourceMap = aSourceMap;
      if (typeof aSourceMap === "string") {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }
      var version = util.getArg(sourceMap, "version");
      var sections = util.getArg(sourceMap, "sections");
      if (version != this._version) {
        throw new Error("Unsupported version: " + version);
      }
      this._sources = new ArraySet();
      this._names = new ArraySet();
      var lastOffset = {
        line: -1,
        column: 0
      };
      this._sections = sections.map(function(s) {
        if (s.url) {
          throw new Error("Support for url field in sections not implemented.");
        }
        var offset2 = util.getArg(s, "offset");
        var offsetLine = util.getArg(offset2, "line");
        var offsetColumn = util.getArg(offset2, "column");
        if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
          throw new Error("Section offsets must be ordered and non-overlapping.");
        }
        lastOffset = offset2;
        return {
          generatedOffset: {
            // The offset fields are 0-based, but we use 1-based indices when
            // encoding/decoding from VLQ.
            generatedLine: offsetLine + 1,
            generatedColumn: offsetColumn + 1
          },
          consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
        };
      });
    }
    IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
    IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
    IndexedSourceMapConsumer.prototype._version = 3;
    Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
      get: function() {
        var sources = [];
        for (var i2 = 0; i2 < this._sections.length; i2++) {
          for (var j = 0; j < this._sections[i2].consumer.sources.length; j++) {
            sources.push(this._sections[i2].consumer.sources[j]);
          }
        }
        return sources;
      }
    });
    IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
      var needle = {
        generatedLine: util.getArg(aArgs, "line"),
        generatedColumn: util.getArg(aArgs, "column")
      };
      var sectionIndex = binarySearch3.search(
        needle,
        this._sections,
        function(needle2, section2) {
          var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
          if (cmp) {
            return cmp;
          }
          return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
        }
      );
      var section = this._sections[sectionIndex];
      if (!section) {
        return {
          source: null,
          line: null,
          column: null,
          name: null
        };
      }
      return section.consumer.originalPositionFor({
        line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
        column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
        bias: aArgs.bias
      });
    };
    IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
      return this._sections.every(function(s) {
        return s.consumer.hasContentsOfAllSources();
      });
    };
    IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
      for (var i2 = 0; i2 < this._sections.length; i2++) {
        var section = this._sections[i2];
        var content = section.consumer.sourceContentFor(aSource, true);
        if (content) {
          return content;
        }
      }
      if (nullOnMissing) {
        return null;
      } else {
        throw new Error('"' + aSource + '" is not in the SourceMap.');
      }
    };
    IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
      for (var i2 = 0; i2 < this._sections.length; i2++) {
        var section = this._sections[i2];
        if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
          continue;
        }
        var generatedPosition = section.consumer.generatedPositionFor(aArgs);
        if (generatedPosition) {
          var ret = {
            line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
            column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
          };
          return ret;
        }
      }
      return {
        line: null,
        column: null
      };
    };
    IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
      this.__generatedMappings = [];
      this.__originalMappings = [];
      for (var i2 = 0; i2 < this._sections.length; i2++) {
        var section = this._sections[i2];
        var sectionMappings = section.consumer._generatedMappings;
        for (var j = 0; j < sectionMappings.length; j++) {
          var mapping = sectionMappings[j];
          var source = section.consumer._sources.at(mapping.source);
          source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
          this._sources.add(source);
          source = this._sources.indexOf(source);
          var name = null;
          if (mapping.name) {
            name = section.consumer._names.at(mapping.name);
            this._names.add(name);
            name = this._names.indexOf(name);
          }
          var adjustedMapping = {
            source,
            generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
            generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
            originalLine: mapping.originalLine,
            originalColumn: mapping.originalColumn,
            name
          };
          this.__generatedMappings.push(adjustedMapping);
          if (typeof adjustedMapping.originalLine === "number") {
            this.__originalMappings.push(adjustedMapping);
          }
        }
      }
      quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
      quickSort(this.__originalMappings, util.compareByOriginalPositions);
    };
    exports4.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  }
});

// node_modules/source-map/lib/source-node.js
var require_source_node = __commonJS({
  "node_modules/source-map/lib/source-node.js"(exports4) {
    var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    var util = require_util();
    var REGEX_NEWLINE = /(\r?\n)/;
    var NEWLINE_CODE = 10;
    var isSourceNode = "$$$isSourceNode$$$";
    function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
      this.children = [];
      this.sourceContents = {};
      this.line = aLine == null ? null : aLine;
      this.column = aColumn == null ? null : aColumn;
      this.source = aSource == null ? null : aSource;
      this.name = aName == null ? null : aName;
      this[isSourceNode] = true;
      if (aChunks != null) this.add(aChunks);
    }
    SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
      var node = new SourceNode();
      var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
      var remainingLinesIndex = 0;
      var shiftNextLine = function() {
        var lineContents = getNextLine();
        var newLine = getNextLine() || "";
        return lineContents + newLine;
        function getNextLine() {
          return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
        }
      };
      var lastGeneratedLine = 1, lastGeneratedColumn = 0;
      var lastMapping = null;
      aSourceMapConsumer.eachMapping(function(mapping) {
        if (lastMapping !== null) {
          if (lastGeneratedLine < mapping.generatedLine) {
            addMappingWithCode(lastMapping, shiftNextLine());
            lastGeneratedLine++;
            lastGeneratedColumn = 0;
          } else {
            var nextLine = remainingLines[remainingLinesIndex] || "";
            var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
            remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
            lastGeneratedColumn = mapping.generatedColumn;
            addMappingWithCode(lastMapping, code);
            lastMapping = mapping;
            return;
          }
        }
        while (lastGeneratedLine < mapping.generatedLine) {
          node.add(shiftNextLine());
          lastGeneratedLine++;
        }
        if (lastGeneratedColumn < mapping.generatedColumn) {
          var nextLine = remainingLines[remainingLinesIndex] || "";
          node.add(nextLine.substr(0, mapping.generatedColumn));
          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
          lastGeneratedColumn = mapping.generatedColumn;
        }
        lastMapping = mapping;
      }, this);
      if (remainingLinesIndex < remainingLines.length) {
        if (lastMapping) {
          addMappingWithCode(lastMapping, shiftNextLine());
        }
        node.add(remainingLines.splice(remainingLinesIndex).join(""));
      }
      aSourceMapConsumer.sources.forEach(function(sourceFile) {
        var content = aSourceMapConsumer.sourceContentFor(sourceFile);
        if (content != null) {
          if (aRelativePath != null) {
            sourceFile = util.join(aRelativePath, sourceFile);
          }
          node.setSourceContent(sourceFile, content);
        }
      });
      return node;
      function addMappingWithCode(mapping, code) {
        if (mapping === null || mapping.source === void 0) {
          node.add(code);
        } else {
          var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
          node.add(new SourceNode(
            mapping.originalLine,
            mapping.originalColumn,
            source,
            code,
            mapping.name
          ));
        }
      }
    };
    SourceNode.prototype.add = function SourceNode_add(aChunk) {
      if (Array.isArray(aChunk)) {
        aChunk.forEach(function(chunk2) {
          this.add(chunk2);
        }, this);
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        if (aChunk) {
          this.children.push(aChunk);
        }
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
      if (Array.isArray(aChunk)) {
        for (var i2 = aChunk.length - 1; i2 >= 0; i2--) {
          this.prepend(aChunk[i2]);
        }
      } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
        this.children.unshift(aChunk);
      } else {
        throw new TypeError(
          "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
        );
      }
      return this;
    };
    SourceNode.prototype.walk = function SourceNode_walk(aFn) {
      var chunk2;
      for (var i2 = 0, len = this.children.length; i2 < len; i2++) {
        chunk2 = this.children[i2];
        if (chunk2[isSourceNode]) {
          chunk2.walk(aFn);
        } else {
          if (chunk2 !== "") {
            aFn(chunk2, {
              source: this.source,
              line: this.line,
              column: this.column,
              name: this.name
            });
          }
        }
      }
    };
    SourceNode.prototype.join = function SourceNode_join(aSep) {
      var newChildren;
      var i2;
      var len = this.children.length;
      if (len > 0) {
        newChildren = [];
        for (i2 = 0; i2 < len - 1; i2++) {
          newChildren.push(this.children[i2]);
          newChildren.push(aSep);
        }
        newChildren.push(this.children[i2]);
        this.children = newChildren;
      }
      return this;
    };
    SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
      var lastChild = this.children[this.children.length - 1];
      if (lastChild[isSourceNode]) {
        lastChild.replaceRight(aPattern, aReplacement);
      } else if (typeof lastChild === "string") {
        this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
      } else {
        this.children.push("".replace(aPattern, aReplacement));
      }
      return this;
    };
    SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
      this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
    };
    SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
      for (var i2 = 0, len = this.children.length; i2 < len; i2++) {
        if (this.children[i2][isSourceNode]) {
          this.children[i2].walkSourceContents(aFn);
        }
      }
      var sources = Object.keys(this.sourceContents);
      for (var i2 = 0, len = sources.length; i2 < len; i2++) {
        aFn(util.fromSetString(sources[i2]), this.sourceContents[sources[i2]]);
      }
    };
    SourceNode.prototype.toString = function SourceNode_toString() {
      var str2 = "";
      this.walk(function(chunk2) {
        str2 += chunk2;
      });
      return str2;
    };
    SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
      var generated = {
        code: "",
        line: 1,
        column: 0
      };
      var map2 = new SourceMapGenerator(aArgs);
      var sourceMappingActive = false;
      var lastOriginalSource = null;
      var lastOriginalLine = null;
      var lastOriginalColumn = null;
      var lastOriginalName = null;
      this.walk(function(chunk2, original) {
        generated.code += chunk2;
        if (original.source !== null && original.line !== null && original.column !== null) {
          if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
            map2.addMapping({
              source: original.source,
              original: {
                line: original.line,
                column: original.column
              },
              generated: {
                line: generated.line,
                column: generated.column
              },
              name: original.name
            });
          }
          lastOriginalSource = original.source;
          lastOriginalLine = original.line;
          lastOriginalColumn = original.column;
          lastOriginalName = original.name;
          sourceMappingActive = true;
        } else if (sourceMappingActive) {
          map2.addMapping({
            generated: {
              line: generated.line,
              column: generated.column
            }
          });
          lastOriginalSource = null;
          sourceMappingActive = false;
        }
        for (var idx = 0, length = chunk2.length; idx < length; idx++) {
          if (chunk2.charCodeAt(idx) === NEWLINE_CODE) {
            generated.line++;
            generated.column = 0;
            if (idx + 1 === length) {
              lastOriginalSource = null;
              sourceMappingActive = false;
            } else if (sourceMappingActive) {
              map2.addMapping({
                source: original.source,
                original: {
                  line: original.line,
                  column: original.column
                },
                generated: {
                  line: generated.line,
                  column: generated.column
                },
                name: original.name
              });
            }
          } else {
            generated.column++;
          }
        }
      });
      this.walkSourceContents(function(sourceFile, sourceContent) {
        map2.setSourceContent(sourceFile, sourceContent);
      });
      return { code: generated.code, map: map2 };
    };
    exports4.SourceNode = SourceNode;
  }
});

// node_modules/source-map/source-map.js
var require_source_map = __commonJS({
  "node_modules/source-map/source-map.js"(exports4) {
    exports4.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
    exports4.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
    exports4.SourceNode = require_source_node().SourceNode;
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
var require_code_gen = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    var _utils = require_utils();
    var SourceNode = void 0;
    try {
      if (typeof define !== "function" || !define.amd) {
        SourceMap = require_source_map();
        SourceNode = SourceMap.SourceNode;
      }
    } catch (err) {
    }
    var SourceMap;
    if (!SourceNode) {
      SourceNode = function(line, column, srcFile, chunks) {
        this.src = "";
        if (chunks) {
          this.add(chunks);
        }
      };
      SourceNode.prototype = {
        add: function add5(chunks) {
          if (_utils.isArray(chunks)) {
            chunks = chunks.join("");
          }
          this.src += chunks;
        },
        prepend: function prepend(chunks) {
          if (_utils.isArray(chunks)) {
            chunks = chunks.join("");
          }
          this.src = chunks + this.src;
        },
        toStringWithSourceMap: function toStringWithSourceMap() {
          return { code: this.toString() };
        },
        toString: function toString7() {
          return this.src;
        }
      };
    }
    function castChunk(chunk2, codeGen, loc) {
      if (_utils.isArray(chunk2)) {
        var ret = [];
        for (var i2 = 0, len = chunk2.length; i2 < len; i2++) {
          ret.push(codeGen.wrap(chunk2[i2], loc));
        }
        return ret;
      } else if (typeof chunk2 === "boolean" || typeof chunk2 === "number") {
        return chunk2 + "";
      }
      return chunk2;
    }
    function CodeGen(srcFile) {
      this.srcFile = srcFile;
      this.source = [];
    }
    CodeGen.prototype = {
      isEmpty: function isEmpty4() {
        return !this.source.length;
      },
      prepend: function prepend(source, loc) {
        this.source.unshift(this.wrap(source, loc));
      },
      push: function push(source, loc) {
        this.source.push(this.wrap(source, loc));
      },
      merge: function merge3() {
        var source = this.empty();
        this.each(function(line) {
          source.add(["  ", line, "\n"]);
        });
        return source;
      },
      each: function each(iter) {
        for (var i2 = 0, len = this.source.length; i2 < len; i2++) {
          iter(this.source[i2]);
        }
      },
      empty: function empty() {
        var loc = this.currentLocation || { start: {} };
        return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
      },
      wrap: function wrap(chunk2) {
        var loc = arguments.length <= 1 || arguments[1] === void 0 ? this.currentLocation || { start: {} } : arguments[1];
        if (chunk2 instanceof SourceNode) {
          return chunk2;
        }
        chunk2 = castChunk(chunk2, this, loc);
        return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk2);
      },
      functionCall: function functionCall(fn, type, params) {
        params = this.generateList(params);
        return this.wrap([fn, type ? "." + type + "(" : "(", params, ")"]);
      },
      quotedString: function quotedString(str2) {
        return '"' + (str2 + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"';
      },
      objectLiteral: function objectLiteral(obj) {
        var _this = this;
        var pairs = [];
        Object.keys(obj).forEach(function(key) {
          var value = castChunk(obj[key], _this);
          if (value !== "undefined") {
            pairs.push([_this.quotedString(key), ":", value]);
          }
        });
        var ret = this.generateList(pairs);
        ret.prepend("{");
        ret.add("}");
        return ret;
      },
      generateList: function generateList(entries) {
        var ret = this.empty();
        for (var i2 = 0, len = entries.length; i2 < len; i2++) {
          if (i2) {
            ret.add(",");
          }
          ret.add(castChunk(entries[i2], this));
        }
        return ret;
      },
      generateArray: function generateArray(entries) {
        var ret = this.generateList(entries);
        ret.prepend("[");
        ret.add("]");
        return ret;
      }
    };
    exports4["default"] = CodeGen;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
var require_javascript_compiler = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _base = require_base();
    var _exception = require_exception();
    var _exception2 = _interopRequireDefault(_exception);
    var _utils = require_utils();
    var _codeGen = require_code_gen();
    var _codeGen2 = _interopRequireDefault(_codeGen);
    function Literal3(value) {
      this.value = value;
    }
    function JavaScriptCompiler() {
    }
    JavaScriptCompiler.prototype = {
      // PUBLIC API: You can override these methods in a subclass to provide
      // alternative compiled forms for name lookup and buffering semantics
      nameLookup: function nameLookup(parent, name) {
        return this.internalNameLookup(parent, name);
      },
      depthedLookup: function depthedLookup(name) {
        return [this.aliasable("container.lookup"), "(depths, ", JSON.stringify(name), ")"];
      },
      compilerInfo: function compilerInfo() {
        var revision = _base.COMPILER_REVISION, versions = _base.REVISION_CHANGES[revision];
        return [revision, versions];
      },
      appendToBuffer: function appendToBuffer(source, location2, explicit) {
        if (!_utils.isArray(source)) {
          source = [source];
        }
        source = this.source.wrap(source, location2);
        if (this.environment.isSimple) {
          return ["return ", source, ";"];
        } else if (explicit) {
          return ["buffer += ", source, ";"];
        } else {
          source.appendToBuffer = true;
          return source;
        }
      },
      initializeBuffer: function initializeBuffer() {
        return this.quotedString("");
      },
      // END PUBLIC API
      internalNameLookup: function internalNameLookup(parent, name) {
        this.lookupPropertyFunctionIsUsed = true;
        return ["lookupProperty(", parent, ",", JSON.stringify(name), ")"];
      },
      lookupPropertyFunctionIsUsed: false,
      compile: function compile4(environment2, options, context2, asObject) {
        this.environment = environment2;
        this.options = options;
        this.stringParams = this.options.stringParams;
        this.trackIds = this.options.trackIds;
        this.precompile = !asObject;
        this.name = this.environment.name;
        this.isChild = !!context2;
        this.context = context2 || {
          decorators: [],
          programs: [],
          environments: []
        };
        this.preamble();
        this.stackSlot = 0;
        this.stackVars = [];
        this.aliases = {};
        this.registers = { list: [] };
        this.hashes = [];
        this.compileStack = [];
        this.inlineStack = [];
        this.blockParams = [];
        this.compileChildren(environment2, options);
        this.useDepths = this.useDepths || environment2.useDepths || environment2.useDecorators || this.options.compat;
        this.useBlockParams = this.useBlockParams || environment2.useBlockParams;
        var opcodes = environment2.opcodes, opcode = void 0, firstLoc = void 0, i2 = void 0, l = void 0;
        for (i2 = 0, l = opcodes.length; i2 < l; i2++) {
          opcode = opcodes[i2];
          this.source.currentLocation = opcode.loc;
          firstLoc = firstLoc || opcode.loc;
          this[opcode.opcode].apply(this, opcode.args);
        }
        this.source.currentLocation = firstLoc;
        this.pushSource("");
        if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
          throw new _exception2["default"]("Compile completed with content left on stack");
        }
        if (!this.decorators.isEmpty()) {
          this.useDecorators = true;
          this.decorators.prepend(["var decorators = container.decorators, ", this.lookupPropertyFunctionVarDeclaration(), ";\n"]);
          this.decorators.push("return fn;");
          if (asObject) {
            this.decorators = Function.apply(this, ["fn", "props", "container", "depth0", "data", "blockParams", "depths", this.decorators.merge()]);
          } else {
            this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n");
            this.decorators.push("}\n");
            this.decorators = this.decorators.merge();
          }
        } else {
          this.decorators = void 0;
        }
        var fn = this.createFunctionContext(asObject);
        if (!this.isChild) {
          var ret = {
            compiler: this.compilerInfo(),
            main: fn
          };
          if (this.decorators) {
            ret.main_d = this.decorators;
            ret.useDecorators = true;
          }
          var _context = this.context;
          var programs = _context.programs;
          var decorators = _context.decorators;
          for (i2 = 0, l = programs.length; i2 < l; i2++) {
            if (programs[i2]) {
              ret[i2] = programs[i2];
              if (decorators[i2]) {
                ret[i2 + "_d"] = decorators[i2];
                ret.useDecorators = true;
              }
            }
          }
          if (this.environment.usePartial) {
            ret.usePartial = true;
          }
          if (this.options.data) {
            ret.useData = true;
          }
          if (this.useDepths) {
            ret.useDepths = true;
          }
          if (this.useBlockParams) {
            ret.useBlockParams = true;
          }
          if (this.options.compat) {
            ret.compat = true;
          }
          if (!asObject) {
            ret.compiler = JSON.stringify(ret.compiler);
            this.source.currentLocation = { start: { line: 1, column: 0 } };
            ret = this.objectLiteral(ret);
            if (options.srcName) {
              ret = ret.toStringWithSourceMap({ file: options.destName });
              ret.map = ret.map && ret.map.toString();
            } else {
              ret = ret.toString();
            }
          } else {
            ret.compilerOptions = this.options;
          }
          return ret;
        } else {
          return fn;
        }
      },
      preamble: function preamble() {
        this.lastContext = 0;
        this.source = new _codeGen2["default"](this.options.srcName);
        this.decorators = new _codeGen2["default"](this.options.srcName);
      },
      createFunctionContext: function createFunctionContext(asObject) {
        var _this = this;
        var varDeclarations = "";
        var locals = this.stackVars.concat(this.registers.list);
        if (locals.length > 0) {
          varDeclarations += ", " + locals.join(", ");
        }
        var aliasCount = 0;
        Object.keys(this.aliases).forEach(function(alias) {
          var node = _this.aliases[alias];
          if (node.children && node.referenceCount > 1) {
            varDeclarations += ", alias" + ++aliasCount + "=" + alias;
            node.children[0] = "alias" + aliasCount;
          }
        });
        if (this.lookupPropertyFunctionIsUsed) {
          varDeclarations += ", " + this.lookupPropertyFunctionVarDeclaration();
        }
        var params = ["container", "depth0", "helpers", "partials", "data"];
        if (this.useBlockParams || this.useDepths) {
          params.push("blockParams");
        }
        if (this.useDepths) {
          params.push("depths");
        }
        var source = this.mergeSource(varDeclarations);
        if (asObject) {
          params.push(source);
          return Function.apply(this, params);
        } else {
          return this.source.wrap(["function(", params.join(","), ") {\n  ", source, "}"]);
        }
      },
      mergeSource: function mergeSource(varDeclarations) {
        var isSimple = this.environment.isSimple, appendOnly = !this.forceBuffer, appendFirst = void 0, sourceSeen = void 0, bufferStart = void 0, bufferEnd = void 0;
        this.source.each(function(line) {
          if (line.appendToBuffer) {
            if (bufferStart) {
              line.prepend("  + ");
            } else {
              bufferStart = line;
            }
            bufferEnd = line;
          } else {
            if (bufferStart) {
              if (!sourceSeen) {
                appendFirst = true;
              } else {
                bufferStart.prepend("buffer += ");
              }
              bufferEnd.add(";");
              bufferStart = bufferEnd = void 0;
            }
            sourceSeen = true;
            if (!isSimple) {
              appendOnly = false;
            }
          }
        });
        if (appendOnly) {
          if (bufferStart) {
            bufferStart.prepend("return ");
            bufferEnd.add(";");
          } else if (!sourceSeen) {
            this.source.push('return "";');
          }
        } else {
          varDeclarations += ", buffer = " + (appendFirst ? "" : this.initializeBuffer());
          if (bufferStart) {
            bufferStart.prepend("return buffer + ");
            bufferEnd.add(";");
          } else {
            this.source.push("return buffer;");
          }
        }
        if (varDeclarations) {
          this.source.prepend("var " + varDeclarations.substring(2) + (appendFirst ? "" : ";\n"));
        }
        return this.source.merge();
      },
      lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
        return "\n      lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    }\n    ".trim();
      },
      // [blockValue]
      //
      // On stack, before: hash, inverse, program, value
      // On stack, after: return value of blockHelperMissing
      //
      // The purpose of this opcode is to take a block of the form
      // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
      // replace it on the stack with the result of properly
      // invoking blockHelperMissing.
      blockValue: function blockValue(name) {
        var blockHelperMissing = this.aliasable("container.hooks.blockHelperMissing"), params = [this.contextName(0)];
        this.setupHelperArgs(name, 0, params);
        var blockName = this.popStack();
        params.splice(1, 0, blockName);
        this.push(this.source.functionCall(blockHelperMissing, "call", params));
      },
      // [ambiguousBlockValue]
      //
      // On stack, before: hash, inverse, program, value
      // Compiler value, before: lastHelper=value of last found helper, if any
      // On stack, after, if no lastHelper: same as [blockValue]
      // On stack, after, if lastHelper: value
      ambiguousBlockValue: function ambiguousBlockValue() {
        var blockHelperMissing = this.aliasable("container.hooks.blockHelperMissing"), params = [this.contextName(0)];
        this.setupHelperArgs("", 0, params, true);
        this.flushInline();
        var current = this.topStack();
        params.splice(1, 0, current);
        this.pushSource(["if (!", this.lastHelper, ") { ", current, " = ", this.source.functionCall(blockHelperMissing, "call", params), "}"]);
      },
      // [appendContent]
      //
      // On stack, before: ...
      // On stack, after: ...
      //
      // Appends the string value of `content` to the current buffer
      appendContent: function appendContent(content) {
        if (this.pendingContent) {
          content = this.pendingContent + content;
        } else {
          this.pendingLocation = this.source.currentLocation;
        }
        this.pendingContent = content;
      },
      // [append]
      //
      // On stack, before: value, ...
      // On stack, after: ...
      //
      // Coerces `value` to a String and appends it to the current buffer.
      //
      // If `value` is truthy, or 0, it is coerced into a string and appended
      // Otherwise, the empty string is appended
      append: function append() {
        if (this.isInline()) {
          this.replaceStack(function(current) {
            return [" != null ? ", current, ' : ""'];
          });
          this.pushSource(this.appendToBuffer(this.popStack()));
        } else {
          var local = this.popStack();
          this.pushSource(["if (", local, " != null) { ", this.appendToBuffer(local, void 0, true), " }"]);
          if (this.environment.isSimple) {
            this.pushSource(["else { ", this.appendToBuffer("''", void 0, true), " }"]);
          }
        }
      },
      // [appendEscaped]
      //
      // On stack, before: value, ...
      // On stack, after: ...
      //
      // Escape `value` and append it to the buffer
      appendEscaped: function appendEscaped() {
        this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"), "(", this.popStack(), ")"]));
      },
      // [getContext]
      //
      // On stack, before: ...
      // On stack, after: ...
      // Compiler value, after: lastContext=depth
      //
      // Set the value of the `lastContext` compiler value to the depth
      getContext: function getContext3(depth) {
        this.lastContext = depth;
      },
      // [pushContext]
      //
      // On stack, before: ...
      // On stack, after: currentContext, ...
      //
      // Pushes the value of the current context onto the stack.
      pushContext: function pushContext() {
        this.pushStackLiteral(this.contextName(this.lastContext));
      },
      // [lookupOnContext]
      //
      // On stack, before: ...
      // On stack, after: currentContext[name], ...
      //
      // Looks up the value of `name` on the current context and pushes
      // it onto the stack.
      lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
        var i2 = 0;
        if (!scoped && this.options.compat && !this.lastContext) {
          this.push(this.depthedLookup(parts[i2++]));
        } else {
          this.pushContext();
        }
        this.resolvePath("context", parts, i2, falsy, strict);
      },
      // [lookupBlockParam]
      //
      // On stack, before: ...
      // On stack, after: blockParam[name], ...
      //
      // Looks up the value of `parts` on the given block param and pushes
      // it onto the stack.
      lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
        this.useBlockParams = true;
        this.push(["blockParams[", blockParamId[0], "][", blockParamId[1], "]"]);
        this.resolvePath("context", parts, 1);
      },
      // [lookupData]
      //
      // On stack, before: ...
      // On stack, after: data, ...
      //
      // Push the data lookup operator
      lookupData: function lookupData(depth, parts, strict) {
        if (!depth) {
          this.pushStackLiteral("data");
        } else {
          this.pushStackLiteral("container.data(data, " + depth + ")");
        }
        this.resolvePath("data", parts, 0, true, strict);
      },
      resolvePath: function resolvePath(type, parts, i2, falsy, strict) {
        var _this2 = this;
        if (this.options.strict || this.options.assumeObjects) {
          this.push(strictLookup(this.options.strict && strict, this, parts, i2, type));
          return;
        }
        var len = parts.length;
        for (; i2 < len; i2++) {
          this.replaceStack(function(current) {
            var lookup = _this2.nameLookup(current, parts[i2], type);
            if (!falsy) {
              return [" != null ? ", lookup, " : ", current];
            } else {
              return [" && ", lookup];
            }
          });
        }
      },
      // [resolvePossibleLambda]
      //
      // On stack, before: value, ...
      // On stack, after: resolved value, ...
      //
      // If the `value` is a lambda, replace it on the stack by
      // the return value of the lambda
      resolvePossibleLambda: function resolvePossibleLambda() {
        this.push([this.aliasable("container.lambda"), "(", this.popStack(), ", ", this.contextName(0), ")"]);
      },
      // [pushStringParam]
      //
      // On stack, before: ...
      // On stack, after: string, currentContext, ...
      //
      // This opcode is designed for use in string mode, which
      // provides the string value of a parameter along with its
      // depth rather than resolving it immediately.
      pushStringParam: function pushStringParam(string, type) {
        this.pushContext();
        this.pushString(type);
        if (type !== "SubExpression") {
          if (typeof string === "string") {
            this.pushString(string);
          } else {
            this.pushStackLiteral(string);
          }
        }
      },
      emptyHash: function emptyHash(omitEmpty) {
        if (this.trackIds) {
          this.push("{}");
        }
        if (this.stringParams) {
          this.push("{}");
          this.push("{}");
        }
        this.pushStackLiteral(omitEmpty ? "undefined" : "{}");
      },
      pushHash: function pushHash() {
        if (this.hash) {
          this.hashes.push(this.hash);
        }
        this.hash = { values: {}, types: [], contexts: [], ids: [] };
      },
      popHash: function popHash() {
        var hash2 = this.hash;
        this.hash = this.hashes.pop();
        if (this.trackIds) {
          this.push(this.objectLiteral(hash2.ids));
        }
        if (this.stringParams) {
          this.push(this.objectLiteral(hash2.contexts));
          this.push(this.objectLiteral(hash2.types));
        }
        this.push(this.objectLiteral(hash2.values));
      },
      // [pushString]
      //
      // On stack, before: ...
      // On stack, after: quotedString(string), ...
      //
      // Push a quoted version of `string` onto the stack
      pushString: function pushString(string) {
        this.pushStackLiteral(this.quotedString(string));
      },
      // [pushLiteral]
      //
      // On stack, before: ...
      // On stack, after: value, ...
      //
      // Pushes a value onto the stack. This operation prevents
      // the compiler from creating a temporary variable to hold
      // it.
      pushLiteral: function pushLiteral(value) {
        this.pushStackLiteral(value);
      },
      // [pushProgram]
      //
      // On stack, before: ...
      // On stack, after: program(guid), ...
      //
      // Push a program expression onto the stack. This takes
      // a compile-time guid and converts it into a runtime-accessible
      // expression.
      pushProgram: function pushProgram(guid) {
        if (guid != null) {
          this.pushStackLiteral(this.programExpression(guid));
        } else {
          this.pushStackLiteral(null);
        }
      },
      // [registerDecorator]
      //
      // On stack, before: hash, program, params..., ...
      // On stack, after: ...
      //
      // Pops off the decorator's parameters, invokes the decorator,
      // and inserts the decorator into the decorators list.
      registerDecorator: function registerDecorator(paramSize, name) {
        var foundDecorator = this.nameLookup("decorators", name, "decorator"), options = this.setupHelperArgs(name, paramSize);
        this.decorators.push(["fn = ", this.decorators.functionCall(foundDecorator, "", ["fn", "props", "container", options]), " || fn;"]);
      },
      // [invokeHelper]
      //
      // On stack, before: hash, inverse, program, params..., ...
      // On stack, after: result of helper invocation
      //
      // Pops off the helper's parameters, invokes the helper,
      // and pushes the helper's return value onto the stack.
      //
      // If the helper is not found, `helperMissing` is called.
      invokeHelper: function invokeHelper(paramSize, name, isSimple) {
        var nonHelper = this.popStack(), helper = this.setupHelper(paramSize, name);
        var possibleFunctionCalls = [];
        if (isSimple) {
          possibleFunctionCalls.push(helper.name);
        }
        possibleFunctionCalls.push(nonHelper);
        if (!this.options.strict) {
          possibleFunctionCalls.push(this.aliasable("container.hooks.helperMissing"));
        }
        var functionLookupCode = ["(", this.itemsSeparatedBy(possibleFunctionCalls, "||"), ")"];
        var functionCall = this.source.functionCall(functionLookupCode, "call", helper.callParams);
        this.push(functionCall);
      },
      itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
        var result = [];
        result.push(items[0]);
        for (var i2 = 1; i2 < items.length; i2++) {
          result.push(separator, items[i2]);
        }
        return result;
      },
      // [invokeKnownHelper]
      //
      // On stack, before: hash, inverse, program, params..., ...
      // On stack, after: result of helper invocation
      //
      // This operation is used when the helper is known to exist,
      // so a `helperMissing` fallback is not required.
      invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
        var helper = this.setupHelper(paramSize, name);
        this.push(this.source.functionCall(helper.name, "call", helper.callParams));
      },
      // [invokeAmbiguous]
      //
      // On stack, before: hash, inverse, program, params..., ...
      // On stack, after: result of disambiguation
      //
      // This operation is used when an expression like `{{foo}}`
      // is provided, but we don't know at compile-time whether it
      // is a helper or a path.
      //
      // This operation emits more code than the other options,
      // and can be avoided by passing the `knownHelpers` and
      // `knownHelpersOnly` flags at compile-time.
      invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
        this.useRegister("helper");
        var nonHelper = this.popStack();
        this.emptyHash();
        var helper = this.setupHelper(0, name, helperCall);
        var helperName = this.lastHelper = this.nameLookup("helpers", name, "helper");
        var lookup = ["(", "(helper = ", helperName, " || ", nonHelper, ")"];
        if (!this.options.strict) {
          lookup[0] = "(helper = ";
          lookup.push(" != null ? helper : ", this.aliasable("container.hooks.helperMissing"));
        }
        this.push(["(", lookup, helper.paramsInit ? ["),(", helper.paramsInit] : [], "),", "(typeof helper === ", this.aliasable('"function"'), " ? ", this.source.functionCall("helper", "call", helper.callParams), " : helper))"]);
      },
      // [invokePartial]
      //
      // On stack, before: context, ...
      // On stack after: result of partial invocation
      //
      // This operation pops off a context, invokes a partial with that context,
      // and pushes the result of the invocation back.
      invokePartial: function invokePartial(isDynamic, name, indent) {
        var params = [], options = this.setupParams(name, 1, params);
        if (isDynamic) {
          name = this.popStack();
          delete options.name;
        }
        if (indent) {
          options.indent = JSON.stringify(indent);
        }
        options.helpers = "helpers";
        options.partials = "partials";
        options.decorators = "container.decorators";
        if (!isDynamic) {
          params.unshift(this.nameLookup("partials", name, "partial"));
        } else {
          params.unshift(name);
        }
        if (this.options.compat) {
          options.depths = "depths";
        }
        options = this.objectLiteral(options);
        params.push(options);
        this.push(this.source.functionCall("container.invokePartial", "", params));
      },
      // [assignToHash]
      //
      // On stack, before: value, ..., hash, ...
      // On stack, after: ..., hash, ...
      //
      // Pops a value off the stack and assigns it to the current hash
      assignToHash: function assignToHash(key) {
        var value = this.popStack(), context2 = void 0, type = void 0, id2 = void 0;
        if (this.trackIds) {
          id2 = this.popStack();
        }
        if (this.stringParams) {
          type = this.popStack();
          context2 = this.popStack();
        }
        var hash2 = this.hash;
        if (context2) {
          hash2.contexts[key] = context2;
        }
        if (type) {
          hash2.types[key] = type;
        }
        if (id2) {
          hash2.ids[key] = id2;
        }
        hash2.values[key] = value;
      },
      pushId: function pushId(type, name, child) {
        if (type === "BlockParam") {
          this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + JSON.stringify("." + child) : ""));
        } else if (type === "PathExpression") {
          this.pushString(name);
        } else if (type === "SubExpression") {
          this.pushStackLiteral("true");
        } else {
          this.pushStackLiteral("null");
        }
      },
      // HELPERS
      compiler: JavaScriptCompiler,
      compileChildren: function compileChildren(environment2, options) {
        var children = environment2.children, child = void 0, compiler = void 0;
        for (var i2 = 0, l = children.length; i2 < l; i2++) {
          child = children[i2];
          compiler = new this.compiler();
          var existing = this.matchExistingProgram(child);
          if (existing == null) {
            this.context.programs.push("");
            var index = this.context.programs.length;
            child.index = index;
            child.name = "program" + index;
            this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
            this.context.decorators[index] = compiler.decorators;
            this.context.environments[index] = child;
            this.useDepths = this.useDepths || compiler.useDepths;
            this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
            child.useDepths = this.useDepths;
            child.useBlockParams = this.useBlockParams;
          } else {
            child.index = existing.index;
            child.name = "program" + existing.index;
            this.useDepths = this.useDepths || existing.useDepths;
            this.useBlockParams = this.useBlockParams || existing.useBlockParams;
          }
        }
      },
      matchExistingProgram: function matchExistingProgram(child) {
        for (var i2 = 0, len = this.context.environments.length; i2 < len; i2++) {
          var environment2 = this.context.environments[i2];
          if (environment2 && environment2.equals(child)) {
            return environment2;
          }
        }
      },
      programExpression: function programExpression(guid) {
        var child = this.environment.children[guid], programParams = [child.index, "data", child.blockParams];
        if (this.useBlockParams || this.useDepths) {
          programParams.push("blockParams");
        }
        if (this.useDepths) {
          programParams.push("depths");
        }
        return "container.program(" + programParams.join(", ") + ")";
      },
      useRegister: function useRegister(name) {
        if (!this.registers[name]) {
          this.registers[name] = true;
          this.registers.list.push(name);
        }
      },
      push: function push(expr) {
        if (!(expr instanceof Literal3)) {
          expr = this.source.wrap(expr);
        }
        this.inlineStack.push(expr);
        return expr;
      },
      pushStackLiteral: function pushStackLiteral(item) {
        this.push(new Literal3(item));
      },
      pushSource: function pushSource(source) {
        if (this.pendingContent) {
          this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
          this.pendingContent = void 0;
        }
        if (source) {
          this.source.push(source);
        }
      },
      replaceStack: function replaceStack(callback) {
        var prefix = ["("], stack = void 0, createdStack = void 0, usedLiteral = void 0;
        if (!this.isInline()) {
          throw new _exception2["default"]("replaceStack on non-inline");
        }
        var top = this.popStack(true);
        if (top instanceof Literal3) {
          stack = [top.value];
          prefix = ["(", stack];
          usedLiteral = true;
        } else {
          createdStack = true;
          var _name = this.incrStack();
          prefix = ["((", this.push(_name), " = ", top, ")"];
          stack = this.topStack();
        }
        var item = callback.call(this, stack);
        if (!usedLiteral) {
          this.popStack();
        }
        if (createdStack) {
          this.stackSlot--;
        }
        this.push(prefix.concat(item, ")"));
      },
      incrStack: function incrStack() {
        this.stackSlot++;
        if (this.stackSlot > this.stackVars.length) {
          this.stackVars.push("stack" + this.stackSlot);
        }
        return this.topStackName();
      },
      topStackName: function topStackName() {
        return "stack" + this.stackSlot;
      },
      flushInline: function flushInline() {
        var inlineStack = this.inlineStack;
        this.inlineStack = [];
        for (var i2 = 0, len = inlineStack.length; i2 < len; i2++) {
          var entry = inlineStack[i2];
          if (entry instanceof Literal3) {
            this.compileStack.push(entry);
          } else {
            var stack = this.incrStack();
            this.pushSource([stack, " = ", entry, ";"]);
            this.compileStack.push(stack);
          }
        }
      },
      isInline: function isInline() {
        return this.inlineStack.length;
      },
      popStack: function popStack(wrapped) {
        var inline = this.isInline(), item = (inline ? this.inlineStack : this.compileStack).pop();
        if (!wrapped && item instanceof Literal3) {
          return item.value;
        } else {
          if (!inline) {
            if (!this.stackSlot) {
              throw new _exception2["default"]("Invalid stack pop");
            }
            this.stackSlot--;
          }
          return item;
        }
      },
      topStack: function topStack() {
        var stack = this.isInline() ? this.inlineStack : this.compileStack, item = stack[stack.length - 1];
        if (item instanceof Literal3) {
          return item.value;
        } else {
          return item;
        }
      },
      contextName: function contextName(context2) {
        if (this.useDepths && context2) {
          return "depths[" + context2 + "]";
        } else {
          return "depth" + context2;
        }
      },
      quotedString: function quotedString(str2) {
        return this.source.quotedString(str2);
      },
      objectLiteral: function objectLiteral(obj) {
        return this.source.objectLiteral(obj);
      },
      aliasable: function aliasable(name) {
        var ret = this.aliases[name];
        if (ret) {
          ret.referenceCount++;
          return ret;
        }
        ret = this.aliases[name] = this.source.wrap(name);
        ret.aliasable = true;
        ret.referenceCount = 1;
        return ret;
      },
      setupHelper: function setupHelper(paramSize, name, blockHelper) {
        var params = [], paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
        var foundHelper = this.nameLookup("helpers", name, "helper"), callContext = this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : (container.nullContext || {})");
        return {
          params,
          paramsInit,
          name: foundHelper,
          callParams: [callContext].concat(params)
        };
      },
      setupParams: function setupParams(helper, paramSize, params) {
        var options = {}, contexts = [], types2 = [], ids = [], objectArgs = !params, param = void 0;
        if (objectArgs) {
          params = [];
        }
        options.name = this.quotedString(helper);
        options.hash = this.popStack();
        if (this.trackIds) {
          options.hashIds = this.popStack();
        }
        if (this.stringParams) {
          options.hashTypes = this.popStack();
          options.hashContexts = this.popStack();
        }
        var inverse30 = this.popStack(), program = this.popStack();
        if (program || inverse30) {
          options.fn = program || "container.noop";
          options.inverse = inverse30 || "container.noop";
        }
        var i2 = paramSize;
        while (i2--) {
          param = this.popStack();
          params[i2] = param;
          if (this.trackIds) {
            ids[i2] = this.popStack();
          }
          if (this.stringParams) {
            types2[i2] = this.popStack();
            contexts[i2] = this.popStack();
          }
        }
        if (objectArgs) {
          options.args = this.source.generateArray(params);
        }
        if (this.trackIds) {
          options.ids = this.source.generateArray(ids);
        }
        if (this.stringParams) {
          options.types = this.source.generateArray(types2);
          options.contexts = this.source.generateArray(contexts);
        }
        if (this.options.data) {
          options.data = "data";
        }
        if (this.useBlockParams) {
          options.blockParams = "blockParams";
        }
        return options;
      },
      setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
        var options = this.setupParams(helper, paramSize, params);
        options.loc = JSON.stringify(this.source.currentLocation);
        options = this.objectLiteral(options);
        if (useRegister) {
          this.useRegister("options");
          params.push("options");
          return ["options=", options];
        } else if (params) {
          params.push(options);
          return "";
        } else {
          return options;
        }
      }
    };
    (function() {
      var reservedWords = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" ");
      var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
      for (var i2 = 0, l = reservedWords.length; i2 < l; i2++) {
        compilerWords[reservedWords[i2]] = true;
      }
    })();
    JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
      return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
    };
    function strictLookup(requireTerminal, compiler, parts, i2, type) {
      var stack = compiler.popStack(), len = parts.length;
      if (requireTerminal) {
        len--;
      }
      for (; i2 < len; i2++) {
        stack = compiler.nameLookup(stack, parts[i2], type);
      }
      if (requireTerminal) {
        return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[i2]), ", ", JSON.stringify(compiler.source.currentLocation), " )"];
      } else {
        return stack;
      }
    }
    exports4["default"] = JavaScriptCompiler;
    module2.exports = exports4["default"];
  }
});

// node_modules/handlebars/dist/cjs/handlebars.js
var require_handlebars = __commonJS({
  "node_modules/handlebars/dist/cjs/handlebars.js"(exports4, module2) {
    "use strict";
    exports4.__esModule = true;
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }
    var _handlebarsRuntime = require_handlebars_runtime();
    var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
    var _handlebarsCompilerAst = require_ast();
    var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
    var _handlebarsCompilerBase = require_base2();
    var _handlebarsCompilerCompiler = require_compiler();
    var _handlebarsCompilerJavascriptCompiler = require_javascript_compiler();
    var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
    var _handlebarsCompilerVisitor = require_visitor();
    var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
    var _handlebarsNoConflict = require_no_conflict();
    var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
    var _create = _handlebarsRuntime2["default"].create;
    function create4() {
      var hb = _create();
      hb.compile = function(input2, options) {
        return _handlebarsCompilerCompiler.compile(input2, options, hb);
      };
      hb.precompile = function(input2, options) {
        return _handlebarsCompilerCompiler.precompile(input2, options, hb);
      };
      hb.AST = _handlebarsCompilerAst2["default"];
      hb.Compiler = _handlebarsCompilerCompiler.Compiler;
      hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2["default"];
      hb.Parser = _handlebarsCompilerBase.parser;
      hb.parse = _handlebarsCompilerBase.parse;
      hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
      return hb;
    }
    var inst = create4();
    inst.create = create4;
    _handlebarsNoConflict2["default"](inst);
    inst.Visitor = _handlebarsCompilerVisitor2["default"];
    inst["default"] = inst;
    exports4["default"] = inst;
    module2.exports = exports4["default"];
  }
});

// node_modules/uuid/lib/rng-browser.js
var require_rng_browser = __commonJS({
  "node_modules/uuid/lib/rng-browser.js"(exports4, module2) {
    var getRandomValues = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof window.msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
    if (getRandomValues) {
      rnds8 = new Uint8Array(16);
      module2.exports = function whatwgRNG() {
        getRandomValues(rnds8);
        return rnds8;
      };
    } else {
      rnds = new Array(16);
      module2.exports = function mathRNG() {
        for (var i2 = 0, r; i2 < 16; i2++) {
          if ((i2 & 3) === 0) r = Math.random() * 4294967296;
          rnds[i2] = r >>> ((i2 & 3) << 3) & 255;
        }
        return rnds;
      };
    }
    var rnds8;
    var rnds;
  }
});

// node_modules/uuid/lib/bytesToUuid.js
var require_bytesToUuid = __commonJS({
  "node_modules/uuid/lib/bytesToUuid.js"(exports4, module2) {
    var byteToHex = [];
    for (i2 = 0; i2 < 256; ++i2) {
      byteToHex[i2] = (i2 + 256).toString(16).substr(1);
    }
    var i2;
    function bytesToUuid(buf, offset2) {
      var i3 = offset2 || 0;
      var bth = byteToHex;
      return [
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]],
        "-",
        bth[buf[i3++]],
        bth[buf[i3++]],
        "-",
        bth[buf[i3++]],
        bth[buf[i3++]],
        "-",
        bth[buf[i3++]],
        bth[buf[i3++]],
        "-",
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]],
        bth[buf[i3++]]
      ].join("");
    }
    module2.exports = bytesToUuid;
  }
});

// node_modules/uuid/v1.js
var require_v1 = __commonJS({
  "node_modules/uuid/v1.js"(exports4, module2) {
    var rng = require_rng_browser();
    var bytesToUuid = require_bytesToUuid();
    var _nodeId;
    var _clockseq;
    var _lastMSecs = 0;
    var _lastNSecs = 0;
    function v14(options, buf, offset2) {
      var i2 = buf && offset2 || 0;
      var b = buf || [];
      options = options || {};
      var node = options.node || _nodeId;
      var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
      if (node == null || clockseq == null) {
        var seedBytes = rng();
        if (node == null) {
          node = _nodeId = [
            seedBytes[0] | 1,
            seedBytes[1],
            seedBytes[2],
            seedBytes[3],
            seedBytes[4],
            seedBytes[5]
          ];
        }
        if (clockseq == null) {
          clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
        }
      }
      var msecs = options.msecs !== void 0 ? options.msecs : (/* @__PURE__ */ new Date()).getTime();
      var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
      var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
      if (dt < 0 && options.clockseq === void 0) {
        clockseq = clockseq + 1 & 16383;
      }
      if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
        nsecs = 0;
      }
      if (nsecs >= 1e4) {
        throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
      }
      _lastMSecs = msecs;
      _lastNSecs = nsecs;
      _clockseq = clockseq;
      msecs += 122192928e5;
      var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
      b[i2++] = tl >>> 24 & 255;
      b[i2++] = tl >>> 16 & 255;
      b[i2++] = tl >>> 8 & 255;
      b[i2++] = tl & 255;
      var tmh = msecs / 4294967296 * 1e4 & 268435455;
      b[i2++] = tmh >>> 8 & 255;
      b[i2++] = tmh & 255;
      b[i2++] = tmh >>> 24 & 15 | 16;
      b[i2++] = tmh >>> 16 & 255;
      b[i2++] = clockseq >>> 8 | 128;
      b[i2++] = clockseq & 255;
      for (var n = 0; n < 6; ++n) {
        b[i2 + n] = node[n];
      }
      return buf ? buf : bytesToUuid(b);
    }
    module2.exports = v14;
  }
});

// node_modules/uuid/v4.js
var require_v4 = __commonJS({
  "node_modules/uuid/v4.js"(exports4, module2) {
    var rng = require_rng_browser();
    var bytesToUuid = require_bytesToUuid();
    function v4(options, buf, offset2) {
      var i2 = buf && offset2 || 0;
      if (typeof options == "string") {
        buf = options === "binary" ? new Array(16) : null;
        options = null;
      }
      options = options || {};
      var rnds = options.random || (options.rng || rng)();
      rnds[6] = rnds[6] & 15 | 64;
      rnds[8] = rnds[8] & 63 | 128;
      if (buf) {
        for (var ii = 0; ii < 16; ++ii) {
          buf[i2 + ii] = rnds[ii];
        }
      }
      return buf || bytesToUuid(rnds);
    }
    module2.exports = v4;
  }
});

// node_modules/uuid/index.js
var require_uuid = __commonJS({
  "node_modules/uuid/index.js"(exports4, module2) {
    var v14 = require_v1();
    var v4 = require_v4();
    var uuid4 = v4;
    uuid4.v1 = v14;
    uuid4.v4 = v4;
    module2.exports = uuid4;
  }
});

// node_modules/moment/moment.js
var require_moment = __commonJS({
  "node_modules/moment/moment.js"(exports4, module2) {
    (function(global2, factory2) {
      typeof exports4 === "object" && typeof module2 !== "undefined" ? module2.exports = factory2() : typeof define === "function" && define.amd ? define(factory2) : global2.moment = factory2();
    })(exports4, function() {
      "use strict";
      var hookCallback;
      function hooks() {
        return hookCallback.apply(null, arguments);
      }
      function setHookCallback(callback) {
        hookCallback = callback;
      }
      function isArray4(input2) {
        return input2 instanceof Array || Object.prototype.toString.call(input2) === "[object Array]";
      }
      function isObject2(input2) {
        return input2 != null && Object.prototype.toString.call(input2) === "[object Object]";
      }
      function hasOwnProp(a, b) {
        return Object.prototype.hasOwnProperty.call(a, b);
      }
      function isObjectEmpty(obj) {
        if (Object.getOwnPropertyNames) {
          return Object.getOwnPropertyNames(obj).length === 0;
        } else {
          var k;
          for (k in obj) {
            if (hasOwnProp(obj, k)) {
              return false;
            }
          }
          return true;
        }
      }
      function isUndefined(input2) {
        return input2 === void 0;
      }
      function isNumber6(input2) {
        return typeof input2 === "number" || Object.prototype.toString.call(input2) === "[object Number]";
      }
      function isDate2(input2) {
        return input2 instanceof Date || Object.prototype.toString.call(input2) === "[object Date]";
      }
      function map2(arr, fn) {
        var res = [], i2, arrLen = arr.length;
        for (i2 = 0; i2 < arrLen; ++i2) {
          res.push(fn(arr[i2], i2));
        }
        return res;
      }
      function extend4(a, b) {
        for (var i2 in b) {
          if (hasOwnProp(b, i2)) {
            a[i2] = b[i2];
          }
        }
        if (hasOwnProp(b, "toString")) {
          a.toString = b.toString;
        }
        if (hasOwnProp(b, "valueOf")) {
          a.valueOf = b.valueOf;
        }
        return a;
      }
      function createUTC(input2, format2, locale2, strict) {
        return createLocalOrUTC(input2, format2, locale2, strict, true).utc();
      }
      function defaultParsingFlags() {
        return {
          empty: false,
          unusedTokens: [],
          unusedInput: [],
          overflow: -2,
          charsLeftOver: 0,
          nullInput: false,
          invalidEra: null,
          invalidMonth: null,
          invalidFormat: false,
          userInvalidated: false,
          iso: false,
          parsedDateParts: [],
          era: null,
          meridiem: null,
          rfc2822: false,
          weekdayMismatch: false
        };
      }
      function getParsingFlags(m) {
        if (m._pf == null) {
          m._pf = defaultParsingFlags();
        }
        return m._pf;
      }
      var some;
      if (Array.prototype.some) {
        some = Array.prototype.some;
      } else {
        some = function(fun2) {
          var t = Object(this), len = t.length >>> 0, i2;
          for (i2 = 0; i2 < len; i2++) {
            if (i2 in t && fun2.call(this, t[i2], i2, t)) {
              return true;
            }
          }
          return false;
        };
      }
      function isValid(m) {
        var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
        if (isNowValid) {
          flags = getParsingFlags(m);
          parsedParts = some.call(flags.parsedDateParts, function(i2) {
            return i2 != null;
          });
          isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
          if (m._strict) {
            isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
          }
        }
        if (Object.isFrozen == null || !Object.isFrozen(m)) {
          m._isValid = isNowValid;
        } else {
          return isNowValid;
        }
        return m._isValid;
      }
      function createInvalid(flags) {
        var m = createUTC(NaN);
        if (flags != null) {
          extend4(getParsingFlags(m), flags);
        } else {
          getParsingFlags(m).userInvalidated = true;
        }
        return m;
      }
      var momentProperties = hooks.momentProperties = [], updateInProgress = false;
      function copyConfig(to2, from3) {
        var i2, prop, val, momentPropertiesLen = momentProperties.length;
        if (!isUndefined(from3._isAMomentObject)) {
          to2._isAMomentObject = from3._isAMomentObject;
        }
        if (!isUndefined(from3._i)) {
          to2._i = from3._i;
        }
        if (!isUndefined(from3._f)) {
          to2._f = from3._f;
        }
        if (!isUndefined(from3._l)) {
          to2._l = from3._l;
        }
        if (!isUndefined(from3._strict)) {
          to2._strict = from3._strict;
        }
        if (!isUndefined(from3._tzm)) {
          to2._tzm = from3._tzm;
        }
        if (!isUndefined(from3._isUTC)) {
          to2._isUTC = from3._isUTC;
        }
        if (!isUndefined(from3._offset)) {
          to2._offset = from3._offset;
        }
        if (!isUndefined(from3._pf)) {
          to2._pf = getParsingFlags(from3);
        }
        if (!isUndefined(from3._locale)) {
          to2._locale = from3._locale;
        }
        if (momentPropertiesLen > 0) {
          for (i2 = 0; i2 < momentPropertiesLen; i2++) {
            prop = momentProperties[i2];
            val = from3[prop];
            if (!isUndefined(val)) {
              to2[prop] = val;
            }
          }
        }
        return to2;
      }
      function Moment(config2) {
        copyConfig(this, config2);
        this._d = new Date(config2._d != null ? config2._d.getTime() : NaN);
        if (!this.isValid()) {
          this._d = /* @__PURE__ */ new Date(NaN);
        }
        if (updateInProgress === false) {
          updateInProgress = true;
          hooks.updateOffset(this);
          updateInProgress = false;
        }
      }
      function isMoment(obj) {
        return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
      }
      function warn(msg) {
        if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
          console.warn("Deprecation warning: " + msg);
        }
      }
      function deprecate(msg, fn) {
        var firstTime = true;
        return extend4(function() {
          if (hooks.deprecationHandler != null) {
            hooks.deprecationHandler(null, msg);
          }
          if (firstTime) {
            var args = [], arg, i2, key, argLen = arguments.length;
            for (i2 = 0; i2 < argLen; i2++) {
              arg = "";
              if (typeof arguments[i2] === "object") {
                arg += "\n[" + i2 + "] ";
                for (key in arguments[0]) {
                  if (hasOwnProp(arguments[0], key)) {
                    arg += key + ": " + arguments[0][key] + ", ";
                  }
                }
                arg = arg.slice(0, -2);
              } else {
                arg = arguments[i2];
              }
              args.push(arg);
            }
            warn(
              msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
            );
            firstTime = false;
          }
          return fn.apply(this, arguments);
        }, fn);
      }
      var deprecations = {};
      function deprecateSimple(name, msg) {
        if (hooks.deprecationHandler != null) {
          hooks.deprecationHandler(name, msg);
        }
        if (!deprecations[name]) {
          warn(msg);
          deprecations[name] = true;
        }
      }
      hooks.suppressDeprecationWarnings = false;
      hooks.deprecationHandler = null;
      function isFunction5(input2) {
        return typeof Function !== "undefined" && input2 instanceof Function || Object.prototype.toString.call(input2) === "[object Function]";
      }
      function set2(config2) {
        var prop, i2;
        for (i2 in config2) {
          if (hasOwnProp(config2, i2)) {
            prop = config2[i2];
            if (isFunction5(prop)) {
              this[i2] = prop;
            } else {
              this["_" + i2] = prop;
            }
          }
        }
        this._config = config2;
        this._dayOfMonthOrdinalParseLenient = new RegExp(
          (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
        );
      }
      function mergeConfigs(parentConfig, childConfig) {
        var res = extend4({}, parentConfig), prop;
        for (prop in childConfig) {
          if (hasOwnProp(childConfig, prop)) {
            if (isObject2(parentConfig[prop]) && isObject2(childConfig[prop])) {
              res[prop] = {};
              extend4(res[prop], parentConfig[prop]);
              extend4(res[prop], childConfig[prop]);
            } else if (childConfig[prop] != null) {
              res[prop] = childConfig[prop];
            } else {
              delete res[prop];
            }
          }
        }
        for (prop in parentConfig) {
          if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject2(parentConfig[prop])) {
            res[prop] = extend4({}, res[prop]);
          }
        }
        return res;
      }
      function Locale(config2) {
        if (config2 != null) {
          this.set(config2);
        }
      }
      var keys;
      if (Object.keys) {
        keys = Object.keys;
      } else {
        keys = function(obj) {
          var i2, res = [];
          for (i2 in obj) {
            if (hasOwnProp(obj, i2)) {
              res.push(i2);
            }
          }
          return res;
        };
      }
      var defaultCalendar = {
        sameDay: "[Today at] LT",
        nextDay: "[Tomorrow at] LT",
        nextWeek: "dddd [at] LT",
        lastDay: "[Yesterday at] LT",
        lastWeek: "[Last] dddd [at] LT",
        sameElse: "L"
      };
      function calendar(key, mom, now2) {
        var output = this._calendar[key] || this._calendar["sameElse"];
        return isFunction5(output) ? output.call(mom, now2) : output;
      }
      function zeroFill(number2, targetLength, forceSign) {
        var absNumber = "" + Math.abs(number2), zerosToFill = targetLength - absNumber.length, sign2 = number2 >= 0;
        return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
      }
      var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
      function addFormatToken(token2, padded, ordinal2, callback) {
        var func = callback;
        if (typeof callback === "string") {
          func = function() {
            return this[callback]();
          };
        }
        if (token2) {
          formatTokenFunctions[token2] = func;
        }
        if (padded) {
          formatTokenFunctions[padded[0]] = function() {
            return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
          };
        }
        if (ordinal2) {
          formatTokenFunctions[ordinal2] = function() {
            return this.localeData().ordinal(
              func.apply(this, arguments),
              token2
            );
          };
        }
      }
      function removeFormattingTokens(input2) {
        if (input2.match(/\[[\s\S]/)) {
          return input2.replace(/^\[|\]$/g, "");
        }
        return input2.replace(/\\/g, "");
      }
      function makeFormatFunction(format2) {
        var array2 = format2.match(formattingTokens), i2, length;
        for (i2 = 0, length = array2.length; i2 < length; i2++) {
          if (formatTokenFunctions[array2[i2]]) {
            array2[i2] = formatTokenFunctions[array2[i2]];
          } else {
            array2[i2] = removeFormattingTokens(array2[i2]);
          }
        }
        return function(mom) {
          var output = "", i3;
          for (i3 = 0; i3 < length; i3++) {
            output += isFunction5(array2[i3]) ? array2[i3].call(mom, format2) : array2[i3];
          }
          return output;
        };
      }
      function formatMoment(m, format2) {
        if (!m.isValid()) {
          return m.localeData().invalidDate();
        }
        format2 = expandFormat(format2, m.localeData());
        formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
        return formatFunctions[format2](m);
      }
      function expandFormat(format2, locale2) {
        var i2 = 5;
        function replaceLongDateFormatTokens(input2) {
          return locale2.longDateFormat(input2) || input2;
        }
        localFormattingTokens.lastIndex = 0;
        while (i2 >= 0 && localFormattingTokens.test(format2)) {
          format2 = format2.replace(
            localFormattingTokens,
            replaceLongDateFormatTokens
          );
          localFormattingTokens.lastIndex = 0;
          i2 -= 1;
        }
        return format2;
      }
      var defaultLongDateFormat = {
        LTS: "h:mm:ss A",
        LT: "h:mm A",
        L: "MM/DD/YYYY",
        LL: "MMMM D, YYYY",
        LLL: "MMMM D, YYYY h:mm A",
        LLLL: "dddd, MMMM D, YYYY h:mm A"
      };
      function longDateFormat(key) {
        var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
        if (format2 || !formatUpper) {
          return format2;
        }
        this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
          if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
            return tok.slice(1);
          }
          return tok;
        }).join("");
        return this._longDateFormat[key];
      }
      var defaultInvalidDate = "Invalid date";
      function invalidDate() {
        return this._invalidDate;
      }
      var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
      function ordinal(number2) {
        return this._ordinal.replace("%d", number2);
      }
      var defaultRelativeTime = {
        future: "in %s",
        past: "%s ago",
        s: "a few seconds",
        ss: "%d seconds",
        m: "a minute",
        mm: "%d minutes",
        h: "an hour",
        hh: "%d hours",
        d: "a day",
        dd: "%d days",
        w: "a week",
        ww: "%d weeks",
        M: "a month",
        MM: "%d months",
        y: "a year",
        yy: "%d years"
      };
      function relativeTime(number2, withoutSuffix, string, isFuture) {
        var output = this._relativeTime[string];
        return isFunction5(output) ? output(number2, withoutSuffix, string, isFuture) : output.replace(/%d/i, number2);
      }
      function pastFuture(diff2, output) {
        var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
        return isFunction5(format2) ? format2(output) : format2.replace(/%s/i, output);
      }
      var aliases = {
        D: "date",
        dates: "date",
        date: "date",
        d: "day",
        days: "day",
        day: "day",
        e: "weekday",
        weekdays: "weekday",
        weekday: "weekday",
        E: "isoWeekday",
        isoweekdays: "isoWeekday",
        isoweekday: "isoWeekday",
        DDD: "dayOfYear",
        dayofyears: "dayOfYear",
        dayofyear: "dayOfYear",
        h: "hour",
        hours: "hour",
        hour: "hour",
        ms: "millisecond",
        milliseconds: "millisecond",
        millisecond: "millisecond",
        m: "minute",
        minutes: "minute",
        minute: "minute",
        M: "month",
        months: "month",
        month: "month",
        Q: "quarter",
        quarters: "quarter",
        quarter: "quarter",
        s: "second",
        seconds: "second",
        second: "second",
        gg: "weekYear",
        weekyears: "weekYear",
        weekyear: "weekYear",
        GG: "isoWeekYear",
        isoweekyears: "isoWeekYear",
        isoweekyear: "isoWeekYear",
        w: "week",
        weeks: "week",
        week: "week",
        W: "isoWeek",
        isoweeks: "isoWeek",
        isoweek: "isoWeek",
        y: "year",
        years: "year",
        year: "year"
      };
      function normalizeUnits(units) {
        return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
      }
      function normalizeObjectUnits(inputObject) {
        var normalizedInput = {}, normalizedProp, prop;
        for (prop in inputObject) {
          if (hasOwnProp(inputObject, prop)) {
            normalizedProp = normalizeUnits(prop);
            if (normalizedProp) {
              normalizedInput[normalizedProp] = inputObject[prop];
            }
          }
        }
        return normalizedInput;
      }
      var priorities = {
        date: 9,
        day: 11,
        weekday: 11,
        isoWeekday: 11,
        dayOfYear: 4,
        hour: 13,
        millisecond: 16,
        minute: 14,
        month: 8,
        quarter: 7,
        second: 15,
        weekYear: 1,
        isoWeekYear: 1,
        week: 5,
        isoWeek: 5,
        year: 1
      };
      function getPrioritizedUnits(unitsObj) {
        var units = [], u2;
        for (u2 in unitsObj) {
          if (hasOwnProp(unitsObj, u2)) {
            units.push({ unit: u2, priority: priorities[u2] });
          }
        }
        units.sort(function(a, b) {
          return a.priority - b.priority;
        });
        return units;
      }
      var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
      regexes = {};
      function addRegexToken(token2, regex, strictRegex) {
        regexes[token2] = isFunction5(regex) ? regex : function(isStrict, localeData2) {
          return isStrict && strictRegex ? strictRegex : regex;
        };
      }
      function getParseRegexForToken(token2, config2) {
        if (!hasOwnProp(regexes, token2)) {
          return new RegExp(unescapeFormat(token2));
        }
        return regexes[token2](config2._strict, config2._locale);
      }
      function unescapeFormat(s) {
        return regexEscape(
          s.replace("\\", "").replace(
            /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
            function(matched, p12, p22, p32, p42) {
              return p12 || p22 || p32 || p42;
            }
          )
        );
      }
      function regexEscape(s) {
        return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
      }
      function absFloor(number2) {
        if (number2 < 0) {
          return Math.ceil(number2) || 0;
        } else {
          return Math.floor(number2);
        }
      }
      function toInt(argumentForCoercion) {
        var coercedNumber = +argumentForCoercion, value = 0;
        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
          value = absFloor(coercedNumber);
        }
        return value;
      }
      var tokens = {};
      function addParseToken(token2, callback) {
        var i2, func = callback, tokenLen;
        if (typeof token2 === "string") {
          token2 = [token2];
        }
        if (isNumber6(callback)) {
          func = function(input2, array2) {
            array2[callback] = toInt(input2);
          };
        }
        tokenLen = token2.length;
        for (i2 = 0; i2 < tokenLen; i2++) {
          tokens[token2[i2]] = func;
        }
      }
      function addWeekParseToken(token2, callback) {
        addParseToken(token2, function(input2, array2, config2, token3) {
          config2._w = config2._w || {};
          callback(input2, config2._w, config2, token3);
        });
      }
      function addTimeToArrayFromToken(token2, input2, config2) {
        if (input2 != null && hasOwnProp(tokens, token2)) {
          tokens[token2](input2, config2._a, config2, token2);
        }
      }
      function isLeapYear(year) {
        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
      }
      var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
      addFormatToken("Y", 0, 0, function() {
        var y = this.year();
        return y <= 9999 ? zeroFill(y, 4) : "+" + y;
      });
      addFormatToken(0, ["YY", 2], 0, function() {
        return this.year() % 100;
      });
      addFormatToken(0, ["YYYY", 4], 0, "year");
      addFormatToken(0, ["YYYYY", 5], 0, "year");
      addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
      addRegexToken("Y", matchSigned);
      addRegexToken("YY", match1to2, match2);
      addRegexToken("YYYY", match1to4, match4);
      addRegexToken("YYYYY", match1to6, match6);
      addRegexToken("YYYYYY", match1to6, match6);
      addParseToken(["YYYYY", "YYYYYY"], YEAR);
      addParseToken("YYYY", function(input2, array2) {
        array2[YEAR] = input2.length === 2 ? hooks.parseTwoDigitYear(input2) : toInt(input2);
      });
      addParseToken("YY", function(input2, array2) {
        array2[YEAR] = hooks.parseTwoDigitYear(input2);
      });
      addParseToken("Y", function(input2, array2) {
        array2[YEAR] = parseInt(input2, 10);
      });
      function daysInYear(year) {
        return isLeapYear(year) ? 366 : 365;
      }
      hooks.parseTwoDigitYear = function(input2) {
        return toInt(input2) + (toInt(input2) > 68 ? 1900 : 2e3);
      };
      var getSetYear = makeGetSet("FullYear", true);
      function getIsLeapYear() {
        return isLeapYear(this.year());
      }
      function makeGetSet(unit, keepTime) {
        return function(value) {
          if (value != null) {
            set$1(this, unit, value);
            hooks.updateOffset(this, keepTime);
            return this;
          } else {
            return get8(this, unit);
          }
        };
      }
      function get8(mom, unit) {
        if (!mom.isValid()) {
          return NaN;
        }
        var d = mom._d, isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
          case "Seconds":
            return isUTC ? d.getUTCSeconds() : d.getSeconds();
          case "Minutes":
            return isUTC ? d.getUTCMinutes() : d.getMinutes();
          case "Hours":
            return isUTC ? d.getUTCHours() : d.getHours();
          case "Date":
            return isUTC ? d.getUTCDate() : d.getDate();
          case "Day":
            return isUTC ? d.getUTCDay() : d.getDay();
          case "Month":
            return isUTC ? d.getUTCMonth() : d.getMonth();
          case "FullYear":
            return isUTC ? d.getUTCFullYear() : d.getFullYear();
          default:
            return NaN;
        }
      }
      function set$1(mom, unit, value) {
        var d, isUTC, year, month, date;
        if (!mom.isValid() || isNaN(value)) {
          return;
        }
        d = mom._d;
        isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
          case "Seconds":
            return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
          case "Minutes":
            return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
          case "Hours":
            return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
          case "Date":
            return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
          case "FullYear":
            break;
          default:
            return;
        }
        year = value;
        month = mom.month();
        date = mom.date();
        date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
        void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
      }
      function stringGet(units) {
        units = normalizeUnits(units);
        if (isFunction5(this[units])) {
          return this[units]();
        }
        return this;
      }
      function stringSet(units, value) {
        if (typeof units === "object") {
          units = normalizeObjectUnits(units);
          var prioritized = getPrioritizedUnits(units), i2, prioritizedLen = prioritized.length;
          for (i2 = 0; i2 < prioritizedLen; i2++) {
            this[prioritized[i2].unit](units[prioritized[i2].unit]);
          }
        } else {
          units = normalizeUnits(units);
          if (isFunction5(this[units])) {
            return this[units](value);
          }
        }
        return this;
      }
      function mod(n, x) {
        return (n % x + x) % x;
      }
      var indexOf2;
      if (Array.prototype.indexOf) {
        indexOf2 = Array.prototype.indexOf;
      } else {
        indexOf2 = function(o) {
          var i2;
          for (i2 = 0; i2 < this.length; ++i2) {
            if (this[i2] === o) {
              return i2;
            }
          }
          return -1;
        };
      }
      function daysInMonth(year, month) {
        if (isNaN(year) || isNaN(month)) {
          return NaN;
        }
        var modMonth = mod(month, 12);
        year += (month - modMonth) / 12;
        return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
      }
      addFormatToken("M", ["MM", 2], "Mo", function() {
        return this.month() + 1;
      });
      addFormatToken("MMM", 0, 0, function(format2) {
        return this.localeData().monthsShort(this, format2);
      });
      addFormatToken("MMMM", 0, 0, function(format2) {
        return this.localeData().months(this, format2);
      });
      addRegexToken("M", match1to2, match1to2NoLeadingZero);
      addRegexToken("MM", match1to2, match2);
      addRegexToken("MMM", function(isStrict, locale2) {
        return locale2.monthsShortRegex(isStrict);
      });
      addRegexToken("MMMM", function(isStrict, locale2) {
        return locale2.monthsRegex(isStrict);
      });
      addParseToken(["M", "MM"], function(input2, array2) {
        array2[MONTH] = toInt(input2) - 1;
      });
      addParseToken(["MMM", "MMMM"], function(input2, array2, config2, token2) {
        var month = config2._locale.monthsParse(input2, token2, config2._strict);
        if (month != null) {
          array2[MONTH] = month;
        } else {
          getParsingFlags(config2).invalidMonth = input2;
        }
      });
      var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
        "_"
      ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
      function localeMonths(m, format2) {
        if (!m) {
          return isArray4(this._months) ? this._months : this._months["standalone"];
        }
        return isArray4(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()];
      }
      function localeMonthsShort(m, format2) {
        if (!m) {
          return isArray4(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
        }
        return isArray4(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
      }
      function handleStrictParse(monthName, format2, strict) {
        var i2, ii, mom, llc = monthName.toLocaleLowerCase();
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
          for (i2 = 0; i2 < 12; ++i2) {
            mom = createUTC([2e3, i2]);
            this._shortMonthsParse[i2] = this.monthsShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._longMonthsParse[i2] = this.months(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format2 === "MMM") {
            ii = indexOf2.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf2.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format2 === "MMM") {
            ii = indexOf2.call(this._shortMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf2.call(this._longMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeMonthsParse(monthName, format2, strict) {
        var i2, mom, regex;
        if (this._monthsParseExact) {
          return handleStrictParse.call(this, monthName, format2, strict);
        }
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
        }
        for (i2 = 0; i2 < 12; i2++) {
          mom = createUTC([2e3, i2]);
          if (strict && !this._longMonthsParse[i2]) {
            this._longMonthsParse[i2] = new RegExp(
              "^" + this.months(mom, "").replace(".", "") + "$",
              "i"
            );
            this._shortMonthsParse[i2] = new RegExp(
              "^" + this.monthsShort(mom, "").replace(".", "") + "$",
              "i"
            );
          }
          if (!strict && !this._monthsParse[i2]) {
            regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
            this._monthsParse[i2] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format2 === "MMMM" && this._longMonthsParse[i2].test(monthName)) {
            return i2;
          } else if (strict && format2 === "MMM" && this._shortMonthsParse[i2].test(monthName)) {
            return i2;
          } else if (!strict && this._monthsParse[i2].test(monthName)) {
            return i2;
          }
        }
      }
      function setMonth(mom, value) {
        if (!mom.isValid()) {
          return mom;
        }
        if (typeof value === "string") {
          if (/^\d+$/.test(value)) {
            value = toInt(value);
          } else {
            value = mom.localeData().monthsParse(value);
            if (!isNumber6(value)) {
              return mom;
            }
          }
        }
        var month = value, date = mom.date();
        date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
        void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
        return mom;
      }
      function getSetMonth(value) {
        if (value != null) {
          setMonth(this, value);
          hooks.updateOffset(this, true);
          return this;
        } else {
          return get8(this, "Month");
        }
      }
      function getDaysInMonth() {
        return daysInMonth(this.year(), this.month());
      }
      function monthsShortRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsShortStrictRegex;
          } else {
            return this._monthsShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsShortRegex")) {
            this._monthsShortRegex = defaultMonthsShortRegex;
          }
          return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
        }
      }
      function monthsRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsStrictRegex;
          } else {
            return this._monthsRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsRegex")) {
            this._monthsRegex = defaultMonthsRegex;
          }
          return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
        }
      }
      function computeMonthsParse() {
        function cmpLenRev(a, b) {
          return b.length - a.length;
        }
        var shortPieces = [], longPieces = [], mixedPieces = [], i2, mom, shortP, longP;
        for (i2 = 0; i2 < 12; i2++) {
          mom = createUTC([2e3, i2]);
          shortP = regexEscape(this.monthsShort(mom, ""));
          longP = regexEscape(this.months(mom, ""));
          shortPieces.push(shortP);
          longPieces.push(longP);
          mixedPieces.push(longP);
          mixedPieces.push(shortP);
        }
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._monthsShortRegex = this._monthsRegex;
        this._monthsStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._monthsShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
      }
      function createDate2(y, m, d, h, M, s, ms) {
        var date;
        if (y < 100 && y >= 0) {
          date = new Date(y + 400, m, d, h, M, s, ms);
          if (isFinite(date.getFullYear())) {
            date.setFullYear(y);
          }
        } else {
          date = new Date(y, m, d, h, M, s, ms);
        }
        return date;
      }
      function createUTCDate(y) {
        var date, args;
        if (y < 100 && y >= 0) {
          args = Array.prototype.slice.call(arguments);
          args[0] = y + 400;
          date = new Date(Date.UTC.apply(null, args));
          if (isFinite(date.getUTCFullYear())) {
            date.setUTCFullYear(y);
          }
        } else {
          date = new Date(Date.UTC.apply(null, arguments));
        }
        return date;
      }
      function firstWeekOffset(year, dow, doy) {
        var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
        return -fwdlw + fwd - 1;
      }
      function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
        var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
        if (dayOfYear <= 0) {
          resYear = year - 1;
          resDayOfYear = daysInYear(resYear) + dayOfYear;
        } else if (dayOfYear > daysInYear(year)) {
          resYear = year + 1;
          resDayOfYear = dayOfYear - daysInYear(year);
        } else {
          resYear = year;
          resDayOfYear = dayOfYear;
        }
        return {
          year: resYear,
          dayOfYear: resDayOfYear
        };
      }
      function weekOfYear(mom, dow, doy) {
        var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
        if (week < 1) {
          resYear = mom.year() - 1;
          resWeek = week + weeksInYear(resYear, dow, doy);
        } else if (week > weeksInYear(mom.year(), dow, doy)) {
          resWeek = week - weeksInYear(mom.year(), dow, doy);
          resYear = mom.year() + 1;
        } else {
          resYear = mom.year();
          resWeek = week;
        }
        return {
          week: resWeek,
          year: resYear
        };
      }
      function weeksInYear(year, dow, doy) {
        var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
      }
      addFormatToken("w", ["ww", 2], "wo", "week");
      addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
      addRegexToken("w", match1to2, match1to2NoLeadingZero);
      addRegexToken("ww", match1to2, match2);
      addRegexToken("W", match1to2, match1to2NoLeadingZero);
      addRegexToken("WW", match1to2, match2);
      addWeekParseToken(
        ["w", "ww", "W", "WW"],
        function(input2, week, config2, token2) {
          week[token2.substr(0, 1)] = toInt(input2);
        }
      );
      function localeWeek(mom) {
        return weekOfYear(mom, this._week.dow, this._week.doy).week;
      }
      var defaultLocaleWeek = {
        dow: 0,
        // Sunday is the first day of the week.
        doy: 6
        // The week that contains Jan 6th is the first week of the year.
      };
      function localeFirstDayOfWeek() {
        return this._week.dow;
      }
      function localeFirstDayOfYear() {
        return this._week.doy;
      }
      function getSetWeek(input2) {
        var week = this.localeData().week(this);
        return input2 == null ? week : this.add((input2 - week) * 7, "d");
      }
      function getSetISOWeek(input2) {
        var week = weekOfYear(this, 1, 4).week;
        return input2 == null ? week : this.add((input2 - week) * 7, "d");
      }
      addFormatToken("d", 0, "do", "day");
      addFormatToken("dd", 0, 0, function(format2) {
        return this.localeData().weekdaysMin(this, format2);
      });
      addFormatToken("ddd", 0, 0, function(format2) {
        return this.localeData().weekdaysShort(this, format2);
      });
      addFormatToken("dddd", 0, 0, function(format2) {
        return this.localeData().weekdays(this, format2);
      });
      addFormatToken("e", 0, 0, "weekday");
      addFormatToken("E", 0, 0, "isoWeekday");
      addRegexToken("d", match1to2);
      addRegexToken("e", match1to2);
      addRegexToken("E", match1to2);
      addRegexToken("dd", function(isStrict, locale2) {
        return locale2.weekdaysMinRegex(isStrict);
      });
      addRegexToken("ddd", function(isStrict, locale2) {
        return locale2.weekdaysShortRegex(isStrict);
      });
      addRegexToken("dddd", function(isStrict, locale2) {
        return locale2.weekdaysRegex(isStrict);
      });
      addWeekParseToken(["dd", "ddd", "dddd"], function(input2, week, config2, token2) {
        var weekday = config2._locale.weekdaysParse(input2, token2, config2._strict);
        if (weekday != null) {
          week.d = weekday;
        } else {
          getParsingFlags(config2).invalidWeekday = input2;
        }
      });
      addWeekParseToken(["d", "e", "E"], function(input2, week, config2, token2) {
        week[token2] = toInt(input2);
      });
      function parseWeekday(input2, locale2) {
        if (typeof input2 !== "string") {
          return input2;
        }
        if (!isNaN(input2)) {
          return parseInt(input2, 10);
        }
        input2 = locale2.weekdaysParse(input2);
        if (typeof input2 === "number") {
          return input2;
        }
        return null;
      }
      function parseIsoWeekday(input2, locale2) {
        if (typeof input2 === "string") {
          return locale2.weekdaysParse(input2) % 7 || 7;
        }
        return isNaN(input2) ? null : input2;
      }
      function shiftWeekdays(ws, n) {
        return ws.slice(n, 7).concat(ws.slice(0, n));
      }
      var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
      function localeWeekdays(m, format2) {
        var weekdays = isArray4(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
        return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
      }
      function localeWeekdaysShort(m) {
        return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
      }
      function localeWeekdaysMin(m) {
        return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
      }
      function handleStrictParse$1(weekdayName, format2, strict) {
        var i2, ii, mom, llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._minWeekdaysParse = [];
          for (i2 = 0; i2 < 7; ++i2) {
            mom = createUTC([2e3, 1]).day(i2);
            this._minWeekdaysParse[i2] = this.weekdaysMin(
              mom,
              ""
            ).toLocaleLowerCase();
            this._shortWeekdaysParse[i2] = this.weekdaysShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._weekdaysParse[i2] = this.weekdays(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format2 === "dddd") {
            ii = indexOf2.call(this._weekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format2 === "ddd") {
            ii = indexOf2.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf2.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format2 === "dddd") {
            ii = indexOf2.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format2 === "ddd") {
            ii = indexOf2.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf2.call(this._minWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf2.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeWeekdaysParse(weekdayName, format2, strict) {
        var i2, mom, regex;
        if (this._weekdaysParseExact) {
          return handleStrictParse$1.call(this, weekdayName, format2, strict);
        }
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._minWeekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._fullWeekdaysParse = [];
        }
        for (i2 = 0; i2 < 7; i2++) {
          mom = createUTC([2e3, 1]).day(i2);
          if (strict && !this._fullWeekdaysParse[i2]) {
            this._fullWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._shortWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._minWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
          }
          if (!this._weekdaysParse[i2]) {
            regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
            this._weekdaysParse[i2] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format2 === "dddd" && this._fullWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (strict && format2 === "dd" && this._minWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (!strict && this._weekdaysParse[i2].test(weekdayName)) {
            return i2;
          }
        }
      }
      function getSetDayOfWeek(input2) {
        if (!this.isValid()) {
          return input2 != null ? this : NaN;
        }
        var day = get8(this, "Day");
        if (input2 != null) {
          input2 = parseWeekday(input2, this.localeData());
          return this.add(input2 - day, "d");
        } else {
          return day;
        }
      }
      function getSetLocaleDayOfWeek(input2) {
        if (!this.isValid()) {
          return input2 != null ? this : NaN;
        }
        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
        return input2 == null ? weekday : this.add(input2 - weekday, "d");
      }
      function getSetISODayOfWeek(input2) {
        if (!this.isValid()) {
          return input2 != null ? this : NaN;
        }
        if (input2 != null) {
          var weekday = parseIsoWeekday(input2, this.localeData());
          return this.day(this.day() % 7 ? weekday : weekday - 7);
        } else {
          return this.day() || 7;
        }
      }
      function weekdaysRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysStrictRegex;
          } else {
            return this._weekdaysRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            this._weekdaysRegex = defaultWeekdaysRegex;
          }
          return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
        }
      }
      function weekdaysShortRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysShortStrictRegex;
          } else {
            return this._weekdaysShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysShortRegex")) {
            this._weekdaysShortRegex = defaultWeekdaysShortRegex;
          }
          return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
        }
      }
      function weekdaysMinRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysMinStrictRegex;
          } else {
            return this._weekdaysMinRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysMinRegex")) {
            this._weekdaysMinRegex = defaultWeekdaysMinRegex;
          }
          return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
        }
      }
      function computeWeekdaysParse() {
        function cmpLenRev(a, b) {
          return b.length - a.length;
        }
        var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i2, mom, minp, shortp, longp;
        for (i2 = 0; i2 < 7; i2++) {
          mom = createUTC([2e3, 1]).day(i2);
          minp = regexEscape(this.weekdaysMin(mom, ""));
          shortp = regexEscape(this.weekdaysShort(mom, ""));
          longp = regexEscape(this.weekdays(mom, ""));
          minPieces.push(minp);
          shortPieces.push(shortp);
          longPieces.push(longp);
          mixedPieces.push(minp);
          mixedPieces.push(shortp);
          mixedPieces.push(longp);
        }
        minPieces.sort(cmpLenRev);
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._weekdaysShortRegex = this._weekdaysRegex;
        this._weekdaysMinRegex = this._weekdaysRegex;
        this._weekdaysStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._weekdaysShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
        this._weekdaysMinStrictRegex = new RegExp(
          "^(" + minPieces.join("|") + ")",
          "i"
        );
      }
      function hFormat() {
        return this.hours() % 12 || 12;
      }
      function kFormat() {
        return this.hours() || 24;
      }
      addFormatToken("H", ["HH", 2], 0, "hour");
      addFormatToken("h", ["hh", 2], 0, hFormat);
      addFormatToken("k", ["kk", 2], 0, kFormat);
      addFormatToken("hmm", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
      });
      addFormatToken("hmmss", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      addFormatToken("Hmm", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2);
      });
      addFormatToken("Hmmss", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      function meridiem(token2, lowercase) {
        addFormatToken(token2, 0, 0, function() {
          return this.localeData().meridiem(
            this.hours(),
            this.minutes(),
            lowercase
          );
        });
      }
      meridiem("a", true);
      meridiem("A", false);
      function matchMeridiem(isStrict, locale2) {
        return locale2._meridiemParse;
      }
      addRegexToken("a", matchMeridiem);
      addRegexToken("A", matchMeridiem);
      addRegexToken("H", match1to2, match1to2HasZero);
      addRegexToken("h", match1to2, match1to2NoLeadingZero);
      addRegexToken("k", match1to2, match1to2NoLeadingZero);
      addRegexToken("HH", match1to2, match2);
      addRegexToken("hh", match1to2, match2);
      addRegexToken("kk", match1to2, match2);
      addRegexToken("hmm", match3to4);
      addRegexToken("hmmss", match5to6);
      addRegexToken("Hmm", match3to4);
      addRegexToken("Hmmss", match5to6);
      addParseToken(["H", "HH"], HOUR);
      addParseToken(["k", "kk"], function(input2, array2, config2) {
        var kInput = toInt(input2);
        array2[HOUR] = kInput === 24 ? 0 : kInput;
      });
      addParseToken(["a", "A"], function(input2, array2, config2) {
        config2._isPm = config2._locale.isPM(input2);
        config2._meridiem = input2;
      });
      addParseToken(["h", "hh"], function(input2, array2, config2) {
        array2[HOUR] = toInt(input2);
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("hmm", function(input2, array2, config2) {
        var pos = input2.length - 2;
        array2[HOUR] = toInt(input2.substr(0, pos));
        array2[MINUTE] = toInt(input2.substr(pos));
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("hmmss", function(input2, array2, config2) {
        var pos1 = input2.length - 4, pos2 = input2.length - 2;
        array2[HOUR] = toInt(input2.substr(0, pos1));
        array2[MINUTE] = toInt(input2.substr(pos1, 2));
        array2[SECOND] = toInt(input2.substr(pos2));
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("Hmm", function(input2, array2, config2) {
        var pos = input2.length - 2;
        array2[HOUR] = toInt(input2.substr(0, pos));
        array2[MINUTE] = toInt(input2.substr(pos));
      });
      addParseToken("Hmmss", function(input2, array2, config2) {
        var pos1 = input2.length - 4, pos2 = input2.length - 2;
        array2[HOUR] = toInt(input2.substr(0, pos1));
        array2[MINUTE] = toInt(input2.substr(pos1, 2));
        array2[SECOND] = toInt(input2.substr(pos2));
      });
      function localeIsPM(input2) {
        return (input2 + "").toLowerCase().charAt(0) === "p";
      }
      var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
      function localeMeridiem(hours2, minutes2, isLower) {
        if (hours2 > 11) {
          return isLower ? "pm" : "PM";
        } else {
          return isLower ? "am" : "AM";
        }
      }
      var baseConfig = {
        calendar: defaultCalendar,
        longDateFormat: defaultLongDateFormat,
        invalidDate: defaultInvalidDate,
        ordinal: defaultOrdinal,
        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
        relativeTime: defaultRelativeTime,
        months: defaultLocaleMonths,
        monthsShort: defaultLocaleMonthsShort,
        week: defaultLocaleWeek,
        weekdays: defaultLocaleWeekdays,
        weekdaysMin: defaultLocaleWeekdaysMin,
        weekdaysShort: defaultLocaleWeekdaysShort,
        meridiemParse: defaultLocaleMeridiemParse
      };
      var locales = {}, localeFamilies = {}, globalLocale;
      function commonPrefix(arr1, arr2) {
        var i2, minl = Math.min(arr1.length, arr2.length);
        for (i2 = 0; i2 < minl; i2 += 1) {
          if (arr1[i2] !== arr2[i2]) {
            return i2;
          }
        }
        return minl;
      }
      function normalizeLocale2(key) {
        return key ? key.toLowerCase().replace("_", "-") : key;
      }
      function chooseLocale(names32) {
        var i2 = 0, j, next, locale2, split;
        while (i2 < names32.length) {
          split = normalizeLocale2(names32[i2]).split("-");
          j = split.length;
          next = normalizeLocale2(names32[i2 + 1]);
          next = next ? next.split("-") : null;
          while (j > 0) {
            locale2 = loadLocale(split.slice(0, j).join("-"));
            if (locale2) {
              return locale2;
            }
            if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
              break;
            }
            j--;
          }
          i2++;
        }
        return globalLocale;
      }
      function isLocaleNameSane(name) {
        return !!(name && name.match("^[^/\\\\]*$"));
      }
      function loadLocale(name) {
        var oldLocale = null, aliasedRequire;
        if (locales[name] === void 0 && typeof module2 !== "undefined" && module2 && module2.exports && isLocaleNameSane(name)) {
          try {
            oldLocale = globalLocale._abbr;
            aliasedRequire = __require;
            aliasedRequire("./locale/" + name);
            getSetGlobalLocale(oldLocale);
          } catch (e) {
            locales[name] = null;
          }
        }
        return locales[name];
      }
      function getSetGlobalLocale(key, values) {
        var data;
        if (key) {
          if (isUndefined(values)) {
            data = getLocale(key);
          } else {
            data = defineLocale(key, values);
          }
          if (data) {
            globalLocale = data;
          } else {
            if (typeof console !== "undefined" && console.warn) {
              console.warn(
                "Locale " + key + " not found. Did you forget to load it?"
              );
            }
          }
        }
        return globalLocale._abbr;
      }
      function defineLocale(name, config2) {
        if (config2 !== null) {
          var locale2, parentConfig = baseConfig;
          config2.abbr = name;
          if (locales[name] != null) {
            deprecateSimple(
              "defineLocaleOverride",
              "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
            );
            parentConfig = locales[name]._config;
          } else if (config2.parentLocale != null) {
            if (locales[config2.parentLocale] != null) {
              parentConfig = locales[config2.parentLocale]._config;
            } else {
              locale2 = loadLocale(config2.parentLocale);
              if (locale2 != null) {
                parentConfig = locale2._config;
              } else {
                if (!localeFamilies[config2.parentLocale]) {
                  localeFamilies[config2.parentLocale] = [];
                }
                localeFamilies[config2.parentLocale].push({
                  name,
                  config: config2
                });
                return null;
              }
            }
          }
          locales[name] = new Locale(mergeConfigs(parentConfig, config2));
          if (localeFamilies[name]) {
            localeFamilies[name].forEach(function(x) {
              defineLocale(x.name, x.config);
            });
          }
          getSetGlobalLocale(name);
          return locales[name];
        } else {
          delete locales[name];
          return null;
        }
      }
      function updateLocale(name, config2) {
        if (config2 != null) {
          var locale2, tmpLocale, parentConfig = baseConfig;
          if (locales[name] != null && locales[name].parentLocale != null) {
            locales[name].set(mergeConfigs(locales[name]._config, config2));
          } else {
            tmpLocale = loadLocale(name);
            if (tmpLocale != null) {
              parentConfig = tmpLocale._config;
            }
            config2 = mergeConfigs(parentConfig, config2);
            if (tmpLocale == null) {
              config2.abbr = name;
            }
            locale2 = new Locale(config2);
            locale2.parentLocale = locales[name];
            locales[name] = locale2;
          }
          getSetGlobalLocale(name);
        } else {
          if (locales[name] != null) {
            if (locales[name].parentLocale != null) {
              locales[name] = locales[name].parentLocale;
              if (name === getSetGlobalLocale()) {
                getSetGlobalLocale(name);
              }
            } else if (locales[name] != null) {
              delete locales[name];
            }
          }
        }
        return locales[name];
      }
      function getLocale(key) {
        var locale2;
        if (key && key._locale && key._locale._abbr) {
          key = key._locale._abbr;
        }
        if (!key) {
          return globalLocale;
        }
        if (!isArray4(key)) {
          locale2 = loadLocale(key);
          if (locale2) {
            return locale2;
          }
          key = [key];
        }
        return chooseLocale(key);
      }
      function listLocales() {
        return keys(locales);
      }
      function checkOverflow(m) {
        var overflow, a = m._a;
        if (a && getParsingFlags(m).overflow === -2) {
          overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
          if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
            overflow = DATE;
          }
          if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
            overflow = WEEK;
          }
          if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
            overflow = WEEKDAY;
          }
          getParsingFlags(m).overflow = overflow;
        }
        return m;
      }
      var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
        ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
        ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
        ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
        ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
        ["YYYY-DDD", /\d{4}-\d{3}/],
        ["YYYY-MM", /\d{4}-\d\d/, false],
        ["YYYYYYMMDD", /[+-]\d{10}/],
        ["YYYYMMDD", /\d{8}/],
        ["GGGG[W]WWE", /\d{4}W\d{3}/],
        ["GGGG[W]WW", /\d{4}W\d{2}/, false],
        ["YYYYDDD", /\d{7}/],
        ["YYYYMM", /\d{6}/, false],
        ["YYYY", /\d{4}/, false]
      ], isoTimes = [
        ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
        ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
        ["HH:mm:ss", /\d\d:\d\d:\d\d/],
        ["HH:mm", /\d\d:\d\d/],
        ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
        ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
        ["HHmmss", /\d\d\d\d\d\d/],
        ["HHmm", /\d\d\d\d/],
        ["HH", /\d\d/]
      ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
        UT: 0,
        GMT: 0,
        EDT: -4 * 60,
        EST: -5 * 60,
        CDT: -5 * 60,
        CST: -6 * 60,
        MDT: -6 * 60,
        MST: -7 * 60,
        PDT: -7 * 60,
        PST: -8 * 60
      };
      function configFromISO(config2) {
        var i2, l, string = config2._i, match5 = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
        if (match5) {
          getParsingFlags(config2).iso = true;
          for (i2 = 0, l = isoDatesLen; i2 < l; i2++) {
            if (isoDates[i2][1].exec(match5[1])) {
              dateFormat = isoDates[i2][0];
              allowTime = isoDates[i2][2] !== false;
              break;
            }
          }
          if (dateFormat == null) {
            config2._isValid = false;
            return;
          }
          if (match5[3]) {
            for (i2 = 0, l = isoTimesLen; i2 < l; i2++) {
              if (isoTimes[i2][1].exec(match5[3])) {
                timeFormat = (match5[2] || " ") + isoTimes[i2][0];
                break;
              }
            }
            if (timeFormat == null) {
              config2._isValid = false;
              return;
            }
          }
          if (!allowTime && timeFormat != null) {
            config2._isValid = false;
            return;
          }
          if (match5[4]) {
            if (tzRegex.exec(match5[4])) {
              tzFormat = "Z";
            } else {
              config2._isValid = false;
              return;
            }
          }
          config2._f = dateFormat + (timeFormat || "") + (tzFormat || "");
          configFromStringAndFormat(config2);
        } else {
          config2._isValid = false;
        }
      }
      function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
        var result = [
          untruncateYear(yearStr),
          defaultLocaleMonthsShort.indexOf(monthStr),
          parseInt(dayStr, 10),
          parseInt(hourStr, 10),
          parseInt(minuteStr, 10)
        ];
        if (secondStr) {
          result.push(parseInt(secondStr, 10));
        }
        return result;
      }
      function untruncateYear(yearStr) {
        var year = parseInt(yearStr, 10);
        if (year <= 49) {
          return 2e3 + year;
        } else if (year <= 999) {
          return 1900 + year;
        }
        return year;
      }
      function preprocessRFC2822(s) {
        return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
      }
      function checkWeekday(weekdayStr, parsedInput, config2) {
        if (weekdayStr) {
          var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
            parsedInput[0],
            parsedInput[1],
            parsedInput[2]
          ).getDay();
          if (weekdayProvided !== weekdayActual) {
            getParsingFlags(config2).weekdayMismatch = true;
            config2._isValid = false;
            return false;
          }
        }
        return true;
      }
      function calculateOffset(obsOffset, militaryOffset, numOffset) {
        if (obsOffset) {
          return obsOffsets[obsOffset];
        } else if (militaryOffset) {
          return 0;
        } else {
          var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100;
          return h * 60 + m;
        }
      }
      function configFromRFC2822(config2) {
        var match5 = rfc2822.exec(preprocessRFC2822(config2._i)), parsedArray;
        if (match5) {
          parsedArray = extractFromRFC2822Strings(
            match5[4],
            match5[3],
            match5[2],
            match5[5],
            match5[6],
            match5[7]
          );
          if (!checkWeekday(match5[1], parsedArray, config2)) {
            return;
          }
          config2._a = parsedArray;
          config2._tzm = calculateOffset(match5[8], match5[9], match5[10]);
          config2._d = createUTCDate.apply(null, config2._a);
          config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm);
          getParsingFlags(config2).rfc2822 = true;
        } else {
          config2._isValid = false;
        }
      }
      function configFromString(config2) {
        var matched = aspNetJsonRegex.exec(config2._i);
        if (matched !== null) {
          config2._d = /* @__PURE__ */ new Date(+matched[1]);
          return;
        }
        configFromISO(config2);
        if (config2._isValid === false) {
          delete config2._isValid;
        } else {
          return;
        }
        configFromRFC2822(config2);
        if (config2._isValid === false) {
          delete config2._isValid;
        } else {
          return;
        }
        if (config2._strict) {
          config2._isValid = false;
        } else {
          hooks.createFromInputFallback(config2);
        }
      }
      hooks.createFromInputFallback = deprecate(
        "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
        function(config2) {
          config2._d = /* @__PURE__ */ new Date(config2._i + (config2._useUTC ? " UTC" : ""));
        }
      );
      function defaults4(a, b, c) {
        if (a != null) {
          return a;
        }
        if (b != null) {
          return b;
        }
        return c;
      }
      function currentDateArray(config2) {
        var nowValue = new Date(hooks.now());
        if (config2._useUTC) {
          return [
            nowValue.getUTCFullYear(),
            nowValue.getUTCMonth(),
            nowValue.getUTCDate()
          ];
        }
        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
      }
      function configFromArray(config2) {
        var i2, date, input2 = [], currentDate, expectedWeekday, yearToUse;
        if (config2._d) {
          return;
        }
        currentDate = currentDateArray(config2);
        if (config2._w && config2._a[DATE] == null && config2._a[MONTH] == null) {
          dayOfYearFromWeekInfo(config2);
        }
        if (config2._dayOfYear != null) {
          yearToUse = defaults4(config2._a[YEAR], currentDate[YEAR]);
          if (config2._dayOfYear > daysInYear(yearToUse) || config2._dayOfYear === 0) {
            getParsingFlags(config2)._overflowDayOfYear = true;
          }
          date = createUTCDate(yearToUse, 0, config2._dayOfYear);
          config2._a[MONTH] = date.getUTCMonth();
          config2._a[DATE] = date.getUTCDate();
        }
        for (i2 = 0; i2 < 3 && config2._a[i2] == null; ++i2) {
          config2._a[i2] = input2[i2] = currentDate[i2];
        }
        for (; i2 < 7; i2++) {
          config2._a[i2] = input2[i2] = config2._a[i2] == null ? i2 === 2 ? 1 : 0 : config2._a[i2];
        }
        if (config2._a[HOUR] === 24 && config2._a[MINUTE] === 0 && config2._a[SECOND] === 0 && config2._a[MILLISECOND] === 0) {
          config2._nextDay = true;
          config2._a[HOUR] = 0;
        }
        config2._d = (config2._useUTC ? createUTCDate : createDate2).apply(
          null,
          input2
        );
        expectedWeekday = config2._useUTC ? config2._d.getUTCDay() : config2._d.getDay();
        if (config2._tzm != null) {
          config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm);
        }
        if (config2._nextDay) {
          config2._a[HOUR] = 24;
        }
        if (config2._w && typeof config2._w.d !== "undefined" && config2._w.d !== expectedWeekday) {
          getParsingFlags(config2).weekdayMismatch = true;
        }
      }
      function dayOfYearFromWeekInfo(config2) {
        var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
        w = config2._w;
        if (w.GG != null || w.W != null || w.E != null) {
          dow = 1;
          doy = 4;
          weekYear = defaults4(
            w.GG,
            config2._a[YEAR],
            weekOfYear(createLocal(), 1, 4).year
          );
          week = defaults4(w.W, 1);
          weekday = defaults4(w.E, 1);
          if (weekday < 1 || weekday > 7) {
            weekdayOverflow = true;
          }
        } else {
          dow = config2._locale._week.dow;
          doy = config2._locale._week.doy;
          curWeek = weekOfYear(createLocal(), dow, doy);
          weekYear = defaults4(w.gg, config2._a[YEAR], curWeek.year);
          week = defaults4(w.w, curWeek.week);
          if (w.d != null) {
            weekday = w.d;
            if (weekday < 0 || weekday > 6) {
              weekdayOverflow = true;
            }
          } else if (w.e != null) {
            weekday = w.e + dow;
            if (w.e < 0 || w.e > 6) {
              weekdayOverflow = true;
            }
          } else {
            weekday = dow;
          }
        }
        if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
          getParsingFlags(config2)._overflowWeeks = true;
        } else if (weekdayOverflow != null) {
          getParsingFlags(config2)._overflowWeekday = true;
        } else {
          temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
          config2._a[YEAR] = temp.year;
          config2._dayOfYear = temp.dayOfYear;
        }
      }
      hooks.ISO_8601 = function() {
      };
      hooks.RFC_2822 = function() {
      };
      function configFromStringAndFormat(config2) {
        if (config2._f === hooks.ISO_8601) {
          configFromISO(config2);
          return;
        }
        if (config2._f === hooks.RFC_2822) {
          configFromRFC2822(config2);
          return;
        }
        config2._a = [];
        getParsingFlags(config2).empty = true;
        var string = "" + config2._i, i2, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
        tokens2 = expandFormat(config2._f, config2._locale).match(formattingTokens) || [];
        tokenLen = tokens2.length;
        for (i2 = 0; i2 < tokenLen; i2++) {
          token2 = tokens2[i2];
          parsedInput = (string.match(getParseRegexForToken(token2, config2)) || [])[0];
          if (parsedInput) {
            skipped = string.substr(0, string.indexOf(parsedInput));
            if (skipped.length > 0) {
              getParsingFlags(config2).unusedInput.push(skipped);
            }
            string = string.slice(
              string.indexOf(parsedInput) + parsedInput.length
            );
            totalParsedInputLength += parsedInput.length;
          }
          if (formatTokenFunctions[token2]) {
            if (parsedInput) {
              getParsingFlags(config2).empty = false;
            } else {
              getParsingFlags(config2).unusedTokens.push(token2);
            }
            addTimeToArrayFromToken(token2, parsedInput, config2);
          } else if (config2._strict && !parsedInput) {
            getParsingFlags(config2).unusedTokens.push(token2);
          }
        }
        getParsingFlags(config2).charsLeftOver = stringLength - totalParsedInputLength;
        if (string.length > 0) {
          getParsingFlags(config2).unusedInput.push(string);
        }
        if (config2._a[HOUR] <= 12 && getParsingFlags(config2).bigHour === true && config2._a[HOUR] > 0) {
          getParsingFlags(config2).bigHour = void 0;
        }
        getParsingFlags(config2).parsedDateParts = config2._a.slice(0);
        getParsingFlags(config2).meridiem = config2._meridiem;
        config2._a[HOUR] = meridiemFixWrap(
          config2._locale,
          config2._a[HOUR],
          config2._meridiem
        );
        era = getParsingFlags(config2).era;
        if (era !== null) {
          config2._a[YEAR] = config2._locale.erasConvertYear(era, config2._a[YEAR]);
        }
        configFromArray(config2);
        checkOverflow(config2);
      }
      function meridiemFixWrap(locale2, hour, meridiem2) {
        var isPm;
        if (meridiem2 == null) {
          return hour;
        }
        if (locale2.meridiemHour != null) {
          return locale2.meridiemHour(hour, meridiem2);
        } else if (locale2.isPM != null) {
          isPm = locale2.isPM(meridiem2);
          if (isPm && hour < 12) {
            hour += 12;
          }
          if (!isPm && hour === 12) {
            hour = 0;
          }
          return hour;
        } else {
          return hour;
        }
      }
      function configFromStringAndArray(config2) {
        var tempConfig, bestMoment, scoreToBeat, i2, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config2._f.length;
        if (configfLen === 0) {
          getParsingFlags(config2).invalidFormat = true;
          config2._d = /* @__PURE__ */ new Date(NaN);
          return;
        }
        for (i2 = 0; i2 < configfLen; i2++) {
          currentScore = 0;
          validFormatFound = false;
          tempConfig = copyConfig({}, config2);
          if (config2._useUTC != null) {
            tempConfig._useUTC = config2._useUTC;
          }
          tempConfig._f = config2._f[i2];
          configFromStringAndFormat(tempConfig);
          if (isValid(tempConfig)) {
            validFormatFound = true;
          }
          currentScore += getParsingFlags(tempConfig).charsLeftOver;
          currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
          getParsingFlags(tempConfig).score = currentScore;
          if (!bestFormatIsValid) {
            if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
              if (validFormatFound) {
                bestFormatIsValid = true;
              }
            }
          } else {
            if (currentScore < scoreToBeat) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
            }
          }
        }
        extend4(config2, bestMoment || tempConfig);
      }
      function configFromObject(config2) {
        if (config2._d) {
          return;
        }
        var i2 = normalizeObjectUnits(config2._i), dayOrDate = i2.day === void 0 ? i2.date : i2.day;
        config2._a = map2(
          [i2.year, i2.month, dayOrDate, i2.hour, i2.minute, i2.second, i2.millisecond],
          function(obj) {
            return obj && parseInt(obj, 10);
          }
        );
        configFromArray(config2);
      }
      function createFromConfig(config2) {
        var res = new Moment(checkOverflow(prepareConfig(config2)));
        if (res._nextDay) {
          res.add(1, "d");
          res._nextDay = void 0;
        }
        return res;
      }
      function prepareConfig(config2) {
        var input2 = config2._i, format2 = config2._f;
        config2._locale = config2._locale || getLocale(config2._l);
        if (input2 === null || format2 === void 0 && input2 === "") {
          return createInvalid({ nullInput: true });
        }
        if (typeof input2 === "string") {
          config2._i = input2 = config2._locale.preparse(input2);
        }
        if (isMoment(input2)) {
          return new Moment(checkOverflow(input2));
        } else if (isDate2(input2)) {
          config2._d = input2;
        } else if (isArray4(format2)) {
          configFromStringAndArray(config2);
        } else if (format2) {
          configFromStringAndFormat(config2);
        } else {
          configFromInput(config2);
        }
        if (!isValid(config2)) {
          config2._d = null;
        }
        return config2;
      }
      function configFromInput(config2) {
        var input2 = config2._i;
        if (isUndefined(input2)) {
          config2._d = new Date(hooks.now());
        } else if (isDate2(input2)) {
          config2._d = new Date(input2.valueOf());
        } else if (typeof input2 === "string") {
          configFromString(config2);
        } else if (isArray4(input2)) {
          config2._a = map2(input2.slice(0), function(obj) {
            return parseInt(obj, 10);
          });
          configFromArray(config2);
        } else if (isObject2(input2)) {
          configFromObject(config2);
        } else if (isNumber6(input2)) {
          config2._d = new Date(input2);
        } else {
          hooks.createFromInputFallback(config2);
        }
      }
      function createLocalOrUTC(input2, format2, locale2, strict, isUTC) {
        var c = {};
        if (format2 === true || format2 === false) {
          strict = format2;
          format2 = void 0;
        }
        if (locale2 === true || locale2 === false) {
          strict = locale2;
          locale2 = void 0;
        }
        if (isObject2(input2) && isObjectEmpty(input2) || isArray4(input2) && input2.length === 0) {
          input2 = void 0;
        }
        c._isAMomentObject = true;
        c._useUTC = c._isUTC = isUTC;
        c._l = locale2;
        c._i = input2;
        c._f = format2;
        c._strict = strict;
        return createFromConfig(c);
      }
      function createLocal(input2, format2, locale2, strict) {
        return createLocalOrUTC(input2, format2, locale2, strict, false);
      }
      var prototypeMin = deprecate(
        "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other < this ? this : other;
          } else {
            return createInvalid();
          }
        }
      ), prototypeMax = deprecate(
        "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other > this ? this : other;
          } else {
            return createInvalid();
          }
        }
      );
      function pickBy(fn, moments) {
        var res, i2;
        if (moments.length === 1 && isArray4(moments[0])) {
          moments = moments[0];
        }
        if (!moments.length) {
          return createLocal();
        }
        res = moments[0];
        for (i2 = 1; i2 < moments.length; ++i2) {
          if (!moments[i2].isValid() || moments[i2][fn](res)) {
            res = moments[i2];
          }
        }
        return res;
      }
      function min() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isBefore", args);
      }
      function max() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isAfter", args);
      }
      var now = function() {
        return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
      };
      var ordering = [
        "year",
        "quarter",
        "month",
        "week",
        "day",
        "hour",
        "minute",
        "second",
        "millisecond"
      ];
      function isDurationValid(m) {
        var key, unitHasDecimal = false, i2, orderLen = ordering.length;
        for (key in m) {
          if (hasOwnProp(m, key) && !(indexOf2.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
            return false;
          }
        }
        for (i2 = 0; i2 < orderLen; ++i2) {
          if (m[ordering[i2]]) {
            if (unitHasDecimal) {
              return false;
            }
            if (parseFloat(m[ordering[i2]]) !== toInt(m[ordering[i2]])) {
              unitHasDecimal = true;
            }
          }
        }
        return true;
      }
      function isValid$1() {
        return this._isValid;
      }
      function createInvalid$1() {
        return createDuration(NaN);
      }
      function Duration(duration) {
        var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
        this._isValid = isDurationValid(normalizedInput);
        this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
        minutes2 * 6e4 + // 1000 * 60
        hours2 * 1e3 * 60 * 60;
        this._days = +days2 + weeks2 * 7;
        this._months = +months2 + quarters * 3 + years2 * 12;
        this._data = {};
        this._locale = getLocale();
        this._bubble();
      }
      function isDuration(obj) {
        return obj instanceof Duration;
      }
      function absRound(number2) {
        if (number2 < 0) {
          return Math.round(-1 * number2) * -1;
        } else {
          return Math.round(number2);
        }
      }
      function compareArrays(array1, array2, dontConvert) {
        var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i2;
        for (i2 = 0; i2 < len; i2++) {
          if (dontConvert && array1[i2] !== array2[i2] || !dontConvert && toInt(array1[i2]) !== toInt(array2[i2])) {
            diffs++;
          }
        }
        return diffs + lengthDiff;
      }
      function offset2(token2, separator) {
        addFormatToken(token2, 0, 0, function() {
          var offset3 = this.utcOffset(), sign2 = "+";
          if (offset3 < 0) {
            offset3 = -offset3;
            sign2 = "-";
          }
          return sign2 + zeroFill(~~(offset3 / 60), 2) + separator + zeroFill(~~offset3 % 60, 2);
        });
      }
      offset2("Z", ":");
      offset2("ZZ", "");
      addRegexToken("Z", matchShortOffset);
      addRegexToken("ZZ", matchShortOffset);
      addParseToken(["Z", "ZZ"], function(input2, array2, config2) {
        config2._useUTC = true;
        config2._tzm = offsetFromString(matchShortOffset, input2);
      });
      var chunkOffset = /([\+\-]|\d\d)/gi;
      function offsetFromString(matcher, string) {
        var matches = (string || "").match(matcher), chunk2, parts, minutes2;
        if (matches === null) {
          return null;
        }
        chunk2 = matches[matches.length - 1] || [];
        parts = (chunk2 + "").match(chunkOffset) || ["-", 0, 0];
        minutes2 = +(parts[1] * 60) + toInt(parts[2]);
        return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
      }
      function cloneWithOffset(input2, model2) {
        var res, diff2;
        if (model2._isUTC) {
          res = model2.clone();
          diff2 = (isMoment(input2) || isDate2(input2) ? input2.valueOf() : createLocal(input2).valueOf()) - res.valueOf();
          res._d.setTime(res._d.valueOf() + diff2);
          hooks.updateOffset(res, false);
          return res;
        } else {
          return createLocal(input2).local();
        }
      }
      function getDateOffset(m) {
        return -Math.round(m._d.getTimezoneOffset());
      }
      hooks.updateOffset = function() {
      };
      function getSetOffset(input2, keepLocalTime, keepMinutes) {
        var offset3 = this._offset || 0, localAdjust;
        if (!this.isValid()) {
          return input2 != null ? this : NaN;
        }
        if (input2 != null) {
          if (typeof input2 === "string") {
            input2 = offsetFromString(matchShortOffset, input2);
            if (input2 === null) {
              return this;
            }
          } else if (Math.abs(input2) < 16 && !keepMinutes) {
            input2 = input2 * 60;
          }
          if (!this._isUTC && keepLocalTime) {
            localAdjust = getDateOffset(this);
          }
          this._offset = input2;
          this._isUTC = true;
          if (localAdjust != null) {
            this.add(localAdjust, "m");
          }
          if (offset3 !== input2) {
            if (!keepLocalTime || this._changeInProgress) {
              addSubtract(
                this,
                createDuration(input2 - offset3, "m"),
                1,
                false
              );
            } else if (!this._changeInProgress) {
              this._changeInProgress = true;
              hooks.updateOffset(this, true);
              this._changeInProgress = null;
            }
          }
          return this;
        } else {
          return this._isUTC ? offset3 : getDateOffset(this);
        }
      }
      function getSetZone(input2, keepLocalTime) {
        if (input2 != null) {
          if (typeof input2 !== "string") {
            input2 = -input2;
          }
          this.utcOffset(input2, keepLocalTime);
          return this;
        } else {
          return -this.utcOffset();
        }
      }
      function setOffsetToUTC(keepLocalTime) {
        return this.utcOffset(0, keepLocalTime);
      }
      function setOffsetToLocal(keepLocalTime) {
        if (this._isUTC) {
          this.utcOffset(0, keepLocalTime);
          this._isUTC = false;
          if (keepLocalTime) {
            this.subtract(getDateOffset(this), "m");
          }
        }
        return this;
      }
      function setOffsetToParsedOffset() {
        if (this._tzm != null) {
          this.utcOffset(this._tzm, false, true);
        } else if (typeof this._i === "string") {
          var tZone = offsetFromString(matchOffset, this._i);
          if (tZone != null) {
            this.utcOffset(tZone);
          } else {
            this.utcOffset(0, true);
          }
        }
        return this;
      }
      function hasAlignedHourOffset(input2) {
        if (!this.isValid()) {
          return false;
        }
        input2 = input2 ? createLocal(input2).utcOffset() : 0;
        return (this.utcOffset() - input2) % 60 === 0;
      }
      function isDaylightSavingTime() {
        return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
      }
      function isDaylightSavingTimeShifted() {
        if (!isUndefined(this._isDSTShifted)) {
          return this._isDSTShifted;
        }
        var c = {}, other;
        copyConfig(c, this);
        c = prepareConfig(c);
        if (c._a) {
          other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
          this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
        } else {
          this._isDSTShifted = false;
        }
        return this._isDSTShifted;
      }
      function isLocal() {
        return this.isValid() ? !this._isUTC : false;
      }
      function isUtcOffset() {
        return this.isValid() ? this._isUTC : false;
      }
      function isUtc() {
        return this.isValid() ? this._isUTC && this._offset === 0 : false;
      }
      var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
      function createDuration(input2, key) {
        var duration = input2, match5 = null, sign2, ret, diffRes;
        if (isDuration(input2)) {
          duration = {
            ms: input2._milliseconds,
            d: input2._days,
            M: input2._months
          };
        } else if (isNumber6(input2) || !isNaN(+input2)) {
          duration = {};
          if (key) {
            duration[key] = +input2;
          } else {
            duration.milliseconds = +input2;
          }
        } else if (match5 = aspNetRegex.exec(input2)) {
          sign2 = match5[1] === "-" ? -1 : 1;
          duration = {
            y: 0,
            d: toInt(match5[DATE]) * sign2,
            h: toInt(match5[HOUR]) * sign2,
            m: toInt(match5[MINUTE]) * sign2,
            s: toInt(match5[SECOND]) * sign2,
            ms: toInt(absRound(match5[MILLISECOND] * 1e3)) * sign2
            // the millisecond decimal point is included in the match
          };
        } else if (match5 = isoRegex.exec(input2)) {
          sign2 = match5[1] === "-" ? -1 : 1;
          duration = {
            y: parseIso(match5[2], sign2),
            M: parseIso(match5[3], sign2),
            w: parseIso(match5[4], sign2),
            d: parseIso(match5[5], sign2),
            h: parseIso(match5[6], sign2),
            m: parseIso(match5[7], sign2),
            s: parseIso(match5[8], sign2)
          };
        } else if (duration == null) {
          duration = {};
        } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
          diffRes = momentsDifference(
            createLocal(duration.from),
            createLocal(duration.to)
          );
          duration = {};
          duration.ms = diffRes.milliseconds;
          duration.M = diffRes.months;
        }
        ret = new Duration(duration);
        if (isDuration(input2) && hasOwnProp(input2, "_locale")) {
          ret._locale = input2._locale;
        }
        if (isDuration(input2) && hasOwnProp(input2, "_isValid")) {
          ret._isValid = input2._isValid;
        }
        return ret;
      }
      createDuration.fn = Duration.prototype;
      createDuration.invalid = createInvalid$1;
      function parseIso(inp, sign2) {
        var res = inp && parseFloat(inp.replace(",", "."));
        return (isNaN(res) ? 0 : res) * sign2;
      }
      function positiveMomentsDifference(base, other) {
        var res = {};
        res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
        if (base.clone().add(res.months, "M").isAfter(other)) {
          --res.months;
        }
        res.milliseconds = +other - +base.clone().add(res.months, "M");
        return res;
      }
      function momentsDifference(base, other) {
        var res;
        if (!(base.isValid() && other.isValid())) {
          return { milliseconds: 0, months: 0 };
        }
        other = cloneWithOffset(other, base);
        if (base.isBefore(other)) {
          res = positiveMomentsDifference(base, other);
        } else {
          res = positiveMomentsDifference(other, base);
          res.milliseconds = -res.milliseconds;
          res.months = -res.months;
        }
        return res;
      }
      function createAdder(direction, name) {
        return function(val, period) {
          var dur, tmp;
          if (period !== null && !isNaN(+period)) {
            deprecateSimple(
              name,
              "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
            );
            tmp = val;
            val = period;
            period = tmp;
          }
          dur = createDuration(val, period);
          addSubtract(this, dur, direction);
          return this;
        };
      }
      function addSubtract(mom, duration, isAdding, updateOffset) {
        var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
        if (!mom.isValid()) {
          return;
        }
        updateOffset = updateOffset == null ? true : updateOffset;
        if (months2) {
          setMonth(mom, get8(mom, "Month") + months2 * isAdding);
        }
        if (days2) {
          set$1(mom, "Date", get8(mom, "Date") + days2 * isAdding);
        }
        if (milliseconds2) {
          mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
        }
        if (updateOffset) {
          hooks.updateOffset(mom, days2 || months2);
        }
      }
      var add5 = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
      function isString2(input2) {
        return typeof input2 === "string" || input2 instanceof String;
      }
      function isMomentInput(input2) {
        return isMoment(input2) || isDate2(input2) || isString2(input2) || isNumber6(input2) || isNumberOrStringArray(input2) || isMomentInputObject(input2) || input2 === null || input2 === void 0;
      }
      function isMomentInputObject(input2) {
        var objectTest = isObject2(input2) && !isObjectEmpty(input2), propertyTest = false, properties2 = [
          "years",
          "year",
          "y",
          "months",
          "month",
          "M",
          "days",
          "day",
          "d",
          "dates",
          "date",
          "D",
          "hours",
          "hour",
          "h",
          "minutes",
          "minute",
          "m",
          "seconds",
          "second",
          "s",
          "milliseconds",
          "millisecond",
          "ms"
        ], i2, property, propertyLen = properties2.length;
        for (i2 = 0; i2 < propertyLen; i2 += 1) {
          property = properties2[i2];
          propertyTest = propertyTest || hasOwnProp(input2, property);
        }
        return objectTest && propertyTest;
      }
      function isNumberOrStringArray(input2) {
        var arrayTest = isArray4(input2), dataTypeTest = false;
        if (arrayTest) {
          dataTypeTest = input2.filter(function(item) {
            return !isNumber6(item) && isString2(input2);
          }).length === 0;
        }
        return arrayTest && dataTypeTest;
      }
      function isCalendarSpec(input2) {
        var objectTest = isObject2(input2) && !isObjectEmpty(input2), propertyTest = false, properties2 = [
          "sameDay",
          "nextDay",
          "lastDay",
          "nextWeek",
          "lastWeek",
          "sameElse"
        ], i2, property;
        for (i2 = 0; i2 < properties2.length; i2 += 1) {
          property = properties2[i2];
          propertyTest = propertyTest || hasOwnProp(input2, property);
        }
        return objectTest && propertyTest;
      }
      function getCalendarFormat(myMoment, now2) {
        var diff2 = myMoment.diff(now2, "days", true);
        return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
      }
      function calendar$1(time, formats) {
        if (arguments.length === 1) {
          if (!arguments[0]) {
            time = void 0;
            formats = void 0;
          } else if (isMomentInput(arguments[0])) {
            time = arguments[0];
            formats = void 0;
          } else if (isCalendarSpec(arguments[0])) {
            formats = arguments[0];
            time = void 0;
          }
        }
        var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction5(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
        return this.format(
          output || this.localeData().calendar(format2, this, createLocal(now2))
        );
      }
      function clone2() {
        return new Moment(this);
      }
      function isAfter(input2, units) {
        var localInput = isMoment(input2) ? input2 : createLocal(input2);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() > localInput.valueOf();
        } else {
          return localInput.valueOf() < this.clone().startOf(units).valueOf();
        }
      }
      function isBefore(input2, units) {
        var localInput = isMoment(input2) ? input2 : createLocal(input2);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() < localInput.valueOf();
        } else {
          return this.clone().endOf(units).valueOf() < localInput.valueOf();
        }
      }
      function isBetween(from3, to2, units, inclusivity) {
        var localFrom = isMoment(from3) ? from3 : createLocal(from3), localTo = isMoment(to2) ? to2 : createLocal(to2);
        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
          return false;
        }
        inclusivity = inclusivity || "()";
        return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
      }
      function isSame(input2, units) {
        var localInput = isMoment(input2) ? input2 : createLocal(input2), inputMs;
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() === localInput.valueOf();
        } else {
          inputMs = localInput.valueOf();
          return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
        }
      }
      function isSameOrAfter(input2, units) {
        return this.isSame(input2, units) || this.isAfter(input2, units);
      }
      function isSameOrBefore(input2, units) {
        return this.isSame(input2, units) || this.isBefore(input2, units);
      }
      function diff(input2, units, asFloat) {
        var that, zoneDelta, output;
        if (!this.isValid()) {
          return NaN;
        }
        that = cloneWithOffset(input2, this);
        if (!that.isValid()) {
          return NaN;
        }
        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
        units = normalizeUnits(units);
        switch (units) {
          case "year":
            output = monthDiff(this, that) / 12;
            break;
          case "month":
            output = monthDiff(this, that);
            break;
          case "quarter":
            output = monthDiff(this, that) / 3;
            break;
          case "second":
            output = (this - that) / 1e3;
            break;
          case "minute":
            output = (this - that) / 6e4;
            break;
          case "hour":
            output = (this - that) / 36e5;
            break;
          case "day":
            output = (this - that - zoneDelta) / 864e5;
            break;
          case "week":
            output = (this - that - zoneDelta) / 6048e5;
            break;
          default:
            output = this - that;
        }
        return asFloat ? output : absFloor(output);
      }
      function monthDiff(a, b) {
        if (a.date() < b.date()) {
          return -monthDiff(b, a);
        }
        var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor2 = a.clone().add(wholeMonthDiff, "months"), anchor22, adjust;
        if (b - anchor2 < 0) {
          anchor22 = a.clone().add(wholeMonthDiff - 1, "months");
          adjust = (b - anchor2) / (anchor2 - anchor22);
        } else {
          anchor22 = a.clone().add(wholeMonthDiff + 1, "months");
          adjust = (b - anchor2) / (anchor22 - anchor2);
        }
        return -(wholeMonthDiff + adjust) || 0;
      }
      hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
      hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
      function toString7() {
        return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
      }
      function toISOString(keepOffset) {
        if (!this.isValid()) {
          return null;
        }
        var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
        if (m.year() < 0 || m.year() > 9999) {
          return formatMoment(
            m,
            utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
          );
        }
        if (isFunction5(Date.prototype.toISOString)) {
          if (utc) {
            return this.toDate().toISOString();
          } else {
            return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
          }
        }
        return formatMoment(
          m,
          utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
        );
      }
      function inspect() {
        if (!this.isValid()) {
          return "moment.invalid(/* " + this._i + " */)";
        }
        var func = "moment", zone = "", prefix, year, datetime, suffix;
        if (!this.isLocal()) {
          func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
          zone = "Z";
        }
        prefix = "[" + func + '("]';
        year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
        datetime = "-MM-DD[T]HH:mm:ss.SSS";
        suffix = zone + '[")]';
        return this.format(prefix + year + datetime + suffix);
      }
      function format(inputString) {
        if (!inputString) {
          inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
        }
        var output = formatMoment(this, inputString);
        return this.localeData().postformat(output);
      }
      function from2(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function fromNow(withoutSuffix) {
        return this.from(createLocal(), withoutSuffix);
      }
      function to(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function toNow(withoutSuffix) {
        return this.to(createLocal(), withoutSuffix);
      }
      function locale(key) {
        var newLocaleData;
        if (key === void 0) {
          return this._locale._abbr;
        } else {
          newLocaleData = getLocale(key);
          if (newLocaleData != null) {
            this._locale = newLocaleData;
          }
          return this;
        }
      }
      var lang = deprecate(
        "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
        function(key) {
          if (key === void 0) {
            return this.localeData();
          } else {
            return this.locale(key);
          }
        }
      );
      function localeData() {
        return this._locale;
      }
      var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
      function mod$1(dividend, divisor) {
        return (dividend % divisor + divisor) % divisor;
      }
      function localStartOfDate(y, m, d) {
        if (y < 100 && y >= 0) {
          return new Date(y + 400, m, d) - MS_PER_400_YEARS;
        } else {
          return new Date(y, m, d).valueOf();
        }
      }
      function utcStartOfDate(y, m, d) {
        if (y < 100 && y >= 0) {
          return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
        } else {
          return Date.UTC(y, m, d);
        }
      }
      function startOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year(), 0, 1);
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3,
              1
            );
            break;
          case "month":
            time = startOfDate(this.year(), this.month(), 1);
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday()
            );
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1)
            );
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date());
            break;
          case "hour":
            time = this._d.valueOf();
            time -= mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            );
            break;
          case "minute":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_MINUTE);
            break;
          case "second":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_SECOND);
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function endOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year() + 1, 0, 1) - 1;
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3 + 3,
              1
            ) - 1;
            break;
          case "month":
            time = startOfDate(this.year(), this.month() + 1, 1) - 1;
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday() + 7
            ) - 1;
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1) + 7
            ) - 1;
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
            break;
          case "hour":
            time = this._d.valueOf();
            time += MS_PER_HOUR - mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            ) - 1;
            break;
          case "minute":
            time = this._d.valueOf();
            time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
            break;
          case "second":
            time = this._d.valueOf();
            time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function valueOf() {
        return this._d.valueOf() - (this._offset || 0) * 6e4;
      }
      function unix() {
        return Math.floor(this.valueOf() / 1e3);
      }
      function toDate2() {
        return new Date(this.valueOf());
      }
      function toArray2() {
        var m = this;
        return [
          m.year(),
          m.month(),
          m.date(),
          m.hour(),
          m.minute(),
          m.second(),
          m.millisecond()
        ];
      }
      function toObject() {
        var m = this;
        return {
          years: m.year(),
          months: m.month(),
          date: m.date(),
          hours: m.hours(),
          minutes: m.minutes(),
          seconds: m.seconds(),
          milliseconds: m.milliseconds()
        };
      }
      function toJSON2() {
        return this.isValid() ? this.toISOString() : null;
      }
      function isValid$2() {
        return isValid(this);
      }
      function parsingFlags() {
        return extend4({}, getParsingFlags(this));
      }
      function invalidAt() {
        return getParsingFlags(this).overflow;
      }
      function creationData() {
        return {
          input: this._i,
          format: this._f,
          locale: this._locale,
          isUTC: this._isUTC,
          strict: this._strict
        };
      }
      addFormatToken("N", 0, 0, "eraAbbr");
      addFormatToken("NN", 0, 0, "eraAbbr");
      addFormatToken("NNN", 0, 0, "eraAbbr");
      addFormatToken("NNNN", 0, 0, "eraName");
      addFormatToken("NNNNN", 0, 0, "eraNarrow");
      addFormatToken("y", ["y", 1], "yo", "eraYear");
      addFormatToken("y", ["yy", 2], 0, "eraYear");
      addFormatToken("y", ["yyy", 3], 0, "eraYear");
      addFormatToken("y", ["yyyy", 4], 0, "eraYear");
      addRegexToken("N", matchEraAbbr);
      addRegexToken("NN", matchEraAbbr);
      addRegexToken("NNN", matchEraAbbr);
      addRegexToken("NNNN", matchEraName);
      addRegexToken("NNNNN", matchEraNarrow);
      addParseToken(
        ["N", "NN", "NNN", "NNNN", "NNNNN"],
        function(input2, array2, config2, token2) {
          var era = config2._locale.erasParse(input2, token2, config2._strict);
          if (era) {
            getParsingFlags(config2).era = era;
          } else {
            getParsingFlags(config2).invalidEra = input2;
          }
        }
      );
      addRegexToken("y", matchUnsigned);
      addRegexToken("yy", matchUnsigned);
      addRegexToken("yyy", matchUnsigned);
      addRegexToken("yyyy", matchUnsigned);
      addRegexToken("yo", matchEraYearOrdinal);
      addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
      addParseToken(["yo"], function(input2, array2, config2, token2) {
        var match5;
        if (config2._locale._eraYearOrdinalRegex) {
          match5 = input2.match(config2._locale._eraYearOrdinalRegex);
        }
        if (config2._locale.eraYearOrdinalParse) {
          array2[YEAR] = config2._locale.eraYearOrdinalParse(input2, match5);
        } else {
          array2[YEAR] = parseInt(input2, 10);
        }
      });
      function localeEras(m, format2) {
        var i2, l, date, eras = this._eras || getLocale("en")._eras;
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          switch (typeof eras[i2].since) {
            case "string":
              date = hooks(eras[i2].since).startOf("day");
              eras[i2].since = date.valueOf();
              break;
          }
          switch (typeof eras[i2].until) {
            case "undefined":
              eras[i2].until = Infinity;
              break;
            case "string":
              date = hooks(eras[i2].until).startOf("day").valueOf();
              eras[i2].until = date.valueOf();
              break;
          }
        }
        return eras;
      }
      function localeErasParse(eraName, format2, strict) {
        var i2, l, eras = this.eras(), name, abbr, narrow;
        eraName = eraName.toUpperCase();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          name = eras[i2].name.toUpperCase();
          abbr = eras[i2].abbr.toUpperCase();
          narrow = eras[i2].narrow.toUpperCase();
          if (strict) {
            switch (format2) {
              case "N":
              case "NN":
              case "NNN":
                if (abbr === eraName) {
                  return eras[i2];
                }
                break;
              case "NNNN":
                if (name === eraName) {
                  return eras[i2];
                }
                break;
              case "NNNNN":
                if (narrow === eraName) {
                  return eras[i2];
                }
                break;
            }
          } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
            return eras[i2];
          }
        }
      }
      function localeErasConvertYear(era, year) {
        var dir = era.since <= era.until ? 1 : -1;
        if (year === void 0) {
          return hooks(era.since).year();
        } else {
          return hooks(era.since).year() + (year - era.offset) * dir;
        }
      }
      function getEraName() {
        var i2, l, val, eras = this.localeData().eras();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].name;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].name;
          }
        }
        return "";
      }
      function getEraNarrow() {
        var i2, l, val, eras = this.localeData().eras();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].narrow;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].narrow;
          }
        }
        return "";
      }
      function getEraAbbr() {
        var i2, l, val, eras = this.localeData().eras();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].abbr;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].abbr;
          }
        }
        return "";
      }
      function getEraYear() {
        var i2, l, dir, val, eras = this.localeData().eras();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          dir = eras[i2].since <= eras[i2].until ? 1 : -1;
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until || eras[i2].until <= val && val <= eras[i2].since) {
            return (this.year() - hooks(eras[i2].since).year()) * dir + eras[i2].offset;
          }
        }
        return this.year();
      }
      function erasNameRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNameRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNameRegex : this._erasRegex;
      }
      function erasAbbrRegex(isStrict) {
        if (!hasOwnProp(this, "_erasAbbrRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasAbbrRegex : this._erasRegex;
      }
      function erasNarrowRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNarrowRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNarrowRegex : this._erasRegex;
      }
      function matchEraAbbr(isStrict, locale2) {
        return locale2.erasAbbrRegex(isStrict);
      }
      function matchEraName(isStrict, locale2) {
        return locale2.erasNameRegex(isStrict);
      }
      function matchEraNarrow(isStrict, locale2) {
        return locale2.erasNarrowRegex(isStrict);
      }
      function matchEraYearOrdinal(isStrict, locale2) {
        return locale2._eraYearOrdinalRegex || matchUnsigned;
      }
      function computeErasParse() {
        var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i2, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
        for (i2 = 0, l = eras.length; i2 < l; ++i2) {
          erasName = regexEscape(eras[i2].name);
          erasAbbr = regexEscape(eras[i2].abbr);
          erasNarrow = regexEscape(eras[i2].narrow);
          namePieces.push(erasName);
          abbrPieces.push(erasAbbr);
          narrowPieces.push(erasNarrow);
          mixedPieces.push(erasName);
          mixedPieces.push(erasAbbr);
          mixedPieces.push(erasNarrow);
        }
        this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
        this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
        this._erasNarrowRegex = new RegExp(
          "^(" + narrowPieces.join("|") + ")",
          "i"
        );
      }
      addFormatToken(0, ["gg", 2], 0, function() {
        return this.weekYear() % 100;
      });
      addFormatToken(0, ["GG", 2], 0, function() {
        return this.isoWeekYear() % 100;
      });
      function addWeekYearFormatToken(token2, getter) {
        addFormatToken(0, [token2, token2.length], 0, getter);
      }
      addWeekYearFormatToken("gggg", "weekYear");
      addWeekYearFormatToken("ggggg", "weekYear");
      addWeekYearFormatToken("GGGG", "isoWeekYear");
      addWeekYearFormatToken("GGGGG", "isoWeekYear");
      addRegexToken("G", matchSigned);
      addRegexToken("g", matchSigned);
      addRegexToken("GG", match1to2, match2);
      addRegexToken("gg", match1to2, match2);
      addRegexToken("GGGG", match1to4, match4);
      addRegexToken("gggg", match1to4, match4);
      addRegexToken("GGGGG", match1to6, match6);
      addRegexToken("ggggg", match1to6, match6);
      addWeekParseToken(
        ["gggg", "ggggg", "GGGG", "GGGGG"],
        function(input2, week, config2, token2) {
          week[token2.substr(0, 2)] = toInt(input2);
        }
      );
      addWeekParseToken(["gg", "GG"], function(input2, week, config2, token2) {
        week[token2] = hooks.parseTwoDigitYear(input2);
      });
      function getSetWeekYear(input2) {
        return getSetWeekYearHelper.call(
          this,
          input2,
          this.week(),
          this.weekday() + this.localeData()._week.dow,
          this.localeData()._week.dow,
          this.localeData()._week.doy
        );
      }
      function getSetISOWeekYear(input2) {
        return getSetWeekYearHelper.call(
          this,
          input2,
          this.isoWeek(),
          this.isoWeekday(),
          1,
          4
        );
      }
      function getISOWeeksInYear() {
        return weeksInYear(this.year(), 1, 4);
      }
      function getISOWeeksInISOWeekYear() {
        return weeksInYear(this.isoWeekYear(), 1, 4);
      }
      function getWeeksInYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
      }
      function getWeeksInWeekYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
      }
      function getSetWeekYearHelper(input2, week, weekday, dow, doy) {
        var weeksTarget;
        if (input2 == null) {
          return weekOfYear(this, dow, doy).year;
        } else {
          weeksTarget = weeksInYear(input2, dow, doy);
          if (week > weeksTarget) {
            week = weeksTarget;
          }
          return setWeekAll.call(this, input2, week, weekday, dow, doy);
        }
      }
      function setWeekAll(weekYear, week, weekday, dow, doy) {
        var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
        this.year(date.getUTCFullYear());
        this.month(date.getUTCMonth());
        this.date(date.getUTCDate());
        return this;
      }
      addFormatToken("Q", 0, "Qo", "quarter");
      addRegexToken("Q", match1);
      addParseToken("Q", function(input2, array2) {
        array2[MONTH] = (toInt(input2) - 1) * 3;
      });
      function getSetQuarter(input2) {
        return input2 == null ? Math.ceil((this.month() + 1) / 3) : this.month((input2 - 1) * 3 + this.month() % 3);
      }
      addFormatToken("D", ["DD", 2], "Do", "date");
      addRegexToken("D", match1to2, match1to2NoLeadingZero);
      addRegexToken("DD", match1to2, match2);
      addRegexToken("Do", function(isStrict, locale2) {
        return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
      });
      addParseToken(["D", "DD"], DATE);
      addParseToken("Do", function(input2, array2) {
        array2[DATE] = toInt(input2.match(match1to2)[0]);
      });
      var getSetDayOfMonth = makeGetSet("Date", true);
      addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
      addRegexToken("DDD", match1to3);
      addRegexToken("DDDD", match3);
      addParseToken(["DDD", "DDDD"], function(input2, array2, config2) {
        config2._dayOfYear = toInt(input2);
      });
      function getSetDayOfYear(input2) {
        var dayOfYear = Math.round(
          (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
        ) + 1;
        return input2 == null ? dayOfYear : this.add(input2 - dayOfYear, "d");
      }
      addFormatToken("m", ["mm", 2], 0, "minute");
      addRegexToken("m", match1to2, match1to2HasZero);
      addRegexToken("mm", match1to2, match2);
      addParseToken(["m", "mm"], MINUTE);
      var getSetMinute = makeGetSet("Minutes", false);
      addFormatToken("s", ["ss", 2], 0, "second");
      addRegexToken("s", match1to2, match1to2HasZero);
      addRegexToken("ss", match1to2, match2);
      addParseToken(["s", "ss"], SECOND);
      var getSetSecond = makeGetSet("Seconds", false);
      addFormatToken("S", 0, 0, function() {
        return ~~(this.millisecond() / 100);
      });
      addFormatToken(0, ["SS", 2], 0, function() {
        return ~~(this.millisecond() / 10);
      });
      addFormatToken(0, ["SSS", 3], 0, "millisecond");
      addFormatToken(0, ["SSSS", 4], 0, function() {
        return this.millisecond() * 10;
      });
      addFormatToken(0, ["SSSSS", 5], 0, function() {
        return this.millisecond() * 100;
      });
      addFormatToken(0, ["SSSSSS", 6], 0, function() {
        return this.millisecond() * 1e3;
      });
      addFormatToken(0, ["SSSSSSS", 7], 0, function() {
        return this.millisecond() * 1e4;
      });
      addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
        return this.millisecond() * 1e5;
      });
      addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
        return this.millisecond() * 1e6;
      });
      addRegexToken("S", match1to3, match1);
      addRegexToken("SS", match1to3, match2);
      addRegexToken("SSS", match1to3, match3);
      var token, getSetMillisecond;
      for (token = "SSSS"; token.length <= 9; token += "S") {
        addRegexToken(token, matchUnsigned);
      }
      function parseMs(input2, array2) {
        array2[MILLISECOND] = toInt(("0." + input2) * 1e3);
      }
      for (token = "S"; token.length <= 9; token += "S") {
        addParseToken(token, parseMs);
      }
      getSetMillisecond = makeGetSet("Milliseconds", false);
      addFormatToken("z", 0, 0, "zoneAbbr");
      addFormatToken("zz", 0, 0, "zoneName");
      function getZoneAbbr() {
        return this._isUTC ? "UTC" : "";
      }
      function getZoneName() {
        return this._isUTC ? "Coordinated Universal Time" : "";
      }
      var proto = Moment.prototype;
      proto.add = add5;
      proto.calendar = calendar$1;
      proto.clone = clone2;
      proto.diff = diff;
      proto.endOf = endOf;
      proto.format = format;
      proto.from = from2;
      proto.fromNow = fromNow;
      proto.to = to;
      proto.toNow = toNow;
      proto.get = stringGet;
      proto.invalidAt = invalidAt;
      proto.isAfter = isAfter;
      proto.isBefore = isBefore;
      proto.isBetween = isBetween;
      proto.isSame = isSame;
      proto.isSameOrAfter = isSameOrAfter;
      proto.isSameOrBefore = isSameOrBefore;
      proto.isValid = isValid$2;
      proto.lang = lang;
      proto.locale = locale;
      proto.localeData = localeData;
      proto.max = prototypeMax;
      proto.min = prototypeMin;
      proto.parsingFlags = parsingFlags;
      proto.set = stringSet;
      proto.startOf = startOf;
      proto.subtract = subtract;
      proto.toArray = toArray2;
      proto.toObject = toObject;
      proto.toDate = toDate2;
      proto.toISOString = toISOString;
      proto.inspect = inspect;
      if (typeof Symbol !== "undefined" && Symbol.for != null) {
        proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
          return "Moment<" + this.format() + ">";
        };
      }
      proto.toJSON = toJSON2;
      proto.toString = toString7;
      proto.unix = unix;
      proto.valueOf = valueOf;
      proto.creationData = creationData;
      proto.eraName = getEraName;
      proto.eraNarrow = getEraNarrow;
      proto.eraAbbr = getEraAbbr;
      proto.eraYear = getEraYear;
      proto.year = getSetYear;
      proto.isLeapYear = getIsLeapYear;
      proto.weekYear = getSetWeekYear;
      proto.isoWeekYear = getSetISOWeekYear;
      proto.quarter = proto.quarters = getSetQuarter;
      proto.month = getSetMonth;
      proto.daysInMonth = getDaysInMonth;
      proto.week = proto.weeks = getSetWeek;
      proto.isoWeek = proto.isoWeeks = getSetISOWeek;
      proto.weeksInYear = getWeeksInYear;
      proto.weeksInWeekYear = getWeeksInWeekYear;
      proto.isoWeeksInYear = getISOWeeksInYear;
      proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
      proto.date = getSetDayOfMonth;
      proto.day = proto.days = getSetDayOfWeek;
      proto.weekday = getSetLocaleDayOfWeek;
      proto.isoWeekday = getSetISODayOfWeek;
      proto.dayOfYear = getSetDayOfYear;
      proto.hour = proto.hours = getSetHour;
      proto.minute = proto.minutes = getSetMinute;
      proto.second = proto.seconds = getSetSecond;
      proto.millisecond = proto.milliseconds = getSetMillisecond;
      proto.utcOffset = getSetOffset;
      proto.utc = setOffsetToUTC;
      proto.local = setOffsetToLocal;
      proto.parseZone = setOffsetToParsedOffset;
      proto.hasAlignedHourOffset = hasAlignedHourOffset;
      proto.isDST = isDaylightSavingTime;
      proto.isLocal = isLocal;
      proto.isUtcOffset = isUtcOffset;
      proto.isUtc = isUtc;
      proto.isUTC = isUtc;
      proto.zoneAbbr = getZoneAbbr;
      proto.zoneName = getZoneName;
      proto.dates = deprecate(
        "dates accessor is deprecated. Use date instead.",
        getSetDayOfMonth
      );
      proto.months = deprecate(
        "months accessor is deprecated. Use month instead",
        getSetMonth
      );
      proto.years = deprecate(
        "years accessor is deprecated. Use year instead",
        getSetYear
      );
      proto.zone = deprecate(
        "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
        getSetZone
      );
      proto.isDSTShifted = deprecate(
        "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
        isDaylightSavingTimeShifted
      );
      function createUnix(input2) {
        return createLocal(input2 * 1e3);
      }
      function createInZone() {
        return createLocal.apply(null, arguments).parseZone();
      }
      function preParsePostFormat(string) {
        return string;
      }
      var proto$1 = Locale.prototype;
      proto$1.calendar = calendar;
      proto$1.longDateFormat = longDateFormat;
      proto$1.invalidDate = invalidDate;
      proto$1.ordinal = ordinal;
      proto$1.preparse = preParsePostFormat;
      proto$1.postformat = preParsePostFormat;
      proto$1.relativeTime = relativeTime;
      proto$1.pastFuture = pastFuture;
      proto$1.set = set2;
      proto$1.eras = localeEras;
      proto$1.erasParse = localeErasParse;
      proto$1.erasConvertYear = localeErasConvertYear;
      proto$1.erasAbbrRegex = erasAbbrRegex;
      proto$1.erasNameRegex = erasNameRegex;
      proto$1.erasNarrowRegex = erasNarrowRegex;
      proto$1.months = localeMonths;
      proto$1.monthsShort = localeMonthsShort;
      proto$1.monthsParse = localeMonthsParse;
      proto$1.monthsRegex = monthsRegex;
      proto$1.monthsShortRegex = monthsShortRegex;
      proto$1.week = localeWeek;
      proto$1.firstDayOfYear = localeFirstDayOfYear;
      proto$1.firstDayOfWeek = localeFirstDayOfWeek;
      proto$1.weekdays = localeWeekdays;
      proto$1.weekdaysMin = localeWeekdaysMin;
      proto$1.weekdaysShort = localeWeekdaysShort;
      proto$1.weekdaysParse = localeWeekdaysParse;
      proto$1.weekdaysRegex = weekdaysRegex;
      proto$1.weekdaysShortRegex = weekdaysShortRegex;
      proto$1.weekdaysMinRegex = weekdaysMinRegex;
      proto$1.isPM = localeIsPM;
      proto$1.meridiem = localeMeridiem;
      function get$1(format2, index, field, setter) {
        var locale2 = getLocale(), utc = createUTC().set(setter, index);
        return locale2[field](utc, format2);
      }
      function listMonthsImpl(format2, index, field) {
        if (isNumber6(format2)) {
          index = format2;
          format2 = void 0;
        }
        format2 = format2 || "";
        if (index != null) {
          return get$1(format2, index, field, "month");
        }
        var i2, out = [];
        for (i2 = 0; i2 < 12; i2++) {
          out[i2] = get$1(format2, i2, field, "month");
        }
        return out;
      }
      function listWeekdaysImpl(localeSorted, format2, index, field) {
        if (typeof localeSorted === "boolean") {
          if (isNumber6(format2)) {
            index = format2;
            format2 = void 0;
          }
          format2 = format2 || "";
        } else {
          format2 = localeSorted;
          index = format2;
          localeSorted = false;
          if (isNumber6(format2)) {
            index = format2;
            format2 = void 0;
          }
          format2 = format2 || "";
        }
        var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i2, out = [];
        if (index != null) {
          return get$1(format2, (index + shift) % 7, field, "day");
        }
        for (i2 = 0; i2 < 7; i2++) {
          out[i2] = get$1(format2, (i2 + shift) % 7, field, "day");
        }
        return out;
      }
      function listMonths(format2, index) {
        return listMonthsImpl(format2, index, "months");
      }
      function listMonthsShort(format2, index) {
        return listMonthsImpl(format2, index, "monthsShort");
      }
      function listWeekdays(localeSorted, format2, index) {
        return listWeekdaysImpl(localeSorted, format2, index, "weekdays");
      }
      function listWeekdaysShort(localeSorted, format2, index) {
        return listWeekdaysImpl(localeSorted, format2, index, "weekdaysShort");
      }
      function listWeekdaysMin(localeSorted, format2, index) {
        return listWeekdaysImpl(localeSorted, format2, index, "weekdaysMin");
      }
      getSetGlobalLocale("en", {
        eras: [
          {
            since: "0001-01-01",
            until: Infinity,
            offset: 1,
            name: "Anno Domini",
            narrow: "AD",
            abbr: "AD"
          },
          {
            since: "0000-12-31",
            until: -Infinity,
            offset: 1,
            name: "Before Christ",
            narrow: "BC",
            abbr: "BC"
          }
        ],
        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
        ordinal: function(number2) {
          var b = number2 % 10, output = toInt(number2 % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
          return number2 + output;
        }
      });
      hooks.lang = deprecate(
        "moment.lang is deprecated. Use moment.locale instead.",
        getSetGlobalLocale
      );
      hooks.langData = deprecate(
        "moment.langData is deprecated. Use moment.localeData instead.",
        getLocale
      );
      var mathAbs = Math.abs;
      function abs() {
        var data = this._data;
        this._milliseconds = mathAbs(this._milliseconds);
        this._days = mathAbs(this._days);
        this._months = mathAbs(this._months);
        data.milliseconds = mathAbs(data.milliseconds);
        data.seconds = mathAbs(data.seconds);
        data.minutes = mathAbs(data.minutes);
        data.hours = mathAbs(data.hours);
        data.months = mathAbs(data.months);
        data.years = mathAbs(data.years);
        return this;
      }
      function addSubtract$1(duration, input2, value, direction) {
        var other = createDuration(input2, value);
        duration._milliseconds += direction * other._milliseconds;
        duration._days += direction * other._days;
        duration._months += direction * other._months;
        return duration._bubble();
      }
      function add$1(input2, value) {
        return addSubtract$1(this, input2, value, 1);
      }
      function subtract$1(input2, value) {
        return addSubtract$1(this, input2, value, -1);
      }
      function absCeil(number2) {
        if (number2 < 0) {
          return Math.floor(number2);
        } else {
          return Math.ceil(number2);
        }
      }
      function bubble() {
        var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
        if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
          milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
          days2 = 0;
          months2 = 0;
        }
        data.milliseconds = milliseconds2 % 1e3;
        seconds2 = absFloor(milliseconds2 / 1e3);
        data.seconds = seconds2 % 60;
        minutes2 = absFloor(seconds2 / 60);
        data.minutes = minutes2 % 60;
        hours2 = absFloor(minutes2 / 60);
        data.hours = hours2 % 24;
        days2 += absFloor(hours2 / 24);
        monthsFromDays = absFloor(daysToMonths(days2));
        months2 += monthsFromDays;
        days2 -= absCeil(monthsToDays(monthsFromDays));
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        data.days = days2;
        data.months = months2;
        data.years = years2;
        return this;
      }
      function daysToMonths(days2) {
        return days2 * 4800 / 146097;
      }
      function monthsToDays(months2) {
        return months2 * 146097 / 4800;
      }
      function as(units) {
        if (!this.isValid()) {
          return NaN;
        }
        var days2, months2, milliseconds2 = this._milliseconds;
        units = normalizeUnits(units);
        if (units === "month" || units === "quarter" || units === "year") {
          days2 = this._days + milliseconds2 / 864e5;
          months2 = this._months + daysToMonths(days2);
          switch (units) {
            case "month":
              return months2;
            case "quarter":
              return months2 / 3;
            case "year":
              return months2 / 12;
          }
        } else {
          days2 = this._days + Math.round(monthsToDays(this._months));
          switch (units) {
            case "week":
              return days2 / 7 + milliseconds2 / 6048e5;
            case "day":
              return days2 + milliseconds2 / 864e5;
            case "hour":
              return days2 * 24 + milliseconds2 / 36e5;
            case "minute":
              return days2 * 1440 + milliseconds2 / 6e4;
            case "second":
              return days2 * 86400 + milliseconds2 / 1e3;
            case "millisecond":
              return Math.floor(days2 * 864e5) + milliseconds2;
            default:
              throw new Error("Unknown unit " + units);
          }
        }
      }
      function makeAs(alias) {
        return function() {
          return this.as(alias);
        };
      }
      var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf$1 = asMilliseconds;
      function clone$1() {
        return createDuration(this);
      }
      function get$2(units) {
        units = normalizeUnits(units);
        return this.isValid() ? this[units + "s"]() : NaN;
      }
      function makeGetter(name) {
        return function() {
          return this.isValid() ? this._data[name] : NaN;
        };
      }
      var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
      function weeks() {
        return absFloor(this.days() / 7);
      }
      var round2 = Math.round, thresholds = {
        ss: 44,
        // a few seconds to seconds
        s: 45,
        // seconds to minute
        m: 45,
        // minutes to hour
        h: 22,
        // hours to day
        d: 26,
        // days to month/week
        w: null,
        // weeks to month
        M: 11
        // months to year
      };
      function substituteTimeAgo(string, number2, withoutSuffix, isFuture, locale2) {
        return locale2.relativeTime(number2 || 1, !!withoutSuffix, string, isFuture);
      }
      function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
        var duration = createDuration(posNegDuration).abs(), seconds2 = round2(duration.as("s")), minutes2 = round2(duration.as("m")), hours2 = round2(duration.as("h")), days2 = round2(duration.as("d")), months2 = round2(duration.as("M")), weeks2 = round2(duration.as("w")), years2 = round2(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
        if (thresholds2.w != null) {
          a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
        }
        a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
        a[2] = withoutSuffix;
        a[3] = +posNegDuration > 0;
        a[4] = locale2;
        return substituteTimeAgo.apply(null, a);
      }
      function getSetRelativeTimeRounding(roundingFunction) {
        if (roundingFunction === void 0) {
          return round2;
        }
        if (typeof roundingFunction === "function") {
          round2 = roundingFunction;
          return true;
        }
        return false;
      }
      function getSetRelativeTimeThreshold(threshold, limit) {
        if (thresholds[threshold] === void 0) {
          return false;
        }
        if (limit === void 0) {
          return thresholds[threshold];
        }
        thresholds[threshold] = limit;
        if (threshold === "s") {
          thresholds.ss = limit - 1;
        }
        return true;
      }
      function humanize(argWithSuffix, argThresholds) {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var withSuffix = false, th = thresholds, locale2, output;
        if (typeof argWithSuffix === "object") {
          argThresholds = argWithSuffix;
          argWithSuffix = false;
        }
        if (typeof argWithSuffix === "boolean") {
          withSuffix = argWithSuffix;
        }
        if (typeof argThresholds === "object") {
          th = Object.assign({}, thresholds, argThresholds);
          if (argThresholds.s != null && argThresholds.ss == null) {
            th.ss = argThresholds.s - 1;
          }
        }
        locale2 = this.localeData();
        output = relativeTime$1(this, !withSuffix, th, locale2);
        if (withSuffix) {
          output = locale2.pastFuture(+this, output);
        }
        return locale2.postformat(output);
      }
      var abs$1 = Math.abs;
      function sign(x) {
        return (x > 0) - (x < 0) || +x;
      }
      function toISOString$1() {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
        if (!total) {
          return "P0D";
        }
        minutes2 = absFloor(seconds2 / 60);
        hours2 = absFloor(minutes2 / 60);
        seconds2 %= 60;
        minutes2 %= 60;
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
        totalSign = total < 0 ? "-" : "";
        ymSign = sign(this._months) !== sign(total) ? "-" : "";
        daysSign = sign(this._days) !== sign(total) ? "-" : "";
        hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
        return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
      }
      var proto$2 = Duration.prototype;
      proto$2.isValid = isValid$1;
      proto$2.abs = abs;
      proto$2.add = add$1;
      proto$2.subtract = subtract$1;
      proto$2.as = as;
      proto$2.asMilliseconds = asMilliseconds;
      proto$2.asSeconds = asSeconds;
      proto$2.asMinutes = asMinutes;
      proto$2.asHours = asHours;
      proto$2.asDays = asDays;
      proto$2.asWeeks = asWeeks;
      proto$2.asMonths = asMonths;
      proto$2.asQuarters = asQuarters;
      proto$2.asYears = asYears;
      proto$2.valueOf = valueOf$1;
      proto$2._bubble = bubble;
      proto$2.clone = clone$1;
      proto$2.get = get$2;
      proto$2.milliseconds = milliseconds;
      proto$2.seconds = seconds;
      proto$2.minutes = minutes;
      proto$2.hours = hours;
      proto$2.days = days;
      proto$2.weeks = weeks;
      proto$2.months = months;
      proto$2.years = years;
      proto$2.humanize = humanize;
      proto$2.toISOString = toISOString$1;
      proto$2.toString = toISOString$1;
      proto$2.toJSON = toISOString$1;
      proto$2.locale = locale;
      proto$2.localeData = localeData;
      proto$2.toIsoString = deprecate(
        "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
        toISOString$1
      );
      proto$2.lang = lang;
      addFormatToken("X", 0, 0, "unix");
      addFormatToken("x", 0, 0, "valueOf");
      addRegexToken("x", matchSigned);
      addRegexToken("X", matchTimestamp);
      addParseToken("X", function(input2, array2, config2) {
        config2._d = new Date(parseFloat(input2) * 1e3);
      });
      addParseToken("x", function(input2, array2, config2) {
        config2._d = new Date(toInt(input2));
      });
      hooks.version = "2.30.1";
      setHookCallback(createLocal);
      hooks.fn = proto;
      hooks.min = min;
      hooks.max = max;
      hooks.now = now;
      hooks.utc = createUTC;
      hooks.unix = createUnix;
      hooks.months = listMonths;
      hooks.isDate = isDate2;
      hooks.locale = getSetGlobalLocale;
      hooks.invalid = createInvalid;
      hooks.duration = createDuration;
      hooks.isMoment = isMoment;
      hooks.weekdays = listWeekdays;
      hooks.parseZone = createInZone;
      hooks.localeData = getLocale;
      hooks.isDuration = isDuration;
      hooks.monthsShort = listMonthsShort;
      hooks.weekdaysMin = listWeekdaysMin;
      hooks.defineLocale = defineLocale;
      hooks.updateLocale = updateLocale;
      hooks.locales = listLocales;
      hooks.weekdaysShort = listWeekdaysShort;
      hooks.normalizeUnits = normalizeUnits;
      hooks.relativeTimeRounding = getSetRelativeTimeRounding;
      hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
      hooks.calendarFormat = getCalendarFormat;
      hooks.prototype = proto;
      hooks.HTML5_FMT = {
        DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
        // <input type="datetime-local" />
        DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
        // <input type="datetime-local" step="1" />
        DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
        // <input type="datetime-local" step="0.001" />
        DATE: "YYYY-MM-DD",
        // <input type="date" />
        TIME: "HH:mm",
        // <input type="time" />
        TIME_SECONDS: "HH:mm:ss",
        // <input type="time" step="1" />
        TIME_MS: "HH:mm:ss.SSS",
        // <input type="time" step="0.001" />
        WEEK: "GGGG-[W]WW",
        // <input type="week" />
        MONTH: "YYYY-MM"
        // <input type="month" />
      };
      return hooks;
    });
  }
});

// node_modules/lodash/lodash.js
var require_lodash = __commonJS({
  "node_modules/lodash/lodash.js"(exports4, module2) {
    (function() {
      var undefined2;
      var VERSION10 = "4.17.21";
      var LARGE_ARRAY_SIZE = 200;
      var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      var MAX_MEMOIZE_SIZE = 500;
      var PLACEHOLDER = "__lodash_placeholder__";
      var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
      var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
      var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
      var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
      var HOT_COUNT = 800, HOT_SPAN = 16;
      var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
      var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
      var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
      var wrapFlags = [
        ["ary", WRAP_ARY_FLAG],
        ["bind", WRAP_BIND_FLAG],
        ["bindKey", WRAP_BIND_KEY_FLAG],
        ["curry", WRAP_CURRY_FLAG],
        ["curryRight", WRAP_CURRY_RIGHT_FLAG],
        ["flip", WRAP_FLIP_FLAG],
        ["partial", WRAP_PARTIAL_FLAG],
        ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
        ["rearg", WRAP_REARG_FLAG]
      ];
      var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
      var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
      var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
      var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
      var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
      var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
      var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
      var reTrimStart = /^\s+/;
      var reWhitespace = /\s/;
      var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
      var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
      var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
      var reEscapeChar = /\\(\\)?/g;
      var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
      var reFlags = /\w*$/;
      var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
      var reIsBinary = /^0b[01]+$/i;
      var reIsHostCtor = /^\[object .+?Constructor\]$/;
      var reIsOctal = /^0o[0-7]+$/i;
      var reIsUint = /^(?:0|[1-9]\d*)$/;
      var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
      var reNoMatch = /($^)/;
      var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
      var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
      var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
      var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
      var reApos = RegExp(rsApos, "g");
      var reComboMark = RegExp(rsCombo, "g");
      var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
      var reUnicodeWord = RegExp([
        rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
        rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
        rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
        rsUpper + "+" + rsOptContrUpper,
        rsOrdUpper,
        rsOrdLower,
        rsDigits,
        rsEmoji
      ].join("|"), "g");
      var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
      var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
      var contextProps = [
        "Array",
        "Buffer",
        "DataView",
        "Date",
        "Error",
        "Float32Array",
        "Float64Array",
        "Function",
        "Int8Array",
        "Int16Array",
        "Int32Array",
        "Map",
        "Math",
        "Object",
        "Promise",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "TypeError",
        "Uint8Array",
        "Uint8ClampedArray",
        "Uint16Array",
        "Uint32Array",
        "WeakMap",
        "_",
        "clearTimeout",
        "isFinite",
        "parseInt",
        "setTimeout"
      ];
      var templateCounter = -1;
      var typedArrayTags = {};
      typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
      typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
      var cloneableTags = {};
      cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
      cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
      var deburredLetters = {
        // Latin-1 Supplement block.
        "\xC0": "A",
        "\xC1": "A",
        "\xC2": "A",
        "\xC3": "A",
        "\xC4": "A",
        "\xC5": "A",
        "\xE0": "a",
        "\xE1": "a",
        "\xE2": "a",
        "\xE3": "a",
        "\xE4": "a",
        "\xE5": "a",
        "\xC7": "C",
        "\xE7": "c",
        "\xD0": "D",
        "\xF0": "d",
        "\xC8": "E",
        "\xC9": "E",
        "\xCA": "E",
        "\xCB": "E",
        "\xE8": "e",
        "\xE9": "e",
        "\xEA": "e",
        "\xEB": "e",
        "\xCC": "I",
        "\xCD": "I",
        "\xCE": "I",
        "\xCF": "I",
        "\xEC": "i",
        "\xED": "i",
        "\xEE": "i",
        "\xEF": "i",
        "\xD1": "N",
        "\xF1": "n",
        "\xD2": "O",
        "\xD3": "O",
        "\xD4": "O",
        "\xD5": "O",
        "\xD6": "O",
        "\xD8": "O",
        "\xF2": "o",
        "\xF3": "o",
        "\xF4": "o",
        "\xF5": "o",
        "\xF6": "o",
        "\xF8": "o",
        "\xD9": "U",
        "\xDA": "U",
        "\xDB": "U",
        "\xDC": "U",
        "\xF9": "u",
        "\xFA": "u",
        "\xFB": "u",
        "\xFC": "u",
        "\xDD": "Y",
        "\xFD": "y",
        "\xFF": "y",
        "\xC6": "Ae",
        "\xE6": "ae",
        "\xDE": "Th",
        "\xFE": "th",
        "\xDF": "ss",
        // Latin Extended-A block.
        "\u0100": "A",
        "\u0102": "A",
        "\u0104": "A",
        "\u0101": "a",
        "\u0103": "a",
        "\u0105": "a",
        "\u0106": "C",
        "\u0108": "C",
        "\u010A": "C",
        "\u010C": "C",
        "\u0107": "c",
        "\u0109": "c",
        "\u010B": "c",
        "\u010D": "c",
        "\u010E": "D",
        "\u0110": "D",
        "\u010F": "d",
        "\u0111": "d",
        "\u0112": "E",
        "\u0114": "E",
        "\u0116": "E",
        "\u0118": "E",
        "\u011A": "E",
        "\u0113": "e",
        "\u0115": "e",
        "\u0117": "e",
        "\u0119": "e",
        "\u011B": "e",
        "\u011C": "G",
        "\u011E": "G",
        "\u0120": "G",
        "\u0122": "G",
        "\u011D": "g",
        "\u011F": "g",
        "\u0121": "g",
        "\u0123": "g",
        "\u0124": "H",
        "\u0126": "H",
        "\u0125": "h",
        "\u0127": "h",
        "\u0128": "I",
        "\u012A": "I",
        "\u012C": "I",
        "\u012E": "I",
        "\u0130": "I",
        "\u0129": "i",
        "\u012B": "i",
        "\u012D": "i",
        "\u012F": "i",
        "\u0131": "i",
        "\u0134": "J",
        "\u0135": "j",
        "\u0136": "K",
        "\u0137": "k",
        "\u0138": "k",
        "\u0139": "L",
        "\u013B": "L",
        "\u013D": "L",
        "\u013F": "L",
        "\u0141": "L",
        "\u013A": "l",
        "\u013C": "l",
        "\u013E": "l",
        "\u0140": "l",
        "\u0142": "l",
        "\u0143": "N",
        "\u0145": "N",
        "\u0147": "N",
        "\u014A": "N",
        "\u0144": "n",
        "\u0146": "n",
        "\u0148": "n",
        "\u014B": "n",
        "\u014C": "O",
        "\u014E": "O",
        "\u0150": "O",
        "\u014D": "o",
        "\u014F": "o",
        "\u0151": "o",
        "\u0154": "R",
        "\u0156": "R",
        "\u0158": "R",
        "\u0155": "r",
        "\u0157": "r",
        "\u0159": "r",
        "\u015A": "S",
        "\u015C": "S",
        "\u015E": "S",
        "\u0160": "S",
        "\u015B": "s",
        "\u015D": "s",
        "\u015F": "s",
        "\u0161": "s",
        "\u0162": "T",
        "\u0164": "T",
        "\u0166": "T",
        "\u0163": "t",
        "\u0165": "t",
        "\u0167": "t",
        "\u0168": "U",
        "\u016A": "U",
        "\u016C": "U",
        "\u016E": "U",
        "\u0170": "U",
        "\u0172": "U",
        "\u0169": "u",
        "\u016B": "u",
        "\u016D": "u",
        "\u016F": "u",
        "\u0171": "u",
        "\u0173": "u",
        "\u0174": "W",
        "\u0175": "w",
        "\u0176": "Y",
        "\u0177": "y",
        "\u0178": "Y",
        "\u0179": "Z",
        "\u017B": "Z",
        "\u017D": "Z",
        "\u017A": "z",
        "\u017C": "z",
        "\u017E": "z",
        "\u0132": "IJ",
        "\u0133": "ij",
        "\u0152": "Oe",
        "\u0153": "oe",
        "\u0149": "'n",
        "\u017F": "s"
      };
      var htmlEscapes2 = {
        "&": "&amp;",
        "<": "&lt;",
        ">": "&gt;",
        '"': "&quot;",
        "'": "&#39;"
      };
      var htmlUnescapes = {
        "&amp;": "&",
        "&lt;": "<",
        "&gt;": ">",
        "&quot;": '"',
        "&#39;": "'"
      };
      var stringEscapes = {
        "\\": "\\",
        "'": "'",
        "\n": "n",
        "\r": "r",
        "\u2028": "u2028",
        "\u2029": "u2029"
      };
      var freeParseFloat = parseFloat, freeParseInt = parseInt;
      var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
      var freeSelf = typeof self == "object" && self && self.Object === Object && self;
      var root = freeGlobal || freeSelf || Function("return this")();
      var freeExports = typeof exports4 == "object" && exports4 && !exports4.nodeType && exports4;
      var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var freeProcess = moduleExports && freeGlobal.process;
      var nodeUtil = function() {
        try {
          var types2 = freeModule && freeModule.require && freeModule.require("util").types;
          if (types2) {
            return types2;
          }
          return freeProcess && freeProcess.binding && freeProcess.binding("util");
        } catch (e) {
        }
      }();
      var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
      function apply2(func, thisArg, args) {
        switch (args.length) {
          case 0:
            return func.call(thisArg);
          case 1:
            return func.call(thisArg, args[0]);
          case 2:
            return func.call(thisArg, args[0], args[1]);
          case 3:
            return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
      }
      function arrayAggregator(array2, setter, iteratee, accumulator) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        while (++index < length) {
          var value = array2[index];
          setter(accumulator, value, iteratee(value), array2);
        }
        return accumulator;
      }
      function arrayEach(array2, iteratee) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        while (++index < length) {
          if (iteratee(array2[index], index, array2) === false) {
            break;
          }
        }
        return array2;
      }
      function arrayEachRight(array2, iteratee) {
        var length = array2 == null ? 0 : array2.length;
        while (length--) {
          if (iteratee(array2[length], length, array2) === false) {
            break;
          }
        }
        return array2;
      }
      function arrayEvery(array2, predicate) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        while (++index < length) {
          if (!predicate(array2[index], index, array2)) {
            return false;
          }
        }
        return true;
      }
      function arrayFilter(array2, predicate) {
        var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array2[index];
          if (predicate(value, index, array2)) {
            result[resIndex++] = value;
          }
        }
        return result;
      }
      function arrayIncludes(array2, value) {
        var length = array2 == null ? 0 : array2.length;
        return !!length && baseIndexOf(array2, value, 0) > -1;
      }
      function arrayIncludesWith(array2, value, comparator) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        while (++index < length) {
          if (comparator(value, array2[index])) {
            return true;
          }
        }
        return false;
      }
      function arrayMap(array2, iteratee) {
        var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
        while (++index < length) {
          result[index] = iteratee(array2[index], index, array2);
        }
        return result;
      }
      function arrayPush(array2, values) {
        var index = -1, length = values.length, offset2 = array2.length;
        while (++index < length) {
          array2[offset2 + index] = values[index];
        }
        return array2;
      }
      function arrayReduce(array2, iteratee, accumulator, initAccum) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        if (initAccum && length) {
          accumulator = array2[++index];
        }
        while (++index < length) {
          accumulator = iteratee(accumulator, array2[index], index, array2);
        }
        return accumulator;
      }
      function arrayReduceRight(array2, iteratee, accumulator, initAccum) {
        var length = array2 == null ? 0 : array2.length;
        if (initAccum && length) {
          accumulator = array2[--length];
        }
        while (length--) {
          accumulator = iteratee(accumulator, array2[length], length, array2);
        }
        return accumulator;
      }
      function arraySome(array2, predicate) {
        var index = -1, length = array2 == null ? 0 : array2.length;
        while (++index < length) {
          if (predicate(array2[index], index, array2)) {
            return true;
          }
        }
        return false;
      }
      var asciiSize = baseProperty("length");
      function asciiToArray(string) {
        return string.split("");
      }
      function asciiWords(string) {
        return string.match(reAsciiWord) || [];
      }
      function baseFindKey(collection, predicate, eachFunc) {
        var result;
        eachFunc(collection, function(value, key, collection2) {
          if (predicate(value, key, collection2)) {
            result = key;
            return false;
          }
        });
        return result;
      }
      function baseFindIndex(array2, predicate, fromIndex, fromRight) {
        var length = array2.length, index = fromIndex + (fromRight ? 1 : -1);
        while (fromRight ? index-- : ++index < length) {
          if (predicate(array2[index], index, array2)) {
            return index;
          }
        }
        return -1;
      }
      function baseIndexOf(array2, value, fromIndex) {
        return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex);
      }
      function baseIndexOfWith(array2, value, fromIndex, comparator) {
        var index = fromIndex - 1, length = array2.length;
        while (++index < length) {
          if (comparator(array2[index], value)) {
            return index;
          }
        }
        return -1;
      }
      function baseIsNaN(value) {
        return value !== value;
      }
      function baseMean(array2, iteratee) {
        var length = array2 == null ? 0 : array2.length;
        return length ? baseSum(array2, iteratee) / length : NAN;
      }
      function baseProperty(key) {
        return function(object) {
          return object == null ? undefined2 : object[key];
        };
      }
      function basePropertyOf(object) {
        return function(key) {
          return object == null ? undefined2 : object[key];
        };
      }
      function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
        eachFunc(collection, function(value, index, collection2) {
          accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
        });
        return accumulator;
      }
      function baseSortBy(array2, comparer) {
        var length = array2.length;
        array2.sort(comparer);
        while (length--) {
          array2[length] = array2[length].value;
        }
        return array2;
      }
      function baseSum(array2, iteratee) {
        var result, index = -1, length = array2.length;
        while (++index < length) {
          var current = iteratee(array2[index]);
          if (current !== undefined2) {
            result = result === undefined2 ? current : result + current;
          }
        }
        return result;
      }
      function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while (++index < n) {
          result[index] = iteratee(index);
        }
        return result;
      }
      function baseToPairs(object, props) {
        return arrayMap(props, function(key) {
          return [key, object[key]];
        });
      }
      function baseTrim(string) {
        return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
      }
      function baseUnary(func) {
        return function(value) {
          return func(value);
        };
      }
      function baseValues(object, props) {
        return arrayMap(props, function(key) {
          return object[key];
        });
      }
      function cacheHas(cache2, key) {
        return cache2.has(key);
      }
      function charsStartIndex(strSymbols, chrSymbols) {
        var index = -1, length = strSymbols.length;
        while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
        }
        return index;
      }
      function charsEndIndex(strSymbols, chrSymbols) {
        var index = strSymbols.length;
        while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
        }
        return index;
      }
      function countHolders(array2, placeholder) {
        var length = array2.length, result = 0;
        while (length--) {
          if (array2[length] === placeholder) {
            ++result;
          }
        }
        return result;
      }
      var deburrLetter = basePropertyOf(deburredLetters);
      var escapeHtmlChar = basePropertyOf(htmlEscapes2);
      function escapeStringChar(chr) {
        return "\\" + stringEscapes[chr];
      }
      function getValue2(object, key) {
        return object == null ? undefined2 : object[key];
      }
      function hasUnicode(string) {
        return reHasUnicode.test(string);
      }
      function hasUnicodeWord(string) {
        return reHasUnicodeWord.test(string);
      }
      function iteratorToArray(iterator2) {
        var data, result = [];
        while (!(data = iterator2.next()).done) {
          result.push(data.value);
        }
        return result;
      }
      function mapToArray(map2) {
        var index = -1, result = Array(map2.size);
        map2.forEach(function(value, key) {
          result[++index] = [key, value];
        });
        return result;
      }
      function overArg(func, transform3) {
        return function(arg) {
          return func(transform3(arg));
        };
      }
      function replaceHolders(array2, placeholder) {
        var index = -1, length = array2.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array2[index];
          if (value === placeholder || value === PLACEHOLDER) {
            array2[index] = PLACEHOLDER;
            result[resIndex++] = index;
          }
        }
        return result;
      }
      function setToArray(set2) {
        var index = -1, result = Array(set2.size);
        set2.forEach(function(value) {
          result[++index] = value;
        });
        return result;
      }
      function setToPairs(set2) {
        var index = -1, result = Array(set2.size);
        set2.forEach(function(value) {
          result[++index] = [value, value];
        });
        return result;
      }
      function strictIndexOf(array2, value, fromIndex) {
        var index = fromIndex - 1, length = array2.length;
        while (++index < length) {
          if (array2[index] === value) {
            return index;
          }
        }
        return -1;
      }
      function strictLastIndexOf(array2, value, fromIndex) {
        var index = fromIndex + 1;
        while (index--) {
          if (array2[index] === value) {
            return index;
          }
        }
        return index;
      }
      function stringSize(string) {
        return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
      }
      function stringToArray(string) {
        return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
      }
      function trimmedEndIndex(string) {
        var index = string.length;
        while (index-- && reWhitespace.test(string.charAt(index))) {
        }
        return index;
      }
      var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
      function unicodeSize(string) {
        var result = reUnicode.lastIndex = 0;
        while (reUnicode.test(string)) {
          ++result;
        }
        return result;
      }
      function unicodeToArray(string) {
        return string.match(reUnicode) || [];
      }
      function unicodeWords(string) {
        return string.match(reUnicodeWord) || [];
      }
      var runInContext = function runInContext2(context2) {
        context2 = context2 == null ? root : _.defaults(root.Object(), context2, _.pick(root, contextProps));
        var Array2 = context2.Array, Date2 = context2.Date, Error2 = context2.Error, Function2 = context2.Function, Math2 = context2.Math, Object2 = context2.Object, RegExp2 = context2.RegExp, String2 = context2.String, TypeError2 = context2.TypeError;
        var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto2 = Object2.prototype;
        var coreJsData = context2["__core-js_shared__"];
        var funcToString = funcProto.toString;
        var hasOwnProperty = objectProto2.hasOwnProperty;
        var idCounter = 0;
        var maskSrcKey = function() {
          var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
          return uid ? "Symbol(src)_1." + uid : "";
        }();
        var nativeObjectToString = objectProto2.toString;
        var objectCtorString = funcToString.call(Object2);
        var oldDash = root._;
        var reIsNative = RegExp2(
          "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
        );
        var Buffer2 = moduleExports ? context2.Buffer : undefined2, Symbol2 = context2.Symbol, Uint8Array2 = context2.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto2.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
        var defineProperty = function() {
          try {
            var func = getNative(Object2, "defineProperty");
            func({}, "", {});
            return func;
          } catch (e) {
          }
        }();
        var ctxClearTimeout = context2.clearTimeout !== root.clearTimeout && context2.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context2.setTimeout !== root.setTimeout && context2.setTimeout;
        var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context2.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context2.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
        var DataView = getNative(context2, "DataView"), Map3 = getNative(context2, "Map"), Promise2 = getNative(context2, "Promise"), Set2 = getNative(context2, "Set"), WeakMap2 = getNative(context2, "WeakMap"), nativeCreate = getNative(Object2, "create");
        var metaMap = WeakMap2 && new WeakMap2();
        var realNames = {};
        var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map3), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
        var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2;
        function lodash(value) {
          if (isObjectLike(value) && !isArray4(value) && !(value instanceof LazyWrapper)) {
            if (value instanceof LodashWrapper) {
              return value;
            }
            if (hasOwnProperty.call(value, "__wrapped__")) {
              return wrapperClone(value);
            }
          }
          return new LodashWrapper(value);
        }
        var baseCreate = /* @__PURE__ */ function() {
          function object() {
          }
          return function(proto) {
            if (!isObject2(proto)) {
              return {};
            }
            if (objectCreate) {
              return objectCreate(proto);
            }
            object.prototype = proto;
            var result2 = new object();
            object.prototype = undefined2;
            return result2;
          };
        }();
        function baseLodash() {
        }
        function LodashWrapper(value, chainAll) {
          this.__wrapped__ = value;
          this.__actions__ = [];
          this.__chain__ = !!chainAll;
          this.__index__ = 0;
          this.__values__ = undefined2;
        }
        lodash.templateSettings = {
          /**
           * Used to detect `data` property values to be HTML-escaped.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          "escape": reEscape,
          /**
           * Used to detect code to be evaluated.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          "evaluate": reEvaluate,
          /**
           * Used to detect `data` property values to inject.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          "interpolate": reInterpolate,
          /**
           * Used to reference the data object in the template text.
           *
           * @memberOf _.templateSettings
           * @type {string}
           */
          "variable": "",
          /**
           * Used to import variables into the compiled template.
           *
           * @memberOf _.templateSettings
           * @type {Object}
           */
          "imports": {
            /**
             * A reference to the `lodash` function.
             *
             * @memberOf _.templateSettings.imports
             * @type {Function}
             */
            "_": lodash
          }
        };
        lodash.prototype = baseLodash.prototype;
        lodash.prototype.constructor = lodash;
        LodashWrapper.prototype = baseCreate(baseLodash.prototype);
        LodashWrapper.prototype.constructor = LodashWrapper;
        function LazyWrapper(value) {
          this.__wrapped__ = value;
          this.__actions__ = [];
          this.__dir__ = 1;
          this.__filtered__ = false;
          this.__iteratees__ = [];
          this.__takeCount__ = MAX_ARRAY_LENGTH;
          this.__views__ = [];
        }
        function lazyClone() {
          var result2 = new LazyWrapper(this.__wrapped__);
          result2.__actions__ = copyArray(this.__actions__);
          result2.__dir__ = this.__dir__;
          result2.__filtered__ = this.__filtered__;
          result2.__iteratees__ = copyArray(this.__iteratees__);
          result2.__takeCount__ = this.__takeCount__;
          result2.__views__ = copyArray(this.__views__);
          return result2;
        }
        function lazyReverse() {
          if (this.__filtered__) {
            var result2 = new LazyWrapper(this);
            result2.__dir__ = -1;
            result2.__filtered__ = true;
          } else {
            result2 = this.clone();
            result2.__dir__ *= -1;
          }
          return result2;
        }
        function lazyValue() {
          var array2 = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray4(array2), isRight = dir < 0, arrLength = isArr ? array2.length : 0, view = getView(0, arrLength, this.__views__), start2 = view.start, end = view.end, length = end - start2, index = isRight ? end : start2 - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
          if (!isArr || !isRight && arrLength == length && takeCount == length) {
            return baseWrapperValue(array2, this.__actions__);
          }
          var result2 = [];
          outer:
            while (length-- && resIndex < takeCount) {
              index += dir;
              var iterIndex = -1, value = array2[index];
              while (++iterIndex < iterLength) {
                var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
                if (type == LAZY_MAP_FLAG) {
                  value = computed;
                } else if (!computed) {
                  if (type == LAZY_FILTER_FLAG) {
                    continue outer;
                  } else {
                    break outer;
                  }
                }
              }
              result2[resIndex++] = value;
            }
          return result2;
        }
        LazyWrapper.prototype = baseCreate(baseLodash.prototype);
        LazyWrapper.prototype.constructor = LazyWrapper;
        function Hash(entries) {
          var index = -1, length = entries == null ? 0 : entries.length;
          this.clear();
          while (++index < length) {
            var entry = entries[index];
            this.set(entry[0], entry[1]);
          }
        }
        function hashClear() {
          this.__data__ = nativeCreate ? nativeCreate(null) : {};
          this.size = 0;
        }
        function hashDelete(key) {
          var result2 = this.has(key) && delete this.__data__[key];
          this.size -= result2 ? 1 : 0;
          return result2;
        }
        function hashGet(key) {
          var data = this.__data__;
          if (nativeCreate) {
            var result2 = data[key];
            return result2 === HASH_UNDEFINED ? undefined2 : result2;
          }
          return hasOwnProperty.call(data, key) ? data[key] : undefined2;
        }
        function hashHas(key) {
          var data = this.__data__;
          return nativeCreate ? data[key] !== undefined2 : hasOwnProperty.call(data, key);
        }
        function hashSet(key, value) {
          var data = this.__data__;
          this.size += this.has(key) ? 0 : 1;
          data[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value;
          return this;
        }
        Hash.prototype.clear = hashClear;
        Hash.prototype["delete"] = hashDelete;
        Hash.prototype.get = hashGet;
        Hash.prototype.has = hashHas;
        Hash.prototype.set = hashSet;
        function ListCache(entries) {
          var index = -1, length = entries == null ? 0 : entries.length;
          this.clear();
          while (++index < length) {
            var entry = entries[index];
            this.set(entry[0], entry[1]);
          }
        }
        function listCacheClear() {
          this.__data__ = [];
          this.size = 0;
        }
        function listCacheDelete(key) {
          var data = this.__data__, index = assocIndexOf(data, key);
          if (index < 0) {
            return false;
          }
          var lastIndex = data.length - 1;
          if (index == lastIndex) {
            data.pop();
          } else {
            splice.call(data, index, 1);
          }
          --this.size;
          return true;
        }
        function listCacheGet(key) {
          var data = this.__data__, index = assocIndexOf(data, key);
          return index < 0 ? undefined2 : data[index][1];
        }
        function listCacheHas(key) {
          return assocIndexOf(this.__data__, key) > -1;
        }
        function listCacheSet(key, value) {
          var data = this.__data__, index = assocIndexOf(data, key);
          if (index < 0) {
            ++this.size;
            data.push([key, value]);
          } else {
            data[index][1] = value;
          }
          return this;
        }
        ListCache.prototype.clear = listCacheClear;
        ListCache.prototype["delete"] = listCacheDelete;
        ListCache.prototype.get = listCacheGet;
        ListCache.prototype.has = listCacheHas;
        ListCache.prototype.set = listCacheSet;
        function MapCache(entries) {
          var index = -1, length = entries == null ? 0 : entries.length;
          this.clear();
          while (++index < length) {
            var entry = entries[index];
            this.set(entry[0], entry[1]);
          }
        }
        function mapCacheClear() {
          this.size = 0;
          this.__data__ = {
            "hash": new Hash(),
            "map": new (Map3 || ListCache)(),
            "string": new Hash()
          };
        }
        function mapCacheDelete(key) {
          var result2 = getMapData(this, key)["delete"](key);
          this.size -= result2 ? 1 : 0;
          return result2;
        }
        function mapCacheGet(key) {
          return getMapData(this, key).get(key);
        }
        function mapCacheHas(key) {
          return getMapData(this, key).has(key);
        }
        function mapCacheSet(key, value) {
          var data = getMapData(this, key), size2 = data.size;
          data.set(key, value);
          this.size += data.size == size2 ? 0 : 1;
          return this;
        }
        MapCache.prototype.clear = mapCacheClear;
        MapCache.prototype["delete"] = mapCacheDelete;
        MapCache.prototype.get = mapCacheGet;
        MapCache.prototype.has = mapCacheHas;
        MapCache.prototype.set = mapCacheSet;
        function SetCache(values2) {
          var index = -1, length = values2 == null ? 0 : values2.length;
          this.__data__ = new MapCache();
          while (++index < length) {
            this.add(values2[index]);
          }
        }
        function setCacheAdd(value) {
          this.__data__.set(value, HASH_UNDEFINED);
          return this;
        }
        function setCacheHas(value) {
          return this.__data__.has(value);
        }
        SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
        SetCache.prototype.has = setCacheHas;
        function Stack(entries) {
          var data = this.__data__ = new ListCache(entries);
          this.size = data.size;
        }
        function stackClear() {
          this.__data__ = new ListCache();
          this.size = 0;
        }
        function stackDelete(key) {
          var data = this.__data__, result2 = data["delete"](key);
          this.size = data.size;
          return result2;
        }
        function stackGet(key) {
          return this.__data__.get(key);
        }
        function stackHas(key) {
          return this.__data__.has(key);
        }
        function stackSet(key, value) {
          var data = this.__data__;
          if (data instanceof ListCache) {
            var pairs = data.__data__;
            if (!Map3 || pairs.length < LARGE_ARRAY_SIZE - 1) {
              pairs.push([key, value]);
              this.size = ++data.size;
              return this;
            }
            data = this.__data__ = new MapCache(pairs);
          }
          data.set(key, value);
          this.size = data.size;
          return this;
        }
        Stack.prototype.clear = stackClear;
        Stack.prototype["delete"] = stackDelete;
        Stack.prototype.get = stackGet;
        Stack.prototype.has = stackHas;
        Stack.prototype.set = stackSet;
        function arrayLikeKeys(value, inherited) {
          var isArr = isArray4(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
          for (var key in value) {
            if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
            (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
            isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
            isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
            isIndex(key, length)))) {
              result2.push(key);
            }
          }
          return result2;
        }
        function arraySample(array2) {
          var length = array2.length;
          return length ? array2[baseRandom(0, length - 1)] : undefined2;
        }
        function arraySampleSize(array2, n) {
          return shuffleSelf(copyArray(array2), baseClamp(n, 0, array2.length));
        }
        function arrayShuffle(array2) {
          return shuffleSelf(copyArray(array2));
        }
        function assignMergeValue(object, key, value) {
          if (value !== undefined2 && !eq2(object[key], value) || value === undefined2 && !(key in object)) {
            baseAssignValue(object, key, value);
          }
        }
        function assignValue(object, key, value) {
          var objValue = object[key];
          if (!(hasOwnProperty.call(object, key) && eq2(objValue, value)) || value === undefined2 && !(key in object)) {
            baseAssignValue(object, key, value);
          }
        }
        function assocIndexOf(array2, key) {
          var length = array2.length;
          while (length--) {
            if (eq2(array2[length][0], key)) {
              return length;
            }
          }
          return -1;
        }
        function baseAggregator(collection, setter, iteratee2, accumulator) {
          baseEach(collection, function(value, key, collection2) {
            setter(accumulator, value, iteratee2(value), collection2);
          });
          return accumulator;
        }
        function baseAssign(object, source) {
          return object && copyObject(source, keys(source), object);
        }
        function baseAssignIn(object, source) {
          return object && copyObject(source, keysIn(source), object);
        }
        function baseAssignValue(object, key, value) {
          if (key == "__proto__" && defineProperty) {
            defineProperty(object, key, {
              "configurable": true,
              "enumerable": true,
              "value": value,
              "writable": true
            });
          } else {
            object[key] = value;
          }
        }
        function baseAt(object, paths) {
          var index = -1, length = paths.length, result2 = Array2(length), skip2 = object == null;
          while (++index < length) {
            result2[index] = skip2 ? undefined2 : get8(object, paths[index]);
          }
          return result2;
        }
        function baseClamp(number2, lower, upper) {
          if (number2 === number2) {
            if (upper !== undefined2) {
              number2 = number2 <= upper ? number2 : upper;
            }
            if (lower !== undefined2) {
              number2 = number2 >= lower ? number2 : lower;
            }
          }
          return number2;
        }
        function baseClone(value, bitmask, customizer, key, object, stack) {
          var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
          if (customizer) {
            result2 = object ? customizer(value, key, object, stack) : customizer(value);
          }
          if (result2 !== undefined2) {
            return result2;
          }
          if (!isObject2(value)) {
            return value;
          }
          var isArr = isArray4(value);
          if (isArr) {
            result2 = initCloneArray(value);
            if (!isDeep) {
              return copyArray(value, result2);
            }
          } else {
            var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
            if (isBuffer(value)) {
              return cloneBuffer(value, isDeep);
            }
            if (tag == objectTag || tag == argsTag || isFunc && !object) {
              result2 = isFlat || isFunc ? {} : initCloneObject(value);
              if (!isDeep) {
                return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
              }
            } else {
              if (!cloneableTags[tag]) {
                return object ? value : {};
              }
              result2 = initCloneByTag(value, tag, isDeep);
            }
          }
          stack || (stack = new Stack());
          var stacked = stack.get(value);
          if (stacked) {
            return stacked;
          }
          stack.set(value, result2);
          if (isSet(value)) {
            value.forEach(function(subValue) {
              result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
            });
          } else if (isMap(value)) {
            value.forEach(function(subValue, key2) {
              result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
            });
          }
          var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
          var props = isArr ? undefined2 : keysFunc(value);
          arrayEach(props || value, function(subValue, key2) {
            if (props) {
              key2 = subValue;
              subValue = value[key2];
            }
            assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
          });
          return result2;
        }
        function baseConforms(source) {
          var props = keys(source);
          return function(object) {
            return baseConformsTo(object, source, props);
          };
        }
        function baseConformsTo(object, source, props) {
          var length = props.length;
          if (object == null) {
            return !length;
          }
          object = Object2(object);
          while (length--) {
            var key = props[length], predicate = source[key], value = object[key];
            if (value === undefined2 && !(key in object) || !predicate(value)) {
              return false;
            }
          }
          return true;
        }
        function baseDelay(func, wait, args) {
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          return setTimeout2(function() {
            func.apply(undefined2, args);
          }, wait);
        }
        function baseDifference(array2, values2, iteratee2, comparator) {
          var index = -1, includes3 = arrayIncludes, isCommon = true, length = array2.length, result2 = [], valuesLength = values2.length;
          if (!length) {
            return result2;
          }
          if (iteratee2) {
            values2 = arrayMap(values2, baseUnary(iteratee2));
          }
          if (comparator) {
            includes3 = arrayIncludesWith;
            isCommon = false;
          } else if (values2.length >= LARGE_ARRAY_SIZE) {
            includes3 = cacheHas;
            isCommon = false;
            values2 = new SetCache(values2);
          }
          outer:
            while (++index < length) {
              var value = array2[index], computed = iteratee2 == null ? value : iteratee2(value);
              value = comparator || value !== 0 ? value : 0;
              if (isCommon && computed === computed) {
                var valuesIndex = valuesLength;
                while (valuesIndex--) {
                  if (values2[valuesIndex] === computed) {
                    continue outer;
                  }
                }
                result2.push(value);
              } else if (!includes3(values2, computed, comparator)) {
                result2.push(value);
              }
            }
          return result2;
        }
        var baseEach = createBaseEach(baseForOwn);
        var baseEachRight = createBaseEach(baseForOwnRight, true);
        function baseEvery(collection, predicate) {
          var result2 = true;
          baseEach(collection, function(value, index, collection2) {
            result2 = !!predicate(value, index, collection2);
            return result2;
          });
          return result2;
        }
        function baseExtremum(array2, iteratee2, comparator) {
          var index = -1, length = array2.length;
          while (++index < length) {
            var value = array2[index], current = iteratee2(value);
            if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) {
              var computed = current, result2 = value;
            }
          }
          return result2;
        }
        function baseFill(array2, value, start2, end) {
          var length = array2.length;
          start2 = toInteger2(start2);
          if (start2 < 0) {
            start2 = -start2 > length ? 0 : length + start2;
          }
          end = end === undefined2 || end > length ? length : toInteger2(end);
          if (end < 0) {
            end += length;
          }
          end = start2 > end ? 0 : toLength(end);
          while (start2 < end) {
            array2[start2++] = value;
          }
          return array2;
        }
        function baseFilter(collection, predicate) {
          var result2 = [];
          baseEach(collection, function(value, index, collection2) {
            if (predicate(value, index, collection2)) {
              result2.push(value);
            }
          });
          return result2;
        }
        function baseFlatten(array2, depth, predicate, isStrict, result2) {
          var index = -1, length = array2.length;
          predicate || (predicate = isFlattenable);
          result2 || (result2 = []);
          while (++index < length) {
            var value = array2[index];
            if (depth > 0 && predicate(value)) {
              if (depth > 1) {
                baseFlatten(value, depth - 1, predicate, isStrict, result2);
              } else {
                arrayPush(result2, value);
              }
            } else if (!isStrict) {
              result2[result2.length] = value;
            }
          }
          return result2;
        }
        var baseFor = createBaseFor();
        var baseForRight = createBaseFor(true);
        function baseForOwn(object, iteratee2) {
          return object && baseFor(object, iteratee2, keys);
        }
        function baseForOwnRight(object, iteratee2) {
          return object && baseForRight(object, iteratee2, keys);
        }
        function baseFunctions(object, props) {
          return arrayFilter(props, function(key) {
            return isFunction5(object[key]);
          });
        }
        function baseGet(object, path) {
          path = castPath(path, object);
          var index = 0, length = path.length;
          while (object != null && index < length) {
            object = object[toKey(path[index++])];
          }
          return index && index == length ? object : undefined2;
        }
        function baseGetAllKeys(object, keysFunc, symbolsFunc) {
          var result2 = keysFunc(object);
          return isArray4(object) ? result2 : arrayPush(result2, symbolsFunc(object));
        }
        function baseGetTag(value) {
          if (value == null) {
            return value === undefined2 ? undefinedTag : nullTag;
          }
          return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
        }
        function baseGt(value, other) {
          return value > other;
        }
        function baseHas(object, key) {
          return object != null && hasOwnProperty.call(object, key);
        }
        function baseHasIn(object, key) {
          return object != null && key in Object2(object);
        }
        function baseInRange(number2, start2, end) {
          return number2 >= nativeMin(start2, end) && number2 < nativeMax(start2, end);
        }
        function baseIntersection(arrays, iteratee2, comparator) {
          var includes3 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
          while (othIndex--) {
            var array2 = arrays[othIndex];
            if (othIndex && iteratee2) {
              array2 = arrayMap(array2, baseUnary(iteratee2));
            }
            maxLength = nativeMin(array2.length, maxLength);
            caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array2.length >= 120) ? new SetCache(othIndex && array2) : undefined2;
          }
          array2 = arrays[0];
          var index = -1, seen = caches[0];
          outer:
            while (++index < length && result2.length < maxLength) {
              var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
              value = comparator || value !== 0 ? value : 0;
              if (!(seen ? cacheHas(seen, computed) : includes3(result2, computed, comparator))) {
                othIndex = othLength;
                while (--othIndex) {
                  var cache2 = caches[othIndex];
                  if (!(cache2 ? cacheHas(cache2, computed) : includes3(arrays[othIndex], computed, comparator))) {
                    continue outer;
                  }
                }
                if (seen) {
                  seen.push(computed);
                }
                result2.push(value);
              }
            }
          return result2;
        }
        function baseInverter(object, setter, iteratee2, accumulator) {
          baseForOwn(object, function(value, key, object2) {
            setter(accumulator, iteratee2(value), key, object2);
          });
          return accumulator;
        }
        function baseInvoke(object, path, args) {
          path = castPath(path, object);
          object = parent(object, path);
          var func = object == null ? object : object[toKey(last2(path))];
          return func == null ? undefined2 : apply2(func, object, args);
        }
        function baseIsArguments(value) {
          return isObjectLike(value) && baseGetTag(value) == argsTag;
        }
        function baseIsArrayBuffer(value) {
          return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
        }
        function baseIsDate(value) {
          return isObjectLike(value) && baseGetTag(value) == dateTag;
        }
        function baseIsEqual(value, other, bitmask, customizer, stack) {
          if (value === other) {
            return true;
          }
          if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
            return value !== value && other !== other;
          }
          return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
        }
        function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
          var objIsArr = isArray4(object), othIsArr = isArray4(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
          objTag = objTag == argsTag ? objectTag : objTag;
          othTag = othTag == argsTag ? objectTag : othTag;
          var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
          if (isSameTag && isBuffer(object)) {
            if (!isBuffer(other)) {
              return false;
            }
            objIsArr = true;
            objIsObj = false;
          }
          if (isSameTag && !objIsObj) {
            stack || (stack = new Stack());
            return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
          }
          if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
            var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
            if (objIsWrapped || othIsWrapped) {
              var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
              stack || (stack = new Stack());
              return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
            }
          }
          if (!isSameTag) {
            return false;
          }
          stack || (stack = new Stack());
          return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
        }
        function baseIsMap(value) {
          return isObjectLike(value) && getTag(value) == mapTag;
        }
        function baseIsMatch(object, source, matchData, customizer) {
          var index = matchData.length, length = index, noCustomizer = !customizer;
          if (object == null) {
            return !length;
          }
          object = Object2(object);
          while (index--) {
            var data = matchData[index];
            if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
              return false;
            }
          }
          while (++index < length) {
            data = matchData[index];
            var key = data[0], objValue = object[key], srcValue = data[1];
            if (noCustomizer && data[2]) {
              if (objValue === undefined2 && !(key in object)) {
                return false;
              }
            } else {
              var stack = new Stack();
              if (customizer) {
                var result2 = customizer(objValue, srcValue, key, object, source, stack);
              }
              if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
                return false;
              }
            }
          }
          return true;
        }
        function baseIsNative(value) {
          if (!isObject2(value) || isMasked(value)) {
            return false;
          }
          var pattern = isFunction5(value) ? reIsNative : reIsHostCtor;
          return pattern.test(toSource(value));
        }
        function baseIsRegExp(value) {
          return isObjectLike(value) && baseGetTag(value) == regexpTag;
        }
        function baseIsSet(value) {
          return isObjectLike(value) && getTag(value) == setTag;
        }
        function baseIsTypedArray(value) {
          return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
        }
        function baseIteratee(value) {
          if (typeof value == "function") {
            return value;
          }
          if (value == null) {
            return identity3;
          }
          if (typeof value == "object") {
            return isArray4(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
          }
          return property(value);
        }
        function baseKeys(object) {
          if (!isPrototype(object)) {
            return nativeKeys(object);
          }
          var result2 = [];
          for (var key in Object2(object)) {
            if (hasOwnProperty.call(object, key) && key != "constructor") {
              result2.push(key);
            }
          }
          return result2;
        }
        function baseKeysIn(object) {
          if (!isObject2(object)) {
            return nativeKeysIn(object);
          }
          var isProto = isPrototype(object), result2 = [];
          for (var key in object) {
            if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
              result2.push(key);
            }
          }
          return result2;
        }
        function baseLt(value, other) {
          return value < other;
        }
        function baseMap(collection, iteratee2) {
          var index = -1, result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
          baseEach(collection, function(value, key, collection2) {
            result2[++index] = iteratee2(value, key, collection2);
          });
          return result2;
        }
        function baseMatches(source) {
          var matchData = getMatchData(source);
          if (matchData.length == 1 && matchData[0][2]) {
            return matchesStrictComparable(matchData[0][0], matchData[0][1]);
          }
          return function(object) {
            return object === source || baseIsMatch(object, source, matchData);
          };
        }
        function baseMatchesProperty(path, srcValue) {
          if (isKey(path) && isStrictComparable(srcValue)) {
            return matchesStrictComparable(toKey(path), srcValue);
          }
          return function(object) {
            var objValue = get8(object, path);
            return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
          };
        }
        function baseMerge(object, source, srcIndex, customizer, stack) {
          if (object === source) {
            return;
          }
          baseFor(source, function(srcValue, key) {
            stack || (stack = new Stack());
            if (isObject2(srcValue)) {
              baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
            } else {
              var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
              if (newValue === undefined2) {
                newValue = srcValue;
              }
              assignMergeValue(object, key, newValue);
            }
          }, keysIn);
        }
        function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
          var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
          if (stacked) {
            assignMergeValue(object, key, stacked);
            return;
          }
          var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2;
          var isCommon = newValue === undefined2;
          if (isCommon) {
            var isArr = isArray4(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
            newValue = srcValue;
            if (isArr || isBuff || isTyped) {
              if (isArray4(objValue)) {
                newValue = objValue;
              } else if (isArrayLikeObject(objValue)) {
                newValue = copyArray(objValue);
              } else if (isBuff) {
                isCommon = false;
                newValue = cloneBuffer(srcValue, true);
              } else if (isTyped) {
                isCommon = false;
                newValue = cloneTypedArray(srcValue, true);
              } else {
                newValue = [];
              }
            } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
              newValue = objValue;
              if (isArguments(objValue)) {
                newValue = toPlainObject(objValue);
              } else if (!isObject2(objValue) || isFunction5(objValue)) {
                newValue = initCloneObject(srcValue);
              }
            } else {
              isCommon = false;
            }
          }
          if (isCommon) {
            stack.set(srcValue, newValue);
            mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
            stack["delete"](srcValue);
          }
          assignMergeValue(object, key, newValue);
        }
        function baseNth(array2, n) {
          var length = array2.length;
          if (!length) {
            return;
          }
          n += n < 0 ? length : 0;
          return isIndex(n, length) ? array2[n] : undefined2;
        }
        function baseOrderBy(collection, iteratees, orders) {
          if (iteratees.length) {
            iteratees = arrayMap(iteratees, function(iteratee2) {
              if (isArray4(iteratee2)) {
                return function(value) {
                  return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
                };
              }
              return iteratee2;
            });
          } else {
            iteratees = [identity3];
          }
          var index = -1;
          iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
          var result2 = baseMap(collection, function(value, key, collection2) {
            var criteria = arrayMap(iteratees, function(iteratee2) {
              return iteratee2(value);
            });
            return { "criteria": criteria, "index": ++index, "value": value };
          });
          return baseSortBy(result2, function(object, other) {
            return compareMultiple(object, other, orders);
          });
        }
        function basePick(object, paths) {
          return basePickBy(object, paths, function(value, path) {
            return hasIn(object, path);
          });
        }
        function basePickBy(object, paths, predicate) {
          var index = -1, length = paths.length, result2 = {};
          while (++index < length) {
            var path = paths[index], value = baseGet(object, path);
            if (predicate(value, path)) {
              baseSet(result2, castPath(path, object), value);
            }
          }
          return result2;
        }
        function basePropertyDeep(path) {
          return function(object) {
            return baseGet(object, path);
          };
        }
        function basePullAll(array2, values2, iteratee2, comparator) {
          var indexOf3 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array2;
          if (array2 === values2) {
            values2 = copyArray(values2);
          }
          if (iteratee2) {
            seen = arrayMap(array2, baseUnary(iteratee2));
          }
          while (++index < length) {
            var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
            while ((fromIndex = indexOf3(seen, computed, fromIndex, comparator)) > -1) {
              if (seen !== array2) {
                splice.call(seen, fromIndex, 1);
              }
              splice.call(array2, fromIndex, 1);
            }
          }
          return array2;
        }
        function basePullAt(array2, indexes) {
          var length = array2 ? indexes.length : 0, lastIndex = length - 1;
          while (length--) {
            var index = indexes[length];
            if (length == lastIndex || index !== previous) {
              var previous = index;
              if (isIndex(index)) {
                splice.call(array2, index, 1);
              } else {
                baseUnset(array2, index);
              }
            }
          }
          return array2;
        }
        function baseRandom(lower, upper) {
          return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
        }
        function baseRange(start2, end, step, fromRight) {
          var index = -1, length = nativeMax(nativeCeil((end - start2) / (step || 1)), 0), result2 = Array2(length);
          while (length--) {
            result2[fromRight ? length : ++index] = start2;
            start2 += step;
          }
          return result2;
        }
        function baseRepeat(string, n) {
          var result2 = "";
          if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
            return result2;
          }
          do {
            if (n % 2) {
              result2 += string;
            }
            n = nativeFloor(n / 2);
            if (n) {
              string += string;
            }
          } while (n);
          return result2;
        }
        function baseRest(func, start2) {
          return setToString(overRest(func, start2, identity3), func + "");
        }
        function baseSample(collection) {
          return arraySample(values(collection));
        }
        function baseSampleSize(collection, n) {
          var array2 = values(collection);
          return shuffleSelf(array2, baseClamp(n, 0, array2.length));
        }
        function baseSet(object, path, value, customizer) {
          if (!isObject2(object)) {
            return object;
          }
          path = castPath(path, object);
          var index = -1, length = path.length, lastIndex = length - 1, nested = object;
          while (nested != null && ++index < length) {
            var key = toKey(path[index]), newValue = value;
            if (key === "__proto__" || key === "constructor" || key === "prototype") {
              return object;
            }
            if (index != lastIndex) {
              var objValue = nested[key];
              newValue = customizer ? customizer(objValue, key, nested) : undefined2;
              if (newValue === undefined2) {
                newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
              }
            }
            assignValue(nested, key, newValue);
            nested = nested[key];
          }
          return object;
        }
        var baseSetData = !metaMap ? identity3 : function(func, data) {
          metaMap.set(func, data);
          return func;
        };
        var baseSetToString = !defineProperty ? identity3 : function(func, string) {
          return defineProperty(func, "toString", {
            "configurable": true,
            "enumerable": false,
            "value": constant(string),
            "writable": true
          });
        };
        function baseShuffle(collection) {
          return shuffleSelf(values(collection));
        }
        function baseSlice(array2, start2, end) {
          var index = -1, length = array2.length;
          if (start2 < 0) {
            start2 = -start2 > length ? 0 : length + start2;
          }
          end = end > length ? length : end;
          if (end < 0) {
            end += length;
          }
          length = start2 > end ? 0 : end - start2 >>> 0;
          start2 >>>= 0;
          var result2 = Array2(length);
          while (++index < length) {
            result2[index] = array2[index + start2];
          }
          return result2;
        }
        function baseSome(collection, predicate) {
          var result2;
          baseEach(collection, function(value, index, collection2) {
            result2 = predicate(value, index, collection2);
            return !result2;
          });
          return !!result2;
        }
        function baseSortedIndex(array2, value, retHighest) {
          var low = 0, high = array2 == null ? low : array2.length;
          if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
            while (low < high) {
              var mid = low + high >>> 1, computed = array2[mid];
              if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
                low = mid + 1;
              } else {
                high = mid;
              }
            }
            return high;
          }
          return baseSortedIndexBy(array2, value, identity3, retHighest);
        }
        function baseSortedIndexBy(array2, value, iteratee2, retHighest) {
          var low = 0, high = array2 == null ? 0 : array2.length;
          if (high === 0) {
            return 0;
          }
          value = iteratee2(value);
          var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2;
          while (low < high) {
            var mid = nativeFloor((low + high) / 2), computed = iteratee2(array2[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
            if (valIsNaN) {
              var setLow = retHighest || othIsReflexive;
            } else if (valIsUndefined) {
              setLow = othIsReflexive && (retHighest || othIsDefined);
            } else if (valIsNull) {
              setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
            } else if (valIsSymbol) {
              setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
            } else if (othIsNull || othIsSymbol) {
              setLow = false;
            } else {
              setLow = retHighest ? computed <= value : computed < value;
            }
            if (setLow) {
              low = mid + 1;
            } else {
              high = mid;
            }
          }
          return nativeMin(high, MAX_ARRAY_INDEX);
        }
        function baseSortedUniq(array2, iteratee2) {
          var index = -1, length = array2.length, resIndex = 0, result2 = [];
          while (++index < length) {
            var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
            if (!index || !eq2(computed, seen)) {
              var seen = computed;
              result2[resIndex++] = value === 0 ? 0 : value;
            }
          }
          return result2;
        }
        function baseToNumber(value) {
          if (typeof value == "number") {
            return value;
          }
          if (isSymbol(value)) {
            return NAN;
          }
          return +value;
        }
        function baseToString(value) {
          if (typeof value == "string") {
            return value;
          }
          if (isArray4(value)) {
            return arrayMap(value, baseToString) + "";
          }
          if (isSymbol(value)) {
            return symbolToString ? symbolToString.call(value) : "";
          }
          var result2 = value + "";
          return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
        }
        function baseUniq(array2, iteratee2, comparator) {
          var index = -1, includes3 = arrayIncludes, length = array2.length, isCommon = true, result2 = [], seen = result2;
          if (comparator) {
            isCommon = false;
            includes3 = arrayIncludesWith;
          } else if (length >= LARGE_ARRAY_SIZE) {
            var set3 = iteratee2 ? null : createSet(array2);
            if (set3) {
              return setToArray(set3);
            }
            isCommon = false;
            includes3 = cacheHas;
            seen = new SetCache();
          } else {
            seen = iteratee2 ? [] : result2;
          }
          outer:
            while (++index < length) {
              var value = array2[index], computed = iteratee2 ? iteratee2(value) : value;
              value = comparator || value !== 0 ? value : 0;
              if (isCommon && computed === computed) {
                var seenIndex = seen.length;
                while (seenIndex--) {
                  if (seen[seenIndex] === computed) {
                    continue outer;
                  }
                }
                if (iteratee2) {
                  seen.push(computed);
                }
                result2.push(value);
              } else if (!includes3(seen, computed, comparator)) {
                if (seen !== result2) {
                  seen.push(computed);
                }
                result2.push(value);
              }
            }
          return result2;
        }
        function baseUnset(object, path) {
          path = castPath(path, object);
          object = parent(object, path);
          return object == null || delete object[toKey(last2(path))];
        }
        function baseUpdate(object, path, updater, customizer) {
          return baseSet(object, path, updater(baseGet(object, path)), customizer);
        }
        function baseWhile(array2, predicate, isDrop, fromRight) {
          var length = array2.length, index = fromRight ? length : -1;
          while ((fromRight ? index-- : ++index < length) && predicate(array2[index], index, array2)) {
          }
          return isDrop ? baseSlice(array2, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array2, fromRight ? index + 1 : 0, fromRight ? length : index);
        }
        function baseWrapperValue(value, actions) {
          var result2 = value;
          if (result2 instanceof LazyWrapper) {
            result2 = result2.value();
          }
          return arrayReduce(actions, function(result3, action) {
            return action.func.apply(action.thisArg, arrayPush([result3], action.args));
          }, result2);
        }
        function baseXor(arrays, iteratee2, comparator) {
          var length = arrays.length;
          if (length < 2) {
            return length ? baseUniq(arrays[0]) : [];
          }
          var index = -1, result2 = Array2(length);
          while (++index < length) {
            var array2 = arrays[index], othIndex = -1;
            while (++othIndex < length) {
              if (othIndex != index) {
                result2[index] = baseDifference(result2[index] || array2, arrays[othIndex], iteratee2, comparator);
              }
            }
          }
          return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
        }
        function baseZipObject(props, values2, assignFunc) {
          var index = -1, length = props.length, valsLength = values2.length, result2 = {};
          while (++index < length) {
            var value = index < valsLength ? values2[index] : undefined2;
            assignFunc(result2, props[index], value);
          }
          return result2;
        }
        function castArrayLikeObject(value) {
          return isArrayLikeObject(value) ? value : [];
        }
        function castFunction(value) {
          return typeof value == "function" ? value : identity3;
        }
        function castPath(value, object) {
          if (isArray4(value)) {
            return value;
          }
          return isKey(value, object) ? [value] : stringToPath(toString7(value));
        }
        var castRest = baseRest;
        function castSlice(array2, start2, end) {
          var length = array2.length;
          end = end === undefined2 ? length : end;
          return !start2 && end >= length ? array2 : baseSlice(array2, start2, end);
        }
        var clearTimeout2 = ctxClearTimeout || function(id2) {
          return root.clearTimeout(id2);
        };
        function cloneBuffer(buffer3, isDeep) {
          if (isDeep) {
            return buffer3.slice();
          }
          var length = buffer3.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer3.constructor(length);
          buffer3.copy(result2);
          return result2;
        }
        function cloneArrayBuffer(arrayBuffer) {
          var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
          new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
          return result2;
        }
        function cloneDataView(dataView, isDeep) {
          var buffer3 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
          return new dataView.constructor(buffer3, dataView.byteOffset, dataView.byteLength);
        }
        function cloneRegExp(regexp) {
          var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
          result2.lastIndex = regexp.lastIndex;
          return result2;
        }
        function cloneSymbol(symbol) {
          return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
        }
        function cloneTypedArray(typedArray, isDeep) {
          var buffer3 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
          return new typedArray.constructor(buffer3, typedArray.byteOffset, typedArray.length);
        }
        function compareAscending(value, other) {
          if (value !== other) {
            var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
            var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
            if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
              return 1;
            }
            if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
              return -1;
            }
          }
          return 0;
        }
        function compareMultiple(object, other, orders) {
          var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
          while (++index < length) {
            var result2 = compareAscending(objCriteria[index], othCriteria[index]);
            if (result2) {
              if (index >= ordersLength) {
                return result2;
              }
              var order = orders[index];
              return result2 * (order == "desc" ? -1 : 1);
            }
          }
          return object.index - other.index;
        }
        function composeArgs(args, partials, holders, isCurried) {
          var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
          while (++leftIndex < leftLength) {
            result2[leftIndex] = partials[leftIndex];
          }
          while (++argsIndex < holdersLength) {
            if (isUncurried || argsIndex < argsLength) {
              result2[holders[argsIndex]] = args[argsIndex];
            }
          }
          while (rangeLength--) {
            result2[leftIndex++] = args[argsIndex++];
          }
          return result2;
        }
        function composeArgsRight(args, partials, holders, isCurried) {
          var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
          while (++argsIndex < rangeLength) {
            result2[argsIndex] = args[argsIndex];
          }
          var offset2 = argsIndex;
          while (++rightIndex < rightLength) {
            result2[offset2 + rightIndex] = partials[rightIndex];
          }
          while (++holdersIndex < holdersLength) {
            if (isUncurried || argsIndex < argsLength) {
              result2[offset2 + holders[holdersIndex]] = args[argsIndex++];
            }
          }
          return result2;
        }
        function copyArray(source, array2) {
          var index = -1, length = source.length;
          array2 || (array2 = Array2(length));
          while (++index < length) {
            array2[index] = source[index];
          }
          return array2;
        }
        function copyObject(source, props, object, customizer) {
          var isNew = !object;
          object || (object = {});
          var index = -1, length = props.length;
          while (++index < length) {
            var key = props[index];
            var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2;
            if (newValue === undefined2) {
              newValue = source[key];
            }
            if (isNew) {
              baseAssignValue(object, key, newValue);
            } else {
              assignValue(object, key, newValue);
            }
          }
          return object;
        }
        function copySymbols(source, object) {
          return copyObject(source, getSymbols(source), object);
        }
        function copySymbolsIn(source, object) {
          return copyObject(source, getSymbolsIn(source), object);
        }
        function createAggregator(setter, initializer) {
          return function(collection, iteratee2) {
            var func = isArray4(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
            return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
          };
        }
        function createAssigner(assigner) {
          return baseRest(function(object, sources) {
            var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2;
            customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2;
            if (guard && isIterateeCall(sources[0], sources[1], guard)) {
              customizer = length < 3 ? undefined2 : customizer;
              length = 1;
            }
            object = Object2(object);
            while (++index < length) {
              var source = sources[index];
              if (source) {
                assigner(object, source, index, customizer);
              }
            }
            return object;
          });
        }
        function createBaseEach(eachFunc, fromRight) {
          return function(collection, iteratee2) {
            if (collection == null) {
              return collection;
            }
            if (!isArrayLike2(collection)) {
              return eachFunc(collection, iteratee2);
            }
            var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
            while (fromRight ? index-- : ++index < length) {
              if (iteratee2(iterable[index], index, iterable) === false) {
                break;
              }
            }
            return collection;
          };
        }
        function createBaseFor(fromRight) {
          return function(object, iteratee2, keysFunc) {
            var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
            while (length--) {
              var key = props[fromRight ? length : ++index];
              if (iteratee2(iterable[key], key, iterable) === false) {
                break;
              }
            }
            return object;
          };
        }
        function createBind(func, bitmask, thisArg) {
          var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
          function wrapper() {
            var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
            return fn.apply(isBind ? thisArg : this, arguments);
          }
          return wrapper;
        }
        function createCaseFirst(methodName) {
          return function(string) {
            string = toString7(string);
            var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2;
            var chr = strSymbols ? strSymbols[0] : string.charAt(0);
            var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
            return chr[methodName]() + trailing;
          };
        }
        function createCompounder(callback) {
          return function(string) {
            return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
          };
        }
        function createCtor(Ctor) {
          return function() {
            var args = arguments;
            switch (args.length) {
              case 0:
                return new Ctor();
              case 1:
                return new Ctor(args[0]);
              case 2:
                return new Ctor(args[0], args[1]);
              case 3:
                return new Ctor(args[0], args[1], args[2]);
              case 4:
                return new Ctor(args[0], args[1], args[2], args[3]);
              case 5:
                return new Ctor(args[0], args[1], args[2], args[3], args[4]);
              case 6:
                return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
              case 7:
                return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
            }
            var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
            return isObject2(result2) ? result2 : thisBinding;
          };
        }
        function createCurry(func, bitmask, arity) {
          var Ctor = createCtor(func);
          function wrapper() {
            var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
            while (index--) {
              args[index] = arguments[index];
            }
            var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
            length -= holders.length;
            if (length < arity) {
              return createRecurry(
                func,
                bitmask,
                createHybrid,
                wrapper.placeholder,
                undefined2,
                args,
                holders,
                undefined2,
                undefined2,
                arity - length
              );
            }
            var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
            return apply2(fn, this, args);
          }
          return wrapper;
        }
        function createFind(findIndexFunc) {
          return function(collection, predicate, fromIndex) {
            var iterable = Object2(collection);
            if (!isArrayLike2(collection)) {
              var iteratee2 = getIteratee(predicate, 3);
              collection = keys(collection);
              predicate = function(key) {
                return iteratee2(iterable[key], key, iterable);
              };
            }
            var index = findIndexFunc(collection, predicate, fromIndex);
            return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2;
          };
        }
        function createFlow(fromRight) {
          return flatRest(function(funcs) {
            var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
            if (fromRight) {
              funcs.reverse();
            }
            while (index--) {
              var func = funcs[index];
              if (typeof func != "function") {
                throw new TypeError2(FUNC_ERROR_TEXT);
              }
              if (prereq && !wrapper && getFuncName(func) == "wrapper") {
                var wrapper = new LodashWrapper([], true);
              }
            }
            index = wrapper ? index : length;
            while (++index < length) {
              func = funcs[index];
              var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2;
              if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
                wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
              } else {
                wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
              }
            }
            return function() {
              var args = arguments, value = args[0];
              if (wrapper && args.length == 1 && isArray4(value)) {
                return wrapper.plant(value).value();
              }
              var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
              while (++index2 < length) {
                result2 = funcs[index2].call(this, result2);
              }
              return result2;
            };
          });
        }
        function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
          var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func);
          function wrapper() {
            var length = arguments.length, args = Array2(length), index = length;
            while (index--) {
              args[index] = arguments[index];
            }
            if (isCurried) {
              var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
            }
            if (partials) {
              args = composeArgs(args, partials, holders, isCurried);
            }
            if (partialsRight) {
              args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
            }
            length -= holdersCount;
            if (isCurried && length < arity) {
              var newHolders = replaceHolders(args, placeholder);
              return createRecurry(
                func,
                bitmask,
                createHybrid,
                wrapper.placeholder,
                thisArg,
                args,
                newHolders,
                argPos,
                ary2,
                arity - length
              );
            }
            var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
            length = args.length;
            if (argPos) {
              args = reorder(args, argPos);
            } else if (isFlip && length > 1) {
              args.reverse();
            }
            if (isAry && ary2 < length) {
              args.length = ary2;
            }
            if (this && this !== root && this instanceof wrapper) {
              fn = Ctor || createCtor(fn);
            }
            return fn.apply(thisBinding, args);
          }
          return wrapper;
        }
        function createInverter(setter, toIteratee) {
          return function(object, iteratee2) {
            return baseInverter(object, setter, toIteratee(iteratee2), {});
          };
        }
        function createMathOperation(operator, defaultValue) {
          return function(value, other) {
            var result2;
            if (value === undefined2 && other === undefined2) {
              return defaultValue;
            }
            if (value !== undefined2) {
              result2 = value;
            }
            if (other !== undefined2) {
              if (result2 === undefined2) {
                return other;
              }
              if (typeof value == "string" || typeof other == "string") {
                value = baseToString(value);
                other = baseToString(other);
              } else {
                value = baseToNumber(value);
                other = baseToNumber(other);
              }
              result2 = operator(value, other);
            }
            return result2;
          };
        }
        function createOver(arrayFunc) {
          return flatRest(function(iteratees) {
            iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
            return baseRest(function(args) {
              var thisArg = this;
              return arrayFunc(iteratees, function(iteratee2) {
                return apply2(iteratee2, thisArg, args);
              });
            });
          });
        }
        function createPadding(length, chars) {
          chars = chars === undefined2 ? " " : baseToString(chars);
          var charsLength = chars.length;
          if (charsLength < 2) {
            return charsLength ? baseRepeat(chars, length) : chars;
          }
          var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
          return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
        }
        function createPartial(func, bitmask, thisArg, partials) {
          var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
          function wrapper() {
            var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
            while (++leftIndex < leftLength) {
              args[leftIndex] = partials[leftIndex];
            }
            while (argsLength--) {
              args[leftIndex++] = arguments[++argsIndex];
            }
            return apply2(fn, isBind ? thisArg : this, args);
          }
          return wrapper;
        }
        function createRange(fromRight) {
          return function(start2, end, step) {
            if (step && typeof step != "number" && isIterateeCall(start2, end, step)) {
              end = step = undefined2;
            }
            start2 = toFinite(start2);
            if (end === undefined2) {
              end = start2;
              start2 = 0;
            } else {
              end = toFinite(end);
            }
            step = step === undefined2 ? start2 < end ? 1 : -1 : toFinite(step);
            return baseRange(start2, end, step, fromRight);
          };
        }
        function createRelationalOperation(operator) {
          return function(value, other) {
            if (!(typeof value == "string" && typeof other == "string")) {
              value = toNumber(value);
              other = toNumber(other);
            }
            return operator(value, other);
          };
        }
        function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
          var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials;
          bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
          bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
          if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
            bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
          }
          var newData = [
            func,
            bitmask,
            thisArg,
            newPartials,
            newHolders,
            newPartialsRight,
            newHoldersRight,
            argPos,
            ary2,
            arity
          ];
          var result2 = wrapFunc.apply(undefined2, newData);
          if (isLaziable(func)) {
            setData(result2, newData);
          }
          result2.placeholder = placeholder;
          return setWrapToString(result2, func, bitmask);
        }
        function createRound(methodName) {
          var func = Math2[methodName];
          return function(number2, precision) {
            number2 = toNumber(number2);
            precision = precision == null ? 0 : nativeMin(toInteger2(precision), 292);
            if (precision && nativeIsFinite(number2)) {
              var pair = (toString7(number2) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
              pair = (toString7(value) + "e").split("e");
              return +(pair[0] + "e" + (+pair[1] - precision));
            }
            return func(number2);
          };
        }
        var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop5 : function(values2) {
          return new Set2(values2);
        };
        function createToPairs(keysFunc) {
          return function(object) {
            var tag = getTag(object);
            if (tag == mapTag) {
              return mapToArray(object);
            }
            if (tag == setTag) {
              return setToPairs(object);
            }
            return baseToPairs(object, keysFunc(object));
          };
        }
        function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
          var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
          if (!isBindKey && typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          var length = partials ? partials.length : 0;
          if (!length) {
            bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
            partials = holders = undefined2;
          }
          ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger2(ary2), 0);
          arity = arity === undefined2 ? arity : toInteger2(arity);
          length -= holders ? holders.length : 0;
          if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
            var partialsRight = partials, holdersRight = holders;
            partials = holders = undefined2;
          }
          var data = isBindKey ? undefined2 : getData(func);
          var newData = [
            func,
            bitmask,
            thisArg,
            partials,
            holders,
            partialsRight,
            holdersRight,
            argPos,
            ary2,
            arity
          ];
          if (data) {
            mergeData(newData, data);
          }
          func = newData[0];
          bitmask = newData[1];
          thisArg = newData[2];
          partials = newData[3];
          holders = newData[4];
          arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
          if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
            bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
          }
          if (!bitmask || bitmask == WRAP_BIND_FLAG) {
            var result2 = createBind(func, bitmask, thisArg);
          } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
            result2 = createCurry(func, bitmask, arity);
          } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
            result2 = createPartial(func, bitmask, thisArg, partials);
          } else {
            result2 = createHybrid.apply(undefined2, newData);
          }
          var setter = data ? baseSetData : setData;
          return setWrapToString(setter(result2, newData), func, bitmask);
        }
        function customDefaultsAssignIn(objValue, srcValue, key, object) {
          if (objValue === undefined2 || eq2(objValue, objectProto2[key]) && !hasOwnProperty.call(object, key)) {
            return srcValue;
          }
          return objValue;
        }
        function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
          if (isObject2(objValue) && isObject2(srcValue)) {
            stack.set(srcValue, objValue);
            baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
            stack["delete"](srcValue);
          }
          return objValue;
        }
        function customOmitClone(value) {
          return isPlainObject(value) ? undefined2 : value;
        }
        function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
          if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
            return false;
          }
          var arrStacked = stack.get(array2);
          var othStacked = stack.get(other);
          if (arrStacked && othStacked) {
            return arrStacked == other && othStacked == array2;
          }
          var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2;
          stack.set(array2, other);
          stack.set(other, array2);
          while (++index < arrLength) {
            var arrValue = array2[index], othValue = other[index];
            if (customizer) {
              var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
            }
            if (compared !== undefined2) {
              if (compared) {
                continue;
              }
              result2 = false;
              break;
            }
            if (seen) {
              if (!arraySome(other, function(othValue2, othIndex) {
                if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
                  return seen.push(othIndex);
                }
              })) {
                result2 = false;
                break;
              }
            } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
              result2 = false;
              break;
            }
          }
          stack["delete"](array2);
          stack["delete"](other);
          return result2;
        }
        function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
          switch (tag) {
            case dataViewTag:
              if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
                return false;
              }
              object = object.buffer;
              other = other.buffer;
            case arrayBufferTag:
              if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
                return false;
              }
              return true;
            case boolTag:
            case dateTag:
            case numberTag:
              return eq2(+object, +other);
            case errorTag:
              return object.name == other.name && object.message == other.message;
            case regexpTag:
            case stringTag:
              return object == other + "";
            case mapTag:
              var convert = mapToArray;
            case setTag:
              var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
              convert || (convert = setToArray);
              if (object.size != other.size && !isPartial) {
                return false;
              }
              var stacked = stack.get(object);
              if (stacked) {
                return stacked == other;
              }
              bitmask |= COMPARE_UNORDERED_FLAG;
              stack.set(object, other);
              var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
              stack["delete"](object);
              return result2;
            case symbolTag:
              if (symbolValueOf) {
                return symbolValueOf.call(object) == symbolValueOf.call(other);
              }
          }
          return false;
        }
        function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
          if (objLength != othLength && !isPartial) {
            return false;
          }
          var index = objLength;
          while (index--) {
            var key = objProps[index];
            if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
              return false;
            }
          }
          var objStacked = stack.get(object);
          var othStacked = stack.get(other);
          if (objStacked && othStacked) {
            return objStacked == other && othStacked == object;
          }
          var result2 = true;
          stack.set(object, other);
          stack.set(other, object);
          var skipCtor = isPartial;
          while (++index < objLength) {
            key = objProps[index];
            var objValue = object[key], othValue = other[key];
            if (customizer) {
              var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
            }
            if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
              result2 = false;
              break;
            }
            skipCtor || (skipCtor = key == "constructor");
          }
          if (result2 && !skipCtor) {
            var objCtor = object.constructor, othCtor = other.constructor;
            if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
              result2 = false;
            }
          }
          stack["delete"](object);
          stack["delete"](other);
          return result2;
        }
        function flatRest(func) {
          return setToString(overRest(func, undefined2, flatten2), func + "");
        }
        function getAllKeys(object) {
          return baseGetAllKeys(object, keys, getSymbols);
        }
        function getAllKeysIn(object) {
          return baseGetAllKeys(object, keysIn, getSymbolsIn);
        }
        var getData = !metaMap ? noop5 : function(func) {
          return metaMap.get(func);
        };
        function getFuncName(func) {
          var result2 = func.name + "", array2 = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array2.length : 0;
          while (length--) {
            var data = array2[length], otherFunc = data.func;
            if (otherFunc == null || otherFunc == func) {
              return data.name;
            }
          }
          return result2;
        }
        function getHolder(func) {
          var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func;
          return object.placeholder;
        }
        function getIteratee() {
          var result2 = lodash.iteratee || iteratee;
          result2 = result2 === iteratee ? baseIteratee : result2;
          return arguments.length ? result2(arguments[0], arguments[1]) : result2;
        }
        function getMapData(map3, key) {
          var data = map3.__data__;
          return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
        }
        function getMatchData(object) {
          var result2 = keys(object), length = result2.length;
          while (length--) {
            var key = result2[length], value = object[key];
            result2[length] = [key, value, isStrictComparable(value)];
          }
          return result2;
        }
        function getNative(object, key) {
          var value = getValue2(object, key);
          return baseIsNative(value) ? value : undefined2;
        }
        function getRawTag(value) {
          var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
          try {
            value[symToStringTag] = undefined2;
            var unmasked = true;
          } catch (e) {
          }
          var result2 = nativeObjectToString.call(value);
          if (unmasked) {
            if (isOwn) {
              value[symToStringTag] = tag;
            } else {
              delete value[symToStringTag];
            }
          }
          return result2;
        }
        var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
          if (object == null) {
            return [];
          }
          object = Object2(object);
          return arrayFilter(nativeGetSymbols(object), function(symbol) {
            return propertyIsEnumerable.call(object, symbol);
          });
        };
        var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
          var result2 = [];
          while (object) {
            arrayPush(result2, getSymbols(object));
            object = getPrototype(object);
          }
          return result2;
        };
        var getTag = baseGetTag;
        if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map3 && getTag(new Map3()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
          getTag = function(value) {
            var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : "";
            if (ctorString) {
              switch (ctorString) {
                case dataViewCtorString:
                  return dataViewTag;
                case mapCtorString:
                  return mapTag;
                case promiseCtorString:
                  return promiseTag;
                case setCtorString:
                  return setTag;
                case weakMapCtorString:
                  return weakMapTag;
              }
            }
            return result2;
          };
        }
        function getView(start2, end, transforms2) {
          var index = -1, length = transforms2.length;
          while (++index < length) {
            var data = transforms2[index], size2 = data.size;
            switch (data.type) {
              case "drop":
                start2 += size2;
                break;
              case "dropRight":
                end -= size2;
                break;
              case "take":
                end = nativeMin(end, start2 + size2);
                break;
              case "takeRight":
                start2 = nativeMax(start2, end - size2);
                break;
            }
          }
          return { "start": start2, "end": end };
        }
        function getWrapDetails(source) {
          var match2 = source.match(reWrapDetails);
          return match2 ? match2[1].split(reSplitDetails) : [];
        }
        function hasPath(object, path, hasFunc) {
          path = castPath(path, object);
          var index = -1, length = path.length, result2 = false;
          while (++index < length) {
            var key = toKey(path[index]);
            if (!(result2 = object != null && hasFunc(object, key))) {
              break;
            }
            object = object[key];
          }
          if (result2 || ++index != length) {
            return result2;
          }
          length = object == null ? 0 : object.length;
          return !!length && isLength(length) && isIndex(key, length) && (isArray4(object) || isArguments(object));
        }
        function initCloneArray(array2) {
          var length = array2.length, result2 = new array2.constructor(length);
          if (length && typeof array2[0] == "string" && hasOwnProperty.call(array2, "index")) {
            result2.index = array2.index;
            result2.input = array2.input;
          }
          return result2;
        }
        function initCloneObject(object) {
          return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
        }
        function initCloneByTag(object, tag, isDeep) {
          var Ctor = object.constructor;
          switch (tag) {
            case arrayBufferTag:
              return cloneArrayBuffer(object);
            case boolTag:
            case dateTag:
              return new Ctor(+object);
            case dataViewTag:
              return cloneDataView(object, isDeep);
            case float32Tag:
            case float64Tag:
            case int8Tag:
            case int16Tag:
            case int32Tag:
            case uint8Tag:
            case uint8ClampedTag:
            case uint16Tag:
            case uint32Tag:
              return cloneTypedArray(object, isDeep);
            case mapTag:
              return new Ctor();
            case numberTag:
            case stringTag:
              return new Ctor(object);
            case regexpTag:
              return cloneRegExp(object);
            case setTag:
              return new Ctor();
            case symbolTag:
              return cloneSymbol(object);
          }
        }
        function insertWrapDetails(source, details) {
          var length = details.length;
          if (!length) {
            return source;
          }
          var lastIndex = length - 1;
          details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
          details = details.join(length > 2 ? ", " : " ");
          return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
        }
        function isFlattenable(value) {
          return isArray4(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
        }
        function isIndex(value, length) {
          var type = typeof value;
          length = length == null ? MAX_SAFE_INTEGER : length;
          return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
        }
        function isIterateeCall(value, index, object) {
          if (!isObject2(object)) {
            return false;
          }
          var type = typeof index;
          if (type == "number" ? isArrayLike2(object) && isIndex(index, object.length) : type == "string" && index in object) {
            return eq2(object[index], value);
          }
          return false;
        }
        function isKey(value, object) {
          if (isArray4(value)) {
            return false;
          }
          var type = typeof value;
          if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
            return true;
          }
          return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
        }
        function isKeyable(value) {
          var type = typeof value;
          return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
        }
        function isLaziable(func) {
          var funcName = getFuncName(func), other = lodash[funcName];
          if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
            return false;
          }
          if (func === other) {
            return true;
          }
          var data = getData(other);
          return !!data && func === data[0];
        }
        function isMasked(func) {
          return !!maskSrcKey && maskSrcKey in func;
        }
        var isMaskable = coreJsData ? isFunction5 : stubFalse;
        function isPrototype(value) {
          var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
          return value === proto;
        }
        function isStrictComparable(value) {
          return value === value && !isObject2(value);
        }
        function matchesStrictComparable(key, srcValue) {
          return function(object) {
            if (object == null) {
              return false;
            }
            return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object));
          };
        }
        function memoizeCapped(func) {
          var result2 = memoize(func, function(key) {
            if (cache2.size === MAX_MEMOIZE_SIZE) {
              cache2.clear();
            }
            return key;
          });
          var cache2 = result2.cache;
          return result2;
        }
        function mergeData(data, source) {
          var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
          var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
          if (!(isCommon || isCombo)) {
            return data;
          }
          if (srcBitmask & WRAP_BIND_FLAG) {
            data[2] = source[2];
            newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
          }
          var value = source[3];
          if (value) {
            var partials = data[3];
            data[3] = partials ? composeArgs(partials, value, source[4]) : value;
            data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
          }
          value = source[5];
          if (value) {
            partials = data[5];
            data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
            data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
          }
          value = source[7];
          if (value) {
            data[7] = value;
          }
          if (srcBitmask & WRAP_ARY_FLAG) {
            data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
          }
          if (data[9] == null) {
            data[9] = source[9];
          }
          data[0] = source[0];
          data[1] = newBitmask;
          return data;
        }
        function nativeKeysIn(object) {
          var result2 = [];
          if (object != null) {
            for (var key in Object2(object)) {
              result2.push(key);
            }
          }
          return result2;
        }
        function objectToString(value) {
          return nativeObjectToString.call(value);
        }
        function overRest(func, start2, transform4) {
          start2 = nativeMax(start2 === undefined2 ? func.length - 1 : start2, 0);
          return function() {
            var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array2 = Array2(length);
            while (++index < length) {
              array2[index] = args[start2 + index];
            }
            index = -1;
            var otherArgs = Array2(start2 + 1);
            while (++index < start2) {
              otherArgs[index] = args[index];
            }
            otherArgs[start2] = transform4(array2);
            return apply2(func, this, otherArgs);
          };
        }
        function parent(object, path) {
          return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
        }
        function reorder(array2, indexes) {
          var arrLength = array2.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array2);
          while (length--) {
            var index = indexes[length];
            array2[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2;
          }
          return array2;
        }
        function safeGet(object, key) {
          if (key === "constructor" && typeof object[key] === "function") {
            return;
          }
          if (key == "__proto__") {
            return;
          }
          return object[key];
        }
        var setData = shortOut(baseSetData);
        var setTimeout2 = ctxSetTimeout || function(func, wait) {
          return root.setTimeout(func, wait);
        };
        var setToString = shortOut(baseSetToString);
        function setWrapToString(wrapper, reference, bitmask) {
          var source = reference + "";
          return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
        }
        function shortOut(func) {
          var count = 0, lastCalled = 0;
          return function() {
            var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
            lastCalled = stamp;
            if (remaining > 0) {
              if (++count >= HOT_COUNT) {
                return arguments[0];
              }
            } else {
              count = 0;
            }
            return func.apply(undefined2, arguments);
          };
        }
        function shuffleSelf(array2, size2) {
          var index = -1, length = array2.length, lastIndex = length - 1;
          size2 = size2 === undefined2 ? length : size2;
          while (++index < size2) {
            var rand = baseRandom(index, lastIndex), value = array2[rand];
            array2[rand] = array2[index];
            array2[index] = value;
          }
          array2.length = size2;
          return array2;
        }
        var stringToPath = memoizeCapped(function(string) {
          var result2 = [];
          if (string.charCodeAt(0) === 46) {
            result2.push("");
          }
          string.replace(rePropName, function(match2, number2, quote, subString) {
            result2.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2);
          });
          return result2;
        });
        function toKey(value) {
          if (typeof value == "string" || isSymbol(value)) {
            return value;
          }
          var result2 = value + "";
          return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
        }
        function toSource(func) {
          if (func != null) {
            try {
              return funcToString.call(func);
            } catch (e) {
            }
            try {
              return func + "";
            } catch (e) {
            }
          }
          return "";
        }
        function updateWrapDetails(details, bitmask) {
          arrayEach(wrapFlags, function(pair) {
            var value = "_." + pair[0];
            if (bitmask & pair[1] && !arrayIncludes(details, value)) {
              details.push(value);
            }
          });
          return details.sort();
        }
        function wrapperClone(wrapper) {
          if (wrapper instanceof LazyWrapper) {
            return wrapper.clone();
          }
          var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
          result2.__actions__ = copyArray(wrapper.__actions__);
          result2.__index__ = wrapper.__index__;
          result2.__values__ = wrapper.__values__;
          return result2;
        }
        function chunk2(array2, size2, guard) {
          if (guard ? isIterateeCall(array2, size2, guard) : size2 === undefined2) {
            size2 = 1;
          } else {
            size2 = nativeMax(toInteger2(size2), 0);
          }
          var length = array2 == null ? 0 : array2.length;
          if (!length || size2 < 1) {
            return [];
          }
          var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
          while (index < length) {
            result2[resIndex++] = baseSlice(array2, index, index += size2);
          }
          return result2;
        }
        function compact(array2) {
          var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result2 = [];
          while (++index < length) {
            var value = array2[index];
            if (value) {
              result2[resIndex++] = value;
            }
          }
          return result2;
        }
        function concat4() {
          var length = arguments.length;
          if (!length) {
            return [];
          }
          var args = Array2(length - 1), array2 = arguments[0], index = length;
          while (index--) {
            args[index - 1] = arguments[index];
          }
          return arrayPush(isArray4(array2) ? copyArray(array2) : [array2], baseFlatten(args, 1));
        }
        var difference = baseRest(function(array2, values2) {
          return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
        });
        var differenceBy = baseRest(function(array2, values2) {
          var iteratee2 = last2(values2);
          if (isArrayLikeObject(iteratee2)) {
            iteratee2 = undefined2;
          }
          return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
        });
        var differenceWith = baseRest(function(array2, values2) {
          var comparator = last2(values2);
          if (isArrayLikeObject(comparator)) {
            comparator = undefined2;
          }
          return isArrayLikeObject(array2) ? baseDifference(array2, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : [];
        });
        function drop(array2, n, guard) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          n = guard || n === undefined2 ? 1 : toInteger2(n);
          return baseSlice(array2, n < 0 ? 0 : n, length);
        }
        function dropRight(array2, n, guard) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          n = guard || n === undefined2 ? 1 : toInteger2(n);
          n = length - n;
          return baseSlice(array2, 0, n < 0 ? 0 : n);
        }
        function dropRightWhile(array2, predicate) {
          return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true, true) : [];
        }
        function dropWhile(array2, predicate) {
          return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), true) : [];
        }
        function fill(array2, value, start2, end) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          if (start2 && typeof start2 != "number" && isIterateeCall(array2, value, start2)) {
            start2 = 0;
            end = length;
          }
          return baseFill(array2, value, start2, end);
        }
        function findIndex(array2, predicate, fromIndex) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return -1;
          }
          var index = fromIndex == null ? 0 : toInteger2(fromIndex);
          if (index < 0) {
            index = nativeMax(length + index, 0);
          }
          return baseFindIndex(array2, getIteratee(predicate, 3), index);
        }
        function findLastIndex(array2, predicate, fromIndex) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return -1;
          }
          var index = length - 1;
          if (fromIndex !== undefined2) {
            index = toInteger2(fromIndex);
            index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
          }
          return baseFindIndex(array2, getIteratee(predicate, 3), index, true);
        }
        function flatten2(array2) {
          var length = array2 == null ? 0 : array2.length;
          return length ? baseFlatten(array2, 1) : [];
        }
        function flattenDeep(array2) {
          var length = array2 == null ? 0 : array2.length;
          return length ? baseFlatten(array2, INFINITY) : [];
        }
        function flattenDepth(array2, depth) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          depth = depth === undefined2 ? 1 : toInteger2(depth);
          return baseFlatten(array2, depth);
        }
        function fromPairs(pairs) {
          var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
          while (++index < length) {
            var pair = pairs[index];
            result2[pair[0]] = pair[1];
          }
          return result2;
        }
        function head(array2) {
          return array2 && array2.length ? array2[0] : undefined2;
        }
        function indexOf2(array2, value, fromIndex) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return -1;
          }
          var index = fromIndex == null ? 0 : toInteger2(fromIndex);
          if (index < 0) {
            index = nativeMax(length + index, 0);
          }
          return baseIndexOf(array2, value, index);
        }
        function initial(array2) {
          var length = array2 == null ? 0 : array2.length;
          return length ? baseSlice(array2, 0, -1) : [];
        }
        var intersection = baseRest(function(arrays) {
          var mapped = arrayMap(arrays, castArrayLikeObject);
          return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
        });
        var intersectionBy = baseRest(function(arrays) {
          var iteratee2 = last2(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
          if (iteratee2 === last2(mapped)) {
            iteratee2 = undefined2;
          } else {
            mapped.pop();
          }
          return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
        });
        var intersectionWith = baseRest(function(arrays) {
          var comparator = last2(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
          comparator = typeof comparator == "function" ? comparator : undefined2;
          if (comparator) {
            mapped.pop();
          }
          return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
        });
        function join(array2, separator) {
          return array2 == null ? "" : nativeJoin.call(array2, separator);
        }
        function last2(array2) {
          var length = array2 == null ? 0 : array2.length;
          return length ? array2[length - 1] : undefined2;
        }
        function lastIndexOf(array2, value, fromIndex) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return -1;
          }
          var index = length;
          if (fromIndex !== undefined2) {
            index = toInteger2(fromIndex);
            index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
          }
          return value === value ? strictLastIndexOf(array2, value, index) : baseFindIndex(array2, baseIsNaN, index, true);
        }
        function nth2(array2, n) {
          return array2 && array2.length ? baseNth(array2, toInteger2(n)) : undefined2;
        }
        var pull = baseRest(pullAll);
        function pullAll(array2, values2) {
          return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
        }
        function pullAllBy(array2, values2, iteratee2) {
          return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, getIteratee(iteratee2, 2)) : array2;
        }
        function pullAllWith(array2, values2, comparator) {
          return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2, undefined2, comparator) : array2;
        }
        var pullAt = flatRest(function(array2, indexes) {
          var length = array2 == null ? 0 : array2.length, result2 = baseAt(array2, indexes);
          basePullAt(array2, arrayMap(indexes, function(index) {
            return isIndex(index, length) ? +index : index;
          }).sort(compareAscending));
          return result2;
        });
        function remove2(array2, predicate) {
          var result2 = [];
          if (!(array2 && array2.length)) {
            return result2;
          }
          var index = -1, indexes = [], length = array2.length;
          predicate = getIteratee(predicate, 3);
          while (++index < length) {
            var value = array2[index];
            if (predicate(value, index, array2)) {
              result2.push(value);
              indexes.push(index);
            }
          }
          basePullAt(array2, indexes);
          return result2;
        }
        function reverse(array2) {
          return array2 == null ? array2 : nativeReverse.call(array2);
        }
        function slice(array2, start2, end) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          if (end && typeof end != "number" && isIterateeCall(array2, start2, end)) {
            start2 = 0;
            end = length;
          } else {
            start2 = start2 == null ? 0 : toInteger2(start2);
            end = end === undefined2 ? length : toInteger2(end);
          }
          return baseSlice(array2, start2, end);
        }
        function sortedIndex(array2, value) {
          return baseSortedIndex(array2, value);
        }
        function sortedIndexBy(array2, value, iteratee2) {
          return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2));
        }
        function sortedIndexOf(array2, value) {
          var length = array2 == null ? 0 : array2.length;
          if (length) {
            var index = baseSortedIndex(array2, value);
            if (index < length && eq2(array2[index], value)) {
              return index;
            }
          }
          return -1;
        }
        function sortedLastIndex(array2, value) {
          return baseSortedIndex(array2, value, true);
        }
        function sortedLastIndexBy(array2, value, iteratee2) {
          return baseSortedIndexBy(array2, value, getIteratee(iteratee2, 2), true);
        }
        function sortedLastIndexOf(array2, value) {
          var length = array2 == null ? 0 : array2.length;
          if (length) {
            var index = baseSortedIndex(array2, value, true) - 1;
            if (eq2(array2[index], value)) {
              return index;
            }
          }
          return -1;
        }
        function sortedUniq(array2) {
          return array2 && array2.length ? baseSortedUniq(array2) : [];
        }
        function sortedUniqBy(array2, iteratee2) {
          return array2 && array2.length ? baseSortedUniq(array2, getIteratee(iteratee2, 2)) : [];
        }
        function tail(array2) {
          var length = array2 == null ? 0 : array2.length;
          return length ? baseSlice(array2, 1, length) : [];
        }
        function take2(array2, n, guard) {
          if (!(array2 && array2.length)) {
            return [];
          }
          n = guard || n === undefined2 ? 1 : toInteger2(n);
          return baseSlice(array2, 0, n < 0 ? 0 : n);
        }
        function takeRight(array2, n, guard) {
          var length = array2 == null ? 0 : array2.length;
          if (!length) {
            return [];
          }
          n = guard || n === undefined2 ? 1 : toInteger2(n);
          n = length - n;
          return baseSlice(array2, n < 0 ? 0 : n, length);
        }
        function takeRightWhile(array2, predicate) {
          return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3), false, true) : [];
        }
        function takeWhile2(array2, predicate) {
          return array2 && array2.length ? baseWhile(array2, getIteratee(predicate, 3)) : [];
        }
        var union = baseRest(function(arrays) {
          return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
        });
        var unionBy = baseRest(function(arrays) {
          var iteratee2 = last2(arrays);
          if (isArrayLikeObject(iteratee2)) {
            iteratee2 = undefined2;
          }
          return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
        });
        var unionWith = baseRest(function(arrays) {
          var comparator = last2(arrays);
          comparator = typeof comparator == "function" ? comparator : undefined2;
          return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator);
        });
        function uniq(array2) {
          return array2 && array2.length ? baseUniq(array2) : [];
        }
        function uniqBy(array2, iteratee2) {
          return array2 && array2.length ? baseUniq(array2, getIteratee(iteratee2, 2)) : [];
        }
        function uniqWith(array2, comparator) {
          comparator = typeof comparator == "function" ? comparator : undefined2;
          return array2 && array2.length ? baseUniq(array2, undefined2, comparator) : [];
        }
        function unzip(array2) {
          if (!(array2 && array2.length)) {
            return [];
          }
          var length = 0;
          array2 = arrayFilter(array2, function(group2) {
            if (isArrayLikeObject(group2)) {
              length = nativeMax(group2.length, length);
              return true;
            }
          });
          return baseTimes(length, function(index) {
            return arrayMap(array2, baseProperty(index));
          });
        }
        function unzipWith(array2, iteratee2) {
          if (!(array2 && array2.length)) {
            return [];
          }
          var result2 = unzip(array2);
          if (iteratee2 == null) {
            return result2;
          }
          return arrayMap(result2, function(group2) {
            return apply2(iteratee2, undefined2, group2);
          });
        }
        var without = baseRest(function(array2, values2) {
          return isArrayLikeObject(array2) ? baseDifference(array2, values2) : [];
        });
        var xor = baseRest(function(arrays) {
          return baseXor(arrayFilter(arrays, isArrayLikeObject));
        });
        var xorBy = baseRest(function(arrays) {
          var iteratee2 = last2(arrays);
          if (isArrayLikeObject(iteratee2)) {
            iteratee2 = undefined2;
          }
          return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
        });
        var xorWith = baseRest(function(arrays) {
          var comparator = last2(arrays);
          comparator = typeof comparator == "function" ? comparator : undefined2;
          return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator);
        });
        var zip = baseRest(unzip);
        function zipObject(props, values2) {
          return baseZipObject(props || [], values2 || [], assignValue);
        }
        function zipObjectDeep(props, values2) {
          return baseZipObject(props || [], values2 || [], baseSet);
        }
        var zipWith = baseRest(function(arrays) {
          var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2;
          iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2;
          return unzipWith(arrays, iteratee2);
        });
        function chain(value) {
          var result2 = lodash(value);
          result2.__chain__ = true;
          return result2;
        }
        function tap2(value, interceptor) {
          interceptor(value);
          return value;
        }
        function thru(value, interceptor) {
          return interceptor(value);
        }
        var wrapperAt = flatRest(function(paths) {
          var length = paths.length, start2 = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
            return baseAt(object, paths);
          };
          if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start2)) {
            return this.thru(interceptor);
          }
          value = value.slice(start2, +start2 + (length ? 1 : 0));
          value.__actions__.push({
            "func": thru,
            "args": [interceptor],
            "thisArg": undefined2
          });
          return new LodashWrapper(value, this.__chain__).thru(function(array2) {
            if (length && !array2.length) {
              array2.push(undefined2);
            }
            return array2;
          });
        });
        function wrapperChain() {
          return chain(this);
        }
        function wrapperCommit() {
          return new LodashWrapper(this.value(), this.__chain__);
        }
        function wrapperNext() {
          if (this.__values__ === undefined2) {
            this.__values__ = toArray2(this.value());
          }
          var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++];
          return { "done": done, "value": value };
        }
        function wrapperToIterator() {
          return this;
        }
        function wrapperPlant(value) {
          var result2, parent2 = this;
          while (parent2 instanceof baseLodash) {
            var clone3 = wrapperClone(parent2);
            clone3.__index__ = 0;
            clone3.__values__ = undefined2;
            if (result2) {
              previous.__wrapped__ = clone3;
            } else {
              result2 = clone3;
            }
            var previous = clone3;
            parent2 = parent2.__wrapped__;
          }
          previous.__wrapped__ = value;
          return result2;
        }
        function wrapperReverse() {
          var value = this.__wrapped__;
          if (value instanceof LazyWrapper) {
            var wrapped = value;
            if (this.__actions__.length) {
              wrapped = new LazyWrapper(this);
            }
            wrapped = wrapped.reverse();
            wrapped.__actions__.push({
              "func": thru,
              "args": [reverse],
              "thisArg": undefined2
            });
            return new LodashWrapper(wrapped, this.__chain__);
          }
          return this.thru(reverse);
        }
        function wrapperValue() {
          return baseWrapperValue(this.__wrapped__, this.__actions__);
        }
        var countBy = createAggregator(function(result2, value, key) {
          if (hasOwnProperty.call(result2, key)) {
            ++result2[key];
          } else {
            baseAssignValue(result2, key, 1);
          }
        });
        function every(collection, predicate, guard) {
          var func = isArray4(collection) ? arrayEvery : baseEvery;
          if (guard && isIterateeCall(collection, predicate, guard)) {
            predicate = undefined2;
          }
          return func(collection, getIteratee(predicate, 3));
        }
        function filter2(collection, predicate) {
          var func = isArray4(collection) ? arrayFilter : baseFilter;
          return func(collection, getIteratee(predicate, 3));
        }
        var find3 = createFind(findIndex);
        var findLast = createFind(findLastIndex);
        function flatMap(collection, iteratee2) {
          return baseFlatten(map2(collection, iteratee2), 1);
        }
        function flatMapDeep(collection, iteratee2) {
          return baseFlatten(map2(collection, iteratee2), INFINITY);
        }
        function flatMapDepth(collection, iteratee2, depth) {
          depth = depth === undefined2 ? 1 : toInteger2(depth);
          return baseFlatten(map2(collection, iteratee2), depth);
        }
        function forEach2(collection, iteratee2) {
          var func = isArray4(collection) ? arrayEach : baseEach;
          return func(collection, getIteratee(iteratee2, 3));
        }
        function forEachRight(collection, iteratee2) {
          var func = isArray4(collection) ? arrayEachRight : baseEachRight;
          return func(collection, getIteratee(iteratee2, 3));
        }
        var groupBy = createAggregator(function(result2, value, key) {
          if (hasOwnProperty.call(result2, key)) {
            result2[key].push(value);
          } else {
            baseAssignValue(result2, key, [value]);
          }
        });
        function includes2(collection, value, fromIndex, guard) {
          collection = isArrayLike2(collection) ? collection : values(collection);
          fromIndex = fromIndex && !guard ? toInteger2(fromIndex) : 0;
          var length = collection.length;
          if (fromIndex < 0) {
            fromIndex = nativeMax(length + fromIndex, 0);
          }
          return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
        }
        var invokeMap = baseRest(function(collection, path, args) {
          var index = -1, isFunc = typeof path == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
          baseEach(collection, function(value) {
            result2[++index] = isFunc ? apply2(path, value, args) : baseInvoke(value, path, args);
          });
          return result2;
        });
        var keyBy = createAggregator(function(result2, value, key) {
          baseAssignValue(result2, key, value);
        });
        function map2(collection, iteratee2) {
          var func = isArray4(collection) ? arrayMap : baseMap;
          return func(collection, getIteratee(iteratee2, 3));
        }
        function orderBy(collection, iteratees, orders, guard) {
          if (collection == null) {
            return [];
          }
          if (!isArray4(iteratees)) {
            iteratees = iteratees == null ? [] : [iteratees];
          }
          orders = guard ? undefined2 : orders;
          if (!isArray4(orders)) {
            orders = orders == null ? [] : [orders];
          }
          return baseOrderBy(collection, iteratees, orders);
        }
        var partition = createAggregator(function(result2, value, key) {
          result2[key ? 0 : 1].push(value);
        }, function() {
          return [[], []];
        });
        function reduce(collection, iteratee2, accumulator) {
          var func = isArray4(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
          return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
        }
        function reduceRight(collection, iteratee2, accumulator) {
          var func = isArray4(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
          return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
        }
        function reject(collection, predicate) {
          var func = isArray4(collection) ? arrayFilter : baseFilter;
          return func(collection, negate(getIteratee(predicate, 3)));
        }
        function sample(collection) {
          var func = isArray4(collection) ? arraySample : baseSample;
          return func(collection);
        }
        function sampleSize(collection, n, guard) {
          if (guard ? isIterateeCall(collection, n, guard) : n === undefined2) {
            n = 1;
          } else {
            n = toInteger2(n);
          }
          var func = isArray4(collection) ? arraySampleSize : baseSampleSize;
          return func(collection, n);
        }
        function shuffle(collection) {
          var func = isArray4(collection) ? arrayShuffle : baseShuffle;
          return func(collection);
        }
        function size(collection) {
          if (collection == null) {
            return 0;
          }
          if (isArrayLike2(collection)) {
            return isString2(collection) ? stringSize(collection) : collection.length;
          }
          var tag = getTag(collection);
          if (tag == mapTag || tag == setTag) {
            return collection.size;
          }
          return baseKeys(collection).length;
        }
        function some(collection, predicate, guard) {
          var func = isArray4(collection) ? arraySome : baseSome;
          if (guard && isIterateeCall(collection, predicate, guard)) {
            predicate = undefined2;
          }
          return func(collection, getIteratee(predicate, 3));
        }
        var sortBy = baseRest(function(collection, iteratees) {
          if (collection == null) {
            return [];
          }
          var length = iteratees.length;
          if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
            iteratees = [];
          } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
            iteratees = [iteratees[0]];
          }
          return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
        });
        var now = ctxNow || function() {
          return root.Date.now();
        };
        function after(n, func) {
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          n = toInteger2(n);
          return function() {
            if (--n < 1) {
              return func.apply(this, arguments);
            }
          };
        }
        function ary(func, n, guard) {
          n = guard ? undefined2 : n;
          n = func && n == null ? func.length : n;
          return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n);
        }
        function before(n, func) {
          var result2;
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          n = toInteger2(n);
          return function() {
            if (--n > 0) {
              result2 = func.apply(this, arguments);
            }
            if (n <= 1) {
              func = undefined2;
            }
            return result2;
          };
        }
        var bind2 = baseRest(function(func, thisArg, partials) {
          var bitmask = WRAP_BIND_FLAG;
          if (partials.length) {
            var holders = replaceHolders(partials, getHolder(bind2));
            bitmask |= WRAP_PARTIAL_FLAG;
          }
          return createWrap(func, bitmask, thisArg, partials, holders);
        });
        var bindKey = baseRest(function(object, key, partials) {
          var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
          if (partials.length) {
            var holders = replaceHolders(partials, getHolder(bindKey));
            bitmask |= WRAP_PARTIAL_FLAG;
          }
          return createWrap(key, bitmask, object, partials, holders);
        });
        function curry(func, arity, guard) {
          arity = guard ? undefined2 : arity;
          var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
          result2.placeholder = curry.placeholder;
          return result2;
        }
        function curryRight(func, arity, guard) {
          arity = guard ? undefined2 : arity;
          var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
          result2.placeholder = curryRight.placeholder;
          return result2;
        }
        function debounce(func, wait, options) {
          var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          wait = toNumber(wait) || 0;
          if (isObject2(options)) {
            leading = !!options.leading;
            maxing = "maxWait" in options;
            maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
            trailing = "trailing" in options ? !!options.trailing : trailing;
          }
          function invokeFunc(time) {
            var args = lastArgs, thisArg = lastThis;
            lastArgs = lastThis = undefined2;
            lastInvokeTime = time;
            result2 = func.apply(thisArg, args);
            return result2;
          }
          function leadingEdge(time) {
            lastInvokeTime = time;
            timerId = setTimeout2(timerExpired, wait);
            return leading ? invokeFunc(time) : result2;
          }
          function remainingWait(time) {
            var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
            return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
          }
          function shouldInvoke(time) {
            var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
            return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
          }
          function timerExpired() {
            var time = now();
            if (shouldInvoke(time)) {
              return trailingEdge(time);
            }
            timerId = setTimeout2(timerExpired, remainingWait(time));
          }
          function trailingEdge(time) {
            timerId = undefined2;
            if (trailing && lastArgs) {
              return invokeFunc(time);
            }
            lastArgs = lastThis = undefined2;
            return result2;
          }
          function cancel() {
            if (timerId !== undefined2) {
              clearTimeout2(timerId);
            }
            lastInvokeTime = 0;
            lastArgs = lastCallTime = lastThis = timerId = undefined2;
          }
          function flush() {
            return timerId === undefined2 ? result2 : trailingEdge(now());
          }
          function debounced() {
            var time = now(), isInvoking = shouldInvoke(time);
            lastArgs = arguments;
            lastThis = this;
            lastCallTime = time;
            if (isInvoking) {
              if (timerId === undefined2) {
                return leadingEdge(lastCallTime);
              }
              if (maxing) {
                clearTimeout2(timerId);
                timerId = setTimeout2(timerExpired, wait);
                return invokeFunc(lastCallTime);
              }
            }
            if (timerId === undefined2) {
              timerId = setTimeout2(timerExpired, wait);
            }
            return result2;
          }
          debounced.cancel = cancel;
          debounced.flush = flush;
          return debounced;
        }
        var defer2 = baseRest(function(func, args) {
          return baseDelay(func, 1, args);
        });
        var delay2 = baseRest(function(func, wait, args) {
          return baseDelay(func, toNumber(wait) || 0, args);
        });
        function flip(func) {
          return createWrap(func, WRAP_FLIP_FLAG);
        }
        function memoize(func, resolver) {
          if (typeof func != "function" || resolver != null && typeof resolver != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          var memoized = function() {
            var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
            if (cache2.has(key)) {
              return cache2.get(key);
            }
            var result2 = func.apply(this, args);
            memoized.cache = cache2.set(key, result2) || cache2;
            return result2;
          };
          memoized.cache = new (memoize.Cache || MapCache)();
          return memoized;
        }
        memoize.Cache = MapCache;
        function negate(predicate) {
          if (typeof predicate != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          return function() {
            var args = arguments;
            switch (args.length) {
              case 0:
                return !predicate.call(this);
              case 1:
                return !predicate.call(this, args[0]);
              case 2:
                return !predicate.call(this, args[0], args[1]);
              case 3:
                return !predicate.call(this, args[0], args[1], args[2]);
            }
            return !predicate.apply(this, args);
          };
        }
        function once(func) {
          return before(2, func);
        }
        var overArgs = castRest(function(func, transforms2) {
          transforms2 = transforms2.length == 1 && isArray4(transforms2[0]) ? arrayMap(transforms2[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms2, 1), baseUnary(getIteratee()));
          var funcsLength = transforms2.length;
          return baseRest(function(args) {
            var index = -1, length = nativeMin(args.length, funcsLength);
            while (++index < length) {
              args[index] = transforms2[index].call(this, args[index]);
            }
            return apply2(func, this, args);
          });
        });
        var partial = baseRest(function(func, partials) {
          var holders = replaceHolders(partials, getHolder(partial));
          return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders);
        });
        var partialRight = baseRest(function(func, partials) {
          var holders = replaceHolders(partials, getHolder(partialRight));
          return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders);
        });
        var rearg = flatRest(function(func, indexes) {
          return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes);
        });
        function rest(func, start2) {
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          start2 = start2 === undefined2 ? start2 : toInteger2(start2);
          return baseRest(func, start2);
        }
        function spread(func, start2) {
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          start2 = start2 == null ? 0 : nativeMax(toInteger2(start2), 0);
          return baseRest(function(args) {
            var array2 = args[start2], otherArgs = castSlice(args, 0, start2);
            if (array2) {
              arrayPush(otherArgs, array2);
            }
            return apply2(func, this, otherArgs);
          });
        }
        function throttle(func, wait, options) {
          var leading = true, trailing = true;
          if (typeof func != "function") {
            throw new TypeError2(FUNC_ERROR_TEXT);
          }
          if (isObject2(options)) {
            leading = "leading" in options ? !!options.leading : leading;
            trailing = "trailing" in options ? !!options.trailing : trailing;
          }
          return debounce(func, wait, {
            "leading": leading,
            "maxWait": wait,
            "trailing": trailing
          });
        }
        function unary(func) {
          return ary(func, 1);
        }
        function wrap(value, wrapper) {
          return partial(castFunction(wrapper), value);
        }
        function castArray() {
          if (!arguments.length) {
            return [];
          }
          var value = arguments[0];
          return isArray4(value) ? value : [value];
        }
        function clone2(value) {
          return baseClone(value, CLONE_SYMBOLS_FLAG);
        }
        function cloneWith(value, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
        }
        function cloneDeep7(value) {
          return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
        }
        function cloneDeepWith(value, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
        }
        function conformsTo(object, source) {
          return source == null || baseConformsTo(object, source, keys(source));
        }
        function eq2(value, other) {
          return value === other || value !== value && other !== other;
        }
        var gt2 = createRelationalOperation(baseGt);
        var gte = createRelationalOperation(function(value, other) {
          return value >= other;
        });
        var isArguments = baseIsArguments(/* @__PURE__ */ function() {
          return arguments;
        }()) ? baseIsArguments : function(value) {
          return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
        };
        var isArray4 = Array2.isArray;
        var isArrayBuffer2 = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
        function isArrayLike2(value) {
          return value != null && isLength(value.length) && !isFunction5(value);
        }
        function isArrayLikeObject(value) {
          return isObjectLike(value) && isArrayLike2(value);
        }
        function isBoolean(value) {
          return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
        }
        var isBuffer = nativeIsBuffer || stubFalse;
        var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
        function isElement2(value) {
          return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
        }
        function isEmpty4(value) {
          if (value == null) {
            return true;
          }
          if (isArrayLike2(value) && (isArray4(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
            return !value.length;
          }
          var tag = getTag(value);
          if (tag == mapTag || tag == setTag) {
            return !value.size;
          }
          if (isPrototype(value)) {
            return !baseKeys(value).length;
          }
          for (var key in value) {
            if (hasOwnProperty.call(value, key)) {
              return false;
            }
          }
          return true;
        }
        function isEqual4(value, other) {
          return baseIsEqual(value, other);
        }
        function isEqualWith(value, other, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          var result2 = customizer ? customizer(value, other) : undefined2;
          return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2;
        }
        function isError(value) {
          if (!isObjectLike(value)) {
            return false;
          }
          var tag = baseGetTag(value);
          return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
        }
        function isFinite2(value) {
          return typeof value == "number" && nativeIsFinite(value);
        }
        function isFunction5(value) {
          if (!isObject2(value)) {
            return false;
          }
          var tag = baseGetTag(value);
          return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
        }
        function isInteger(value) {
          return typeof value == "number" && value == toInteger2(value);
        }
        function isLength(value) {
          return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
        }
        function isObject2(value) {
          var type = typeof value;
          return value != null && (type == "object" || type == "function");
        }
        function isObjectLike(value) {
          return value != null && typeof value == "object";
        }
        var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
        function isMatch(object, source) {
          return object === source || baseIsMatch(object, source, getMatchData(source));
        }
        function isMatchWith(object, source, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          return baseIsMatch(object, source, getMatchData(source), customizer);
        }
        function isNaN2(value) {
          return isNumber6(value) && value != +value;
        }
        function isNative(value) {
          if (isMaskable(value)) {
            throw new Error2(CORE_ERROR_TEXT);
          }
          return baseIsNative(value);
        }
        function isNull(value) {
          return value === null;
        }
        function isNil(value) {
          return value == null;
        }
        function isNumber6(value) {
          return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
        }
        function isPlainObject(value) {
          if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
            return false;
          }
          var proto = getPrototype(value);
          if (proto === null) {
            return true;
          }
          var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
          return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
        }
        var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
        function isSafeInteger(value) {
          return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
        }
        var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
        function isString2(value) {
          return typeof value == "string" || !isArray4(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
        }
        function isSymbol(value) {
          return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
        }
        var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
        function isUndefined(value) {
          return value === undefined2;
        }
        function isWeakMap(value) {
          return isObjectLike(value) && getTag(value) == weakMapTag;
        }
        function isWeakSet(value) {
          return isObjectLike(value) && baseGetTag(value) == weakSetTag;
        }
        var lt2 = createRelationalOperation(baseLt);
        var lte = createRelationalOperation(function(value, other) {
          return value <= other;
        });
        function toArray2(value) {
          if (!value) {
            return [];
          }
          if (isArrayLike2(value)) {
            return isString2(value) ? stringToArray(value) : copyArray(value);
          }
          if (symIterator && value[symIterator]) {
            return iteratorToArray(value[symIterator]());
          }
          var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
          return func(value);
        }
        function toFinite(value) {
          if (!value) {
            return value === 0 ? value : 0;
          }
          value = toNumber(value);
          if (value === INFINITY || value === -INFINITY) {
            var sign = value < 0 ? -1 : 1;
            return sign * MAX_INTEGER;
          }
          return value === value ? value : 0;
        }
        function toInteger2(value) {
          var result2 = toFinite(value), remainder = result2 % 1;
          return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
        }
        function toLength(value) {
          return value ? baseClamp(toInteger2(value), 0, MAX_ARRAY_LENGTH) : 0;
        }
        function toNumber(value) {
          if (typeof value == "number") {
            return value;
          }
          if (isSymbol(value)) {
            return NAN;
          }
          if (isObject2(value)) {
            var other = typeof value.valueOf == "function" ? value.valueOf() : value;
            value = isObject2(other) ? other + "" : other;
          }
          if (typeof value != "string") {
            return value === 0 ? value : +value;
          }
          value = baseTrim(value);
          var isBinary = reIsBinary.test(value);
          return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
        }
        function toPlainObject(value) {
          return copyObject(value, keysIn(value));
        }
        function toSafeInteger(value) {
          return value ? baseClamp(toInteger2(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
        }
        function toString7(value) {
          return value == null ? "" : baseToString(value);
        }
        var assign2 = createAssigner(function(object, source) {
          if (isPrototype(source) || isArrayLike2(source)) {
            copyObject(source, keys(source), object);
            return;
          }
          for (var key in source) {
            if (hasOwnProperty.call(source, key)) {
              assignValue(object, key, source[key]);
            }
          }
        });
        var assignIn = createAssigner(function(object, source) {
          copyObject(source, keysIn(source), object);
        });
        var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
          copyObject(source, keysIn(source), object, customizer);
        });
        var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
          copyObject(source, keys(source), object, customizer);
        });
        var at = flatRest(baseAt);
        function create4(prototype, properties2) {
          var result2 = baseCreate(prototype);
          return properties2 == null ? result2 : baseAssign(result2, properties2);
        }
        var defaults4 = baseRest(function(object, sources) {
          object = Object2(object);
          var index = -1;
          var length = sources.length;
          var guard = length > 2 ? sources[2] : undefined2;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            length = 1;
          }
          while (++index < length) {
            var source = sources[index];
            var props = keysIn(source);
            var propsIndex = -1;
            var propsLength = props.length;
            while (++propsIndex < propsLength) {
              var key = props[propsIndex];
              var value = object[key];
              if (value === undefined2 || eq2(value, objectProto2[key]) && !hasOwnProperty.call(object, key)) {
                object[key] = source[key];
              }
            }
          }
          return object;
        });
        var defaultsDeep = baseRest(function(args) {
          args.push(undefined2, customDefaultsMerge);
          return apply2(mergeWith, undefined2, args);
        });
        function findKey(object, predicate) {
          return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
        }
        function findLastKey(object, predicate) {
          return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
        }
        function forIn(object, iteratee2) {
          return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
        }
        function forInRight(object, iteratee2) {
          return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
        }
        function forOwn(object, iteratee2) {
          return object && baseForOwn(object, getIteratee(iteratee2, 3));
        }
        function forOwnRight(object, iteratee2) {
          return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
        }
        function functions(object) {
          return object == null ? [] : baseFunctions(object, keys(object));
        }
        function functionsIn(object) {
          return object == null ? [] : baseFunctions(object, keysIn(object));
        }
        function get8(object, path, defaultValue) {
          var result2 = object == null ? undefined2 : baseGet(object, path);
          return result2 === undefined2 ? defaultValue : result2;
        }
        function has3(object, path) {
          return object != null && hasPath(object, path, baseHas);
        }
        function hasIn(object, path) {
          return object != null && hasPath(object, path, baseHasIn);
        }
        var invert = createInverter(function(result2, value, key) {
          if (value != null && typeof value.toString != "function") {
            value = nativeObjectToString.call(value);
          }
          result2[value] = key;
        }, constant(identity3));
        var invertBy = createInverter(function(result2, value, key) {
          if (value != null && typeof value.toString != "function") {
            value = nativeObjectToString.call(value);
          }
          if (hasOwnProperty.call(result2, value)) {
            result2[value].push(key);
          } else {
            result2[value] = [key];
          }
        }, getIteratee);
        var invoke = baseRest(baseInvoke);
        function keys(object) {
          return isArrayLike2(object) ? arrayLikeKeys(object) : baseKeys(object);
        }
        function keysIn(object) {
          return isArrayLike2(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
        }
        function mapKeys(object, iteratee2) {
          var result2 = {};
          iteratee2 = getIteratee(iteratee2, 3);
          baseForOwn(object, function(value, key, object2) {
            baseAssignValue(result2, iteratee2(value, key, object2), value);
          });
          return result2;
        }
        function mapValues(object, iteratee2) {
          var result2 = {};
          iteratee2 = getIteratee(iteratee2, 3);
          baseForOwn(object, function(value, key, object2) {
            baseAssignValue(result2, key, iteratee2(value, key, object2));
          });
          return result2;
        }
        var merge3 = createAssigner(function(object, source, srcIndex) {
          baseMerge(object, source, srcIndex);
        });
        var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
          baseMerge(object, source, srcIndex, customizer);
        });
        var omit = flatRest(function(object, paths) {
          var result2 = {};
          if (object == null) {
            return result2;
          }
          var isDeep = false;
          paths = arrayMap(paths, function(path) {
            path = castPath(path, object);
            isDeep || (isDeep = path.length > 1);
            return path;
          });
          copyObject(object, getAllKeysIn(object), result2);
          if (isDeep) {
            result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
          }
          var length = paths.length;
          while (length--) {
            baseUnset(result2, paths[length]);
          }
          return result2;
        });
        function omitBy(object, predicate) {
          return pickBy(object, negate(getIteratee(predicate)));
        }
        var pick = flatRest(function(object, paths) {
          return object == null ? {} : basePick(object, paths);
        });
        function pickBy(object, predicate) {
          if (object == null) {
            return {};
          }
          var props = arrayMap(getAllKeysIn(object), function(prop) {
            return [prop];
          });
          predicate = getIteratee(predicate);
          return basePickBy(object, props, function(value, path) {
            return predicate(value, path[0]);
          });
        }
        function result(object, path, defaultValue) {
          path = castPath(path, object);
          var index = -1, length = path.length;
          if (!length) {
            length = 1;
            object = undefined2;
          }
          while (++index < length) {
            var value = object == null ? undefined2 : object[toKey(path[index])];
            if (value === undefined2) {
              index = length;
              value = defaultValue;
            }
            object = isFunction5(value) ? value.call(object) : value;
          }
          return object;
        }
        function set2(object, path, value) {
          return object == null ? object : baseSet(object, path, value);
        }
        function setWith(object, path, value, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          return object == null ? object : baseSet(object, path, value, customizer);
        }
        var toPairs = createToPairs(keys);
        var toPairsIn = createToPairs(keysIn);
        function transform3(object, iteratee2, accumulator) {
          var isArr = isArray4(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
          iteratee2 = getIteratee(iteratee2, 4);
          if (accumulator == null) {
            var Ctor = object && object.constructor;
            if (isArrLike) {
              accumulator = isArr ? new Ctor() : [];
            } else if (isObject2(object)) {
              accumulator = isFunction5(Ctor) ? baseCreate(getPrototype(object)) : {};
            } else {
              accumulator = {};
            }
          }
          (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
            return iteratee2(accumulator, value, index, object2);
          });
          return accumulator;
        }
        function unset(object, path) {
          return object == null ? true : baseUnset(object, path);
        }
        function update(object, path, updater) {
          return object == null ? object : baseUpdate(object, path, castFunction(updater));
        }
        function updateWith(object, path, updater, customizer) {
          customizer = typeof customizer == "function" ? customizer : undefined2;
          return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
        }
        function values(object) {
          return object == null ? [] : baseValues(object, keys(object));
        }
        function valuesIn(object) {
          return object == null ? [] : baseValues(object, keysIn(object));
        }
        function clamp2(number2, lower, upper) {
          if (upper === undefined2) {
            upper = lower;
            lower = undefined2;
          }
          if (upper !== undefined2) {
            upper = toNumber(upper);
            upper = upper === upper ? upper : 0;
          }
          if (lower !== undefined2) {
            lower = toNumber(lower);
            lower = lower === lower ? lower : 0;
          }
          return baseClamp(toNumber(number2), lower, upper);
        }
        function inRange(number2, start2, end) {
          start2 = toFinite(start2);
          if (end === undefined2) {
            end = start2;
            start2 = 0;
          } else {
            end = toFinite(end);
          }
          number2 = toNumber(number2);
          return baseInRange(number2, start2, end);
        }
        function random(lower, upper, floating) {
          if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
            upper = floating = undefined2;
          }
          if (floating === undefined2) {
            if (typeof upper == "boolean") {
              floating = upper;
              upper = undefined2;
            } else if (typeof lower == "boolean") {
              floating = lower;
              lower = undefined2;
            }
          }
          if (lower === undefined2 && upper === undefined2) {
            lower = 0;
            upper = 1;
          } else {
            lower = toFinite(lower);
            if (upper === undefined2) {
              upper = lower;
              lower = 0;
            } else {
              upper = toFinite(upper);
            }
          }
          if (lower > upper) {
            var temp = lower;
            lower = upper;
            upper = temp;
          }
          if (floating || lower % 1 || upper % 1) {
            var rand = nativeRandom();
            return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
          }
          return baseRandom(lower, upper);
        }
        var camelCase = createCompounder(function(result2, word, index) {
          word = word.toLowerCase();
          return result2 + (index ? capitalize(word) : word);
        });
        function capitalize(string) {
          return upperFirst(toString7(string).toLowerCase());
        }
        function deburr(string) {
          string = toString7(string);
          return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
        }
        function endsWith(string, target, position) {
          string = toString7(string);
          target = baseToString(target);
          var length = string.length;
          position = position === undefined2 ? length : baseClamp(toInteger2(position), 0, length);
          var end = position;
          position -= target.length;
          return position >= 0 && string.slice(position, end) == target;
        }
        function escape(string) {
          string = toString7(string);
          return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
        }
        function escapeRegExp(string) {
          string = toString7(string);
          return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
        }
        var kebabCase = createCompounder(function(result2, word, index) {
          return result2 + (index ? "-" : "") + word.toLowerCase();
        });
        var lowerCase = createCompounder(function(result2, word, index) {
          return result2 + (index ? " " : "") + word.toLowerCase();
        });
        var lowerFirst = createCaseFirst("toLowerCase");
        function pad(string, length, chars) {
          string = toString7(string);
          length = toInteger2(length);
          var strLength = length ? stringSize(string) : 0;
          if (!length || strLength >= length) {
            return string;
          }
          var mid = (length - strLength) / 2;
          return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
        }
        function padEnd(string, length, chars) {
          string = toString7(string);
          length = toInteger2(length);
          var strLength = length ? stringSize(string) : 0;
          return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
        }
        function padStart(string, length, chars) {
          string = toString7(string);
          length = toInteger2(length);
          var strLength = length ? stringSize(string) : 0;
          return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
        }
        function parseInt2(string, radix, guard) {
          if (guard || radix == null) {
            radix = 0;
          } else if (radix) {
            radix = +radix;
          }
          return nativeParseInt(toString7(string).replace(reTrimStart, ""), radix || 0);
        }
        function repeat(string, n, guard) {
          if (guard ? isIterateeCall(string, n, guard) : n === undefined2) {
            n = 1;
          } else {
            n = toInteger2(n);
          }
          return baseRepeat(toString7(string), n);
        }
        function replace() {
          var args = arguments, string = toString7(args[0]);
          return args.length < 3 ? string : string.replace(args[1], args[2]);
        }
        var snakeCase = createCompounder(function(result2, word, index) {
          return result2 + (index ? "_" : "") + word.toLowerCase();
        });
        function split(string, separator, limit) {
          if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
            separator = limit = undefined2;
          }
          limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0;
          if (!limit) {
            return [];
          }
          string = toString7(string);
          if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
            separator = baseToString(separator);
            if (!separator && hasUnicode(string)) {
              return castSlice(stringToArray(string), 0, limit);
            }
          }
          return string.split(separator, limit);
        }
        var startCase = createCompounder(function(result2, word, index) {
          return result2 + (index ? " " : "") + upperFirst(word);
        });
        function startsWith(string, target, position) {
          string = toString7(string);
          position = position == null ? 0 : baseClamp(toInteger2(position), 0, string.length);
          target = baseToString(target);
          return string.slice(position, position + target.length) == target;
        }
        function template(string, options, guard) {
          var settings = lodash.templateSettings;
          if (guard && isIterateeCall(string, options, guard)) {
            options = undefined2;
          }
          string = toString7(string);
          options = assignInWith({}, options, settings, customDefaultsAssignIn);
          var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
          var isEscaping, isEvaluating, index = 0, interpolate2 = options.interpolate || reNoMatch, source = "__p += '";
          var reDelimiters = RegExp2(
            (options.escape || reNoMatch).source + "|" + interpolate2.source + "|" + (interpolate2 === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
            "g"
          );
          var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
          string.replace(reDelimiters, function(match2, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset2) {
            interpolateValue || (interpolateValue = esTemplateValue);
            source += string.slice(index, offset2).replace(reUnescapedString, escapeStringChar);
            if (escapeValue) {
              isEscaping = true;
              source += "' +\n__e(" + escapeValue + ") +\n'";
            }
            if (evaluateValue) {
              isEvaluating = true;
              source += "';\n" + evaluateValue + ";\n__p += '";
            }
            if (interpolateValue) {
              source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
            }
            index = offset2 + match2.length;
            return match2;
          });
          source += "';\n";
          var variable = hasOwnProperty.call(options, "variable") && options.variable;
          if (!variable) {
            source = "with (obj) {\n" + source + "\n}\n";
          } else if (reForbiddenIdentifierChars.test(variable)) {
            throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
          }
          source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
          source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
          var result2 = attempt(function() {
            return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues);
          });
          result2.source = source;
          if (isError(result2)) {
            throw result2;
          }
          return result2;
        }
        function toLower(value) {
          return toString7(value).toLowerCase();
        }
        function toUpper(value) {
          return toString7(value).toUpperCase();
        }
        function trim(string, chars, guard) {
          string = toString7(string);
          if (string && (guard || chars === undefined2)) {
            return baseTrim(string);
          }
          if (!string || !(chars = baseToString(chars))) {
            return string;
          }
          var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start2 = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
          return castSlice(strSymbols, start2, end).join("");
        }
        function trimEnd(string, chars, guard) {
          string = toString7(string);
          if (string && (guard || chars === undefined2)) {
            return string.slice(0, trimmedEndIndex(string) + 1);
          }
          if (!string || !(chars = baseToString(chars))) {
            return string;
          }
          var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
          return castSlice(strSymbols, 0, end).join("");
        }
        function trimStart(string, chars, guard) {
          string = toString7(string);
          if (string && (guard || chars === undefined2)) {
            return string.replace(reTrimStart, "");
          }
          if (!string || !(chars = baseToString(chars))) {
            return string;
          }
          var strSymbols = stringToArray(string), start2 = charsStartIndex(strSymbols, stringToArray(chars));
          return castSlice(strSymbols, start2).join("");
        }
        function truncate(string, options) {
          var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
          if (isObject2(options)) {
            var separator = "separator" in options ? options.separator : separator;
            length = "length" in options ? toInteger2(options.length) : length;
            omission = "omission" in options ? baseToString(options.omission) : omission;
          }
          string = toString7(string);
          var strLength = string.length;
          if (hasUnicode(string)) {
            var strSymbols = stringToArray(string);
            strLength = strSymbols.length;
          }
          if (length >= strLength) {
            return string;
          }
          var end = length - stringSize(omission);
          if (end < 1) {
            return omission;
          }
          var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
          if (separator === undefined2) {
            return result2 + omission;
          }
          if (strSymbols) {
            end += result2.length - end;
          }
          if (isRegExp(separator)) {
            if (string.slice(end).search(separator)) {
              var match2, substring = result2;
              if (!separator.global) {
                separator = RegExp2(separator.source, toString7(reFlags.exec(separator)) + "g");
              }
              separator.lastIndex = 0;
              while (match2 = separator.exec(substring)) {
                var newEnd = match2.index;
              }
              result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd);
            }
          } else if (string.indexOf(baseToString(separator), end) != end) {
            var index = result2.lastIndexOf(separator);
            if (index > -1) {
              result2 = result2.slice(0, index);
            }
          }
          return result2 + omission;
        }
        function unescape2(string) {
          string = toString7(string);
          return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
        }
        var upperCase = createCompounder(function(result2, word, index) {
          return result2 + (index ? " " : "") + word.toUpperCase();
        });
        var upperFirst = createCaseFirst("toUpperCase");
        function words(string, pattern, guard) {
          string = toString7(string);
          pattern = guard ? undefined2 : pattern;
          if (pattern === undefined2) {
            return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
          }
          return string.match(pattern) || [];
        }
        var attempt = baseRest(function(func, args) {
          try {
            return apply2(func, undefined2, args);
          } catch (e) {
            return isError(e) ? e : new Error2(e);
          }
        });
        var bindAll = flatRest(function(object, methodNames) {
          arrayEach(methodNames, function(key) {
            key = toKey(key);
            baseAssignValue(object, key, bind2(object[key], object));
          });
          return object;
        });
        function cond(pairs) {
          var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
          pairs = !length ? [] : arrayMap(pairs, function(pair) {
            if (typeof pair[1] != "function") {
              throw new TypeError2(FUNC_ERROR_TEXT);
            }
            return [toIteratee(pair[0]), pair[1]];
          });
          return baseRest(function(args) {
            var index = -1;
            while (++index < length) {
              var pair = pairs[index];
              if (apply2(pair[0], this, args)) {
                return apply2(pair[1], this, args);
              }
            }
          });
        }
        function conforms(source) {
          return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
        }
        function constant(value) {
          return function() {
            return value;
          };
        }
        function defaultTo(value, defaultValue) {
          return value == null || value !== value ? defaultValue : value;
        }
        var flow = createFlow();
        var flowRight = createFlow(true);
        function identity3(value) {
          return value;
        }
        function iteratee(func) {
          return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
        }
        function matches(source) {
          return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
        }
        function matchesProperty(path, srcValue) {
          return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
        }
        var method = baseRest(function(path, args) {
          return function(object) {
            return baseInvoke(object, path, args);
          };
        });
        var methodOf = baseRest(function(object, args) {
          return function(path) {
            return baseInvoke(object, path, args);
          };
        });
        function mixin(object, source, options) {
          var props = keys(source), methodNames = baseFunctions(source, props);
          if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
            options = source;
            source = object;
            object = this;
            methodNames = baseFunctions(source, keys(source));
          }
          var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction5(object);
          arrayEach(methodNames, function(methodName) {
            var func = source[methodName];
            object[methodName] = func;
            if (isFunc) {
              object.prototype[methodName] = function() {
                var chainAll = this.__chain__;
                if (chain2 || chainAll) {
                  var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
                  actions.push({ "func": func, "args": arguments, "thisArg": object });
                  result2.__chain__ = chainAll;
                  return result2;
                }
                return func.apply(object, arrayPush([this.value()], arguments));
              };
            }
          });
          return object;
        }
        function noConflict() {
          if (root._ === this) {
            root._ = oldDash;
          }
          return this;
        }
        function noop5() {
        }
        function nthArg(n) {
          n = toInteger2(n);
          return baseRest(function(args) {
            return baseNth(args, n);
          });
        }
        var over = createOver(arrayMap);
        var overEvery = createOver(arrayEvery);
        var overSome = createOver(arraySome);
        function property(path) {
          return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
        }
        function propertyOf(object) {
          return function(path) {
            return object == null ? undefined2 : baseGet(object, path);
          };
        }
        var range2 = createRange();
        var rangeRight = createRange(true);
        function stubArray() {
          return [];
        }
        function stubFalse() {
          return false;
        }
        function stubObject() {
          return {};
        }
        function stubString() {
          return "";
        }
        function stubTrue() {
          return true;
        }
        function times(n, iteratee2) {
          n = toInteger2(n);
          if (n < 1 || n > MAX_SAFE_INTEGER) {
            return [];
          }
          var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
          iteratee2 = getIteratee(iteratee2);
          n -= MAX_ARRAY_LENGTH;
          var result2 = baseTimes(length, iteratee2);
          while (++index < n) {
            iteratee2(index);
          }
          return result2;
        }
        function toPath(value) {
          if (isArray4(value)) {
            return arrayMap(value, toKey);
          }
          return isSymbol(value) ? [value] : copyArray(stringToPath(toString7(value)));
        }
        function uniqueId(prefix) {
          var id2 = ++idCounter;
          return toString7(prefix) + id2;
        }
        var add5 = createMathOperation(function(augend, addend) {
          return augend + addend;
        }, 0);
        var ceil2 = createRound("ceil");
        var divide = createMathOperation(function(dividend, divisor) {
          return dividend / divisor;
        }, 1);
        var floor2 = createRound("floor");
        function max(array2) {
          return array2 && array2.length ? baseExtremum(array2, identity3, baseGt) : undefined2;
        }
        function maxBy(array2, iteratee2) {
          return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseGt) : undefined2;
        }
        function mean(array2) {
          return baseMean(array2, identity3);
        }
        function meanBy(array2, iteratee2) {
          return baseMean(array2, getIteratee(iteratee2, 2));
        }
        function min(array2) {
          return array2 && array2.length ? baseExtremum(array2, identity3, baseLt) : undefined2;
        }
        function minBy(array2, iteratee2) {
          return array2 && array2.length ? baseExtremum(array2, getIteratee(iteratee2, 2), baseLt) : undefined2;
        }
        var multiply2 = createMathOperation(function(multiplier, multiplicand) {
          return multiplier * multiplicand;
        }, 1);
        var round2 = createRound("round");
        var subtract = createMathOperation(function(minuend, subtrahend) {
          return minuend - subtrahend;
        }, 0);
        function sum(array2) {
          return array2 && array2.length ? baseSum(array2, identity3) : 0;
        }
        function sumBy(array2, iteratee2) {
          return array2 && array2.length ? baseSum(array2, getIteratee(iteratee2, 2)) : 0;
        }
        lodash.after = after;
        lodash.ary = ary;
        lodash.assign = assign2;
        lodash.assignIn = assignIn;
        lodash.assignInWith = assignInWith;
        lodash.assignWith = assignWith;
        lodash.at = at;
        lodash.before = before;
        lodash.bind = bind2;
        lodash.bindAll = bindAll;
        lodash.bindKey = bindKey;
        lodash.castArray = castArray;
        lodash.chain = chain;
        lodash.chunk = chunk2;
        lodash.compact = compact;
        lodash.concat = concat4;
        lodash.cond = cond;
        lodash.conforms = conforms;
        lodash.constant = constant;
        lodash.countBy = countBy;
        lodash.create = create4;
        lodash.curry = curry;
        lodash.curryRight = curryRight;
        lodash.debounce = debounce;
        lodash.defaults = defaults4;
        lodash.defaultsDeep = defaultsDeep;
        lodash.defer = defer2;
        lodash.delay = delay2;
        lodash.difference = difference;
        lodash.differenceBy = differenceBy;
        lodash.differenceWith = differenceWith;
        lodash.drop = drop;
        lodash.dropRight = dropRight;
        lodash.dropRightWhile = dropRightWhile;
        lodash.dropWhile = dropWhile;
        lodash.fill = fill;
        lodash.filter = filter2;
        lodash.flatMap = flatMap;
        lodash.flatMapDeep = flatMapDeep;
        lodash.flatMapDepth = flatMapDepth;
        lodash.flatten = flatten2;
        lodash.flattenDeep = flattenDeep;
        lodash.flattenDepth = flattenDepth;
        lodash.flip = flip;
        lodash.flow = flow;
        lodash.flowRight = flowRight;
        lodash.fromPairs = fromPairs;
        lodash.functions = functions;
        lodash.functionsIn = functionsIn;
        lodash.groupBy = groupBy;
        lodash.initial = initial;
        lodash.intersection = intersection;
        lodash.intersectionBy = intersectionBy;
        lodash.intersectionWith = intersectionWith;
        lodash.invert = invert;
        lodash.invertBy = invertBy;
        lodash.invokeMap = invokeMap;
        lodash.iteratee = iteratee;
        lodash.keyBy = keyBy;
        lodash.keys = keys;
        lodash.keysIn = keysIn;
        lodash.map = map2;
        lodash.mapKeys = mapKeys;
        lodash.mapValues = mapValues;
        lodash.matches = matches;
        lodash.matchesProperty = matchesProperty;
        lodash.memoize = memoize;
        lodash.merge = merge3;
        lodash.mergeWith = mergeWith;
        lodash.method = method;
        lodash.methodOf = methodOf;
        lodash.mixin = mixin;
        lodash.negate = negate;
        lodash.nthArg = nthArg;
        lodash.omit = omit;
        lodash.omitBy = omitBy;
        lodash.once = once;
        lodash.orderBy = orderBy;
        lodash.over = over;
        lodash.overArgs = overArgs;
        lodash.overEvery = overEvery;
        lodash.overSome = overSome;
        lodash.partial = partial;
        lodash.partialRight = partialRight;
        lodash.partition = partition;
        lodash.pick = pick;
        lodash.pickBy = pickBy;
        lodash.property = property;
        lodash.propertyOf = propertyOf;
        lodash.pull = pull;
        lodash.pullAll = pullAll;
        lodash.pullAllBy = pullAllBy;
        lodash.pullAllWith = pullAllWith;
        lodash.pullAt = pullAt;
        lodash.range = range2;
        lodash.rangeRight = rangeRight;
        lodash.rearg = rearg;
        lodash.reject = reject;
        lodash.remove = remove2;
        lodash.rest = rest;
        lodash.reverse = reverse;
        lodash.sampleSize = sampleSize;
        lodash.set = set2;
        lodash.setWith = setWith;
        lodash.shuffle = shuffle;
        lodash.slice = slice;
        lodash.sortBy = sortBy;
        lodash.sortedUniq = sortedUniq;
        lodash.sortedUniqBy = sortedUniqBy;
        lodash.split = split;
        lodash.spread = spread;
        lodash.tail = tail;
        lodash.take = take2;
        lodash.takeRight = takeRight;
        lodash.takeRightWhile = takeRightWhile;
        lodash.takeWhile = takeWhile2;
        lodash.tap = tap2;
        lodash.throttle = throttle;
        lodash.thru = thru;
        lodash.toArray = toArray2;
        lodash.toPairs = toPairs;
        lodash.toPairsIn = toPairsIn;
        lodash.toPath = toPath;
        lodash.toPlainObject = toPlainObject;
        lodash.transform = transform3;
        lodash.unary = unary;
        lodash.union = union;
        lodash.unionBy = unionBy;
        lodash.unionWith = unionWith;
        lodash.uniq = uniq;
        lodash.uniqBy = uniqBy;
        lodash.uniqWith = uniqWith;
        lodash.unset = unset;
        lodash.unzip = unzip;
        lodash.unzipWith = unzipWith;
        lodash.update = update;
        lodash.updateWith = updateWith;
        lodash.values = values;
        lodash.valuesIn = valuesIn;
        lodash.without = without;
        lodash.words = words;
        lodash.wrap = wrap;
        lodash.xor = xor;
        lodash.xorBy = xorBy;
        lodash.xorWith = xorWith;
        lodash.zip = zip;
        lodash.zipObject = zipObject;
        lodash.zipObjectDeep = zipObjectDeep;
        lodash.zipWith = zipWith;
        lodash.entries = toPairs;
        lodash.entriesIn = toPairsIn;
        lodash.extend = assignIn;
        lodash.extendWith = assignInWith;
        mixin(lodash, lodash);
        lodash.add = add5;
        lodash.attempt = attempt;
        lodash.camelCase = camelCase;
        lodash.capitalize = capitalize;
        lodash.ceil = ceil2;
        lodash.clamp = clamp2;
        lodash.clone = clone2;
        lodash.cloneDeep = cloneDeep7;
        lodash.cloneDeepWith = cloneDeepWith;
        lodash.cloneWith = cloneWith;
        lodash.conformsTo = conformsTo;
        lodash.deburr = deburr;
        lodash.defaultTo = defaultTo;
        lodash.divide = divide;
        lodash.endsWith = endsWith;
        lodash.eq = eq2;
        lodash.escape = escape;
        lodash.escapeRegExp = escapeRegExp;
        lodash.every = every;
        lodash.find = find3;
        lodash.findIndex = findIndex;
        lodash.findKey = findKey;
        lodash.findLast = findLast;
        lodash.findLastIndex = findLastIndex;
        lodash.findLastKey = findLastKey;
        lodash.floor = floor2;
        lodash.forEach = forEach2;
        lodash.forEachRight = forEachRight;
        lodash.forIn = forIn;
        lodash.forInRight = forInRight;
        lodash.forOwn = forOwn;
        lodash.forOwnRight = forOwnRight;
        lodash.get = get8;
        lodash.gt = gt2;
        lodash.gte = gte;
        lodash.has = has3;
        lodash.hasIn = hasIn;
        lodash.head = head;
        lodash.identity = identity3;
        lodash.includes = includes2;
        lodash.indexOf = indexOf2;
        lodash.inRange = inRange;
        lodash.invoke = invoke;
        lodash.isArguments = isArguments;
        lodash.isArray = isArray4;
        lodash.isArrayBuffer = isArrayBuffer2;
        lodash.isArrayLike = isArrayLike2;
        lodash.isArrayLikeObject = isArrayLikeObject;
        lodash.isBoolean = isBoolean;
        lodash.isBuffer = isBuffer;
        lodash.isDate = isDate2;
        lodash.isElement = isElement2;
        lodash.isEmpty = isEmpty4;
        lodash.isEqual = isEqual4;
        lodash.isEqualWith = isEqualWith;
        lodash.isError = isError;
        lodash.isFinite = isFinite2;
        lodash.isFunction = isFunction5;
        lodash.isInteger = isInteger;
        lodash.isLength = isLength;
        lodash.isMap = isMap;
        lodash.isMatch = isMatch;
        lodash.isMatchWith = isMatchWith;
        lodash.isNaN = isNaN2;
        lodash.isNative = isNative;
        lodash.isNil = isNil;
        lodash.isNull = isNull;
        lodash.isNumber = isNumber6;
        lodash.isObject = isObject2;
        lodash.isObjectLike = isObjectLike;
        lodash.isPlainObject = isPlainObject;
        lodash.isRegExp = isRegExp;
        lodash.isSafeInteger = isSafeInteger;
        lodash.isSet = isSet;
        lodash.isString = isString2;
        lodash.isSymbol = isSymbol;
        lodash.isTypedArray = isTypedArray;
        lodash.isUndefined = isUndefined;
        lodash.isWeakMap = isWeakMap;
        lodash.isWeakSet = isWeakSet;
        lodash.join = join;
        lodash.kebabCase = kebabCase;
        lodash.last = last2;
        lodash.lastIndexOf = lastIndexOf;
        lodash.lowerCase = lowerCase;
        lodash.lowerFirst = lowerFirst;
        lodash.lt = lt2;
        lodash.lte = lte;
        lodash.max = max;
        lodash.maxBy = maxBy;
        lodash.mean = mean;
        lodash.meanBy = meanBy;
        lodash.min = min;
        lodash.minBy = minBy;
        lodash.stubArray = stubArray;
        lodash.stubFalse = stubFalse;
        lodash.stubObject = stubObject;
        lodash.stubString = stubString;
        lodash.stubTrue = stubTrue;
        lodash.multiply = multiply2;
        lodash.nth = nth2;
        lodash.noConflict = noConflict;
        lodash.noop = noop5;
        lodash.now = now;
        lodash.pad = pad;
        lodash.padEnd = padEnd;
        lodash.padStart = padStart;
        lodash.parseInt = parseInt2;
        lodash.random = random;
        lodash.reduce = reduce;
        lodash.reduceRight = reduceRight;
        lodash.repeat = repeat;
        lodash.replace = replace;
        lodash.result = result;
        lodash.round = round2;
        lodash.runInContext = runInContext2;
        lodash.sample = sample;
        lodash.size = size;
        lodash.snakeCase = snakeCase;
        lodash.some = some;
        lodash.sortedIndex = sortedIndex;
        lodash.sortedIndexBy = sortedIndexBy;
        lodash.sortedIndexOf = sortedIndexOf;
        lodash.sortedLastIndex = sortedLastIndex;
        lodash.sortedLastIndexBy = sortedLastIndexBy;
        lodash.sortedLastIndexOf = sortedLastIndexOf;
        lodash.startCase = startCase;
        lodash.startsWith = startsWith;
        lodash.subtract = subtract;
        lodash.sum = sum;
        lodash.sumBy = sumBy;
        lodash.template = template;
        lodash.times = times;
        lodash.toFinite = toFinite;
        lodash.toInteger = toInteger2;
        lodash.toLength = toLength;
        lodash.toLower = toLower;
        lodash.toNumber = toNumber;
        lodash.toSafeInteger = toSafeInteger;
        lodash.toString = toString7;
        lodash.toUpper = toUpper;
        lodash.trim = trim;
        lodash.trimEnd = trimEnd;
        lodash.trimStart = trimStart;
        lodash.truncate = truncate;
        lodash.unescape = unescape2;
        lodash.uniqueId = uniqueId;
        lodash.upperCase = upperCase;
        lodash.upperFirst = upperFirst;
        lodash.each = forEach2;
        lodash.eachRight = forEachRight;
        lodash.first = head;
        mixin(lodash, function() {
          var source = {};
          baseForOwn(lodash, function(func, methodName) {
            if (!hasOwnProperty.call(lodash.prototype, methodName)) {
              source[methodName] = func;
            }
          });
          return source;
        }(), { "chain": false });
        lodash.VERSION = VERSION10;
        arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
          lodash[methodName].placeholder = lodash;
        });
        arrayEach(["drop", "take"], function(methodName, index) {
          LazyWrapper.prototype[methodName] = function(n) {
            n = n === undefined2 ? 1 : nativeMax(toInteger2(n), 0);
            var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
            if (result2.__filtered__) {
              result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
            } else {
              result2.__views__.push({
                "size": nativeMin(n, MAX_ARRAY_LENGTH),
                "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
              });
            }
            return result2;
          };
          LazyWrapper.prototype[methodName + "Right"] = function(n) {
            return this.reverse()[methodName](n).reverse();
          };
        });
        arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
          var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
          LazyWrapper.prototype[methodName] = function(iteratee2) {
            var result2 = this.clone();
            result2.__iteratees__.push({
              "iteratee": getIteratee(iteratee2, 3),
              "type": type
            });
            result2.__filtered__ = result2.__filtered__ || isFilter;
            return result2;
          };
        });
        arrayEach(["head", "last"], function(methodName, index) {
          var takeName = "take" + (index ? "Right" : "");
          LazyWrapper.prototype[methodName] = function() {
            return this[takeName](1).value()[0];
          };
        });
        arrayEach(["initial", "tail"], function(methodName, index) {
          var dropName = "drop" + (index ? "" : "Right");
          LazyWrapper.prototype[methodName] = function() {
            return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
          };
        });
        LazyWrapper.prototype.compact = function() {
          return this.filter(identity3);
        };
        LazyWrapper.prototype.find = function(predicate) {
          return this.filter(predicate).head();
        };
        LazyWrapper.prototype.findLast = function(predicate) {
          return this.reverse().find(predicate);
        };
        LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
          if (typeof path == "function") {
            return new LazyWrapper(this);
          }
          return this.map(function(value) {
            return baseInvoke(value, path, args);
          });
        });
        LazyWrapper.prototype.reject = function(predicate) {
          return this.filter(negate(getIteratee(predicate)));
        };
        LazyWrapper.prototype.slice = function(start2, end) {
          start2 = toInteger2(start2);
          var result2 = this;
          if (result2.__filtered__ && (start2 > 0 || end < 0)) {
            return new LazyWrapper(result2);
          }
          if (start2 < 0) {
            result2 = result2.takeRight(-start2);
          } else if (start2) {
            result2 = result2.drop(start2);
          }
          if (end !== undefined2) {
            end = toInteger2(end);
            result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start2);
          }
          return result2;
        };
        LazyWrapper.prototype.takeRightWhile = function(predicate) {
          return this.reverse().takeWhile(predicate).reverse();
        };
        LazyWrapper.prototype.toArray = function() {
          return this.take(MAX_ARRAY_LENGTH);
        };
        baseForOwn(LazyWrapper.prototype, function(func, methodName) {
          var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
          if (!lodashFunc) {
            return;
          }
          lodash.prototype[methodName] = function() {
            var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray4(value);
            var interceptor = function(value2) {
              var result3 = lodashFunc.apply(lodash, arrayPush([value2], args));
              return isTaker && chainAll ? result3[0] : result3;
            };
            if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
              isLazy = useLazy = false;
            }
            var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
            if (!retUnwrapped && useLazy) {
              value = onlyLazy ? value : new LazyWrapper(this);
              var result2 = func.apply(value, args);
              result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 });
              return new LodashWrapper(result2, chainAll);
            }
            if (isUnwrapped && onlyLazy) {
              return func.apply(this, args);
            }
            result2 = this.thru(interceptor);
            return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
          };
        });
        arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
          var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
          lodash.prototype[methodName] = function() {
            var args = arguments;
            if (retUnwrapped && !this.__chain__) {
              var value = this.value();
              return func.apply(isArray4(value) ? value : [], args);
            }
            return this[chainName](function(value2) {
              return func.apply(isArray4(value2) ? value2 : [], args);
            });
          };
        });
        baseForOwn(LazyWrapper.prototype, function(func, methodName) {
          var lodashFunc = lodash[methodName];
          if (lodashFunc) {
            var key = lodashFunc.name + "";
            if (!hasOwnProperty.call(realNames, key)) {
              realNames[key] = [];
            }
            realNames[key].push({ "name": methodName, "func": lodashFunc });
          }
        });
        realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{
          "name": "wrapper",
          "func": undefined2
        }];
        LazyWrapper.prototype.clone = lazyClone;
        LazyWrapper.prototype.reverse = lazyReverse;
        LazyWrapper.prototype.value = lazyValue;
        lodash.prototype.at = wrapperAt;
        lodash.prototype.chain = wrapperChain;
        lodash.prototype.commit = wrapperCommit;
        lodash.prototype.next = wrapperNext;
        lodash.prototype.plant = wrapperPlant;
        lodash.prototype.reverse = wrapperReverse;
        lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
        lodash.prototype.first = lodash.prototype.head;
        if (symIterator) {
          lodash.prototype[symIterator] = wrapperToIterator;
        }
        return lodash;
      };
      var _ = runInContext();
      if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
        root._ = _;
        define(function() {
          return _;
        });
      } else if (freeModule) {
        (freeModule.exports = _)._ = _;
        freeExports._ = _;
      } else {
        root._ = _;
      }
    }).call(exports4);
  }
});

// node_modules/esri-loader/dist/umd/esri-loader.js
var require_esri_loader = __commonJS({
  "node_modules/esri-loader/dist/umd/esri-loader.js"(exports4, module2) {
    (function(global2, factory2) {
      typeof exports4 === "object" && typeof module2 !== "undefined" ? factory2(exports4) : typeof define === "function" && define.amd ? define(["exports"], factory2) : factory2(global2.esriLoader = global2.esriLoader || {});
    })(exports4, function(exports5) {
      "use strict";
      var DEFAULT_VERSION2 = "4.17";
      var NEXT2 = "next";
      function parseVersion(version) {
        if (version.toLowerCase() === NEXT2) {
          return NEXT2;
        }
        var match2 = version && version.match(/^(\d)\.(\d+)/);
        return match2 && {
          major: parseInt(match2[1], 10),
          minor: parseInt(match2[2], 10)
        };
      }
      function getCdnUrl(version) {
        if (version === void 0) {
          version = DEFAULT_VERSION2;
        }
        return "https://js.arcgis.com/" + version + "/";
      }
      function getCdnCssUrl(version) {
        if (version === void 0) {
          version = DEFAULT_VERSION2;
        }
        var baseUrl = getCdnUrl(version);
        var parsedVersion = parseVersion(version);
        if (parsedVersion !== NEXT2 && parsedVersion.major === 3) {
          var path = parsedVersion.minor <= 10 ? "js/" : "";
          return "" + baseUrl + path + "esri/css/esri.css";
        } else {
          return baseUrl + "esri/themes/light/main.css";
        }
      }
      function createStylesheetLink(href) {
        var link = document.createElement("link");
        link.rel = "stylesheet";
        link.href = href;
        return link;
      }
      function insertLink(link, before) {
        if (before) {
          var beforeNode = document.querySelector(before);
          beforeNode.parentNode.insertBefore(link, beforeNode);
        } else {
          document.head.appendChild(link);
        }
      }
      function getCss(url) {
        return document.querySelector('link[href*="' + url + '"]');
      }
      function getCssUrl(urlOrVersion) {
        return !urlOrVersion || parseVersion(urlOrVersion) ? getCdnCssUrl(urlOrVersion) : urlOrVersion;
      }
      function loadCss(urlOrVersion, before) {
        var url = getCssUrl(urlOrVersion);
        var link = getCss(url);
        if (!link) {
          link = createStylesheetLink(url);
          insertLink(link, before);
        }
        return link;
      }
      var isBrowser = typeof window !== "undefined";
      var utils = {
        Promise: isBrowser ? window["Promise"] : void 0
      };
      var defaultOptions2 = {};
      function createScript(url) {
        var script = document.createElement("script");
        script.type = "text/javascript";
        script.src = url;
        script.setAttribute("data-esri-loader", "loading");
        return script;
      }
      function handleScriptLoad(script, callback, errback) {
        var onScriptError;
        if (errback) {
          onScriptError = handleScriptError(script, errback);
        }
        var onScriptLoad = function() {
          callback(script);
          script.removeEventListener("load", onScriptLoad, false);
          if (onScriptError) {
            script.removeEventListener("error", onScriptError, false);
          }
        };
        script.addEventListener("load", onScriptLoad, false);
      }
      function handleScriptError(script, callback) {
        var onScriptError = function(e) {
          callback(e.error || new Error("There was an error attempting to load " + script.src));
          script.removeEventListener("error", onScriptError, false);
        };
        script.addEventListener("error", onScriptError, false);
        return onScriptError;
      }
      function setDefaultOptions2(options) {
        if (options === void 0) {
          options = {};
        }
        defaultOptions2 = options;
      }
      function getScript() {
        return document.querySelector("script[data-esri-loader]");
      }
      function isLoaded() {
        var globalRequire = window["require"];
        return globalRequire && globalRequire.on;
      }
      function loadScript(options) {
        if (options === void 0) {
          options = {};
        }
        var opts = {};
        [defaultOptions2, options].forEach(function(obj) {
          for (var prop in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, prop)) {
              opts[prop] = obj[prop];
            }
          }
        });
        var version = opts.version;
        var url = opts.url || getCdnUrl(version);
        return new utils.Promise(function(resolve, reject) {
          var script = getScript();
          if (script) {
            var src = script.getAttribute("src");
            if (src !== url) {
              reject(new Error("The ArcGIS API for JavaScript is already loaded (" + src + ")."));
            } else {
              if (isLoaded()) {
                resolve(script);
              } else {
                handleScriptLoad(script, resolve, reject);
              }
            }
          } else {
            if (isLoaded()) {
              reject(new Error("The ArcGIS API for JavaScript is already loaded."));
            } else {
              var css = opts.css;
              if (css) {
                var useVersion = css === true;
                loadCss(useVersion ? version : css, opts.insertCssBefore);
              }
              if (opts.dojoConfig) {
                window["dojoConfig"] = opts.dojoConfig;
              }
              script = createScript(url);
              handleScriptLoad(script, function() {
                script.setAttribute("data-esri-loader", "loaded");
                resolve(script);
              }, reject);
              document.body.appendChild(script);
            }
          }
        });
      }
      function requireModules(modules2) {
        return new utils.Promise(function(resolve, reject) {
          var errorHandler2 = window["require"].on("error", reject);
          window["require"](modules2, function() {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              args[_i] = arguments[_i];
            }
            errorHandler2.remove();
            resolve(args);
          });
        });
      }
      function loadModules2(modules2, loadScriptOptions) {
        if (loadScriptOptions === void 0) {
          loadScriptOptions = {};
        }
        if (!isLoaded()) {
          var script = getScript();
          var src = script && script.getAttribute("src");
          if (!loadScriptOptions.url && src) {
            loadScriptOptions.url = src;
          }
          return loadScript(loadScriptOptions).then(function() {
            return requireModules(modules2);
          });
        } else {
          return requireModules(modules2);
        }
      }
      var esriLoader = {
        getScript,
        isLoaded,
        loadModules: loadModules2,
        loadScript,
        loadCss,
        setDefaultOptions: setDefaultOptions2,
        utils
      };
      exports5.getScript = getScript;
      exports5.isLoaded = isLoaded;
      exports5.loadModules = loadModules2;
      exports5.loadScript = loadScript;
      exports5.loadCss = loadCss;
      exports5.setDefaultOptions = setDefaultOptions2;
      exports5.utils = utils;
      exports5["default"] = esriLoader;
      Object.defineProperty(exports5, "__esModule", { value: true });
    });
  }
});

// node_modules/markerwithlabel/index.js
var require_markerwithlabel = __commonJS({
  "node_modules/markerwithlabel/index.js"(exports4, module2) {
    function inherits(childCtor, parentCtor) {
      function tempCtor() {
      }
      ;
      tempCtor.prototype = parentCtor.prototype;
      childCtor.superClass_ = parentCtor.prototype;
      childCtor.prototype = new tempCtor();
      childCtor.prototype.constructor = childCtor;
    }
    module2.exports = function(gMapsApi) {
      function MarkerLabel_(marker, crossURL, handCursorURL) {
        this.marker_ = marker;
        this.handCursorURL_ = marker.handCursorURL;
        this.labelDiv_ = document.createElement("div");
        this.labelDiv_.style.cssText = "position: absolute; overflow: hidden;";
        this.eventDiv_ = document.createElement("div");
        this.eventDiv_.style.cssText = this.labelDiv_.style.cssText;
        this.eventDiv_.addEventListener("selectstart", function() {
          return false;
        });
        this.eventDiv_.addEventListener("dragstart", function() {
          return false;
        });
        this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL);
      }
      inherits(MarkerLabel_, gMapsApi.OverlayView);
      MarkerLabel_.getSharedCross = function(crossURL) {
        var div;
        if (typeof MarkerLabel_.getSharedCross.crossDiv === "undefined") {
          div = document.createElement("img");
          div.style.cssText = "position: absolute; z-index: 1000002; display: none;";
          div.style.marginLeft = "-8px";
          div.style.marginTop = "-9px";
          div.src = crossURL;
          MarkerLabel_.getSharedCross.crossDiv = div;
        }
        return MarkerLabel_.getSharedCross.crossDiv;
      };
      MarkerLabel_.prototype.onAdd = function() {
        var me = this;
        var cMouseIsDown = false;
        var cDraggingLabel = false;
        var cSavedZIndex;
        var cLatOffset, cLngOffset;
        var cIgnoreClick;
        var cRaiseEnabled;
        var cStartPosition;
        var cStartCenter;
        var cRaiseOffset = 20;
        var cDraggingCursor = "url(" + this.handCursorURL_ + ")";
        var cAbortEvent = function(e) {
          if (e.preventDefault) {
            e.preventDefault();
          }
          e.cancelBubble = true;
          if (e.stopPropagation) {
            e.stopPropagation();
          }
        };
        var cStopBounce = function() {
          me.marker_.setAnimation(null);
        };
        this.getPanes().markerLayer.appendChild(this.labelDiv_);
        this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_);
        if (typeof MarkerLabel_.getSharedCross.processed === "undefined") {
          this.getPanes().markerLayer.appendChild(this.crossDiv_);
          MarkerLabel_.getSharedCross.processed = true;
        }
        this.listeners_ = [
          gMapsApi.event.addDomListener(this.eventDiv_, "mouseover", function(e) {
            if (me.marker_.getDraggable() || me.marker_.getClickable()) {
              this.style.cursor = "pointer";
              gMapsApi.event.trigger(me.marker_, "mouseover", e);
            }
          }),
          gMapsApi.event.addDomListener(this.eventDiv_, "mouseout", function(e) {
            if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) {
              this.style.cursor = me.marker_.getCursor();
              gMapsApi.event.trigger(me.marker_, "mouseout", e);
            }
          }),
          gMapsApi.event.addDomListener(this.eventDiv_, "mousedown", function(e) {
            cDraggingLabel = false;
            if (me.marker_.getDraggable()) {
              cMouseIsDown = true;
              this.style.cursor = cDraggingCursor;
            }
            if (me.marker_.getDraggable() || me.marker_.getClickable()) {
              gMapsApi.event.trigger(me.marker_, "mousedown", e);
              cAbortEvent(e);
            }
          }),
          gMapsApi.event.addDomListener(document, "mouseup", function(mEvent) {
            var position;
            if (cMouseIsDown) {
              cMouseIsDown = false;
              me.eventDiv_.style.cursor = "pointer";
              gMapsApi.event.trigger(me.marker_, "mouseup", mEvent);
            }
            if (cDraggingLabel) {
              if (cRaiseEnabled) {
                position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition());
                position.y += cRaiseOffset;
                me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));
                try {
                  me.marker_.setAnimation(gMapsApi.Animation.BOUNCE);
                  setTimeout(cStopBounce, 1406);
                } catch (e) {
                }
              }
              me.crossDiv_.style.display = "none";
              me.marker_.setZIndex(cSavedZIndex);
              cIgnoreClick = true;
              cDraggingLabel = false;
              mEvent.latLng = me.marker_.getPosition();
              gMapsApi.event.trigger(me.marker_, "dragend", mEvent);
            }
          }),
          gMapsApi.event.addListener(me.marker_.getMap(), "mousemove", function(mEvent) {
            var position;
            if (cMouseIsDown) {
              if (cDraggingLabel) {
                mEvent.latLng = new gMapsApi.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset);
                position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng);
                if (cRaiseEnabled) {
                  me.crossDiv_.style.left = position.x + "px";
                  me.crossDiv_.style.top = position.y + "px";
                  me.crossDiv_.style.display = "";
                  position.y -= cRaiseOffset;
                }
                me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));
                if (cRaiseEnabled) {
                  me.eventDiv_.style.top = position.y + cRaiseOffset + "px";
                }
                gMapsApi.event.trigger(me.marker_, "drag", mEvent);
              } else {
                cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat();
                cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng();
                cSavedZIndex = me.marker_.getZIndex();
                cStartPosition = me.marker_.getPosition();
                cStartCenter = me.marker_.getMap().getCenter();
                cRaiseEnabled = me.marker_.get("raiseOnDrag");
                cDraggingLabel = true;
                me.marker_.setZIndex(1e6);
                mEvent.latLng = me.marker_.getPosition();
                gMapsApi.event.trigger(me.marker_, "dragstart", mEvent);
              }
            }
          }),
          gMapsApi.event.addDomListener(document, "keydown", function(e) {
            if (cDraggingLabel) {
              if (e.keyCode === 27) {
                cRaiseEnabled = false;
                me.marker_.setPosition(cStartPosition);
                me.marker_.getMap().setCenter(cStartCenter);
                gMapsApi.event.trigger(document, "mouseup", e);
              }
            }
          }),
          gMapsApi.event.addDomListener(this.eventDiv_, "click", function(e) {
            if (me.marker_.getDraggable() || me.marker_.getClickable()) {
              if (cIgnoreClick) {
                cIgnoreClick = false;
              } else {
                gMapsApi.event.trigger(me.marker_, "click", e);
                cAbortEvent(e);
              }
            }
          }),
          gMapsApi.event.addDomListener(this.eventDiv_, "dblclick", function(e) {
            if (me.marker_.getDraggable() || me.marker_.getClickable()) {
              gMapsApi.event.trigger(me.marker_, "dblclick", e);
              cAbortEvent(e);
            }
          }),
          gMapsApi.event.addListener(this.marker_, "dragstart", function(mEvent) {
            if (!cDraggingLabel) {
              cRaiseEnabled = this.get("raiseOnDrag");
            }
          }),
          gMapsApi.event.addListener(this.marker_, "drag", function(mEvent) {
            if (!cDraggingLabel) {
              if (cRaiseEnabled) {
                me.setPosition(cRaiseOffset);
                me.labelDiv_.style.zIndex = 1e6 + (this.get("labelInBackground") ? -1 : 1);
              }
            }
          }),
          gMapsApi.event.addListener(this.marker_, "dragend", function(mEvent) {
            if (!cDraggingLabel) {
              if (cRaiseEnabled) {
                me.setPosition(0);
              }
            }
          }),
          gMapsApi.event.addListener(this.marker_, "position_changed", function() {
            me.setPosition();
          }),
          gMapsApi.event.addListener(this.marker_, "zindex_changed", function() {
            me.setZIndex();
          }),
          gMapsApi.event.addListener(this.marker_, "visible_changed", function() {
            me.setVisible();
          }),
          gMapsApi.event.addListener(this.marker_, "labelvisible_changed", function() {
            me.setVisible();
          }),
          gMapsApi.event.addListener(this.marker_, "title_changed", function() {
            me.setTitle();
          }),
          gMapsApi.event.addListener(this.marker_, "labelcontent_changed", function() {
            me.setContent();
          }),
          gMapsApi.event.addListener(this.marker_, "labelanchor_changed", function() {
            me.setAnchor();
          }),
          gMapsApi.event.addListener(this.marker_, "labelclass_changed", function() {
            me.setStyles();
          }),
          gMapsApi.event.addListener(this.marker_, "labelstyle_changed", function() {
            me.setStyles();
          })
        ];
      };
      MarkerLabel_.prototype.onRemove = function() {
        var i2;
        if (this.labelDiv_.parentNode) {
          this.labelDiv_.parentNode.removeChild(this.labelDiv_);
          this.eventDiv_.parentNode.removeChild(this.eventDiv_);
        }
        if (this.listeners_) {
          for (i2 = 0; i2 < this.listeners_.length; i2++) {
            gMapsApi.event.removeListener(this.listeners_[i2]);
          }
        }
      };
      MarkerLabel_.prototype.draw = function() {
        this.setContent();
        this.setTitle();
        this.setStyles();
      };
      MarkerLabel_.prototype.setContent = function() {
        var content = this.marker_.get("labelContent");
        if (typeof content.nodeType === "undefined") {
          this.labelDiv_.innerHTML = content;
          this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;
        } else {
          while (this.labelDiv_.lastChild) {
            this.labelDiv_.removeChild(this.labelDiv_.lastChild);
          }
          while (this.eventDiv_.lastChild) {
            this.eventDiv_.removeChild(this.eventDiv_.lastChild);
          }
          this.labelDiv_.appendChild(content);
          content = content.cloneNode(true);
          this.eventDiv_.appendChild(content);
        }
      };
      MarkerLabel_.prototype.setTitle = function() {
        this.eventDiv_.title = this.marker_.getTitle() || "";
      };
      MarkerLabel_.prototype.setStyles = function() {
        var i2, labelStyle;
        this.labelDiv_.className = this.marker_.get("labelClass");
        this.eventDiv_.className = this.labelDiv_.className;
        this.labelDiv_.style.cssText = "";
        this.eventDiv_.style.cssText = "";
        labelStyle = this.marker_.get("labelStyle");
        for (i2 in labelStyle) {
          if (labelStyle.hasOwnProperty(i2)) {
            this.labelDiv_.style[i2] = labelStyle[i2];
            this.eventDiv_.style[i2] = labelStyle[i2];
          }
        }
        this.setMandatoryStyles();
      };
      MarkerLabel_.prototype.setMandatoryStyles = function() {
        this.labelDiv_.style.position = "absolute";
        this.labelDiv_.style.overflow = "hidden";
        if (typeof this.labelDiv_.style.opacity !== "undefined" && this.labelDiv_.style.opacity !== "") {
          this.labelDiv_.style.MsFilter = '"progid:DXImageTransform.Microsoft.Alpha(opacity=' + this.labelDiv_.style.opacity * 100 + ')"';
          this.labelDiv_.style.filter = "alpha(opacity=" + this.labelDiv_.style.opacity * 100 + ")";
        }
        this.eventDiv_.style.position = this.labelDiv_.style.position;
        this.eventDiv_.style.overflow = this.labelDiv_.style.overflow;
        this.eventDiv_.style.opacity = 0.01;
        this.eventDiv_.style.MsFilter = '"progid:DXImageTransform.Microsoft.Alpha(opacity=1)"';
        this.eventDiv_.style.filter = "alpha(opacity=1)";
        this.setAnchor();
        this.setPosition();
        this.setVisible();
      };
      MarkerLabel_.prototype.setAnchor = function() {
        var anchor2 = this.marker_.get("labelAnchor");
        this.labelDiv_.style.marginLeft = -anchor2.x + "px";
        this.labelDiv_.style.marginTop = -anchor2.y + "px";
        this.eventDiv_.style.marginLeft = -anchor2.x + "px";
        this.eventDiv_.style.marginTop = -anchor2.y + "px";
      };
      MarkerLabel_.prototype.setPosition = function(yOffset) {
        var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());
        if (typeof yOffset === "undefined") {
          yOffset = 0;
        }
        this.labelDiv_.style.left = Math.round(position.x) + "px";
        this.labelDiv_.style.top = Math.round(position.y - yOffset) + "px";
        this.eventDiv_.style.left = this.labelDiv_.style.left;
        this.eventDiv_.style.top = this.labelDiv_.style.top;
        this.setZIndex();
      };
      MarkerLabel_.prototype.setZIndex = function() {
        var zAdjust = this.marker_.get("labelInBackground") ? -1 : 1;
        if (typeof this.marker_.getZIndex() === "undefined") {
          this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust;
          this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;
        } else {
          this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust;
          this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;
        }
      };
      MarkerLabel_.prototype.setVisible = function() {
        if (this.marker_.get("labelVisible")) {
          this.labelDiv_.style.display = this.marker_.getVisible() ? "block" : "none";
        } else {
          this.labelDiv_.style.display = "none";
        }
        this.eventDiv_.style.display = this.labelDiv_.style.display;
      };
      function MarkerWithLabel(opt_options) {
        opt_options = opt_options || {};
        opt_options.labelContent = opt_options.labelContent || "";
        opt_options.labelAnchor = opt_options.labelAnchor || new gMapsApi.Point(0, 0);
        opt_options.labelClass = opt_options.labelClass || "markerLabels";
        opt_options.labelStyle = opt_options.labelStyle || {};
        opt_options.labelInBackground = opt_options.labelInBackground || false;
        if (typeof opt_options.labelVisible === "undefined") {
          opt_options.labelVisible = true;
        }
        if (typeof opt_options.raiseOnDrag === "undefined") {
          opt_options.raiseOnDrag = true;
        }
        if (typeof opt_options.clickable === "undefined") {
          opt_options.clickable = true;
        }
        if (typeof opt_options.draggable === "undefined") {
          opt_options.draggable = false;
        }
        if (typeof opt_options.optimized === "undefined") {
          opt_options.optimized = false;
        }
        opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
        opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";
        opt_options.optimized = false;
        this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor);
        gMapsApi.Marker.apply(this, arguments);
      }
      inherits(MarkerWithLabel, gMapsApi.Marker);
      MarkerWithLabel.prototype.setMap = function(theMap) {
        gMapsApi.Marker.prototype.setMap.apply(this, arguments);
        this.label.setMap(theMap);
      };
      return MarkerWithLabel;
    };
  }
});

// node_modules/fast-deep-equal/index.js
var require_fast_deep_equal = __commonJS({
  "node_modules/fast-deep-equal/index.js"(exports4, module2) {
    "use strict";
    module2.exports = function equal2(a, b) {
      if (a === b) return true;
      if (a && b && typeof a == "object" && typeof b == "object") {
        if (a.constructor !== b.constructor) return false;
        var length, i2, keys;
        if (Array.isArray(a)) {
          length = a.length;
          if (length != b.length) return false;
          for (i2 = length; i2-- !== 0; )
            if (!equal2(a[i2], b[i2])) return false;
          return true;
        }
        if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
        if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
        if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
        keys = Object.keys(a);
        length = keys.length;
        if (length !== Object.keys(b).length) return false;
        for (i2 = length; i2-- !== 0; )
          if (!Object.prototype.hasOwnProperty.call(b, keys[i2])) return false;
        for (i2 = length; i2-- !== 0; ) {
          var key = keys[i2];
          if (!equal2(a[key], b[key])) return false;
        }
        return true;
      }
      return a !== a && b !== b;
    };
  }
});

// node_modules/lodash/_listCacheClear.js
var require_listCacheClear = __commonJS({
  "node_modules/lodash/_listCacheClear.js"(exports4, module2) {
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }
    module2.exports = listCacheClear;
  }
});

// node_modules/lodash/eq.js
var require_eq = __commonJS({
  "node_modules/lodash/eq.js"(exports4, module2) {
    function eq2(value, other) {
      return value === other || value !== value && other !== other;
    }
    module2.exports = eq2;
  }
});

// node_modules/lodash/_assocIndexOf.js
var require_assocIndexOf = __commonJS({
  "node_modules/lodash/_assocIndexOf.js"(exports4, module2) {
    var eq2 = require_eq();
    function assocIndexOf(array2, key) {
      var length = array2.length;
      while (length--) {
        if (eq2(array2[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    module2.exports = assocIndexOf;
  }
});

// node_modules/lodash/_listCacheDelete.js
var require_listCacheDelete = __commonJS({
  "node_modules/lodash/_listCacheDelete.js"(exports4, module2) {
    var assocIndexOf = require_assocIndexOf();
    var arrayProto = Array.prototype;
    var splice = arrayProto.splice;
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }
    module2.exports = listCacheDelete;
  }
});

// node_modules/lodash/_listCacheGet.js
var require_listCacheGet = __commonJS({
  "node_modules/lodash/_listCacheGet.js"(exports4, module2) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheGet(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    module2.exports = listCacheGet;
  }
});

// node_modules/lodash/_listCacheHas.js
var require_listCacheHas = __commonJS({
  "node_modules/lodash/_listCacheHas.js"(exports4, module2) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    module2.exports = listCacheHas;
  }
});

// node_modules/lodash/_listCacheSet.js
var require_listCacheSet = __commonJS({
  "node_modules/lodash/_listCacheSet.js"(exports4, module2) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheSet(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    module2.exports = listCacheSet;
  }
});

// node_modules/lodash/_ListCache.js
var require_ListCache = __commonJS({
  "node_modules/lodash/_ListCache.js"(exports4, module2) {
    var listCacheClear = require_listCacheClear();
    var listCacheDelete = require_listCacheDelete();
    var listCacheGet = require_listCacheGet();
    var listCacheHas = require_listCacheHas();
    var listCacheSet = require_listCacheSet();
    function ListCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    module2.exports = ListCache;
  }
});

// node_modules/lodash/_stackClear.js
var require_stackClear = __commonJS({
  "node_modules/lodash/_stackClear.js"(exports4, module2) {
    var ListCache = require_ListCache();
    function stackClear() {
      this.__data__ = new ListCache();
      this.size = 0;
    }
    module2.exports = stackClear;
  }
});

// node_modules/lodash/_stackDelete.js
var require_stackDelete = __commonJS({
  "node_modules/lodash/_stackDelete.js"(exports4, module2) {
    function stackDelete(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    module2.exports = stackDelete;
  }
});

// node_modules/lodash/_stackGet.js
var require_stackGet = __commonJS({
  "node_modules/lodash/_stackGet.js"(exports4, module2) {
    function stackGet(key) {
      return this.__data__.get(key);
    }
    module2.exports = stackGet;
  }
});

// node_modules/lodash/_stackHas.js
var require_stackHas = __commonJS({
  "node_modules/lodash/_stackHas.js"(exports4, module2) {
    function stackHas(key) {
      return this.__data__.has(key);
    }
    module2.exports = stackHas;
  }
});

// node_modules/lodash/_freeGlobal.js
var require_freeGlobal = __commonJS({
  "node_modules/lodash/_freeGlobal.js"(exports4, module2) {
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    module2.exports = freeGlobal;
  }
});

// node_modules/lodash/_root.js
var require_root = __commonJS({
  "node_modules/lodash/_root.js"(exports4, module2) {
    var freeGlobal = require_freeGlobal();
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    module2.exports = root;
  }
});

// node_modules/lodash/_Symbol.js
var require_Symbol = __commonJS({
  "node_modules/lodash/_Symbol.js"(exports4, module2) {
    var root = require_root();
    var Symbol2 = root.Symbol;
    module2.exports = Symbol2;
  }
});

// node_modules/lodash/_getRawTag.js
var require_getRawTag = __commonJS({
  "node_modules/lodash/_getRawTag.js"(exports4, module2) {
    var Symbol2 = require_Symbol();
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    var nativeObjectToString = objectProto2.toString;
    var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
      try {
        value[symToStringTag] = void 0;
        var unmasked = true;
      } catch (e) {
      }
      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }
    module2.exports = getRawTag;
  }
});

// node_modules/lodash/_objectToString.js
var require_objectToString = __commonJS({
  "node_modules/lodash/_objectToString.js"(exports4, module2) {
    var objectProto2 = Object.prototype;
    var nativeObjectToString = objectProto2.toString;
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }
    module2.exports = objectToString;
  }
});

// node_modules/lodash/_baseGetTag.js
var require_baseGetTag = __commonJS({
  "node_modules/lodash/_baseGetTag.js"(exports4, module2) {
    var Symbol2 = require_Symbol();
    var getRawTag = require_getRawTag();
    var objectToString = require_objectToString();
    var nullTag = "[object Null]";
    var undefinedTag = "[object Undefined]";
    var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    module2.exports = baseGetTag;
  }
});

// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
  "node_modules/lodash/isObject.js"(exports4, module2) {
    function isObject2(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    module2.exports = isObject2;
  }
});

// node_modules/lodash/isFunction.js
var require_isFunction = __commonJS({
  "node_modules/lodash/isFunction.js"(exports4, module2) {
    var baseGetTag = require_baseGetTag();
    var isObject2 = require_isObject();
    var asyncTag = "[object AsyncFunction]";
    var funcTag = "[object Function]";
    var genTag = "[object GeneratorFunction]";
    var proxyTag = "[object Proxy]";
    function isFunction5(value) {
      if (!isObject2(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    module2.exports = isFunction5;
  }
});

// node_modules/lodash/_coreJsData.js
var require_coreJsData = __commonJS({
  "node_modules/lodash/_coreJsData.js"(exports4, module2) {
    var root = require_root();
    var coreJsData = root["__core-js_shared__"];
    module2.exports = coreJsData;
  }
});

// node_modules/lodash/_isMasked.js
var require_isMasked = __commonJS({
  "node_modules/lodash/_isMasked.js"(exports4, module2) {
    var coreJsData = require_coreJsData();
    var maskSrcKey = function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid ? "Symbol(src)_1." + uid : "";
    }();
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    module2.exports = isMasked;
  }
});

// node_modules/lodash/_toSource.js
var require_toSource = __commonJS({
  "node_modules/lodash/_toSource.js"(exports4, module2) {
    var funcProto = Function.prototype;
    var funcToString = funcProto.toString;
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e) {
        }
        try {
          return func + "";
        } catch (e) {
        }
      }
      return "";
    }
    module2.exports = toSource;
  }
});

// node_modules/lodash/_baseIsNative.js
var require_baseIsNative = __commonJS({
  "node_modules/lodash/_baseIsNative.js"(exports4, module2) {
    var isFunction5 = require_isFunction();
    var isMasked = require_isMasked();
    var isObject2 = require_isObject();
    var toSource = require_toSource();
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var funcProto = Function.prototype;
    var objectProto2 = Object.prototype;
    var funcToString = funcProto.toString;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    var reIsNative = RegExp(
      "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    function baseIsNative(value) {
      if (!isObject2(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction5(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    module2.exports = baseIsNative;
  }
});

// node_modules/lodash/_getValue.js
var require_getValue = __commonJS({
  "node_modules/lodash/_getValue.js"(exports4, module2) {
    function getValue2(object, key) {
      return object == null ? void 0 : object[key];
    }
    module2.exports = getValue2;
  }
});

// node_modules/lodash/_getNative.js
var require_getNative = __commonJS({
  "node_modules/lodash/_getNative.js"(exports4, module2) {
    var baseIsNative = require_baseIsNative();
    var getValue2 = require_getValue();
    function getNative(object, key) {
      var value = getValue2(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    module2.exports = getNative;
  }
});

// node_modules/lodash/_Map.js
var require_Map = __commonJS({
  "node_modules/lodash/_Map.js"(exports4, module2) {
    var getNative = require_getNative();
    var root = require_root();
    var Map3 = getNative(root, "Map");
    module2.exports = Map3;
  }
});

// node_modules/lodash/_nativeCreate.js
var require_nativeCreate = __commonJS({
  "node_modules/lodash/_nativeCreate.js"(exports4, module2) {
    var getNative = require_getNative();
    var nativeCreate = getNative(Object, "create");
    module2.exports = nativeCreate;
  }
});

// node_modules/lodash/_hashClear.js
var require_hashClear = __commonJS({
  "node_modules/lodash/_hashClear.js"(exports4, module2) {
    var nativeCreate = require_nativeCreate();
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }
    module2.exports = hashClear;
  }
});

// node_modules/lodash/_hashDelete.js
var require_hashDelete = __commonJS({
  "node_modules/lodash/_hashDelete.js"(exports4, module2) {
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    module2.exports = hashDelete;
  }
});

// node_modules/lodash/_hashGet.js
var require_hashGet = __commonJS({
  "node_modules/lodash/_hashGet.js"(exports4, module2) {
    var nativeCreate = require_nativeCreate();
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? void 0 : result;
      }
      return hasOwnProperty.call(data, key) ? data[key] : void 0;
    }
    module2.exports = hashGet;
  }
});

// node_modules/lodash/_hashHas.js
var require_hashHas = __commonJS({
  "node_modules/lodash/_hashHas.js"(exports4, module2) {
    var nativeCreate = require_nativeCreate();
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
    }
    module2.exports = hashHas;
  }
});

// node_modules/lodash/_hashSet.js
var require_hashSet = __commonJS({
  "node_modules/lodash/_hashSet.js"(exports4, module2) {
    var nativeCreate = require_nativeCreate();
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
      return this;
    }
    module2.exports = hashSet;
  }
});

// node_modules/lodash/_Hash.js
var require_Hash = __commonJS({
  "node_modules/lodash/_Hash.js"(exports4, module2) {
    var hashClear = require_hashClear();
    var hashDelete = require_hashDelete();
    var hashGet = require_hashGet();
    var hashHas = require_hashHas();
    var hashSet = require_hashSet();
    function Hash(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    module2.exports = Hash;
  }
});

// node_modules/lodash/_mapCacheClear.js
var require_mapCacheClear = __commonJS({
  "node_modules/lodash/_mapCacheClear.js"(exports4, module2) {
    var Hash = require_Hash();
    var ListCache = require_ListCache();
    var Map3 = require_Map();
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map3 || ListCache)(),
        "string": new Hash()
      };
    }
    module2.exports = mapCacheClear;
  }
});

// node_modules/lodash/_isKeyable.js
var require_isKeyable = __commonJS({
  "node_modules/lodash/_isKeyable.js"(exports4, module2) {
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    module2.exports = isKeyable;
  }
});

// node_modules/lodash/_getMapData.js
var require_getMapData = __commonJS({
  "node_modules/lodash/_getMapData.js"(exports4, module2) {
    var isKeyable = require_isKeyable();
    function getMapData(map2, key) {
      var data = map2.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    module2.exports = getMapData;
  }
});

// node_modules/lodash/_mapCacheDelete.js
var require_mapCacheDelete = __commonJS({
  "node_modules/lodash/_mapCacheDelete.js"(exports4, module2) {
    var getMapData = require_getMapData();
    function mapCacheDelete(key) {
      var result = getMapData(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    module2.exports = mapCacheDelete;
  }
});

// node_modules/lodash/_mapCacheGet.js
var require_mapCacheGet = __commonJS({
  "node_modules/lodash/_mapCacheGet.js"(exports4, module2) {
    var getMapData = require_getMapData();
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    module2.exports = mapCacheGet;
  }
});

// node_modules/lodash/_mapCacheHas.js
var require_mapCacheHas = __commonJS({
  "node_modules/lodash/_mapCacheHas.js"(exports4, module2) {
    var getMapData = require_getMapData();
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    module2.exports = mapCacheHas;
  }
});

// node_modules/lodash/_mapCacheSet.js
var require_mapCacheSet = __commonJS({
  "node_modules/lodash/_mapCacheSet.js"(exports4, module2) {
    var getMapData = require_getMapData();
    function mapCacheSet(key, value) {
      var data = getMapData(this, key), size = data.size;
      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }
    module2.exports = mapCacheSet;
  }
});

// node_modules/lodash/_MapCache.js
var require_MapCache = __commonJS({
  "node_modules/lodash/_MapCache.js"(exports4, module2) {
    var mapCacheClear = require_mapCacheClear();
    var mapCacheDelete = require_mapCacheDelete();
    var mapCacheGet = require_mapCacheGet();
    var mapCacheHas = require_mapCacheHas();
    var mapCacheSet = require_mapCacheSet();
    function MapCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    module2.exports = MapCache;
  }
});

// node_modules/lodash/_stackSet.js
var require_stackSet = __commonJS({
  "node_modules/lodash/_stackSet.js"(exports4, module2) {
    var ListCache = require_ListCache();
    var Map3 = require_Map();
    var MapCache = require_MapCache();
    var LARGE_ARRAY_SIZE = 200;
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map3 || pairs.length < LARGE_ARRAY_SIZE - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    module2.exports = stackSet;
  }
});

// node_modules/lodash/_Stack.js
var require_Stack = __commonJS({
  "node_modules/lodash/_Stack.js"(exports4, module2) {
    var ListCache = require_ListCache();
    var stackClear = require_stackClear();
    var stackDelete = require_stackDelete();
    var stackGet = require_stackGet();
    var stackHas = require_stackHas();
    var stackSet = require_stackSet();
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }
    Stack.prototype.clear = stackClear;
    Stack.prototype["delete"] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    module2.exports = Stack;
  }
});

// node_modules/lodash/_setCacheAdd.js
var require_setCacheAdd = __commonJS({
  "node_modules/lodash/_setCacheAdd.js"(exports4, module2) {
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }
    module2.exports = setCacheAdd;
  }
});

// node_modules/lodash/_setCacheHas.js
var require_setCacheHas = __commonJS({
  "node_modules/lodash/_setCacheHas.js"(exports4, module2) {
    function setCacheHas(value) {
      return this.__data__.has(value);
    }
    module2.exports = setCacheHas;
  }
});

// node_modules/lodash/_SetCache.js
var require_SetCache = __commonJS({
  "node_modules/lodash/_SetCache.js"(exports4, module2) {
    var MapCache = require_MapCache();
    var setCacheAdd = require_setCacheAdd();
    var setCacheHas = require_setCacheHas();
    function SetCache(values) {
      var index = -1, length = values == null ? 0 : values.length;
      this.__data__ = new MapCache();
      while (++index < length) {
        this.add(values[index]);
      }
    }
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    module2.exports = SetCache;
  }
});

// node_modules/lodash/_arraySome.js
var require_arraySome = __commonJS({
  "node_modules/lodash/_arraySome.js"(exports4, module2) {
    function arraySome(array2, predicate) {
      var index = -1, length = array2 == null ? 0 : array2.length;
      while (++index < length) {
        if (predicate(array2[index], index, array2)) {
          return true;
        }
      }
      return false;
    }
    module2.exports = arraySome;
  }
});

// node_modules/lodash/_cacheHas.js
var require_cacheHas = __commonJS({
  "node_modules/lodash/_cacheHas.js"(exports4, module2) {
    function cacheHas(cache2, key) {
      return cache2.has(key);
    }
    module2.exports = cacheHas;
  }
});

// node_modules/lodash/_equalArrays.js
var require_equalArrays = __commonJS({
  "node_modules/lodash/_equalArrays.js"(exports4, module2) {
    var SetCache = require_SetCache();
    var arraySome = require_arraySome();
    var cacheHas = require_cacheHas();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var arrStacked = stack.get(array2);
      var othStacked = stack.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array2;
      }
      var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
      stack.set(array2, other);
      stack.set(other, array2);
      while (++index < arrLength) {
        var arrValue = array2[index], othValue = other[index];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen) {
          if (!arraySome(other, function(othValue2, othIndex) {
            if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
          result = false;
          break;
        }
      }
      stack["delete"](array2);
      stack["delete"](other);
      return result;
    }
    module2.exports = equalArrays;
  }
});

// node_modules/lodash/_Uint8Array.js
var require_Uint8Array = __commonJS({
  "node_modules/lodash/_Uint8Array.js"(exports4, module2) {
    var root = require_root();
    var Uint8Array2 = root.Uint8Array;
    module2.exports = Uint8Array2;
  }
});

// node_modules/lodash/_mapToArray.js
var require_mapToArray = __commonJS({
  "node_modules/lodash/_mapToArray.js"(exports4, module2) {
    function mapToArray(map2) {
      var index = -1, result = Array(map2.size);
      map2.forEach(function(value, key) {
        result[++index] = [key, value];
      });
      return result;
    }
    module2.exports = mapToArray;
  }
});

// node_modules/lodash/_setToArray.js
var require_setToArray = __commonJS({
  "node_modules/lodash/_setToArray.js"(exports4, module2) {
    function setToArray(set2) {
      var index = -1, result = Array(set2.size);
      set2.forEach(function(value) {
        result[++index] = value;
      });
      return result;
    }
    module2.exports = setToArray;
  }
});

// node_modules/lodash/_equalByTag.js
var require_equalByTag = __commonJS({
  "node_modules/lodash/_equalByTag.js"(exports4, module2) {
    var Symbol2 = require_Symbol();
    var Uint8Array2 = require_Uint8Array();
    var eq2 = require_eq();
    var equalArrays = require_equalArrays();
    var mapToArray = require_mapToArray();
    var setToArray = require_setToArray();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var symbolTag = "[object Symbol]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
    var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
    function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
      switch (tag) {
        case dataViewTag:
          if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;
        case arrayBufferTag:
          if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
            return false;
          }
          return true;
        case boolTag:
        case dateTag:
        case numberTag:
          return eq2(+object, +other);
        case errorTag:
          return object.name == other.name && object.message == other.message;
        case regexpTag:
        case stringTag:
          return object == other + "";
        case mapTag:
          var convert = mapToArray;
        case setTag:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
          convert || (convert = setToArray);
          if (object.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG;
          stack.set(object, other);
          var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
          stack["delete"](object);
          return result;
        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }
    module2.exports = equalByTag;
  }
});

// node_modules/lodash/_arrayPush.js
var require_arrayPush = __commonJS({
  "node_modules/lodash/_arrayPush.js"(exports4, module2) {
    function arrayPush(array2, values) {
      var index = -1, length = values.length, offset2 = array2.length;
      while (++index < length) {
        array2[offset2 + index] = values[index];
      }
      return array2;
    }
    module2.exports = arrayPush;
  }
});

// node_modules/lodash/isArray.js
var require_isArray = __commonJS({
  "node_modules/lodash/isArray.js"(exports4, module2) {
    var isArray4 = Array.isArray;
    module2.exports = isArray4;
  }
});

// node_modules/lodash/_baseGetAllKeys.js
var require_baseGetAllKeys = __commonJS({
  "node_modules/lodash/_baseGetAllKeys.js"(exports4, module2) {
    var arrayPush = require_arrayPush();
    var isArray4 = require_isArray();
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray4(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    module2.exports = baseGetAllKeys;
  }
});

// node_modules/lodash/_arrayFilter.js
var require_arrayFilter = __commonJS({
  "node_modules/lodash/_arrayFilter.js"(exports4, module2) {
    function arrayFilter(array2, predicate) {
      var index = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
      while (++index < length) {
        var value = array2[index];
        if (predicate(value, index, array2)) {
          result[resIndex++] = value;
        }
      }
      return result;
    }
    module2.exports = arrayFilter;
  }
});

// node_modules/lodash/stubArray.js
var require_stubArray = __commonJS({
  "node_modules/lodash/stubArray.js"(exports4, module2) {
    function stubArray() {
      return [];
    }
    module2.exports = stubArray;
  }
});

// node_modules/lodash/_getSymbols.js
var require_getSymbols = __commonJS({
  "node_modules/lodash/_getSymbols.js"(exports4, module2) {
    var arrayFilter = require_arrayFilter();
    var stubArray = require_stubArray();
    var objectProto2 = Object.prototype;
    var propertyIsEnumerable = objectProto2.propertyIsEnumerable;
    var nativeGetSymbols = Object.getOwnPropertySymbols;
    var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
      if (object == null) {
        return [];
      }
      object = Object(object);
      return arrayFilter(nativeGetSymbols(object), function(symbol) {
        return propertyIsEnumerable.call(object, symbol);
      });
    };
    module2.exports = getSymbols;
  }
});

// node_modules/lodash/_baseTimes.js
var require_baseTimes = __commonJS({
  "node_modules/lodash/_baseTimes.js"(exports4, module2) {
    function baseTimes(n, iteratee) {
      var index = -1, result = Array(n);
      while (++index < n) {
        result[index] = iteratee(index);
      }
      return result;
    }
    module2.exports = baseTimes;
  }
});

// node_modules/lodash/isObjectLike.js
var require_isObjectLike = __commonJS({
  "node_modules/lodash/isObjectLike.js"(exports4, module2) {
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    module2.exports = isObjectLike;
  }
});

// node_modules/lodash/_baseIsArguments.js
var require_baseIsArguments = __commonJS({
  "node_modules/lodash/_baseIsArguments.js"(exports4, module2) {
    var baseGetTag = require_baseGetTag();
    var isObjectLike = require_isObjectLike();
    var argsTag = "[object Arguments]";
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag;
    }
    module2.exports = baseIsArguments;
  }
});

// node_modules/lodash/isArguments.js
var require_isArguments = __commonJS({
  "node_modules/lodash/isArguments.js"(exports4, module2) {
    var baseIsArguments = require_baseIsArguments();
    var isObjectLike = require_isObjectLike();
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    var propertyIsEnumerable = objectProto2.propertyIsEnumerable;
    var isArguments = baseIsArguments(/* @__PURE__ */ function() {
      return arguments;
    }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
    };
    module2.exports = isArguments;
  }
});

// node_modules/lodash/stubFalse.js
var require_stubFalse = __commonJS({
  "node_modules/lodash/stubFalse.js"(exports4, module2) {
    function stubFalse() {
      return false;
    }
    module2.exports = stubFalse;
  }
});

// node_modules/lodash/isBuffer.js
var require_isBuffer = __commonJS({
  "node_modules/lodash/isBuffer.js"(exports4, module2) {
    var root = require_root();
    var stubFalse = require_stubFalse();
    var freeExports = typeof exports4 == "object" && exports4 && !exports4.nodeType && exports4;
    var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var Buffer2 = moduleExports ? root.Buffer : void 0;
    var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
    var isBuffer = nativeIsBuffer || stubFalse;
    module2.exports = isBuffer;
  }
});

// node_modules/lodash/_isIndex.js
var require_isIndex = __commonJS({
  "node_modules/lodash/_isIndex.js"(exports4, module2) {
    var MAX_SAFE_INTEGER = 9007199254740991;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER : length;
      return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    module2.exports = isIndex;
  }
});

// node_modules/lodash/isLength.js
var require_isLength = __commonJS({
  "node_modules/lodash/isLength.js"(exports4, module2) {
    var MAX_SAFE_INTEGER = 9007199254740991;
    function isLength(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }
    module2.exports = isLength;
  }
});

// node_modules/lodash/_baseIsTypedArray.js
var require_baseIsTypedArray = __commonJS({
  "node_modules/lodash/_baseIsTypedArray.js"(exports4, module2) {
    var baseGetTag = require_baseGetTag();
    var isLength = require_isLength();
    var isObjectLike = require_isObjectLike();
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var funcTag = "[object Function]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var objectTag = "[object Object]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var weakMapTag = "[object WeakMap]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var float32Tag = "[object Float32Array]";
    var float64Tag = "[object Float64Array]";
    var int8Tag = "[object Int8Array]";
    var int16Tag = "[object Int16Array]";
    var int32Tag = "[object Int32Array]";
    var uint8Tag = "[object Uint8Array]";
    var uint8ClampedTag = "[object Uint8ClampedArray]";
    var uint16Tag = "[object Uint16Array]";
    var uint32Tag = "[object Uint32Array]";
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    module2.exports = baseIsTypedArray;
  }
});

// node_modules/lodash/_baseUnary.js
var require_baseUnary = __commonJS({
  "node_modules/lodash/_baseUnary.js"(exports4, module2) {
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    module2.exports = baseUnary;
  }
});

// node_modules/lodash/_nodeUtil.js
var require_nodeUtil = __commonJS({
  "node_modules/lodash/_nodeUtil.js"(exports4, module2) {
    var freeGlobal = require_freeGlobal();
    var freeExports = typeof exports4 == "object" && exports4 && !exports4.nodeType && exports4;
    var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var freeProcess = moduleExports && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types2 = freeModule && freeModule.require && freeModule.require("util").types;
        if (types2) {
          return types2;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e) {
      }
    }();
    module2.exports = nodeUtil;
  }
});

// node_modules/lodash/isTypedArray.js
var require_isTypedArray = __commonJS({
  "node_modules/lodash/isTypedArray.js"(exports4, module2) {
    var baseIsTypedArray = require_baseIsTypedArray();
    var baseUnary = require_baseUnary();
    var nodeUtil = require_nodeUtil();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    module2.exports = isTypedArray;
  }
});

// node_modules/lodash/_arrayLikeKeys.js
var require_arrayLikeKeys = __commonJS({
  "node_modules/lodash/_arrayLikeKeys.js"(exports4, module2) {
    var baseTimes = require_baseTimes();
    var isArguments = require_isArguments();
    var isArray4 = require_isArray();
    var isBuffer = require_isBuffer();
    var isIndex = require_isIndex();
    var isTypedArray = require_isTypedArray();
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray4(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    module2.exports = arrayLikeKeys;
  }
});

// node_modules/lodash/_isPrototype.js
var require_isPrototype = __commonJS({
  "node_modules/lodash/_isPrototype.js"(exports4, module2) {
    var objectProto2 = Object.prototype;
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
      return value === proto;
    }
    module2.exports = isPrototype;
  }
});

// node_modules/lodash/_overArg.js
var require_overArg = __commonJS({
  "node_modules/lodash/_overArg.js"(exports4, module2) {
    function overArg(func, transform3) {
      return function(arg) {
        return func(transform3(arg));
      };
    }
    module2.exports = overArg;
  }
});

// node_modules/lodash/_nativeKeys.js
var require_nativeKeys = __commonJS({
  "node_modules/lodash/_nativeKeys.js"(exports4, module2) {
    var overArg = require_overArg();
    var nativeKeys = overArg(Object.keys, Object);
    module2.exports = nativeKeys;
  }
});

// node_modules/lodash/_baseKeys.js
var require_baseKeys = __commonJS({
  "node_modules/lodash/_baseKeys.js"(exports4, module2) {
    var isPrototype = require_isPrototype();
    var nativeKeys = require_nativeKeys();
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty.call(object, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    module2.exports = baseKeys;
  }
});

// node_modules/lodash/isArrayLike.js
var require_isArrayLike = __commonJS({
  "node_modules/lodash/isArrayLike.js"(exports4, module2) {
    var isFunction5 = require_isFunction();
    var isLength = require_isLength();
    function isArrayLike2(value) {
      return value != null && isLength(value.length) && !isFunction5(value);
    }
    module2.exports = isArrayLike2;
  }
});

// node_modules/lodash/keys.js
var require_keys = __commonJS({
  "node_modules/lodash/keys.js"(exports4, module2) {
    var arrayLikeKeys = require_arrayLikeKeys();
    var baseKeys = require_baseKeys();
    var isArrayLike2 = require_isArrayLike();
    function keys(object) {
      return isArrayLike2(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    module2.exports = keys;
  }
});

// node_modules/lodash/_getAllKeys.js
var require_getAllKeys = __commonJS({
  "node_modules/lodash/_getAllKeys.js"(exports4, module2) {
    var baseGetAllKeys = require_baseGetAllKeys();
    var getSymbols = require_getSymbols();
    var keys = require_keys();
    function getAllKeys(object) {
      return baseGetAllKeys(object, keys, getSymbols);
    }
    module2.exports = getAllKeys;
  }
});

// node_modules/lodash/_equalObjects.js
var require_equalObjects = __commonJS({
  "node_modules/lodash/_equalObjects.js"(exports4, module2) {
    var getAllKeys = require_getAllKeys();
    var COMPARE_PARTIAL_FLAG = 1;
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
          return false;
        }
      }
      var objStacked = stack.get(object);
      var othStacked = stack.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object;
      }
      var result = true;
      stack.set(object, other);
      stack.set(other, object);
      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack["delete"](object);
      stack["delete"](other);
      return result;
    }
    module2.exports = equalObjects;
  }
});

// node_modules/lodash/_DataView.js
var require_DataView = __commonJS({
  "node_modules/lodash/_DataView.js"(exports4, module2) {
    var getNative = require_getNative();
    var root = require_root();
    var DataView = getNative(root, "DataView");
    module2.exports = DataView;
  }
});

// node_modules/lodash/_Promise.js
var require_Promise = __commonJS({
  "node_modules/lodash/_Promise.js"(exports4, module2) {
    var getNative = require_getNative();
    var root = require_root();
    var Promise2 = getNative(root, "Promise");
    module2.exports = Promise2;
  }
});

// node_modules/lodash/_Set.js
var require_Set = __commonJS({
  "node_modules/lodash/_Set.js"(exports4, module2) {
    var getNative = require_getNative();
    var root = require_root();
    var Set2 = getNative(root, "Set");
    module2.exports = Set2;
  }
});

// node_modules/lodash/_WeakMap.js
var require_WeakMap = __commonJS({
  "node_modules/lodash/_WeakMap.js"(exports4, module2) {
    var getNative = require_getNative();
    var root = require_root();
    var WeakMap2 = getNative(root, "WeakMap");
    module2.exports = WeakMap2;
  }
});

// node_modules/lodash/_getTag.js
var require_getTag = __commonJS({
  "node_modules/lodash/_getTag.js"(exports4, module2) {
    var DataView = require_DataView();
    var Map3 = require_Map();
    var Promise2 = require_Promise();
    var Set2 = require_Set();
    var WeakMap2 = require_WeakMap();
    var baseGetTag = require_baseGetTag();
    var toSource = require_toSource();
    var mapTag = "[object Map]";
    var objectTag = "[object Object]";
    var promiseTag = "[object Promise]";
    var setTag = "[object Set]";
    var weakMapTag = "[object WeakMap]";
    var dataViewTag = "[object DataView]";
    var dataViewCtorString = toSource(DataView);
    var mapCtorString = toSource(Map3);
    var promiseCtorString = toSource(Promise2);
    var setCtorString = toSource(Set2);
    var weakMapCtorString = toSource(WeakMap2);
    var getTag = baseGetTag;
    if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map3 && getTag(new Map3()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
      getTag = function(value) {
        var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString:
              return dataViewTag;
            case mapCtorString:
              return mapTag;
            case promiseCtorString:
              return promiseTag;
            case setCtorString:
              return setTag;
            case weakMapCtorString:
              return weakMapTag;
          }
        }
        return result;
      };
    }
    module2.exports = getTag;
  }
});

// node_modules/lodash/_baseIsEqualDeep.js
var require_baseIsEqualDeep = __commonJS({
  "node_modules/lodash/_baseIsEqualDeep.js"(exports4, module2) {
    var Stack = require_Stack();
    var equalArrays = require_equalArrays();
    var equalByTag = require_equalByTag();
    var equalObjects = require_equalObjects();
    var getTag = require_getTag();
    var isArray4 = require_isArray();
    var isBuffer = require_isBuffer();
    var isTypedArray = require_isTypedArray();
    var COMPARE_PARTIAL_FLAG = 1;
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var objectTag = "[object Object]";
    var objectProto2 = Object.prototype;
    var hasOwnProperty = objectProto2.hasOwnProperty;
    function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
      var objIsArr = isArray4(object), othIsArr = isArray4(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
      objTag = objTag == argsTag ? objectTag : objTag;
      othTag = othTag == argsTag ? objectTag : othTag;
      var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
      if (isSameTag && isBuffer(object)) {
        if (!isBuffer(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack || (stack = new Stack());
        return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
        var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
          stack || (stack = new Stack());
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack || (stack = new Stack());
      return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
    }
    module2.exports = baseIsEqualDeep;
  }
});

// node_modules/lodash/_baseIsEqual.js
var require_baseIsEqual = __commonJS({
  "node_modules/lodash/_baseIsEqual.js"(exports4, module2) {
    var baseIsEqualDeep = require_baseIsEqualDeep();
    var isObjectLike = require_isObjectLike();
    function baseIsEqual(value, other, bitmask, customizer, stack) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
    }
    module2.exports = baseIsEqual;
  }
});

// node_modules/lodash/isEqual.js
var require_isEqual = __commonJS({
  "node_modules/lodash/isEqual.js"(exports4, module2) {
    var baseIsEqual = require_baseIsEqual();
    function isEqual4(value, other) {
      return baseIsEqual(value, other);
    }
    module2.exports = isEqual4;
  }
});

// node_modules/@angular/core/fesm2022/primitives/signals.mjs
function defaultEquals(a, b) {
  return Object.is(a, b);
}
var activeConsumer = null;
var inNotificationPhase = false;
var epoch = 1;
var SIGNAL = /* @__PURE__ */ Symbol("SIGNAL");
function setActiveConsumer(consumer) {
  const prev = activeConsumer;
  activeConsumer = consumer;
  return prev;
}
function getActiveConsumer() {
  return activeConsumer;
}
function isInNotificationPhase() {
  return inNotificationPhase;
}
var REACTIVE_NODE = {
  version: 0,
  lastCleanEpoch: 0,
  dirty: false,
  producerNode: void 0,
  producerLastReadVersion: void 0,
  producerIndexOfThis: void 0,
  nextProducerIndex: 0,
  liveConsumerNode: void 0,
  liveConsumerIndexOfThis: void 0,
  consumerAllowSignalWrites: false,
  consumerIsAlwaysLive: false,
  producerMustRecompute: () => false,
  producerRecomputeValue: () => {
  },
  consumerMarkedDirty: () => {
  },
  consumerOnSignalRead: () => {
  }
};
function producerAccessed(node) {
  if (inNotificationPhase) {
    throw new Error(typeof ngDevMode !== "undefined" && ngDevMode ? `Assertion error: signal read during notification phase` : "");
  }
  if (activeConsumer === null) {
    return;
  }
  activeConsumer.consumerOnSignalRead(node);
  const idx = activeConsumer.nextProducerIndex++;
  assertConsumerNode(activeConsumer);
  if (idx < activeConsumer.producerNode.length && activeConsumer.producerNode[idx] !== node) {
    if (consumerIsLive(activeConsumer)) {
      const staleProducer = activeConsumer.producerNode[idx];
      producerRemoveLiveConsumerAtIndex(staleProducer, activeConsumer.producerIndexOfThis[idx]);
    }
  }
  if (activeConsumer.producerNode[idx] !== node) {
    activeConsumer.producerNode[idx] = node;
    activeConsumer.producerIndexOfThis[idx] = consumerIsLive(activeConsumer) ? producerAddLiveConsumer(node, activeConsumer, idx) : 0;
  }
  activeConsumer.producerLastReadVersion[idx] = node.version;
}
function producerIncrementEpoch() {
  epoch++;
}
function producerUpdateValueVersion(node) {
  if (consumerIsLive(node) && !node.dirty) {
    return;
  }
  if (!node.dirty && node.lastCleanEpoch === epoch) {
    return;
  }
  if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {
    node.dirty = false;
    node.lastCleanEpoch = epoch;
    return;
  }
  node.producerRecomputeValue(node);
  node.dirty = false;
  node.lastCleanEpoch = epoch;
}
function producerNotifyConsumers(node) {
  if (node.liveConsumerNode === void 0) {
    return;
  }
  const prev = inNotificationPhase;
  inNotificationPhase = true;
  try {
    for (const consumer of node.liveConsumerNode) {
      if (!consumer.dirty) {
        consumerMarkDirty(consumer);
      }
    }
  } finally {
    inNotificationPhase = prev;
  }
}
function producerUpdatesAllowed() {
  return activeConsumer?.consumerAllowSignalWrites !== false;
}
function consumerMarkDirty(node) {
  node.dirty = true;
  producerNotifyConsumers(node);
  node.consumerMarkedDirty?.(node);
}
function consumerBeforeComputation(node) {
  node && (node.nextProducerIndex = 0);
  return setActiveConsumer(node);
}
function consumerAfterComputation(node, prevConsumer) {
  setActiveConsumer(prevConsumer);
  if (!node || node.producerNode === void 0 || node.producerIndexOfThis === void 0 || node.producerLastReadVersion === void 0) {
    return;
  }
  if (consumerIsLive(node)) {
    for (let i2 = node.nextProducerIndex; i2 < node.producerNode.length; i2++) {
      producerRemoveLiveConsumerAtIndex(node.producerNode[i2], node.producerIndexOfThis[i2]);
    }
  }
  while (node.producerNode.length > node.nextProducerIndex) {
    node.producerNode.pop();
    node.producerLastReadVersion.pop();
    node.producerIndexOfThis.pop();
  }
}
function consumerPollProducersForChange(node) {
  assertConsumerNode(node);
  for (let i2 = 0; i2 < node.producerNode.length; i2++) {
    const producer = node.producerNode[i2];
    const seenVersion = node.producerLastReadVersion[i2];
    if (seenVersion !== producer.version) {
      return true;
    }
    producerUpdateValueVersion(producer);
    if (seenVersion !== producer.version) {
      return true;
    }
  }
  return false;
}
function consumerDestroy(node) {
  assertConsumerNode(node);
  if (consumerIsLive(node)) {
    for (let i2 = 0; i2 < node.producerNode.length; i2++) {
      producerRemoveLiveConsumerAtIndex(node.producerNode[i2], node.producerIndexOfThis[i2]);
    }
  }
  node.producerNode.length = node.producerLastReadVersion.length = node.producerIndexOfThis.length = 0;
  if (node.liveConsumerNode) {
    node.liveConsumerNode.length = node.liveConsumerIndexOfThis.length = 0;
  }
}
function producerAddLiveConsumer(node, consumer, indexOfThis) {
  assertProducerNode(node);
  assertConsumerNode(node);
  if (node.liveConsumerNode.length === 0) {
    for (let i2 = 0; i2 < node.producerNode.length; i2++) {
      node.producerIndexOfThis[i2] = producerAddLiveConsumer(node.producerNode[i2], node, i2);
    }
  }
  node.liveConsumerIndexOfThis.push(indexOfThis);
  return node.liveConsumerNode.push(consumer) - 1;
}
function producerRemoveLiveConsumerAtIndex(node, idx) {
  assertProducerNode(node);
  assertConsumerNode(node);
  if (typeof ngDevMode !== "undefined" && ngDevMode && idx >= node.liveConsumerNode.length) {
    throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);
  }
  if (node.liveConsumerNode.length === 1) {
    for (let i2 = 0; i2 < node.producerNode.length; i2++) {
      producerRemoveLiveConsumerAtIndex(node.producerNode[i2], node.producerIndexOfThis[i2]);
    }
  }
  const lastIdx = node.liveConsumerNode.length - 1;
  node.liveConsumerNode[idx] = node.liveConsumerNode[lastIdx];
  node.liveConsumerIndexOfThis[idx] = node.liveConsumerIndexOfThis[lastIdx];
  node.liveConsumerNode.length--;
  node.liveConsumerIndexOfThis.length--;
  if (idx < node.liveConsumerNode.length) {
    const idxProducer = node.liveConsumerIndexOfThis[idx];
    const consumer = node.liveConsumerNode[idx];
    assertConsumerNode(consumer);
    consumer.producerIndexOfThis[idxProducer] = idx;
  }
}
function consumerIsLive(node) {
  return node.consumerIsAlwaysLive || (node?.liveConsumerNode?.length ?? 0) > 0;
}
function assertConsumerNode(node) {
  node.producerNode ??= [];
  node.producerIndexOfThis ??= [];
  node.producerLastReadVersion ??= [];
}
function assertProducerNode(node) {
  node.liveConsumerNode ??= [];
  node.liveConsumerIndexOfThis ??= [];
}
function createComputed(computation) {
  const node = Object.create(COMPUTED_NODE);
  node.computation = computation;
  const computed = () => {
    producerUpdateValueVersion(node);
    producerAccessed(node);
    if (node.value === ERRORED) {
      throw node.error;
    }
    return node.value;
  };
  computed[SIGNAL] = node;
  return computed;
}
var UNSET = /* @__PURE__ */ Symbol("UNSET");
var COMPUTING = /* @__PURE__ */ Symbol("COMPUTING");
var ERRORED = /* @__PURE__ */ Symbol("ERRORED");
var COMPUTED_NODE = /* @__PURE__ */ (() => {
  return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
    value: UNSET,
    dirty: true,
    error: null,
    equal: defaultEquals,
    producerMustRecompute(node) {
      return node.value === UNSET || node.value === COMPUTING;
    },
    producerRecomputeValue(node) {
      if (node.value === COMPUTING) {
        throw new Error("Detected cycle in computations.");
      }
      const oldValue = node.value;
      node.value = COMPUTING;
      const prevConsumer = consumerBeforeComputation(node);
      let newValue;
      try {
        newValue = node.computation();
      } catch (err) {
        newValue = ERRORED;
        node.error = err;
      } finally {
        consumerAfterComputation(node, prevConsumer);
      }
      if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED && node.equal(oldValue, newValue)) {
        node.value = oldValue;
        return;
      }
      node.value = newValue;
      node.version++;
    }
  });
})();
function defaultThrowError() {
  throw new Error();
}
var throwInvalidWriteToSignalErrorFn = defaultThrowError;
function throwInvalidWriteToSignalError() {
  throwInvalidWriteToSignalErrorFn();
}
function setThrowInvalidWriteToSignalError(fn) {
  throwInvalidWriteToSignalErrorFn = fn;
}
var postSignalSetFn = null;
function createSignal(initialValue) {
  const node = Object.create(SIGNAL_NODE);
  node.value = initialValue;
  const getter = () => {
    producerAccessed(node);
    return node.value;
  };
  getter[SIGNAL] = node;
  return getter;
}
function signalSetFn(node, newValue) {
  if (!producerUpdatesAllowed()) {
    throwInvalidWriteToSignalError();
  }
  if (!node.equal(node.value, newValue)) {
    node.value = newValue;
    signalValueChanged(node);
  }
}
function signalUpdateFn(node, updater) {
  if (!producerUpdatesAllowed()) {
    throwInvalidWriteToSignalError();
  }
  signalSetFn(node, updater(node.value));
}
var SIGNAL_NODE = /* @__PURE__ */ (() => {
  return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
    equal: defaultEquals,
    value: void 0
  });
})();
function signalValueChanged(node) {
  node.version++;
  producerIncrementEpoch();
  producerNotifyConsumers(node);
  postSignalSetFn?.();
}
function createWatch(fn, schedule, allowSignalWrites) {
  const node = Object.create(WATCH_NODE);
  if (allowSignalWrites) {
    node.consumerAllowSignalWrites = true;
  }
  node.fn = fn;
  node.schedule = schedule;
  const registerOnCleanup = (cleanupFn) => {
    node.cleanupFn = cleanupFn;
  };
  function isWatchNodeDestroyed(node2) {
    return node2.fn === null && node2.schedule === null;
  }
  function destroyWatchNode(node2) {
    if (!isWatchNodeDestroyed(node2)) {
      consumerDestroy(node2);
      node2.cleanupFn();
      node2.fn = null;
      node2.schedule = null;
      node2.cleanupFn = NOOP_CLEANUP_FN;
    }
  }
  const run = () => {
    if (node.fn === null) {
      return;
    }
    if (isInNotificationPhase()) {
      throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);
    }
    node.dirty = false;
    if (node.hasRun && !consumerPollProducersForChange(node)) {
      return;
    }
    node.hasRun = true;
    const prevConsumer = consumerBeforeComputation(node);
    try {
      node.cleanupFn();
      node.cleanupFn = NOOP_CLEANUP_FN;
      node.fn(registerOnCleanup);
    } finally {
      consumerAfterComputation(node, prevConsumer);
    }
  };
  node.ref = {
    notify: () => consumerMarkDirty(node),
    run,
    cleanup: () => node.cleanupFn(),
    destroy: () => destroyWatchNode(node),
    [SIGNAL]: node
  };
  return node.ref;
}
var NOOP_CLEANUP_FN = () => {
};
var WATCH_NODE = /* @__PURE__ */ (() => {
  return __spreadProps(__spreadValues({}, REACTIVE_NODE), {
    consumerIsAlwaysLive: true,
    consumerAllowSignalWrites: false,
    consumerMarkedDirty: (node) => {
      if (node.schedule !== null) {
        node.schedule(node.ref);
      }
    },
    hasRun: false,
    cleanupFn: NOOP_CLEANUP_FN
  });
})();

// node_modules/rxjs/dist/esm/internal/util/isFunction.js
function isFunction(value) {
  return typeof value === "function";
}

// node_modules/rxjs/dist/esm/internal/util/createErrorClass.js
function createErrorClass(createImpl) {
  const _super = (instance) => {
    Error.call(instance);
    instance.stack = new Error().stack;
  };
  const ctorFunc = createImpl(_super);
  ctorFunc.prototype = Object.create(Error.prototype);
  ctorFunc.prototype.constructor = ctorFunc;
  return ctorFunc;
}

// node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js
var UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
  _super(this);
  this.message = errors ? `${errors.length} errors occurred during unsubscription:
${errors.map((err, i2) => `${i2 + 1}) ${err.toString()}`).join("\n  ")}` : "";
  this.name = "UnsubscriptionError";
  this.errors = errors;
});

// node_modules/rxjs/dist/esm/internal/util/arrRemove.js
function arrRemove(arr, item) {
  if (arr) {
    const index = arr.indexOf(item);
    0 <= index && arr.splice(index, 1);
  }
}

// node_modules/rxjs/dist/esm/internal/Subscription.js
var Subscription = class _Subscription {
  constructor(initialTeardown) {
    this.initialTeardown = initialTeardown;
    this.closed = false;
    this._parentage = null;
    this._finalizers = null;
  }
  unsubscribe() {
    let errors;
    if (!this.closed) {
      this.closed = true;
      const { _parentage } = this;
      if (_parentage) {
        this._parentage = null;
        if (Array.isArray(_parentage)) {
          for (const parent of _parentage) {
            parent.remove(this);
          }
        } else {
          _parentage.remove(this);
        }
      }
      const { initialTeardown: initialFinalizer } = this;
      if (isFunction(initialFinalizer)) {
        try {
          initialFinalizer();
        } catch (e) {
          errors = e instanceof UnsubscriptionError ? e.errors : [e];
        }
      }
      const { _finalizers } = this;
      if (_finalizers) {
        this._finalizers = null;
        for (const finalizer of _finalizers) {
          try {
            execFinalizer(finalizer);
          } catch (err) {
            errors = errors !== null && errors !== void 0 ? errors : [];
            if (err instanceof UnsubscriptionError) {
              errors = [...errors, ...err.errors];
            } else {
              errors.push(err);
            }
          }
        }
      }
      if (errors) {
        throw new UnsubscriptionError(errors);
      }
    }
  }
  add(teardown) {
    var _a56;
    if (teardown && teardown !== this) {
      if (this.closed) {
        execFinalizer(teardown);
      } else {
        if (teardown instanceof _Subscription) {
          if (teardown.closed || teardown._hasParent(this)) {
            return;
          }
          teardown._addParent(this);
        }
        (this._finalizers = (_a56 = this._finalizers) !== null && _a56 !== void 0 ? _a56 : []).push(teardown);
      }
    }
  }
  _hasParent(parent) {
    const { _parentage } = this;
    return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent);
  }
  _addParent(parent) {
    const { _parentage } = this;
    this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
  }
  _removeParent(parent) {
    const { _parentage } = this;
    if (_parentage === parent) {
      this._parentage = null;
    } else if (Array.isArray(_parentage)) {
      arrRemove(_parentage, parent);
    }
  }
  remove(teardown) {
    const { _finalizers } = this;
    _finalizers && arrRemove(_finalizers, teardown);
    if (teardown instanceof _Subscription) {
      teardown._removeParent(this);
    }
  }
};
Subscription.EMPTY = (() => {
  const empty = new Subscription();
  empty.closed = true;
  return empty;
})();
var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
function isSubscription(value) {
  return value instanceof Subscription || value && "closed" in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe);
}
function execFinalizer(finalizer) {
  if (isFunction(finalizer)) {
    finalizer();
  } else {
    finalizer.unsubscribe();
  }
}

// node_modules/rxjs/dist/esm/internal/config.js
var config = {
  onUnhandledError: null,
  onStoppedNotification: null,
  Promise: void 0,
  useDeprecatedSynchronousErrorHandling: false,
  useDeprecatedNextContext: false
};

// node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js
var timeoutProvider = {
  setTimeout(handler, timeout, ...args) {
    const { delegate } = timeoutProvider;
    if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
      return delegate.setTimeout(handler, timeout, ...args);
    }
    return setTimeout(handler, timeout, ...args);
  },
  clearTimeout(handle) {
    const { delegate } = timeoutProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
  },
  delegate: void 0
};

// node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js
function reportUnhandledError(err) {
  timeoutProvider.setTimeout(() => {
    const { onUnhandledError } = config;
    if (onUnhandledError) {
      onUnhandledError(err);
    } else {
      throw err;
    }
  });
}

// node_modules/rxjs/dist/esm/internal/util/noop.js
function noop() {
}

// node_modules/rxjs/dist/esm/internal/NotificationFactories.js
var COMPLETE_NOTIFICATION = (() => createNotification("C", void 0, void 0))();
function errorNotification(error3) {
  return createNotification("E", void 0, error3);
}
function nextNotification(value) {
  return createNotification("N", value, void 0);
}
function createNotification(kind, value, error3) {
  return {
    kind,
    value,
    error: error3
  };
}

// node_modules/rxjs/dist/esm/internal/util/errorContext.js
var context = null;
function errorContext(cb) {
  if (config.useDeprecatedSynchronousErrorHandling) {
    const isRoot = !context;
    if (isRoot) {
      context = { errorThrown: false, error: null };
    }
    cb();
    if (isRoot) {
      const { errorThrown, error: error3 } = context;
      context = null;
      if (errorThrown) {
        throw error3;
      }
    }
  } else {
    cb();
  }
}
function captureError(err) {
  if (config.useDeprecatedSynchronousErrorHandling && context) {
    context.errorThrown = true;
    context.error = err;
  }
}

// node_modules/rxjs/dist/esm/internal/Subscriber.js
var Subscriber = class extends Subscription {
  constructor(destination) {
    super();
    this.isStopped = false;
    if (destination) {
      this.destination = destination;
      if (isSubscription(destination)) {
        destination.add(this);
      }
    } else {
      this.destination = EMPTY_OBSERVER;
    }
  }
  static create(next, error3, complete) {
    return new SafeSubscriber(next, error3, complete);
  }
  next(value) {
    if (this.isStopped) {
      handleStoppedNotification(nextNotification(value), this);
    } else {
      this._next(value);
    }
  }
  error(err) {
    if (this.isStopped) {
      handleStoppedNotification(errorNotification(err), this);
    } else {
      this.isStopped = true;
      this._error(err);
    }
  }
  complete() {
    if (this.isStopped) {
      handleStoppedNotification(COMPLETE_NOTIFICATION, this);
    } else {
      this.isStopped = true;
      this._complete();
    }
  }
  unsubscribe() {
    if (!this.closed) {
      this.isStopped = true;
      super.unsubscribe();
      this.destination = null;
    }
  }
  _next(value) {
    this.destination.next(value);
  }
  _error(err) {
    try {
      this.destination.error(err);
    } finally {
      this.unsubscribe();
    }
  }
  _complete() {
    try {
      this.destination.complete();
    } finally {
      this.unsubscribe();
    }
  }
};
var _bind = Function.prototype.bind;
function bind(fn, thisArg) {
  return _bind.call(fn, thisArg);
}
var ConsumerObserver = class {
  constructor(partialObserver) {
    this.partialObserver = partialObserver;
  }
  next(value) {
    const { partialObserver } = this;
    if (partialObserver.next) {
      try {
        partialObserver.next(value);
      } catch (error3) {
        handleUnhandledError(error3);
      }
    }
  }
  error(err) {
    const { partialObserver } = this;
    if (partialObserver.error) {
      try {
        partialObserver.error(err);
      } catch (error3) {
        handleUnhandledError(error3);
      }
    } else {
      handleUnhandledError(err);
    }
  }
  complete() {
    const { partialObserver } = this;
    if (partialObserver.complete) {
      try {
        partialObserver.complete();
      } catch (error3) {
        handleUnhandledError(error3);
      }
    }
  }
};
var SafeSubscriber = class extends Subscriber {
  constructor(observerOrNext, error3, complete) {
    super();
    let partialObserver;
    if (isFunction(observerOrNext) || !observerOrNext) {
      partialObserver = {
        next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : void 0,
        error: error3 !== null && error3 !== void 0 ? error3 : void 0,
        complete: complete !== null && complete !== void 0 ? complete : void 0
      };
    } else {
      let context2;
      if (this && config.useDeprecatedNextContext) {
        context2 = Object.create(observerOrNext);
        context2.unsubscribe = () => this.unsubscribe();
        partialObserver = {
          next: observerOrNext.next && bind(observerOrNext.next, context2),
          error: observerOrNext.error && bind(observerOrNext.error, context2),
          complete: observerOrNext.complete && bind(observerOrNext.complete, context2)
        };
      } else {
        partialObserver = observerOrNext;
      }
    }
    this.destination = new ConsumerObserver(partialObserver);
  }
};
function handleUnhandledError(error3) {
  if (config.useDeprecatedSynchronousErrorHandling) {
    captureError(error3);
  } else {
    reportUnhandledError(error3);
  }
}
function defaultErrorHandler(err) {
  throw err;
}
function handleStoppedNotification(notification, subscriber) {
  const { onStoppedNotification } = config;
  onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
}
var EMPTY_OBSERVER = {
  closed: true,
  next: noop,
  error: defaultErrorHandler,
  complete: noop
};

// node_modules/rxjs/dist/esm/internal/symbol/observable.js
var observable = (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();

// node_modules/rxjs/dist/esm/internal/util/identity.js
function identity(x) {
  return x;
}

// node_modules/rxjs/dist/esm/internal/util/pipe.js
function pipeFromArray(fns) {
  if (fns.length === 0) {
    return identity;
  }
  if (fns.length === 1) {
    return fns[0];
  }
  return function piped(input2) {
    return fns.reduce((prev, fn) => fn(prev), input2);
  };
}

// node_modules/rxjs/dist/esm/internal/Observable.js
var Observable = class _Observable {
  constructor(subscribe) {
    if (subscribe) {
      this._subscribe = subscribe;
    }
  }
  lift(operator) {
    const observable2 = new _Observable();
    observable2.source = this;
    observable2.operator = operator;
    return observable2;
  }
  subscribe(observerOrNext, error3, complete) {
    const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error3, complete);
    errorContext(() => {
      const { operator, source } = this;
      subscriber.add(operator ? operator.call(subscriber, source) : source ? this._subscribe(subscriber) : this._trySubscribe(subscriber));
    });
    return subscriber;
  }
  _trySubscribe(sink) {
    try {
      return this._subscribe(sink);
    } catch (err) {
      sink.error(err);
    }
  }
  forEach(next, promiseCtor) {
    promiseCtor = getPromiseCtor(promiseCtor);
    return new promiseCtor((resolve, reject) => {
      const subscriber = new SafeSubscriber({
        next: (value) => {
          try {
            next(value);
          } catch (err) {
            reject(err);
            subscriber.unsubscribe();
          }
        },
        error: reject,
        complete: resolve
      });
      this.subscribe(subscriber);
    });
  }
  _subscribe(subscriber) {
    var _a56;
    return (_a56 = this.source) === null || _a56 === void 0 ? void 0 : _a56.subscribe(subscriber);
  }
  [observable]() {
    return this;
  }
  pipe(...operations) {
    return pipeFromArray(operations)(this);
  }
  toPromise(promiseCtor) {
    promiseCtor = getPromiseCtor(promiseCtor);
    return new promiseCtor((resolve, reject) => {
      let value;
      this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value));
    });
  }
};
Observable.create = (subscribe) => {
  return new Observable(subscribe);
};
function getPromiseCtor(promiseCtor) {
  var _a56;
  return (_a56 = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a56 !== void 0 ? _a56 : Promise;
}
function isObserver(value) {
  return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
}
function isSubscriber(value) {
  return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
}

// node_modules/rxjs/dist/esm/internal/util/lift.js
function hasLift(source) {
  return isFunction(source === null || source === void 0 ? void 0 : source.lift);
}
function operate(init31) {
  return (source) => {
    if (hasLift(source)) {
      return source.lift(function(liftedSource) {
        try {
          return init31(liftedSource, this);
        } catch (err) {
          this.error(err);
        }
      });
    }
    throw new TypeError("Unable to lift unknown Observable type");
  };
}

// node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js
function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
  return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
}
var OperatorSubscriber = class extends Subscriber {
  constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
    super(destination);
    this.onFinalize = onFinalize;
    this.shouldUnsubscribe = shouldUnsubscribe;
    this._next = onNext ? function(value) {
      try {
        onNext(value);
      } catch (err) {
        destination.error(err);
      }
    } : super._next;
    this._error = onError ? function(err) {
      try {
        onError(err);
      } catch (err2) {
        destination.error(err2);
      } finally {
        this.unsubscribe();
      }
    } : super._error;
    this._complete = onComplete ? function() {
      try {
        onComplete();
      } catch (err) {
        destination.error(err);
      } finally {
        this.unsubscribe();
      }
    } : super._complete;
  }
  unsubscribe() {
    var _a56;
    if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
      const { closed } = this;
      super.unsubscribe();
      !closed && ((_a56 = this.onFinalize) === null || _a56 === void 0 ? void 0 : _a56.call(this));
    }
  }
};

// node_modules/rxjs/dist/esm/internal/operators/refCount.js
function refCount() {
  return operate((source, subscriber) => {
    let connection = null;
    source._refCount++;
    const refCounter = createOperatorSubscriber(subscriber, void 0, void 0, void 0, () => {
      if (!source || source._refCount <= 0 || 0 < --source._refCount) {
        connection = null;
        return;
      }
      const sharedConnection = source._connection;
      const conn = connection;
      connection = null;
      if (sharedConnection && (!conn || sharedConnection === conn)) {
        sharedConnection.unsubscribe();
      }
      subscriber.unsubscribe();
    });
    source.subscribe(refCounter);
    if (!refCounter.closed) {
      connection = source.connect();
    }
  });
}

// node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js
var ConnectableObservable = class extends Observable {
  constructor(source, subjectFactory) {
    super();
    this.source = source;
    this.subjectFactory = subjectFactory;
    this._subject = null;
    this._refCount = 0;
    this._connection = null;
    if (hasLift(source)) {
      this.lift = source.lift;
    }
  }
  _subscribe(subscriber) {
    return this.getSubject().subscribe(subscriber);
  }
  getSubject() {
    const subject = this._subject;
    if (!subject || subject.isStopped) {
      this._subject = this.subjectFactory();
    }
    return this._subject;
  }
  _teardown() {
    this._refCount = 0;
    const { _connection } = this;
    this._subject = this._connection = null;
    _connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe();
  }
  connect() {
    let connection = this._connection;
    if (!connection) {
      connection = this._connection = new Subscription();
      const subject = this.getSubject();
      connection.add(this.source.subscribe(createOperatorSubscriber(subject, void 0, () => {
        this._teardown();
        subject.complete();
      }, (err) => {
        this._teardown();
        subject.error(err);
      }, () => this._teardown())));
      if (connection.closed) {
        this._connection = null;
        connection = Subscription.EMPTY;
      }
    }
    return connection;
  }
  refCount() {
    return refCount()(this);
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js
var animationFrameProvider = {
  schedule(callback) {
    let request = requestAnimationFrame;
    let cancel = cancelAnimationFrame;
    const { delegate } = animationFrameProvider;
    if (delegate) {
      request = delegate.requestAnimationFrame;
      cancel = delegate.cancelAnimationFrame;
    }
    const handle = request((timestamp) => {
      cancel = void 0;
      callback(timestamp);
    });
    return new Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle));
  },
  requestAnimationFrame(...args) {
    const { delegate } = animationFrameProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args);
  },
  cancelAnimationFrame(...args) {
    const { delegate } = animationFrameProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args);
  },
  delegate: void 0
};

// node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js
var ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
  _super(this);
  this.name = "ObjectUnsubscribedError";
  this.message = "object unsubscribed";
});

// node_modules/rxjs/dist/esm/internal/Subject.js
var Subject = class extends Observable {
  constructor() {
    super();
    this.closed = false;
    this.currentObservers = null;
    this.observers = [];
    this.isStopped = false;
    this.hasError = false;
    this.thrownError = null;
  }
  lift(operator) {
    const subject = new AnonymousSubject(this, this);
    subject.operator = operator;
    return subject;
  }
  _throwIfClosed() {
    if (this.closed) {
      throw new ObjectUnsubscribedError();
    }
  }
  next(value) {
    errorContext(() => {
      this._throwIfClosed();
      if (!this.isStopped) {
        if (!this.currentObservers) {
          this.currentObservers = Array.from(this.observers);
        }
        for (const observer of this.currentObservers) {
          observer.next(value);
        }
      }
    });
  }
  error(err) {
    errorContext(() => {
      this._throwIfClosed();
      if (!this.isStopped) {
        this.hasError = this.isStopped = true;
        this.thrownError = err;
        const { observers } = this;
        while (observers.length) {
          observers.shift().error(err);
        }
      }
    });
  }
  complete() {
    errorContext(() => {
      this._throwIfClosed();
      if (!this.isStopped) {
        this.isStopped = true;
        const { observers } = this;
        while (observers.length) {
          observers.shift().complete();
        }
      }
    });
  }
  unsubscribe() {
    this.isStopped = this.closed = true;
    this.observers = this.currentObservers = null;
  }
  get observed() {
    var _a56;
    return ((_a56 = this.observers) === null || _a56 === void 0 ? void 0 : _a56.length) > 0;
  }
  _trySubscribe(subscriber) {
    this._throwIfClosed();
    return super._trySubscribe(subscriber);
  }
  _subscribe(subscriber) {
    this._throwIfClosed();
    this._checkFinalizedStatuses(subscriber);
    return this._innerSubscribe(subscriber);
  }
  _innerSubscribe(subscriber) {
    const { hasError, isStopped, observers } = this;
    if (hasError || isStopped) {
      return EMPTY_SUBSCRIPTION;
    }
    this.currentObservers = null;
    observers.push(subscriber);
    return new Subscription(() => {
      this.currentObservers = null;
      arrRemove(observers, subscriber);
    });
  }
  _checkFinalizedStatuses(subscriber) {
    const { hasError, thrownError, isStopped } = this;
    if (hasError) {
      subscriber.error(thrownError);
    } else if (isStopped) {
      subscriber.complete();
    }
  }
  asObservable() {
    const observable2 = new Observable();
    observable2.source = this;
    return observable2;
  }
};
Subject.create = (destination, source) => {
  return new AnonymousSubject(destination, source);
};
var AnonymousSubject = class extends Subject {
  constructor(destination, source) {
    super();
    this.destination = destination;
    this.source = source;
  }
  next(value) {
    var _a56, _b;
    (_b = (_a56 = this.destination) === null || _a56 === void 0 ? void 0 : _a56.next) === null || _b === void 0 ? void 0 : _b.call(_a56, value);
  }
  error(err) {
    var _a56, _b;
    (_b = (_a56 = this.destination) === null || _a56 === void 0 ? void 0 : _a56.error) === null || _b === void 0 ? void 0 : _b.call(_a56, err);
  }
  complete() {
    var _a56, _b;
    (_b = (_a56 = this.destination) === null || _a56 === void 0 ? void 0 : _a56.complete) === null || _b === void 0 ? void 0 : _b.call(_a56);
  }
  _subscribe(subscriber) {
    var _a56, _b;
    return (_b = (_a56 = this.source) === null || _a56 === void 0 ? void 0 : _a56.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
  }
};

// node_modules/rxjs/dist/esm/internal/BehaviorSubject.js
var BehaviorSubject = class extends Subject {
  constructor(_value) {
    super();
    this._value = _value;
  }
  get value() {
    return this.getValue();
  }
  _subscribe(subscriber) {
    const subscription = super._subscribe(subscriber);
    !subscription.closed && subscriber.next(this._value);
    return subscription;
  }
  getValue() {
    const { hasError, thrownError, _value } = this;
    if (hasError) {
      throw thrownError;
    }
    this._throwIfClosed();
    return _value;
  }
  next(value) {
    super.next(this._value = value);
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js
var dateTimestampProvider = {
  now() {
    return (dateTimestampProvider.delegate || Date).now();
  },
  delegate: void 0
};

// node_modules/rxjs/dist/esm/internal/ReplaySubject.js
var ReplaySubject = class extends Subject {
  constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = dateTimestampProvider) {
    super();
    this._bufferSize = _bufferSize;
    this._windowTime = _windowTime;
    this._timestampProvider = _timestampProvider;
    this._buffer = [];
    this._infiniteTimeWindow = true;
    this._infiniteTimeWindow = _windowTime === Infinity;
    this._bufferSize = Math.max(1, _bufferSize);
    this._windowTime = Math.max(1, _windowTime);
  }
  next(value) {
    const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;
    if (!isStopped) {
      _buffer.push(value);
      !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);
    }
    this._trimBuffer();
    super.next(value);
  }
  _subscribe(subscriber) {
    this._throwIfClosed();
    this._trimBuffer();
    const subscription = this._innerSubscribe(subscriber);
    const { _infiniteTimeWindow, _buffer } = this;
    const copy = _buffer.slice();
    for (let i2 = 0; i2 < copy.length && !subscriber.closed; i2 += _infiniteTimeWindow ? 1 : 2) {
      subscriber.next(copy[i2]);
    }
    this._checkFinalizedStatuses(subscriber);
    return subscription;
  }
  _trimBuffer() {
    const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;
    const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;
    _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);
    if (!_infiniteTimeWindow) {
      const now = _timestampProvider.now();
      let last2 = 0;
      for (let i2 = 1; i2 < _buffer.length && _buffer[i2] <= now; i2 += 2) {
        last2 = i2;
      }
      last2 && _buffer.splice(0, last2 + 1);
    }
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/Action.js
var Action = class extends Subscription {
  constructor(scheduler2, work) {
    super();
  }
  schedule(state2, delay2 = 0) {
    return this;
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js
var intervalProvider = {
  setInterval(handler, timeout, ...args) {
    const { delegate } = intervalProvider;
    if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {
      return delegate.setInterval(handler, timeout, ...args);
    }
    return setInterval(handler, timeout, ...args);
  },
  clearInterval(handle) {
    const { delegate } = intervalProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);
  },
  delegate: void 0
};

// node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js
var AsyncAction = class extends Action {
  constructor(scheduler2, work) {
    super(scheduler2, work);
    this.scheduler = scheduler2;
    this.work = work;
    this.pending = false;
  }
  schedule(state2, delay2 = 0) {
    var _a56;
    if (this.closed) {
      return this;
    }
    this.state = state2;
    const id2 = this.id;
    const scheduler2 = this.scheduler;
    if (id2 != null) {
      this.id = this.recycleAsyncId(scheduler2, id2, delay2);
    }
    this.pending = true;
    this.delay = delay2;
    this.id = (_a56 = this.id) !== null && _a56 !== void 0 ? _a56 : this.requestAsyncId(scheduler2, this.id, delay2);
    return this;
  }
  requestAsyncId(scheduler2, _id, delay2 = 0) {
    return intervalProvider.setInterval(scheduler2.flush.bind(scheduler2, this), delay2);
  }
  recycleAsyncId(_scheduler, id2, delay2 = 0) {
    if (delay2 != null && this.delay === delay2 && this.pending === false) {
      return id2;
    }
    if (id2 != null) {
      intervalProvider.clearInterval(id2);
    }
    return void 0;
  }
  execute(state2, delay2) {
    if (this.closed) {
      return new Error("executing a cancelled action");
    }
    this.pending = false;
    const error3 = this._execute(state2, delay2);
    if (error3) {
      return error3;
    } else if (this.pending === false && this.id != null) {
      this.id = this.recycleAsyncId(this.scheduler, this.id, null);
    }
  }
  _execute(state2, _delay) {
    let errored = false;
    let errorValue;
    try {
      this.work(state2);
    } catch (e) {
      errored = true;
      errorValue = e ? e : new Error("Scheduled action threw falsy error");
    }
    if (errored) {
      this.unsubscribe();
      return errorValue;
    }
  }
  unsubscribe() {
    if (!this.closed) {
      const { id: id2, scheduler: scheduler2 } = this;
      const { actions } = scheduler2;
      this.work = this.state = this.scheduler = null;
      this.pending = false;
      arrRemove(actions, this);
      if (id2 != null) {
        this.id = this.recycleAsyncId(scheduler2, id2, null);
      }
      this.delay = null;
      super.unsubscribe();
    }
  }
};

// node_modules/rxjs/dist/esm/internal/util/Immediate.js
var nextHandle = 1;
var resolved;
var activeHandles = {};
function findAndClearHandle(handle) {
  if (handle in activeHandles) {
    delete activeHandles[handle];
    return true;
  }
  return false;
}
var Immediate = {
  setImmediate(cb) {
    const handle = nextHandle++;
    activeHandles[handle] = true;
    if (!resolved) {
      resolved = Promise.resolve();
    }
    resolved.then(() => findAndClearHandle(handle) && cb());
    return handle;
  },
  clearImmediate(handle) {
    findAndClearHandle(handle);
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js
var { setImmediate: setImmediate2, clearImmediate } = Immediate;
var immediateProvider = {
  setImmediate(...args) {
    const { delegate } = immediateProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate2)(...args);
  },
  clearImmediate(handle) {
    const { delegate } = immediateProvider;
    return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);
  },
  delegate: void 0
};

// node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js
var AsapAction = class extends AsyncAction {
  constructor(scheduler2, work) {
    super(scheduler2, work);
    this.scheduler = scheduler2;
    this.work = work;
  }
  requestAsyncId(scheduler2, id2, delay2 = 0) {
    if (delay2 !== null && delay2 > 0) {
      return super.requestAsyncId(scheduler2, id2, delay2);
    }
    scheduler2.actions.push(this);
    return scheduler2._scheduled || (scheduler2._scheduled = immediateProvider.setImmediate(scheduler2.flush.bind(scheduler2, void 0)));
  }
  recycleAsyncId(scheduler2, id2, delay2 = 0) {
    var _a56;
    if (delay2 != null ? delay2 > 0 : this.delay > 0) {
      return super.recycleAsyncId(scheduler2, id2, delay2);
    }
    const { actions } = scheduler2;
    if (id2 != null && ((_a56 = actions[actions.length - 1]) === null || _a56 === void 0 ? void 0 : _a56.id) !== id2) {
      immediateProvider.clearImmediate(id2);
      if (scheduler2._scheduled === id2) {
        scheduler2._scheduled = void 0;
      }
    }
    return void 0;
  }
};

// node_modules/rxjs/dist/esm/internal/Scheduler.js
var Scheduler = class _Scheduler {
  constructor(schedulerActionCtor, now = _Scheduler.now) {
    this.schedulerActionCtor = schedulerActionCtor;
    this.now = now;
  }
  schedule(work, delay2 = 0, state2) {
    return new this.schedulerActionCtor(this, work).schedule(state2, delay2);
  }
};
Scheduler.now = dateTimestampProvider.now;

// node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js
var AsyncScheduler = class extends Scheduler {
  constructor(SchedulerAction, now = Scheduler.now) {
    super(SchedulerAction, now);
    this.actions = [];
    this._active = false;
  }
  flush(action) {
    const { actions } = this;
    if (this._active) {
      actions.push(action);
      return;
    }
    let error3;
    this._active = true;
    do {
      if (error3 = action.execute(action.state, action.delay)) {
        break;
      }
    } while (action = actions.shift());
    this._active = false;
    if (error3) {
      while (action = actions.shift()) {
        action.unsubscribe();
      }
      throw error3;
    }
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js
var AsapScheduler = class extends AsyncScheduler {
  flush(action) {
    this._active = true;
    const flushId = this._scheduled;
    this._scheduled = void 0;
    const { actions } = this;
    let error3;
    action = action || actions.shift();
    do {
      if (error3 = action.execute(action.state, action.delay)) {
        break;
      }
    } while ((action = actions[0]) && action.id === flushId && actions.shift());
    this._active = false;
    if (error3) {
      while ((action = actions[0]) && action.id === flushId && actions.shift()) {
        action.unsubscribe();
      }
      throw error3;
    }
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/asap.js
var asapScheduler = new AsapScheduler(AsapAction);

// node_modules/rxjs/dist/esm/internal/scheduler/async.js
var asyncScheduler = new AsyncScheduler(AsyncAction);
var async = asyncScheduler;

// node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js
var AnimationFrameAction = class extends AsyncAction {
  constructor(scheduler2, work) {
    super(scheduler2, work);
    this.scheduler = scheduler2;
    this.work = work;
  }
  requestAsyncId(scheduler2, id2, delay2 = 0) {
    if (delay2 !== null && delay2 > 0) {
      return super.requestAsyncId(scheduler2, id2, delay2);
    }
    scheduler2.actions.push(this);
    return scheduler2._scheduled || (scheduler2._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler2.flush(void 0)));
  }
  recycleAsyncId(scheduler2, id2, delay2 = 0) {
    var _a56;
    if (delay2 != null ? delay2 > 0 : this.delay > 0) {
      return super.recycleAsyncId(scheduler2, id2, delay2);
    }
    const { actions } = scheduler2;
    if (id2 != null && ((_a56 = actions[actions.length - 1]) === null || _a56 === void 0 ? void 0 : _a56.id) !== id2) {
      animationFrameProvider.cancelAnimationFrame(id2);
      scheduler2._scheduled = void 0;
    }
    return void 0;
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js
var AnimationFrameScheduler = class extends AsyncScheduler {
  flush(action) {
    this._active = true;
    const flushId = this._scheduled;
    this._scheduled = void 0;
    const { actions } = this;
    let error3;
    action = action || actions.shift();
    do {
      if (error3 = action.execute(action.state, action.delay)) {
        break;
      }
    } while ((action = actions[0]) && action.id === flushId && actions.shift());
    this._active = false;
    if (error3) {
      while ((action = actions[0]) && action.id === flushId && actions.shift()) {
        action.unsubscribe();
      }
      throw error3;
    }
  }
};

// node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js
var animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);

// node_modules/rxjs/dist/esm/internal/observable/empty.js
var EMPTY = new Observable((subscriber) => subscriber.complete());

// node_modules/rxjs/dist/esm/internal/util/isScheduler.js
function isScheduler(value) {
  return value && isFunction(value.schedule);
}

// node_modules/rxjs/dist/esm/internal/util/args.js
function last(arr) {
  return arr[arr.length - 1];
}
function popResultSelector(args) {
  return isFunction(last(args)) ? args.pop() : void 0;
}
function popScheduler(args) {
  return isScheduler(last(args)) ? args.pop() : void 0;
}
function popNumber(args, defaultValue) {
  return typeof last(args) === "number" ? args.pop() : defaultValue;
}

// node_modules/tslib/tslib.es6.mjs
function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function(resolve) {
      resolve(value);
    });
  }
  return new (P || (P = Promise))(function(resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }
    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i2 = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
    next: function() {
      if (o && i2 >= o.length) o = void 0;
      return { value: o && o[i2++], done: !o };
    }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []), i2, q = [];
  return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
    return this;
  }, i2;
  function verb(n) {
    if (g[n]) i2[n] = function(v) {
      return new Promise(function(a, b) {
        q.push([n, v, a, b]) > 1 || resume(n, v);
      });
    };
  }
  function resume(n, v) {
    try {
      step(g[n](v));
    } catch (e) {
      settle(q[0][3], e);
    }
  }
  function step(r) {
    r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  }
  function fulfill(value) {
    resume("next", value);
  }
  function reject(value) {
    resume("throw", value);
  }
  function settle(f, v) {
    if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  }
}
function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator], i2;
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
    return this;
  }, i2);
  function verb(n) {
    i2[n] = o[n] && function(v) {
      return new Promise(function(resolve, reject) {
        v = o[n](v), settle(resolve, reject, v.done, v.value);
      });
    };
  }
  function settle(resolve, reject, d, v) {
    Promise.resolve(v).then(function(v2) {
      resolve({ value: v2, done: d });
    }, reject);
  }
}

// node_modules/rxjs/dist/esm/internal/util/isArrayLike.js
var isArrayLike = (x) => x && typeof x.length === "number" && typeof x !== "function";

// node_modules/rxjs/dist/esm/internal/util/isPromise.js
function isPromise(value) {
  return isFunction(value === null || value === void 0 ? void 0 : value.then);
}

// node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js
function isInteropObservable(input2) {
  return isFunction(input2[observable]);
}

// node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js
function isAsyncIterable(obj) {
  return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
}

// node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js
function createInvalidObservableTypeError(input2) {
  return new TypeError(`You provided ${input2 !== null && typeof input2 === "object" ? "an invalid object" : `'${input2}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);
}

// node_modules/rxjs/dist/esm/internal/symbol/iterator.js
function getSymbolIterator() {
  if (typeof Symbol !== "function" || !Symbol.iterator) {
    return "@@iterator";
  }
  return Symbol.iterator;
}
var iterator = getSymbolIterator();

// node_modules/rxjs/dist/esm/internal/util/isIterable.js
function isIterable(input2) {
  return isFunction(input2 === null || input2 === void 0 ? void 0 : input2[iterator]);
}

// node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js
function readableStreamLikeToAsyncGenerator(readableStream) {
  return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
    const reader = readableStream.getReader();
    try {
      while (true) {
        const { value, done } = yield __await(reader.read());
        if (done) {
          return yield __await(void 0);
        }
        yield yield __await(value);
      }
    } finally {
      reader.releaseLock();
    }
  });
}
function isReadableStreamLike(obj) {
  return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
}

// node_modules/rxjs/dist/esm/internal/observable/innerFrom.js
function innerFrom(input2) {
  if (input2 instanceof Observable) {
    return input2;
  }
  if (input2 != null) {
    if (isInteropObservable(input2)) {
      return fromInteropObservable(input2);
    }
    if (isArrayLike(input2)) {
      return fromArrayLike(input2);
    }
    if (isPromise(input2)) {
      return fromPromise(input2);
    }
    if (isAsyncIterable(input2)) {
      return fromAsyncIterable(input2);
    }
    if (isIterable(input2)) {
      return fromIterable(input2);
    }
    if (isReadableStreamLike(input2)) {
      return fromReadableStreamLike(input2);
    }
  }
  throw createInvalidObservableTypeError(input2);
}
function fromInteropObservable(obj) {
  return new Observable((subscriber) => {
    const obs = obj[observable]();
    if (isFunction(obs.subscribe)) {
      return obs.subscribe(subscriber);
    }
    throw new TypeError("Provided object does not correctly implement Symbol.observable");
  });
}
function fromArrayLike(array2) {
  return new Observable((subscriber) => {
    for (let i2 = 0; i2 < array2.length && !subscriber.closed; i2++) {
      subscriber.next(array2[i2]);
    }
    subscriber.complete();
  });
}
function fromPromise(promise) {
  return new Observable((subscriber) => {
    promise.then((value) => {
      if (!subscriber.closed) {
        subscriber.next(value);
        subscriber.complete();
      }
    }, (err) => subscriber.error(err)).then(null, reportUnhandledError);
  });
}
function fromIterable(iterable) {
  return new Observable((subscriber) => {
    for (const value of iterable) {
      subscriber.next(value);
      if (subscriber.closed) {
        return;
      }
    }
    subscriber.complete();
  });
}
function fromAsyncIterable(asyncIterable) {
  return new Observable((subscriber) => {
    process2(asyncIterable, subscriber).catch((err) => subscriber.error(err));
  });
}
function fromReadableStreamLike(readableStream) {
  return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
}
function process2(asyncIterable, subscriber) {
  var asyncIterable_1, asyncIterable_1_1;
  var e_1, _a56;
  return __awaiter(this, void 0, void 0, function* () {
    try {
      for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done; ) {
        const value = asyncIterable_1_1.value;
        subscriber.next(value);
        if (subscriber.closed) {
          return;
        }
      }
    } catch (e_1_1) {
      e_1 = { error: e_1_1 };
    } finally {
      try {
        if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a56 = asyncIterable_1.return)) yield _a56.call(asyncIterable_1);
      } finally {
        if (e_1) throw e_1.error;
      }
    }
    subscriber.complete();
  });
}

// node_modules/rxjs/dist/esm/internal/util/executeSchedule.js
function executeSchedule(parentSubscription, scheduler2, work, delay2 = 0, repeat = false) {
  const scheduleSubscription = scheduler2.schedule(function() {
    work();
    if (repeat) {
      parentSubscription.add(this.schedule(null, delay2));
    } else {
      this.unsubscribe();
    }
  }, delay2);
  parentSubscription.add(scheduleSubscription);
  if (!repeat) {
    return scheduleSubscription;
  }
}

// node_modules/rxjs/dist/esm/internal/operators/observeOn.js
function observeOn(scheduler2, delay2 = 0) {
  return operate((source, subscriber) => {
    source.subscribe(createOperatorSubscriber(subscriber, (value) => executeSchedule(subscriber, scheduler2, () => subscriber.next(value), delay2), () => executeSchedule(subscriber, scheduler2, () => subscriber.complete(), delay2), (err) => executeSchedule(subscriber, scheduler2, () => subscriber.error(err), delay2)));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js
function subscribeOn(scheduler2, delay2 = 0) {
  return operate((source, subscriber) => {
    subscriber.add(scheduler2.schedule(() => source.subscribe(subscriber), delay2));
  });
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js
function scheduleObservable(input2, scheduler2) {
  return innerFrom(input2).pipe(subscribeOn(scheduler2), observeOn(scheduler2));
}

// node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js
function schedulePromise(input2, scheduler2) {
  return innerFrom(input2).pipe(subscribeOn(scheduler2), observeOn(scheduler2));
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js
function scheduleArray(input2, scheduler2) {
  return new Observable((subscriber) => {
    let i2 = 0;
    return scheduler2.schedule(function() {
      if (i2 === input2.length) {
        subscriber.complete();
      } else {
        subscriber.next(input2[i2++]);
        if (!subscriber.closed) {
          this.schedule();
        }
      }
    });
  });
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js
function scheduleIterable(input2, scheduler2) {
  return new Observable((subscriber) => {
    let iterator2;
    executeSchedule(subscriber, scheduler2, () => {
      iterator2 = input2[iterator]();
      executeSchedule(subscriber, scheduler2, () => {
        let value;
        let done;
        try {
          ({ value, done } = iterator2.next());
        } catch (err) {
          subscriber.error(err);
          return;
        }
        if (done) {
          subscriber.complete();
        } else {
          subscriber.next(value);
        }
      }, 0, true);
    });
    return () => isFunction(iterator2 === null || iterator2 === void 0 ? void 0 : iterator2.return) && iterator2.return();
  });
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js
function scheduleAsyncIterable(input2, scheduler2) {
  if (!input2) {
    throw new Error("Iterable cannot be null");
  }
  return new Observable((subscriber) => {
    executeSchedule(subscriber, scheduler2, () => {
      const iterator2 = input2[Symbol.asyncIterator]();
      executeSchedule(subscriber, scheduler2, () => {
        iterator2.next().then((result) => {
          if (result.done) {
            subscriber.complete();
          } else {
            subscriber.next(result.value);
          }
        });
      }, 0, true);
    });
  });
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js
function scheduleReadableStreamLike(input2, scheduler2) {
  return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input2), scheduler2);
}

// node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js
function scheduled(input2, scheduler2) {
  if (input2 != null) {
    if (isInteropObservable(input2)) {
      return scheduleObservable(input2, scheduler2);
    }
    if (isArrayLike(input2)) {
      return scheduleArray(input2, scheduler2);
    }
    if (isPromise(input2)) {
      return schedulePromise(input2, scheduler2);
    }
    if (isAsyncIterable(input2)) {
      return scheduleAsyncIterable(input2, scheduler2);
    }
    if (isIterable(input2)) {
      return scheduleIterable(input2, scheduler2);
    }
    if (isReadableStreamLike(input2)) {
      return scheduleReadableStreamLike(input2, scheduler2);
    }
  }
  throw createInvalidObservableTypeError(input2);
}

// node_modules/rxjs/dist/esm/internal/observable/from.js
function from(input2, scheduler2) {
  return scheduler2 ? scheduled(input2, scheduler2) : innerFrom(input2);
}

// node_modules/rxjs/dist/esm/internal/observable/of.js
function of(...args) {
  const scheduler2 = popScheduler(args);
  return from(args, scheduler2);
}

// node_modules/rxjs/dist/esm/internal/observable/throwError.js
function throwError(errorOrErrorFactory, scheduler2) {
  const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;
  const init31 = (subscriber) => subscriber.error(errorFactory());
  return new Observable(scheduler2 ? (subscriber) => scheduler2.schedule(init31, 0, subscriber) : init31);
}

// node_modules/rxjs/dist/esm/internal/util/isObservable.js
function isObservable(obj) {
  return !!obj && (obj instanceof Observable || isFunction(obj.lift) && isFunction(obj.subscribe));
}

// node_modules/rxjs/dist/esm/internal/util/isDate.js
function isValidDate(value) {
  return value instanceof Date && !isNaN(value);
}

// node_modules/rxjs/dist/esm/internal/operators/map.js
function map(project, thisArg) {
  return operate((source, subscriber) => {
    let index = 0;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      subscriber.next(project.call(thisArg, value, index++));
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js
var { isArray } = Array;
function callOrApply(fn, args) {
  return isArray(args) ? fn(...args) : fn(args);
}
function mapOneOrManyArgs(fn) {
  return map((args) => callOrApply(fn, args));
}

// node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js
var { isArray: isArray2 } = Array;
var { getPrototypeOf, prototype: objectProto, keys: getKeys } = Object;
function argsArgArrayOrObject(args) {
  if (args.length === 1) {
    const first2 = args[0];
    if (isArray2(first2)) {
      return { args: first2, keys: null };
    }
    if (isPOJO(first2)) {
      const keys = getKeys(first2);
      return {
        args: keys.map((key) => first2[key]),
        keys
      };
    }
  }
  return { args, keys: null };
}
function isPOJO(obj) {
  return obj && typeof obj === "object" && getPrototypeOf(obj) === objectProto;
}

// node_modules/rxjs/dist/esm/internal/util/createObject.js
function createObject(keys, values) {
  return keys.reduce((result, key, i2) => (result[key] = values[i2], result), {});
}

// node_modules/rxjs/dist/esm/internal/observable/combineLatest.js
function combineLatest(...args) {
  const scheduler2 = popScheduler(args);
  const resultSelector = popResultSelector(args);
  const { args: observables, keys } = argsArgArrayOrObject(args);
  if (observables.length === 0) {
    return from([], scheduler2);
  }
  const result = new Observable(combineLatestInit(observables, scheduler2, keys ? (values) => createObject(keys, values) : identity));
  return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}
function combineLatestInit(observables, scheduler2, valueTransform = identity) {
  return (subscriber) => {
    maybeSchedule(scheduler2, () => {
      const { length } = observables;
      const values = new Array(length);
      let active = length;
      let remainingFirstValues = length;
      for (let i2 = 0; i2 < length; i2++) {
        maybeSchedule(scheduler2, () => {
          const source = from(observables[i2], scheduler2);
          let hasFirstValue = false;
          source.subscribe(createOperatorSubscriber(subscriber, (value) => {
            values[i2] = value;
            if (!hasFirstValue) {
              hasFirstValue = true;
              remainingFirstValues--;
            }
            if (!remainingFirstValues) {
              subscriber.next(valueTransform(values.slice()));
            }
          }, () => {
            if (!--active) {
              subscriber.complete();
            }
          }));
        }, subscriber);
      }
    }, subscriber);
  };
}
function maybeSchedule(scheduler2, execute, subscription) {
  if (scheduler2) {
    executeSchedule(subscription, scheduler2, execute);
  } else {
    execute();
  }
}

// node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js
function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
  const buffer3 = [];
  let active = 0;
  let index = 0;
  let isComplete = false;
  const checkComplete = () => {
    if (isComplete && !buffer3.length && !active) {
      subscriber.complete();
    }
  };
  const outerNext = (value) => active < concurrent ? doInnerSub(value) : buffer3.push(value);
  const doInnerSub = (value) => {
    expand && subscriber.next(value);
    active++;
    let innerComplete = false;
    innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, (innerValue) => {
      onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
      if (expand) {
        outerNext(innerValue);
      } else {
        subscriber.next(innerValue);
      }
    }, () => {
      innerComplete = true;
    }, void 0, () => {
      if (innerComplete) {
        try {
          active--;
          while (buffer3.length && active < concurrent) {
            const bufferedValue = buffer3.shift();
            if (innerSubScheduler) {
              executeSchedule(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue));
            } else {
              doInnerSub(bufferedValue);
            }
          }
          checkComplete();
        } catch (err) {
          subscriber.error(err);
        }
      }
    }));
  };
  source.subscribe(createOperatorSubscriber(subscriber, outerNext, () => {
    isComplete = true;
    checkComplete();
  }));
  return () => {
    additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
  };
}

// node_modules/rxjs/dist/esm/internal/operators/mergeMap.js
function mergeMap(project, resultSelector, concurrent = Infinity) {
  if (isFunction(resultSelector)) {
    return mergeMap((a, i2) => map((b, ii) => resultSelector(a, b, i2, ii))(innerFrom(project(a, i2))), concurrent);
  } else if (typeof resultSelector === "number") {
    concurrent = resultSelector;
  }
  return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));
}

// node_modules/rxjs/dist/esm/internal/operators/mergeAll.js
function mergeAll(concurrent = Infinity) {
  return mergeMap(identity, concurrent);
}

// node_modules/rxjs/dist/esm/internal/operators/concatAll.js
function concatAll() {
  return mergeAll(1);
}

// node_modules/rxjs/dist/esm/internal/observable/concat.js
function concat(...args) {
  return concatAll()(from(args, popScheduler(args)));
}

// node_modules/rxjs/dist/esm/internal/observable/defer.js
function defer(observableFactory) {
  return new Observable((subscriber) => {
    innerFrom(observableFactory()).subscribe(subscriber);
  });
}

// node_modules/rxjs/dist/esm/internal/observable/forkJoin.js
function forkJoin(...args) {
  const resultSelector = popResultSelector(args);
  const { args: sources, keys } = argsArgArrayOrObject(args);
  const result = new Observable((subscriber) => {
    const { length } = sources;
    if (!length) {
      subscriber.complete();
      return;
    }
    const values = new Array(length);
    let remainingCompletions = length;
    let remainingEmissions = length;
    for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
      let hasValue = false;
      innerFrom(sources[sourceIndex]).subscribe(createOperatorSubscriber(subscriber, (value) => {
        if (!hasValue) {
          hasValue = true;
          remainingEmissions--;
        }
        values[sourceIndex] = value;
      }, () => remainingCompletions--, void 0, () => {
        if (!remainingCompletions || !hasValue) {
          if (!remainingEmissions) {
            subscriber.next(keys ? createObject(keys, values) : values);
          }
          subscriber.complete();
        }
      }));
    }
  });
  return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;
}

// node_modules/rxjs/dist/esm/internal/observable/fromEvent.js
var nodeEventEmitterMethods = ["addListener", "removeListener"];
var eventTargetMethods = ["addEventListener", "removeEventListener"];
var jqueryMethods = ["on", "off"];
function fromEvent(target, eventName, options, resultSelector) {
  if (isFunction(options)) {
    resultSelector = options;
    options = void 0;
  }
  if (resultSelector) {
    return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));
  }
  const [add5, remove2] = isEventTarget(target) ? eventTargetMethods.map((methodName) => (handler) => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [];
  if (!add5) {
    if (isArrayLike(target)) {
      return mergeMap((subTarget) => fromEvent(subTarget, eventName, options))(innerFrom(target));
    }
  }
  if (!add5) {
    throw new TypeError("Invalid event target");
  }
  return new Observable((subscriber) => {
    const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]);
    add5(handler);
    return () => remove2(handler);
  });
}
function toCommonHandlerRegistry(target, eventName) {
  return (methodName) => (handler) => target[methodName](eventName, handler);
}
function isNodeStyleEventEmitter(target) {
  return isFunction(target.addListener) && isFunction(target.removeListener);
}
function isJQueryStyleEventEmitter(target) {
  return isFunction(target.on) && isFunction(target.off);
}
function isEventTarget(target) {
  return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
}

// node_modules/rxjs/dist/esm/internal/observable/timer.js
function timer(dueTime = 0, intervalOrScheduler, scheduler2 = async) {
  let intervalDuration = -1;
  if (intervalOrScheduler != null) {
    if (isScheduler(intervalOrScheduler)) {
      scheduler2 = intervalOrScheduler;
    } else {
      intervalDuration = intervalOrScheduler;
    }
  }
  return new Observable((subscriber) => {
    let due = isValidDate(dueTime) ? +dueTime - scheduler2.now() : dueTime;
    if (due < 0) {
      due = 0;
    }
    let n = 0;
    return scheduler2.schedule(function() {
      if (!subscriber.closed) {
        subscriber.next(n++);
        if (0 <= intervalDuration) {
          this.schedule(void 0, intervalDuration);
        } else {
          subscriber.complete();
        }
      }
    }, due);
  });
}

// node_modules/rxjs/dist/esm/internal/observable/merge.js
function merge(...args) {
  const scheduler2 = popScheduler(args);
  const concurrent = popNumber(args, Infinity);
  const sources = args;
  return !sources.length ? EMPTY : sources.length === 1 ? innerFrom(sources[0]) : mergeAll(concurrent)(from(sources, scheduler2));
}

// node_modules/rxjs/dist/esm/internal/operators/filter.js
function filter(predicate, thisArg) {
  return operate((source, subscriber) => {
    let index = 0;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => predicate.call(thisArg, value, index++) && subscriber.next(value)));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/audit.js
function audit(durationSelector) {
  return operate((source, subscriber) => {
    let hasValue = false;
    let lastValue = null;
    let durationSubscriber = null;
    let isComplete = false;
    const endDuration = () => {
      durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
      durationSubscriber = null;
      if (hasValue) {
        hasValue = false;
        const value = lastValue;
        lastValue = null;
        subscriber.next(value);
      }
      isComplete && subscriber.complete();
    };
    const cleanupDuration = () => {
      durationSubscriber = null;
      isComplete && subscriber.complete();
    };
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      hasValue = true;
      lastValue = value;
      if (!durationSubscriber) {
        innerFrom(durationSelector(value)).subscribe(durationSubscriber = createOperatorSubscriber(subscriber, endDuration, cleanupDuration));
      }
    }, () => {
      isComplete = true;
      (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete();
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/auditTime.js
function auditTime(duration, scheduler2 = asyncScheduler) {
  return audit(() => timer(duration, scheduler2));
}

// node_modules/rxjs/dist/esm/internal/operators/catchError.js
function catchError(selector) {
  return operate((source, subscriber) => {
    let innerSub = null;
    let syncUnsub = false;
    let handledResult;
    innerSub = source.subscribe(createOperatorSubscriber(subscriber, void 0, void 0, (err) => {
      handledResult = innerFrom(selector(err, catchError(selector)(source)));
      if (innerSub) {
        innerSub.unsubscribe();
        innerSub = null;
        handledResult.subscribe(subscriber);
      } else {
        syncUnsub = true;
      }
    }));
    if (syncUnsub) {
      innerSub.unsubscribe();
      innerSub = null;
      handledResult.subscribe(subscriber);
    }
  });
}

// node_modules/rxjs/dist/esm/internal/operators/concatMap.js
function concatMap(project, resultSelector) {
  return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
}

// node_modules/rxjs/dist/esm/internal/operators/debounceTime.js
function debounceTime(dueTime, scheduler2 = asyncScheduler) {
  return operate((source, subscriber) => {
    let activeTask = null;
    let lastValue = null;
    let lastTime = null;
    const emit = () => {
      if (activeTask) {
        activeTask.unsubscribe();
        activeTask = null;
        const value = lastValue;
        lastValue = null;
        subscriber.next(value);
      }
    };
    function emitWhenIdle() {
      const targetTime = lastTime + dueTime;
      const now = scheduler2.now();
      if (now < targetTime) {
        activeTask = this.schedule(void 0, targetTime - now);
        subscriber.add(activeTask);
        return;
      }
      emit();
    }
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      lastValue = value;
      lastTime = scheduler2.now();
      if (!activeTask) {
        activeTask = scheduler2.schedule(emitWhenIdle, dueTime);
        subscriber.add(activeTask);
      }
    }, () => {
      emit();
      subscriber.complete();
    }, void 0, () => {
      lastValue = activeTask = null;
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/take.js
function take(count) {
  return count <= 0 ? () => EMPTY : operate((source, subscriber) => {
    let seen = 0;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      if (++seen <= count) {
        subscriber.next(value);
        if (count <= seen) {
          subscriber.complete();
        }
      }
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js
function ignoreElements() {
  return operate((source, subscriber) => {
    source.subscribe(createOperatorSubscriber(subscriber, noop));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/mapTo.js
function mapTo(value) {
  return map(() => value);
}

// node_modules/rxjs/dist/esm/internal/operators/delayWhen.js
function delayWhen(delayDurationSelector, subscriptionDelay) {
  if (subscriptionDelay) {
    return (source) => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));
  }
  return mergeMap((value, index) => innerFrom(delayDurationSelector(value, index)).pipe(take(1), mapTo(value)));
}

// node_modules/rxjs/dist/esm/internal/operators/delay.js
function delay(due, scheduler2 = asyncScheduler) {
  const duration = timer(due, scheduler2);
  return delayWhen(() => duration);
}

// node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js
function distinctUntilChanged(comparator, keySelector = identity) {
  comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;
  return operate((source, subscriber) => {
    let previousKey;
    let first2 = true;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      const currentKey = keySelector(value);
      if (first2 || !comparator(previousKey, currentKey)) {
        first2 = false;
        previousKey = currentKey;
        subscriber.next(value);
      }
    }));
  });
}
function defaultCompare(a, b) {
  return a === b;
}

// node_modules/rxjs/dist/esm/internal/operators/finalize.js
function finalize(callback) {
  return operate((source, subscriber) => {
    try {
      source.subscribe(subscriber);
    } finally {
      subscriber.add(callback);
    }
  });
}

// node_modules/rxjs/dist/esm/internal/operators/pairwise.js
function pairwise() {
  return operate((source, subscriber) => {
    let prev;
    let hasPrev = false;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      const p = prev;
      prev = value;
      hasPrev && subscriber.next([p, value]);
      hasPrev = true;
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/retry.js
function retry(configOrCount = Infinity) {
  let config2;
  if (configOrCount && typeof configOrCount === "object") {
    config2 = configOrCount;
  } else {
    config2 = {
      count: configOrCount
    };
  }
  const { count = Infinity, delay: delay2, resetOnSuccess = false } = config2;
  return count <= 0 ? identity : operate((source, subscriber) => {
    let soFar = 0;
    let innerSub;
    const subscribeForRetry = () => {
      let syncUnsub = false;
      innerSub = source.subscribe(createOperatorSubscriber(subscriber, (value) => {
        if (resetOnSuccess) {
          soFar = 0;
        }
        subscriber.next(value);
      }, void 0, (err) => {
        if (soFar++ < count) {
          const resub = () => {
            if (innerSub) {
              innerSub.unsubscribe();
              innerSub = null;
              subscribeForRetry();
            } else {
              syncUnsub = true;
            }
          };
          if (delay2 != null) {
            const notifier = typeof delay2 === "number" ? timer(delay2) : innerFrom(delay2(err, soFar));
            const notifierSubscriber = createOperatorSubscriber(subscriber, () => {
              notifierSubscriber.unsubscribe();
              resub();
            }, () => {
              subscriber.complete();
            });
            notifier.subscribe(notifierSubscriber);
          } else {
            resub();
          }
        } else {
          subscriber.error(err);
        }
      }));
      if (syncUnsub) {
        innerSub.unsubscribe();
        innerSub = null;
        subscribeForRetry();
      }
    };
    subscribeForRetry();
  });
}

// node_modules/rxjs/dist/esm/internal/operators/share.js
function share(options = {}) {
  const { connector = () => new Subject(), resetOnError = true, resetOnComplete = true, resetOnRefCountZero = true } = options;
  return (wrapperSource) => {
    let connection;
    let resetConnection;
    let subject;
    let refCount2 = 0;
    let hasCompleted = false;
    let hasErrored = false;
    const cancelReset = () => {
      resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
      resetConnection = void 0;
    };
    const reset2 = () => {
      cancelReset();
      connection = subject = void 0;
      hasCompleted = hasErrored = false;
    };
    const resetAndUnsubscribe = () => {
      const conn = connection;
      reset2();
      conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
    };
    return operate((source, subscriber) => {
      refCount2++;
      if (!hasErrored && !hasCompleted) {
        cancelReset();
      }
      const dest = subject = subject !== null && subject !== void 0 ? subject : connector();
      subscriber.add(() => {
        refCount2--;
        if (refCount2 === 0 && !hasErrored && !hasCompleted) {
          resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);
        }
      });
      dest.subscribe(subscriber);
      if (!connection && refCount2 > 0) {
        connection = new SafeSubscriber({
          next: (value) => dest.next(value),
          error: (err) => {
            hasErrored = true;
            cancelReset();
            resetConnection = handleReset(reset2, resetOnError, err);
            dest.error(err);
          },
          complete: () => {
            hasCompleted = true;
            cancelReset();
            resetConnection = handleReset(reset2, resetOnComplete);
            dest.complete();
          }
        });
        innerFrom(source).subscribe(connection);
      }
    })(wrapperSource);
  };
}
function handleReset(reset2, on, ...args) {
  if (on === true) {
    reset2();
    return;
  }
  if (on === false) {
    return;
  }
  const onSubscriber = new SafeSubscriber({
    next: () => {
      onSubscriber.unsubscribe();
      reset2();
    }
  });
  return innerFrom(on(...args)).subscribe(onSubscriber);
}

// node_modules/rxjs/dist/esm/internal/operators/shareReplay.js
function shareReplay(configOrBufferSize, windowTime, scheduler2) {
  let bufferSize;
  let refCount2 = false;
  if (configOrBufferSize && typeof configOrBufferSize === "object") {
    ({ bufferSize = Infinity, windowTime = Infinity, refCount: refCount2 = false, scheduler: scheduler2 } = configOrBufferSize);
  } else {
    bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;
  }
  return share({
    connector: () => new ReplaySubject(bufferSize, windowTime, scheduler2),
    resetOnError: true,
    resetOnComplete: false,
    resetOnRefCountZero: refCount2
  });
}

// node_modules/rxjs/dist/esm/internal/operators/skip.js
function skip(count) {
  return filter((_, index) => count <= index);
}

// node_modules/rxjs/dist/esm/internal/operators/startWith.js
function startWith(...values) {
  const scheduler2 = popScheduler(values);
  return operate((source, subscriber) => {
    (scheduler2 ? concat(values, source, scheduler2) : concat(values, source)).subscribe(subscriber);
  });
}

// node_modules/rxjs/dist/esm/internal/operators/switchMap.js
function switchMap(project, resultSelector) {
  return operate((source, subscriber) => {
    let innerSubscriber = null;
    let index = 0;
    let isComplete = false;
    const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe();
      let innerIndex = 0;
      const outerIndex = index++;
      innerFrom(project(value, outerIndex)).subscribe(innerSubscriber = createOperatorSubscriber(subscriber, (innerValue) => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => {
        innerSubscriber = null;
        checkComplete();
      }));
    }, () => {
      isComplete = true;
      checkComplete();
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/takeUntil.js
function takeUntil(notifier) {
  return operate((source, subscriber) => {
    innerFrom(notifier).subscribe(createOperatorSubscriber(subscriber, () => subscriber.complete(), noop));
    !subscriber.closed && source.subscribe(subscriber);
  });
}

// node_modules/rxjs/dist/esm/internal/operators/takeWhile.js
function takeWhile(predicate, inclusive = false) {
  return operate((source, subscriber) => {
    let index = 0;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      const result = predicate(value, index++);
      (result || inclusive) && subscriber.next(value);
      !result && subscriber.complete();
    }));
  });
}

// node_modules/rxjs/dist/esm/internal/operators/tap.js
function tap(observerOrNext, error3, complete) {
  const tapObserver = isFunction(observerOrNext) || error3 || complete ? { next: observerOrNext, error: error3, complete } : observerOrNext;
  return tapObserver ? operate((source, subscriber) => {
    var _a56;
    (_a56 = tapObserver.subscribe) === null || _a56 === void 0 ? void 0 : _a56.call(tapObserver);
    let isUnsub = true;
    source.subscribe(createOperatorSubscriber(subscriber, (value) => {
      var _a57;
      (_a57 = tapObserver.next) === null || _a57 === void 0 ? void 0 : _a57.call(tapObserver, value);
      subscriber.next(value);
    }, () => {
      var _a57;
      isUnsub = false;
      (_a57 = tapObserver.complete) === null || _a57 === void 0 ? void 0 : _a57.call(tapObserver);
      subscriber.complete();
    }, (err) => {
      var _a57;
      isUnsub = false;
      (_a57 = tapObserver.error) === null || _a57 === void 0 ? void 0 : _a57.call(tapObserver, err);
      subscriber.error(err);
    }, () => {
      var _a57, _b;
      if (isUnsub) {
        (_a57 = tapObserver.unsubscribe) === null || _a57 === void 0 ? void 0 : _a57.call(tapObserver);
      }
      (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
    }));
  }) : identity;
}

// node_modules/@angular/core/fesm2022/core.mjs
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
var XSS_SECURITY_URL = "https://g.co/ng/security#xss";
var RuntimeError = class extends Error {
  constructor(code, message) {
    super(formatRuntimeError(code, message));
    this.code = code;
  }
};
function formatRuntimeError(code, message) {
  const fullCode = `NG0${Math.abs(code)}`;
  let errorMessage = `${fullCode}${message ? ": " + message : ""}`;
  if (ngDevMode && code < 0) {
    const addPeriodSeparator = !errorMessage.match(/[.,;!?\n]$/);
    const separator = addPeriodSeparator ? "." : "";
    errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
  }
  return errorMessage;
}
var REQUIRED_UNSET_VALUE = /* @__PURE__ */ Symbol("InputSignalNode#UNSET");
var INPUT_SIGNAL_NODE = /* @__PURE__ */ (() => {
  return __spreadProps(__spreadValues({}, SIGNAL_NODE), {
    transformFn: void 0,
    applyValueToInputSignal(node, value) {
      signalSetFn(node, value);
    }
  });
})();
function createInputSignal(initialValue, options) {
  const node = Object.create(INPUT_SIGNAL_NODE);
  node.value = initialValue;
  node.transformFn = options?.transform;
  function inputValueFn() {
    producerAccessed(node);
    if (node.value === REQUIRED_UNSET_VALUE) {
      throw new RuntimeError(-950, ngDevMode && "Input is required but no value is available yet.");
    }
    return node.value;
  }
  inputValueFn[SIGNAL] = node;
  if (ngDevMode) {
    inputValueFn.toString = () => `[Input Signal: ${inputValueFn()}]`;
  }
  return inputValueFn;
}
function noSideEffects(fn) {
  return { toString: fn }.toString();
}
var ANNOTATIONS = "__annotations__";
var PARAMETERS = "__parameters__";
var PROP_METADATA = "__prop__metadata__";
function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {
  return noSideEffects(() => {
    const metaCtor = makeMetadataCtor(props);
    function DecoratorFactory(...args) {
      if (this instanceof DecoratorFactory) {
        metaCtor.call(this, ...args);
        return this;
      }
      const annotationInstance = new DecoratorFactory(...args);
      return function TypeDecorator(cls) {
        if (typeFn)
          typeFn(cls, ...args);
        const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS];
        annotations.push(annotationInstance);
        if (additionalProcessing)
          additionalProcessing(cls);
        return cls;
      };
    }
    if (parentClass) {
      DecoratorFactory.prototype = Object.create(parentClass.prototype);
    }
    DecoratorFactory.prototype.ngMetadataName = name;
    DecoratorFactory.annotationCls = DecoratorFactory;
    return DecoratorFactory;
  });
}
function makeMetadataCtor(props) {
  return function ctor(...args) {
    if (props) {
      const values = props(...args);
      for (const propName in values) {
        this[propName] = values[propName];
      }
    }
  };
}
function makeParamDecorator(name, props, parentClass) {
  return noSideEffects(() => {
    const metaCtor = makeMetadataCtor(props);
    function ParamDecoratorFactory(...args) {
      if (this instanceof ParamDecoratorFactory) {
        metaCtor.apply(this, args);
        return this;
      }
      const annotationInstance = new ParamDecoratorFactory(...args);
      ParamDecorator.annotation = annotationInstance;
      return ParamDecorator;
      function ParamDecorator(cls, unusedKey, index) {
        const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS];
        while (parameters.length <= index) {
          parameters.push(null);
        }
        (parameters[index] = parameters[index] || []).push(annotationInstance);
        return cls;
      }
    }
    if (parentClass) {
      ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);
    }
    ParamDecoratorFactory.prototype.ngMetadataName = name;
    ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;
    return ParamDecoratorFactory;
  });
}
function makePropDecorator(name, props, parentClass, additionalProcessing) {
  return noSideEffects(() => {
    const metaCtor = makeMetadataCtor(props);
    function PropDecoratorFactory(...args) {
      if (this instanceof PropDecoratorFactory) {
        metaCtor.apply(this, args);
        return this;
      }
      const decoratorInstance = new PropDecoratorFactory(...args);
      function PropDecorator(target, name2) {
        if (target === void 0) {
          throw new Error("Standard Angular field decorators are not supported in JIT mode.");
        }
        const constructor = target.constructor;
        const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA];
        meta[name2] = meta.hasOwnProperty(name2) && meta[name2] || [];
        meta[name2].unshift(decoratorInstance);
        if (additionalProcessing)
          additionalProcessing(target, name2, ...args);
      }
      return PropDecorator;
    }
    if (parentClass) {
      PropDecoratorFactory.prototype = Object.create(parentClass.prototype);
    }
    PropDecoratorFactory.prototype.ngMetadataName = name;
    PropDecoratorFactory.annotationCls = PropDecoratorFactory;
    return PropDecoratorFactory;
  });
}
var _global = globalThis;
function ngDevModeResetPerfCounters() {
  const locationString = typeof location !== "undefined" ? location.toString() : "";
  const newCounters = {
    namedConstructors: locationString.indexOf("ngDevMode=namedConstructors") != -1,
    firstCreatePass: 0,
    tNode: 0,
    tView: 0,
    rendererCreateTextNode: 0,
    rendererSetText: 0,
    rendererCreateElement: 0,
    rendererAddEventListener: 0,
    rendererSetAttribute: 0,
    rendererRemoveAttribute: 0,
    rendererSetProperty: 0,
    rendererSetClassName: 0,
    rendererAddClass: 0,
    rendererRemoveClass: 0,
    rendererSetStyle: 0,
    rendererRemoveStyle: 0,
    rendererDestroy: 0,
    rendererDestroyNode: 0,
    rendererMoveNode: 0,
    rendererRemoveNode: 0,
    rendererAppendChild: 0,
    rendererInsertBefore: 0,
    rendererCreateComment: 0,
    hydratedNodes: 0,
    hydratedComponents: 0,
    dehydratedViewsRemoved: 0,
    dehydratedViewsCleanupRuns: 0,
    componentsSkippedHydration: 0
  };
  const allowNgDevModeTrue = locationString.indexOf("ngDevMode=false") === -1;
  if (!allowNgDevModeTrue) {
    _global["ngDevMode"] = false;
  } else {
    if (typeof _global["ngDevMode"] !== "object") {
      _global["ngDevMode"] = {};
    }
    Object.assign(_global["ngDevMode"], newCounters);
  }
  return newCounters;
}
function initNgDevMode() {
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    if (typeof ngDevMode !== "object" || Object.keys(ngDevMode).length === 0) {
      ngDevModeResetPerfCounters();
    }
    return typeof ngDevMode !== "undefined" && !!ngDevMode;
  }
  return false;
}
function getClosureSafeProperty(objWithPropertyToExtract) {
  for (let key in objWithPropertyToExtract) {
    if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
      return key;
    }
  }
  throw Error("Could not find renamed property on target object.");
}
function fillProperties(target, source) {
  for (const key in source) {
    if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {
      target[key] = source[key];
    }
  }
}
function stringify(token) {
  if (typeof token === "string") {
    return token;
  }
  if (Array.isArray(token)) {
    return "[" + token.map(stringify).join(", ") + "]";
  }
  if (token == null) {
    return "" + token;
  }
  if (token.overriddenName) {
    return `${token.overriddenName}`;
  }
  if (token.name) {
    return `${token.name}`;
  }
  const res = token.toString();
  if (res == null) {
    return "" + res;
  }
  const newLineIndex = res.indexOf("\n");
  return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
}
function concatStringsWithSpace(before, after) {
  return before == null || before === "" ? after === null ? "" : after : after == null || after === "" ? before : before + " " + after;
}
var __forward_ref__ = getClosureSafeProperty({ __forward_ref__: getClosureSafeProperty });
function forwardRef(forwardRefFn) {
  forwardRefFn.__forward_ref__ = forwardRef;
  forwardRefFn.toString = function() {
    return stringify(this());
  };
  return forwardRefFn;
}
function resolveForwardRef(type) {
  return isForwardRef(type) ? type() : type;
}
function isForwardRef(fn) {
  return typeof fn === "function" && fn.hasOwnProperty(__forward_ref__) && fn.__forward_ref__ === forwardRef;
}
function assertNumber(actual, msg) {
  if (!(typeof actual === "number")) {
    throwError2(msg, typeof actual, "number", "===");
  }
}
function assertNumberInRange(actual, minInclusive, maxInclusive) {
  assertNumber(actual, "Expected a number");
  assertLessThanOrEqual(actual, maxInclusive, "Expected number to be less than or equal to");
  assertGreaterThanOrEqual(actual, minInclusive, "Expected number to be greater than or equal to");
}
function assertString(actual, msg) {
  if (!(typeof actual === "string")) {
    throwError2(msg, actual === null ? "null" : typeof actual, "string", "===");
  }
}
function assertFunction(actual, msg) {
  if (!(typeof actual === "function")) {
    throwError2(msg, actual === null ? "null" : typeof actual, "function", "===");
  }
}
function assertEqual(actual, expected, msg) {
  if (!(actual == expected)) {
    throwError2(msg, actual, expected, "==");
  }
}
function assertNotEqual(actual, expected, msg) {
  if (!(actual != expected)) {
    throwError2(msg, actual, expected, "!=");
  }
}
function assertSame(actual, expected, msg) {
  if (!(actual === expected)) {
    throwError2(msg, actual, expected, "===");
  }
}
function assertNotSame(actual, expected, msg) {
  if (!(actual !== expected)) {
    throwError2(msg, actual, expected, "!==");
  }
}
function assertLessThan(actual, expected, msg) {
  if (!(actual < expected)) {
    throwError2(msg, actual, expected, "<");
  }
}
function assertLessThanOrEqual(actual, expected, msg) {
  if (!(actual <= expected)) {
    throwError2(msg, actual, expected, "<=");
  }
}
function assertGreaterThan(actual, expected, msg) {
  if (!(actual > expected)) {
    throwError2(msg, actual, expected, ">");
  }
}
function assertGreaterThanOrEqual(actual, expected, msg) {
  if (!(actual >= expected)) {
    throwError2(msg, actual, expected, ">=");
  }
}
function assertDefined(actual, msg) {
  if (actual == null) {
    throwError2(msg, actual, null, "!=");
  }
}
function throwError2(msg, actual, expected, comparison) {
  throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? "" : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));
}
function assertDomNode(node) {
  if (!(node instanceof Node)) {
    throwError2(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);
  }
}
function assertElement(node) {
  if (!(node instanceof Element)) {
    throwError2(`The provided value must be an element but got ${stringify(node)}`);
  }
}
function assertIndexInRange(arr, index) {
  assertDefined(arr, "Array must be defined.");
  const maxLen = arr.length;
  if (index < 0 || index >= maxLen) {
    throwError2(`Index expected to be less than ${maxLen} but got ${index}`);
  }
}
function assertOneOf(value, ...validValues) {
  if (validValues.indexOf(value) !== -1)
    return true;
  throwError2(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);
}
function assertNotReactive(fn) {
  if (getActiveConsumer() !== null) {
    throwError2(`${fn}() should never be called in a reactive context.`);
  }
}
function \u0275\u0275defineInjectable(opts) {
  return {
    token: opts.token,
    providedIn: opts.providedIn || null,
    factory: opts.factory,
    value: void 0
  };
}
function \u0275\u0275defineInjector(options) {
  return { providers: options.providers || [], imports: options.imports || [] };
}
function getInjectableDef(type) {
  return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);
}
function getOwnDefinition(type, field) {
  return type.hasOwnProperty(field) ? type[field] : null;
}
function getInheritedInjectableDef(type) {
  const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
  if (def) {
    ngDevMode && console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.
This will become an error in a future version of Angular. Please add @Injectable() to the "${type.name}" class.`);
    return def;
  } else {
    return null;
  }
}
function getInjectorDef(type) {
  return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF)) ? type[NG_INJ_DEF] : null;
}
var NG_PROV_DEF = getClosureSafeProperty({ \u0275prov: getClosureSafeProperty });
var NG_INJ_DEF = getClosureSafeProperty({ \u0275inj: getClosureSafeProperty });
var NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty });
var NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty });
var InjectionToken = class {
  /**
   * @param _desc   Description for the token,
   *                used only for debugging purposes,
   *                it should but does not need to be unique
   * @param options Options for the token's usage, as described above
   */
  constructor(_desc, options) {
    this._desc = _desc;
    this.ngMetadataName = "InjectionToken";
    this.\u0275prov = void 0;
    if (typeof options == "number") {
      (typeof ngDevMode === "undefined" || ngDevMode) && assertLessThan(options, 0, "Only negative numbers are supported here");
      this.__NG_ELEMENT_ID__ = options;
    } else if (options !== void 0) {
      this.\u0275prov = \u0275\u0275defineInjectable({
        token: this,
        providedIn: options.providedIn || "root",
        factory: options.factory
      });
    }
  }
  /**
   * @internal
   */
  get multi() {
    return this;
  }
  toString() {
    return `InjectionToken ${this._desc}`;
  }
};
var _injectorProfilerContext;
function getInjectorProfilerContext() {
  !ngDevMode && throwError2("getInjectorProfilerContext should never be called in production mode");
  return _injectorProfilerContext;
}
function setInjectorProfilerContext(context2) {
  !ngDevMode && throwError2("setInjectorProfilerContext should never be called in production mode");
  const previous = _injectorProfilerContext;
  _injectorProfilerContext = context2;
  return previous;
}
var injectorProfilerCallback = null;
var setInjectorProfiler = (injectorProfiler2) => {
  !ngDevMode && throwError2("setInjectorProfiler should never be called in production mode");
  injectorProfilerCallback = injectorProfiler2;
};
function injectorProfiler(event) {
  !ngDevMode && throwError2("Injector profiler should never be called in production mode");
  if (injectorProfilerCallback != null) {
    injectorProfilerCallback(event);
  }
}
function emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {
  !ngDevMode && throwError2("Injector profiler should never be called in production mode");
  let token;
  if (typeof eventProvider === "function") {
    token = eventProvider;
  } else if (eventProvider instanceof InjectionToken) {
    token = eventProvider;
  } else {
    token = resolveForwardRef(eventProvider.provide);
  }
  let provider = eventProvider;
  if (eventProvider instanceof InjectionToken) {
    provider = eventProvider.\u0275prov || eventProvider;
  }
  injectorProfiler({
    type: 2,
    context: getInjectorProfilerContext(),
    providerRecord: { token, provider, isViewProvider }
  });
}
function emitInstanceCreatedByInjectorEvent(instance) {
  !ngDevMode && throwError2("Injector profiler should never be called in production mode");
  injectorProfiler({
    type: 1,
    context: getInjectorProfilerContext(),
    instance: { value: instance }
  });
}
function emitInjectEvent(token, value, flags) {
  !ngDevMode && throwError2("Injector profiler should never be called in production mode");
  injectorProfiler({
    type: 0,
    context: getInjectorProfilerContext(),
    service: { token, value, flags }
  });
}
function runInInjectorProfilerContext(injector, token, callback) {
  !ngDevMode && throwError2("runInInjectorProfilerContext should never be called in production mode");
  const prevInjectContext = setInjectorProfilerContext({ injector, token });
  try {
    callback();
  } finally {
    setInjectorProfilerContext(prevInjectContext);
  }
}
function isEnvironmentProviders(value) {
  return value && !!value.\u0275providers;
}
var NG_COMP_DEF = getClosureSafeProperty({ \u0275cmp: getClosureSafeProperty });
var NG_DIR_DEF = getClosureSafeProperty({ \u0275dir: getClosureSafeProperty });
var NG_PIPE_DEF = getClosureSafeProperty({ \u0275pipe: getClosureSafeProperty });
var NG_MOD_DEF = getClosureSafeProperty({ \u0275mod: getClosureSafeProperty });
var NG_FACTORY_DEF = getClosureSafeProperty({ \u0275fac: getClosureSafeProperty });
var NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafeProperty });
var NG_ENV_ID = getClosureSafeProperty({ __NG_ENV_ID__: getClosureSafeProperty });
function renderStringify(value) {
  if (typeof value === "string")
    return value;
  if (value == null)
    return "";
  return String(value);
}
function stringifyForError(value) {
  if (typeof value === "function")
    return value.name || value.toString();
  if (typeof value === "object" && value != null && typeof value.type === "function") {
    return value.type.name || value.type.toString();
  }
  return renderStringify(value);
}
function throwCyclicDependencyError(token, path) {
  const depPath = path ? `. Dependency path: ${path.join(" > ")} > ${token}` : "";
  throw new RuntimeError(-200, ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token);
}
function throwMixedMultiProviderError() {
  throw new Error(`Cannot mix multi providers and regular providers`);
}
function throwInvalidProviderError(ngModuleType, providers, provider) {
  if (ngModuleType && providers) {
    const providerDetail = providers.map((v) => v == provider ? "?" + provider + "?" : "...");
    throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(", ")}]`);
  } else if (isEnvironmentProviders(provider)) {
    if (provider.\u0275fromNgModule) {
      throw new RuntimeError(207, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);
    } else {
      throw new RuntimeError(207, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);
    }
  } else {
    throw new Error("Invalid provider");
  }
}
function throwProviderNotFoundError(token, injectorName) {
  const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ""}`;
  throw new RuntimeError(-201, errorMessage);
}
var InjectFlags;
(function(InjectFlags2) {
  InjectFlags2[InjectFlags2["Default"] = 0] = "Default";
  InjectFlags2[InjectFlags2["Host"] = 1] = "Host";
  InjectFlags2[InjectFlags2["Self"] = 2] = "Self";
  InjectFlags2[InjectFlags2["SkipSelf"] = 4] = "SkipSelf";
  InjectFlags2[InjectFlags2["Optional"] = 8] = "Optional";
})(InjectFlags || (InjectFlags = {}));
var _injectImplementation;
function getInjectImplementation() {
  return _injectImplementation;
}
function setInjectImplementation(impl) {
  const previous = _injectImplementation;
  _injectImplementation = impl;
  return previous;
}
function injectRootLimpMode(token, notFoundValue, flags) {
  const injectableDef = getInjectableDef(token);
  if (injectableDef && injectableDef.providedIn == "root") {
    return injectableDef.value === void 0 ? injectableDef.value = injectableDef.factory() : injectableDef.value;
  }
  if (flags & InjectFlags.Optional)
    return null;
  if (notFoundValue !== void 0)
    return notFoundValue;
  throwProviderNotFoundError(token, "Injector");
}
function assertInjectImplementationNotEqual(fn) {
  ngDevMode && assertNotEqual(_injectImplementation, fn, "Calling \u0275\u0275inject would cause infinite recursion");
}
var _THROW_IF_NOT_FOUND = {};
var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
var DI_DECORATOR_FLAG = "__NG_DI_FLAG__";
var NG_TEMP_TOKEN_PATH = "ngTempTokenPath";
var NG_TOKEN_PATH = "ngTokenPath";
var NEW_LINE = /\n/gm;
var NO_NEW_LINE = "\u0275";
var SOURCE = "__source";
var _currentInjector = void 0;
function getCurrentInjector() {
  return _currentInjector;
}
function setCurrentInjector(injector) {
  const former = _currentInjector;
  _currentInjector = injector;
  return former;
}
function injectInjectorOnly(token, flags = InjectFlags.Default) {
  if (_currentInjector === void 0) {
    throw new RuntimeError(-203, ngDevMode && `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`runInInjectionContext\`.`);
  } else if (_currentInjector === null) {
    return injectRootLimpMode(token, void 0, flags);
  } else {
    const value = _currentInjector.get(token, flags & InjectFlags.Optional ? null : void 0, flags);
    ngDevMode && emitInjectEvent(token, value, flags);
    return value;
  }
}
function \u0275\u0275inject(token, flags = InjectFlags.Default) {
  return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
}
function \u0275\u0275invalidFactoryDep(index) {
  throw new RuntimeError(202, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.

Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
}
function inject(token, flags = InjectFlags.Default) {
  return \u0275\u0275inject(token, convertToBitFlags(flags));
}
function convertToBitFlags(flags) {
  if (typeof flags === "undefined" || typeof flags === "number") {
    return flags;
  }
  return 0 | // comment to force a line break in the formatter
  (flags.optional && 8) | (flags.host && 1) | (flags.self && 2) | (flags.skipSelf && 4);
}
function injectArgs(types2) {
  const args = [];
  for (let i2 = 0; i2 < types2.length; i2++) {
    const arg = resolveForwardRef(types2[i2]);
    if (Array.isArray(arg)) {
      if (arg.length === 0) {
        throw new RuntimeError(900, ngDevMode && "Arguments array must have arguments.");
      }
      let type = void 0;
      let flags = InjectFlags.Default;
      for (let j = 0; j < arg.length; j++) {
        const meta = arg[j];
        const flag = getInjectFlag(meta);
        if (typeof flag === "number") {
          if (flag === -1) {
            type = meta.token;
          } else {
            flags |= flag;
          }
        } else {
          type = meta;
        }
      }
      args.push(\u0275\u0275inject(type, flags));
    } else {
      args.push(\u0275\u0275inject(arg));
    }
  }
  return args;
}
function attachInjectFlag(decorator, flag) {
  decorator[DI_DECORATOR_FLAG] = flag;
  decorator.prototype[DI_DECORATOR_FLAG] = flag;
  return decorator;
}
function getInjectFlag(token) {
  return token[DI_DECORATOR_FLAG];
}
function catchInjectorError(e, token, injectorErrorName, source) {
  const tokenPath = e[NG_TEMP_TOKEN_PATH];
  if (token[SOURCE]) {
    tokenPath.unshift(token[SOURCE]);
  }
  e.message = formatError("\n" + e.message, tokenPath, injectorErrorName, source);
  e[NG_TOKEN_PATH] = tokenPath;
  e[NG_TEMP_TOKEN_PATH] = null;
  throw e;
}
function formatError(text, obj, injectorErrorName, source = null) {
  text = text && text.charAt(0) === "\n" && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;
  let context2 = stringify(obj);
  if (Array.isArray(obj)) {
    context2 = obj.map(stringify).join(" -> ");
  } else if (typeof obj === "object") {
    let parts = [];
    for (let key in obj) {
      if (obj.hasOwnProperty(key)) {
        let value = obj[key];
        parts.push(key + ":" + (typeof value === "string" ? JSON.stringify(value) : stringify(value)));
      }
    }
    context2 = `{${parts.join(", ")}}`;
  }
  return `${injectorErrorName}${source ? "(" + source + ")" : ""}[${context2}]: ${text.replace(NEW_LINE, "\n  ")}`;
}
var Inject = attachInjectFlag(
  // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
  makeParamDecorator("Inject", (token) => ({ token })),
  -1
  /* DecoratorFlags.Inject */
);
var Optional = (
  // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
  // tslint:disable-next-line: no-toplevel-property-access
  attachInjectFlag(
    makeParamDecorator("Optional"),
    8
    /* InternalInjectFlags.Optional */
  )
);
var Self = (
  // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
  // tslint:disable-next-line: no-toplevel-property-access
  attachInjectFlag(
    makeParamDecorator("Self"),
    2
    /* InternalInjectFlags.Self */
  )
);
var SkipSelf = (
  // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
  // tslint:disable-next-line: no-toplevel-property-access
  attachInjectFlag(
    makeParamDecorator("SkipSelf"),
    4
    /* InternalInjectFlags.SkipSelf */
  )
);
var Host = (
  // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
  // tslint:disable-next-line: no-toplevel-property-access
  attachInjectFlag(
    makeParamDecorator("Host"),
    1
    /* InternalInjectFlags.Host */
  )
);
function getFactoryDef(type, throwNotFound) {
  const hasFactoryDef = type.hasOwnProperty(NG_FACTORY_DEF);
  if (!hasFactoryDef && throwNotFound === true && ngDevMode) {
    throw new Error(`Type ${stringify(type)} does not have '\u0275fac' property.`);
  }
  return hasFactoryDef ? type[NG_FACTORY_DEF] : null;
}
function arrayEquals(a, b, identityAccessor) {
  if (a.length !== b.length)
    return false;
  for (let i2 = 0; i2 < a.length; i2++) {
    let valueA = a[i2];
    let valueB = b[i2];
    if (identityAccessor) {
      valueA = identityAccessor(valueA);
      valueB = identityAccessor(valueB);
    }
    if (valueB !== valueA) {
      return false;
    }
  }
  return true;
}
function flatten(list) {
  return list.flat(Number.POSITIVE_INFINITY);
}
function deepForEach(input2, fn) {
  input2.forEach((value) => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
}
function addToArray(arr, index, value) {
  if (index >= arr.length) {
    arr.push(value);
  } else {
    arr.splice(index, 0, value);
  }
}
function removeFromArray(arr, index) {
  if (index >= arr.length - 1) {
    return arr.pop();
  } else {
    return arr.splice(index, 1)[0];
  }
}
function newArray(size, value) {
  const list = [];
  for (let i2 = 0; i2 < size; i2++) {
    list.push(value);
  }
  return list;
}
function arraySplice(array2, index, count) {
  const length = array2.length - count;
  while (index < length) {
    array2[index] = array2[index + count];
    index++;
  }
  while (count--) {
    array2.pop();
  }
}
function arrayInsert2(array2, index, value1, value2) {
  ngDevMode && assertLessThanOrEqual(index, array2.length, "Can't insert past array end.");
  let end = array2.length;
  if (end == index) {
    array2.push(value1, value2);
  } else if (end === 1) {
    array2.push(value2, array2[0]);
    array2[0] = value1;
  } else {
    end--;
    array2.push(array2[end - 1], array2[end]);
    while (end > index) {
      const previousEnd = end - 2;
      array2[end] = array2[previousEnd];
      end--;
    }
    array2[index] = value1;
    array2[index + 1] = value2;
  }
}
function keyValueArraySet(keyValueArray, key, value) {
  let index = keyValueArrayIndexOf(keyValueArray, key);
  if (index >= 0) {
    keyValueArray[index | 1] = value;
  } else {
    index = ~index;
    arrayInsert2(keyValueArray, index, key, value);
  }
  return index;
}
function keyValueArrayGet(keyValueArray, key) {
  const index = keyValueArrayIndexOf(keyValueArray, key);
  if (index >= 0) {
    return keyValueArray[index | 1];
  }
  return void 0;
}
function keyValueArrayIndexOf(keyValueArray, key) {
  return _arrayIndexOfSorted(keyValueArray, key, 1);
}
function _arrayIndexOfSorted(array2, value, shift) {
  ngDevMode && assertEqual(Array.isArray(array2), true, "Expecting an array");
  let start2 = 0;
  let end = array2.length >> shift;
  while (end !== start2) {
    const middle = start2 + (end - start2 >> 1);
    const current = array2[middle << shift];
    if (value === current) {
      return middle << shift;
    } else if (current > value) {
      end = middle;
    } else {
      start2 = middle + 1;
    }
  }
  return ~(end << shift);
}
var EMPTY_OBJ = {};
var EMPTY_ARRAY = [];
if ((typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode()) {
  Object.freeze(EMPTY_OBJ);
  Object.freeze(EMPTY_ARRAY);
}
var ENVIRONMENT_INITIALIZER = new InjectionToken(ngDevMode ? "ENVIRONMENT_INITIALIZER" : "");
var INJECTOR$1 = new InjectionToken(
  ngDevMode ? "INJECTOR" : "",
  // Disable tslint because this is const enum which gets inlined not top level prop access.
  // tslint:disable-next-line: no-toplevel-property-access
  -1
  /* InjectorMarkers.Injector */
);
var INJECTOR_DEF_TYPES = new InjectionToken(ngDevMode ? "INJECTOR_DEF_TYPES" : "");
var NullInjector = class {
  get(token, notFoundValue = THROW_IF_NOT_FOUND) {
    if (notFoundValue === THROW_IF_NOT_FOUND) {
      const error3 = new Error(`NullInjectorError: No provider for ${stringify(token)}!`);
      error3.name = "NullInjectorError";
      throw error3;
    }
    return notFoundValue;
  }
};
var ChangeDetectionStrategy;
(function(ChangeDetectionStrategy2) {
  ChangeDetectionStrategy2[ChangeDetectionStrategy2["OnPush"] = 0] = "OnPush";
  ChangeDetectionStrategy2[ChangeDetectionStrategy2["Default"] = 1] = "Default";
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
var ViewEncapsulation$1;
(function(ViewEncapsulation2) {
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
  ViewEncapsulation2[ViewEncapsulation2["None"] = 2] = "None";
  ViewEncapsulation2[ViewEncapsulation2["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
var InputFlags;
(function(InputFlags2) {
  InputFlags2[InputFlags2["None"] = 0] = "None";
  InputFlags2[InputFlags2["SignalBased"] = 1] = "SignalBased";
  InputFlags2[InputFlags2["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform";
})(InputFlags || (InputFlags = {}));
function classIndexOf(className, classToSearch, startingIndex) {
  ngDevMode && assertNotEqual(classToSearch, "", 'can not look for "" string.');
  let end = className.length;
  while (true) {
    const foundIndex = className.indexOf(classToSearch, startingIndex);
    if (foundIndex === -1)
      return foundIndex;
    if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32) {
      const length = classToSearch.length;
      if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32) {
        return foundIndex;
      }
    }
    startingIndex = foundIndex + 1;
  }
}
function setUpAttributes(renderer, native, attrs) {
  let i2 = 0;
  while (i2 < attrs.length) {
    const value = attrs[i2];
    if (typeof value === "number") {
      if (value !== 0) {
        break;
      }
      i2++;
      const namespaceURI = attrs[i2++];
      const attrName = attrs[i2++];
      const attrVal = attrs[i2++];
      ngDevMode && ngDevMode.rendererSetAttribute++;
      renderer.setAttribute(native, attrName, attrVal, namespaceURI);
    } else {
      const attrName = value;
      const attrVal = attrs[++i2];
      ngDevMode && ngDevMode.rendererSetAttribute++;
      if (isAnimationProp(attrName)) {
        renderer.setProperty(native, attrName, attrVal);
      } else {
        renderer.setAttribute(native, attrName, attrVal);
      }
      i2++;
    }
  }
  return i2;
}
function isNameOnlyAttributeMarker(marker) {
  return marker === 3 || marker === 4 || marker === 6;
}
function isAnimationProp(name) {
  return name.charCodeAt(0) === 64;
}
function mergeHostAttrs(dst, src) {
  if (src === null || src.length === 0) {
  } else if (dst === null || dst.length === 0) {
    dst = src.slice();
  } else {
    let srcMarker = -1;
    for (let i2 = 0; i2 < src.length; i2++) {
      const item = src[i2];
      if (typeof item === "number") {
        srcMarker = item;
      } else {
        if (srcMarker === 0) {
        } else if (srcMarker === -1 || srcMarker === 2) {
          mergeHostAttribute(dst, srcMarker, item, null, src[++i2]);
        } else {
          mergeHostAttribute(dst, srcMarker, item, null, null);
        }
      }
    }
  }
  return dst;
}
function mergeHostAttribute(dst, marker, key1, key2, value) {
  let i2 = 0;
  let markerInsertPosition = dst.length;
  if (marker === -1) {
    markerInsertPosition = -1;
  } else {
    while (i2 < dst.length) {
      const dstValue = dst[i2++];
      if (typeof dstValue === "number") {
        if (dstValue === marker) {
          markerInsertPosition = -1;
          break;
        } else if (dstValue > marker) {
          markerInsertPosition = i2 - 1;
          break;
        }
      }
    }
  }
  while (i2 < dst.length) {
    const item = dst[i2];
    if (typeof item === "number") {
      break;
    } else if (item === key1) {
      if (key2 === null) {
        if (value !== null) {
          dst[i2 + 1] = value;
        }
        return;
      } else if (key2 === dst[i2 + 1]) {
        dst[i2 + 2] = value;
        return;
      }
    }
    i2++;
    if (key2 !== null)
      i2++;
    if (value !== null)
      i2++;
  }
  if (markerInsertPosition !== -1) {
    dst.splice(markerInsertPosition, 0, marker);
    i2 = markerInsertPosition + 1;
  }
  dst.splice(i2++, 0, key1);
  if (key2 !== null) {
    dst.splice(i2++, 0, key2);
  }
  if (value !== null) {
    dst.splice(i2++, 0, value);
  }
}
var NG_TEMPLATE_SELECTOR = "ng-template";
function isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {
  ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), "Class name expected to be lowercase.");
  let i2 = 0;
  if (isProjectionMode) {
    for (; i2 < attrs.length && typeof attrs[i2] === "string"; i2 += 2) {
      if (attrs[i2] === "class" && classIndexOf(attrs[i2 + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {
        return true;
      }
    }
  } else if (isInlineTemplate(tNode)) {
    return false;
  }
  i2 = attrs.indexOf(1, i2);
  if (i2 > -1) {
    let item;
    while (++i2 < attrs.length && typeof (item = attrs[i2]) === "string") {
      if (item.toLowerCase() === cssClassToMatch) {
        return true;
      }
    }
  }
  return false;
}
function isInlineTemplate(tNode) {
  return tNode.type === 4 && tNode.value !== NG_TEMPLATE_SELECTOR;
}
function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {
  const tagNameToCompare = tNode.type === 4 && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;
  return currentSelector === tagNameToCompare;
}
function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
  ngDevMode && assertDefined(selector[0], "Selector should have a tag name");
  let mode = 4;
  const nodeAttrs = tNode.attrs;
  const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;
  let skipToNextSelector = false;
  for (let i2 = 0; i2 < selector.length; i2++) {
    const current = selector[i2];
    if (typeof current === "number") {
      if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
        return false;
      }
      if (skipToNextSelector && isPositive(current))
        continue;
      skipToNextSelector = false;
      mode = current | mode & 1;
      continue;
    }
    if (skipToNextSelector)
      continue;
    if (mode & 4) {
      mode = 2 | mode & 1;
      if (current !== "" && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === "" && selector.length === 1) {
        if (isPositive(mode))
          return false;
        skipToNextSelector = true;
      }
    } else if (mode & 8) {
      if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {
        if (isPositive(mode))
          return false;
        skipToNextSelector = true;
      }
    } else {
      const selectorAttrValue = selector[++i2];
      const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);
      if (attrIndexInNode === -1) {
        if (isPositive(mode))
          return false;
        skipToNextSelector = true;
        continue;
      }
      if (selectorAttrValue !== "") {
        let nodeAttrValue;
        if (attrIndexInNode > nameOnlyMarkerIdx) {
          nodeAttrValue = "";
        } else {
          ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0, "We do not match directives on namespaced attributes");
          nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();
        }
        if (mode & 2 && selectorAttrValue !== nodeAttrValue) {
          if (isPositive(mode))
            return false;
          skipToNextSelector = true;
        }
      }
    }
  }
  return isPositive(mode) || skipToNextSelector;
}
function isPositive(mode) {
  return (mode & 1) === 0;
}
function findAttrIndexInNode(name, attrs, isInlineTemplate2, isProjectionMode) {
  if (attrs === null)
    return -1;
  let i2 = 0;
  if (isProjectionMode || !isInlineTemplate2) {
    let bindingsMode = false;
    while (i2 < attrs.length) {
      const maybeAttrName = attrs[i2];
      if (maybeAttrName === name) {
        return i2;
      } else if (maybeAttrName === 3 || maybeAttrName === 6) {
        bindingsMode = true;
      } else if (maybeAttrName === 1 || maybeAttrName === 2) {
        let value = attrs[++i2];
        while (typeof value === "string") {
          value = attrs[++i2];
        }
        continue;
      } else if (maybeAttrName === 4) {
        break;
      } else if (maybeAttrName === 0) {
        i2 += 4;
        continue;
      }
      i2 += bindingsMode ? 1 : 2;
    }
    return -1;
  } else {
    return matchTemplateAttribute(attrs, name);
  }
}
function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {
  for (let i2 = 0; i2 < selector.length; i2++) {
    if (isNodeMatchingSelector(tNode, selector[i2], isProjectionMode)) {
      return true;
    }
  }
  return false;
}
function getProjectAsAttrValue(tNode) {
  const nodeAttrs = tNode.attrs;
  if (nodeAttrs != null) {
    const ngProjectAsAttrIdx = nodeAttrs.indexOf(
      5
      /* AttributeMarker.ProjectAs */
    );
    if ((ngProjectAsAttrIdx & 1) === 0) {
      return nodeAttrs[ngProjectAsAttrIdx + 1];
    }
  }
  return null;
}
function getNameOnlyMarkerIndex(nodeAttrs) {
  for (let i2 = 0; i2 < nodeAttrs.length; i2++) {
    const nodeAttr = nodeAttrs[i2];
    if (isNameOnlyAttributeMarker(nodeAttr)) {
      return i2;
    }
  }
  return nodeAttrs.length;
}
function matchTemplateAttribute(attrs, name) {
  let i2 = attrs.indexOf(
    4
    /* AttributeMarker.Template */
  );
  if (i2 > -1) {
    i2++;
    while (i2 < attrs.length) {
      const attr = attrs[i2];
      if (typeof attr === "number")
        return -1;
      if (attr === name)
        return i2;
      i2++;
    }
  }
  return -1;
}
function isSelectorInSelectorList(selector, list) {
  selectorListLoop: for (let i2 = 0; i2 < list.length; i2++) {
    const currentSelectorInList = list[i2];
    if (selector.length !== currentSelectorInList.length) {
      continue;
    }
    for (let j = 0; j < selector.length; j++) {
      if (selector[j] !== currentSelectorInList[j]) {
        continue selectorListLoop;
      }
    }
    return true;
  }
  return false;
}
function maybeWrapInNotSelector(isNegativeMode, chunk2) {
  return isNegativeMode ? ":not(" + chunk2.trim() + ")" : chunk2;
}
function stringifyCSSSelector(selector) {
  let result = selector[0];
  let i2 = 1;
  let mode = 2;
  let currentChunk = "";
  let isNegativeMode = false;
  while (i2 < selector.length) {
    let valueOrMarker = selector[i2];
    if (typeof valueOrMarker === "string") {
      if (mode & 2) {
        const attrValue = selector[++i2];
        currentChunk += "[" + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : "") + "]";
      } else if (mode & 8) {
        currentChunk += "." + valueOrMarker;
      } else if (mode & 4) {
        currentChunk += " " + valueOrMarker;
      }
    } else {
      if (currentChunk !== "" && !isPositive(valueOrMarker)) {
        result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
        currentChunk = "";
      }
      mode = valueOrMarker;
      isNegativeMode = isNegativeMode || !isPositive(mode);
    }
    i2++;
  }
  if (currentChunk !== "") {
    result += maybeWrapInNotSelector(isNegativeMode, currentChunk);
  }
  return result;
}
function stringifyCSSSelectorList(selectorList) {
  return selectorList.map(stringifyCSSSelector).join(",");
}
function extractAttrsAndClassesFromSelector(selector) {
  const attrs = [];
  const classes = [];
  let i2 = 1;
  let mode = 2;
  while (i2 < selector.length) {
    let valueOrMarker = selector[i2];
    if (typeof valueOrMarker === "string") {
      if (mode === 2) {
        if (valueOrMarker !== "") {
          attrs.push(valueOrMarker, selector[++i2]);
        }
      } else if (mode === 8) {
        classes.push(valueOrMarker);
      }
    } else {
      if (!isPositive(mode))
        break;
      mode = valueOrMarker;
    }
    i2++;
  }
  return { attrs, classes };
}
function \u0275\u0275defineComponent(componentDefinition) {
  return noSideEffects(() => {
    (typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode();
    const baseDef = getNgDirectiveDef(componentDefinition);
    const def = __spreadProps(__spreadValues({}, baseDef), {
      decls: componentDefinition.decls,
      vars: componentDefinition.vars,
      template: componentDefinition.template,
      consts: componentDefinition.consts || null,
      ngContentSelectors: componentDefinition.ngContentSelectors,
      onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
      directiveDefs: null,
      // assigned in noSideEffects
      pipeDefs: null,
      // assigned in noSideEffects
      dependencies: baseDef.standalone && componentDefinition.dependencies || null,
      getStandaloneInjector: null,
      signals: componentDefinition.signals ?? false,
      data: componentDefinition.data || {},
      encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated,
      styles: componentDefinition.styles || EMPTY_ARRAY,
      _: null,
      schemas: componentDefinition.schemas || null,
      tView: null,
      id: ""
    });
    initFeatures(def);
    const dependencies = componentDefinition.dependencies;
    def.directiveDefs = extractDefListOrFactory(
      dependencies,
      /* pipeDef */
      false
    );
    def.pipeDefs = extractDefListOrFactory(
      dependencies,
      /* pipeDef */
      true
    );
    def.id = getComponentId(def);
    return def;
  });
}
function extractDirectiveDef(type) {
  return getComponentDef(type) || getDirectiveDef(type);
}
function nonNull(value) {
  return value !== null;
}
function \u0275\u0275defineNgModule(def) {
  return noSideEffects(() => {
    const res = {
      type: def.type,
      bootstrap: def.bootstrap || EMPTY_ARRAY,
      declarations: def.declarations || EMPTY_ARRAY,
      imports: def.imports || EMPTY_ARRAY,
      exports: def.exports || EMPTY_ARRAY,
      transitiveCompileScopes: null,
      schemas: def.schemas || null,
      id: def.id || null
    };
    return res;
  });
}
function parseAndConvertBindingsForDefinition(obj, declaredInputs) {
  if (obj == null)
    return EMPTY_OBJ;
  const newLookup = {};
  for (const minifiedKey in obj) {
    if (obj.hasOwnProperty(minifiedKey)) {
      const value = obj[minifiedKey];
      let publicName;
      let declaredName;
      let inputFlags = InputFlags.None;
      if (Array.isArray(value)) {
        inputFlags = value[0];
        publicName = value[1];
        declaredName = value[2] ?? publicName;
      } else {
        publicName = value;
        declaredName = value;
      }
      if (declaredInputs) {
        newLookup[publicName] = inputFlags !== InputFlags.None ? [minifiedKey, inputFlags] : minifiedKey;
        declaredInputs[publicName] = declaredName;
      } else {
        newLookup[publicName] = minifiedKey;
      }
    }
  }
  return newLookup;
}
function \u0275\u0275defineDirective(directiveDefinition) {
  return noSideEffects(() => {
    const def = getNgDirectiveDef(directiveDefinition);
    initFeatures(def);
    return def;
  });
}
function \u0275\u0275definePipe(pipeDef) {
  return {
    type: pipeDef.type,
    name: pipeDef.name,
    factory: null,
    pure: pipeDef.pure !== false,
    standalone: pipeDef.standalone === true,
    onDestroy: pipeDef.type.prototype.ngOnDestroy || null
  };
}
function getComponentDef(type) {
  return type[NG_COMP_DEF] || null;
}
function getDirectiveDef(type) {
  return type[NG_DIR_DEF] || null;
}
function getPipeDef$1(type) {
  return type[NG_PIPE_DEF] || null;
}
function isStandalone(type) {
  const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
  return def !== null ? def.standalone : false;
}
function getNgModuleDef(type, throwNotFound) {
  const ngModuleDef = type[NG_MOD_DEF] || null;
  if (!ngModuleDef && throwNotFound === true) {
    throw new Error(`Type ${stringify(type)} does not have '\u0275mod' property.`);
  }
  return ngModuleDef;
}
function getNgDirectiveDef(directiveDefinition) {
  const declaredInputs = {};
  return {
    type: directiveDefinition.type,
    providersResolver: null,
    factory: null,
    hostBindings: directiveDefinition.hostBindings || null,
    hostVars: directiveDefinition.hostVars || 0,
    hostAttrs: directiveDefinition.hostAttrs || null,
    contentQueries: directiveDefinition.contentQueries || null,
    declaredInputs,
    inputTransforms: null,
    inputConfig: directiveDefinition.inputs || EMPTY_OBJ,
    exportAs: directiveDefinition.exportAs || null,
    standalone: directiveDefinition.standalone === true,
    signals: directiveDefinition.signals === true,
    selectors: directiveDefinition.selectors || EMPTY_ARRAY,
    viewQuery: directiveDefinition.viewQuery || null,
    features: directiveDefinition.features || null,
    setInput: null,
    findHostDirectiveDefs: null,
    hostDirectives: null,
    inputs: parseAndConvertBindingsForDefinition(directiveDefinition.inputs, declaredInputs),
    outputs: parseAndConvertBindingsForDefinition(directiveDefinition.outputs),
    debugInfo: null
  };
}
function initFeatures(definition) {
  definition.features?.forEach((fn) => fn(definition));
}
function extractDefListOrFactory(dependencies, pipeDef) {
  if (!dependencies) {
    return null;
  }
  const defExtractor = pipeDef ? getPipeDef$1 : extractDirectiveDef;
  return () => (typeof dependencies === "function" ? dependencies() : dependencies).map((dep) => defExtractor(dep)).filter(nonNull);
}
var GENERATED_COMP_IDS = /* @__PURE__ */ new Map();
function getComponentId(componentDef) {
  let hash2 = 0;
  const hashSelectors = [
    componentDef.selectors,
    componentDef.ngContentSelectors,
    componentDef.hostVars,
    componentDef.hostAttrs,
    componentDef.consts,
    componentDef.vars,
    componentDef.decls,
    componentDef.encapsulation,
    componentDef.standalone,
    componentDef.signals,
    componentDef.exportAs,
    JSON.stringify(componentDef.inputs),
    JSON.stringify(componentDef.outputs),
    // We cannot use 'componentDef.type.name' as the name of the symbol will change and will not
    // match in the server and browser bundles.
    Object.getOwnPropertyNames(componentDef.type.prototype),
    !!componentDef.contentQueries,
    !!componentDef.viewQuery
  ].join("|");
  for (const char of hashSelectors) {
    hash2 = Math.imul(31, hash2) + char.charCodeAt(0) << 0;
  }
  hash2 += 2147483647 + 1;
  const compId = "c" + hash2;
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    if (GENERATED_COMP_IDS.has(compId)) {
      const previousCompDefType = GENERATED_COMP_IDS.get(compId);
      if (previousCompDefType !== componentDef.type) {
        console.warn(formatRuntimeError(-912, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`));
      }
    } else {
      GENERATED_COMP_IDS.set(compId, componentDef.type);
    }
  }
  return compId;
}
function makeEnvironmentProviders(providers) {
  return {
    \u0275providers: providers
  };
}
function importProvidersFrom(...sources) {
  return {
    \u0275providers: internalImportProvidersFrom(true, sources),
    \u0275fromNgModule: true
  };
}
function internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {
  const providersOut = [];
  const dedup = /* @__PURE__ */ new Set();
  let injectorTypesWithProviders;
  const collectProviders = (provider) => {
    providersOut.push(provider);
  };
  deepForEach(sources, (source) => {
    if ((typeof ngDevMode === "undefined" || ngDevMode) && checkForStandaloneCmp) {
      const cmpDef = getComponentDef(source);
      if (cmpDef?.standalone) {
        throw new RuntimeError(800, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component "${stringifyForError(source)}"`);
      }
    }
    const internalSource = source;
    if (walkProviderTree(internalSource, collectProviders, [], dedup)) {
      injectorTypesWithProviders ||= [];
      injectorTypesWithProviders.push(internalSource);
    }
  });
  if (injectorTypesWithProviders !== void 0) {
    processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);
  }
  return providersOut;
}
function processInjectorTypesWithProviders(typesWithProviders, visitor) {
  for (let i2 = 0; i2 < typesWithProviders.length; i2++) {
    const { ngModule, providers } = typesWithProviders[i2];
    deepForEachProvider(providers, (provider) => {
      ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);
      visitor(provider, ngModule);
    });
  }
}
function walkProviderTree(container, visitor, parents, dedup) {
  container = resolveForwardRef(container);
  if (!container)
    return false;
  let defType = null;
  let injDef = getInjectorDef(container);
  const cmpDef = !injDef && getComponentDef(container);
  if (!injDef && !cmpDef) {
    const ngModule = container.ngModule;
    injDef = getInjectorDef(ngModule);
    if (injDef) {
      defType = ngModule;
    } else {
      return false;
    }
  } else if (cmpDef && !cmpDef.standalone) {
    return false;
  } else {
    defType = container;
  }
  if (ngDevMode && parents.indexOf(defType) !== -1) {
    const defName = stringify(defType);
    const path = parents.map(stringify);
    throwCyclicDependencyError(defName, path);
  }
  const isDuplicate = dedup.has(defType);
  if (cmpDef) {
    if (isDuplicate) {
      return false;
    }
    dedup.add(defType);
    if (cmpDef.dependencies) {
      const deps = typeof cmpDef.dependencies === "function" ? cmpDef.dependencies() : cmpDef.dependencies;
      for (const dep of deps) {
        walkProviderTree(dep, visitor, parents, dedup);
      }
    }
  } else if (injDef) {
    if (injDef.imports != null && !isDuplicate) {
      ngDevMode && parents.push(defType);
      dedup.add(defType);
      let importTypesWithProviders;
      try {
        deepForEach(injDef.imports, (imported) => {
          if (walkProviderTree(imported, visitor, parents, dedup)) {
            importTypesWithProviders ||= [];
            importTypesWithProviders.push(imported);
          }
        });
      } finally {
        ngDevMode && parents.pop();
      }
      if (importTypesWithProviders !== void 0) {
        processInjectorTypesWithProviders(importTypesWithProviders, visitor);
      }
    }
    if (!isDuplicate) {
      const factory2 = getFactoryDef(defType) || (() => new defType());
      visitor({ provide: defType, useFactory: factory2, deps: EMPTY_ARRAY }, defType);
      visitor({ provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true }, defType);
      visitor({ provide: ENVIRONMENT_INITIALIZER, useValue: () => \u0275\u0275inject(defType), multi: true }, defType);
    }
    const defProviders = injDef.providers;
    if (defProviders != null && !isDuplicate) {
      const injectorType = container;
      deepForEachProvider(defProviders, (provider) => {
        ngDevMode && validateProvider(provider, defProviders, injectorType);
        visitor(provider, injectorType);
      });
    }
  } else {
    return false;
  }
  return defType !== container && container.providers !== void 0;
}
function validateProvider(provider, providers, containerType) {
  if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) || isExistingProvider(provider)) {
    return;
  }
  const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
  if (!classRef) {
    throwInvalidProviderError(containerType, providers, provider);
  }
}
function deepForEachProvider(providers, fn) {
  for (let provider of providers) {
    if (isEnvironmentProviders(provider)) {
      provider = provider.\u0275providers;
    }
    if (Array.isArray(provider)) {
      deepForEachProvider(provider, fn);
    } else {
      fn(provider);
    }
  }
}
var USE_VALUE$1 = getClosureSafeProperty({
  provide: String,
  useValue: getClosureSafeProperty
});
function isValueProvider(value) {
  return value !== null && typeof value == "object" && USE_VALUE$1 in value;
}
function isExistingProvider(value) {
  return !!(value && value.useExisting);
}
function isFactoryProvider(value) {
  return !!(value && value.useFactory);
}
function isTypeProvider(value) {
  return typeof value === "function";
}
function isClassProvider(value) {
  return !!value.useClass;
}
var INJECTOR_SCOPE = new InjectionToken(ngDevMode ? "Set Injector scope." : "");
var NOT_YET = {};
var CIRCULAR = {};
var NULL_INJECTOR = void 0;
function getNullInjector() {
  if (NULL_INJECTOR === void 0) {
    NULL_INJECTOR = new NullInjector();
  }
  return NULL_INJECTOR;
}
var EnvironmentInjector = class {
};
var R3Injector = class extends EnvironmentInjector {
  /**
   * Flag indicating that this injector was previously destroyed.
   */
  get destroyed() {
    return this._destroyed;
  }
  constructor(providers, parent, source, scopes) {
    super();
    this.parent = parent;
    this.source = source;
    this.scopes = scopes;
    this.records = /* @__PURE__ */ new Map();
    this._ngOnDestroyHooks = /* @__PURE__ */ new Set();
    this._onDestroyHooks = [];
    this._destroyed = false;
    forEachSingleProvider(providers, (provider) => this.processProvider(provider));
    this.records.set(INJECTOR$1, makeRecord(void 0, this));
    if (scopes.has("environment")) {
      this.records.set(EnvironmentInjector, makeRecord(void 0, this));
    }
    const record = this.records.get(INJECTOR_SCOPE);
    if (record != null && typeof record.value === "string") {
      this.scopes.add(record.value);
    }
    this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, InjectFlags.Self));
  }
  /**
   * Destroy the injector and release references to every instance or provider associated with it.
   *
   * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a
   * hook was found.
   */
  destroy() {
    this.assertNotDestroyed();
    this._destroyed = true;
    const prevConsumer = setActiveConsumer(null);
    try {
      for (const service of this._ngOnDestroyHooks) {
        service.ngOnDestroy();
      }
      const onDestroyHooks = this._onDestroyHooks;
      this._onDestroyHooks = [];
      for (const hook of onDestroyHooks) {
        hook();
      }
    } finally {
      this.records.clear();
      this._ngOnDestroyHooks.clear();
      this.injectorDefTypes.clear();
      setActiveConsumer(prevConsumer);
    }
  }
  onDestroy(callback) {
    this.assertNotDestroyed();
    this._onDestroyHooks.push(callback);
    return () => this.removeOnDestroy(callback);
  }
  runInContext(fn) {
    this.assertNotDestroyed();
    const previousInjector = setCurrentInjector(this);
    const previousInjectImplementation = setInjectImplementation(void 0);
    let prevInjectContext;
    if (ngDevMode) {
      prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });
    }
    try {
      return fn();
    } finally {
      setCurrentInjector(previousInjector);
      setInjectImplementation(previousInjectImplementation);
      ngDevMode && setInjectorProfilerContext(prevInjectContext);
    }
  }
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
    this.assertNotDestroyed();
    if (token.hasOwnProperty(NG_ENV_ID)) {
      return token[NG_ENV_ID](this);
    }
    flags = convertToBitFlags(flags);
    let prevInjectContext;
    if (ngDevMode) {
      prevInjectContext = setInjectorProfilerContext({ injector: this, token });
    }
    const previousInjector = setCurrentInjector(this);
    const previousInjectImplementation = setInjectImplementation(void 0);
    try {
      if (!(flags & InjectFlags.SkipSelf)) {
        let record = this.records.get(token);
        if (record === void 0) {
          const def = couldBeInjectableType(token) && getInjectableDef(token);
          if (def && this.injectableDefInScope(def)) {
            if (ngDevMode) {
              runInInjectorProfilerContext(this, token, () => {
                emitProviderConfiguredEvent(token);
              });
            }
            record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);
          } else {
            record = null;
          }
          this.records.set(token, record);
        }
        if (record != null) {
          return this.hydrate(token, record);
        }
      }
      const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();
      notFoundValue = flags & InjectFlags.Optional && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;
      return nextInjector.get(token, notFoundValue);
    } catch (e) {
      if (e.name === "NullInjectorError") {
        const path = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];
        path.unshift(stringify(token));
        if (previousInjector) {
          throw e;
        } else {
          return catchInjectorError(e, token, "R3InjectorError", this.source);
        }
      } else {
        throw e;
      }
    } finally {
      setInjectImplementation(previousInjectImplementation);
      setCurrentInjector(previousInjector);
      ngDevMode && setInjectorProfilerContext(prevInjectContext);
    }
  }
  /** @internal */
  resolveInjectorInitializers() {
    const prevConsumer = setActiveConsumer(null);
    const previousInjector = setCurrentInjector(this);
    const previousInjectImplementation = setInjectImplementation(void 0);
    let prevInjectContext;
    if (ngDevMode) {
      prevInjectContext = setInjectorProfilerContext({ injector: this, token: null });
    }
    try {
      const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, InjectFlags.Self);
      if (ngDevMode && !Array.isArray(initializers)) {
        throw new RuntimeError(-209, `Unexpected type of the \`ENVIRONMENT_INITIALIZER\` token value (expected an array, but got ${typeof initializers}). Please check that the \`ENVIRONMENT_INITIALIZER\` token is configured as a \`multi: true\` provider.`);
      }
      for (const initializer of initializers) {
        initializer();
      }
    } finally {
      setCurrentInjector(previousInjector);
      setInjectImplementation(previousInjectImplementation);
      ngDevMode && setInjectorProfilerContext(prevInjectContext);
      setActiveConsumer(prevConsumer);
    }
  }
  toString() {
    const tokens = [];
    const records = this.records;
    for (const token of records.keys()) {
      tokens.push(stringify(token));
    }
    return `R3Injector[${tokens.join(", ")}]`;
  }
  assertNotDestroyed() {
    if (this._destroyed) {
      throw new RuntimeError(205, ngDevMode && "Injector has already been destroyed.");
    }
  }
  /**
   * Process a `SingleProvider` and add it.
   */
  processProvider(provider) {
    provider = resolveForwardRef(provider);
    let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);
    const record = providerToRecord(provider);
    if (ngDevMode) {
      runInInjectorProfilerContext(this, token, () => {
        if (isValueProvider(provider)) {
          emitInstanceCreatedByInjectorEvent(provider.useValue);
        }
        emitProviderConfiguredEvent(provider);
      });
    }
    if (!isTypeProvider(provider) && provider.multi === true) {
      let multiRecord = this.records.get(token);
      if (multiRecord) {
        if (ngDevMode && multiRecord.multi === void 0) {
          throwMixedMultiProviderError();
        }
      } else {
        multiRecord = makeRecord(void 0, NOT_YET, true);
        multiRecord.factory = () => injectArgs(multiRecord.multi);
        this.records.set(token, multiRecord);
      }
      token = provider;
      multiRecord.multi.push(provider);
    } else {
      if (ngDevMode) {
        const existing = this.records.get(token);
        if (existing && existing.multi !== void 0) {
          throwMixedMultiProviderError();
        }
      }
    }
    this.records.set(token, record);
  }
  hydrate(token, record) {
    const prevConsumer = setActiveConsumer(null);
    try {
      if (ngDevMode && record.value === CIRCULAR) {
        throwCyclicDependencyError(stringify(token));
      } else if (record.value === NOT_YET) {
        record.value = CIRCULAR;
        if (ngDevMode) {
          runInInjectorProfilerContext(this, token, () => {
            record.value = record.factory();
            emitInstanceCreatedByInjectorEvent(record.value);
          });
        } else {
          record.value = record.factory();
        }
      }
      if (typeof record.value === "object" && record.value && hasOnDestroy(record.value)) {
        this._ngOnDestroyHooks.add(record.value);
      }
      return record.value;
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
  injectableDefInScope(def) {
    if (!def.providedIn) {
      return false;
    }
    const providedIn = resolveForwardRef(def.providedIn);
    if (typeof providedIn === "string") {
      return providedIn === "any" || this.scopes.has(providedIn);
    } else {
      return this.injectorDefTypes.has(providedIn);
    }
  }
  removeOnDestroy(callback) {
    const destroyCBIdx = this._onDestroyHooks.indexOf(callback);
    if (destroyCBIdx !== -1) {
      this._onDestroyHooks.splice(destroyCBIdx, 1);
    }
  }
};
function injectableDefOrInjectorDefFactory(token) {
  const injectableDef = getInjectableDef(token);
  const factory2 = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);
  if (factory2 !== null) {
    return factory2;
  }
  if (token instanceof InjectionToken) {
    throw new RuntimeError(204, ngDevMode && `Token ${stringify(token)} is missing a \u0275prov definition.`);
  }
  if (token instanceof Function) {
    return getUndecoratedInjectableFactory(token);
  }
  throw new RuntimeError(204, ngDevMode && "unreachable");
}
function getUndecoratedInjectableFactory(token) {
  const paramLength = token.length;
  if (paramLength > 0) {
    throw new RuntimeError(204, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, "?").join(", ")}).`);
  }
  const inheritedInjectableDef = getInheritedInjectableDef(token);
  if (inheritedInjectableDef !== null) {
    return () => inheritedInjectableDef.factory(token);
  } else {
    return () => new token();
  }
}
function providerToRecord(provider) {
  if (isValueProvider(provider)) {
    return makeRecord(void 0, provider.useValue);
  } else {
    const factory2 = providerToFactory(provider);
    return makeRecord(factory2, NOT_YET);
  }
}
function providerToFactory(provider, ngModuleType, providers) {
  let factory2 = void 0;
  if (ngDevMode && isEnvironmentProviders(provider)) {
    throwInvalidProviderError(void 0, providers, provider);
  }
  if (isTypeProvider(provider)) {
    const unwrappedProvider = resolveForwardRef(provider);
    return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);
  } else {
    if (isValueProvider(provider)) {
      factory2 = () => resolveForwardRef(provider.useValue);
    } else if (isFactoryProvider(provider)) {
      factory2 = () => provider.useFactory(...injectArgs(provider.deps || []));
    } else if (isExistingProvider(provider)) {
      factory2 = () => \u0275\u0275inject(resolveForwardRef(provider.useExisting));
    } else {
      const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
      if (ngDevMode && !classRef) {
        throwInvalidProviderError(ngModuleType, providers, provider);
      }
      if (hasDeps(provider)) {
        factory2 = () => new classRef(...injectArgs(provider.deps));
      } else {
        return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);
      }
    }
  }
  return factory2;
}
function makeRecord(factory2, value, multi = false) {
  return {
    factory: factory2,
    value,
    multi: multi ? [] : void 0
  };
}
function hasDeps(value) {
  return !!value.deps;
}
function hasOnDestroy(value) {
  return value !== null && typeof value === "object" && typeof value.ngOnDestroy === "function";
}
function couldBeInjectableType(value) {
  return typeof value === "function" || typeof value === "object" && value instanceof InjectionToken;
}
function forEachSingleProvider(providers, fn) {
  for (const provider of providers) {
    if (Array.isArray(provider)) {
      forEachSingleProvider(provider, fn);
    } else if (provider && isEnvironmentProviders(provider)) {
      forEachSingleProvider(provider.\u0275providers, fn);
    } else {
      fn(provider);
    }
  }
}
function runInInjectionContext(injector, fn) {
  if (injector instanceof R3Injector) {
    injector.assertNotDestroyed();
  }
  let prevInjectorProfilerContext;
  if (ngDevMode) {
    prevInjectorProfilerContext = setInjectorProfilerContext({ injector, token: null });
  }
  const prevInjector = setCurrentInjector(injector);
  const previousInjectImplementation = setInjectImplementation(void 0);
  try {
    return fn();
  } finally {
    setCurrentInjector(prevInjector);
    ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);
    setInjectImplementation(previousInjectImplementation);
  }
}
function isInInjectionContext() {
  return getInjectImplementation() !== void 0 || getCurrentInjector() != null;
}
function assertInInjectionContext(debugFn) {
  if (!isInInjectionContext()) {
    throw new RuntimeError(-203, ngDevMode && debugFn.name + "() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`");
  }
}
var FactoryTarget;
(function(FactoryTarget2) {
  FactoryTarget2[FactoryTarget2["Directive"] = 0] = "Directive";
  FactoryTarget2[FactoryTarget2["Component"] = 1] = "Component";
  FactoryTarget2[FactoryTarget2["Injectable"] = 2] = "Injectable";
  FactoryTarget2[FactoryTarget2["Pipe"] = 3] = "Pipe";
  FactoryTarget2[FactoryTarget2["NgModule"] = 4] = "NgModule";
})(FactoryTarget || (FactoryTarget = {}));
var R3TemplateDependencyKind;
(function(R3TemplateDependencyKind2) {
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Pipe"] = 1] = "Pipe";
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
var ViewEncapsulation;
(function(ViewEncapsulation2) {
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
  ViewEncapsulation2[ViewEncapsulation2["None"] = 2] = "None";
  ViewEncapsulation2[ViewEncapsulation2["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation || (ViewEncapsulation = {}));
function getCompilerFacade(request) {
  const globalNg = _global["ng"];
  if (globalNg && globalNg.\u0275compilerFacade) {
    return globalNg.\u0275compilerFacade;
  }
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    console.error(`JIT compilation failed for ${request.kind}`, request.type);
    let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

`;
    if (request.usage === 1) {
      message += `The ${request.kind} is part of a library that has been partially compiled.
`;
      message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.
`;
      message += "\n";
      message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
`;
    } else {
      message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.
`;
    }
    message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
`;
    message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
    throw new Error(message);
  } else {
    throw new Error("JIT compiler unavailable");
  }
}
var angularCoreDiEnv = {
  "\u0275\u0275defineInjectable": \u0275\u0275defineInjectable,
  "\u0275\u0275defineInjector": \u0275\u0275defineInjector,
  "\u0275\u0275inject": \u0275\u0275inject,
  "\u0275\u0275invalidFactoryDep": \u0275\u0275invalidFactoryDep,
  "resolveForwardRef": resolveForwardRef
};
var Type = Function;
function isType(v) {
  return typeof v === "function";
}
var ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/;
var ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/;
var ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/;
var ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;
function isDelegateCtor(typeStr) {
  return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);
}
var ReflectionCapabilities = class {
  constructor(reflect) {
    this._reflect = reflect || _global["Reflect"];
  }
  factory(t) {
    return (...args) => new t(...args);
  }
  /** @internal */
  _zipTypesAndAnnotations(paramTypes, paramAnnotations) {
    let result;
    if (typeof paramTypes === "undefined") {
      result = newArray(paramAnnotations.length);
    } else {
      result = newArray(paramTypes.length);
    }
    for (let i2 = 0; i2 < result.length; i2++) {
      if (typeof paramTypes === "undefined") {
        result[i2] = [];
      } else if (paramTypes[i2] && paramTypes[i2] != Object) {
        result[i2] = [paramTypes[i2]];
      } else {
        result[i2] = [];
      }
      if (paramAnnotations && paramAnnotations[i2] != null) {
        result[i2] = result[i2].concat(paramAnnotations[i2]);
      }
    }
    return result;
  }
  _ownParameters(type, parentCtor) {
    const typeStr = type.toString();
    if (isDelegateCtor(typeStr)) {
      return null;
    }
    if (type.parameters && type.parameters !== parentCtor.parameters) {
      return type.parameters;
    }
    const tsickleCtorParams = type.ctorParameters;
    if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {
      const ctorParameters = typeof tsickleCtorParams === "function" ? tsickleCtorParams() : tsickleCtorParams;
      const paramTypes2 = ctorParameters.map((ctorParam) => ctorParam && ctorParam.type);
      const paramAnnotations2 = ctorParameters.map((ctorParam) => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
      return this._zipTypesAndAnnotations(paramTypes2, paramAnnotations2);
    }
    const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS];
    const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata("design:paramtypes", type);
    if (paramTypes || paramAnnotations) {
      return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
    }
    return newArray(type.length);
  }
  parameters(type) {
    if (!isType(type)) {
      return [];
    }
    const parentCtor = getParentCtor(type);
    let parameters = this._ownParameters(type, parentCtor);
    if (!parameters && parentCtor !== Object) {
      parameters = this.parameters(parentCtor);
    }
    return parameters || [];
  }
  _ownAnnotations(typeOrFunc, parentCtor) {
    if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {
      let annotations = typeOrFunc.annotations;
      if (typeof annotations === "function" && annotations.annotations) {
        annotations = annotations.annotations;
      }
      return annotations;
    }
    if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {
      return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);
    }
    if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {
      return typeOrFunc[ANNOTATIONS];
    }
    return null;
  }
  annotations(typeOrFunc) {
    if (!isType(typeOrFunc)) {
      return [];
    }
    const parentCtor = getParentCtor(typeOrFunc);
    const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];
    const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];
    return parentAnnotations.concat(ownAnnotations);
  }
  _ownPropMetadata(typeOrFunc, parentCtor) {
    if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {
      let propMetadata = typeOrFunc.propMetadata;
      if (typeof propMetadata === "function" && propMetadata.propMetadata) {
        propMetadata = propMetadata.propMetadata;
      }
      return propMetadata;
    }
    if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {
      const propDecorators = typeOrFunc.propDecorators;
      const propMetadata = {};
      Object.keys(propDecorators).forEach((prop) => {
        propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
      });
      return propMetadata;
    }
    if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {
      return typeOrFunc[PROP_METADATA];
    }
    return null;
  }
  propMetadata(typeOrFunc) {
    if (!isType(typeOrFunc)) {
      return {};
    }
    const parentCtor = getParentCtor(typeOrFunc);
    const propMetadata = {};
    if (parentCtor !== Object) {
      const parentPropMetadata = this.propMetadata(parentCtor);
      Object.keys(parentPropMetadata).forEach((propName) => {
        propMetadata[propName] = parentPropMetadata[propName];
      });
    }
    const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);
    if (ownPropMetadata) {
      Object.keys(ownPropMetadata).forEach((propName) => {
        const decorators = [];
        if (propMetadata.hasOwnProperty(propName)) {
          decorators.push(...propMetadata[propName]);
        }
        decorators.push(...ownPropMetadata[propName]);
        propMetadata[propName] = decorators;
      });
    }
    return propMetadata;
  }
  ownPropMetadata(typeOrFunc) {
    if (!isType(typeOrFunc)) {
      return {};
    }
    return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
  }
  hasLifecycleHook(type, lcProperty) {
    return type instanceof Type && lcProperty in type.prototype;
  }
};
function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
  if (!decoratorInvocations) {
    return [];
  }
  return decoratorInvocations.map((decoratorInvocation) => {
    const decoratorType = decoratorInvocation.type;
    const annotationCls = decoratorType.annotationCls;
    const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
    return new annotationCls(...annotationArgs);
  });
}
function getParentCtor(ctor) {
  const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
  const parentCtor = parentProto ? parentProto.constructor : null;
  return parentCtor || Object;
}
var HOST = 0;
var TVIEW = 1;
var FLAGS = 2;
var PARENT = 3;
var NEXT = 4;
var T_HOST = 5;
var HYDRATION = 6;
var CLEANUP = 7;
var CONTEXT = 8;
var INJECTOR = 9;
var ENVIRONMENT = 10;
var RENDERER = 11;
var CHILD_HEAD = 12;
var CHILD_TAIL = 13;
var DECLARATION_VIEW = 14;
var DECLARATION_COMPONENT_VIEW = 15;
var DECLARATION_LCONTAINER = 16;
var PREORDER_HOOK_FLAGS = 17;
var QUERIES = 18;
var ID = 19;
var EMBEDDED_VIEW_INJECTOR = 20;
var ON_DESTROY_HOOKS = 21;
var EFFECTS_TO_SCHEDULE = 22;
var REACTIVE_TEMPLATE_CONSUMER = 23;
var HEADER_OFFSET = 25;
var TYPE = 1;
var NATIVE = 7;
var VIEW_REFS = 8;
var MOVED_VIEWS = 9;
var CONTAINER_HEADER_OFFSET = 10;
var LContainerFlags;
(function(LContainerFlags2) {
  LContainerFlags2[LContainerFlags2["None"] = 0] = "None";
  LContainerFlags2[LContainerFlags2["HasTransplantedViews"] = 2] = "HasTransplantedViews";
})(LContainerFlags || (LContainerFlags = {}));
function isLView(value) {
  return Array.isArray(value) && typeof value[TYPE] === "object";
}
function isLContainer(value) {
  return Array.isArray(value) && value[TYPE] === true;
}
function isContentQueryHost(tNode) {
  return (tNode.flags & 4) !== 0;
}
function isComponentHost(tNode) {
  return tNode.componentOffset > -1;
}
function isDirectiveHost(tNode) {
  return (tNode.flags & 1) === 1;
}
function isComponentDef(def) {
  return !!def.template;
}
function isRootView(target) {
  return (target[FLAGS] & 512) !== 0;
}
function isDestroyed(lView) {
  return (lView[FLAGS] & 256) === 256;
}
function assertTNodeForLView(tNode, lView) {
  assertTNodeForTView(tNode, lView[TVIEW]);
}
function assertTNodeForTView(tNode, tView) {
  assertTNode(tNode);
  const tData = tView.data;
  for (let i2 = HEADER_OFFSET; i2 < tData.length; i2++) {
    if (tData[i2] === tNode) {
      return;
    }
  }
  throwError2("This TNode does not belong to this TView.");
}
function assertTNode(tNode) {
  assertDefined(tNode, "TNode must be defined");
  if (!(tNode && typeof tNode === "object" && tNode.hasOwnProperty("directiveStylingLast"))) {
    throwError2("Not of type TNode, got: " + tNode);
  }
}
function assertTIcu(tIcu) {
  assertDefined(tIcu, "Expected TIcu to be defined");
  if (!(typeof tIcu.currentCaseLViewIndex === "number")) {
    throwError2("Object is not of TIcu type.");
  }
}
function assertComponentType(actual, msg = "Type passed in is not ComponentType, it does not have '\u0275cmp' property.") {
  if (!getComponentDef(actual)) {
    throwError2(msg);
  }
}
function assertNgModuleType(actual, msg = "Type passed in is not NgModuleType, it does not have '\u0275mod' property.") {
  if (!getNgModuleDef(actual)) {
    throwError2(msg);
  }
}
function assertHasParent(tNode) {
  assertDefined(tNode, "currentTNode should exist!");
  assertDefined(tNode.parent, "currentTNode should have a parent");
}
function assertLContainer(value) {
  assertDefined(value, "LContainer must be defined");
  assertEqual(isLContainer(value), true, "Expecting LContainer");
}
function assertLViewOrUndefined(value) {
  value && assertEqual(isLView(value), true, "Expecting LView or undefined or null");
}
function assertLView(value) {
  assertDefined(value, "LView must be defined");
  assertEqual(isLView(value), true, "Expecting LView");
}
function assertFirstCreatePass(tView, errMessage) {
  assertEqual(tView.firstCreatePass, true, errMessage || "Should only be called in first create pass.");
}
function assertFirstUpdatePass(tView, errMessage) {
  assertEqual(tView.firstUpdatePass, true, errMessage || "Should only be called in first update pass.");
}
function assertDirectiveDef(obj) {
  if (obj.type === void 0 || obj.selectors == void 0 || obj.inputs === void 0) {
    throwError2(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);
  }
}
function assertIndexInDeclRange(tView, index) {
  assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
}
function assertIndexInExpandoRange(lView, index) {
  const tView = lView[1];
  assertBetween(tView.expandoStartIndex, lView.length, index);
}
function assertBetween(lower, upper, index) {
  if (!(lower <= index && index < upper)) {
    throwError2(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);
  }
}
function assertProjectionSlots(lView, errMessage) {
  assertDefined(lView[DECLARATION_COMPONENT_VIEW], "Component views should exist.");
  assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, errMessage || "Components with projection nodes (<ng-content>) must have projection slots defined.");
}
function assertParentView(lView, errMessage) {
  assertDefined(lView, errMessage || "Component views should always have a parent view (component's host view)");
}
function assertNoDuplicateDirectives(directives) {
  if (directives.length < 2) {
    return;
  }
  const seenDirectives = /* @__PURE__ */ new Set();
  for (const current of directives) {
    if (seenDirectives.has(current)) {
      throw new RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. Directives can only match an element once.`);
    }
    seenDirectives.add(current);
  }
}
function assertNodeInjector(lView, injectorIndex) {
  assertIndexInExpandoRange(lView, injectorIndex);
  assertIndexInExpandoRange(
    lView,
    injectorIndex + 8
    /* NodeInjectorOffset.PARENT */
  );
  assertNumber(lView[injectorIndex + 0], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 1], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 2], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 3], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 4], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 5], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 6], "injectorIndex should point to a bloom filter");
  assertNumber(lView[injectorIndex + 7], "injectorIndex should point to a bloom filter");
  assertNumber(lView[
    injectorIndex + 8
    /* NodeInjectorOffset.PARENT */
  ], "injectorIndex should point to parent injector");
}
var SimpleChange = class {
  constructor(previousValue, currentValue, firstChange) {
    this.previousValue = previousValue;
    this.currentValue = currentValue;
    this.firstChange = firstChange;
  }
  /**
   * Check whether the new value is the first value assigned.
   */
  isFirstChange() {
    return this.firstChange;
  }
};
function applyValueToInputField(instance, inputSignalNode, privateName, value) {
  if (inputSignalNode !== null) {
    inputSignalNode.applyValueToInputSignal(inputSignalNode, value);
  } else {
    instance[privateName] = value;
  }
}
function \u0275\u0275NgOnChangesFeature() {
  return NgOnChangesFeatureImpl;
}
function NgOnChangesFeatureImpl(definition) {
  if (definition.type.prototype.ngOnChanges) {
    definition.setInput = ngOnChangesSetInput;
  }
  return rememberChangeHistoryAndInvokeOnChangesHook;
}
\u0275\u0275NgOnChangesFeature.ngInherit = true;
function rememberChangeHistoryAndInvokeOnChangesHook() {
  const simpleChangesStore = getSimpleChangesStore(this);
  const current = simpleChangesStore?.current;
  if (current) {
    const previous = simpleChangesStore.previous;
    if (previous === EMPTY_OBJ) {
      simpleChangesStore.previous = current;
    } else {
      for (let key in current) {
        previous[key] = current[key];
      }
    }
    simpleChangesStore.current = null;
    this.ngOnChanges(current);
  }
}
function ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {
  const declaredName = this.declaredInputs[publicName];
  ngDevMode && assertString(declaredName, "Name of input in ngOnChanges has to be a string");
  const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, { previous: EMPTY_OBJ, current: null });
  const current = simpleChangesStore.current || (simpleChangesStore.current = {});
  const previous = simpleChangesStore.previous;
  const previousChange = previous[declaredName];
  current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);
  applyValueToInputField(instance, inputSignalNode, privateName, value);
}
var SIMPLE_CHANGES_STORE = "__ngSimpleChanges__";
function getSimpleChangesStore(instance) {
  return instance[SIMPLE_CHANGES_STORE] || null;
}
function setSimpleChangesStore(instance, store2) {
  return instance[SIMPLE_CHANGES_STORE] = store2;
}
var profilerCallback = null;
var setProfiler = (profiler2) => {
  profilerCallback = profiler2;
};
var profiler = function(event, instance, hookOrListener) {
  if (profilerCallback != null) {
    profilerCallback(event, instance, hookOrListener);
  }
};
var SVG_NAMESPACE = "svg";
var MATH_ML_NAMESPACE = "math";
function unwrapRNode(value) {
  while (Array.isArray(value)) {
    value = value[HOST];
  }
  return value;
}
function unwrapLView(value) {
  while (Array.isArray(value)) {
    if (typeof value[TYPE] === "object")
      return value;
    value = value[HOST];
  }
  return null;
}
function getNativeByIndex(index, lView) {
  ngDevMode && assertIndexInRange(lView, index);
  ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, "Expected to be past HEADER_OFFSET");
  return unwrapRNode(lView[index]);
}
function getNativeByTNode(tNode, lView) {
  ngDevMode && assertTNodeForLView(tNode, lView);
  ngDevMode && assertIndexInRange(lView, tNode.index);
  const node = unwrapRNode(lView[tNode.index]);
  return node;
}
function getTNode(tView, index) {
  ngDevMode && assertGreaterThan(index, -1, "wrong index for TNode");
  ngDevMode && assertLessThan(index, tView.data.length, "wrong index for TNode");
  const tNode = tView.data[index];
  ngDevMode && tNode !== null && assertTNode(tNode);
  return tNode;
}
function load(view, index) {
  ngDevMode && assertIndexInRange(view, index);
  return view[index];
}
function getComponentLViewByIndex(nodeIndex, hostView) {
  ngDevMode && assertIndexInRange(hostView, nodeIndex);
  const slotValue = hostView[nodeIndex];
  const lView = isLView(slotValue) ? slotValue : slotValue[HOST];
  return lView;
}
function isCreationMode(view) {
  return (view[FLAGS] & 4) === 4;
}
function viewAttachedToChangeDetector(view) {
  return (view[FLAGS] & 128) === 128;
}
function viewAttachedToContainer(view) {
  return isLContainer(view[PARENT]);
}
function getConstant(consts, index) {
  if (index === null || index === void 0)
    return null;
  ngDevMode && assertIndexInRange(consts, index);
  return consts[index];
}
function resetPreOrderHookFlags(lView) {
  lView[PREORDER_HOOK_FLAGS] = 0;
}
function markViewForRefresh(lView) {
  if (lView[FLAGS] & 1024) {
    return;
  }
  lView[FLAGS] |= 1024;
  if (viewAttachedToChangeDetector(lView)) {
    markAncestorsForTraversal(lView);
  }
}
function walkUpViews(nestingLevel, currentView) {
  while (nestingLevel > 0) {
    ngDevMode && assertDefined(currentView[DECLARATION_VIEW], "Declaration view should be defined if nesting level is greater than 0.");
    currentView = currentView[DECLARATION_VIEW];
    nestingLevel--;
  }
  return currentView;
}
function requiresRefreshOrTraversal(lView) {
  return !!(lView[FLAGS] & (1024 | 8192) || lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);
}
function updateAncestorTraversalFlagsOnAttach(lView) {
  lView[ENVIRONMENT].changeDetectionScheduler?.notify(
    7
    /* NotificationSource.ViewAttached */
  );
  if (lView[FLAGS] & 64) {
    lView[FLAGS] |= 1024;
  }
  if (requiresRefreshOrTraversal(lView)) {
    markAncestorsForTraversal(lView);
  }
}
function markAncestorsForTraversal(lView) {
  lView[ENVIRONMENT].changeDetectionScheduler?.notify(
    0
    /* NotificationSource.MarkAncestorsForTraversal */
  );
  let parent = getLViewParent(lView);
  while (parent !== null) {
    if (parent[FLAGS] & 8192) {
      break;
    }
    parent[FLAGS] |= 8192;
    if (!viewAttachedToChangeDetector(parent)) {
      break;
    }
    parent = getLViewParent(parent);
  }
}
function storeLViewOnDestroy(lView, onDestroyCallback) {
  if ((lView[FLAGS] & 256) === 256) {
    throw new RuntimeError(911, ngDevMode && "View has already been destroyed.");
  }
  if (lView[ON_DESTROY_HOOKS] === null) {
    lView[ON_DESTROY_HOOKS] = [];
  }
  lView[ON_DESTROY_HOOKS].push(onDestroyCallback);
}
function removeLViewOnDestroy(lView, onDestroyCallback) {
  if (lView[ON_DESTROY_HOOKS] === null)
    return;
  const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);
  if (destroyCBIdx !== -1) {
    lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);
  }
}
function getLViewParent(lView) {
  ngDevMode && assertLView(lView);
  const parent = lView[PARENT];
  return isLContainer(parent) ? parent[PARENT] : parent;
}
var instructionState = {
  lFrame: createLFrame(null),
  bindingsEnabled: true,
  skipHydrationRootTNode: null
};
var CheckNoChangesMode;
(function(CheckNoChangesMode2) {
  CheckNoChangesMode2[CheckNoChangesMode2["Off"] = 0] = "Off";
  CheckNoChangesMode2[CheckNoChangesMode2["Exhaustive"] = 1] = "Exhaustive";
  CheckNoChangesMode2[CheckNoChangesMode2["OnlyDirtyViews"] = 2] = "OnlyDirtyViews";
})(CheckNoChangesMode || (CheckNoChangesMode = {}));
var _checkNoChangesMode = 0;
var _isRefreshingViews = false;
function getElementDepthCount() {
  return instructionState.lFrame.elementDepthCount;
}
function increaseElementDepthCount() {
  instructionState.lFrame.elementDepthCount++;
}
function decreaseElementDepthCount() {
  instructionState.lFrame.elementDepthCount--;
}
function getBindingsEnabled() {
  return instructionState.bindingsEnabled;
}
function isInSkipHydrationBlock$1() {
  return instructionState.skipHydrationRootTNode !== null;
}
function isSkipHydrationRootTNode(tNode) {
  return instructionState.skipHydrationRootTNode === tNode;
}
function \u0275\u0275enableBindings() {
  instructionState.bindingsEnabled = true;
}
function \u0275\u0275disableBindings() {
  instructionState.bindingsEnabled = false;
}
function leaveSkipHydrationBlock() {
  instructionState.skipHydrationRootTNode = null;
}
function getLView() {
  return instructionState.lFrame.lView;
}
function getTView() {
  return instructionState.lFrame.tView;
}
function \u0275\u0275restoreView(viewToRestore) {
  instructionState.lFrame.contextLView = viewToRestore;
  return viewToRestore[CONTEXT];
}
function \u0275\u0275resetView(value) {
  instructionState.lFrame.contextLView = null;
  return value;
}
function getCurrentTNode() {
  let currentTNode = getCurrentTNodePlaceholderOk();
  while (currentTNode !== null && currentTNode.type === 64) {
    currentTNode = currentTNode.parent;
  }
  return currentTNode;
}
function getCurrentTNodePlaceholderOk() {
  return instructionState.lFrame.currentTNode;
}
function getCurrentParentTNode() {
  const lFrame = instructionState.lFrame;
  const currentTNode = lFrame.currentTNode;
  return lFrame.isParent ? currentTNode : currentTNode.parent;
}
function setCurrentTNode(tNode, isParent) {
  ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);
  const lFrame = instructionState.lFrame;
  lFrame.currentTNode = tNode;
  lFrame.isParent = isParent;
}
function isCurrentTNodeParent() {
  return instructionState.lFrame.isParent;
}
function setCurrentTNodeAsNotParent() {
  instructionState.lFrame.isParent = false;
}
function getContextLView() {
  const contextLView = instructionState.lFrame.contextLView;
  ngDevMode && assertDefined(contextLView, "contextLView must be defined.");
  return contextLView;
}
function isInCheckNoChangesMode() {
  !ngDevMode && throwError2("Must never be called in production mode");
  return _checkNoChangesMode !== CheckNoChangesMode.Off;
}
function isExhaustiveCheckNoChanges() {
  !ngDevMode && throwError2("Must never be called in production mode");
  return _checkNoChangesMode === CheckNoChangesMode.Exhaustive;
}
function setIsInCheckNoChangesMode(mode) {
  !ngDevMode && throwError2("Must never be called in production mode");
  _checkNoChangesMode = mode;
}
function isRefreshingViews() {
  return _isRefreshingViews;
}
function setIsRefreshingViews(mode) {
  _isRefreshingViews = mode;
}
function getBindingRoot() {
  const lFrame = instructionState.lFrame;
  let index = lFrame.bindingRootIndex;
  if (index === -1) {
    index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;
  }
  return index;
}
function getBindingIndex() {
  return instructionState.lFrame.bindingIndex;
}
function setBindingIndex(value) {
  return instructionState.lFrame.bindingIndex = value;
}
function nextBindingIndex() {
  return instructionState.lFrame.bindingIndex++;
}
function incrementBindingIndex(count) {
  const lFrame = instructionState.lFrame;
  const index = lFrame.bindingIndex;
  lFrame.bindingIndex = lFrame.bindingIndex + count;
  return index;
}
function isInI18nBlock() {
  return instructionState.lFrame.inI18n;
}
function setInI18nBlock(isInI18nBlock2) {
  instructionState.lFrame.inI18n = isInI18nBlock2;
}
function setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {
  const lFrame = instructionState.lFrame;
  lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;
  setCurrentDirectiveIndex(currentDirectiveIndex);
}
function getCurrentDirectiveIndex() {
  return instructionState.lFrame.currentDirectiveIndex;
}
function setCurrentDirectiveIndex(currentDirectiveIndex) {
  instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;
}
function getCurrentDirectiveDef(tData) {
  const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;
  return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];
}
function getCurrentQueryIndex() {
  return instructionState.lFrame.currentQueryIndex;
}
function setCurrentQueryIndex(value) {
  instructionState.lFrame.currentQueryIndex = value;
}
function getDeclarationTNode(lView) {
  const tView = lView[TVIEW];
  if (tView.type === 2) {
    ngDevMode && assertDefined(tView.declTNode, "Embedded TNodes should have declaration parents.");
    return tView.declTNode;
  }
  if (tView.type === 1) {
    return lView[T_HOST];
  }
  return null;
}
function enterDI(lView, tNode, flags) {
  ngDevMode && assertLViewOrUndefined(lView);
  if (flags & InjectFlags.SkipSelf) {
    ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);
    let parentTNode = tNode;
    let parentLView = lView;
    while (true) {
      ngDevMode && assertDefined(parentTNode, "Parent TNode should be defined");
      parentTNode = parentTNode.parent;
      if (parentTNode === null && !(flags & InjectFlags.Host)) {
        parentTNode = getDeclarationTNode(parentLView);
        if (parentTNode === null)
          break;
        ngDevMode && assertDefined(parentLView, "Parent LView should be defined");
        parentLView = parentLView[DECLARATION_VIEW];
        if (parentTNode.type & (2 | 8)) {
          break;
        }
      } else {
        break;
      }
    }
    if (parentTNode === null) {
      return false;
    } else {
      tNode = parentTNode;
      lView = parentLView;
    }
  }
  ngDevMode && assertTNodeForLView(tNode, lView);
  const lFrame = instructionState.lFrame = allocLFrame();
  lFrame.currentTNode = tNode;
  lFrame.lView = lView;
  return true;
}
function enterView(newView) {
  ngDevMode && assertNotEqual(newView[0], newView[1], "????");
  ngDevMode && assertLViewOrUndefined(newView);
  const newLFrame = allocLFrame();
  if (ngDevMode) {
    assertEqual(newLFrame.isParent, true, "Expected clean LFrame");
    assertEqual(newLFrame.lView, null, "Expected clean LFrame");
    assertEqual(newLFrame.tView, null, "Expected clean LFrame");
    assertEqual(newLFrame.selectedIndex, -1, "Expected clean LFrame");
    assertEqual(newLFrame.elementDepthCount, 0, "Expected clean LFrame");
    assertEqual(newLFrame.currentDirectiveIndex, -1, "Expected clean LFrame");
    assertEqual(newLFrame.currentNamespace, null, "Expected clean LFrame");
    assertEqual(newLFrame.bindingRootIndex, -1, "Expected clean LFrame");
    assertEqual(newLFrame.currentQueryIndex, 0, "Expected clean LFrame");
  }
  const tView = newView[TVIEW];
  instructionState.lFrame = newLFrame;
  ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);
  newLFrame.currentTNode = tView.firstChild;
  newLFrame.lView = newView;
  newLFrame.tView = tView;
  newLFrame.contextLView = newView;
  newLFrame.bindingIndex = tView.bindingStartIndex;
  newLFrame.inI18n = false;
}
function allocLFrame() {
  const currentLFrame = instructionState.lFrame;
  const childLFrame = currentLFrame === null ? null : currentLFrame.child;
  const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;
  return newLFrame;
}
function createLFrame(parent) {
  const lFrame = {
    currentTNode: null,
    isParent: true,
    lView: null,
    tView: null,
    selectedIndex: -1,
    contextLView: null,
    elementDepthCount: 0,
    currentNamespace: null,
    currentDirectiveIndex: -1,
    bindingRootIndex: -1,
    bindingIndex: -1,
    currentQueryIndex: 0,
    parent,
    child: null,
    inI18n: false
  };
  parent !== null && (parent.child = lFrame);
  return lFrame;
}
function leaveViewLight() {
  const oldLFrame = instructionState.lFrame;
  instructionState.lFrame = oldLFrame.parent;
  oldLFrame.currentTNode = null;
  oldLFrame.lView = null;
  return oldLFrame;
}
var leaveDI = leaveViewLight;
function leaveView() {
  const oldLFrame = leaveViewLight();
  oldLFrame.isParent = true;
  oldLFrame.tView = null;
  oldLFrame.selectedIndex = -1;
  oldLFrame.contextLView = null;
  oldLFrame.elementDepthCount = 0;
  oldLFrame.currentDirectiveIndex = -1;
  oldLFrame.currentNamespace = null;
  oldLFrame.bindingRootIndex = -1;
  oldLFrame.bindingIndex = -1;
  oldLFrame.currentQueryIndex = 0;
}
function nextContextImpl(level) {
  const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView);
  return contextLView[CONTEXT];
}
function getSelectedIndex() {
  return instructionState.lFrame.selectedIndex;
}
function setSelectedIndex(index) {
  ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, "Index must be past HEADER_OFFSET (or -1).");
  ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, "Can't set index passed end of LView");
  instructionState.lFrame.selectedIndex = index;
}
function getSelectedTNode() {
  const lFrame = instructionState.lFrame;
  return getTNode(lFrame.tView, lFrame.selectedIndex);
}
function \u0275\u0275namespaceSVG() {
  instructionState.lFrame.currentNamespace = SVG_NAMESPACE;
}
function \u0275\u0275namespaceMathML() {
  instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;
}
function \u0275\u0275namespaceHTML() {
  namespaceHTMLInternal();
}
function namespaceHTMLInternal() {
  instructionState.lFrame.currentNamespace = null;
}
function getNamespace$1() {
  return instructionState.lFrame.currentNamespace;
}
var _wasLastNodeCreated = true;
function wasLastNodeCreated() {
  return _wasLastNodeCreated;
}
function lastNodeWasCreated(flag) {
  _wasLastNodeCreated = flag;
}
function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
  ngDevMode && assertFirstCreatePass(tView);
  const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
  if (ngOnChanges) {
    const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
    (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);
    (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);
  }
  if (ngOnInit) {
    (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);
  }
  if (ngDoCheck) {
    (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);
    (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);
  }
}
function registerPostOrderHooks(tView, tNode) {
  ngDevMode && assertFirstCreatePass(tView);
  for (let i2 = tNode.directiveStart, end = tNode.directiveEnd; i2 < end; i2++) {
    const directiveDef = tView.data[i2];
    ngDevMode && assertDefined(directiveDef, "Expecting DirectiveDef");
    const lifecycleHooks = directiveDef.type.prototype;
    const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
    if (ngAfterContentInit) {
      (tView.contentHooks ??= []).push(-i2, ngAfterContentInit);
    }
    if (ngAfterContentChecked) {
      (tView.contentHooks ??= []).push(i2, ngAfterContentChecked);
      (tView.contentCheckHooks ??= []).push(i2, ngAfterContentChecked);
    }
    if (ngAfterViewInit) {
      (tView.viewHooks ??= []).push(-i2, ngAfterViewInit);
    }
    if (ngAfterViewChecked) {
      (tView.viewHooks ??= []).push(i2, ngAfterViewChecked);
      (tView.viewCheckHooks ??= []).push(i2, ngAfterViewChecked);
    }
    if (ngOnDestroy != null) {
      (tView.destroyHooks ??= []).push(i2, ngOnDestroy);
    }
  }
}
function executeCheckHooks(lView, hooks, nodeIndex) {
  callHooks(lView, hooks, 3, nodeIndex);
}
function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
  ngDevMode && assertNotEqual(initPhase, 3, "Init pre-order hooks should not be called more than once");
  if ((lView[FLAGS] & 3) === initPhase) {
    callHooks(lView, hooks, initPhase, nodeIndex);
  }
}
function incrementInitPhaseFlags(lView, initPhase) {
  ngDevMode && assertNotEqual(initPhase, 3, "Init hooks phase should not be incremented after all init hooks have been run.");
  let flags = lView[FLAGS];
  if ((flags & 3) === initPhase) {
    flags &= 16383;
    flags += 1;
    lView[FLAGS] = flags;
  }
}
function callHooks(currentView, arr, initPhase, currentNodeIndex) {
  ngDevMode && assertEqual(isInCheckNoChangesMode(), false, "Hooks should never be run when in check no changes mode.");
  const startIndex = currentNodeIndex !== void 0 ? currentView[PREORDER_HOOK_FLAGS] & 65535 : 0;
  const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;
  const max = arr.length - 1;
  let lastNodeIndexFound = 0;
  for (let i2 = startIndex; i2 < max; i2++) {
    const hook = arr[i2 + 1];
    if (typeof hook === "number") {
      lastNodeIndexFound = arr[i2];
      if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {
        break;
      }
    } else {
      const isInitHook = arr[i2] < 0;
      if (isInitHook) {
        currentView[PREORDER_HOOK_FLAGS] += 65536;
      }
      if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
        callHook(currentView, initPhase, arr, i2);
        currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760) + i2 + 2;
      }
      i2++;
    }
  }
}
function callHookInternal(directive, hook) {
  profiler(4, directive, hook);
  const prevConsumer = setActiveConsumer(null);
  try {
    hook.call(directive);
  } finally {
    setActiveConsumer(prevConsumer);
    profiler(5, directive, hook);
  }
}
function callHook(currentView, initPhase, arr, i2) {
  const isInitHook = arr[i2] < 0;
  const hook = arr[i2 + 1];
  const directiveIndex = isInitHook ? -arr[i2] : arr[i2];
  const directive = currentView[directiveIndex];
  if (isInitHook) {
    const indexWithintInitPhase = currentView[FLAGS] >> 14;
    if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 && (currentView[FLAGS] & 3) === initPhase) {
      currentView[FLAGS] += 16384;
      callHookInternal(directive, hook);
    }
  } else {
    callHookInternal(directive, hook);
  }
}
var NO_PARENT_INJECTOR = -1;
var NodeInjectorFactory = class {
  constructor(factory2, isViewProvider, injectImplementation) {
    this.factory = factory2;
    this.resolving = false;
    ngDevMode && assertDefined(factory2, "Factory not specified");
    ngDevMode && assertEqual(typeof factory2, "function", "Expected factory function.");
    this.canSeeViewProviders = isViewProvider;
    this.injectImpl = injectImplementation;
  }
};
function isFactory(obj) {
  return obj instanceof NodeInjectorFactory;
}
function toTNodeTypeAsString(tNodeType) {
  let text = "";
  tNodeType & 1 && (text += "|Text");
  tNodeType & 2 && (text += "|Element");
  tNodeType & 4 && (text += "|Container");
  tNodeType & 8 && (text += "|ElementContainer");
  tNodeType & 16 && (text += "|Projection");
  tNodeType & 32 && (text += "|IcuContainer");
  tNodeType & 64 && (text += "|Placeholder");
  return text.length > 0 ? text.substring(1) : text;
}
function hasClassInput(tNode) {
  return (tNode.flags & 8) !== 0;
}
function hasStyleInput(tNode) {
  return (tNode.flags & 16) !== 0;
}
function assertTNodeType(tNode, expectedTypes, message) {
  assertDefined(tNode, "should be called with a TNode");
  if ((tNode.type & expectedTypes) === 0) {
    throwError2(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);
  }
}
function assertPureTNodeType(type) {
  if (!(type === 2 || //
  type === 1 || //
  type === 4 || //
  type === 8 || //
  type === 32 || //
  type === 16 || //
  type === 64)) {
    throwError2(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);
  }
}
function hasParentInjector(parentLocation) {
  return parentLocation !== NO_PARENT_INJECTOR;
}
function getParentInjectorIndex(parentLocation) {
  if (ngDevMode) {
    assertNumber(parentLocation, "Number expected");
    assertNotEqual(parentLocation, -1, "Not a valid state.");
    const parentInjectorIndex = parentLocation & 32767;
    assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, "Parent injector must be pointing past HEADER_OFFSET.");
  }
  return parentLocation & 32767;
}
function getParentInjectorViewOffset(parentLocation) {
  return parentLocation >> 16;
}
function getParentInjectorView(location2, startView) {
  let viewOffset = getParentInjectorViewOffset(location2);
  let parentView = startView;
  while (viewOffset > 0) {
    parentView = parentView[DECLARATION_VIEW];
    viewOffset--;
  }
  return parentView;
}
var includeViewProviders = true;
function setIncludeViewProviders(v) {
  const oldValue = includeViewProviders;
  includeViewProviders = v;
  return oldValue;
}
var BLOOM_SIZE = 256;
var BLOOM_MASK = BLOOM_SIZE - 1;
var BLOOM_BUCKET_BITS = 5;
var nextNgElementId = 0;
var NOT_FOUND = {};
function bloomAdd(injectorIndex, tView, type) {
  ngDevMode && assertEqual(tView.firstCreatePass, true, "expected firstCreatePass to be true");
  let id2;
  if (typeof type === "string") {
    id2 = type.charCodeAt(0) || 0;
  } else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
    id2 = type[NG_ELEMENT_ID];
  }
  if (id2 == null) {
    id2 = type[NG_ELEMENT_ID] = nextNgElementId++;
  }
  const bloomHash = id2 & BLOOM_MASK;
  const mask = 1 << bloomHash;
  tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
}
function getOrCreateNodeInjectorForNode(tNode, lView) {
  const existingInjectorIndex = getInjectorIndex(tNode, lView);
  if (existingInjectorIndex !== -1) {
    return existingInjectorIndex;
  }
  const tView = lView[TVIEW];
  if (tView.firstCreatePass) {
    tNode.injectorIndex = lView.length;
    insertBloom(tView.data, tNode);
    insertBloom(lView, null);
    insertBloom(tView.blueprint, null);
  }
  const parentLoc = getParentInjectorLocation(tNode, lView);
  const injectorIndex = tNode.injectorIndex;
  if (hasParentInjector(parentLoc)) {
    const parentIndex = getParentInjectorIndex(parentLoc);
    const parentLView = getParentInjectorView(parentLoc, lView);
    const parentData = parentLView[TVIEW].data;
    for (let i2 = 0; i2 < 8; i2++) {
      lView[injectorIndex + i2] = parentLView[parentIndex + i2] | parentData[parentIndex + i2];
    }
  }
  lView[
    injectorIndex + 8
    /* NodeInjectorOffset.PARENT */
  ] = parentLoc;
  return injectorIndex;
}
function insertBloom(arr, footer) {
  arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);
}
function getInjectorIndex(tNode, lView) {
  if (tNode.injectorIndex === -1 || // If the injector index is the same as its parent's injector index, then the index has been
  // copied down from the parent node. No injector has been created yet on this node.
  tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || // After the first template pass, the injector index might exist but the parent values
  // might not have been calculated yet for this instance
  lView[
    tNode.injectorIndex + 8
    /* NodeInjectorOffset.PARENT */
  ] === null) {
    return -1;
  } else {
    ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);
    return tNode.injectorIndex;
  }
}
function getParentInjectorLocation(tNode, lView) {
  if (tNode.parent && tNode.parent.injectorIndex !== -1) {
    return tNode.parent.injectorIndex;
  }
  let declarationViewOffset = 0;
  let parentTNode = null;
  let lViewCursor = lView;
  while (lViewCursor !== null) {
    parentTNode = getTNodeFromLView(lViewCursor);
    if (parentTNode === null) {
      return NO_PARENT_INJECTOR;
    }
    ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);
    declarationViewOffset++;
    lViewCursor = lViewCursor[DECLARATION_VIEW];
    if (parentTNode.injectorIndex !== -1) {
      return parentTNode.injectorIndex | declarationViewOffset << 16;
    }
  }
  return NO_PARENT_INJECTOR;
}
function diPublicInInjector(injectorIndex, tView, token) {
  bloomAdd(injectorIndex, tView, token);
}
function injectAttributeImpl(tNode, attrNameToInject) {
  ngDevMode && assertTNodeType(
    tNode,
    12 | 3
    /* TNodeType.AnyRNode */
  );
  ngDevMode && assertDefined(tNode, "expecting tNode");
  if (attrNameToInject === "class") {
    return tNode.classes;
  }
  if (attrNameToInject === "style") {
    return tNode.styles;
  }
  const attrs = tNode.attrs;
  if (attrs) {
    const attrsLength = attrs.length;
    let i2 = 0;
    while (i2 < attrsLength) {
      const value = attrs[i2];
      if (isNameOnlyAttributeMarker(value))
        break;
      if (value === 0) {
        i2 = i2 + 2;
      } else if (typeof value === "number") {
        i2++;
        while (i2 < attrsLength && typeof attrs[i2] === "string") {
          i2++;
        }
      } else if (value === attrNameToInject) {
        return attrs[i2 + 1];
      } else {
        i2 = i2 + 2;
      }
    }
  }
  return null;
}
function notFoundValueOrThrow(notFoundValue, token, flags) {
  if (flags & InjectFlags.Optional || notFoundValue !== void 0) {
    return notFoundValue;
  } else {
    throwProviderNotFoundError(token, "NodeInjector");
  }
}
function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
  if (flags & InjectFlags.Optional && notFoundValue === void 0) {
    notFoundValue = null;
  }
  if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {
    const moduleInjector = lView[INJECTOR];
    const previousInjectImplementation = setInjectImplementation(void 0);
    try {
      if (moduleInjector) {
        return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);
      } else {
        return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);
      }
    } finally {
      setInjectImplementation(previousInjectImplementation);
    }
  }
  return notFoundValueOrThrow(notFoundValue, token, flags);
}
function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {
  if (tNode !== null) {
    if (lView[FLAGS] & 2048 && // The token must be present on the current node injector when the `Self`
    // flag is set, so the lookup on embedded view injector(s) can be skipped.
    !(flags & InjectFlags.Self)) {
      const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);
      if (embeddedInjectorValue !== NOT_FOUND) {
        return embeddedInjectorValue;
      }
    }
    const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);
    if (value !== NOT_FOUND) {
      return value;
    }
  }
  return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
}
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {
  const bloomHash = bloomHashBitOrFactory(token);
  if (typeof bloomHash === "function") {
    if (!enterDI(lView, tNode, flags)) {
      return flags & InjectFlags.Host ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
    }
    try {
      let value;
      if (ngDevMode) {
        runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {
          value = bloomHash(flags);
          if (value != null) {
            emitInstanceCreatedByInjectorEvent(value);
          }
        });
      } else {
        value = bloomHash(flags);
      }
      if (value == null && !(flags & InjectFlags.Optional)) {
        throwProviderNotFoundError(token);
      } else {
        return value;
      }
    } finally {
      leaveDI();
    }
  } else if (typeof bloomHash === "number") {
    let previousTView = null;
    let injectorIndex = getInjectorIndex(tNode, lView);
    let parentLocation = NO_PARENT_INJECTOR;
    let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
    if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {
      parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[
        injectorIndex + 8
        /* NodeInjectorOffset.PARENT */
      ];
      if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
        injectorIndex = -1;
      } else {
        previousTView = lView[TVIEW];
        injectorIndex = getParentInjectorIndex(parentLocation);
        lView = getParentInjectorView(parentLocation, lView);
      }
    }
    while (injectorIndex !== -1) {
      ngDevMode && assertNodeInjector(lView, injectorIndex);
      const tView = lView[TVIEW];
      ngDevMode && assertTNodeForLView(tView.data[
        injectorIndex + 8
        /* NodeInjectorOffset.TNODE */
      ], lView);
      if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
        const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
        if (instance !== NOT_FOUND) {
          return instance;
        }
      }
      parentLocation = lView[
        injectorIndex + 8
        /* NodeInjectorOffset.PARENT */
      ];
      if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW].data[
        injectorIndex + 8
        /* NodeInjectorOffset.TNODE */
      ] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {
        previousTView = tView;
        injectorIndex = getParentInjectorIndex(parentLocation);
        lView = getParentInjectorView(parentLocation, lView);
      } else {
        injectorIndex = -1;
      }
    }
  }
  return notFoundValue;
}
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
  const currentTView = lView[TVIEW];
  const tNode = currentTView.data[
    injectorIndex + 8
    /* NodeInjectorOffset.TNODE */
  ];
  const canAccessViewProviders = previousTView == null ? (
    // 1) This is the first invocation `previousTView == null` which means that we are at the
    // `TNode` of where injector is starting to look. In such a case the only time we are allowed
    // to look into the ViewProviders is if:
    // - we are on a component
    // - AND the injector set `includeViewProviders` to true (implying that the token can see
    // ViewProviders because it is the Component or a Service which itself was declared in
    // ViewProviders)
    isComponentHost(tNode) && includeViewProviders
  ) : (
    // 2) `previousTView != null` which means that we are now walking across the parent nodes.
    // In such a case we are only allowed to look into the ViewProviders if:
    // - We just crossed from child View to Parent View `previousTView != currentTView`
    // - AND the parent TNode is an Element.
    // This means that we just came from the Component's View and therefore are allowed to see
    // into the ViewProviders.
    previousTView != currentTView && (tNode.type & 3) !== 0
  );
  const isHostSpecialCase = flags & InjectFlags.Host && hostTElementNode === tNode;
  const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);
  if (injectableIdx !== null) {
    return getNodeInjectable(lView, currentTView, injectableIdx, tNode);
  } else {
    return NOT_FOUND;
  }
}
function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
  const nodeProviderIndexes = tNode.providerIndexes;
  const tInjectables = tView.data;
  const injectablesStart = nodeProviderIndexes & 1048575;
  const directivesStart = tNode.directiveStart;
  const directiveEnd = tNode.directiveEnd;
  const cptViewProvidersCount = nodeProviderIndexes >> 20;
  const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
  const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
  for (let i2 = startingIndex; i2 < endIndex; i2++) {
    const providerTokenOrDef = tInjectables[i2];
    if (i2 < directivesStart && token === providerTokenOrDef || i2 >= directivesStart && providerTokenOrDef.type === token) {
      return i2;
    }
  }
  if (isHostSpecialCase) {
    const dirDef = tInjectables[directivesStart];
    if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {
      return directivesStart;
    }
  }
  return null;
}
function getNodeInjectable(lView, tView, index, tNode) {
  let value = lView[index];
  const tData = tView.data;
  if (isFactory(value)) {
    const factory2 = value;
    if (factory2.resolving) {
      throwCyclicDependencyError(stringifyForError(tData[index]));
    }
    const previousIncludeViewProviders = setIncludeViewProviders(factory2.canSeeViewProviders);
    factory2.resolving = true;
    let prevInjectContext;
    if (ngDevMode) {
      const token = tData[index].type || tData[index];
      const injector = new NodeInjector(tNode, lView);
      prevInjectContext = setInjectorProfilerContext({ injector, token });
    }
    const previousInjectImplementation = factory2.injectImpl ? setInjectImplementation(factory2.injectImpl) : null;
    const success2 = enterDI(lView, tNode, InjectFlags.Default);
    ngDevMode && assertEqual(success2, true, "Because flags do not contain `SkipSelf' we expect this to always succeed.");
    try {
      value = lView[index] = factory2.factory(void 0, tData, lView, tNode);
      ngDevMode && emitInstanceCreatedByInjectorEvent(value);
      if (tView.firstCreatePass && index >= tNode.directiveStart) {
        ngDevMode && assertDirectiveDef(tData[index]);
        registerPreOrderHooks(index, tData[index], tView);
      }
    } finally {
      ngDevMode && setInjectorProfilerContext(prevInjectContext);
      previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);
      setIncludeViewProviders(previousIncludeViewProviders);
      factory2.resolving = false;
      leaveDI();
    }
  }
  return value;
}
function bloomHashBitOrFactory(token) {
  ngDevMode && assertDefined(token, "token must be defined");
  if (typeof token === "string") {
    return token.charCodeAt(0) || 0;
  }
  const tokenId = (
    // First check with `hasOwnProperty` so we don't get an inherited ID.
    token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : void 0
  );
  if (typeof tokenId === "number") {
    if (tokenId >= 0) {
      return tokenId & BLOOM_MASK;
    } else {
      ngDevMode && assertEqual(tokenId, -1, "Expecting to get Special Injector Id");
      return createNodeInjector;
    }
  } else {
    return tokenId;
  }
}
function bloomHasToken(bloomHash, injectorIndex, injectorView) {
  const mask = 1 << bloomHash;
  const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
  return !!(value & mask);
}
function shouldSearchParent(flags, isFirstHostTNode) {
  return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);
}
function getNodeInjectorLView(nodeInjector) {
  return nodeInjector._lView;
}
function getNodeInjectorTNode(nodeInjector) {
  return nodeInjector._tNode;
}
var NodeInjector = class {
  constructor(_tNode, _lView) {
    this._tNode = _tNode;
    this._lView = _lView;
  }
  get(token, notFoundValue, flags) {
    return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);
  }
};
function createNodeInjector() {
  return new NodeInjector(getCurrentTNode(), getLView());
}
function \u0275\u0275getInheritedFactory(type) {
  return noSideEffects(() => {
    const ownConstructor = type.prototype.constructor;
    const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);
    const objectPrototype = Object.prototype;
    let parent = Object.getPrototypeOf(type.prototype).constructor;
    while (parent && parent !== objectPrototype) {
      const factory2 = parent[NG_FACTORY_DEF] || getFactoryOf(parent);
      if (factory2 && factory2 !== ownFactory) {
        return factory2;
      }
      parent = Object.getPrototypeOf(parent);
    }
    return (t) => new t();
  });
}
function getFactoryOf(type) {
  if (isForwardRef(type)) {
    return () => {
      const factory2 = getFactoryOf(resolveForwardRef(type));
      return factory2 && factory2();
    };
  }
  return getFactoryDef(type);
}
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {
  let currentTNode = tNode;
  let currentLView = lView;
  while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !(currentLView[FLAGS] & 512)) {
    ngDevMode && assertTNodeForLView(currentTNode, currentLView);
    const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);
    if (nodeInjectorValue !== NOT_FOUND) {
      return nodeInjectorValue;
    }
    let parentTNode = currentTNode.parent;
    if (!parentTNode) {
      const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];
      if (embeddedViewInjector) {
        const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);
        if (embeddedViewInjectorValue !== NOT_FOUND) {
          return embeddedViewInjectorValue;
        }
      }
      parentTNode = getTNodeFromLView(currentLView);
      currentLView = currentLView[DECLARATION_VIEW];
    }
    currentTNode = parentTNode;
  }
  return notFoundValue;
}
function getTNodeFromLView(lView) {
  const tView = lView[TVIEW];
  const tViewType = tView.type;
  if (tViewType === 2) {
    ngDevMode && assertDefined(tView.declTNode, "Embedded TNodes should have declaration parents.");
    return tView.declTNode;
  } else if (tViewType === 1) {
    return lView[T_HOST];
  }
  return null;
}
function \u0275\u0275injectAttribute(attrNameToInject) {
  return injectAttributeImpl(getCurrentTNode(), attrNameToInject);
}
var Attribute = makeParamDecorator("Attribute", (attributeName) => ({
  attributeName,
  __NG_ELEMENT_ID__: () => \u0275\u0275injectAttribute(attributeName)
}));
var _reflect = null;
function getReflect() {
  return _reflect = _reflect || new ReflectionCapabilities();
}
function reflectDependencies(type) {
  return convertDependencies(getReflect().parameters(type));
}
function convertDependencies(deps) {
  return deps.map((dep) => reflectDependency(dep));
}
function reflectDependency(dep) {
  const meta = {
    token: null,
    attribute: null,
    host: false,
    optional: false,
    self: false,
    skipSelf: false
  };
  if (Array.isArray(dep) && dep.length > 0) {
    for (let j = 0; j < dep.length; j++) {
      const param = dep[j];
      if (param === void 0) {
        continue;
      }
      const proto = Object.getPrototypeOf(param);
      if (param instanceof Optional || proto.ngMetadataName === "Optional") {
        meta.optional = true;
      } else if (param instanceof SkipSelf || proto.ngMetadataName === "SkipSelf") {
        meta.skipSelf = true;
      } else if (param instanceof Self || proto.ngMetadataName === "Self") {
        meta.self = true;
      } else if (param instanceof Host || proto.ngMetadataName === "Host") {
        meta.host = true;
      } else if (param instanceof Inject) {
        meta.token = param.token;
      } else if (param instanceof Attribute) {
        if (param.attributeName === void 0) {
          throw new RuntimeError(204, ngDevMode && `Attribute name must be defined.`);
        }
        meta.attribute = param.attributeName;
      } else {
        meta.token = param;
      }
    }
  } else if (dep === void 0 || Array.isArray(dep) && dep.length === 0) {
    meta.token = null;
  } else {
    meta.token = dep;
  }
  return meta;
}
function compileInjectable(type, meta) {
  let ngInjectableDef = null;
  let ngFactoryDef = null;
  if (!type.hasOwnProperty(NG_PROV_DEF)) {
    Object.defineProperty(type, NG_PROV_DEF, {
      get: () => {
        if (ngInjectableDef === null) {
          const compiler = getCompilerFacade({
            usage: 0,
            kind: "injectable",
            type
          });
          ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/\u0275prov.js`, getInjectableMetadata(type, meta));
        }
        return ngInjectableDef;
      }
    });
  }
  if (!type.hasOwnProperty(NG_FACTORY_DEF)) {
    Object.defineProperty(type, NG_FACTORY_DEF, {
      get: () => {
        if (ngFactoryDef === null) {
          const compiler = getCompilerFacade({
            usage: 0,
            kind: "injectable",
            type
          });
          ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/\u0275fac.js`, {
            name: type.name,
            type,
            typeArgumentCount: 0,
            // In JIT mode types are not available nor used.
            deps: reflectDependencies(type),
            target: compiler.FactoryTarget.Injectable
          });
        }
        return ngFactoryDef;
      },
      // Leave this configurable so that the factories from directives or pipes can take precedence.
      configurable: true
    });
  }
}
var USE_VALUE = getClosureSafeProperty({
  provide: String,
  useValue: getClosureSafeProperty
});
function isUseClassProvider(meta) {
  return meta.useClass !== void 0;
}
function isUseValueProvider(meta) {
  return USE_VALUE in meta;
}
function isUseFactoryProvider(meta) {
  return meta.useFactory !== void 0;
}
function isUseExistingProvider(meta) {
  return meta.useExisting !== void 0;
}
function getInjectableMetadata(type, srcMeta) {
  const meta = srcMeta || { providedIn: null };
  const compilerMeta = {
    name: type.name,
    type,
    typeArgumentCount: 0,
    providedIn: meta.providedIn
  };
  if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== void 0) {
    compilerMeta.deps = convertDependencies(meta.deps);
  }
  if (isUseClassProvider(meta)) {
    compilerMeta.useClass = meta.useClass;
  } else if (isUseValueProvider(meta)) {
    compilerMeta.useValue = meta.useValue;
  } else if (isUseFactoryProvider(meta)) {
    compilerMeta.useFactory = meta.useFactory;
  } else if (isUseExistingProvider(meta)) {
    compilerMeta.useExisting = meta.useExisting;
  }
  return compilerMeta;
}
var Injectable = makeDecorator("Injectable", void 0, void 0, void 0, (type, meta) => compileInjectable(type, meta));
function createInjector(defType, parent = null, additionalProviders = null, name) {
  const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
  injector.resolveInjectorInitializers();
  return injector;
}
function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = /* @__PURE__ */ new Set()) {
  const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];
  name = name || (typeof defType === "object" ? void 0 : stringify(defType));
  return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);
}
var _Injector = class _Injector {
  static create(options, parent) {
    if (Array.isArray(options)) {
      return createInjector({ name: "" }, parent, options, "");
    } else {
      const name = options.name ?? "";
      return createInjector({ name }, options.parent, options.providers, name);
    }
  }
};
_Injector.THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;
_Injector.NULL = new NullInjector();
_Injector.\u0275prov = \u0275\u0275defineInjectable({
  token: _Injector,
  providedIn: "any",
  factory: () => \u0275\u0275inject(INJECTOR$1)
});
_Injector.__NG_ELEMENT_ID__ = -1;
var Injector = _Injector;
var HOST_TAG_NAME = new InjectionToken(ngDevMode ? "HOST_TAG_NAME" : "");
HOST_TAG_NAME.__NG_ELEMENT_ID__ = (flags) => {
  const tNode = getCurrentTNode();
  if (tNode === null) {
    throw new RuntimeError(204, ngDevMode && "HOST_TAG_NAME can only be injected in directives and components during construction time (in a class constructor or as a class field initializer)");
  }
  if (tNode.type & 2) {
    return tNode.value;
  }
  if (flags & InjectFlags.Optional) {
    return null;
  }
  throw new RuntimeError(204, ngDevMode && `HOST_TAG_NAME was used on ${getDevModeNodeName(tNode)} which doesn't have an underlying element in the DOM. This is invalid, and so the dependency should be marked as optional.`);
};
function getDevModeNodeName(tNode) {
  if (tNode.type & 8) {
    return "an <ng-container>";
  } else if (tNode.type & 4) {
    return "an <ng-template>";
  } else {
    return "a node";
  }
}
var ERROR_ORIGINAL_ERROR = "ngOriginalError";
function getOriginalError(error3) {
  return error3[ERROR_ORIGINAL_ERROR];
}
var ErrorHandler = class {
  constructor() {
    this._console = console;
  }
  handleError(error3) {
    const originalError = this._findOriginalError(error3);
    this._console.error("ERROR", error3);
    if (originalError) {
      this._console.error("ORIGINAL ERROR", originalError);
    }
  }
  /** @internal */
  _findOriginalError(error3) {
    let e = error3 && getOriginalError(error3);
    while (e && getOriginalError(e)) {
      e = getOriginalError(e);
    }
    return e || null;
  }
};
var INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "internal error handler" : "", {
  providedIn: "root",
  factory: () => {
    const userErrorHandler = inject(ErrorHandler);
    return userErrorHandler.handleError.bind(void 0);
  }
});
var _DestroyRef = class _DestroyRef {
};
_DestroyRef.__NG_ELEMENT_ID__ = injectDestroyRef;
_DestroyRef.__NG_ENV_ID__ = (injector) => injector;
var DestroyRef = _DestroyRef;
var NodeInjectorDestroyRef = class extends DestroyRef {
  constructor(_lView) {
    super();
    this._lView = _lView;
  }
  onDestroy(callback) {
    storeLViewOnDestroy(this._lView, callback);
    return () => removeLViewOnDestroy(this._lView, callback);
  }
};
function injectDestroyRef() {
  return new NodeInjectorDestroyRef(getLView());
}
var OutputEmitterRef = class {
  constructor() {
    this.destroyed = false;
    this.listeners = null;
    this.errorHandler = inject(ErrorHandler, { optional: true });
    this.destroyRef = inject(DestroyRef);
    this.destroyRef.onDestroy(() => {
      this.destroyed = true;
      this.listeners = null;
    });
  }
  subscribe(callback) {
    if (this.destroyed) {
      throw new RuntimeError(953, ngDevMode && "Unexpected subscription to destroyed `OutputRef`. The owning directive/component is destroyed.");
    }
    (this.listeners ??= []).push(callback);
    return {
      unsubscribe: () => {
        const idx = this.listeners?.indexOf(callback);
        if (idx !== void 0 && idx !== -1) {
          this.listeners?.splice(idx, 1);
        }
      }
    };
  }
  /** Emits a new value to the output. */
  emit(value) {
    if (this.destroyed) {
      throw new RuntimeError(953, ngDevMode && "Unexpected emit for destroyed `OutputRef`. The owning directive/component is destroyed.");
    }
    if (this.listeners === null) {
      return;
    }
    const previousConsumer = setActiveConsumer(null);
    try {
      for (const listenerFn of this.listeners) {
        try {
          listenerFn(value);
        } catch (err) {
          this.errorHandler?.handleError(err);
        }
      }
    } finally {
      setActiveConsumer(previousConsumer);
    }
  }
};
function inputFunction(initialValue, opts) {
  ngDevMode && assertInInjectionContext(input);
  return createInputSignal(initialValue, opts);
}
function inputRequiredFunction(opts) {
  ngDevMode && assertInInjectionContext(input);
  return createInputSignal(REQUIRED_UNSET_VALUE, opts);
}
var input = (() => {
  inputFunction.required = inputRequiredFunction;
  return inputFunction;
})();
function injectElementRef() {
  return createElementRef(getCurrentTNode(), getLView());
}
function createElementRef(tNode, lView) {
  return new ElementRef(getNativeByTNode(tNode, lView));
}
var _ElementRef = class _ElementRef {
  constructor(nativeElement) {
    this.nativeElement = nativeElement;
  }
};
_ElementRef.__NG_ELEMENT_ID__ = injectElementRef;
var ElementRef = _ElementRef;
function unwrapElementRef(value) {
  return value instanceof ElementRef ? value.nativeElement : value;
}
var EventEmitter_ = class extends Subject {
  constructor(isAsync = false) {
    super();
    this.destroyRef = void 0;
    this.__isAsync = isAsync;
    if (isInInjectionContext()) {
      this.destroyRef = inject(DestroyRef, { optional: true }) ?? void 0;
    }
  }
  emit(value) {
    const prevConsumer = setActiveConsumer(null);
    try {
      super.next(value);
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
  subscribe(observerOrNext, error3, complete) {
    let nextFn = observerOrNext;
    let errorFn = error3 || (() => null);
    let completeFn = complete;
    if (observerOrNext && typeof observerOrNext === "object") {
      const observer = observerOrNext;
      nextFn = observer.next?.bind(observer);
      errorFn = observer.error?.bind(observer);
      completeFn = observer.complete?.bind(observer);
    }
    if (this.__isAsync) {
      errorFn = _wrapInTimeout(errorFn);
      if (nextFn) {
        nextFn = _wrapInTimeout(nextFn);
      }
      if (completeFn) {
        completeFn = _wrapInTimeout(completeFn);
      }
    }
    const sink = super.subscribe({ next: nextFn, error: errorFn, complete: completeFn });
    if (observerOrNext instanceof Subscription) {
      observerOrNext.add(sink);
    }
    return sink;
  }
};
function _wrapInTimeout(fn) {
  return (value) => {
    setTimeout(fn, void 0, value);
  };
}
var EventEmitter = EventEmitter_;
function symbolIterator() {
  return this._results[Symbol.iterator]();
}
var _QueryList = class _QueryList {
  /**
   * Returns `Observable` of `QueryList` notifying the subscriber of changes.
   */
  get changes() {
    return this._changes ??= new EventEmitter();
  }
  /**
   * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
   *     has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
   *     the same result)
   */
  constructor(_emitDistinctChangesOnly = false) {
    this._emitDistinctChangesOnly = _emitDistinctChangesOnly;
    this.dirty = true;
    this._onDirty = void 0;
    this._results = [];
    this._changesDetected = false;
    this._changes = void 0;
    this.length = 0;
    this.first = void 0;
    this.last = void 0;
    const proto = _QueryList.prototype;
    if (!proto[Symbol.iterator])
      proto[Symbol.iterator] = symbolIterator;
  }
  /**
   * Returns the QueryList entry at `index`.
   */
  get(index) {
    return this._results[index];
  }
  /**
   * See
   * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
   */
  map(fn) {
    return this._results.map(fn);
  }
  filter(fn) {
    return this._results.filter(fn);
  }
  /**
   * See
   * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
   */
  find(fn) {
    return this._results.find(fn);
  }
  /**
   * See
   * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)
   */
  reduce(fn, init31) {
    return this._results.reduce(fn, init31);
  }
  /**
   * See
   * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
   */
  forEach(fn) {
    this._results.forEach(fn);
  }
  /**
   * See
   * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)
   */
  some(fn) {
    return this._results.some(fn);
  }
  /**
   * Returns a copy of the internal results list as an Array.
   */
  toArray() {
    return this._results.slice();
  }
  toString() {
    return this._results.toString();
  }
  /**
   * Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that
   * on change detection, it will not notify of changes to the queries, unless a new change
   * occurs.
   *
   * @param resultsTree The query results to store
   * @param identityAccessor Optional function for extracting stable object identity from a value
   *    in the array. This function is executed for each element of the query result list while
   *    comparing current query list with the new one (provided as a first argument of the `reset`
   *    function) to detect if the lists are different. If the function is not provided, elements
   *    are compared as is (without any pre-processing).
   */
  reset(resultsTree, identityAccessor) {
    this.dirty = false;
    const newResultFlat = flatten(resultsTree);
    if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {
      this._results = newResultFlat;
      this.length = newResultFlat.length;
      this.last = newResultFlat[this.length - 1];
      this.first = newResultFlat[0];
    }
  }
  /**
   * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
   */
  notifyOnChanges() {
    if (this._changes !== void 0 && (this._changesDetected || !this._emitDistinctChangesOnly))
      this._changes.emit(this);
  }
  /** @internal */
  onDirty(cb) {
    this._onDirty = cb;
  }
  /** internal */
  setDirty() {
    this.dirty = true;
    this._onDirty?.();
  }
  /** internal */
  destroy() {
    if (this._changes !== void 0) {
      this._changes.complete();
      this._changes.unsubscribe();
    }
  }
};
Symbol.iterator;
var QueryList = _QueryList;
function hasInSkipHydrationBlockFlag(tNode) {
  return (tNode.flags & 128) === 128;
}
var TRACKED_LVIEWS = /* @__PURE__ */ new Map();
var uniqueIdCounter = 0;
function getUniqueLViewId() {
  return uniqueIdCounter++;
}
function registerLView(lView) {
  ngDevMode && assertNumber(lView[ID], "LView must have an ID in order to be registered");
  TRACKED_LVIEWS.set(lView[ID], lView);
}
function getLViewById(id2) {
  ngDevMode && assertNumber(id2, "ID used for LView lookup must be a number");
  return TRACKED_LVIEWS.get(id2) || null;
}
function unregisterLView(lView) {
  ngDevMode && assertNumber(lView[ID], "Cannot stop tracking an LView that does not have an ID");
  TRACKED_LVIEWS.delete(lView[ID]);
}
var LContext = class {
  /** Component's parent view data. */
  get lView() {
    return getLViewById(this.lViewId);
  }
  constructor(lViewId, nodeIndex, native) {
    this.lViewId = lViewId;
    this.nodeIndex = nodeIndex;
    this.native = native;
  }
};
function getLContext(target) {
  let mpValue = readPatchedData(target);
  if (mpValue) {
    if (isLView(mpValue)) {
      const lView = mpValue;
      let nodeIndex;
      let component = void 0;
      let directives = void 0;
      if (isComponentInstance(target)) {
        nodeIndex = findViaComponent(lView, target);
        if (nodeIndex == -1) {
          throw new Error("The provided component was not found in the application");
        }
        component = target;
      } else if (isDirectiveInstance(target)) {
        nodeIndex = findViaDirective(lView, target);
        if (nodeIndex == -1) {
          throw new Error("The provided directive was not found in the application");
        }
        directives = getDirectivesAtNodeIndex(nodeIndex, lView);
      } else {
        nodeIndex = findViaNativeElement(lView, target);
        if (nodeIndex == -1) {
          return null;
        }
      }
      const native = unwrapRNode(lView[nodeIndex]);
      const existingCtx = readPatchedData(native);
      const context2 = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native);
      if (component && context2.component === void 0) {
        context2.component = component;
        attachPatchData(context2.component, context2);
      }
      if (directives && context2.directives === void 0) {
        context2.directives = directives;
        for (let i2 = 0; i2 < directives.length; i2++) {
          attachPatchData(directives[i2], context2);
        }
      }
      attachPatchData(context2.native, context2);
      mpValue = context2;
    }
  } else {
    const rElement = target;
    ngDevMode && assertDomNode(rElement);
    let parent = rElement;
    while (parent = parent.parentNode) {
      const parentContext = readPatchedData(parent);
      if (parentContext) {
        const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;
        if (!lView) {
          return null;
        }
        const index = findViaNativeElement(lView, rElement);
        if (index >= 0) {
          const native = unwrapRNode(lView[index]);
          const context2 = createLContext(lView, index, native);
          attachPatchData(native, context2);
          mpValue = context2;
          break;
        }
      }
    }
  }
  return mpValue || null;
}
function createLContext(lView, nodeIndex, native) {
  return new LContext(lView[ID], nodeIndex, native);
}
function getComponentViewByInstance(componentInstance) {
  let patchedData = readPatchedData(componentInstance);
  let lView;
  if (isLView(patchedData)) {
    const contextLView = patchedData;
    const nodeIndex = findViaComponent(contextLView, componentInstance);
    lView = getComponentLViewByIndex(nodeIndex, contextLView);
    const context2 = createLContext(contextLView, nodeIndex, lView[HOST]);
    context2.component = componentInstance;
    attachPatchData(componentInstance, context2);
    attachPatchData(context2.native, context2);
  } else {
    const context2 = patchedData;
    const contextLView = context2.lView;
    ngDevMode && assertLView(contextLView);
    lView = getComponentLViewByIndex(context2.nodeIndex, contextLView);
  }
  return lView;
}
var MONKEY_PATCH_KEY_NAME = "__ngContext__";
function attachPatchData(target, data) {
  ngDevMode && assertDefined(target, "Target expected");
  if (isLView(data)) {
    target[MONKEY_PATCH_KEY_NAME] = data[ID];
    registerLView(data);
  } else {
    target[MONKEY_PATCH_KEY_NAME] = data;
  }
}
function readPatchedData(target) {
  ngDevMode && assertDefined(target, "Target expected");
  const data = target[MONKEY_PATCH_KEY_NAME];
  return typeof data === "number" ? getLViewById(data) : data || null;
}
function readPatchedLView(target) {
  const value = readPatchedData(target);
  if (value) {
    return isLView(value) ? value : value.lView;
  }
  return null;
}
function isComponentInstance(instance) {
  return instance && instance.constructor && instance.constructor.\u0275cmp;
}
function isDirectiveInstance(instance) {
  return instance && instance.constructor && instance.constructor.\u0275dir;
}
function findViaNativeElement(lView, target) {
  const tView = lView[TVIEW];
  for (let i2 = HEADER_OFFSET; i2 < tView.bindingStartIndex; i2++) {
    if (unwrapRNode(lView[i2]) === target) {
      return i2;
    }
  }
  return -1;
}
function traverseNextElement(tNode) {
  if (tNode.child) {
    return tNode.child;
  } else if (tNode.next) {
    return tNode.next;
  } else {
    while (tNode.parent && !tNode.parent.next) {
      tNode = tNode.parent;
    }
    return tNode.parent && tNode.parent.next;
  }
}
function findViaComponent(lView, componentInstance) {
  const componentIndices = lView[TVIEW].components;
  if (componentIndices) {
    for (let i2 = 0; i2 < componentIndices.length; i2++) {
      const elementComponentIndex = componentIndices[i2];
      const componentView = getComponentLViewByIndex(elementComponentIndex, lView);
      if (componentView[CONTEXT] === componentInstance) {
        return elementComponentIndex;
      }
    }
  } else {
    const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);
    const rootComponent = rootComponentView[CONTEXT];
    if (rootComponent === componentInstance) {
      return HEADER_OFFSET;
    }
  }
  return -1;
}
function findViaDirective(lView, directiveInstance) {
  let tNode = lView[TVIEW].firstChild;
  while (tNode) {
    const directiveIndexStart = tNode.directiveStart;
    const directiveIndexEnd = tNode.directiveEnd;
    for (let i2 = directiveIndexStart; i2 < directiveIndexEnd; i2++) {
      if (lView[i2] === directiveInstance) {
        return tNode.index;
      }
    }
    tNode = traverseNextElement(tNode);
  }
  return -1;
}
function getDirectivesAtNodeIndex(nodeIndex, lView) {
  const tNode = lView[TVIEW].data[nodeIndex];
  if (tNode.directiveStart === 0)
    return EMPTY_ARRAY;
  const results = [];
  for (let i2 = tNode.directiveStart; i2 < tNode.directiveEnd; i2++) {
    const directiveInstance = lView[i2];
    if (!isComponentInstance(directiveInstance)) {
      results.push(directiveInstance);
    }
  }
  return results;
}
function getComponentAtNodeIndex(nodeIndex, lView) {
  const tNode = lView[TVIEW].data[nodeIndex];
  const { directiveStart, componentOffset } = tNode;
  return componentOffset > -1 ? lView[directiveStart + componentOffset] : null;
}
function getRootView(componentOrLView) {
  ngDevMode && assertDefined(componentOrLView, "component");
  let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);
  while (lView && !(lView[FLAGS] & 512)) {
    lView = getLViewParent(lView);
  }
  ngDevMode && assertLView(lView);
  return lView;
}
function getRootContext(viewOrComponent) {
  const rootView = getRootView(viewOrComponent);
  ngDevMode && assertDefined(rootView[CONTEXT], "Root view has no context. Perhaps it is disconnected?");
  return rootView[CONTEXT];
}
function getFirstLContainer(lView) {
  return getNearestLContainer(lView[CHILD_HEAD]);
}
function getNextLContainer(container) {
  return getNearestLContainer(container[NEXT]);
}
function getNearestLContainer(viewOrContainer) {
  while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {
    viewOrContainer = viewOrContainer[NEXT];
  }
  return viewOrContainer;
}
function getComponent$1(element) {
  ngDevMode && assertDomElement(element);
  const context2 = getLContext(element);
  if (context2 === null)
    return null;
  if (context2.component === void 0) {
    const lView = context2.lView;
    if (lView === null) {
      return null;
    }
    context2.component = getComponentAtNodeIndex(context2.nodeIndex, lView);
  }
  return context2.component;
}
function getContext(element) {
  assertDomElement(element);
  const context2 = getLContext(element);
  const lView = context2 ? context2.lView : null;
  return lView === null ? null : lView[CONTEXT];
}
function getOwningComponent(elementOrDir) {
  const context2 = getLContext(elementOrDir);
  let lView = context2 ? context2.lView : null;
  if (lView === null)
    return null;
  let parent;
  while (lView[TVIEW].type === 2 && (parent = getLViewParent(lView))) {
    lView = parent;
  }
  return lView[FLAGS] & 512 ? null : lView[CONTEXT];
}
function getRootComponents(elementOrDir) {
  const lView = readPatchedLView(elementOrDir);
  return lView !== null ? [getRootContext(lView)] : [];
}
function getInjector(elementOrDir) {
  const context2 = getLContext(elementOrDir);
  const lView = context2 ? context2.lView : null;
  if (lView === null)
    return Injector.NULL;
  const tNode = lView[TVIEW].data[context2.nodeIndex];
  return new NodeInjector(tNode, lView);
}
function getDirectives(node) {
  if (node instanceof Text) {
    return [];
  }
  const context2 = getLContext(node);
  const lView = context2 ? context2.lView : null;
  if (lView === null) {
    return [];
  }
  const tView = lView[TVIEW];
  const nodeIndex = context2.nodeIndex;
  if (!tView?.data[nodeIndex]) {
    return [];
  }
  if (context2.directives === void 0) {
    context2.directives = getDirectivesAtNodeIndex(nodeIndex, lView);
  }
  return context2.directives === null ? [] : [...context2.directives];
}
function getDirectiveMetadata$1(directiveOrComponentInstance) {
  const { constructor } = directiveOrComponentInstance;
  if (!constructor) {
    throw new Error("Unable to find the instance constructor");
  }
  const componentDef = getComponentDef(constructor);
  if (componentDef) {
    const inputs = extractInputDebugMetadata(componentDef.inputs);
    return {
      inputs,
      outputs: componentDef.outputs,
      encapsulation: componentDef.encapsulation,
      changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Default
    };
  }
  const directiveDef = getDirectiveDef(constructor);
  if (directiveDef) {
    const inputs = extractInputDebugMetadata(directiveDef.inputs);
    return { inputs, outputs: directiveDef.outputs };
  }
  return null;
}
function getHostElement(componentOrDirective) {
  return getLContext(componentOrDirective).native;
}
function getListeners(element) {
  ngDevMode && assertDomElement(element);
  const lContext = getLContext(element);
  const lView = lContext === null ? null : lContext.lView;
  if (lView === null)
    return [];
  const tView = lView[TVIEW];
  const lCleanup = lView[CLEANUP];
  const tCleanup = tView.cleanup;
  const listeners = [];
  if (tCleanup && lCleanup) {
    for (let i2 = 0; i2 < tCleanup.length; ) {
      const firstParam = tCleanup[i2++];
      const secondParam = tCleanup[i2++];
      if (typeof firstParam === "string") {
        const name = firstParam;
        const listenerElement = unwrapRNode(lView[secondParam]);
        const callback = lCleanup[tCleanup[i2++]];
        const useCaptureOrIndx = tCleanup[i2++];
        const type = typeof useCaptureOrIndx === "boolean" || useCaptureOrIndx >= 0 ? "dom" : "output";
        const useCapture = typeof useCaptureOrIndx === "boolean" ? useCaptureOrIndx : false;
        if (element == listenerElement) {
          listeners.push({ element, name, callback, useCapture, type });
        }
      }
    }
  }
  listeners.sort(sortListeners);
  return listeners;
}
function sortListeners(a, b) {
  if (a.name == b.name)
    return 0;
  return a.name < b.name ? -1 : 1;
}
function assertDomElement(value) {
  if (typeof Element !== "undefined" && !(value instanceof Element)) {
    throw new Error("Expecting instance of DOM Element");
  }
}
function extractInputDebugMetadata(inputs) {
  const res = {};
  for (const key in inputs) {
    if (!inputs.hasOwnProperty(key)) {
      continue;
    }
    const value = inputs[key];
    if (value === void 0) {
      continue;
    }
    let minifiedName;
    if (Array.isArray(value)) {
      minifiedName = value[0];
    } else {
      minifiedName = value;
    }
    res[key] = minifiedName;
  }
  return res;
}
var DOCUMENT = void 0;
function setDocument(document2) {
  DOCUMENT = document2;
}
function getDocument() {
  if (DOCUMENT !== void 0) {
    return DOCUMENT;
  } else if (typeof document !== "undefined") {
    return document;
  }
  throw new RuntimeError(210, (typeof ngDevMode === "undefined" || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);
}
var APP_ID = new InjectionToken(ngDevMode ? "AppId" : "", {
  providedIn: "root",
  factory: () => DEFAULT_APP_ID
});
var DEFAULT_APP_ID = "ng";
var PLATFORM_INITIALIZER = new InjectionToken(ngDevMode ? "Platform Initializer" : "");
var PLATFORM_ID = new InjectionToken(ngDevMode ? "Platform ID" : "", {
  providedIn: "platform",
  factory: () => "unknown"
  // set a default platform name, when none set explicitly
});
var PACKAGE_ROOT_URL = new InjectionToken(ngDevMode ? "Application Packages Root URL" : "");
var ANIMATION_MODULE_TYPE = new InjectionToken(ngDevMode ? "AnimationModuleType" : "");
var CSP_NONCE = new InjectionToken(ngDevMode ? "CSP nonce" : "", {
  providedIn: "root",
  factory: () => {
    return getDocument().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce") || null;
  }
});
var IMAGE_CONFIG_DEFAULTS = {
  breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
  placeholderResolution: 30,
  disableImageSizeWarning: false,
  disableImageLazyLoadWarning: false
};
var IMAGE_CONFIG = new InjectionToken(ngDevMode ? "ImageConfig" : "", {
  providedIn: "root",
  factory: () => IMAGE_CONFIG_DEFAULTS
});
function makeStateKey(key) {
  return key;
}
function initTransferState() {
  const transferState = new TransferState();
  if (inject(PLATFORM_ID) === "browser") {
    transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
  }
  return transferState;
}
var _TransferState = class _TransferState {
  constructor() {
    this.store = {};
    this.onSerializeCallbacks = {};
  }
  /**
   * Get the value corresponding to a key. Return `defaultValue` if key is not found.
   */
  get(key, defaultValue) {
    return this.store[key] !== void 0 ? this.store[key] : defaultValue;
  }
  /**
   * Set the value corresponding to a key.
   */
  set(key, value) {
    this.store[key] = value;
  }
  /**
   * Remove a key from the store.
   */
  remove(key) {
    delete this.store[key];
  }
  /**
   * Test whether a key exists in the store.
   */
  hasKey(key) {
    return this.store.hasOwnProperty(key);
  }
  /**
   * Indicates whether the state is empty.
   */
  get isEmpty() {
    return Object.keys(this.store).length === 0;
  }
  /**
   * Register a callback to provide the value for a key when `toJson` is called.
   */
  onSerialize(key, callback) {
    this.onSerializeCallbacks[key] = callback;
  }
  /**
   * Serialize the current state of the store to JSON.
   */
  toJson() {
    for (const key in this.onSerializeCallbacks) {
      if (this.onSerializeCallbacks.hasOwnProperty(key)) {
        try {
          this.store[key] = this.onSerializeCallbacks[key]();
        } catch (e) {
          console.warn("Exception in onSerialize callback: ", e);
        }
      }
    }
    return JSON.stringify(this.store).replace(/</g, "\\u003C");
  }
};
_TransferState.\u0275prov = \u0275\u0275defineInjectable({
  token: _TransferState,
  providedIn: "root",
  factory: initTransferState
});
var TransferState = _TransferState;
function retrieveTransferredState(doc, appId) {
  const script = doc.getElementById(appId + "-state");
  if (script?.textContent) {
    try {
      return JSON.parse(script.textContent);
    } catch (e) {
      console.warn("Exception while restoring TransferState for app " + appId, e);
    }
  }
  return {};
}
var REFERENCE_NODE_HOST = "h";
var REFERENCE_NODE_BODY = "b";
var NodeNavigationStep;
(function(NodeNavigationStep2) {
  NodeNavigationStep2["FirstChild"] = "f";
  NodeNavigationStep2["NextSibling"] = "n";
})(NodeNavigationStep || (NodeNavigationStep = {}));
var TRANSFER_STATE_TOKEN_ID = "__nghData__";
var NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID);
var _retrieveHydrationInfoImpl = () => null;
function retrieveHydrationInfo(rNode, injector, isRootView2 = false) {
  return _retrieveHydrationInfoImpl(rNode, injector, isRootView2);
}
var HydrationStatus;
(function(HydrationStatus2) {
  HydrationStatus2["Hydrated"] = "hydrated";
  HydrationStatus2["Skipped"] = "skipped";
  HydrationStatus2["Mismatched"] = "mismatched";
})(HydrationStatus || (HydrationStatus = {}));
var IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || !!ngDevMode ? "IS_HYDRATION_DOM_REUSE_ENABLED" : "");
var PRESERVE_HOST_CONTENT_DEFAULT = false;
var PRESERVE_HOST_CONTENT = new InjectionToken(typeof ngDevMode === "undefined" || !!ngDevMode ? "PRESERVE_HOST_CONTENT" : "", {
  providedIn: "root",
  factory: () => PRESERVE_HOST_CONTENT_DEFAULT
});
var IS_I18N_HYDRATION_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || !!ngDevMode ? "IS_I18N_HYDRATION_ENABLED" : "");
var IS_EVENT_REPLAY_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || !!ngDevMode ? "IS_EVENT_REPLAY_ENABLED" : "");
var policy$1;
function getPolicy$1() {
  if (policy$1 === void 0) {
    policy$1 = null;
    if (_global.trustedTypes) {
      try {
        policy$1 = _global.trustedTypes.createPolicy("angular", {
          createHTML: (s) => s,
          createScript: (s) => s,
          createScriptURL: (s) => s
        });
      } catch {
      }
    }
  }
  return policy$1;
}
function trustedHTMLFromString(html) {
  return getPolicy$1()?.createHTML(html) || html;
}
function trustedScriptURLFromString(url) {
  return getPolicy$1()?.createScriptURL(url) || url;
}
var policy;
function getPolicy() {
  if (policy === void 0) {
    policy = null;
    if (_global.trustedTypes) {
      try {
        policy = _global.trustedTypes.createPolicy("angular#unsafe-bypass", {
          createHTML: (s) => s,
          createScript: (s) => s,
          createScriptURL: (s) => s
        });
      } catch {
      }
    }
  }
  return policy;
}
function trustedHTMLFromStringBypass(html) {
  return getPolicy()?.createHTML(html) || html;
}
function trustedScriptFromStringBypass(script) {
  return getPolicy()?.createScript(script) || script;
}
function trustedScriptURLFromStringBypass(url) {
  return getPolicy()?.createScriptURL(url) || url;
}
var SafeValueImpl = class {
  constructor(changingThisBreaksApplicationSecurity) {
    this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
  }
  toString() {
    return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${XSS_SECURITY_URL})`;
  }
};
var SafeHtmlImpl = class extends SafeValueImpl {
  getTypeName() {
    return "HTML";
  }
};
var SafeStyleImpl = class extends SafeValueImpl {
  getTypeName() {
    return "Style";
  }
};
var SafeScriptImpl = class extends SafeValueImpl {
  getTypeName() {
    return "Script";
  }
};
var SafeUrlImpl = class extends SafeValueImpl {
  getTypeName() {
    return "URL";
  }
};
var SafeResourceUrlImpl = class extends SafeValueImpl {
  getTypeName() {
    return "ResourceURL";
  }
};
function unwrapSafeValue(value) {
  return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value;
}
function allowSanitizationBypassAndThrow(value, type) {
  const actualType = getSanitizationBypassType(value);
  if (actualType != null && actualType !== type) {
    if (actualType === "ResourceURL" && type === "URL")
      return true;
    throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
  }
  return actualType === type;
}
function getSanitizationBypassType(value) {
  return value instanceof SafeValueImpl && value.getTypeName() || null;
}
function bypassSanitizationTrustHtml(trustedHtml) {
  return new SafeHtmlImpl(trustedHtml);
}
function bypassSanitizationTrustStyle(trustedStyle) {
  return new SafeStyleImpl(trustedStyle);
}
function bypassSanitizationTrustScript(trustedScript) {
  return new SafeScriptImpl(trustedScript);
}
function bypassSanitizationTrustUrl(trustedUrl) {
  return new SafeUrlImpl(trustedUrl);
}
function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {
  return new SafeResourceUrlImpl(trustedResourceUrl);
}
function getInertBodyHelper(defaultDoc) {
  const inertDocumentHelper = new InertDocumentHelper(defaultDoc);
  return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;
}
var DOMParserHelper = class {
  constructor(inertDocumentHelper) {
    this.inertDocumentHelper = inertDocumentHelper;
  }
  getInertBodyElement(html) {
    html = "<body><remove></remove>" + html;
    try {
      const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), "text/html").body;
      if (body === null) {
        return this.inertDocumentHelper.getInertBodyElement(html);
      }
      body.removeChild(body.firstChild);
      return body;
    } catch {
      return null;
    }
  }
};
var InertDocumentHelper = class {
  constructor(defaultDoc) {
    this.defaultDoc = defaultDoc;
    this.inertDocument = this.defaultDoc.implementation.createHTMLDocument("sanitization-inert");
  }
  getInertBodyElement(html) {
    const templateEl = this.inertDocument.createElement("template");
    templateEl.innerHTML = trustedHTMLFromString(html);
    return templateEl;
  }
};
function isDOMParserAvailable() {
  try {
    return !!new window.DOMParser().parseFromString(trustedHTMLFromString(""), "text/html");
  } catch {
    return false;
  }
}
var SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
function _sanitizeUrl(url) {
  url = String(url);
  if (url.match(SAFE_URL_PATTERN))
    return url;
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
  }
  return "unsafe:" + url;
}
function tagSet(tags) {
  const res = {};
  for (const t of tags.split(","))
    res[t] = true;
  return res;
}
function merge2(...sets) {
  const res = {};
  for (const s of sets) {
    for (const v in s) {
      if (s.hasOwnProperty(v))
        res[v] = true;
    }
  }
  return res;
}
var VOID_ELEMENTS = tagSet("area,br,col,hr,img,wbr");
var OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr");
var OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet("rp,rt");
var OPTIONAL_END_TAG_ELEMENTS = merge2(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);
var BLOCK_ELEMENTS = merge2(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul"));
var INLINE_ELEMENTS = merge2(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video"));
var VALID_ELEMENTS = merge2(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);
var URI_ATTRS = tagSet("background,cite,href,itemtype,longdesc,poster,src,xlink:href");
var HTML_ATTRS = tagSet("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width");
var ARIA_ATTRS = tagSet("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext");
var VALID_ATTRS = merge2(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);
var SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet("script,style,template");
var SanitizingHtmlSerializer = class {
  constructor() {
    this.sanitizedSomething = false;
    this.buf = [];
  }
  sanitizeChildren(el) {
    let current = el.firstChild;
    let traverseContent = true;
    let parentNodes = [];
    while (current) {
      if (current.nodeType === Node.ELEMENT_NODE) {
        traverseContent = this.startElement(current);
      } else if (current.nodeType === Node.TEXT_NODE) {
        this.chars(current.nodeValue);
      } else {
        this.sanitizedSomething = true;
      }
      if (traverseContent && current.firstChild) {
        parentNodes.push(current);
        current = getFirstChild(current);
        continue;
      }
      while (current) {
        if (current.nodeType === Node.ELEMENT_NODE) {
          this.endElement(current);
        }
        let next = getNextSibling(current);
        if (next) {
          current = next;
          break;
        }
        current = parentNodes.pop();
      }
    }
    return this.buf.join("");
  }
  /**
   * Sanitizes an opening element tag (if valid) and returns whether the element's contents should
   * be traversed. Element content must always be traversed (even if the element itself is not
   * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.
   *
   * @param element The element to sanitize.
   * @return True if the element's contents should be traversed.
   */
  startElement(element) {
    const tagName = getNodeName(element).toLowerCase();
    if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {
      this.sanitizedSomething = true;
      return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);
    }
    this.buf.push("<");
    this.buf.push(tagName);
    const elAttrs = element.attributes;
    for (let i2 = 0; i2 < elAttrs.length; i2++) {
      const elAttr = elAttrs.item(i2);
      const attrName = elAttr.name;
      const lower = attrName.toLowerCase();
      if (!VALID_ATTRS.hasOwnProperty(lower)) {
        this.sanitizedSomething = true;
        continue;
      }
      let value = elAttr.value;
      if (URI_ATTRS[lower])
        value = _sanitizeUrl(value);
      this.buf.push(" ", attrName, '="', encodeEntities(value), '"');
    }
    this.buf.push(">");
    return true;
  }
  endElement(current) {
    const tagName = getNodeName(current).toLowerCase();
    if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {
      this.buf.push("</");
      this.buf.push(tagName);
      this.buf.push(">");
    }
  }
  chars(chars) {
    this.buf.push(encodeEntities(chars));
  }
};
function isClobberedElement(parentNode, childNode) {
  return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY;
}
function getNextSibling(node) {
  const nextSibling = node.nextSibling;
  if (nextSibling && node !== nextSibling.previousSibling) {
    throw clobberedElementError(nextSibling);
  }
  return nextSibling;
}
function getFirstChild(node) {
  const firstChild = node.firstChild;
  if (firstChild && isClobberedElement(node, firstChild)) {
    throw clobberedElementError(firstChild);
  }
  return firstChild;
}
function getNodeName(node) {
  const nodeName = node.nodeName;
  return typeof nodeName === "string" ? nodeName : "FORM";
}
function clobberedElementError(node) {
  return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);
}
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g;
function encodeEntities(value) {
  return value.replace(/&/g, "&amp;").replace(SURROGATE_PAIR_REGEXP, function(match2) {
    const hi = match2.charCodeAt(0);
    const low = match2.charCodeAt(1);
    return "&#" + ((hi - 55296) * 1024 + (low - 56320) + 65536) + ";";
  }).replace(NON_ALPHANUMERIC_REGEXP, function(match2) {
    return "&#" + match2.charCodeAt(0) + ";";
  }).replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
var inertBodyHelper;
function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
  let inertBodyElement = null;
  try {
    inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);
    let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : "";
    inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
    let mXSSAttempts = 5;
    let parsedHtml = unsafeHtml;
    do {
      if (mXSSAttempts === 0) {
        throw new Error("Failed to sanitize html because the input is unstable");
      }
      mXSSAttempts--;
      unsafeHtml = parsedHtml;
      parsedHtml = inertBodyElement.innerHTML;
      inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
    } while (unsafeHtml !== parsedHtml);
    const sanitizer = new SanitizingHtmlSerializer();
    const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
    if ((typeof ngDevMode === "undefined" || ngDevMode) && sanitizer.sanitizedSomething) {
      console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
    }
    return trustedHTMLFromString(safeHtml);
  } finally {
    if (inertBodyElement) {
      const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
      while (parent.firstChild) {
        parent.removeChild(parent.firstChild);
      }
    }
  }
}
function getTemplateContent(el) {
  return "content" in el && isTemplateElement(el) ? el.content : null;
}
function isTemplateElement(el) {
  return el.nodeType === Node.ELEMENT_NODE && el.nodeName === "TEMPLATE";
}
var SecurityContext;
(function(SecurityContext2) {
  SecurityContext2[SecurityContext2["NONE"] = 0] = "NONE";
  SecurityContext2[SecurityContext2["HTML"] = 1] = "HTML";
  SecurityContext2[SecurityContext2["STYLE"] = 2] = "STYLE";
  SecurityContext2[SecurityContext2["SCRIPT"] = 3] = "SCRIPT";
  SecurityContext2[SecurityContext2["URL"] = 4] = "URL";
  SecurityContext2[SecurityContext2["RESOURCE_URL"] = 5] = "RESOURCE_URL";
})(SecurityContext || (SecurityContext = {}));
function \u0275\u0275sanitizeHtml(unsafeHtml) {
  const sanitizer = getSanitizer();
  if (sanitizer) {
    return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || "");
  }
  if (allowSanitizationBypassAndThrow(
    unsafeHtml,
    "HTML"
    /* BypassType.Html */
  )) {
    return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
  }
  return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
}
function \u0275\u0275sanitizeStyle(unsafeStyle) {
  const sanitizer = getSanitizer();
  if (sanitizer) {
    return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || "";
  }
  if (allowSanitizationBypassAndThrow(
    unsafeStyle,
    "Style"
    /* BypassType.Style */
  )) {
    return unwrapSafeValue(unsafeStyle);
  }
  return renderStringify(unsafeStyle);
}
function \u0275\u0275sanitizeUrl(unsafeUrl) {
  const sanitizer = getSanitizer();
  if (sanitizer) {
    return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || "";
  }
  if (allowSanitizationBypassAndThrow(
    unsafeUrl,
    "URL"
    /* BypassType.Url */
  )) {
    return unwrapSafeValue(unsafeUrl);
  }
  return _sanitizeUrl(renderStringify(unsafeUrl));
}
function \u0275\u0275sanitizeResourceUrl(unsafeResourceUrl) {
  const sanitizer = getSanitizer();
  if (sanitizer) {
    return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || "");
  }
  if (allowSanitizationBypassAndThrow(
    unsafeResourceUrl,
    "ResourceURL"
    /* BypassType.ResourceUrl */
  )) {
    return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
  }
  throw new RuntimeError(904, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
}
function \u0275\u0275sanitizeScript(unsafeScript) {
  const sanitizer = getSanitizer();
  if (sanitizer) {
    return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || "");
  }
  if (allowSanitizationBypassAndThrow(
    unsafeScript,
    "Script"
    /* BypassType.Script */
  )) {
    return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
  }
  throw new RuntimeError(905, ngDevMode && "unsafe value used in a script context");
}
function \u0275\u0275trustConstantHtml(html) {
  if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {
    throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join("?")}`);
  }
  return trustedHTMLFromString(html[0]);
}
function \u0275\u0275trustConstantResourceUrl(url) {
  if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {
    throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join("?")}`);
  }
  return trustedScriptURLFromString(url[0]);
}
function getUrlSanitizer(tag, prop) {
  if (prop === "src" && (tag === "embed" || tag === "frame" || tag === "iframe" || tag === "media" || tag === "script") || prop === "href" && (tag === "base" || tag === "link")) {
    return \u0275\u0275sanitizeResourceUrl;
  }
  return \u0275\u0275sanitizeUrl;
}
function \u0275\u0275sanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
  return getUrlSanitizer(tag, prop)(unsafeUrl);
}
function validateAgainstEventProperties(name) {
  if (name.toLowerCase().startsWith("on")) {
    const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...
If '${name}' is a directive input, make sure the directive is imported by the current module.`;
    throw new RuntimeError(306, errorMessage);
  }
}
function validateAgainstEventAttributes(name) {
  if (name.toLowerCase().startsWith("on")) {
    const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, please use (${name.slice(2)})=...`;
    throw new RuntimeError(306, errorMessage);
  }
}
function getSanitizer() {
  const lView = getLView();
  return lView && lView[ENVIRONMENT].sanitizer;
}
var COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
var COMMENT_DELIMITER = /(<|>)/g;
var COMMENT_DELIMITER_ESCAPED = "\u200B$1\u200B";
function escapeCommentText(value) {
  return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
}
function normalizeDebugBindingName(name) {
  name = camelCaseToDashCase(name.replace(/[$@]/g, "_"));
  return `ng-reflect-${name}`;
}
var CAMEL_CASE_REGEXP = /([A-Z])/g;
function camelCaseToDashCase(input2) {
  return input2.replace(CAMEL_CASE_REGEXP, (...m) => "-" + m[1].toLowerCase());
}
function normalizeDebugBindingValue(value) {
  try {
    return value != null ? value.toString().slice(0, 30) : value;
  } catch (e) {
    return "[ERROR] Exception while trying to serialize the value";
  }
}
var CUSTOM_ELEMENTS_SCHEMA = {
  name: "custom-elements"
};
var NO_ERRORS_SCHEMA = {
  name: "no-errors-schema"
};
var shouldThrowErrorOnUnknownElement = false;
var shouldThrowErrorOnUnknownProperty = false;
function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
  if (schemas === null)
    return;
  if (!hasDirectives && tagName !== null) {
    const isUnknown = (
      // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
      // Domino doesn't expose HTMLUnknownElement globally.
      typeof HTMLUnknownElement !== "undefined" && HTMLUnknownElement && element instanceof HTMLUnknownElement || typeof customElements !== "undefined" && tagName.indexOf("-") > -1 && !customElements.get(tagName)
    );
    if (isUnknown && !matchingSchemas(schemas, tagName)) {
      const isHostStandalone = isHostComponentStandalone(lView);
      const templateLocation = getTemplateLocationDetails(lView);
      const schemas2 = `'${isHostStandalone ? "@Component" : "@NgModule"}.schemas'`;
      let message = `'${tagName}' is not a known element${templateLocation}:
`;
      message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? "included in the '@Component.imports' of this component" : "a part of an @NgModule where this component is declared"}.
`;
      if (tagName && tagName.indexOf("-") > -1) {
        message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas2} of this component to suppress this message.`;
      } else {
        message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas2} of this component.`;
      }
      if (shouldThrowErrorOnUnknownElement) {
        throw new RuntimeError(304, message);
      } else {
        console.error(formatRuntimeError(304, message));
      }
    }
  }
}
function isPropertyValid(element, propName, tagName, schemas) {
  if (schemas === null)
    return true;
  if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
    return true;
  }
  return typeof Node === "undefined" || Node === null || !(element instanceof Node);
}
function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
  if (!tagName && nodeType === 4) {
    tagName = "ng-template";
  }
  const isHostStandalone = isHostComponentStandalone(lView);
  const templateLocation = getTemplateLocationDetails(lView);
  let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
  const schemas = `'${isHostStandalone ? "@Component" : "@NgModule"}.schemas'`;
  const importLocation = isHostStandalone ? "included in the '@Component.imports' of this component" : "a part of an @NgModule where this component is declared";
  if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
    const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
    message += `
If the '${propName}' is an Angular control flow directive, please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
  } else {
    message += `
1. If '${tagName}' is an Angular component and it has the '${propName}' input, then verify that it is ${importLocation}.`;
    if (tagName && tagName.indexOf("-") > -1) {
      message += `
2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
      message += `
3. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
    } else {
      message += `
2. To allow any property add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
    }
  }
  reportUnknownPropertyError(message);
}
function reportUnknownPropertyError(message) {
  if (shouldThrowErrorOnUnknownProperty) {
    throw new RuntimeError(303, message);
  } else {
    console.error(formatRuntimeError(303, message));
  }
}
function getDeclarationComponentDef(lView) {
  !ngDevMode && throwError2("Must never be called in production mode");
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
  const context2 = declarationLView[CONTEXT];
  if (!context2)
    return null;
  return context2.constructor ? getComponentDef(context2.constructor) : null;
}
function isHostComponentStandalone(lView) {
  !ngDevMode && throwError2("Must never be called in production mode");
  const componentDef = getDeclarationComponentDef(lView);
  return !!componentDef?.standalone;
}
function getTemplateLocationDetails(lView) {
  !ngDevMode && throwError2("Must never be called in production mode");
  const hostComponentDef = getDeclarationComponentDef(lView);
  const componentClassName = hostComponentDef?.type?.name;
  return componentClassName ? ` (used in the '${componentClassName}' component template)` : "";
}
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
  ["ngIf", "NgIf"],
  ["ngFor", "NgFor"],
  ["ngSwitchCase", "NgSwitchCase"],
  ["ngSwitchDefault", "NgSwitchDefault"]
]);
function matchingSchemas(schemas, tagName) {
  if (schemas !== null) {
    for (let i2 = 0; i2 < schemas.length; i2++) {
      const schema = schemas[i2];
      if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf("-") > -1) {
        return true;
      }
    }
  }
  return false;
}
function \u0275\u0275resolveWindow(element) {
  return element.ownerDocument.defaultView;
}
function \u0275\u0275resolveDocument(element) {
  return element.ownerDocument;
}
function \u0275\u0275resolveBody(element) {
  return element.ownerDocument.body;
}
var INTERPOLATION_DELIMITER = `\uFFFD`;
function maybeUnwrapFn(value) {
  if (value instanceof Function) {
    return value();
  } else {
    return value;
  }
}
function isPlatformBrowser(injector) {
  return (injector ?? inject(Injector)).get(PLATFORM_ID) === "browser";
}
var VALUE_STRING_LENGTH_LIMIT = 200;
function throwMultipleComponentError(tNode, first2, second) {
  throw new RuntimeError(-300, `Multiple components match node with tagname ${tNode.value}: ${stringifyForError(first2)} and ${stringifyForError(second)}`);
}
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {
  const hostComponentDef = getDeclarationComponentDef(lView);
  const componentClassName = hostComponentDef?.type?.name;
  const field = propName ? ` for '${propName}'` : "";
  let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ""}`;
  if (creationMode) {
    msg += ` It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook?`;
  }
  throw new RuntimeError(-100, msg);
}
function formatValue(value) {
  let strValue = String(value);
  try {
    if (Array.isArray(value) || strValue === "[object Object]") {
      strValue = JSON.stringify(value);
    }
  } catch (error3) {
  }
  return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + "\u2026" : strValue;
}
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
  const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
  let oldValue = prefix, newValue = prefix;
  for (let i2 = 0; i2 < chunks.length; i2++) {
    const slotIdx = rootIndex + i2;
    oldValue += `${lView[slotIdx]}${chunks[i2]}`;
    newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i2]}`;
  }
  return { propName, oldValue, newValue };
}
function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {
  const tData = lView[TVIEW].data;
  const metadata = tData[bindingIndex];
  if (typeof metadata === "string") {
    if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {
      return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);
    }
    return { propName: metadata, oldValue, newValue };
  }
  if (metadata === null) {
    let idx = bindingIndex - 1;
    while (typeof tData[idx] !== "string" && tData[idx + 1] === null) {
      idx--;
    }
    const meta = tData[idx];
    if (typeof meta === "string") {
      const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, "g"));
      if (matches && matches.length - 1 > bindingIndex - idx) {
        return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);
      }
    }
  }
  return { propName: void 0, oldValue, newValue };
}
var RendererStyleFlags2;
(function(RendererStyleFlags22) {
  RendererStyleFlags22[RendererStyleFlags22["Important"] = 1] = "Important";
  RendererStyleFlags22[RendererStyleFlags22["DashCase"] = 2] = "DashCase";
})(RendererStyleFlags2 || (RendererStyleFlags2 = {}));
var _icuContainerIterate;
function icuContainerIterate(tIcuContainerNode, lView) {
  return _icuContainerIterate(tIcuContainerNode, lView);
}
function ensureIcuContainerVisitorLoaded(loader) {
  if (_icuContainerIterate === void 0) {
    _icuContainerIterate = loader();
  }
}
function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, beforeNode) {
  if (lNodeToHandle != null) {
    let lContainer;
    let isComponent2 = false;
    if (isLContainer(lNodeToHandle)) {
      lContainer = lNodeToHandle;
    } else if (isLView(lNodeToHandle)) {
      isComponent2 = true;
      ngDevMode && assertDefined(lNodeToHandle[HOST], "HOST must be defined for a component LView");
      lNodeToHandle = lNodeToHandle[HOST];
    }
    const rNode = unwrapRNode(lNodeToHandle);
    if (action === 0 && parent !== null) {
      if (beforeNode == null) {
        nativeAppendChild(renderer, parent, rNode);
      } else {
        nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
      }
    } else if (action === 1 && parent !== null) {
      nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
    } else if (action === 2) {
      nativeRemoveNode(renderer, rNode, isComponent2);
    } else if (action === 3) {
      ngDevMode && ngDevMode.rendererDestroyNode++;
      renderer.destroyNode(rNode);
    }
    if (lContainer != null) {
      applyContainer(renderer, action, lContainer, parent, beforeNode);
    }
  }
}
function createTextNode(renderer, value) {
  ngDevMode && ngDevMode.rendererCreateTextNode++;
  ngDevMode && ngDevMode.rendererSetText++;
  return renderer.createText(value);
}
function updateTextNode(renderer, rNode, value) {
  ngDevMode && ngDevMode.rendererSetText++;
  renderer.setValue(rNode, value);
}
function createCommentNode(renderer, value) {
  ngDevMode && ngDevMode.rendererCreateComment++;
  return renderer.createComment(escapeCommentText(value));
}
function createElementNode(renderer, name, namespace) {
  ngDevMode && ngDevMode.rendererCreateElement++;
  return renderer.createElement(name, namespace);
}
function removeViewFromDOM(tView, lView) {
  detachViewFromDOM(tView, lView);
  lView[HOST] = null;
  lView[T_HOST] = null;
}
function addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {
  lView[HOST] = parentNativeNode;
  lView[T_HOST] = parentTNode;
  applyView(tView, lView, renderer, 1, parentNativeNode, beforeNode);
}
function detachViewFromDOM(tView, lView) {
  lView[ENVIRONMENT].changeDetectionScheduler?.notify(
    8
    /* NotificationSource.ViewDetachedFromDOM */
  );
  applyView(tView, lView, lView[RENDERER], 2, null, null);
}
function destroyViewTree(rootView) {
  let lViewOrLContainer = rootView[CHILD_HEAD];
  if (!lViewOrLContainer) {
    return cleanUpView(rootView[TVIEW], rootView);
  }
  while (lViewOrLContainer) {
    let next = null;
    if (isLView(lViewOrLContainer)) {
      next = lViewOrLContainer[CHILD_HEAD];
    } else {
      ngDevMode && assertLContainer(lViewOrLContainer);
      const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];
      if (firstView)
        next = firstView;
    }
    if (!next) {
      while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {
        if (isLView(lViewOrLContainer)) {
          cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
        }
        lViewOrLContainer = lViewOrLContainer[PARENT];
      }
      if (lViewOrLContainer === null)
        lViewOrLContainer = rootView;
      if (isLView(lViewOrLContainer)) {
        cleanUpView(lViewOrLContainer[TVIEW], lViewOrLContainer);
      }
      next = lViewOrLContainer && lViewOrLContainer[NEXT];
    }
    lViewOrLContainer = next;
  }
}
function insertView(tView, lView, lContainer, index) {
  ngDevMode && assertLView(lView);
  ngDevMode && assertLContainer(lContainer);
  const indexInContainer = CONTAINER_HEADER_OFFSET + index;
  const containerLength = lContainer.length;
  if (index > 0) {
    lContainer[indexInContainer - 1][NEXT] = lView;
  }
  if (index < containerLength - CONTAINER_HEADER_OFFSET) {
    lView[NEXT] = lContainer[indexInContainer];
    addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);
  } else {
    lContainer.push(lView);
    lView[NEXT] = null;
  }
  lView[PARENT] = lContainer;
  const declarationLContainer = lView[DECLARATION_LCONTAINER];
  if (declarationLContainer !== null && lContainer !== declarationLContainer) {
    trackMovedView(declarationLContainer, lView);
  }
  const lQueries = lView[QUERIES];
  if (lQueries !== null) {
    lQueries.insertView(tView);
  }
  updateAncestorTraversalFlagsOnAttach(lView);
  lView[FLAGS] |= 128;
}
function trackMovedView(declarationContainer, lView) {
  ngDevMode && assertDefined(lView, "LView required");
  ngDevMode && assertLContainer(declarationContainer);
  const movedViews = declarationContainer[MOVED_VIEWS];
  const parent = lView[PARENT];
  ngDevMode && assertDefined(parent, "missing parent");
  if (isLView(parent)) {
    declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
  } else {
    const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];
    ngDevMode && assertDefined(insertedComponentLView, "Missing insertedComponentLView");
    const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];
    ngDevMode && assertDefined(declaredComponentLView, "Missing declaredComponentLView");
    if (declaredComponentLView !== insertedComponentLView) {
      declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
    }
  }
  if (movedViews === null) {
    declarationContainer[MOVED_VIEWS] = [lView];
  } else {
    movedViews.push(lView);
  }
}
function detachMovedView(declarationContainer, lView) {
  ngDevMode && assertLContainer(declarationContainer);
  ngDevMode && assertDefined(declarationContainer[MOVED_VIEWS], "A projected view should belong to a non-empty projected views collection");
  const movedViews = declarationContainer[MOVED_VIEWS];
  const declarationViewIndex = movedViews.indexOf(lView);
  movedViews.splice(declarationViewIndex, 1);
}
function detachView(lContainer, removeIndex) {
  if (lContainer.length <= CONTAINER_HEADER_OFFSET)
    return;
  const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;
  const viewToDetach = lContainer[indexInContainer];
  if (viewToDetach) {
    const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];
    if (declarationLContainer !== null && declarationLContainer !== lContainer) {
      detachMovedView(declarationLContainer, viewToDetach);
    }
    if (removeIndex > 0) {
      lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];
    }
    const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);
    removeViewFromDOM(viewToDetach[TVIEW], viewToDetach);
    const lQueries = removedLView[QUERIES];
    if (lQueries !== null) {
      lQueries.detachView(removedLView[TVIEW]);
    }
    viewToDetach[PARENT] = null;
    viewToDetach[NEXT] = null;
    viewToDetach[FLAGS] &= ~128;
  }
  return viewToDetach;
}
function destroyLView(tView, lView) {
  if (!(lView[FLAGS] & 256)) {
    const renderer = lView[RENDERER];
    if (renderer.destroyNode) {
      applyView(tView, lView, renderer, 3, null, null);
    }
    destroyViewTree(lView);
  }
}
function cleanUpView(tView, lView) {
  if (lView[FLAGS] & 256) {
    return;
  }
  const prevConsumer = setActiveConsumer(null);
  try {
    lView[FLAGS] &= ~128;
    lView[FLAGS] |= 256;
    lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);
    executeOnDestroys(tView, lView);
    processCleanups(tView, lView);
    if (lView[TVIEW].type === 1) {
      ngDevMode && ngDevMode.rendererDestroy++;
      lView[RENDERER].destroy();
    }
    const declarationContainer = lView[DECLARATION_LCONTAINER];
    if (declarationContainer !== null && isLContainer(lView[PARENT])) {
      if (declarationContainer !== lView[PARENT]) {
        detachMovedView(declarationContainer, lView);
      }
      const lQueries = lView[QUERIES];
      if (lQueries !== null) {
        lQueries.detachView(tView);
      }
    }
    unregisterLView(lView);
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
function processCleanups(tView, lView) {
  ngDevMode && assertNotReactive(processCleanups.name);
  const tCleanup = tView.cleanup;
  const lCleanup = lView[CLEANUP];
  if (tCleanup !== null) {
    for (let i2 = 0; i2 < tCleanup.length - 1; i2 += 2) {
      if (typeof tCleanup[i2] === "string") {
        const targetIdx = tCleanup[i2 + 3];
        ngDevMode && assertNumber(targetIdx, "cleanup target must be a number");
        if (targetIdx >= 0) {
          lCleanup[targetIdx]();
        } else {
          lCleanup[-targetIdx].unsubscribe();
        }
        i2 += 2;
      } else {
        const context2 = lCleanup[tCleanup[i2 + 1]];
        tCleanup[i2].call(context2);
      }
    }
  }
  if (lCleanup !== null) {
    lView[CLEANUP] = null;
  }
  const destroyHooks = lView[ON_DESTROY_HOOKS];
  if (destroyHooks !== null) {
    lView[ON_DESTROY_HOOKS] = null;
    for (let i2 = 0; i2 < destroyHooks.length; i2++) {
      const destroyHooksFn = destroyHooks[i2];
      ngDevMode && assertFunction(destroyHooksFn, "Expecting destroy hook to be a function.");
      destroyHooksFn();
    }
  }
}
function executeOnDestroys(tView, lView) {
  ngDevMode && assertNotReactive(executeOnDestroys.name);
  let destroyHooks;
  if (tView != null && (destroyHooks = tView.destroyHooks) != null) {
    for (let i2 = 0; i2 < destroyHooks.length; i2 += 2) {
      const context2 = lView[destroyHooks[i2]];
      if (!(context2 instanceof NodeInjectorFactory)) {
        const toCall = destroyHooks[i2 + 1];
        if (Array.isArray(toCall)) {
          for (let j = 0; j < toCall.length; j += 2) {
            const callContext = context2[toCall[j]];
            const hook = toCall[j + 1];
            profiler(4, callContext, hook);
            try {
              hook.call(callContext);
            } finally {
              profiler(5, callContext, hook);
            }
          }
        } else {
          profiler(4, context2, toCall);
          try {
            toCall.call(context2);
          } finally {
            profiler(5, context2, toCall);
          }
        }
      }
    }
  }
}
function getParentRElement(tView, tNode, lView) {
  return getClosestRElement(tView, tNode.parent, lView);
}
function getClosestRElement(tView, tNode, lView) {
  let parentTNode = tNode;
  while (parentTNode !== null && parentTNode.type & (8 | 32)) {
    tNode = parentTNode;
    parentTNode = tNode.parent;
  }
  if (parentTNode === null) {
    return lView[HOST];
  } else {
    ngDevMode && assertTNodeType(
      parentTNode,
      3 | 4
      /* TNodeType.Container */
    );
    const { componentOffset } = parentTNode;
    if (componentOffset > -1) {
      ngDevMode && assertTNodeForLView(parentTNode, lView);
      const { encapsulation } = tView.data[parentTNode.directiveStart + componentOffset];
      if (encapsulation === ViewEncapsulation$1.None || encapsulation === ViewEncapsulation$1.Emulated) {
        return null;
      }
    }
    return getNativeByTNode(parentTNode, lView);
  }
}
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
  ngDevMode && ngDevMode.rendererInsertBefore++;
  renderer.insertBefore(parent, child, beforeNode, isMove);
}
function nativeAppendChild(renderer, parent, child) {
  ngDevMode && ngDevMode.rendererAppendChild++;
  ngDevMode && assertDefined(parent, "parent node must be defined");
  renderer.appendChild(parent, child);
}
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
  if (beforeNode !== null) {
    nativeInsertBefore(renderer, parent, child, beforeNode, isMove);
  } else {
    nativeAppendChild(renderer, parent, child);
  }
}
function nativeRemoveChild(renderer, parent, child, isHostElement) {
  renderer.removeChild(parent, child, isHostElement);
}
function nativeParentNode(renderer, node) {
  return renderer.parentNode(node);
}
function nativeNextSibling(renderer, node) {
  return renderer.nextSibling(node);
}
function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {
  return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);
}
function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {
  if (parentTNode.type & (8 | 32)) {
    return getNativeByTNode(parentTNode, lView);
  }
  return null;
}
var _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;
var _processI18nInsertBefore;
function setI18nHandling(getInsertInFrontOfRNodeWithI18n2, processI18nInsertBefore2) {
  _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n2;
  _processI18nInsertBefore = processI18nInsertBefore2;
}
function appendChild(tView, lView, childRNode, childTNode) {
  const parentRNode = getParentRElement(tView, childTNode, lView);
  const renderer = lView[RENDERER];
  const parentTNode = childTNode.parent || lView[T_HOST];
  const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);
  if (parentRNode != null) {
    if (Array.isArray(childRNode)) {
      for (let i2 = 0; i2 < childRNode.length; i2++) {
        nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i2], anchorNode, false);
      }
    } else {
      nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);
    }
  }
  _processI18nInsertBefore !== void 0 && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);
}
function getFirstNativeNode(lView, tNode) {
  if (tNode !== null) {
    ngDevMode && assertTNodeType(
      tNode,
      3 | 12 | 32 | 16
      /* TNodeType.Projection */
    );
    const tNodeType = tNode.type;
    if (tNodeType & 3) {
      return getNativeByTNode(tNode, lView);
    } else if (tNodeType & 4) {
      return getBeforeNodeForView(-1, lView[tNode.index]);
    } else if (tNodeType & 8) {
      const elIcuContainerChild = tNode.child;
      if (elIcuContainerChild !== null) {
        return getFirstNativeNode(lView, elIcuContainerChild);
      } else {
        const rNodeOrLContainer = lView[tNode.index];
        if (isLContainer(rNodeOrLContainer)) {
          return getBeforeNodeForView(-1, rNodeOrLContainer);
        } else {
          return unwrapRNode(rNodeOrLContainer);
        }
      }
    } else if (tNodeType & 32) {
      let nextRNode = icuContainerIterate(tNode, lView);
      let rNode = nextRNode();
      return rNode || unwrapRNode(lView[tNode.index]);
    } else {
      const projectionNodes = getProjectionNodes(lView, tNode);
      if (projectionNodes !== null) {
        if (Array.isArray(projectionNodes)) {
          return projectionNodes[0];
        }
        const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
        ngDevMode && assertParentView(parentView);
        return getFirstNativeNode(parentView, projectionNodes);
      } else {
        return getFirstNativeNode(lView, tNode.next);
      }
    }
  }
  return null;
}
function getProjectionNodes(lView, tNode) {
  if (tNode !== null) {
    const componentView = lView[DECLARATION_COMPONENT_VIEW];
    const componentHost = componentView[T_HOST];
    const slotIdx = tNode.projection;
    ngDevMode && assertProjectionSlots(lView);
    return componentHost.projection[slotIdx];
  }
  return null;
}
function getBeforeNodeForView(viewIndexInContainer, lContainer) {
  const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;
  if (nextViewIndex < lContainer.length) {
    const lView = lContainer[nextViewIndex];
    const firstTNodeOfView = lView[TVIEW].firstChild;
    if (firstTNodeOfView !== null) {
      return getFirstNativeNode(lView, firstTNodeOfView);
    }
  }
  return lContainer[NATIVE];
}
function nativeRemoveNode(renderer, rNode, isHostElement) {
  ngDevMode && ngDevMode.rendererRemoveNode++;
  const nativeParent = nativeParentNode(renderer, rNode);
  if (nativeParent) {
    nativeRemoveChild(renderer, nativeParent, rNode, isHostElement);
  }
}
function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {
  while (tNode != null) {
    ngDevMode && assertTNodeForLView(tNode, lView);
    ngDevMode && assertTNodeType(
      tNode,
      3 | 12 | 16 | 32
      /* TNodeType.Icu */
    );
    const rawSlotValue = lView[tNode.index];
    const tNodeType = tNode.type;
    if (isProjection) {
      if (action === 0) {
        rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);
        tNode.flags |= 2;
      }
    }
    if ((tNode.flags & 32) !== 32) {
      if (tNodeType & 8) {
        applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);
        applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
      } else if (tNodeType & 32) {
        const nextRNode = icuContainerIterate(tNode, lView);
        let rNode;
        while (rNode = nextRNode()) {
          applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
        }
        applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
      } else if (tNodeType & 16) {
        applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);
      } else {
        ngDevMode && assertTNodeType(
          tNode,
          3 | 4
          /* TNodeType.Container */
        );
        applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
      }
    }
    tNode = isProjection ? tNode.projectionNext : tNode.next;
  }
}
function applyView(tView, lView, renderer, action, parentRElement, beforeNode) {
  applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);
}
function applyProjection(tView, lView, tProjectionNode) {
  const renderer = lView[RENDERER];
  const parentRNode = getParentRElement(tView, tProjectionNode, lView);
  const parentTNode = tProjectionNode.parent || lView[T_HOST];
  let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);
  applyProjectionRecursive(renderer, 0, lView, tProjectionNode, parentRNode, beforeNode);
}
function applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {
  const componentLView = lView[DECLARATION_COMPONENT_VIEW];
  const componentNode = componentLView[T_HOST];
  ngDevMode && assertEqual(typeof tProjectionNode.projection, "number", "expecting projection index");
  const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];
  if (Array.isArray(nodeToProjectOrRNodes)) {
    for (let i2 = 0; i2 < nodeToProjectOrRNodes.length; i2++) {
      const rNode = nodeToProjectOrRNodes[i2];
      applyToElementOrContainer(action, renderer, parentRElement, rNode, beforeNode);
    }
  } else {
    let nodeToProject = nodeToProjectOrRNodes;
    const projectedComponentLView = componentLView[PARENT];
    if (hasInSkipHydrationBlockFlag(tProjectionNode)) {
      nodeToProject.flags |= 128;
    }
    applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);
  }
}
function applyContainer(renderer, action, lContainer, parentRElement, beforeNode) {
  ngDevMode && assertLContainer(lContainer);
  const anchor2 = lContainer[NATIVE];
  const native = unwrapRNode(lContainer);
  if (anchor2 !== native) {
    applyToElementOrContainer(action, renderer, parentRElement, anchor2, beforeNode);
  }
  for (let i2 = CONTAINER_HEADER_OFFSET; i2 < lContainer.length; i2++) {
    const lView = lContainer[i2];
    applyView(lView[TVIEW], lView, renderer, action, parentRElement, anchor2);
  }
}
function applyStyling(renderer, isClassBased, rNode, prop, value) {
  if (isClassBased) {
    if (!value) {
      ngDevMode && ngDevMode.rendererRemoveClass++;
      renderer.removeClass(rNode, prop);
    } else {
      ngDevMode && ngDevMode.rendererAddClass++;
      renderer.addClass(rNode, prop);
    }
  } else {
    let flags = prop.indexOf("-") === -1 ? void 0 : RendererStyleFlags2.DashCase;
    if (value == null) {
      ngDevMode && ngDevMode.rendererRemoveStyle++;
      renderer.removeStyle(rNode, prop, flags);
    } else {
      const isImportant = typeof value === "string" ? value.endsWith("!important") : false;
      if (isImportant) {
        value = value.slice(0, -10);
        flags |= RendererStyleFlags2.Important;
      }
      ngDevMode && ngDevMode.rendererSetStyle++;
      renderer.setStyle(rNode, prop, value, flags);
    }
  }
}
function writeDirectStyle(renderer, element, newValue) {
  ngDevMode && assertString(newValue, "'newValue' should be a string");
  renderer.setAttribute(element, "style", newValue);
  ngDevMode && ngDevMode.rendererSetStyle++;
}
function writeDirectClass(renderer, element, newValue) {
  ngDevMode && assertString(newValue, "'newValue' should be a string");
  if (newValue === "") {
    renderer.removeAttribute(element, "class");
  } else {
    renderer.setAttribute(element, "class", newValue);
  }
  ngDevMode && ngDevMode.rendererSetClassName++;
}
function setupStaticAttributes(renderer, element, tNode) {
  const { mergedAttrs, classes, styles } = tNode;
  if (mergedAttrs !== null) {
    setUpAttributes(renderer, element, mergedAttrs);
  }
  if (classes !== null) {
    writeDirectClass(renderer, element, classes);
  }
  if (styles !== null) {
    writeDirectStyle(renderer, element, styles);
  }
}
var NO_CHANGE = typeof ngDevMode === "undefined" || ngDevMode ? { __brand__: "NO_CHANGE" } : {};
function \u0275\u0275advance(delta = 1) {
  ngDevMode && assertGreaterThan(delta, 0, "Can only advance forward");
  selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());
}
function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
  ngDevMode && assertIndexInDeclRange(lView[TVIEW], index);
  if (!checkNoChangesMode) {
    const hooksInitPhaseCompleted = (lView[FLAGS] & 3) === 3;
    if (hooksInitPhaseCompleted) {
      const preOrderCheckHooks = tView.preOrderCheckHooks;
      if (preOrderCheckHooks !== null) {
        executeCheckHooks(lView, preOrderCheckHooks, index);
      }
    } else {
      const preOrderHooks = tView.preOrderHooks;
      if (preOrderHooks !== null) {
        executeInitAndCheckHooks(lView, preOrderHooks, 0, index);
      }
    }
  }
  setSelectedIndex(index);
}
function \u0275\u0275directiveInject(token, flags = InjectFlags.Default) {
  const lView = getLView();
  if (lView === null) {
    ngDevMode && assertInjectImplementationNotEqual(\u0275\u0275directiveInject);
    return \u0275\u0275inject(token, flags);
  }
  const tNode = getCurrentTNode();
  const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
  ngDevMode && emitInjectEvent(token, value, flags);
  return value;
}
function \u0275\u0275invalidFactory() {
  const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : "invalid";
  throw new Error(msg);
}
function writeToDirectiveInput(def, instance, publicName, privateName, flags, value) {
  const prevConsumer = setActiveConsumer(null);
  try {
    let inputSignalNode = null;
    if ((flags & InputFlags.SignalBased) !== 0) {
      const field = instance[privateName];
      inputSignalNode = field[SIGNAL];
    }
    if (inputSignalNode !== null && inputSignalNode.transformFn !== void 0) {
      value = inputSignalNode.transformFn(value);
    }
    if ((flags & InputFlags.HasDecoratorInputTransform) !== 0) {
      value = def.inputTransforms[privateName].call(instance, value);
    }
    if (def.setInput !== null) {
      def.setInput(instance, inputSignalNode, value, publicName, privateName);
    } else {
      applyValueToInputField(instance, inputSignalNode, privateName, value);
    }
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
function processHostBindingOpCodes(tView, lView) {
  const hostBindingOpCodes = tView.hostBindingOpCodes;
  if (hostBindingOpCodes === null)
    return;
  try {
    for (let i2 = 0; i2 < hostBindingOpCodes.length; i2++) {
      const opCode = hostBindingOpCodes[i2];
      if (opCode < 0) {
        setSelectedIndex(~opCode);
      } else {
        const directiveIdx = opCode;
        const bindingRootIndx = hostBindingOpCodes[++i2];
        const hostBindingFn = hostBindingOpCodes[++i2];
        setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
        const context2 = lView[directiveIdx];
        hostBindingFn(2, context2);
      }
    }
  } finally {
    setSelectedIndex(-1);
  }
}
function createLView(parentLView, tView, context2, flags, host, tHostNode, environment2, renderer, injector, embeddedViewInjector, hydrationInfo) {
  const lView = tView.blueprint.slice();
  lView[HOST] = host;
  lView[FLAGS] = flags | 4 | 128 | 8 | 64;
  if (embeddedViewInjector !== null || parentLView && parentLView[FLAGS] & 2048) {
    lView[FLAGS] |= 2048;
  }
  resetPreOrderHookFlags(lView);
  ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
  lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;
  lView[CONTEXT] = context2;
  lView[ENVIRONMENT] = environment2 || parentLView && parentLView[ENVIRONMENT];
  ngDevMode && assertDefined(lView[ENVIRONMENT], "LViewEnvironment is required");
  lView[RENDERER] = renderer || parentLView && parentLView[RENDERER];
  ngDevMode && assertDefined(lView[RENDERER], "Renderer is required");
  lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;
  lView[T_HOST] = tHostNode;
  lView[ID] = getUniqueLViewId();
  lView[HYDRATION] = hydrationInfo;
  lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
  ngDevMode && assertEqual(tView.type == 2 ? parentLView !== null : true, true, "Embedded views must have parentLView");
  lView[DECLARATION_COMPONENT_VIEW] = tView.type == 2 ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
  return lView;
}
function getOrCreateTNode(tView, index, type, name, attrs) {
  ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
  // `view_engine_compatibility` for additional context.
  assertGreaterThanOrEqual(index, HEADER_OFFSET, "TNodes can't be in the LView header.");
  ngDevMode && assertPureTNodeType(type);
  let tNode = tView.data[index];
  if (tNode === null) {
    tNode = createTNodeAtIndex(tView, index, type, name, attrs);
    if (isInI18nBlock()) {
      tNode.flags |= 32;
    }
  } else if (tNode.type & 64) {
    tNode.type = type;
    tNode.value = name;
    tNode.attrs = attrs;
    const parent = getCurrentParentTNode();
    tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;
    ngDevMode && assertTNodeForTView(tNode, tView);
    ngDevMode && assertEqual(index, tNode.index, "Expecting same index");
  }
  setCurrentTNode(tNode, true);
  return tNode;
}
function createTNodeAtIndex(tView, index, type, name, attrs) {
  const currentTNode = getCurrentTNodePlaceholderOk();
  const isParent = isCurrentTNodeParent();
  const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;
  const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs);
  if (tView.firstChild === null) {
    tView.firstChild = tNode;
  }
  if (currentTNode !== null) {
    if (isParent) {
      if (currentTNode.child == null && tNode.parent !== null) {
        currentTNode.child = tNode;
      }
    } else {
      if (currentTNode.next === null) {
        currentTNode.next = tNode;
        tNode.prev = currentTNode;
      }
    }
  }
  return tNode;
}
function allocExpando(tView, lView, numSlotsToAlloc, initialValue) {
  if (numSlotsToAlloc === 0)
    return -1;
  if (ngDevMode) {
    assertFirstCreatePass(tView);
    assertSame(tView, lView[TVIEW], "`LView` must be associated with `TView`!");
    assertEqual(tView.data.length, lView.length, "Expecting LView to be same size as TView");
    assertEqual(tView.data.length, tView.blueprint.length, "Expecting Blueprint to be same size as TView");
    assertFirstUpdatePass(tView);
  }
  const allocIdx = lView.length;
  for (let i2 = 0; i2 < numSlotsToAlloc; i2++) {
    lView.push(initialValue);
    tView.blueprint.push(initialValue);
    tView.data.push(null);
  }
  return allocIdx;
}
function executeTemplate(tView, lView, templateFn, rf, context2) {
  const prevSelectedIndex = getSelectedIndex();
  const isUpdatePhase = rf & 2;
  try {
    setSelectedIndex(-1);
    if (isUpdatePhase && lView.length > HEADER_OFFSET) {
      selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());
    }
    const preHookType = isUpdatePhase ? 2 : 0;
    profiler(preHookType, context2);
    templateFn(rf, context2);
  } finally {
    setSelectedIndex(prevSelectedIndex);
    const postHookType = isUpdatePhase ? 3 : 1;
    profiler(postHookType, context2);
  }
}
function executeContentQueries(tView, tNode, lView) {
  if (isContentQueryHost(tNode)) {
    const prevConsumer = setActiveConsumer(null);
    try {
      const start2 = tNode.directiveStart;
      const end = tNode.directiveEnd;
      for (let directiveIndex = start2; directiveIndex < end; directiveIndex++) {
        const def = tView.data[directiveIndex];
        if (def.contentQueries) {
          const directiveInstance = lView[directiveIndex];
          ngDevMode && assertDefined(directiveIndex, "Incorrect reference to a directive defining a content query");
          def.contentQueries(1, directiveInstance, directiveIndex);
        }
      }
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
}
function createDirectivesInstances(tView, lView, tNode) {
  if (!getBindingsEnabled())
    return;
  instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));
  if ((tNode.flags & 64) === 64) {
    invokeDirectivesHostBindings(tView, lView, tNode);
  }
}
function saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {
  const localNames = tNode.localNames;
  if (localNames !== null) {
    let localIndex = tNode.index + 1;
    for (let i2 = 0; i2 < localNames.length; i2 += 2) {
      const index = localNames[i2 + 1];
      const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];
      viewData[localIndex++] = value;
    }
  }
}
function getOrCreateComponentTView(def) {
  const tView = def.tView;
  if (tView === null || tView.incompleteFirstPass) {
    const declTNode = null;
    return def.tView = createTView(1, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id);
  }
  return tView;
}
function createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {
  ngDevMode && ngDevMode.tView++;
  const bindingStartIndex = HEADER_OFFSET + decls;
  const initialViewLength = bindingStartIndex + vars;
  const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
  const consts = typeof constsOrFactory === "function" ? constsOrFactory() : constsOrFactory;
  const tView = blueprint[TVIEW] = {
    type,
    blueprint,
    template: templateFn,
    queries: null,
    viewQuery,
    declTNode,
    data: blueprint.slice().fill(null, bindingStartIndex),
    bindingStartIndex,
    expandoStartIndex: initialViewLength,
    hostBindingOpCodes: null,
    firstCreatePass: true,
    firstUpdatePass: true,
    staticViewQueries: false,
    staticContentQueries: false,
    preOrderHooks: null,
    preOrderCheckHooks: null,
    contentHooks: null,
    contentCheckHooks: null,
    viewHooks: null,
    viewCheckHooks: null,
    destroyHooks: null,
    cleanup: null,
    contentQueries: null,
    components: null,
    directiveRegistry: typeof directives === "function" ? directives() : directives,
    pipeRegistry: typeof pipes === "function" ? pipes() : pipes,
    firstChild: null,
    schemas,
    consts,
    incompleteFirstPass: false,
    ssrId
  };
  if (ngDevMode) {
    Object.seal(tView);
  }
  return tView;
}
function createViewBlueprint(bindingStartIndex, initialViewLength) {
  const blueprint = [];
  for (let i2 = 0; i2 < initialViewLength; i2++) {
    blueprint.push(i2 < bindingStartIndex ? null : NO_CHANGE);
  }
  return blueprint;
}
function locateHostElement(renderer, elementOrSelector, encapsulation, injector) {
  const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);
  const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation$1.ShadowDom;
  const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);
  applyRootElementTransform(rootElement);
  return rootElement;
}
function applyRootElementTransform(rootElement) {
  _applyRootElementTransformImpl(rootElement);
}
var _applyRootElementTransformImpl = () => null;
function storeCleanupWithContext(tView, lView, context2, cleanupFn) {
  const lCleanup = getOrCreateLViewCleanup(lView);
  ngDevMode && assertDefined(context2, "Cleanup context is mandatory when registering framework-level destroy hooks");
  lCleanup.push(context2);
  if (tView.firstCreatePass) {
    getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
  } else {
    if (ngDevMode) {
      Object.freeze(getOrCreateTViewCleanup(tView));
    }
  }
}
function createTNode(tView, tParent, type, index, value, attrs) {
  ngDevMode && index !== 0 && // 0 are bogus nodes and they are OK. See `createContainerRef` in
  // `view_engine_compatibility` for additional context.
  assertGreaterThanOrEqual(index, HEADER_OFFSET, "TNodes can't be in the LView header.");
  ngDevMode && assertNotSame(attrs, void 0, "'undefined' is not valid value for 'attrs'");
  ngDevMode && ngDevMode.tNode++;
  ngDevMode && tParent && assertTNodeForTView(tParent, tView);
  let injectorIndex = tParent ? tParent.injectorIndex : -1;
  let flags = 0;
  if (isInSkipHydrationBlock$1()) {
    flags |= 128;
  }
  const tNode = {
    type,
    index,
    insertBeforeIndex: null,
    injectorIndex,
    directiveStart: -1,
    directiveEnd: -1,
    directiveStylingLast: -1,
    componentOffset: -1,
    propertyBindings: null,
    flags,
    providerIndexes: 0,
    value,
    attrs,
    mergedAttrs: null,
    localNames: null,
    initialInputs: void 0,
    inputs: null,
    outputs: null,
    tView: null,
    next: null,
    prev: null,
    projectionNext: null,
    child: null,
    parent: tParent,
    projection: null,
    styles: null,
    stylesWithoutHost: null,
    residualStyles: void 0,
    classes: null,
    classesWithoutHost: null,
    residualClasses: void 0,
    classBindings: 0,
    styleBindings: 0
  };
  if (ngDevMode) {
    Object.seal(tNode);
  }
  return tNode;
}
function captureNodeBindings(mode, aliasMap, directiveIndex, bindingsResult, hostDirectiveAliasMap) {
  for (let publicName in aliasMap) {
    if (!aliasMap.hasOwnProperty(publicName)) {
      continue;
    }
    const value = aliasMap[publicName];
    if (value === void 0) {
      continue;
    }
    bindingsResult ??= {};
    let internalName;
    let inputFlags = InputFlags.None;
    if (Array.isArray(value)) {
      internalName = value[0];
      inputFlags = value[1];
    } else {
      internalName = value;
    }
    let finalPublicName = publicName;
    if (hostDirectiveAliasMap !== null) {
      if (!hostDirectiveAliasMap.hasOwnProperty(publicName)) {
        continue;
      }
      finalPublicName = hostDirectiveAliasMap[publicName];
    }
    if (mode === 0) {
      addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName, inputFlags);
    } else {
      addPropertyBinding(bindingsResult, directiveIndex, finalPublicName, internalName);
    }
  }
  return bindingsResult;
}
function addPropertyBinding(bindings, directiveIndex, publicName, internalName, inputFlags) {
  let values;
  if (bindings.hasOwnProperty(publicName)) {
    (values = bindings[publicName]).push(directiveIndex, internalName);
  } else {
    values = bindings[publicName] = [directiveIndex, internalName];
  }
  if (inputFlags !== void 0) {
    values.push(inputFlags);
  }
}
function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMap) {
  ngDevMode && assertFirstCreatePass(tView);
  const start2 = tNode.directiveStart;
  const end = tNode.directiveEnd;
  const tViewData = tView.data;
  const tNodeAttrs = tNode.attrs;
  const inputsFromAttrs = [];
  let inputsStore = null;
  let outputsStore = null;
  for (let directiveIndex = start2; directiveIndex < end; directiveIndex++) {
    const directiveDef = tViewData[directiveIndex];
    const aliasData = hostDirectiveDefinitionMap ? hostDirectiveDefinitionMap.get(directiveDef) : null;
    const aliasedInputs = aliasData ? aliasData.inputs : null;
    const aliasedOutputs = aliasData ? aliasData.outputs : null;
    inputsStore = captureNodeBindings(0, directiveDef.inputs, directiveIndex, inputsStore, aliasedInputs);
    outputsStore = captureNodeBindings(1, directiveDef.outputs, directiveIndex, outputsStore, aliasedOutputs);
    const initialInputs = inputsStore !== null && tNodeAttrs !== null && !isInlineTemplate(tNode) ? generateInitialInputs(inputsStore, directiveIndex, tNodeAttrs) : null;
    inputsFromAttrs.push(initialInputs);
  }
  if (inputsStore !== null) {
    if (inputsStore.hasOwnProperty("class")) {
      tNode.flags |= 8;
    }
    if (inputsStore.hasOwnProperty("style")) {
      tNode.flags |= 16;
    }
  }
  tNode.initialInputs = inputsFromAttrs;
  tNode.inputs = inputsStore;
  tNode.outputs = outputsStore;
}
function mapPropName(name) {
  if (name === "class")
    return "className";
  if (name === "for")
    return "htmlFor";
  if (name === "formaction")
    return "formAction";
  if (name === "innerHtml")
    return "innerHTML";
  if (name === "readonly")
    return "readOnly";
  if (name === "tabindex")
    return "tabIndex";
  return name;
}
function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {
  ngDevMode && assertNotSame(value, NO_CHANGE, "Incoming value should never be NO_CHANGE.");
  const element = getNativeByTNode(tNode, lView);
  let inputData = tNode.inputs;
  let dataValue;
  if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {
    setInputsForProperty(tView, lView, dataValue, propName, value);
    if (isComponentHost(tNode))
      markDirtyIfOnPush(lView, tNode.index);
    if (ngDevMode) {
      setNgReflectProperties(lView, element, tNode.type, dataValue, value);
    }
  } else if (tNode.type & 3) {
    propName = mapPropName(propName);
    if (ngDevMode) {
      validateAgainstEventProperties(propName);
      if (!isPropertyValid(element, propName, tNode.value, tView.schemas)) {
        handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
      }
      ngDevMode.rendererSetProperty++;
    }
    value = sanitizer != null ? sanitizer(value, tNode.value || "", propName) : value;
    renderer.setProperty(element, propName, value);
  } else if (tNode.type & 12) {
    if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
      handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
    }
  }
}
function markDirtyIfOnPush(lView, viewIndex) {
  ngDevMode && assertLView(lView);
  const childComponentLView = getComponentLViewByIndex(viewIndex, lView);
  if (!(childComponentLView[FLAGS] & 16)) {
    childComponentLView[FLAGS] |= 64;
  }
}
function setNgReflectProperty(lView, element, type, attrName, value) {
  const renderer = lView[RENDERER];
  attrName = normalizeDebugBindingName(attrName);
  const debugValue = normalizeDebugBindingValue(value);
  if (type & 3) {
    if (value == null) {
      renderer.removeAttribute(element, attrName);
    } else {
      renderer.setAttribute(element, attrName, debugValue);
    }
  } else {
    const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
    renderer.setValue(element, textContent);
  }
}
function setNgReflectProperties(lView, element, type, dataValue, value) {
  if (type & (3 | 4)) {
    for (let i2 = 0; i2 < dataValue.length; i2 += 3) {
      setNgReflectProperty(lView, element, type, dataValue[i2 + 1], value);
    }
  }
}
function resolveDirectives(tView, lView, tNode, localRefs) {
  ngDevMode && assertFirstCreatePass(tView);
  if (getBindingsEnabled()) {
    const exportsMap = localRefs === null ? null : { "": -1 };
    const matchResult = findDirectiveDefMatches(tView, tNode);
    let directiveDefs;
    let hostDirectiveDefs;
    if (matchResult === null) {
      directiveDefs = hostDirectiveDefs = null;
    } else {
      [directiveDefs, hostDirectiveDefs] = matchResult;
    }
    if (directiveDefs !== null) {
      initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
    }
    if (exportsMap)
      cacheMatchingLocalNames(tNode, localRefs, exportsMap);
  }
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
}
function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
  ngDevMode && assertFirstCreatePass(tView);
  for (let i2 = 0; i2 < directives.length; i2++) {
    diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, directives[i2].type);
  }
  initTNodeFlags(tNode, tView.data.length, directives.length);
  for (let i2 = 0; i2 < directives.length; i2++) {
    const def = directives[i2];
    if (def.providersResolver)
      def.providersResolver(def);
  }
  let preOrderHooksFound = false;
  let preOrderCheckHooksFound = false;
  let directiveIdx = allocExpando(tView, lView, directives.length, null);
  ngDevMode && assertSame(directiveIdx, tNode.directiveStart, "TNode.directiveStart should point to just allocated space");
  for (let i2 = 0; i2 < directives.length; i2++) {
    const def = directives[i2];
    tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
    configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
    saveNameToExportMap(directiveIdx, def, exportsMap);
    if (def.contentQueries !== null)
      tNode.flags |= 4;
    if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
      tNode.flags |= 64;
    const lifeCycleHooks = def.type.prototype;
    if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {
      (tView.preOrderHooks ??= []).push(tNode.index);
      preOrderHooksFound = true;
    }
    if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
      (tView.preOrderCheckHooks ??= []).push(tNode.index);
      preOrderCheckHooksFound = true;
    }
    directiveIdx++;
  }
  initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);
}
function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {
  ngDevMode && assertFirstCreatePass(tView);
  const hostBindings = def.hostBindings;
  if (hostBindings) {
    let hostBindingOpCodes = tView.hostBindingOpCodes;
    if (hostBindingOpCodes === null) {
      hostBindingOpCodes = tView.hostBindingOpCodes = [];
    }
    const elementIndx = ~tNode.index;
    if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {
      hostBindingOpCodes.push(elementIndx);
    }
    hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);
  }
}
function lastSelectedElementIdx(hostBindingOpCodes) {
  let i2 = hostBindingOpCodes.length;
  while (i2 > 0) {
    const value = hostBindingOpCodes[--i2];
    if (typeof value === "number" && value < 0) {
      return value;
    }
  }
  return 0;
}
function instantiateAllDirectives(tView, lView, tNode, native) {
  const start2 = tNode.directiveStart;
  const end = tNode.directiveEnd;
  if (isComponentHost(tNode)) {
    ngDevMode && assertTNodeType(
      tNode,
      3
      /* TNodeType.AnyRNode */
    );
    addComponentLogic(lView, tNode, tView.data[start2 + tNode.componentOffset]);
  }
  if (!tView.firstCreatePass) {
    getOrCreateNodeInjectorForNode(tNode, lView);
  }
  attachPatchData(native, lView);
  const initialInputs = tNode.initialInputs;
  for (let i2 = start2; i2 < end; i2++) {
    const def = tView.data[i2];
    const directive = getNodeInjectable(lView, tView, i2, tNode);
    attachPatchData(directive, lView);
    if (initialInputs !== null) {
      setInputsFromAttrs(lView, i2 - start2, directive, def, tNode, initialInputs);
    }
    if (isComponentDef(def)) {
      const componentView = getComponentLViewByIndex(tNode.index, lView);
      componentView[CONTEXT] = getNodeInjectable(lView, tView, i2, tNode);
    }
  }
}
function invokeDirectivesHostBindings(tView, lView, tNode) {
  const start2 = tNode.directiveStart;
  const end = tNode.directiveEnd;
  const elementIndex = tNode.index;
  const currentDirectiveIndex = getCurrentDirectiveIndex();
  try {
    setSelectedIndex(elementIndex);
    for (let dirIndex = start2; dirIndex < end; dirIndex++) {
      const def = tView.data[dirIndex];
      const directive = lView[dirIndex];
      setCurrentDirectiveIndex(dirIndex);
      if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {
        invokeHostBindingsInCreationMode(def, directive);
      }
    }
  } finally {
    setSelectedIndex(-1);
    setCurrentDirectiveIndex(currentDirectiveIndex);
  }
}
function invokeHostBindingsInCreationMode(def, directive) {
  if (def.hostBindings !== null) {
    def.hostBindings(1, directive);
  }
}
function findDirectiveDefMatches(tView, tNode) {
  ngDevMode && assertFirstCreatePass(tView);
  ngDevMode && assertTNodeType(
    tNode,
    3 | 12
    /* TNodeType.AnyContainer */
  );
  const registry = tView.directiveRegistry;
  let matches = null;
  let hostDirectiveDefs = null;
  if (registry) {
    for (let i2 = 0; i2 < registry.length; i2++) {
      const def = registry[i2];
      if (isNodeMatchingSelectorList(
        tNode,
        def.selectors,
        /* isProjectionMode */
        false
      )) {
        matches || (matches = []);
        if (isComponentDef(def)) {
          if (ngDevMode) {
            assertTNodeType(tNode, 2, `"${tNode.value}" tags cannot be used as component hosts. Please use a different tag to activate the ${stringify(def.type)} component.`);
            if (isComponentHost(tNode)) {
              throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);
            }
          }
          if (def.findHostDirectiveDefs !== null) {
            const hostDirectiveMatches = [];
            hostDirectiveDefs = hostDirectiveDefs || /* @__PURE__ */ new Map();
            def.findHostDirectiveDefs(def, hostDirectiveMatches, hostDirectiveDefs);
            matches.unshift(...hostDirectiveMatches, def);
            const componentOffset = hostDirectiveMatches.length;
            markAsComponentHost(tView, tNode, componentOffset);
          } else {
            matches.unshift(def);
            markAsComponentHost(tView, tNode, 0);
          }
        } else {
          hostDirectiveDefs = hostDirectiveDefs || /* @__PURE__ */ new Map();
          def.findHostDirectiveDefs?.(def, matches, hostDirectiveDefs);
          matches.push(def);
        }
      }
    }
  }
  ngDevMode && matches !== null && assertNoDuplicateDirectives(matches);
  return matches === null ? null : [matches, hostDirectiveDefs];
}
function markAsComponentHost(tView, hostTNode, componentOffset) {
  ngDevMode && assertFirstCreatePass(tView);
  ngDevMode && assertGreaterThan(componentOffset, -1, "componentOffset must be great than -1");
  hostTNode.componentOffset = componentOffset;
  (tView.components ??= []).push(hostTNode.index);
}
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
  if (localRefs) {
    const localNames = tNode.localNames = [];
    for (let i2 = 0; i2 < localRefs.length; i2 += 2) {
      const index = exportsMap[localRefs[i2 + 1]];
      if (index == null)
        throw new RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i2 + 1]}' not found!`);
      localNames.push(localRefs[i2], index);
    }
  }
}
function saveNameToExportMap(directiveIdx, def, exportsMap) {
  if (exportsMap) {
    if (def.exportAs) {
      for (let i2 = 0; i2 < def.exportAs.length; i2++) {
        exportsMap[def.exportAs[i2]] = directiveIdx;
      }
    }
    if (isComponentDef(def))
      exportsMap[""] = directiveIdx;
  }
}
function initTNodeFlags(tNode, index, numberOfDirectives) {
  ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, "Reached the max number of directives");
  tNode.flags |= 1;
  tNode.directiveStart = index;
  tNode.directiveEnd = index + numberOfDirectives;
  tNode.providerIndexes = index;
}
function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {
  ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, "Must be in Expando section");
  tView.data[directiveIndex] = def;
  const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));
  const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), \u0275\u0275directiveInject);
  tView.blueprint[directiveIndex] = nodeInjectorFactory;
  lView[directiveIndex] = nodeInjectorFactory;
  registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);
}
function addComponentLogic(lView, hostTNode, def) {
  const native = getNativeByTNode(hostTNode, lView);
  const tView = getOrCreateComponentTView(def);
  const rendererFactory = lView[ENVIRONMENT].rendererFactory;
  let lViewFlags = 16;
  if (def.signals) {
    lViewFlags = 4096;
  } else if (def.onPush) {
    lViewFlags = 64;
  }
  const componentView = addToViewTree(lView, createLView(lView, tView, null, lViewFlags, native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));
  lView[hostTNode.index] = componentView;
}
function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
  if (ngDevMode) {
    assertNotSame(value, NO_CHANGE, "Incoming value should never be NO_CHANGE.");
    validateAgainstEventAttributes(name);
    assertTNodeType(tNode, 2, `Attempted to set attribute \`${name}\` on a container node. Host bindings are not valid on ng-container or ng-template.`);
  }
  const element = getNativeByTNode(tNode, lView);
  setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);
}
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
  if (value == null) {
    ngDevMode && ngDevMode.rendererRemoveAttribute++;
    renderer.removeAttribute(element, name, namespace);
  } else {
    ngDevMode && ngDevMode.rendererSetAttribute++;
    const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || "", name);
    renderer.setAttribute(element, name, strValue, namespace);
  }
}
function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {
  const initialInputs = initialInputData[directiveIndex];
  if (initialInputs !== null) {
    for (let i2 = 0; i2 < initialInputs.length; ) {
      const publicName = initialInputs[i2++];
      const privateName = initialInputs[i2++];
      const flags = initialInputs[i2++];
      const value = initialInputs[i2++];
      writeToDirectiveInput(def, instance, publicName, privateName, flags, value);
      if (ngDevMode) {
        const nativeElement = getNativeByTNode(tNode, lView);
        setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);
      }
    }
  }
}
function generateInitialInputs(inputs, directiveIndex, attrs) {
  let inputsToStore = null;
  let i2 = 0;
  while (i2 < attrs.length) {
    const attrName = attrs[i2];
    if (attrName === 0) {
      i2 += 4;
      continue;
    } else if (attrName === 5) {
      i2 += 2;
      continue;
    }
    if (typeof attrName === "number")
      break;
    if (inputs.hasOwnProperty(attrName)) {
      if (inputsToStore === null)
        inputsToStore = [];
      const inputConfig = inputs[attrName];
      for (let j = 0; j < inputConfig.length; j += 3) {
        if (inputConfig[j] === directiveIndex) {
          inputsToStore.push(attrName, inputConfig[j + 1], inputConfig[j + 2], attrs[i2 + 1]);
          break;
        }
      }
    }
    i2 += 2;
  }
  return inputsToStore;
}
function createLContainer(hostNative, currentView, native, tNode) {
  ngDevMode && assertLView(currentView);
  const lContainer = [
    hostNative,
    // host native
    true,
    // Boolean `true` in this position signifies that this is an `LContainer`
    0,
    // flags
    currentView,
    // parent
    null,
    // next
    tNode,
    // t_host
    null,
    // dehydrated views
    native,
    // native,
    null,
    // view refs
    null
    // moved views
  ];
  ngDevMode && assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, "Should allocate correct number of slots for LContainer header.");
  return lContainer;
}
function refreshContentQueries(tView, lView) {
  const contentQueries = tView.contentQueries;
  if (contentQueries !== null) {
    const prevConsumer = setActiveConsumer(null);
    try {
      for (let i2 = 0; i2 < contentQueries.length; i2 += 2) {
        const queryStartIdx = contentQueries[i2];
        const directiveDefIdx = contentQueries[i2 + 1];
        if (directiveDefIdx !== -1) {
          const directiveDef = tView.data[directiveDefIdx];
          ngDevMode && assertDefined(directiveDef, "DirectiveDef not found.");
          ngDevMode && assertDefined(directiveDef.contentQueries, "contentQueries function should be defined");
          setCurrentQueryIndex(queryStartIdx);
          directiveDef.contentQueries(2, lView[directiveDefIdx], directiveDefIdx);
        }
      }
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
}
function addToViewTree(lView, lViewOrLContainer) {
  if (lView[CHILD_HEAD]) {
    lView[CHILD_TAIL][NEXT] = lViewOrLContainer;
  } else {
    lView[CHILD_HEAD] = lViewOrLContainer;
  }
  lView[CHILD_TAIL] = lViewOrLContainer;
  return lViewOrLContainer;
}
function executeViewQueryFn(flags, viewQueryFn, component) {
  ngDevMode && assertDefined(viewQueryFn, "View queries function to execute must be defined.");
  setCurrentQueryIndex(0);
  const prevConsumer = setActiveConsumer(null);
  try {
    viewQueryFn(flags, component);
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {
  if (tData[bindingIndex] === null) {
    if (tNode.inputs == null || !tNode.inputs[propertyName]) {
      const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);
      propBindingIdxs.push(bindingIndex);
      let bindingMetadata = propertyName;
      if (interpolationParts.length > 0) {
        bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);
      }
      tData[bindingIndex] = bindingMetadata;
    }
  }
}
function getOrCreateLViewCleanup(view) {
  return view[CLEANUP] || (view[CLEANUP] = []);
}
function getOrCreateTViewCleanup(tView) {
  return tView.cleanup || (tView.cleanup = []);
}
function loadComponentRenderer(currentDef, tNode, lView) {
  if (currentDef === null || isComponentDef(currentDef)) {
    lView = unwrapLView(lView[tNode.index]);
  }
  return lView[RENDERER];
}
function handleError(lView, error3) {
  const injector = lView[INJECTOR];
  const errorHandler2 = injector ? injector.get(ErrorHandler, null) : null;
  errorHandler2 && errorHandler2.handleError(error3);
}
function setInputsForProperty(tView, lView, inputs, publicName, value) {
  for (let i2 = 0; i2 < inputs.length; ) {
    const index = inputs[i2++];
    const privateName = inputs[i2++];
    const flags = inputs[i2++];
    const instance = lView[index];
    ngDevMode && assertIndexInRange(lView, index);
    const def = tView.data[index];
    writeToDirectiveInput(def, instance, publicName, privateName, flags, value);
  }
}
function textBindingInternal(lView, index, value) {
  ngDevMode && assertString(value, "Value should be a string");
  ngDevMode && assertNotSame(value, NO_CHANGE, "value should not be NO_CHANGE");
  ngDevMode && assertIndexInRange(lView, index);
  const element = getNativeByIndex(index, lView);
  ngDevMode && assertDefined(element, "native element should exist");
  updateTextNode(lView[RENDERER], element, value);
}
function renderComponent(hostLView, componentHostIdx) {
  ngDevMode && assertEqual(isCreationMode(hostLView), true, "Should be run in creation mode");
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
  const componentTView = componentView[TVIEW];
  syncViewWithBlueprint(componentTView, componentView);
  const hostRNode = componentView[HOST];
  if (hostRNode !== null && componentView[HYDRATION] === null) {
    componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);
  }
  renderView(componentTView, componentView, componentView[CONTEXT]);
}
function syncViewWithBlueprint(tView, lView) {
  for (let i2 = lView.length; i2 < tView.blueprint.length; i2++) {
    lView.push(tView.blueprint[i2]);
  }
}
function renderView(tView, lView, context2) {
  ngDevMode && assertEqual(isCreationMode(lView), true, "Should be run in creation mode");
  ngDevMode && assertNotReactive(renderView.name);
  enterView(lView);
  try {
    const viewQuery = tView.viewQuery;
    if (viewQuery !== null) {
      executeViewQueryFn(1, viewQuery, context2);
    }
    const templateFn = tView.template;
    if (templateFn !== null) {
      executeTemplate(tView, lView, templateFn, 1, context2);
    }
    if (tView.firstCreatePass) {
      tView.firstCreatePass = false;
    }
    lView[QUERIES]?.finishViewCreation(tView);
    if (tView.staticContentQueries) {
      refreshContentQueries(tView, lView);
    }
    if (tView.staticViewQueries) {
      executeViewQueryFn(2, tView.viewQuery, context2);
    }
    const components = tView.components;
    if (components !== null) {
      renderChildComponents(lView, components);
    }
  } catch (error3) {
    if (tView.firstCreatePass) {
      tView.incompleteFirstPass = true;
      tView.firstCreatePass = false;
    }
    throw error3;
  } finally {
    lView[FLAGS] &= ~4;
    leaveView();
  }
}
function renderChildComponents(hostLView, components) {
  for (let i2 = 0; i2 < components.length; i2++) {
    renderComponent(hostLView, components[i2]);
  }
}
function createAndRenderEmbeddedLView(declarationLView, templateTNode, context2, options) {
  const prevConsumer = setActiveConsumer(null);
  try {
    const embeddedTView = templateTNode.tView;
    ngDevMode && assertDefined(embeddedTView, "TView must be defined for a template node.");
    ngDevMode && assertTNodeForLView(templateTNode, declarationLView);
    const isSignalView = declarationLView[FLAGS] & 4096;
    const viewFlags = isSignalView ? 4096 : 16;
    const embeddedLView = createLView(declarationLView, embeddedTView, context2, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);
    const declarationLContainer = declarationLView[templateTNode.index];
    ngDevMode && assertLContainer(declarationLContainer);
    embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
    const declarationViewLQueries = declarationLView[QUERIES];
    if (declarationViewLQueries !== null) {
      embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);
    }
    renderView(embeddedTView, embeddedLView, context2);
    return embeddedLView;
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
function getLViewFromLContainer(lContainer, index) {
  const adjustedIndex = CONTAINER_HEADER_OFFSET + index;
  if (adjustedIndex < lContainer.length) {
    const lView = lContainer[adjustedIndex];
    ngDevMode && assertLView(lView);
    return lView;
  }
  return void 0;
}
function shouldAddViewToDom(tNode, dehydratedView) {
  return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode);
}
function addLViewToLContainer(lContainer, lView, index, addToDOM = true) {
  const tView = lView[TVIEW];
  insertView(tView, lView, lContainer, index);
  if (addToDOM) {
    const beforeNode = getBeforeNodeForView(index, lContainer);
    const renderer = lView[RENDERER];
    const parentRNode = nativeParentNode(renderer, lContainer[NATIVE]);
    if (parentRNode !== null) {
      addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);
    }
  }
  const hydrationInfo = lView[HYDRATION];
  if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {
    hydrationInfo.firstChild = null;
  }
}
function removeLViewFromLContainer(lContainer, index) {
  const lView = detachView(lContainer, index);
  if (lView !== void 0) {
    destroyLView(lView[TVIEW], lView);
  }
  return lView;
}
function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
  while (tNode !== null) {
    ngDevMode && assertTNodeType(
      tNode,
      3 | 12 | 16 | 32
      /* TNodeType.Icu */
    );
    const lNode = lView[tNode.index];
    if (lNode !== null) {
      result.push(unwrapRNode(lNode));
    }
    if (isLContainer(lNode)) {
      collectNativeNodesInLContainer(lNode, result);
    }
    const tNodeType = tNode.type;
    if (tNodeType & 8) {
      collectNativeNodes(tView, lView, tNode.child, result);
    } else if (tNodeType & 32) {
      const nextRNode = icuContainerIterate(tNode, lView);
      let rNode;
      while (rNode = nextRNode()) {
        result.push(rNode);
      }
    } else if (tNodeType & 16) {
      const nodesInSlot = getProjectionNodes(lView, tNode);
      if (Array.isArray(nodesInSlot)) {
        result.push(...nodesInSlot);
      } else {
        const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);
        ngDevMode && assertParentView(parentView);
        collectNativeNodes(parentView[TVIEW], parentView, nodesInSlot, result, true);
      }
    }
    tNode = isProjection ? tNode.projectionNext : tNode.next;
  }
  return result;
}
function collectNativeNodesInLContainer(lContainer, result) {
  for (let i2 = CONTAINER_HEADER_OFFSET; i2 < lContainer.length; i2++) {
    const lViewInAContainer = lContainer[i2];
    const lViewFirstChildTNode = lViewInAContainer[TVIEW].firstChild;
    if (lViewFirstChildTNode !== null) {
      collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);
    }
  }
  if (lContainer[NATIVE] !== lContainer[HOST]) {
    result.push(lContainer[NATIVE]);
  }
}
var freeConsumers = [];
function getOrBorrowReactiveLViewConsumer(lView) {
  return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);
}
function borrowReactiveLViewConsumer(lView) {
  const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);
  consumer.lView = lView;
  return consumer;
}
function maybeReturnReactiveLViewConsumer(consumer) {
  if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {
    return;
  }
  consumer.lView = null;
  freeConsumers.push(consumer);
}
var REACTIVE_LVIEW_CONSUMER_NODE = __spreadProps(__spreadValues({}, REACTIVE_NODE), {
  consumerIsAlwaysLive: true,
  consumerMarkedDirty: (node) => {
    markAncestorsForTraversal(node.lView);
  },
  consumerOnSignalRead() {
    this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;
  }
});
var MAXIMUM_REFRESH_RERUNS$1 = 100;
function detectChangesInternal(lView, notifyErrorHandler = true, mode = 0) {
  const environment2 = lView[ENVIRONMENT];
  const rendererFactory = environment2.rendererFactory;
  const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();
  if (!checkNoChangesMode) {
    rendererFactory.begin?.();
  }
  try {
    detectChangesInViewWhileDirty(lView, mode);
  } catch (error3) {
    if (notifyErrorHandler) {
      handleError(lView, error3);
    }
    throw error3;
  } finally {
    if (!checkNoChangesMode) {
      rendererFactory.end?.();
      environment2.inlineEffectRunner?.flush();
    }
  }
}
function detectChangesInViewWhileDirty(lView, mode) {
  const lastIsRefreshingViewsValue = isRefreshingViews();
  try {
    setIsRefreshingViews(true);
    detectChangesInView(lView, mode);
    let retries = 0;
    while (requiresRefreshOrTraversal(lView)) {
      if (retries === MAXIMUM_REFRESH_RERUNS$1) {
        throw new RuntimeError(103, ngDevMode && "Infinite change detection while trying to refresh views. There may be components which each cause the other to require a refresh, causing an infinite loop.");
      }
      retries++;
      detectChangesInView(
        lView,
        1
        /* ChangeDetectionMode.Targeted */
      );
    }
  } finally {
    setIsRefreshingViews(lastIsRefreshingViewsValue);
  }
}
function checkNoChangesInternal(lView, mode, notifyErrorHandler = true) {
  setIsInCheckNoChangesMode(mode);
  try {
    detectChangesInternal(lView, notifyErrorHandler);
  } finally {
    setIsInCheckNoChangesMode(CheckNoChangesMode.Off);
  }
}
function refreshView(tView, lView, templateFn, context2) {
  ngDevMode && assertEqual(isCreationMode(lView), false, "Should be run in update mode");
  const flags = lView[FLAGS];
  if ((flags & 256) === 256)
    return;
  const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
  !isInCheckNoChangesPass && lView[ENVIRONMENT].inlineEffectRunner?.flush();
  enterView(lView);
  let prevConsumer = null;
  let currentConsumer = null;
  if (!isInCheckNoChangesPass && viewShouldHaveReactiveConsumer(tView)) {
    currentConsumer = getOrBorrowReactiveLViewConsumer(lView);
    prevConsumer = consumerBeforeComputation(currentConsumer);
  }
  try {
    resetPreOrderHookFlags(lView);
    setBindingIndex(tView.bindingStartIndex);
    if (templateFn !== null) {
      executeTemplate(tView, lView, templateFn, 2, context2);
    }
    const hooksInitPhaseCompleted = (flags & 3) === 3;
    if (!isInCheckNoChangesPass) {
      if (hooksInitPhaseCompleted) {
        const preOrderCheckHooks = tView.preOrderCheckHooks;
        if (preOrderCheckHooks !== null) {
          executeCheckHooks(lView, preOrderCheckHooks, null);
        }
      } else {
        const preOrderHooks = tView.preOrderHooks;
        if (preOrderHooks !== null) {
          executeInitAndCheckHooks(lView, preOrderHooks, 0, null);
        }
        incrementInitPhaseFlags(
          lView,
          0
          /* InitPhaseState.OnInitHooksToBeRun */
        );
      }
    }
    markTransplantedViewsForRefresh(lView);
    detectChangesInEmbeddedViews(
      lView,
      0
      /* ChangeDetectionMode.Global */
    );
    if (tView.contentQueries !== null) {
      refreshContentQueries(tView, lView);
    }
    if (!isInCheckNoChangesPass) {
      if (hooksInitPhaseCompleted) {
        const contentCheckHooks = tView.contentCheckHooks;
        if (contentCheckHooks !== null) {
          executeCheckHooks(lView, contentCheckHooks);
        }
      } else {
        const contentHooks = tView.contentHooks;
        if (contentHooks !== null) {
          executeInitAndCheckHooks(
            lView,
            contentHooks,
            1
            /* InitPhaseState.AfterContentInitHooksToBeRun */
          );
        }
        incrementInitPhaseFlags(
          lView,
          1
          /* InitPhaseState.AfterContentInitHooksToBeRun */
        );
      }
    }
    processHostBindingOpCodes(tView, lView);
    const components = tView.components;
    if (components !== null) {
      detectChangesInChildComponents(
        lView,
        components,
        0
        /* ChangeDetectionMode.Global */
      );
    }
    const viewQuery = tView.viewQuery;
    if (viewQuery !== null) {
      executeViewQueryFn(2, viewQuery, context2);
    }
    if (!isInCheckNoChangesPass) {
      if (hooksInitPhaseCompleted) {
        const viewCheckHooks = tView.viewCheckHooks;
        if (viewCheckHooks !== null) {
          executeCheckHooks(lView, viewCheckHooks);
        }
      } else {
        const viewHooks = tView.viewHooks;
        if (viewHooks !== null) {
          executeInitAndCheckHooks(
            lView,
            viewHooks,
            2
            /* InitPhaseState.AfterViewInitHooksToBeRun */
          );
        }
        incrementInitPhaseFlags(
          lView,
          2
          /* InitPhaseState.AfterViewInitHooksToBeRun */
        );
      }
    }
    if (tView.firstUpdatePass === true) {
      tView.firstUpdatePass = false;
    }
    if (lView[EFFECTS_TO_SCHEDULE]) {
      for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {
        notifyEffect();
      }
      lView[EFFECTS_TO_SCHEDULE] = null;
    }
    if (!isInCheckNoChangesPass) {
      lView[FLAGS] &= ~(64 | 8);
    }
  } catch (e) {
    if (!isInCheckNoChangesPass) {
      markAncestorsForTraversal(lView);
    }
    throw e;
  } finally {
    if (currentConsumer !== null) {
      consumerAfterComputation(currentConsumer, prevConsumer);
      maybeReturnReactiveLViewConsumer(currentConsumer);
    }
    leaveView();
  }
}
function viewShouldHaveReactiveConsumer(tView) {
  return tView.type !== 2;
}
function detectChangesInEmbeddedViews(lView, mode) {
  for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
    for (let i2 = CONTAINER_HEADER_OFFSET; i2 < lContainer.length; i2++) {
      const embeddedLView = lContainer[i2];
      detectChangesInViewIfAttached(embeddedLView, mode);
    }
  }
}
function markTransplantedViewsForRefresh(lView) {
  for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
    if (!(lContainer[FLAGS] & LContainerFlags.HasTransplantedViews))
      continue;
    const movedViews = lContainer[MOVED_VIEWS];
    ngDevMode && assertDefined(movedViews, "Transplanted View flags set but missing MOVED_VIEWS");
    for (let i2 = 0; i2 < movedViews.length; i2++) {
      const movedLView = movedViews[i2];
      markViewForRefresh(movedLView);
    }
  }
}
function detectChangesInComponent(hostLView, componentHostIdx, mode) {
  ngDevMode && assertEqual(isCreationMode(hostLView), false, "Should be run in update mode");
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
  detectChangesInViewIfAttached(componentView, mode);
}
function detectChangesInViewIfAttached(lView, mode) {
  if (!viewAttachedToChangeDetector(lView)) {
    return;
  }
  detectChangesInView(lView, mode);
}
function detectChangesInView(lView, mode) {
  const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
  const tView = lView[TVIEW];
  const flags = lView[FLAGS];
  const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];
  let shouldRefreshView = !!(mode === 0 && flags & 16);
  shouldRefreshView ||= !!(flags & 64 && mode === 0 && !isInCheckNoChangesPass);
  shouldRefreshView ||= !!(flags & 1024);
  shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange(consumer));
  shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());
  if (consumer) {
    consumer.dirty = false;
  }
  lView[FLAGS] &= ~(8192 | 1024);
  if (shouldRefreshView) {
    refreshView(tView, lView, tView.template, lView[CONTEXT]);
  } else if (flags & 8192) {
    detectChangesInEmbeddedViews(
      lView,
      1
      /* ChangeDetectionMode.Targeted */
    );
    const components = tView.components;
    if (components !== null) {
      detectChangesInChildComponents(
        lView,
        components,
        1
        /* ChangeDetectionMode.Targeted */
      );
    }
  }
}
function detectChangesInChildComponents(hostLView, components, mode) {
  for (let i2 = 0; i2 < components.length; i2++) {
    detectChangesInComponent(hostLView, components[i2], mode);
  }
}
function markViewDirty(lView, source) {
  const dirtyBitsToUse = isRefreshingViews() ? (
    // When we are actively refreshing views, we only use the `Dirty` bit to mark a view
    64
  ) : (
    // When we are not actively refreshing a view tree, it is absolutely
    // valid to update state and mark views dirty. We use the `RefreshView` flag in this
    // case to allow synchronously rerunning change detection. This applies today to
    // afterRender hooks as well as animation listeners which execute after detecting
    // changes in a view when the render factory flushes.
    1024 | 64
  );
  lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);
  while (lView) {
    lView[FLAGS] |= dirtyBitsToUse;
    const parent = getLViewParent(lView);
    if (isRootView(lView) && !parent) {
      return lView;
    }
    lView = parent;
  }
  return null;
}
var ViewRef$1 = class {
  get rootNodes() {
    const lView = this._lView;
    const tView = lView[TVIEW];
    return collectNativeNodes(tView, lView, tView.firstChild, []);
  }
  constructor(_lView, _cdRefInjectingView, notifyErrorHandler = true) {
    this._lView = _lView;
    this._cdRefInjectingView = _cdRefInjectingView;
    this.notifyErrorHandler = notifyErrorHandler;
    this._appRef = null;
    this._attachedToViewContainer = false;
  }
  get context() {
    return this._lView[CONTEXT];
  }
  /**
   * @deprecated Replacing the full context object is not supported. Modify the context
   *   directly, or consider using a `Proxy` if you need to replace the full object.
   * // TODO(devversion): Remove this.
   */
  set context(value) {
    if (ngDevMode) {
      console.warn("Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.");
    }
    this._lView[CONTEXT] = value;
  }
  get destroyed() {
    return (this._lView[FLAGS] & 256) === 256;
  }
  destroy() {
    if (this._appRef) {
      this._appRef.detachView(this);
    } else if (this._attachedToViewContainer) {
      const parent = this._lView[PARENT];
      if (isLContainer(parent)) {
        const viewRefs = parent[VIEW_REFS];
        const index = viewRefs ? viewRefs.indexOf(this) : -1;
        if (index > -1) {
          ngDevMode && assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, "An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.");
          detachView(parent, index);
          removeFromArray(viewRefs, index);
        }
      }
      this._attachedToViewContainer = false;
    }
    destroyLView(this._lView[TVIEW], this._lView);
  }
  onDestroy(callback) {
    storeLViewOnDestroy(this._lView, callback);
  }
  /**
   * Marks a view and all of its ancestors dirty.
   *
   * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush} component is
   * checked when it needs to be re-rendered but the two normal triggers haven't marked it
   * dirty (i.e. inputs haven't changed and events haven't fired in the view).
   *
   * <!-- TODO: Add a link to a chapter on OnPush components -->
   *
   * @usageNotes
   * ### Example
   *
   * ```typescript
   * @Component({
   *   selector: 'app-root',
   *   template: `Number of ticks: {{numberOfTicks}}`
   *   changeDetection: ChangeDetectionStrategy.OnPush,
   * })
   * class AppComponent {
   *   numberOfTicks = 0;
   *
   *   constructor(private ref: ChangeDetectorRef) {
   *     setInterval(() => {
   *       this.numberOfTicks++;
   *       // the following is required, otherwise the view will not be updated
   *       this.ref.markForCheck();
   *     }, 1000);
   *   }
   * }
   * ```
   */
  markForCheck() {
    markViewDirty(
      this._cdRefInjectingView || this._lView,
      4
      /* NotificationSource.MarkForCheck */
    );
  }
  /**
   * Detaches the view from the change detection tree.
   *
   * Detached views will not be checked during change detection runs until they are
   * re-attached, even if they are dirty. `detach` can be used in combination with
   * {@link ChangeDetectorRef#detectChanges} to implement local change
   * detection checks.
   *
   * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
   * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
   *
   * @usageNotes
   * ### Example
   *
   * The following example defines a component with a large list of readonly data.
   * Imagine the data changes constantly, many times per second. For performance reasons,
   * we want to check and update the list every five seconds. We can do that by detaching
   * the component's change detector and doing a local check every five seconds.
   *
   * ```typescript
   * class DataProvider {
   *   // in a real application the returned data will be different every time
   *   get data() {
   *     return [1,2,3,4,5];
   *   }
   * }
   *
   * @Component({
   *   selector: 'giant-list',
   *   template: `
   *     <li *ngFor="let d of dataProvider.data">Data {{d}}</li>
   *   `,
   * })
   * class GiantList {
   *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {
   *     ref.detach();
   *     setInterval(() => {
   *       this.ref.detectChanges();
   *     }, 5000);
   *   }
   * }
   *
   * @Component({
   *   selector: 'app',
   *   providers: [DataProvider],
   *   template: `
   *     <giant-list><giant-list>
   *   `,
   * })
   * class App {
   * }
   * ```
   */
  detach() {
    this._lView[FLAGS] &= ~128;
  }
  /**
   * Re-attaches a view to the change detection tree.
   *
   * This can be used to re-attach views that were previously detached from the tree
   * using {@link ChangeDetectorRef#detach}. Views are attached to the tree by default.
   *
   * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
   *
   * @usageNotes
   * ### Example
   *
   * The following example creates a component displaying `live` data. The component will detach
   * its change detector from the main change detector tree when the component's live property
   * is set to false.
   *
   * ```typescript
   * class DataProvider {
   *   data = 1;
   *
   *   constructor() {
   *     setInterval(() => {
   *       this.data = this.data * 2;
   *     }, 500);
   *   }
   * }
   *
   * @Component({
   *   selector: 'live-data',
   *   inputs: ['live'],
   *   template: 'Data: {{dataProvider.data}}'
   * })
   * class LiveData {
   *   constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}
   *
   *   set live(value) {
   *     if (value) {
   *       this.ref.reattach();
   *     } else {
   *       this.ref.detach();
   *     }
   *   }
   * }
   *
   * @Component({
   *   selector: 'app-root',
   *   providers: [DataProvider],
   *   template: `
   *     Live Update: <input type="checkbox" [(ngModel)]="live">
   *     <live-data [live]="live"><live-data>
   *   `,
   * })
   * class AppComponent {
   *   live = true;
   * }
   * ```
   */
  reattach() {
    updateAncestorTraversalFlagsOnAttach(this._lView);
    this._lView[FLAGS] |= 128;
  }
  /**
   * Checks the view and its children.
   *
   * This can also be used in combination with {@link ChangeDetectorRef#detach} to implement
   * local change detection checks.
   *
   * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->
   * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->
   *
   * @usageNotes
   * ### Example
   *
   * The following example defines a component with a large list of readonly data.
   * Imagine, the data changes constantly, many times per second. For performance reasons,
   * we want to check and update the list every five seconds.
   *
   * We can do that by detaching the component's change detector and doing a local change detection
   * check every five seconds.
   *
   * See {@link ChangeDetectorRef#detach} for more information.
   */
  detectChanges() {
    this._lView[FLAGS] |= 1024;
    detectChangesInternal(this._lView, this.notifyErrorHandler);
  }
  /**
   * Checks the change detector and its children, and throws if any changes are detected.
   *
   * This is used in development mode to verify that running change detection doesn't
   * introduce other changes.
   */
  checkNoChanges() {
    if (ngDevMode) {
      checkNoChangesInternal(this._lView, CheckNoChangesMode.OnlyDirtyViews, this.notifyErrorHandler);
    }
  }
  attachToViewContainerRef() {
    if (this._appRef) {
      throw new RuntimeError(902, ngDevMode && "This view is already attached directly to the ApplicationRef!");
    }
    this._attachedToViewContainer = true;
  }
  detachFromAppRef() {
    this._appRef = null;
    const isRoot = isRootView(this._lView);
    const declarationContainer = this._lView[DECLARATION_LCONTAINER];
    if (declarationContainer !== null && !isRoot) {
      detachMovedView(declarationContainer, this._lView);
    }
    detachViewFromDOM(this._lView[TVIEW], this._lView);
  }
  attachToAppRef(appRef) {
    if (this._attachedToViewContainer) {
      throw new RuntimeError(902, ngDevMode && "This view is already attached to a ViewContainer!");
    }
    this._appRef = appRef;
    const isRoot = isRootView(this._lView);
    const declarationContainer = this._lView[DECLARATION_LCONTAINER];
    if (declarationContainer !== null && !isRoot) {
      trackMovedView(declarationContainer, this._lView);
    }
    updateAncestorTraversalFlagsOnAttach(this._lView);
  }
};
var _TemplateRef = class _TemplateRef {
};
_TemplateRef.__NG_ELEMENT_ID__ = injectTemplateRef;
var TemplateRef = _TemplateRef;
var ViewEngineTemplateRef = TemplateRef;
var R3TemplateRef = class TemplateRef2 extends ViewEngineTemplateRef {
  constructor(_declarationLView, _declarationTContainer, elementRef) {
    super();
    this._declarationLView = _declarationLView;
    this._declarationTContainer = _declarationTContainer;
    this.elementRef = elementRef;
  }
  /**
   * Returns an `ssrId` associated with a TView, which was used to
   * create this instance of the `TemplateRef`.
   *
   * @internal
   */
  get ssrId() {
    return this._declarationTContainer.tView?.ssrId || null;
  }
  createEmbeddedView(context2, injector) {
    return this.createEmbeddedViewImpl(context2, injector);
  }
  /**
   * @internal
   */
  createEmbeddedViewImpl(context2, injector, dehydratedView) {
    const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context2, { embeddedViewInjector: injector, dehydratedView });
    return new ViewRef$1(embeddedLView);
  }
};
function injectTemplateRef() {
  return createTemplateRef(getCurrentTNode(), getLView());
}
function createTemplateRef(hostTNode, hostLView) {
  if (hostTNode.type & 4) {
    ngDevMode && assertDefined(hostTNode.tView, "TView must be allocated");
    return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
  }
  return null;
}
function getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {
  const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;
  const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;
  if (insertBeforeIndex === null) {
    return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);
  } else {
    ngDevMode && assertIndexInRange(lView, insertBeforeIndex);
    return unwrapRNode(lView[insertBeforeIndex]);
  }
}
function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {
  const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;
  if (Array.isArray(tNodeInsertBeforeIndex)) {
    ngDevMode && assertDomNode(childRNode);
    let i18nParent = childRNode;
    let anchorRNode = null;
    if (!(childTNode.type & 3)) {
      anchorRNode = i18nParent;
      i18nParent = parentRElement;
    }
    if (i18nParent !== null && childTNode.componentOffset === -1) {
      for (let i2 = 1; i2 < tNodeInsertBeforeIndex.length; i2++) {
        const i18nChild = lView[tNodeInsertBeforeIndex[i2]];
        nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);
      }
    }
  }
}
function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {
  ngDevMode && assertEqual(newTNode.insertBeforeIndex, null, "We expect that insertBeforeIndex is not set");
  previousTNodes.push(newTNode);
  if (previousTNodes.length > 1) {
    for (let i2 = previousTNodes.length - 2; i2 >= 0; i2--) {
      const existingTNode = previousTNodes[i2];
      if (!isI18nText(existingTNode)) {
        if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) {
          setInsertBeforeIndex(existingTNode, newTNode.index);
        }
      }
    }
  }
}
function isI18nText(tNode) {
  return !(tNode.type & 64);
}
function isNewTNodeCreatedBefore(existingTNode, newTNode) {
  return isI18nText(newTNode) || existingTNode.index > newTNode.index;
}
function getInsertBeforeIndex(tNode) {
  const index = tNode.insertBeforeIndex;
  return Array.isArray(index) ? index[0] : index;
}
function setInsertBeforeIndex(tNode, value) {
  const index = tNode.insertBeforeIndex;
  if (Array.isArray(index)) {
    index[0] = value;
  } else {
    setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
    tNode.insertBeforeIndex = value;
  }
}
function getTIcu(tView, index) {
  const value = tView.data[index];
  if (value === null || typeof value === "string")
    return null;
  if (ngDevMode && !(value.hasOwnProperty("tView") || value.hasOwnProperty("currentCaseLViewIndex"))) {
    throwError2("We expect to get 'null'|'TIcu'|'TIcuContainer', but got: " + value);
  }
  const tIcu = value.hasOwnProperty("currentCaseLViewIndex") ? value : value.value;
  ngDevMode && assertTIcu(tIcu);
  return tIcu;
}
function setTIcu(tView, index, tIcu) {
  const tNode = tView.data[index];
  ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty("tView"), true, "We expect to get 'null'|'TIcuContainer'");
  if (tNode === null) {
    tView.data[index] = tIcu;
  } else {
    ngDevMode && assertTNodeType(
      tNode,
      32
      /* TNodeType.Icu */
    );
    tNode.value = tIcu;
  }
}
function setTNodeInsertBeforeIndex(tNode, index) {
  ngDevMode && assertTNode(tNode);
  let insertBeforeIndex = tNode.insertBeforeIndex;
  if (insertBeforeIndex === null) {
    setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);
    insertBeforeIndex = tNode.insertBeforeIndex = [
      null,
      index
    ];
  } else {
    assertEqual(Array.isArray(insertBeforeIndex), true, "Expecting array here");
    insertBeforeIndex.push(index);
  }
}
function createTNodePlaceholder(tView, previousTNodes, index) {
  const tNode = createTNodeAtIndex(tView, index, 64, null, null);
  addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);
  return tNode;
}
function getCurrentICUCaseIndex(tIcu, lView) {
  const currentCase = lView[tIcu.currentCaseLViewIndex];
  return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;
}
function getParentFromIcuCreateOpCode(mergedCode) {
  return mergedCode >>> 17;
}
function getRefFromIcuCreateOpCode(mergedCode) {
  return (mergedCode & 131070) >>> 1;
}
function getInstructionFromIcuCreateOpCode(mergedCode) {
  return mergedCode & 1;
}
function icuCreateOpCode(opCode, parentIdx, refIdx) {
  ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, "Missing parent index");
  ngDevMode && assertGreaterThan(refIdx, 0, "Missing ref index");
  return opCode | parentIdx << 17 | refIdx << 1;
}
function isRootTemplateMessage(subTemplateIndex) {
  return subTemplateIndex === -1;
}
var REF_EXTRACTOR_REGEXP = new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);
var _prepareI18nBlockForHydrationImpl = () => {
};
function prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {
  _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);
}
var _claimDehydratedIcuCaseImpl = () => {
};
function claimDehydratedIcuCase(lView, icuIndex, caseIndex) {
  _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);
}
var _findMatchingDehydratedViewImpl = () => null;
function findMatchingDehydratedView(lContainer, template) {
  return _findMatchingDehydratedViewImpl(lContainer, template);
}
var ChangeDetectionScheduler = class {
};
var ZONELESS_ENABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "Zoneless enabled" : "", { providedIn: "root", factory: () => false });
var ZONELESS_SCHEDULER_DISABLED = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "scheduler disabled" : "");
var ComponentRef$1 = class {
};
var ComponentFactory$1 = class {
};
function noComponentFactoryError(component) {
  const error3 = Error(`No component factory found for ${stringify(component)}.`);
  error3[ERROR_COMPONENT] = component;
  return error3;
}
var ERROR_COMPONENT = "ngComponent";
var _NullComponentFactoryResolver = class {
  resolveComponentFactory(component) {
    throw noComponentFactoryError(component);
  }
};
var _ComponentFactoryResolver$1 = class _ComponentFactoryResolver$1 {
};
_ComponentFactoryResolver$1.NULL = new _NullComponentFactoryResolver();
var ComponentFactoryResolver$1 = _ComponentFactoryResolver$1;
var RendererFactory2 = class {
};
var _Renderer2 = class _Renderer2 {
  constructor() {
    this.destroyNode = null;
  }
};
_Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
var Renderer2 = _Renderer2;
function injectRenderer2() {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
  return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
}
var _Sanitizer = class _Sanitizer {
};
_Sanitizer.\u0275prov = \u0275\u0275defineInjectable({
  token: _Sanitizer,
  providedIn: "root",
  factory: () => null
});
var Sanitizer = _Sanitizer;
var NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
function assertNotInReactiveContext(debugFn, extraContext) {
  if (getActiveConsumer() !== null) {
    throw new RuntimeError(-602, ngDevMode && `${debugFn.name}() cannot be called from within a reactive context.${extraContext ? ` ${extraContext}` : ""}`);
  }
}
var markedFeatures = /* @__PURE__ */ new Set();
function performanceMarkFeature(feature) {
  if (markedFeatures.has(feature)) {
    return;
  }
  markedFeatures.add(feature);
  performance?.mark?.("mark_feature_usage", { detail: { feature } });
}
function scheduleCallbackWithRafRace(callback) {
  let executeCallback = true;
  setTimeout(() => {
    if (!executeCallback) {
      return;
    }
    executeCallback = false;
    callback();
  });
  if (typeof _global["requestAnimationFrame"] === "function") {
    _global["requestAnimationFrame"](() => {
      if (!executeCallback) {
        return;
      }
      executeCallback = false;
      callback();
    });
  }
  return () => {
    executeCallback = false;
  };
}
function scheduleCallbackWithMicrotask(callback) {
  let executeCallback = true;
  queueMicrotask(() => {
    if (executeCallback) {
      callback();
    }
  });
  return () => {
    executeCallback = false;
  };
}
function noop2(...args) {
}
var AsyncStackTaggingZoneSpec = class {
  constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {
    this.name = "asyncStackTagging for " + namePrefix;
    this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);
  }
  onScheduleTask(delegate, _current, target, task) {
    task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);
    return delegate.scheduleTask(target, task);
  }
  onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {
    let ret;
    if (task.consoleTask) {
      ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));
    } else {
      ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);
    }
    return ret;
  }
};
var NgZone = class _NgZone {
  constructor({ enableLongStackTrace = false, shouldCoalesceEventChangeDetection = false, shouldCoalesceRunChangeDetection = false }) {
    this.hasPendingMacrotasks = false;
    this.hasPendingMicrotasks = false;
    this.isStable = true;
    this.onUnstable = new EventEmitter(false);
    this.onMicrotaskEmpty = new EventEmitter(false);
    this.onStable = new EventEmitter(false);
    this.onError = new EventEmitter(false);
    if (typeof Zone == "undefined") {
      throw new RuntimeError(908, ngDevMode && `In this configuration Angular requires Zone.js`);
    }
    Zone.assertZonePatched();
    const self2 = this;
    self2._nesting = 0;
    self2._outer = self2._inner = Zone.current;
    if (ngDevMode) {
      self2._inner = self2._inner.fork(new AsyncStackTaggingZoneSpec("Angular"));
    }
    if (Zone["TaskTrackingZoneSpec"]) {
      self2._inner = self2._inner.fork(new Zone["TaskTrackingZoneSpec"]());
    }
    if (enableLongStackTrace && Zone["longStackTraceZoneSpec"]) {
      self2._inner = self2._inner.fork(Zone["longStackTraceZoneSpec"]);
    }
    self2.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;
    self2.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;
    self2.callbackScheduled = false;
    forkInnerZoneWithAngularBehavior(self2);
  }
  /**
    This method checks whether the method call happens within an Angular Zone instance.
  */
  static isInAngularZone() {
    return typeof Zone !== "undefined" && Zone.current.get("isAngularZone") === true;
  }
  /**
    Assures that the method is called within the Angular Zone, otherwise throws an error.
  */
  static assertInAngularZone() {
    if (!_NgZone.isInAngularZone()) {
      throw new RuntimeError(909, ngDevMode && "Expected to be in Angular Zone, but it is not!");
    }
  }
  /**
    Assures that the method is called outside of the Angular Zone, otherwise throws an error.
  */
  static assertNotInAngularZone() {
    if (_NgZone.isInAngularZone()) {
      throw new RuntimeError(909, ngDevMode && "Expected to not be in Angular Zone, but it is!");
    }
  }
  /**
   * Executes the `fn` function synchronously within the Angular zone and returns value returned by
   * the function.
   *
   * Running functions via `run` allows you to reenter Angular zone from a task that was executed
   * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
   *
   * Any future tasks or microtasks scheduled from within this function will continue executing from
   * within the Angular zone.
   *
   * If a synchronous error happens it will be rethrown and not reported via `onError`.
   */
  run(fn, applyThis, applyArgs) {
    return this._inner.run(fn, applyThis, applyArgs);
  }
  /**
   * Executes the `fn` function synchronously within the Angular zone as a task and returns value
   * returned by the function.
   *
   * Running functions via `run` allows you to reenter Angular zone from a task that was executed
   * outside of the Angular zone (typically started via {@link #runOutsideAngular}).
   *
   * Any future tasks or microtasks scheduled from within this function will continue executing from
   * within the Angular zone.
   *
   * If a synchronous error happens it will be rethrown and not reported via `onError`.
   */
  runTask(fn, applyThis, applyArgs, name) {
    const zone = this._inner;
    const task = zone.scheduleEventTask("NgZoneEvent: " + name, fn, EMPTY_PAYLOAD, noop2, noop2);
    try {
      return zone.runTask(task, applyThis, applyArgs);
    } finally {
      zone.cancelTask(task);
    }
  }
  /**
   * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not
   * rethrown.
   */
  runGuarded(fn, applyThis, applyArgs) {
    return this._inner.runGuarded(fn, applyThis, applyArgs);
  }
  /**
   * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by
   * the function.
   *
   * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do
   * work that
   * doesn't trigger Angular change-detection or is subject to Angular's error handling.
   *
   * Any future tasks or microtasks scheduled from within this function will continue executing from
   * outside of the Angular zone.
   *
   * Use {@link #run} to reenter the Angular zone and do work that updates the application model.
   */
  runOutsideAngular(fn) {
    return this._outer.run(fn);
  }
};
var EMPTY_PAYLOAD = {};
function checkStable(zone) {
  if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {
    try {
      zone._nesting++;
      zone.onMicrotaskEmpty.emit(null);
    } finally {
      zone._nesting--;
      if (!zone.hasPendingMicrotasks) {
        try {
          zone.runOutsideAngular(() => zone.onStable.emit(null));
        } finally {
          zone.isStable = true;
        }
      }
    }
  }
}
function delayChangeDetectionForEvents(zone) {
  if (zone.isCheckStableRunning || zone.callbackScheduled) {
    return;
  }
  zone.callbackScheduled = true;
  Zone.root.run(() => {
    scheduleCallbackWithRafRace(() => {
      zone.callbackScheduled = false;
      updateMicroTaskStatus(zone);
      zone.isCheckStableRunning = true;
      checkStable(zone);
      zone.isCheckStableRunning = false;
    });
  });
  updateMicroTaskStatus(zone);
}
function forkInnerZoneWithAngularBehavior(zone) {
  const delayChangeDetectionForEventsDelegate = () => {
    delayChangeDetectionForEvents(zone);
  };
  zone._inner = zone._inner.fork({
    name: "angular",
    properties: { "isAngularZone": true },
    onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {
      if (shouldBeIgnoredByZone(applyArgs)) {
        return delegate.invokeTask(target, task, applyThis, applyArgs);
      }
      try {
        onEnter(zone);
        return delegate.invokeTask(target, task, applyThis, applyArgs);
      } finally {
        if (zone.shouldCoalesceEventChangeDetection && task.type === "eventTask" || zone.shouldCoalesceRunChangeDetection) {
          delayChangeDetectionForEventsDelegate();
        }
        onLeave(zone);
      }
    },
    onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {
      try {
        onEnter(zone);
        return delegate.invoke(target, callback, applyThis, applyArgs, source);
      } finally {
        if (zone.shouldCoalesceRunChangeDetection && // Do not delay change detection when the task is the scheduler's tick.
        // We need to synchronously trigger the stability logic so that the
        // zone-based scheduler can prevent a duplicate ApplicationRef.tick
        // by first checking if the scheduler tick is running. This does seem a bit roundabout,
        // but we _do_ still want to trigger all the correct events when we exit the zone.run
        // (`onMicrotaskEmpty` and `onStable` _should_ emit; developers can have code which
        // relies on these events happening after change detection runs).
        // Note: `zone.callbackScheduled` is already in delayChangeDetectionForEventsDelegate
        // but is added here as well to prevent reads of applyArgs when not necessary
        !zone.callbackScheduled && !isSchedulerTick(applyArgs)) {
          delayChangeDetectionForEventsDelegate();
        }
        onLeave(zone);
      }
    },
    onHasTask: (delegate, current, target, hasTaskState) => {
      delegate.hasTask(target, hasTaskState);
      if (current === target) {
        if (hasTaskState.change == "microTask") {
          zone._hasPendingMicrotasks = hasTaskState.microTask;
          updateMicroTaskStatus(zone);
          checkStable(zone);
        } else if (hasTaskState.change == "macroTask") {
          zone.hasPendingMacrotasks = hasTaskState.macroTask;
        }
      }
    },
    onHandleError: (delegate, current, target, error3) => {
      delegate.handleError(target, error3);
      zone.runOutsideAngular(() => zone.onError.emit(error3));
      return false;
    }
  });
}
function updateMicroTaskStatus(zone) {
  if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {
    zone.hasPendingMicrotasks = true;
  } else {
    zone.hasPendingMicrotasks = false;
  }
}
function onEnter(zone) {
  zone._nesting++;
  if (zone.isStable) {
    zone.isStable = false;
    zone.onUnstable.emit(null);
  }
}
function onLeave(zone) {
  zone._nesting--;
  checkStable(zone);
}
var NoopNgZone = class {
  constructor() {
    this.hasPendingMicrotasks = false;
    this.hasPendingMacrotasks = false;
    this.isStable = true;
    this.onUnstable = new EventEmitter();
    this.onMicrotaskEmpty = new EventEmitter();
    this.onStable = new EventEmitter();
    this.onError = new EventEmitter();
  }
  run(fn, applyThis, applyArgs) {
    return fn.apply(applyThis, applyArgs);
  }
  runGuarded(fn, applyThis, applyArgs) {
    return fn.apply(applyThis, applyArgs);
  }
  runOutsideAngular(fn) {
    return fn();
  }
  runTask(fn, applyThis, applyArgs, name) {
    return fn.apply(applyThis, applyArgs);
  }
};
function shouldBeIgnoredByZone(applyArgs) {
  return hasApplyArgsData(applyArgs, "__ignore_ng_zone__");
}
function isSchedulerTick(applyArgs) {
  return hasApplyArgsData(applyArgs, "__scheduler_tick__");
}
function hasApplyArgsData(applyArgs, key) {
  if (!Array.isArray(applyArgs)) {
    return false;
  }
  if (applyArgs.length !== 1) {
    return false;
  }
  return applyArgs[0]?.data?.[key] === true;
}
function getNgZone(ngZoneToUse = "zone.js", options) {
  if (ngZoneToUse === "noop") {
    return new NoopNgZone();
  }
  if (ngZoneToUse === "zone.js") {
    return new NgZone(options);
  }
  return ngZoneToUse;
}
var AfterRenderPhase;
(function(AfterRenderPhase2) {
  AfterRenderPhase2[AfterRenderPhase2["EarlyRead"] = 0] = "EarlyRead";
  AfterRenderPhase2[AfterRenderPhase2["Write"] = 1] = "Write";
  AfterRenderPhase2[AfterRenderPhase2["MixedReadWrite"] = 2] = "MixedReadWrite";
  AfterRenderPhase2[AfterRenderPhase2["Read"] = 3] = "Read";
})(AfterRenderPhase || (AfterRenderPhase = {}));
var NOOP_AFTER_RENDER_REF = {
  destroy() {
  }
};
function internalAfterNextRender(callback, options) {
  const injector = options?.injector ?? inject(Injector);
  if (!options?.runOnServer && !isPlatformBrowser(injector))
    return;
  const afterRenderEventManager = injector.get(AfterRenderEventManager);
  afterRenderEventManager.internalCallbacks.push(callback);
}
function afterRender(callback, options) {
  ngDevMode && assertNotInReactiveContext(afterRender, "Call `afterRender` outside of a reactive context. For example, schedule the render callback inside the component constructor`.");
  !options && assertInInjectionContext(afterRender);
  const injector = options?.injector ?? inject(Injector);
  if (!isPlatformBrowser(injector)) {
    return NOOP_AFTER_RENDER_REF;
  }
  performanceMarkFeature("NgAfterRender");
  const afterRenderEventManager = injector.get(AfterRenderEventManager);
  const callbackHandler = afterRenderEventManager.handler ??= new AfterRenderCallbackHandlerImpl();
  const phase = options?.phase ?? AfterRenderPhase.MixedReadWrite;
  const destroy = () => {
    callbackHandler.unregister(instance);
    unregisterFn();
  };
  const unregisterFn = injector.get(DestroyRef).onDestroy(destroy);
  const instance = runInInjectionContext(injector, () => new AfterRenderCallback(phase, callback));
  callbackHandler.register(instance);
  return { destroy };
}
function afterNextRender(callback, options) {
  !options && assertInInjectionContext(afterNextRender);
  const injector = options?.injector ?? inject(Injector);
  if (!isPlatformBrowser(injector)) {
    return NOOP_AFTER_RENDER_REF;
  }
  performanceMarkFeature("NgAfterNextRender");
  const afterRenderEventManager = injector.get(AfterRenderEventManager);
  const callbackHandler = afterRenderEventManager.handler ??= new AfterRenderCallbackHandlerImpl();
  const phase = options?.phase ?? AfterRenderPhase.MixedReadWrite;
  const destroy = () => {
    callbackHandler.unregister(instance);
    unregisterFn();
  };
  const unregisterFn = injector.get(DestroyRef).onDestroy(destroy);
  const instance = runInInjectionContext(injector, () => new AfterRenderCallback(phase, () => {
    destroy();
    callback();
  }));
  callbackHandler.register(instance);
  return { destroy };
}
var AfterRenderCallback = class {
  constructor(phase, callbackFn) {
    this.phase = phase;
    this.callbackFn = callbackFn;
    this.zone = inject(NgZone);
    this.errorHandler = inject(ErrorHandler, { optional: true });
    inject(ChangeDetectionScheduler, { optional: true })?.notify(
      6
      /* NotificationSource.NewRenderHook */
    );
  }
  invoke() {
    try {
      this.zone.runOutsideAngular(this.callbackFn);
    } catch (err) {
      this.errorHandler?.handleError(err);
    }
  }
};
var AfterRenderCallbackHandlerImpl = class {
  constructor() {
    this.executingCallbacks = false;
    this.buckets = {
      // Note: the order of these keys controls the order the phases are run.
      [AfterRenderPhase.EarlyRead]: /* @__PURE__ */ new Set(),
      [AfterRenderPhase.Write]: /* @__PURE__ */ new Set(),
      [AfterRenderPhase.MixedReadWrite]: /* @__PURE__ */ new Set(),
      [AfterRenderPhase.Read]: /* @__PURE__ */ new Set()
    };
    this.deferredCallbacks = /* @__PURE__ */ new Set();
  }
  register(callback) {
    const target = this.executingCallbacks ? this.deferredCallbacks : this.buckets[callback.phase];
    target.add(callback);
  }
  unregister(callback) {
    this.buckets[callback.phase].delete(callback);
    this.deferredCallbacks.delete(callback);
  }
  execute() {
    this.executingCallbacks = true;
    for (const bucket of Object.values(this.buckets)) {
      for (const callback of bucket) {
        callback.invoke();
      }
    }
    this.executingCallbacks = false;
    for (const callback of this.deferredCallbacks) {
      this.buckets[callback.phase].add(callback);
    }
    this.deferredCallbacks.clear();
  }
  destroy() {
    for (const bucket of Object.values(this.buckets)) {
      bucket.clear();
    }
    this.deferredCallbacks.clear();
  }
};
var _AfterRenderEventManager = class _AfterRenderEventManager {
  constructor() {
    this.handler = null;
    this.internalCallbacks = [];
  }
  /**
   * Executes internal and user-provided callbacks.
   */
  execute() {
    this.executeInternalCallbacks();
    this.handler?.execute();
  }
  executeInternalCallbacks() {
    const callbacks = [...this.internalCallbacks];
    this.internalCallbacks.length = 0;
    for (const callback of callbacks) {
      callback();
    }
  }
  ngOnDestroy() {
    this.handler?.destroy();
    this.handler = null;
    this.internalCallbacks.length = 0;
  }
};
_AfterRenderEventManager.\u0275prov = \u0275\u0275defineInjectable({
  token: _AfterRenderEventManager,
  providedIn: "root",
  factory: () => new _AfterRenderEventManager()
});
var AfterRenderEventManager = _AfterRenderEventManager;
function isModuleWithProviders(value) {
  return value.ngModule !== void 0;
}
function isNgModule(value) {
  return !!getNgModuleDef(value);
}
function isPipe(value) {
  return !!getPipeDef$1(value);
}
function isDirective(value) {
  return !!getDirectiveDef(value);
}
function isComponent(value) {
  return !!getComponentDef(value);
}
function getDependencyTypeForError(type) {
  if (getComponentDef(type))
    return "component";
  if (getDirectiveDef(type))
    return "directive";
  if (getPipeDef$1(type))
    return "pipe";
  return "type";
}
function verifyStandaloneImport(depType, importingType) {
  if (isForwardRef(depType)) {
    depType = resolveForwardRef(depType);
    if (!depType) {
      throw new Error(`Expected forwardRef function, imported from "${stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${stringifyForError(depType) || depType}".`);
    }
  }
  if (getNgModuleDef(depType) == null) {
    const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);
    if (def != null) {
      if (!def.standalone) {
        throw new Error(`The "${stringifyForError(depType)}" ${getDependencyTypeForError(depType)}, imported from "${stringifyForError(importingType)}", is not standalone. Did you forget to add the standalone: true flag?`);
      }
    } else {
      if (isModuleWithProviders(depType)) {
        throw new Error(`A module with providers was imported from "${stringifyForError(importingType)}". Modules with providers are not supported in standalone components imports.`);
      } else {
        throw new Error(`The "${stringifyForError(depType)}" type, imported from "${stringifyForError(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);
      }
    }
  }
}
var USE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;
var DepsTracker = class {
  constructor() {
    this.ownerNgModule = /* @__PURE__ */ new Map();
    this.ngModulesWithSomeUnresolvedDecls = /* @__PURE__ */ new Set();
    this.ngModulesScopeCache = /* @__PURE__ */ new Map();
    this.standaloneComponentsScopeCache = /* @__PURE__ */ new Map();
  }
  /**
   * Attempts to resolve ng module's forward ref declarations as much as possible and add them to
   * the `ownerNgModule` map. This method normally should be called after the initial parsing when
   * all the forward refs are resolved (e.g., when trying to render a component)
   */
  resolveNgModulesDecls() {
    if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {
      return;
    }
    for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {
      const def = getNgModuleDef(moduleType);
      if (def?.declarations) {
        for (const decl of maybeUnwrapFn(def.declarations)) {
          if (isComponent(decl)) {
            this.ownerNgModule.set(decl, moduleType);
          }
        }
      }
    }
    this.ngModulesWithSomeUnresolvedDecls.clear();
  }
  /** @override */
  getComponentDependencies(type, rawImports) {
    this.resolveNgModulesDecls();
    const def = getComponentDef(type);
    if (def === null) {
      throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);
    }
    if (def.standalone) {
      const scope = this.getStandaloneComponentScope(type, rawImports);
      if (scope.compilation.isPoisoned) {
        return { dependencies: [] };
      }
      return {
        dependencies: [
          ...scope.compilation.directives,
          ...scope.compilation.pipes,
          ...scope.compilation.ngModules
        ]
      };
    } else {
      if (!this.ownerNgModule.has(type)) {
        return { dependencies: [] };
      }
      const scope = this.getNgModuleScope(this.ownerNgModule.get(type));
      if (scope.compilation.isPoisoned) {
        return { dependencies: [] };
      }
      return {
        dependencies: [...scope.compilation.directives, ...scope.compilation.pipes]
      };
    }
  }
  /**
   * @override
   * This implementation does not make use of param scopeInfo since it assumes the scope info is
   * already added to the type itself through methods like {@link ɵɵsetNgModuleScope}
   */
  registerNgModule(type, scopeInfo) {
    if (!isNgModule(type)) {
      throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);
    }
    this.ngModulesWithSomeUnresolvedDecls.add(type);
  }
  /** @override */
  clearScopeCacheFor(type) {
    this.ngModulesScopeCache.delete(type);
    this.standaloneComponentsScopeCache.delete(type);
  }
  /** @override */
  getNgModuleScope(type) {
    if (this.ngModulesScopeCache.has(type)) {
      return this.ngModulesScopeCache.get(type);
    }
    const scope = this.computeNgModuleScope(type);
    this.ngModulesScopeCache.set(type, scope);
    return scope;
  }
  /** Compute NgModule scope afresh. */
  computeNgModuleScope(type) {
    const def = getNgModuleDef(type, true);
    const scope = {
      exported: { directives: /* @__PURE__ */ new Set(), pipes: /* @__PURE__ */ new Set() },
      compilation: { directives: /* @__PURE__ */ new Set(), pipes: /* @__PURE__ */ new Set() }
    };
    for (const imported of maybeUnwrapFn(def.imports)) {
      if (isNgModule(imported)) {
        const importedScope = this.getNgModuleScope(imported);
        addSet(importedScope.exported.directives, scope.compilation.directives);
        addSet(importedScope.exported.pipes, scope.compilation.pipes);
      } else if (isStandalone(imported)) {
        if (isDirective(imported) || isComponent(imported)) {
          scope.compilation.directives.add(imported);
        } else if (isPipe(imported)) {
          scope.compilation.pipes.add(imported);
        } else {
          throw new RuntimeError(1e3, "The standalone imported type is neither a component nor a directive nor a pipe");
        }
      } else {
        scope.compilation.isPoisoned = true;
        break;
      }
    }
    if (!scope.compilation.isPoisoned) {
      for (const decl of maybeUnwrapFn(def.declarations)) {
        if (isNgModule(decl) || isStandalone(decl)) {
          scope.compilation.isPoisoned = true;
          break;
        }
        if (isPipe(decl)) {
          scope.compilation.pipes.add(decl);
        } else {
          scope.compilation.directives.add(decl);
        }
      }
    }
    for (const exported of maybeUnwrapFn(def.exports)) {
      if (isNgModule(exported)) {
        const exportedScope = this.getNgModuleScope(exported);
        addSet(exportedScope.exported.directives, scope.exported.directives);
        addSet(exportedScope.exported.pipes, scope.exported.pipes);
        addSet(exportedScope.exported.directives, scope.compilation.directives);
        addSet(exportedScope.exported.pipes, scope.compilation.pipes);
      } else if (isPipe(exported)) {
        scope.exported.pipes.add(exported);
      } else {
        scope.exported.directives.add(exported);
      }
    }
    return scope;
  }
  /** @override */
  getStandaloneComponentScope(type, rawImports) {
    if (this.standaloneComponentsScopeCache.has(type)) {
      return this.standaloneComponentsScopeCache.get(type);
    }
    const ans = this.computeStandaloneComponentScope(type, rawImports);
    this.standaloneComponentsScopeCache.set(type, ans);
    return ans;
  }
  computeStandaloneComponentScope(type, rawImports) {
    const ans = {
      compilation: {
        // Standalone components are always able to self-reference.
        directives: /* @__PURE__ */ new Set([type]),
        pipes: /* @__PURE__ */ new Set(),
        ngModules: /* @__PURE__ */ new Set()
      }
    };
    for (const rawImport of flatten(rawImports ?? [])) {
      const imported = resolveForwardRef(rawImport);
      try {
        verifyStandaloneImport(imported, type);
      } catch (e) {
        ans.compilation.isPoisoned = true;
        return ans;
      }
      if (isNgModule(imported)) {
        ans.compilation.ngModules.add(imported);
        const importedScope = this.getNgModuleScope(imported);
        if (importedScope.exported.isPoisoned) {
          ans.compilation.isPoisoned = true;
          return ans;
        }
        addSet(importedScope.exported.directives, ans.compilation.directives);
        addSet(importedScope.exported.pipes, ans.compilation.pipes);
      } else if (isPipe(imported)) {
        ans.compilation.pipes.add(imported);
      } else if (isDirective(imported) || isComponent(imported)) {
        ans.compilation.directives.add(imported);
      } else {
        ans.compilation.isPoisoned = true;
        return ans;
      }
    }
    return ans;
  }
  /** @override */
  isOrphanComponent(cmp) {
    const def = getComponentDef(cmp);
    if (!def || def.standalone) {
      return false;
    }
    this.resolveNgModulesDecls();
    return !this.ownerNgModule.has(cmp);
  }
};
function addSet(sourceSet, targetSet) {
  for (const m of sourceSet) {
    targetSet.add(m);
  }
}
var depsTracker = new DepsTracker();
function computeStaticStyling(tNode, attrs, writeToHost) {
  ngDevMode && assertFirstCreatePass(getTView(), "Expecting to be called in first template pass only");
  let styles = writeToHost ? tNode.styles : null;
  let classes = writeToHost ? tNode.classes : null;
  let mode = 0;
  if (attrs !== null) {
    for (let i2 = 0; i2 < attrs.length; i2++) {
      const value = attrs[i2];
      if (typeof value === "number") {
        mode = value;
      } else if (mode == 1) {
        classes = concatStringsWithSpace(classes, value);
      } else if (mode == 2) {
        const style2 = value;
        const styleValue = attrs[++i2];
        styles = concatStringsWithSpace(styles, style2 + ": " + styleValue + ";");
      }
    }
  }
  writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;
  writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;
}
var ComponentFactoryResolver = class extends ComponentFactoryResolver$1 {
  /**
   * @param ngModule The NgModuleRef to which all resolved factories are bound.
   */
  constructor(ngModule) {
    super();
    this.ngModule = ngModule;
  }
  resolveComponentFactory(component) {
    ngDevMode && assertComponentType(component);
    const componentDef = getComponentDef(component);
    return new ComponentFactory(componentDef, this.ngModule);
  }
};
function toRefArray(map2) {
  const array2 = [];
  for (const publicName in map2) {
    if (!map2.hasOwnProperty(publicName)) {
      continue;
    }
    const value = map2[publicName];
    if (value === void 0) {
      continue;
    }
    array2.push({
      propName: Array.isArray(value) ? value[0] : value,
      templateName: publicName
    });
  }
  return array2;
}
function getNamespace(elementName) {
  const name = elementName.toLowerCase();
  return name === "svg" ? SVG_NAMESPACE : name === "math" ? MATH_ML_NAMESPACE : null;
}
var ChainedInjector = class {
  constructor(injector, parentInjector) {
    this.injector = injector;
    this.parentInjector = parentInjector;
  }
  get(token, notFoundValue, flags) {
    flags = convertToBitFlags(flags);
    const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
    if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
      return value;
    }
    return this.parentInjector.get(token, notFoundValue, flags);
  }
};
var ComponentFactory = class extends ComponentFactory$1 {
  get inputs() {
    const componentDef = this.componentDef;
    const inputTransforms = componentDef.inputTransforms;
    const refArray = toRefArray(componentDef.inputs);
    if (inputTransforms !== null) {
      for (const input2 of refArray) {
        if (inputTransforms.hasOwnProperty(input2.propName)) {
          input2.transform = inputTransforms[input2.propName];
        }
      }
    }
    return refArray;
  }
  get outputs() {
    return toRefArray(this.componentDef.outputs);
  }
  /**
   * @param componentDef The component definition.
   * @param ngModule The NgModuleRef to which the factory is bound.
   */
  constructor(componentDef, ngModule) {
    super();
    this.componentDef = componentDef;
    this.ngModule = ngModule;
    this.componentType = componentDef.type;
    this.selector = stringifyCSSSelectorList(componentDef.selectors);
    this.ngContentSelectors = componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
    this.isBoundToModule = !!ngModule;
  }
  create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
    const prevConsumer = setActiveConsumer(null);
    try {
      if (ngDevMode && false) {
        if (depsTracker.isOrphanComponent(this.componentType)) {
          throw new RuntimeError(1001, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(this.componentType)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);
        }
      }
      environmentInjector = environmentInjector || this.ngModule;
      let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ? environmentInjector : environmentInjector?.injector;
      if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
        realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;
      }
      const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
      const rendererFactory = rootViewInjector.get(RendererFactory2, null);
      if (rendererFactory === null) {
        throw new RuntimeError(407, ngDevMode && "Angular was not able to inject a renderer (RendererFactory2). Likely this is due to a broken DI hierarchy. Make sure that any injector used to create this component has a correct parent.");
      }
      const sanitizer = rootViewInjector.get(Sanitizer, null);
      const afterRenderEventManager = rootViewInjector.get(AfterRenderEventManager, null);
      const changeDetectionScheduler = rootViewInjector.get(ChangeDetectionScheduler, null);
      const environment2 = {
        rendererFactory,
        sanitizer,
        // We don't use inline effects (yet).
        inlineEffectRunner: null,
        afterRenderEventManager,
        changeDetectionScheduler
      };
      const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
      const elementName = this.componentDef.selectors[0][0] || "div";
      const hostRNode = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) : createElementNode(hostRenderer, elementName, getNamespace(elementName));
      let rootFlags = 512;
      if (this.componentDef.signals) {
        rootFlags |= 4096;
      } else if (!this.componentDef.onPush) {
        rootFlags |= 16;
      }
      let hydrationInfo = null;
      if (hostRNode !== null) {
        hydrationInfo = retrieveHydrationInfo(
          hostRNode,
          rootViewInjector,
          true
          /* isRootView */
        );
      }
      const rootTView = createTView(0, null, null, 1, 0, null, null, null, null, null, null);
      const rootLView = createLView(null, rootTView, null, rootFlags, null, null, environment2, hostRenderer, rootViewInjector, null, hydrationInfo);
      enterView(rootLView);
      let component;
      let tElementNode;
      try {
        const rootComponentDef = this.componentDef;
        let rootDirectives;
        let hostDirectiveDefs = null;
        if (rootComponentDef.findHostDirectiveDefs) {
          rootDirectives = [];
          hostDirectiveDefs = /* @__PURE__ */ new Map();
          rootComponentDef.findHostDirectiveDefs(rootComponentDef, rootDirectives, hostDirectiveDefs);
          rootDirectives.push(rootComponentDef);
          ngDevMode && assertNoDuplicateDirectives(rootDirectives);
        } else {
          rootDirectives = [rootComponentDef];
        }
        const hostTNode = createRootComponentTNode(rootLView, hostRNode);
        const componentView = createRootComponentView(hostTNode, hostRNode, rootComponentDef, rootDirectives, rootLView, environment2, hostRenderer);
        tElementNode = getTNode(rootTView, HEADER_OFFSET);
        if (hostRNode) {
          setRootNodeAttributes(hostRenderer, rootComponentDef, hostRNode, rootSelectorOrNode);
        }
        if (projectableNodes !== void 0) {
          projectNodes(tElementNode, this.ngContentSelectors, projectableNodes);
        }
        component = createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, [LifecycleHooksFeature]);
        renderView(rootTView, rootLView, null);
      } finally {
        leaveView();
      }
      return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
};
var ComponentRef = class extends ComponentRef$1 {
  constructor(componentType, instance, location2, _rootLView, _tNode) {
    super();
    this.location = location2;
    this._rootLView = _rootLView;
    this._tNode = _tNode;
    this.previousInputValues = null;
    this.instance = instance;
    this.hostView = this.changeDetectorRef = new ViewRef$1(
      _rootLView,
      void 0,
      false
      /* notifyErrorHandler */
    );
    this.componentType = componentType;
  }
  setInput(name, value) {
    const inputData = this._tNode.inputs;
    let dataValue;
    if (inputData !== null && (dataValue = inputData[name])) {
      this.previousInputValues ??= /* @__PURE__ */ new Map();
      if (this.previousInputValues.has(name) && Object.is(this.previousInputValues.get(name), value)) {
        return;
      }
      const lView = this._rootLView;
      setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
      this.previousInputValues.set(name, value);
      const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);
      markViewDirty(
        childComponentLView,
        1
        /* NotificationSource.SetInput */
      );
    } else {
      if (ngDevMode) {
        const cmpNameForError = stringifyForError(this.componentType);
        let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
        message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
        reportUnknownPropertyError(message);
      }
    }
  }
  get injector() {
    return new NodeInjector(this._tNode, this._rootLView);
  }
  destroy() {
    this.hostView.destroy();
  }
  onDestroy(callback) {
    this.hostView.onDestroy(callback);
  }
};
function createRootComponentTNode(lView, rNode) {
  const tView = lView[TVIEW];
  const index = HEADER_OFFSET;
  ngDevMode && assertIndexInRange(lView, index);
  lView[index] = rNode;
  return getOrCreateTNode(tView, index, 2, "#host", null);
}
function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirectives, rootView, environment2, hostRenderer) {
  const tView = rootView[TVIEW];
  applyRootComponentStyling(rootDirectives, tNode, hostRNode, hostRenderer);
  let hydrationInfo = null;
  if (hostRNode !== null) {
    hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR]);
  }
  const viewRenderer = environment2.rendererFactory.createRenderer(hostRNode, rootComponentDef);
  let lViewFlags = 16;
  if (rootComponentDef.signals) {
    lViewFlags = 4096;
  } else if (rootComponentDef.onPush) {
    lViewFlags = 64;
  }
  const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, lViewFlags, rootView[tNode.index], tNode, environment2, viewRenderer, null, null, hydrationInfo);
  if (tView.firstCreatePass) {
    markAsComponentHost(tView, tNode, rootDirectives.length - 1);
  }
  addToViewTree(rootView, componentView);
  return rootView[tNode.index] = componentView;
}
function applyRootComponentStyling(rootDirectives, tNode, rNode, hostRenderer) {
  for (const def of rootDirectives) {
    tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);
  }
  if (tNode.mergedAttrs !== null) {
    computeStaticStyling(tNode, tNode.mergedAttrs, true);
    if (rNode !== null) {
      setupStaticAttributes(hostRenderer, rNode, tNode);
    }
  }
}
function createRootComponent(componentView, rootComponentDef, rootDirectives, hostDirectiveDefs, rootLView, hostFeatures) {
  const rootTNode = getCurrentTNode();
  ngDevMode && assertDefined(rootTNode, "tNode should have been already created");
  const tView = rootLView[TVIEW];
  const native = getNativeByTNode(rootTNode, rootLView);
  initializeDirectives(tView, rootLView, rootTNode, rootDirectives, null, hostDirectiveDefs);
  for (let i2 = 0; i2 < rootDirectives.length; i2++) {
    const directiveIndex = rootTNode.directiveStart + i2;
    const directiveInstance = getNodeInjectable(rootLView, tView, directiveIndex, rootTNode);
    attachPatchData(directiveInstance, rootLView);
  }
  invokeDirectivesHostBindings(tView, rootLView, rootTNode);
  if (native) {
    attachPatchData(native, rootLView);
  }
  ngDevMode && assertGreaterThan(rootTNode.componentOffset, -1, "componentOffset must be great than -1");
  const component = getNodeInjectable(rootLView, tView, rootTNode.directiveStart + rootTNode.componentOffset, rootTNode);
  componentView[CONTEXT] = rootLView[CONTEXT] = component;
  if (hostFeatures !== null) {
    for (const feature of hostFeatures) {
      feature(component, rootComponentDef);
    }
  }
  executeContentQueries(tView, rootTNode, rootLView);
  return component;
}
function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
  if (rootSelectorOrNode) {
    setUpAttributes(hostRenderer, hostRNode, ["ng-version", "18.0.0-rc.1"]);
  } else {
    const { attrs, classes } = extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
    if (attrs) {
      setUpAttributes(hostRenderer, hostRNode, attrs);
    }
    if (classes && classes.length > 0) {
      writeDirectClass(hostRenderer, hostRNode, classes.join(" "));
    }
  }
}
function projectNodes(tNode, ngContentSelectors, projectableNodes) {
  const projection = tNode.projection = [];
  for (let i2 = 0; i2 < ngContentSelectors.length; i2++) {
    const nodesforSlot = projectableNodes[i2];
    projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
  }
}
function LifecycleHooksFeature() {
  const tNode = getCurrentTNode();
  ngDevMode && assertDefined(tNode, "TNode is required");
  registerPostOrderHooks(getLView()[TVIEW], tNode);
}
var _ViewContainerRef = class _ViewContainerRef {
};
_ViewContainerRef.__NG_ELEMENT_ID__ = injectViewContainerRef;
var ViewContainerRef = _ViewContainerRef;
function injectViewContainerRef() {
  const previousTNode = getCurrentTNode();
  return createContainerRef(previousTNode, getLView());
}
var VE_ViewContainerRef = ViewContainerRef;
var R3ViewContainerRef = class ViewContainerRef2 extends VE_ViewContainerRef {
  constructor(_lContainer, _hostTNode, _hostLView) {
    super();
    this._lContainer = _lContainer;
    this._hostTNode = _hostTNode;
    this._hostLView = _hostLView;
  }
  get element() {
    return createElementRef(this._hostTNode, this._hostLView);
  }
  get injector() {
    return new NodeInjector(this._hostTNode, this._hostLView);
  }
  /** @deprecated No replacement */
  get parentInjector() {
    const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView);
    if (hasParentInjector(parentLocation)) {
      const parentView = getParentInjectorView(parentLocation, this._hostLView);
      const injectorIndex = getParentInjectorIndex(parentLocation);
      ngDevMode && assertNodeInjector(parentView, injectorIndex);
      const parentTNode = parentView[TVIEW].data[
        injectorIndex + 8
        /* NodeInjectorOffset.TNODE */
      ];
      return new NodeInjector(parentTNode, parentView);
    } else {
      return new NodeInjector(null, this._hostLView);
    }
  }
  clear() {
    while (this.length > 0) {
      this.remove(this.length - 1);
    }
  }
  get(index) {
    const viewRefs = getViewRefs(this._lContainer);
    return viewRefs !== null && viewRefs[index] || null;
  }
  get length() {
    return this._lContainer.length - CONTAINER_HEADER_OFFSET;
  }
  createEmbeddedView(templateRef, context2, indexOrOptions) {
    let index;
    let injector;
    if (typeof indexOrOptions === "number") {
      index = indexOrOptions;
    } else if (indexOrOptions != null) {
      index = indexOrOptions.index;
      injector = indexOrOptions.injector;
    }
    const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);
    const viewRef = templateRef.createEmbeddedViewImpl(context2 || {}, injector, dehydratedView);
    this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
    return viewRef;
  }
  createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {
    const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
    let index;
    if (isComponentFactory) {
      if (ngDevMode) {
        assertEqual(typeof indexOrOptions !== "object", true, "It looks like Component factory was provided as the first argument and an options object as the second argument. This combination of arguments is incompatible. You can either change the first argument to provide Component type or change the second argument to be a number (representing an index at which to insert the new component's host view into this container)");
      }
      index = indexOrOptions;
    } else {
      if (ngDevMode) {
        assertDefined(getComponentDef(componentFactoryOrType), `Provided Component class doesn't contain Component definition. Please check whether provided class has @Component decorator.`);
        assertEqual(typeof indexOrOptions !== "number", true, "It looks like Component type was provided as the first argument and a number (representing an index at which to insert the new component's host view into this container as the second argument. This combination of arguments is incompatible. Please use an object as the second argument instead.");
      }
      const options = indexOrOptions || {};
      if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
        throwError2(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
      }
      index = options.index;
      injector = options.injector;
      projectableNodes = options.projectableNodes;
      environmentInjector = options.environmentInjector || options.ngModuleRef;
    }
    const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory(getComponentDef(componentFactoryOrType));
    const contextInjector = injector || this.parentInjector;
    if (!environmentInjector && componentFactory.ngModule == null) {
      const _injector = isComponentFactory ? contextInjector : this.parentInjector;
      const result = _injector.get(EnvironmentInjector, null);
      if (result) {
        environmentInjector = result;
      }
    }
    const componentDef = getComponentDef(componentFactory.componentType ?? {});
    const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);
    const rNode = dehydratedView?.firstChild ?? null;
    const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector);
    this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
    return componentRef;
  }
  insert(viewRef, index) {
    return this.insertImpl(viewRef, index, true);
  }
  insertImpl(viewRef, index, addToDOM) {
    const lView = viewRef._lView;
    if (ngDevMode && viewRef.destroyed) {
      throw new Error("Cannot insert a destroyed View in a ViewContainer!");
    }
    if (viewAttachedToContainer(lView)) {
      const prevIdx = this.indexOf(viewRef);
      if (prevIdx !== -1) {
        this.detach(prevIdx);
      } else {
        const prevLContainer = lView[PARENT];
        ngDevMode && assertEqual(isLContainer(prevLContainer), true, "An attached view should have its PARENT point to a container.");
        const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[T_HOST], prevLContainer[PARENT]);
        prevVCRef.detach(prevVCRef.indexOf(viewRef));
      }
    }
    const adjustedIdx = this._adjustIndex(index);
    const lContainer = this._lContainer;
    addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM);
    viewRef.attachToViewContainerRef();
    addToArray(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef);
    return viewRef;
  }
  move(viewRef, newIndex) {
    if (ngDevMode && viewRef.destroyed) {
      throw new Error("Cannot move a destroyed View in a ViewContainer!");
    }
    return this.insert(viewRef, newIndex);
  }
  indexOf(viewRef) {
    const viewRefsArr = getViewRefs(this._lContainer);
    return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1;
  }
  remove(index) {
    const adjustedIdx = this._adjustIndex(index, -1);
    const detachedView = detachView(this._lContainer, adjustedIdx);
    if (detachedView) {
      removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx);
      destroyLView(detachedView[TVIEW], detachedView);
    }
  }
  detach(index) {
    const adjustedIdx = this._adjustIndex(index, -1);
    const view = detachView(this._lContainer, adjustedIdx);
    const wasDetached = view && removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null;
    return wasDetached ? new ViewRef$1(view) : null;
  }
  _adjustIndex(index, shift = 0) {
    if (index == null) {
      return this.length + shift;
    }
    if (ngDevMode) {
      assertGreaterThan(index, -1, `ViewRef index must be positive, got ${index}`);
      assertLessThan(index, this.length + 1 + shift, "index");
    }
    return index;
  }
};
function getViewRefs(lContainer) {
  return lContainer[VIEW_REFS];
}
function getOrCreateViewRefs(lContainer) {
  return lContainer[VIEW_REFS] || (lContainer[VIEW_REFS] = []);
}
function createContainerRef(hostTNode, hostLView) {
  ngDevMode && assertTNodeType(
    hostTNode,
    12 | 3
    /* TNodeType.AnyRNode */
  );
  let lContainer;
  const slotValue = hostLView[hostTNode.index];
  if (isLContainer(slotValue)) {
    lContainer = slotValue;
  } else {
    lContainer = createLContainer(slotValue, hostLView, null, hostTNode);
    hostLView[hostTNode.index] = lContainer;
    addToViewTree(hostLView, lContainer);
  }
  _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue);
  return new R3ViewContainerRef(lContainer, hostTNode, hostLView);
}
function insertAnchorNode(hostLView, hostTNode) {
  const renderer = hostLView[RENDERER];
  ngDevMode && ngDevMode.rendererCreateComment++;
  const commentNode = renderer.createComment(ngDevMode ? "container" : "");
  const hostNative = getNativeByTNode(hostTNode, hostLView);
  const parentOfHostNative = nativeParentNode(renderer, hostNative);
  nativeInsertBefore(renderer, parentOfHostNative, commentNode, nativeNextSibling(renderer, hostNative), false);
  return commentNode;
}
var _locateOrCreateAnchorNode = createAnchorNode;
var _populateDehydratedViewsInLContainer = () => false;
function populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) {
  return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView);
}
function createAnchorNode(lContainer, hostLView, hostTNode, slotValue) {
  if (lContainer[NATIVE])
    return;
  let commentNode;
  if (hostTNode.type & 8) {
    commentNode = unwrapRNode(slotValue);
  } else {
    commentNode = insertAnchorNode(hostLView, hostTNode);
  }
  lContainer[NATIVE] = commentNode;
}
var LQuery_ = class _LQuery_ {
  constructor(queryList) {
    this.queryList = queryList;
    this.matches = null;
  }
  clone() {
    return new _LQuery_(this.queryList);
  }
  setDirty() {
    this.queryList.setDirty();
  }
};
var LQueries_ = class _LQueries_ {
  constructor(queries = []) {
    this.queries = queries;
  }
  createEmbeddedView(tView) {
    const tQueries = tView.queries;
    if (tQueries !== null) {
      const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length;
      const viewLQueries = [];
      for (let i2 = 0; i2 < noOfInheritedQueries; i2++) {
        const tQuery = tQueries.getByIndex(i2);
        const parentLQuery = this.queries[tQuery.indexInDeclarationView];
        viewLQueries.push(parentLQuery.clone());
      }
      return new _LQueries_(viewLQueries);
    }
    return null;
  }
  insertView(tView) {
    this.dirtyQueriesWithMatches(tView);
  }
  detachView(tView) {
    this.dirtyQueriesWithMatches(tView);
  }
  finishViewCreation(tView) {
    this.dirtyQueriesWithMatches(tView);
  }
  dirtyQueriesWithMatches(tView) {
    for (let i2 = 0; i2 < this.queries.length; i2++) {
      if (getTQuery(tView, i2).matches !== null) {
        this.queries[i2].setDirty();
      }
    }
  }
};
var TQueryMetadata_ = class {
  constructor(predicate, flags, read = null) {
    this.flags = flags;
    this.read = read;
    if (typeof predicate === "string") {
      this.predicate = splitQueryMultiSelectors(predicate);
    } else {
      this.predicate = predicate;
    }
  }
};
var TQueries_ = class _TQueries_ {
  constructor(queries = []) {
    this.queries = queries;
  }
  elementStart(tView, tNode) {
    ngDevMode && assertFirstCreatePass(tView, "Queries should collect results on the first template pass only");
    for (let i2 = 0; i2 < this.queries.length; i2++) {
      this.queries[i2].elementStart(tView, tNode);
    }
  }
  elementEnd(tNode) {
    for (let i2 = 0; i2 < this.queries.length; i2++) {
      this.queries[i2].elementEnd(tNode);
    }
  }
  embeddedTView(tNode) {
    let queriesForTemplateRef = null;
    for (let i2 = 0; i2 < this.length; i2++) {
      const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0;
      const tqueryClone = this.getByIndex(i2).embeddedTView(tNode, childQueryIndex);
      if (tqueryClone) {
        tqueryClone.indexInDeclarationView = i2;
        if (queriesForTemplateRef !== null) {
          queriesForTemplateRef.push(tqueryClone);
        } else {
          queriesForTemplateRef = [tqueryClone];
        }
      }
    }
    return queriesForTemplateRef !== null ? new _TQueries_(queriesForTemplateRef) : null;
  }
  template(tView, tNode) {
    ngDevMode && assertFirstCreatePass(tView, "Queries should collect results on the first template pass only");
    for (let i2 = 0; i2 < this.queries.length; i2++) {
      this.queries[i2].template(tView, tNode);
    }
  }
  getByIndex(index) {
    ngDevMode && assertIndexInRange(this.queries, index);
    return this.queries[index];
  }
  get length() {
    return this.queries.length;
  }
  track(tquery) {
    this.queries.push(tquery);
  }
};
var TQuery_ = class _TQuery_ {
  constructor(metadata, nodeIndex = -1) {
    this.metadata = metadata;
    this.matches = null;
    this.indexInDeclarationView = -1;
    this.crossesNgTemplate = false;
    this._appliesToNextNode = true;
    this._declarationNodeIndex = nodeIndex;
  }
  elementStart(tView, tNode) {
    if (this.isApplyingToNode(tNode)) {
      this.matchTNode(tView, tNode);
    }
  }
  elementEnd(tNode) {
    if (this._declarationNodeIndex === tNode.index) {
      this._appliesToNextNode = false;
    }
  }
  template(tView, tNode) {
    this.elementStart(tView, tNode);
  }
  embeddedTView(tNode, childQueryIndex) {
    if (this.isApplyingToNode(tNode)) {
      this.crossesNgTemplate = true;
      this.addMatch(-tNode.index, childQueryIndex);
      return new _TQuery_(this.metadata);
    }
    return null;
  }
  isApplyingToNode(tNode) {
    if (this._appliesToNextNode && (this.metadata.flags & 1) !== 1) {
      const declarationNodeIdx = this._declarationNodeIndex;
      let parent = tNode.parent;
      while (parent !== null && parent.type & 8 && parent.index !== declarationNodeIdx) {
        parent = parent.parent;
      }
      return declarationNodeIdx === (parent !== null ? parent.index : -1);
    }
    return this._appliesToNextNode;
  }
  matchTNode(tView, tNode) {
    const predicate = this.metadata.predicate;
    if (Array.isArray(predicate)) {
      for (let i2 = 0; i2 < predicate.length; i2++) {
        const name = predicate[i2];
        this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name));
        this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false));
      }
    } else {
      if (predicate === TemplateRef) {
        if (tNode.type & 4) {
          this.matchTNodeWithReadOption(tView, tNode, -1);
        }
      } else {
        this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false));
      }
    }
  }
  matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) {
    if (nodeMatchIdx !== null) {
      const read = this.metadata.read;
      if (read !== null) {
        if (read === ElementRef || read === ViewContainerRef || read === TemplateRef && tNode.type & 4) {
          this.addMatch(tNode.index, -2);
        } else {
          const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false);
          if (directiveOrProviderIdx !== null) {
            this.addMatch(tNode.index, directiveOrProviderIdx);
          }
        }
      } else {
        this.addMatch(tNode.index, nodeMatchIdx);
      }
    }
  }
  addMatch(tNodeIdx, matchIdx) {
    if (this.matches === null) {
      this.matches = [tNodeIdx, matchIdx];
    } else {
      this.matches.push(tNodeIdx, matchIdx);
    }
  }
};
function getIdxOfMatchingSelector(tNode, selector) {
  const localNames = tNode.localNames;
  if (localNames !== null) {
    for (let i2 = 0; i2 < localNames.length; i2 += 2) {
      if (localNames[i2] === selector) {
        return localNames[i2 + 1];
      }
    }
  }
  return null;
}
function createResultByTNodeType(tNode, currentView) {
  if (tNode.type & (3 | 8)) {
    return createElementRef(tNode, currentView);
  } else if (tNode.type & 4) {
    return createTemplateRef(tNode, currentView);
  }
  return null;
}
function createResultForNode(lView, tNode, matchingIdx, read) {
  if (matchingIdx === -1) {
    return createResultByTNodeType(tNode, lView);
  } else if (matchingIdx === -2) {
    return createSpecialToken(lView, tNode, read);
  } else {
    return getNodeInjectable(lView, lView[TVIEW], matchingIdx, tNode);
  }
}
function createSpecialToken(lView, tNode, read) {
  if (read === ElementRef) {
    return createElementRef(tNode, lView);
  } else if (read === TemplateRef) {
    return createTemplateRef(tNode, lView);
  } else if (read === ViewContainerRef) {
    ngDevMode && assertTNodeType(
      tNode,
      3 | 12
      /* TNodeType.AnyContainer */
    );
    return createContainerRef(tNode, lView);
  } else {
    ngDevMode && throwError2(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${stringify(read)}.`);
  }
}
function materializeViewResults(tView, lView, tQuery, queryIndex) {
  const lQuery = lView[QUERIES].queries[queryIndex];
  if (lQuery.matches === null) {
    const tViewData = tView.data;
    const tQueryMatches = tQuery.matches;
    const result = [];
    for (let i2 = 0; tQueryMatches !== null && i2 < tQueryMatches.length; i2 += 2) {
      const matchedNodeIdx = tQueryMatches[i2];
      if (matchedNodeIdx < 0) {
        result.push(null);
      } else {
        ngDevMode && assertIndexInRange(tViewData, matchedNodeIdx);
        const tNode = tViewData[matchedNodeIdx];
        result.push(createResultForNode(lView, tNode, tQueryMatches[i2 + 1], tQuery.metadata.read));
      }
    }
    lQuery.matches = result;
  }
  return lQuery.matches;
}
function collectQueryResults(tView, lView, queryIndex, result) {
  const tQuery = tView.queries.getByIndex(queryIndex);
  const tQueryMatches = tQuery.matches;
  if (tQueryMatches !== null) {
    const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex);
    for (let i2 = 0; i2 < tQueryMatches.length; i2 += 2) {
      const tNodeIdx = tQueryMatches[i2];
      if (tNodeIdx > 0) {
        result.push(lViewResults[i2 / 2]);
      } else {
        const childQueryIndex = tQueryMatches[i2 + 1];
        const declarationLContainer = lView[-tNodeIdx];
        ngDevMode && assertLContainer(declarationLContainer);
        for (let i3 = CONTAINER_HEADER_OFFSET; i3 < declarationLContainer.length; i3++) {
          const embeddedLView = declarationLContainer[i3];
          if (embeddedLView[DECLARATION_LCONTAINER] === embeddedLView[PARENT]) {
            collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
          }
        }
        if (declarationLContainer[MOVED_VIEWS] !== null) {
          const embeddedLViews = declarationLContainer[MOVED_VIEWS];
          for (let i3 = 0; i3 < embeddedLViews.length; i3++) {
            const embeddedLView = embeddedLViews[i3];
            collectQueryResults(embeddedLView[TVIEW], embeddedLView, childQueryIndex, result);
          }
        }
      }
    }
  }
  return result;
}
function loadQueryInternal(lView, queryIndex) {
  ngDevMode && assertDefined(lView[QUERIES], "LQueries should be defined when trying to load a query");
  ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);
  return lView[QUERIES].queries[queryIndex].queryList;
}
function createLQuery(tView, lView, flags) {
  const queryList = new QueryList(
    (flags & 4) === 4
    /* QueryFlags.emitDistinctChangesOnly */
  );
  storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
  const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;
  return lQueries.push(new LQuery_(queryList)) - 1;
}
function createViewQuery(predicate, flags, read) {
  ngDevMode && assertNumber(flags, "Expecting flags");
  const tView = getTView();
  if (tView.firstCreatePass) {
    createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);
    if ((flags & 2) === 2) {
      tView.staticViewQueries = true;
    }
  }
  return createLQuery(tView, getLView(), flags);
}
function createContentQuery(directiveIndex, predicate, flags, read) {
  ngDevMode && assertNumber(flags, "Expecting flags");
  const tView = getTView();
  if (tView.firstCreatePass) {
    const tNode = getCurrentTNode();
    createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
    saveContentQueryAndDirectiveIndex(tView, directiveIndex);
    if ((flags & 2) === 2) {
      tView.staticContentQueries = true;
    }
  }
  return createLQuery(tView, getLView(), flags);
}
function splitQueryMultiSelectors(locator) {
  return locator.split(",").map((s) => s.trim());
}
function createTQuery(tView, metadata, nodeIndex) {
  if (tView.queries === null)
    tView.queries = new TQueries_();
  tView.queries.track(new TQuery_(metadata, nodeIndex));
}
function saveContentQueryAndDirectiveIndex(tView, directiveIndex) {
  const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);
  const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1;
  if (directiveIndex !== lastSavedDirectiveIndex) {
    tViewContentQueries.push(tView.queries.length - 1, directiveIndex);
  }
}
function getTQuery(tView, index) {
  ngDevMode && assertDefined(tView.queries, "TQueries must be defined to retrieve a TQuery");
  return tView.queries.getByIndex(index);
}
function getQueryResults(lView, queryIndex) {
  const tView = lView[TVIEW];
  const tQuery = getTQuery(tView, queryIndex);
  return tQuery.crossesNgTemplate ? collectQueryResults(tView, lView, queryIndex, []) : materializeViewResults(tView, lView, tQuery, queryIndex);
}
function isSignal(value) {
  return typeof value === "function" && value[SIGNAL] !== void 0;
}
function signal(initialValue, options) {
  performanceMarkFeature("NgSignals");
  const signalFn = createSignal(initialValue);
  const node = signalFn[SIGNAL];
  if (options?.equal) {
    node.equal = options.equal;
  }
  signalFn.set = (newValue) => signalSetFn(node, newValue);
  signalFn.update = (updateFn) => signalUpdateFn(node, updateFn);
  signalFn.asReadonly = signalAsReadonlyFn.bind(signalFn);
  if (ngDevMode) {
    signalFn.toString = () => `[Signal: ${signalFn()}]`;
  }
  return signalFn;
}
function signalAsReadonlyFn() {
  const node = this[SIGNAL];
  if (node.readonlyFn === void 0) {
    const readonlyFn = () => this();
    readonlyFn[SIGNAL] = node;
    node.readonlyFn = readonlyFn;
  }
  return node.readonlyFn;
}
function isWritableSignal(value) {
  return isSignal(value) && typeof value.set === "function";
}
function createQuerySignalFn(firstOnly, required) {
  let node;
  const signalFn = createComputed(() => {
    node._dirtyCounter();
    const value = refreshSignalQuery(node, firstOnly);
    if (required && value === void 0) {
      throw new RuntimeError(-951, ngDevMode && "Child query result is required but no value is available.");
    }
    return value;
  });
  node = signalFn[SIGNAL];
  node._dirtyCounter = signal(0);
  node._flatValue = void 0;
  if (ngDevMode) {
    signalFn.toString = () => `[Query Signal]`;
  }
  return signalFn;
}
function createSingleResultOptionalQuerySignalFn() {
  return createQuerySignalFn(
    /* firstOnly */
    true,
    /* required */
    false
  );
}
function createSingleResultRequiredQuerySignalFn() {
  return createQuerySignalFn(
    /* firstOnly */
    true,
    /* required */
    true
  );
}
function createMultiResultQuerySignalFn() {
  return createQuerySignalFn(
    /* firstOnly */
    false,
    /* required */
    false
  );
}
function bindQueryToSignal(target, queryIndex) {
  const node = target[SIGNAL];
  node._lView = getLView();
  node._queryIndex = queryIndex;
  node._queryList = loadQueryInternal(node._lView, queryIndex);
  node._queryList.onDirty(() => node._dirtyCounter.update((v) => v + 1));
}
function refreshSignalQuery(node, firstOnly) {
  const lView = node._lView;
  const queryIndex = node._queryIndex;
  if (lView === void 0 || queryIndex === void 0 || lView[FLAGS] & 4) {
    return firstOnly ? void 0 : EMPTY_ARRAY;
  }
  const queryList = loadQueryInternal(lView, queryIndex);
  const results = getQueryResults(lView, queryIndex);
  queryList.reset(results, unwrapElementRef);
  if (firstOnly) {
    return queryList.first;
  } else {
    const resultChanged = queryList._changesDetected;
    if (resultChanged || node._flatValue === void 0) {
      return node._flatValue = queryList.toArray();
    }
    return node._flatValue;
  }
}
function viewChildFn(locator, opts) {
  ngDevMode && assertInInjectionContext(viewChild);
  return createSingleResultOptionalQuerySignalFn();
}
function viewChildRequiredFn(locator, opts) {
  ngDevMode && assertInInjectionContext(viewChild);
  return createSingleResultRequiredQuerySignalFn();
}
var viewChild = (() => {
  viewChildFn.required = viewChildRequiredFn;
  return viewChildFn;
})();
function contentChildFn(locator, opts) {
  ngDevMode && assertInInjectionContext(contentChild);
  return createSingleResultOptionalQuerySignalFn();
}
function contentChildRequiredFn(locator, opts) {
  ngDevMode && assertInInjectionContext(contentChildren);
  return createSingleResultRequiredQuerySignalFn();
}
var contentChild = (() => {
  contentChildFn.required = contentChildRequiredFn;
  return contentChildFn;
})();
function contentChildren(locator, opts) {
  return createMultiResultQuerySignalFn();
}
function createModelSignal(initialValue) {
  const node = Object.create(INPUT_SIGNAL_NODE);
  const emitterRef = new OutputEmitterRef();
  node.value = initialValue;
  function getter() {
    producerAccessed(node);
    assertModelSet(node.value);
    return node.value;
  }
  getter[SIGNAL] = node;
  getter.asReadonly = signalAsReadonlyFn.bind(getter);
  getter.set = (newValue) => {
    if (!node.equal(node.value, newValue)) {
      signalSetFn(node, newValue);
      emitterRef.emit(newValue);
    }
  };
  getter.update = (updateFn) => {
    assertModelSet(node.value);
    getter.set(updateFn(node.value));
  };
  getter.subscribe = emitterRef.subscribe.bind(emitterRef);
  getter.destroyRef = emitterRef.destroyRef;
  if (ngDevMode) {
    getter.toString = () => `[Model Signal: ${getter()}]`;
  }
  return getter;
}
function assertModelSet(value) {
  if (value === REQUIRED_UNSET_VALUE) {
    throw new RuntimeError(-952, ngDevMode && "Model is required but no value is available yet.");
  }
}
function modelFunction(initialValue) {
  ngDevMode && assertInInjectionContext(model);
  return createModelSignal(initialValue);
}
function modelRequiredFunction() {
  ngDevMode && assertInInjectionContext(model);
  return createModelSignal(REQUIRED_UNSET_VALUE);
}
var model = (() => {
  modelFunction.required = modelRequiredFunction;
  return modelFunction;
})();
var emitDistinctChangesOnlyDefaultValue = true;
var Query = class {
};
var ContentChildren = makePropDecorator("ContentChildren", (selector, opts = {}) => __spreadValues({
  selector,
  first: false,
  isViewQuery: false,
  descendants: false,
  emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue
}, opts), Query);
var ContentChild = makePropDecorator("ContentChild", (selector, opts = {}) => __spreadValues({
  selector,
  first: true,
  isViewQuery: false,
  descendants: true
}, opts), Query);
var ViewChildren = makePropDecorator("ViewChildren", (selector, opts = {}) => __spreadValues({
  selector,
  first: false,
  isViewQuery: true,
  descendants: true,
  emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue
}, opts), Query);
var ViewChild = makePropDecorator("ViewChild", (selector, opts) => __spreadValues({
  selector,
  first: true,
  isViewQuery: true,
  descendants: true
}, opts), Query);
function resolveComponentResources(resourceResolver) {
  const componentResolved = [];
  const urlMap = /* @__PURE__ */ new Map();
  function cachedResourceResolve(url) {
    let promise = urlMap.get(url);
    if (!promise) {
      const resp = resourceResolver(url);
      urlMap.set(url, promise = resp.then(unwrapResponse));
    }
    return promise;
  }
  componentResourceResolutionQueue.forEach((component, type) => {
    const promises = [];
    if (component.templateUrl) {
      promises.push(cachedResourceResolve(component.templateUrl).then((template) => {
        component.template = template;
      }));
    }
    const styles = typeof component.styles === "string" ? [component.styles] : component.styles || [];
    component.styles = styles;
    if (component.styleUrl && component.styleUrls?.length) {
      throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");
    } else if (component.styleUrls?.length) {
      const styleOffset = component.styles.length;
      const styleUrls = component.styleUrls;
      component.styleUrls.forEach((styleUrl, index) => {
        styles.push("");
        promises.push(cachedResourceResolve(styleUrl).then((style2) => {
          styles[styleOffset + index] = style2;
          styleUrls.splice(styleUrls.indexOf(styleUrl), 1);
          if (styleUrls.length == 0) {
            component.styleUrls = void 0;
          }
        }));
      });
    } else if (component.styleUrl) {
      promises.push(cachedResourceResolve(component.styleUrl).then((style2) => {
        styles.push(style2);
        component.styleUrl = void 0;
      }));
    }
    const fullyResolved = Promise.all(promises).then(() => componentDefResolved(type));
    componentResolved.push(fullyResolved);
  });
  clearResolutionOfComponentResourcesQueue();
  return Promise.all(componentResolved).then(() => void 0);
}
var componentResourceResolutionQueue = /* @__PURE__ */ new Map();
var componentDefPendingResolution = /* @__PURE__ */ new Set();
function maybeQueueResolutionOfComponentResources(type, metadata) {
  if (componentNeedsResolution(metadata)) {
    componentResourceResolutionQueue.set(type, metadata);
    componentDefPendingResolution.add(type);
  }
}
function componentNeedsResolution(component) {
  return !!(component.templateUrl && !component.hasOwnProperty("template") || component.styleUrls && component.styleUrls.length || component.styleUrl);
}
function clearResolutionOfComponentResourcesQueue() {
  const old = componentResourceResolutionQueue;
  componentResourceResolutionQueue = /* @__PURE__ */ new Map();
  return old;
}
function isComponentResourceResolutionQueueEmpty() {
  return componentResourceResolutionQueue.size === 0;
}
function unwrapResponse(response) {
  return typeof response == "string" ? response : response.text();
}
function componentDefResolved(type) {
  componentDefPendingResolution.delete(type);
}
var modules = /* @__PURE__ */ new Map();
var checkForDuplicateNgModules = true;
function assertSameOrNotExisting(id2, type, incoming) {
  if (type && type !== incoming && checkForDuplicateNgModules) {
    throw new Error(`Duplicate module registered for ${id2} - ${stringify(type)} vs ${stringify(type.name)}`);
  }
}
function registerNgModuleType(ngModuleType, id2) {
  const existing = modules.get(id2) || null;
  assertSameOrNotExisting(id2, existing, ngModuleType);
  modules.set(id2, ngModuleType);
}
function \u0275\u0275validateIframeAttribute(attrValue, tagName, attrName) {
  const lView = getLView();
  const tNode = getSelectedTNode();
  const element = getNativeByTNode(tNode, lView);
  if (tNode.type === 2 && tagName.toLowerCase() === "iframe") {
    const iframe = element;
    iframe.src = "";
    iframe.srcdoc = trustedHTMLFromString("");
    nativeRemoveNode(lView[RENDERER], iframe);
    const errorMessage = ngDevMode && `Angular has detected that the \`${attrName}\` was applied as a binding to an <iframe>${getTemplateLocationDetails(lView)}. For security reasons, the \`${attrName}\` can be set on an <iframe> as a static attribute only. 
To fix this, switch the \`${attrName}\` binding to a static attribute in a template or in host bindings section.`;
    throw new RuntimeError(-910, errorMessage);
  }
  return attrValue;
}
function getSuperType(type) {
  return Object.getPrototypeOf(type.prototype).constructor;
}
function \u0275\u0275InheritDefinitionFeature(definition) {
  let superType = getSuperType(definition.type);
  let shouldInheritFields = true;
  const inheritanceChain = [definition];
  while (superType) {
    let superDef = void 0;
    if (isComponentDef(definition)) {
      superDef = superType.\u0275cmp || superType.\u0275dir;
    } else {
      if (superType.\u0275cmp) {
        throw new RuntimeError(903, ngDevMode && `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
      }
      superDef = superType.\u0275dir;
    }
    if (superDef) {
      if (shouldInheritFields) {
        inheritanceChain.push(superDef);
        const writeableDef = definition;
        writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
        writeableDef.inputTransforms = maybeUnwrapEmpty(definition.inputTransforms);
        writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
        writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
        const superHostBindings = superDef.hostBindings;
        superHostBindings && inheritHostBindings(definition, superHostBindings);
        const superViewQuery = superDef.viewQuery;
        const superContentQueries = superDef.contentQueries;
        superViewQuery && inheritViewQuery(definition, superViewQuery);
        superContentQueries && inheritContentQueries(definition, superContentQueries);
        mergeInputsWithTransforms(definition, superDef);
        fillProperties(definition.outputs, superDef.outputs);
        if (isComponentDef(superDef) && superDef.data.animation) {
          const defData = definition.data;
          defData.animation = (defData.animation || []).concat(superDef.data.animation);
        }
      }
      const features = superDef.features;
      if (features) {
        for (let i2 = 0; i2 < features.length; i2++) {
          const feature = features[i2];
          if (feature && feature.ngInherit) {
            feature(definition);
          }
          if (feature === \u0275\u0275InheritDefinitionFeature) {
            shouldInheritFields = false;
          }
        }
      }
    }
    superType = Object.getPrototypeOf(superType);
  }
  mergeHostAttrsAcrossInheritance(inheritanceChain);
}
function mergeInputsWithTransforms(target, source) {
  for (const key in source.inputs) {
    if (!source.inputs.hasOwnProperty(key)) {
      continue;
    }
    if (target.inputs.hasOwnProperty(key)) {
      continue;
    }
    const value = source.inputs[key];
    if (value === void 0) {
      continue;
    }
    target.inputs[key] = value;
    target.declaredInputs[key] = source.declaredInputs[key];
    if (source.inputTransforms !== null) {
      const minifiedName = Array.isArray(value) ? value[0] : value;
      if (!source.inputTransforms.hasOwnProperty(minifiedName)) {
        continue;
      }
      target.inputTransforms ??= {};
      target.inputTransforms[minifiedName] = source.inputTransforms[minifiedName];
    }
  }
}
function mergeHostAttrsAcrossInheritance(inheritanceChain) {
  let hostVars = 0;
  let hostAttrs = null;
  for (let i2 = inheritanceChain.length - 1; i2 >= 0; i2--) {
    const def = inheritanceChain[i2];
    def.hostVars = hostVars += def.hostVars;
    def.hostAttrs = mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
  }
}
function maybeUnwrapEmpty(value) {
  if (value === EMPTY_OBJ) {
    return {};
  } else if (value === EMPTY_ARRAY) {
    return [];
  } else {
    return value;
  }
}
function inheritViewQuery(definition, superViewQuery) {
  const prevViewQuery = definition.viewQuery;
  if (prevViewQuery) {
    definition.viewQuery = (rf, ctx) => {
      superViewQuery(rf, ctx);
      prevViewQuery(rf, ctx);
    };
  } else {
    definition.viewQuery = superViewQuery;
  }
}
function inheritContentQueries(definition, superContentQueries) {
  const prevContentQueries = definition.contentQueries;
  if (prevContentQueries) {
    definition.contentQueries = (rf, ctx, directiveIndex) => {
      superContentQueries(rf, ctx, directiveIndex);
      prevContentQueries(rf, ctx, directiveIndex);
    };
  } else {
    definition.contentQueries = superContentQueries;
  }
}
function inheritHostBindings(definition, superHostBindings) {
  const prevHostBindings = definition.hostBindings;
  if (prevHostBindings) {
    definition.hostBindings = (rf, ctx) => {
      superHostBindings(rf, ctx);
      prevHostBindings(rf, ctx);
    };
  } else {
    definition.hostBindings = superHostBindings;
  }
}
var COPY_DIRECTIVE_FIELDS = [
  // The child class should use the providers of its parent.
  "providersResolver"
  // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
  // as inputs, outputs, and host binding functions.
];
var COPY_COMPONENT_FIELDS = [
  // The child class should use the template function of its parent, including all template
  // semantics.
  "template",
  "decls",
  "consts",
  "vars",
  "onPush",
  "ngContentSelectors",
  // The child class should use the CSS styles of its parent, including all styling semantics.
  "styles",
  "encapsulation",
  // The child class should be checked by the runtime in the same way as its parent.
  "schemas"
];
function \u0275\u0275CopyDefinitionFeature(definition) {
  let superType = getSuperType(definition.type);
  let superDef = void 0;
  if (isComponentDef(definition)) {
    superDef = superType.\u0275cmp;
  } else {
    superDef = superType.\u0275dir;
  }
  const defAny = definition;
  for (const field of COPY_DIRECTIVE_FIELDS) {
    defAny[field] = superDef[field];
  }
  if (isComponentDef(superDef)) {
    for (const field of COPY_COMPONENT_FIELDS) {
      defAny[field] = superDef[field];
    }
  }
}
function \u0275\u0275HostDirectivesFeature(rawHostDirectives) {
  const feature = (definition) => {
    const resolved2 = (Array.isArray(rawHostDirectives) ? rawHostDirectives : rawHostDirectives()).map((dir) => {
      return typeof dir === "function" ? { directive: resolveForwardRef(dir), inputs: EMPTY_OBJ, outputs: EMPTY_OBJ } : {
        directive: resolveForwardRef(dir.directive),
        inputs: bindingArrayToMap(dir.inputs),
        outputs: bindingArrayToMap(dir.outputs)
      };
    });
    if (definition.hostDirectives === null) {
      definition.findHostDirectiveDefs = findHostDirectiveDefs;
      definition.hostDirectives = resolved2;
    } else {
      definition.hostDirectives.unshift(...resolved2);
    }
  };
  feature.ngInherit = true;
  return feature;
}
function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
  if (currentDef.hostDirectives !== null) {
    for (const hostDirectiveConfig of currentDef.hostDirectives) {
      const hostDirectiveDef = getDirectiveDef(hostDirectiveConfig.directive);
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        validateHostDirective(hostDirectiveConfig, hostDirectiveDef);
      }
      patchDeclaredInputs(hostDirectiveDef.declaredInputs, hostDirectiveConfig.inputs);
      findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs);
      hostDirectiveDefs.set(hostDirectiveDef, hostDirectiveConfig);
      matchedDefs.push(hostDirectiveDef);
    }
  }
}
function bindingArrayToMap(bindings) {
  if (bindings === void 0 || bindings.length === 0) {
    return EMPTY_OBJ;
  }
  const result = {};
  for (let i2 = 0; i2 < bindings.length; i2 += 2) {
    result[bindings[i2]] = bindings[i2 + 1];
  }
  return result;
}
function patchDeclaredInputs(declaredInputs, exposedInputs) {
  for (const publicName in exposedInputs) {
    if (exposedInputs.hasOwnProperty(publicName)) {
      const remappedPublicName = exposedInputs[publicName];
      const privateName = declaredInputs[publicName];
      if ((typeof ngDevMode === "undefined" || ngDevMode) && declaredInputs.hasOwnProperty(remappedPublicName)) {
        assertEqual(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`);
      }
      declaredInputs[remappedPublicName] = privateName;
    }
  }
}
function validateHostDirective(hostDirectiveConfig, directiveDef) {
  const type = hostDirectiveConfig.directive;
  if (directiveDef === null) {
    if (getComponentDef(type) !== null) {
      throw new RuntimeError(310, `Host directive ${type.name} cannot be a component.`);
    }
    throw new RuntimeError(307, `Could not resolve metadata for host directive ${type.name}. Make sure that the ${type.name} class is annotated with an @Directive decorator.`);
  }
  if (!directiveDef.standalone) {
    throw new RuntimeError(308, `Host directive ${directiveDef.type.name} must be standalone.`);
  }
  validateMappings("input", directiveDef, hostDirectiveConfig.inputs);
  validateMappings("output", directiveDef, hostDirectiveConfig.outputs);
}
function validateMappings(bindingType, def, hostDirectiveBindings) {
  const className = def.type.name;
  const bindings = bindingType === "input" ? def.inputs : def.outputs;
  for (const publicName in hostDirectiveBindings) {
    if (hostDirectiveBindings.hasOwnProperty(publicName)) {
      if (!bindings.hasOwnProperty(publicName)) {
        throw new RuntimeError(311, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`);
      }
      const remappedPublicName = hostDirectiveBindings[publicName];
      if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) {
        throw new RuntimeError(312, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`);
      }
    }
  }
}
function \u0275\u0275InputTransformsFeature(definition) {
  const inputs = definition.inputConfig;
  const inputTransforms = {};
  for (const minifiedKey in inputs) {
    if (inputs.hasOwnProperty(minifiedKey)) {
      const value = inputs[minifiedKey];
      if (Array.isArray(value) && value[3]) {
        inputTransforms[minifiedKey] = value[3];
      }
    }
  }
  definition.inputTransforms = inputTransforms;
}
var NgModuleRef$1 = class {
};
var NgModuleFactory$1 = class {
};
function createNgModule(ngModule, parentInjector) {
  return new NgModuleRef(ngModule, parentInjector ?? null, []);
}
var NgModuleRef = class extends NgModuleRef$1 {
  constructor(ngModuleType, _parent, additionalProviders) {
    super();
    this._parent = _parent;
    this._bootstrapComponents = [];
    this.destroyCbs = [];
    this.componentFactoryResolver = new ComponentFactoryResolver(this);
    const ngModuleDef = getNgModuleDef(ngModuleType);
    ngDevMode && assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
    this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
    this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
      { provide: NgModuleRef$1, useValue: this },
      {
        provide: ComponentFactoryResolver$1,
        useValue: this.componentFactoryResolver
      },
      ...additionalProviders
    ], stringify(ngModuleType), /* @__PURE__ */ new Set(["environment"]));
    this._r3Injector.resolveInjectorInitializers();
    this.instance = this._r3Injector.get(ngModuleType);
  }
  get injector() {
    return this._r3Injector;
  }
  destroy() {
    ngDevMode && assertDefined(this.destroyCbs, "NgModule already destroyed");
    const injector = this._r3Injector;
    !injector.destroyed && injector.destroy();
    this.destroyCbs.forEach((fn) => fn());
    this.destroyCbs = null;
  }
  onDestroy(callback) {
    ngDevMode && assertDefined(this.destroyCbs, "NgModule already destroyed");
    this.destroyCbs.push(callback);
  }
};
var NgModuleFactory = class extends NgModuleFactory$1 {
  constructor(moduleType) {
    super();
    this.moduleType = moduleType;
  }
  create(parentInjector) {
    return new NgModuleRef(this.moduleType, parentInjector, []);
  }
};
function createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) {
  return new NgModuleRef(moduleType, parentInjector, additionalProviders);
}
var EnvironmentNgModuleRefAdapter = class extends NgModuleRef$1 {
  constructor(config2) {
    super();
    this.componentFactoryResolver = new ComponentFactoryResolver(this);
    this.instance = null;
    const injector = new R3Injector([
      ...config2.providers,
      { provide: NgModuleRef$1, useValue: this },
      { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver }
    ], config2.parent || getNullInjector(), config2.debugName, /* @__PURE__ */ new Set(["environment"]));
    this.injector = injector;
    if (config2.runEnvironmentInitializers) {
      injector.resolveInjectorInitializers();
    }
  }
  destroy() {
    this.injector.destroy();
  }
  onDestroy(callback) {
    this.injector.onDestroy(callback);
  }
};
function createEnvironmentInjector(providers, parent, debugName = null) {
  const adapter = new EnvironmentNgModuleRefAdapter({
    providers,
    parent,
    debugName,
    runEnvironmentInitializers: true
  });
  return adapter.injector;
}
var _CachedInjectorService = class _CachedInjectorService {
  constructor() {
    this.cachedInjectors = /* @__PURE__ */ new Map();
  }
  getOrCreateInjector(key, parentInjector, providers, debugName) {
    if (!this.cachedInjectors.has(key)) {
      const injector = providers.length > 0 ? createEnvironmentInjector(providers, parentInjector, debugName) : null;
      this.cachedInjectors.set(key, injector);
    }
    return this.cachedInjectors.get(key);
  }
  ngOnDestroy() {
    try {
      for (const injector of this.cachedInjectors.values()) {
        if (injector !== null) {
          injector.destroy();
        }
      }
    } finally {
      this.cachedInjectors.clear();
    }
  }
};
_CachedInjectorService.\u0275prov = \u0275\u0275defineInjectable({
  token: _CachedInjectorService,
  providedIn: "environment",
  factory: () => new _CachedInjectorService()
});
var CachedInjectorService = _CachedInjectorService;
function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
  return noSideEffects(() => {
    const clazz = type;
    if (decorators !== null) {
      if (clazz.hasOwnProperty("decorators") && clazz.decorators !== void 0) {
        clazz.decorators.push(...decorators);
      } else {
        clazz.decorators = decorators;
      }
    }
    if (ctorParameters !== null) {
      clazz.ctorParameters = ctorParameters;
    }
    if (propDecorators !== null) {
      if (clazz.hasOwnProperty("propDecorators") && clazz.propDecorators !== void 0) {
        clazz.propDecorators = __spreadValues(__spreadValues({}, clazz.propDecorators), propDecorators);
      } else {
        clazz.propDecorators = propDecorators;
      }
    }
  });
}
var _PendingTasks = class _PendingTasks {
  constructor() {
    this.taskId = 0;
    this.pendingTasks = /* @__PURE__ */ new Set();
    this.hasPendingTasks = new BehaviorSubject(false);
  }
  get _hasPendingTasks() {
    return this.hasPendingTasks.value;
  }
  add() {
    if (!this._hasPendingTasks) {
      this.hasPendingTasks.next(true);
    }
    const taskId = this.taskId++;
    this.pendingTasks.add(taskId);
    return taskId;
  }
  remove(taskId) {
    this.pendingTasks.delete(taskId);
    if (this.pendingTasks.size === 0 && this._hasPendingTasks) {
      this.hasPendingTasks.next(false);
    }
  }
  ngOnDestroy() {
    this.pendingTasks.clear();
    if (this._hasPendingTasks) {
      this.hasPendingTasks.next(false);
    }
  }
};
_PendingTasks.\u0275fac = function PendingTasks_Factory(t) {
  return new (t || _PendingTasks)();
};
_PendingTasks.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _PendingTasks, factory: _PendingTasks.\u0275fac, providedIn: "root" });
var PendingTasks = _PendingTasks;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PendingTasks, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _ExperimentalPendingTasks = class _ExperimentalPendingTasks {
  constructor() {
    this.internalPendingTasks = inject(PendingTasks);
  }
  /**
   * Adds a new task that should block application's stability.
   * @returns A cleanup function that removes a task when called.
   */
  add() {
    const taskId = this.internalPendingTasks.add();
    return () => this.internalPendingTasks.remove(taskId);
  }
};
_ExperimentalPendingTasks.\u0275fac = function ExperimentalPendingTasks_Factory(t) {
  return new (t || _ExperimentalPendingTasks)();
};
_ExperimentalPendingTasks.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ExperimentalPendingTasks, factory: _ExperimentalPendingTasks.\u0275fac, providedIn: "root" });
var ExperimentalPendingTasks = _ExperimentalPendingTasks;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ExperimentalPendingTasks, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
function isListLikeIterable(obj) {
  if (!isJsObject(obj))
    return false;
  return Array.isArray(obj) || !(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
  Symbol.iterator in obj;
}
function areIterablesEqual(a, b, comparator) {
  const iterator1 = a[Symbol.iterator]();
  const iterator2 = b[Symbol.iterator]();
  while (true) {
    const item1 = iterator1.next();
    const item2 = iterator2.next();
    if (item1.done && item2.done)
      return true;
    if (item1.done || item2.done)
      return false;
    if (!comparator(item1.value, item2.value))
      return false;
  }
}
function iterateListLike(obj, fn) {
  if (Array.isArray(obj)) {
    for (let i2 = 0; i2 < obj.length; i2++) {
      fn(obj[i2]);
    }
  } else {
    const iterator2 = obj[Symbol.iterator]();
    let item;
    while (!(item = iterator2.next()).done) {
      fn(item.value);
    }
  }
}
function isJsObject(o) {
  return o !== null && (typeof o === "function" || typeof o === "object");
}
function devModeEqual(a, b) {
  const isListLikeIterableA = isListLikeIterable(a);
  const isListLikeIterableB = isListLikeIterable(b);
  if (isListLikeIterableA && isListLikeIterableB) {
    return areIterablesEqual(a, b, devModeEqual);
  } else {
    const isAObject = a && (typeof a === "object" || typeof a === "function");
    const isBObject = b && (typeof b === "object" || typeof b === "function");
    if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
      return true;
    } else {
      return Object.is(a, b);
    }
  }
}
function updateBinding(lView, bindingIndex, value) {
  return lView[bindingIndex] = value;
}
function getBinding(lView, bindingIndex) {
  ngDevMode && assertIndexInRange(lView, bindingIndex);
  ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, "Stored value should never be NO_CHANGE.");
  return lView[bindingIndex];
}
function bindingUpdated(lView, bindingIndex, value) {
  ngDevMode && assertNotSame(value, NO_CHANGE, "Incoming value should never be NO_CHANGE.");
  ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
  const oldValue = lView[bindingIndex];
  if (Object.is(oldValue, value)) {
    return false;
  } else {
    if (ngDevMode && isInCheckNoChangesMode()) {
      const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : void 0;
      if (!devModeEqual(oldValueToCompare, value)) {
        const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
        throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);
      }
      return false;
    }
    lView[bindingIndex] = value;
    return true;
  }
}
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
  const different = bindingUpdated(lView, bindingIndex, exp1);
  return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
}
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
  const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
  return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
}
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
  const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
  return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
}
function isDetachedByI18n(tNode) {
  return (tNode.flags & 32) === 32;
}
function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrs, localRefsIndex) {
  ngDevMode && assertFirstCreatePass(tView);
  ngDevMode && ngDevMode.firstCreatePass++;
  const tViewConsts = tView.consts;
  const tNode = getOrCreateTNode(tView, index, 4, tagName || null, attrs || null);
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
  registerPostOrderHooks(tView, tNode);
  const embeddedTView = tNode.tView = createTView(
    2,
    tNode,
    templateFn,
    decls,
    vars,
    tView.directiveRegistry,
    tView.pipeRegistry,
    null,
    tView.schemas,
    tViewConsts,
    null
    /* ssrId */
  );
  if (tView.queries !== null) {
    tView.queries.template(tView, tNode);
    embeddedTView.queries = tView.queries.embeddedTView(tNode);
  }
  return tNode;
}
function declareTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor) {
  const adjustedIndex = index + HEADER_OFFSET;
  const tNode = declarationTView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, declarationTView, declarationLView, templateFn, decls, vars, tagName, attrs, localRefsIndex) : declarationTView.data[adjustedIndex];
  setCurrentTNode(tNode, false);
  const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index);
  if (wasLastNodeCreated()) {
    appendChild(declarationTView, declarationLView, comment, tNode);
  }
  attachPatchData(comment, declarationLView);
  const lContainer = createLContainer(comment, declarationLView, comment, tNode);
  declarationLView[adjustedIndex] = lContainer;
  addToViewTree(declarationLView, lContainer);
  populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView);
  if (isDirectiveHost(tNode)) {
    createDirectivesInstances(declarationTView, declarationLView, tNode);
  }
  if (localRefsIndex != null) {
    saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor);
  }
  return tNode;
}
function \u0275\u0275template(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
  const lView = getLView();
  const tView = getTView();
  const attrs = getConstant(tView.consts, attrsIndex);
  declareTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, localRefsIndex, localRefExtractor);
  return \u0275\u0275template;
}
var _locateOrCreateContainerAnchor = createContainerAnchorImpl;
function createContainerAnchorImpl(tView, lView, tNode, index) {
  lastNodeWasCreated(true);
  return lView[RENDERER].createComment(ngDevMode ? "container" : "");
}
var DeferDependenciesLoadingState;
(function(DeferDependenciesLoadingState2) {
  DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["NOT_STARTED"] = 0] = "NOT_STARTED";
  DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["IN_PROGRESS"] = 1] = "IN_PROGRESS";
  DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["COMPLETE"] = 2] = "COMPLETE";
  DeferDependenciesLoadingState2[DeferDependenciesLoadingState2["FAILED"] = 3] = "FAILED";
})(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {}));
var MINIMUM_SLOT = 0;
var LOADING_AFTER_SLOT = 1;
var DeferBlockState;
(function(DeferBlockState2) {
  DeferBlockState2[DeferBlockState2["Placeholder"] = 0] = "Placeholder";
  DeferBlockState2[DeferBlockState2["Loading"] = 1] = "Loading";
  DeferBlockState2[DeferBlockState2["Complete"] = 2] = "Complete";
  DeferBlockState2[DeferBlockState2["Error"] = 3] = "Error";
})(DeferBlockState || (DeferBlockState = {}));
var DeferBlockInternalState;
(function(DeferBlockInternalState2) {
  DeferBlockInternalState2[DeferBlockInternalState2["Initial"] = -1] = "Initial";
})(DeferBlockInternalState || (DeferBlockInternalState = {}));
var NEXT_DEFER_BLOCK_STATE = 0;
var DEFER_BLOCK_STATE = 1;
var STATE_IS_FROZEN_UNTIL = 2;
var LOADING_AFTER_CLEANUP_FN = 3;
var TRIGGER_CLEANUP_FNS = 4;
var PREFETCH_TRIGGER_CLEANUP_FNS = 5;
var DeferBlockBehavior;
(function(DeferBlockBehavior2) {
  DeferBlockBehavior2[DeferBlockBehavior2["Manual"] = 0] = "Manual";
  DeferBlockBehavior2[DeferBlockBehavior2["Playthrough"] = 1] = "Playthrough";
})(DeferBlockBehavior || (DeferBlockBehavior = {}));
function storeTriggerCleanupFn(type, lDetails, cleanupFn) {
  const key = type === 1 ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;
  if (lDetails[key] === null) {
    lDetails[key] = [];
  }
  lDetails[key].push(cleanupFn);
}
function invokeTriggerCleanupFns(type, lDetails) {
  const key = type === 1 ? PREFETCH_TRIGGER_CLEANUP_FNS : TRIGGER_CLEANUP_FNS;
  const cleanupFns = lDetails[key];
  if (cleanupFns !== null) {
    for (const cleanupFn of cleanupFns) {
      cleanupFn();
    }
    lDetails[key] = null;
  }
}
function invokeAllTriggerCleanupFns(lDetails) {
  invokeTriggerCleanupFns(1, lDetails);
  invokeTriggerCleanupFns(0, lDetails);
}
function getDeferBlockDataIndex(deferBlockIndex) {
  return deferBlockIndex + 1;
}
function getLDeferBlockDetails(lView, tNode) {
  const tView = lView[TVIEW];
  const slotIndex = getDeferBlockDataIndex(tNode.index);
  ngDevMode && assertIndexInDeclRange(tView, slotIndex);
  return lView[slotIndex];
}
function setLDeferBlockDetails(lView, deferBlockIndex, lDetails) {
  const tView = lView[TVIEW];
  const slotIndex = getDeferBlockDataIndex(deferBlockIndex);
  ngDevMode && assertIndexInDeclRange(tView, slotIndex);
  lView[slotIndex] = lDetails;
}
function getTDeferBlockDetails(tView, tNode) {
  const slotIndex = getDeferBlockDataIndex(tNode.index);
  ngDevMode && assertIndexInDeclRange(tView, slotIndex);
  return tView.data[slotIndex];
}
function setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) {
  const slotIndex = getDeferBlockDataIndex(deferBlockIndex);
  ngDevMode && assertIndexInDeclRange(tView, slotIndex);
  tView.data[slotIndex] = deferBlockConfig;
}
function getTemplateIndexForState(newState, hostLView, tNode) {
  const tView = hostLView[TVIEW];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  switch (newState) {
    case DeferBlockState.Complete:
      return tDetails.primaryTmplIndex;
    case DeferBlockState.Loading:
      return tDetails.loadingTmplIndex;
    case DeferBlockState.Error:
      return tDetails.errorTmplIndex;
    case DeferBlockState.Placeholder:
      return tDetails.placeholderTmplIndex;
    default:
      ngDevMode && throwError2(`Unexpected defer block state: ${newState}`);
      return null;
  }
}
function getMinimumDurationForState(tDetails, currentState) {
  if (currentState === DeferBlockState.Placeholder) {
    return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null;
  } else if (currentState === DeferBlockState.Loading) {
    return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null;
  }
  return null;
}
function getLoadingBlockAfter(tDetails) {
  return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null;
}
function addDepsToRegistry(currentDeps, newDeps) {
  if (!currentDeps || currentDeps.length === 0) {
    return newDeps;
  }
  const currentDepSet = new Set(currentDeps);
  for (const dep of newDeps) {
    currentDepSet.add(dep);
  }
  return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet);
}
function getPrimaryBlockTNode(tView, tDetails) {
  const adjustedIndex = tDetails.primaryTmplIndex + HEADER_OFFSET;
  return getTNode(tView, adjustedIndex);
}
function assertDeferredDependenciesLoaded(tDetails) {
  assertEqual(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, "Expecting all deferred dependencies to be loaded.");
}
var eventListenerOptions = {
  passive: true,
  capture: true
};
var hoverTriggers = /* @__PURE__ */ new WeakMap();
var interactionTriggers = /* @__PURE__ */ new WeakMap();
var viewportTriggers = /* @__PURE__ */ new WeakMap();
var interactionEventNames = ["click", "keydown"];
var hoverEventNames = ["mouseenter", "focusin"];
var intersectionObserver = null;
var observedViewportElements = 0;
var DeferEventEntry = class {
  constructor() {
    this.callbacks = /* @__PURE__ */ new Set();
    this.listener = () => {
      for (const callback of this.callbacks) {
        callback();
      }
    };
  }
};
function onInteraction(trigger2, callback) {
  let entry = interactionTriggers.get(trigger2);
  if (!entry) {
    entry = new DeferEventEntry();
    interactionTriggers.set(trigger2, entry);
    for (const name of interactionEventNames) {
      trigger2.addEventListener(name, entry.listener, eventListenerOptions);
    }
  }
  entry.callbacks.add(callback);
  return () => {
    const { callbacks, listener } = entry;
    callbacks.delete(callback);
    if (callbacks.size === 0) {
      interactionTriggers.delete(trigger2);
      for (const name of interactionEventNames) {
        trigger2.removeEventListener(name, listener, eventListenerOptions);
      }
    }
  };
}
function onHover(trigger2, callback) {
  let entry = hoverTriggers.get(trigger2);
  if (!entry) {
    entry = new DeferEventEntry();
    hoverTriggers.set(trigger2, entry);
    for (const name of hoverEventNames) {
      trigger2.addEventListener(name, entry.listener, eventListenerOptions);
    }
  }
  entry.callbacks.add(callback);
  return () => {
    const { callbacks, listener } = entry;
    callbacks.delete(callback);
    if (callbacks.size === 0) {
      for (const name of hoverEventNames) {
        trigger2.removeEventListener(name, listener, eventListenerOptions);
      }
      hoverTriggers.delete(trigger2);
    }
  };
}
function onViewport(trigger2, callback, injector) {
  const ngZone = injector.get(NgZone);
  let entry = viewportTriggers.get(trigger2);
  intersectionObserver = intersectionObserver || ngZone.runOutsideAngular(() => {
    return new IntersectionObserver((entries) => {
      for (const current of entries) {
        if (current.isIntersecting && viewportTriggers.has(current.target)) {
          ngZone.run(viewportTriggers.get(current.target).listener);
        }
      }
    });
  });
  if (!entry) {
    entry = new DeferEventEntry();
    ngZone.runOutsideAngular(() => intersectionObserver.observe(trigger2));
    viewportTriggers.set(trigger2, entry);
    observedViewportElements++;
  }
  entry.callbacks.add(callback);
  return () => {
    if (!viewportTriggers.has(trigger2)) {
      return;
    }
    entry.callbacks.delete(callback);
    if (entry.callbacks.size === 0) {
      intersectionObserver?.unobserve(trigger2);
      viewportTriggers.delete(trigger2);
      observedViewportElements--;
    }
    if (observedViewportElements === 0) {
      intersectionObserver?.disconnect();
      intersectionObserver = null;
    }
  };
}
function getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) {
  if (walkUpTimes == null) {
    return deferredHostLView;
  }
  if (walkUpTimes >= 0) {
    return walkUpViews(walkUpTimes, deferredHostLView);
  }
  const deferredContainer = deferredHostLView[deferredTNode.index];
  ngDevMode && assertLContainer(deferredContainer);
  const triggerLView = deferredContainer[CONTAINER_HEADER_OFFSET] ?? null;
  if (ngDevMode && triggerLView !== null) {
    const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode);
    const renderedState = lDetails[DEFER_BLOCK_STATE];
    assertEqual(renderedState, DeferBlockState.Placeholder, "Expected a placeholder to be rendered in this defer block.");
    assertLView(triggerLView);
  }
  return triggerLView;
}
function getTriggerElement(triggerLView, triggerIndex) {
  const element = getNativeByIndex(HEADER_OFFSET + triggerIndex, triggerLView);
  ngDevMode && assertElement(element);
  return element;
}
function registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type) {
  const injector = initialLView[INJECTOR];
  function pollDomTrigger() {
    if (isDestroyed(initialLView)) {
      return;
    }
    const lDetails = getLDeferBlockDetails(initialLView, tNode);
    const renderedState = lDetails[DEFER_BLOCK_STATE];
    if (renderedState !== DeferBlockInternalState.Initial && renderedState !== DeferBlockState.Placeholder) {
      return;
    }
    const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes);
    if (!triggerLView) {
      internalAfterNextRender(pollDomTrigger, { injector });
      return;
    }
    if (isDestroyed(triggerLView)) {
      return;
    }
    const element = getTriggerElement(triggerLView, triggerIndex);
    const cleanup = registerFn(element, () => {
      if (initialLView !== triggerLView) {
        removeLViewOnDestroy(triggerLView, cleanup);
      }
      callback();
    }, injector);
    if (initialLView !== triggerLView) {
      storeLViewOnDestroy(triggerLView, cleanup);
    }
    storeTriggerCleanupFn(type, lDetails, cleanup);
  }
  internalAfterNextRender(pollDomTrigger, { injector });
}
function onIdle(callback, lView) {
  const injector = lView[INJECTOR];
  const scheduler2 = injector.get(IdleScheduler);
  const cleanupFn = () => scheduler2.remove(callback);
  scheduler2.add(callback);
  return cleanupFn;
}
var _requestIdleCallback = () => typeof requestIdleCallback !== "undefined" ? requestIdleCallback : setTimeout;
var _cancelIdleCallback = () => typeof requestIdleCallback !== "undefined" ? cancelIdleCallback : clearTimeout;
var _IdleScheduler = class _IdleScheduler {
  constructor() {
    this.executingCallbacks = false;
    this.idleId = null;
    this.current = /* @__PURE__ */ new Set();
    this.deferred = /* @__PURE__ */ new Set();
    this.ngZone = inject(NgZone);
    this.requestIdleCallbackFn = _requestIdleCallback().bind(globalThis);
    this.cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis);
  }
  add(callback) {
    const target = this.executingCallbacks ? this.deferred : this.current;
    target.add(callback);
    if (this.idleId === null) {
      this.scheduleIdleCallback();
    }
  }
  remove(callback) {
    const { current, deferred } = this;
    current.delete(callback);
    deferred.delete(callback);
    if (current.size === 0 && deferred.size === 0) {
      this.cancelIdleCallback();
    }
  }
  scheduleIdleCallback() {
    const callback = () => {
      this.cancelIdleCallback();
      this.executingCallbacks = true;
      for (const callback2 of this.current) {
        callback2();
      }
      this.current.clear();
      this.executingCallbacks = false;
      if (this.deferred.size > 0) {
        for (const callback2 of this.deferred) {
          this.current.add(callback2);
        }
        this.deferred.clear();
        this.scheduleIdleCallback();
      }
    };
    this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback));
  }
  cancelIdleCallback() {
    if (this.idleId !== null) {
      this.cancelIdleCallbackFn(this.idleId);
      this.idleId = null;
    }
  }
  ngOnDestroy() {
    this.cancelIdleCallback();
    this.current.clear();
    this.deferred.clear();
  }
};
_IdleScheduler.\u0275prov = \u0275\u0275defineInjectable({
  token: _IdleScheduler,
  providedIn: "root",
  factory: () => new _IdleScheduler()
});
var IdleScheduler = _IdleScheduler;
function onTimer(delay2) {
  return (callback, lView) => scheduleTimerTrigger(delay2, callback, lView);
}
function scheduleTimerTrigger(delay2, callback, lView) {
  const injector = lView[INJECTOR];
  const scheduler2 = injector.get(TimerScheduler);
  const cleanupFn = () => scheduler2.remove(callback);
  scheduler2.add(delay2, callback);
  return cleanupFn;
}
var _TimerScheduler = class _TimerScheduler {
  constructor() {
    this.executingCallbacks = false;
    this.timeoutId = null;
    this.invokeTimerAt = null;
    this.current = [];
    this.deferred = [];
  }
  add(delay2, callback) {
    const target = this.executingCallbacks ? this.deferred : this.current;
    this.addToQueue(target, Date.now() + delay2, callback);
    this.scheduleTimer();
  }
  remove(callback) {
    const { current, deferred } = this;
    const callbackIndex = this.removeFromQueue(current, callback);
    if (callbackIndex === -1) {
      this.removeFromQueue(deferred, callback);
    }
    if (current.length === 0 && deferred.length === 0) {
      this.clearTimeout();
    }
  }
  addToQueue(target, invokeAt, callback) {
    let insertAtIndex = target.length;
    for (let i2 = 0; i2 < target.length; i2 += 2) {
      const invokeQueuedCallbackAt = target[i2];
      if (invokeQueuedCallbackAt > invokeAt) {
        insertAtIndex = i2;
        break;
      }
    }
    arrayInsert2(target, insertAtIndex, invokeAt, callback);
  }
  removeFromQueue(target, callback) {
    let index = -1;
    for (let i2 = 0; i2 < target.length; i2 += 2) {
      const queuedCallback = target[i2 + 1];
      if (queuedCallback === callback) {
        index = i2;
        break;
      }
    }
    if (index > -1) {
      arraySplice(target, index, 2);
    }
    return index;
  }
  scheduleTimer() {
    const callback = () => {
      this.clearTimeout();
      this.executingCallbacks = true;
      const current = [...this.current];
      const now = Date.now();
      for (let i2 = 0; i2 < current.length; i2 += 2) {
        const invokeAt = current[i2];
        const callback2 = current[i2 + 1];
        if (invokeAt <= now) {
          callback2();
        } else {
          break;
        }
      }
      let lastCallbackIndex = -1;
      for (let i2 = 0; i2 < this.current.length; i2 += 2) {
        const invokeAt = this.current[i2];
        if (invokeAt <= now) {
          lastCallbackIndex = i2 + 1;
        } else {
          break;
        }
      }
      if (lastCallbackIndex >= 0) {
        arraySplice(this.current, 0, lastCallbackIndex + 1);
      }
      this.executingCallbacks = false;
      if (this.deferred.length > 0) {
        for (let i2 = 0; i2 < this.deferred.length; i2 += 2) {
          const invokeAt = this.deferred[i2];
          const callback2 = this.deferred[i2 + 1];
          this.addToQueue(this.current, invokeAt, callback2);
        }
        this.deferred.length = 0;
      }
      this.scheduleTimer();
    };
    const FRAME_DURATION_MS = 16;
    if (this.current.length > 0) {
      const now = Date.now();
      const invokeAt = this.current[0];
      if (this.timeoutId === null || // Reschedule a timer in case a queue contains an item with
      // an earlier timestamp and the delta is more than an average
      // frame duration.
      this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS) {
        this.clearTimeout();
        const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS);
        this.invokeTimerAt = invokeAt;
        this.timeoutId = setTimeout(callback, timeout);
      }
    }
  }
  clearTimeout() {
    if (this.timeoutId !== null) {
      clearTimeout(this.timeoutId);
      this.timeoutId = null;
    }
  }
  ngOnDestroy() {
    this.clearTimeout();
    this.current.length = 0;
    this.deferred.length = 0;
  }
};
_TimerScheduler.\u0275prov = \u0275\u0275defineInjectable({
  token: _TimerScheduler,
  providedIn: "root",
  factory: () => new _TimerScheduler()
});
var TimerScheduler = _TimerScheduler;
var DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = new InjectionToken("DEFER_BLOCK_DEPENDENCY_INTERCEPTOR");
var DEFER_BLOCK_CONFIG = new InjectionToken(ngDevMode ? "DEFER_BLOCK_CONFIG" : "");
function shouldTriggerDeferBlock(injector) {
  const config2 = injector.get(DEFER_BLOCK_CONFIG, null, { optional: true });
  if (config2?.behavior === DeferBlockBehavior.Manual) {
    return false;
  }
  return isPlatformBrowser(injector);
}
var applyDeferBlockStateWithSchedulingImpl = null;
function \u0275\u0275deferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) {
  const tViewConsts = tView.consts;
  if (placeholderConfigIndex != null) {
    tDetails.placeholderBlockConfig = getConstant(tViewConsts, placeholderConfigIndex);
  }
  if (loadingConfigIndex != null) {
    tDetails.loadingBlockConfig = getConstant(tViewConsts, loadingConfigIndex);
  }
  if (applyDeferBlockStateWithSchedulingImpl === null) {
    applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling;
  }
}
function \u0275\u0275defer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling) {
  const lView = getLView();
  const tView = getTView();
  const adjustedIndex = index + HEADER_OFFSET;
  const tNode = declareTemplate(lView, tView, index, null, 0, 0);
  if (tView.firstCreatePass) {
    performanceMarkFeature("NgDefer");
    const tDetails = {
      primaryTmplIndex,
      loadingTmplIndex: loadingTmplIndex ?? null,
      placeholderTmplIndex: placeholderTmplIndex ?? null,
      errorTmplIndex: errorTmplIndex ?? null,
      placeholderBlockConfig: null,
      loadingBlockConfig: null,
      dependencyResolverFn: dependencyResolverFn ?? null,
      loadingState: DeferDependenciesLoadingState.NOT_STARTED,
      loadingPromise: null,
      providers: null
    };
    enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex);
    setTDeferBlockDetails(tView, adjustedIndex, tDetails);
  }
  const lContainer = lView[adjustedIndex];
  populateDehydratedViewsInLContainer(lContainer, tNode, lView);
  const lDetails = [
    null,
    // NEXT_DEFER_BLOCK_STATE
    DeferBlockInternalState.Initial,
    // DEFER_BLOCK_STATE
    null,
    // STATE_IS_FROZEN_UNTIL
    null,
    // LOADING_AFTER_CLEANUP_FN
    null,
    // TRIGGER_CLEANUP_FNS
    null
    // PREFETCH_TRIGGER_CLEANUP_FNS
  ];
  setLDeferBlockDetails(lView, adjustedIndex, lDetails);
  const cleanupTriggersFn = () => invokeAllTriggerCleanupFns(lDetails);
  storeTriggerCleanupFn(0, lDetails, () => removeLViewOnDestroy(lView, cleanupTriggersFn));
  storeLViewOnDestroy(lView, cleanupTriggersFn);
}
function \u0275\u0275deferWhen(rawValue) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, rawValue)) {
    const prevConsumer = setActiveConsumer(null);
    try {
      const value = Boolean(rawValue);
      const tNode = getSelectedTNode();
      const lDetails = getLDeferBlockDetails(lView, tNode);
      const renderedState = lDetails[DEFER_BLOCK_STATE];
      if (value === false && renderedState === DeferBlockInternalState.Initial) {
        renderPlaceholder(lView, tNode);
      } else if (value === true && (renderedState === DeferBlockInternalState.Initial || renderedState === DeferBlockState.Placeholder)) {
        triggerDeferBlock(lView, tNode);
      }
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
}
function \u0275\u0275deferPrefetchWhen(rawValue) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, rawValue)) {
    const prevConsumer = setActiveConsumer(null);
    try {
      const value = Boolean(rawValue);
      const tView = lView[TVIEW];
      const tNode = getSelectedTNode();
      const tDetails = getTDeferBlockDetails(tView, tNode);
      if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
        triggerPrefetching(tDetails, lView, tNode);
      }
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }
}
function \u0275\u0275deferOnIdle() {
  scheduleDelayedTrigger(onIdle);
}
function \u0275\u0275deferPrefetchOnIdle() {
  scheduleDelayedPrefetching(onIdle);
}
function \u0275\u0275deferOnImmediate() {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const tView = lView[TVIEW];
  const injector = lView[INJECTOR];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  if (!shouldTriggerDeferBlock(injector) || tDetails.loadingTmplIndex === null) {
    renderPlaceholder(lView, tNode);
  }
  triggerDeferBlock(lView, tNode);
}
function \u0275\u0275deferPrefetchOnImmediate() {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const tView = lView[TVIEW];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
    triggerResourceLoading(tDetails, lView, tNode);
  }
}
function \u0275\u0275deferOnTimer(delay2) {
  scheduleDelayedTrigger(onTimer(delay2));
}
function \u0275\u0275deferPrefetchOnTimer(delay2) {
  scheduleDelayedPrefetching(onTimer(delay2));
}
function \u0275\u0275deferOnHover(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  renderPlaceholder(lView, tNode);
  registerDomTrigger(
    lView,
    tNode,
    triggerIndex,
    walkUpTimes,
    onHover,
    () => triggerDeferBlock(lView, tNode),
    0
    /* TriggerType.Regular */
  );
}
function \u0275\u0275deferPrefetchOnHover(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const tView = lView[TVIEW];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
    registerDomTrigger(
      lView,
      tNode,
      triggerIndex,
      walkUpTimes,
      onHover,
      () => triggerPrefetching(tDetails, lView, tNode),
      1
      /* TriggerType.Prefetch */
    );
  }
}
function \u0275\u0275deferOnInteraction(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  renderPlaceholder(lView, tNode);
  registerDomTrigger(
    lView,
    tNode,
    triggerIndex,
    walkUpTimes,
    onInteraction,
    () => triggerDeferBlock(lView, tNode),
    0
    /* TriggerType.Regular */
  );
}
function \u0275\u0275deferPrefetchOnInteraction(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const tView = lView[TVIEW];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
    registerDomTrigger(
      lView,
      tNode,
      triggerIndex,
      walkUpTimes,
      onInteraction,
      () => triggerPrefetching(tDetails, lView, tNode),
      1
      /* TriggerType.Prefetch */
    );
  }
}
function \u0275\u0275deferOnViewport(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  renderPlaceholder(lView, tNode);
  registerDomTrigger(
    lView,
    tNode,
    triggerIndex,
    walkUpTimes,
    onViewport,
    () => triggerDeferBlock(lView, tNode),
    0
    /* TriggerType.Regular */
  );
}
function \u0275\u0275deferPrefetchOnViewport(triggerIndex, walkUpTimes) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  const tView = lView[TVIEW];
  const tDetails = getTDeferBlockDetails(tView, tNode);
  if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
    registerDomTrigger(
      lView,
      tNode,
      triggerIndex,
      walkUpTimes,
      onViewport,
      () => triggerPrefetching(tDetails, lView, tNode),
      1
      /* TriggerType.Prefetch */
    );
  }
}
function scheduleDelayedTrigger(scheduleFn) {
  const lView = getLView();
  const tNode = getCurrentTNode();
  renderPlaceholder(lView, tNode);
  if (isPlatformBrowser(lView[INJECTOR])) {
    const cleanupFn = scheduleFn(() => triggerDeferBlock(lView, tNode), lView);
    const lDetails = getLDeferBlockDetails(lView, tNode);
    storeTriggerCleanupFn(0, lDetails, cleanupFn);
  }
}
function scheduleDelayedPrefetching(scheduleFn) {
  const lView = getLView();
  if (isPlatformBrowser(lView[INJECTOR])) {
    const tNode = getCurrentTNode();
    const tView = lView[TVIEW];
    const tDetails = getTDeferBlockDetails(tView, tNode);
    if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) {
      const lDetails = getLDeferBlockDetails(lView, tNode);
      const prefetch = () => triggerPrefetching(tDetails, lView, tNode);
      const cleanupFn = scheduleFn(prefetch, lView);
      storeTriggerCleanupFn(1, lDetails, cleanupFn);
    }
  }
}
function renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) {
  const hostLView = lContainer[PARENT];
  const hostTView = hostLView[TVIEW];
  if (isDestroyed(hostLView))
    return;
  ngDevMode && assertTNodeForLView(tNode, hostLView);
  const lDetails = getLDeferBlockDetails(hostLView, tNode);
  ngDevMode && assertDefined(lDetails, "Expected a defer block state defined");
  const currentState = lDetails[DEFER_BLOCK_STATE];
  if (isValidStateChange(currentState, newState) && isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) {
    const injector = hostLView[INJECTOR];
    const tDetails = getTDeferBlockDetails(hostTView, tNode);
    const needsScheduling = !skipTimerScheduling && isPlatformBrowser(injector) && (getLoadingBlockAfter(tDetails) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Placeholder));
    if (ngDevMode && needsScheduling) {
      assertDefined(applyDeferBlockStateWithSchedulingImpl, "Expected scheduling function to be defined");
    }
    const applyStateFn = needsScheduling ? applyDeferBlockStateWithSchedulingImpl : applyDeferBlockState;
    try {
      applyStateFn(newState, lDetails, lContainer, tNode, hostLView);
    } catch (error3) {
      handleError(hostLView, error3);
    }
  }
}
function isRouterOutletInjector(currentInjector) {
  return currentInjector instanceof ChainedInjector && typeof currentInjector.injector.__ngOutletInjector === "function";
}
function createRouterOutletInjector(parentOutletInjector, parentInjector) {
  const outletInjector = parentOutletInjector.injector;
  return outletInjector.__ngOutletInjector(parentInjector);
}
function applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) {
  const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode);
  if (stateTmplIndex !== null) {
    lDetails[DEFER_BLOCK_STATE] = newState;
    const hostTView = hostLView[TVIEW];
    const adjustedIndex = stateTmplIndex + HEADER_OFFSET;
    const activeBlockTNode = getTNode(hostTView, adjustedIndex);
    const viewIndex = 0;
    removeLViewFromLContainer(lContainer, viewIndex);
    let injector;
    if (newState === DeferBlockState.Complete) {
      const tDetails = getTDeferBlockDetails(hostTView, tNode);
      const providers = tDetails.providers;
      if (providers && providers.length > 0) {
        const parentInjector = hostLView[INJECTOR];
        const isParentOutletInjector = isRouterOutletInjector(parentInjector);
        const parentEnvInjector = isParentOutletInjector ? parentInjector : parentInjector.get(EnvironmentInjector);
        injector = parentEnvInjector.get(CachedInjectorService).getOrCreateInjector(tDetails, parentEnvInjector, providers, ngDevMode ? "DeferBlock Injector" : "");
        if (isParentOutletInjector) {
          injector = createRouterOutletInjector(parentInjector, injector);
        }
      }
    }
    const dehydratedView = findMatchingDehydratedView(lContainer, activeBlockTNode.tView.ssrId);
    const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, {
      dehydratedView,
      injector
    });
    addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView));
    markViewDirty(
      embeddedLView,
      2
      /* NotificationSource.DeferBlockStateUpdate */
    );
  }
}
function applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) {
  const now = Date.now();
  const hostTView = hostLView[TVIEW];
  const tDetails = getTDeferBlockDetails(hostTView, tNode);
  if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) {
    lDetails[STATE_IS_FROZEN_UNTIL] = null;
    const loadingAfter = getLoadingBlockAfter(tDetails);
    const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null;
    if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) {
      lDetails[NEXT_DEFER_BLOCK_STATE] = newState;
      const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView);
      lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn;
    } else {
      if (newState > DeferBlockState.Loading && inLoadingAfterPhase) {
        lDetails[LOADING_AFTER_CLEANUP_FN]();
        lDetails[LOADING_AFTER_CLEANUP_FN] = null;
        lDetails[NEXT_DEFER_BLOCK_STATE] = null;
      }
      applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView);
      const duration = getMinimumDurationForState(tDetails, newState);
      if (duration !== null) {
        lDetails[STATE_IS_FROZEN_UNTIL] = now + duration;
        scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView);
      }
    }
  } else {
    lDetails[NEXT_DEFER_BLOCK_STATE] = newState;
  }
}
function scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) {
  const callback = () => {
    const nextState = lDetails[NEXT_DEFER_BLOCK_STATE];
    lDetails[STATE_IS_FROZEN_UNTIL] = null;
    lDetails[NEXT_DEFER_BLOCK_STATE] = null;
    if (nextState !== null) {
      renderDeferBlockState(nextState, tNode, lContainer);
    }
  };
  return scheduleTimerTrigger(timeout, callback, hostLView);
}
function isValidStateChange(currentState, newState) {
  return currentState < newState;
}
function triggerPrefetching(tDetails, lView, tNode) {
  if (lView[INJECTOR] && shouldTriggerDeferBlock(lView[INJECTOR])) {
    triggerResourceLoading(tDetails, lView, tNode);
  }
}
function triggerResourceLoading(tDetails, lView, tNode) {
  const injector = lView[INJECTOR];
  const tView = lView[TVIEW];
  if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) {
    return tDetails.loadingPromise ?? Promise.resolve();
  }
  const lDetails = getLDeferBlockDetails(lView, tNode);
  const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails);
  tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS;
  invokeTriggerCleanupFns(1, lDetails);
  let dependenciesFn = tDetails.dependencyResolverFn;
  if (ngDevMode) {
    const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, {
      optional: true
    });
    if (deferDependencyInterceptor) {
      dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn);
    }
  }
  const pendingTasks = injector.get(PendingTasks);
  const taskId = pendingTasks.add();
  if (!dependenciesFn) {
    tDetails.loadingPromise = Promise.resolve().then(() => {
      tDetails.loadingPromise = null;
      tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
      pendingTasks.remove(taskId);
    });
    return tDetails.loadingPromise;
  }
  tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then((results) => {
    let failed = false;
    const directiveDefs = [];
    const pipeDefs = [];
    for (const result of results) {
      if (result.status === "fulfilled") {
        const dependency = result.value;
        const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);
        if (directiveDef) {
          directiveDefs.push(directiveDef);
        } else {
          const pipeDef = getPipeDef$1(dependency);
          if (pipeDef) {
            pipeDefs.push(pipeDef);
          }
        }
      } else {
        failed = true;
        break;
      }
    }
    tDetails.loadingPromise = null;
    pendingTasks.remove(taskId);
    if (failed) {
      tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
      if (tDetails.errorTmplIndex === null) {
        const templateLocation = getTemplateLocationDetails(lView);
        const error3 = new RuntimeError(750, ngDevMode && `Loading dependencies for \`@defer\` block failed, but no \`@error\` block was configured${templateLocation}. Consider using the \`@error\` block to render an error state.`);
        handleError(lView, error3);
      }
    } else {
      tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE;
      const primaryBlockTView = primaryBlockTNode.tView;
      if (directiveDefs.length > 0) {
        primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs);
        const directiveTypes = directiveDefs.map((def) => def.type);
        const providers = internalImportProvidersFrom(false, ...directiveTypes);
        tDetails.providers = providers;
      }
      if (pipeDefs.length > 0) {
        primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs);
      }
    }
  });
  return tDetails.loadingPromise;
}
function renderPlaceholder(lView, tNode) {
  const lContainer = lView[tNode.index];
  ngDevMode && assertLContainer(lContainer);
  renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer);
}
function renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) {
  ngDevMode && assertDefined(tDetails.loadingPromise, "Expected loading Promise to exist on this defer block");
  tDetails.loadingPromise.then(() => {
    if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) {
      ngDevMode && assertDeferredDependenciesLoaded(tDetails);
      renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
    } else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) {
      renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
    }
  });
}
function triggerDeferBlock(lView, tNode) {
  const tView = lView[TVIEW];
  const lContainer = lView[tNode.index];
  const injector = lView[INJECTOR];
  ngDevMode && assertLContainer(lContainer);
  if (!shouldTriggerDeferBlock(injector))
    return;
  const lDetails = getLDeferBlockDetails(lView, tNode);
  const tDetails = getTDeferBlockDetails(tView, tNode);
  invokeAllTriggerCleanupFns(lDetails);
  switch (tDetails.loadingState) {
    case DeferDependenciesLoadingState.NOT_STARTED:
      renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);
      triggerResourceLoading(tDetails, lView, tNode);
      if (tDetails.loadingState === DeferDependenciesLoadingState.IN_PROGRESS) {
        renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
      }
      break;
    case DeferDependenciesLoadingState.IN_PROGRESS:
      renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer);
      renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer);
      break;
    case DeferDependenciesLoadingState.COMPLETE:
      ngDevMode && assertDeferredDependenciesLoaded(tDetails);
      renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer);
      break;
    case DeferDependenciesLoadingState.FAILED:
      renderDeferBlockState(DeferBlockState.Error, tNode, lContainer);
      break;
    default:
      if (ngDevMode) {
        throwError2("Unknown defer block state");
      }
  }
}
function \u0275\u0275attribute(name, value, sanitizer, namespace) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, value)) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, "attr." + name, bindingIndex);
  }
  return \u0275\u0275attribute;
}
function interpolationV(lView, values) {
  ngDevMode && assertLessThan(2, values.length, "should have at least 3 values");
  ngDevMode && assertEqual(values.length % 2, 1, "should have an odd number of values");
  let isBindingUpdated = false;
  let bindingIndex = getBindingIndex();
  for (let i2 = 1; i2 < values.length; i2 += 2) {
    isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i2]) || isBindingUpdated;
  }
  setBindingIndex(bindingIndex);
  if (!isBindingUpdated) {
    return NO_CHANGE;
  }
  let content = values[0];
  for (let i2 = 1; i2 < values.length; i2 += 2) {
    content += renderStringify(values[i2]) + values[i2 + 1];
  }
  return content;
}
function interpolation1(lView, prefix, v0, suffix) {
  const different = bindingUpdated(lView, nextBindingIndex(), v0);
  return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
}
function interpolation2(lView, prefix, v0, i0, v14, suffix) {
  const bindingIndex = getBindingIndex();
  const different = bindingUpdated2(lView, bindingIndex, v0, v14);
  incrementBindingIndex(2);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + suffix : NO_CHANGE;
}
function interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix) {
  const bindingIndex = getBindingIndex();
  const different = bindingUpdated3(lView, bindingIndex, v0, v14, v2);
  incrementBindingIndex(3);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + suffix : NO_CHANGE;
}
function interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix) {
  const bindingIndex = getBindingIndex();
  const different = bindingUpdated4(lView, bindingIndex, v0, v14, v2, v3);
  incrementBindingIndex(4);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + suffix : NO_CHANGE;
}
function interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix) {
  const bindingIndex = getBindingIndex();
  let different = bindingUpdated4(lView, bindingIndex, v0, v14, v2, v3);
  different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
  incrementBindingIndex(5);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix : NO_CHANGE;
}
function interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
  const bindingIndex = getBindingIndex();
  let different = bindingUpdated4(lView, bindingIndex, v0, v14, v2, v3);
  different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
  incrementBindingIndex(6);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix : NO_CHANGE;
}
function interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
  const bindingIndex = getBindingIndex();
  let different = bindingUpdated4(lView, bindingIndex, v0, v14, v2, v3);
  different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
  incrementBindingIndex(7);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + suffix : NO_CHANGE;
}
function interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
  const bindingIndex = getBindingIndex();
  let different = bindingUpdated4(lView, bindingIndex, v0, v14, v2, v3);
  different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
  incrementBindingIndex(8);
  return different ? prefix + renderStringify(v0) + i0 + renderStringify(v14) + i1 + renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix : NO_CHANGE;
}
function \u0275\u0275attributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 1, prefix, suffix);
  }
  return \u0275\u0275attributeInterpolate1;
}
function \u0275\u0275attributeInterpolate2(attrName, prefix, v0, i0, v14, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation2(lView, prefix, v0, i0, v14, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 2, prefix, i0, suffix);
  }
  return \u0275\u0275attributeInterpolate2;
}
function \u0275\u0275attributeInterpolate3(attrName, prefix, v0, i0, v14, i1, v2, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
  }
  return \u0275\u0275attributeInterpolate3;
}
function \u0275\u0275attributeInterpolate4(attrName, prefix, v0, i0, v14, i1, v2, i2, v3, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
  }
  return \u0275\u0275attributeInterpolate4;
}
function \u0275\u0275attributeInterpolate5(attrName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
  }
  return \u0275\u0275attributeInterpolate5;
}
function \u0275\u0275attributeInterpolate6(attrName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
  }
  return \u0275\u0275attributeInterpolate6;
}
function \u0275\u0275attributeInterpolate7(attrName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
  }
  return \u0275\u0275attributeInterpolate7;
}
function \u0275\u0275attributeInterpolate8(attrName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer, namespace) {
  const lView = getLView();
  const interpolatedValue = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
    ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
  }
  return \u0275\u0275attributeInterpolate8;
}
function \u0275\u0275attributeInterpolateV(attrName, values, sanitizer, namespace) {
  const lView = getLView();
  const interpolated = interpolationV(lView, values);
  if (interpolated !== NO_CHANGE) {
    const tNode = getSelectedTNode();
    elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);
    if (ngDevMode) {
      const interpolationInBetween = [values[0]];
      for (let i2 = 2; i2 < values.length; i2 += 2) {
        interpolationInBetween.push(values[i2]);
      }
      storePropertyBindingMetadata(getTView().data, tNode, "attr." + attrName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);
    }
  }
  return \u0275\u0275attributeInterpolateV;
}
function toTStylingRange(prev, next) {
  ngDevMode && assertNumberInRange(
    prev,
    0,
    32767
    /* StylingRange.UNSIGNED_MASK */
  );
  ngDevMode && assertNumberInRange(
    next,
    0,
    32767
    /* StylingRange.UNSIGNED_MASK */
  );
  return prev << 17 | next << 2;
}
function getTStylingRangePrev(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return tStylingRange >> 17 & 32767;
}
function getTStylingRangePrevDuplicate(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return (tStylingRange & 2) == 2;
}
function setTStylingRangePrev(tStylingRange, previous) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  ngDevMode && assertNumberInRange(
    previous,
    0,
    32767
    /* StylingRange.UNSIGNED_MASK */
  );
  return tStylingRange & ~4294836224 | previous << 17;
}
function setTStylingRangePrevDuplicate(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return tStylingRange | 2;
}
function getTStylingRangeNext(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return (tStylingRange & 131068) >> 2;
}
function setTStylingRangeNext(tStylingRange, next) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  ngDevMode && assertNumberInRange(
    next,
    0,
    32767
    /* StylingRange.UNSIGNED_MASK */
  );
  return tStylingRange & ~131068 | //
  next << 2;
}
function getTStylingRangeNextDuplicate(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return (tStylingRange & 1) === 1;
}
function setTStylingRangeNextDuplicate(tStylingRange) {
  ngDevMode && assertNumber(tStylingRange, "expected number");
  return tStylingRange | 1;
}
function insertTStylingBinding(tData, tNode, tStylingKeyWithStatic, index, isHostBinding, isClassBinding) {
  ngDevMode && assertFirstUpdatePass(getTView());
  let tBindings = isClassBinding ? tNode.classBindings : tNode.styleBindings;
  let tmplHead = getTStylingRangePrev(tBindings);
  let tmplTail = getTStylingRangeNext(tBindings);
  tData[index] = tStylingKeyWithStatic;
  let isKeyDuplicateOfStatic = false;
  let tStylingKey;
  if (Array.isArray(tStylingKeyWithStatic)) {
    const staticKeyValueArray = tStylingKeyWithStatic;
    tStylingKey = staticKeyValueArray[1];
    if (tStylingKey === null || keyValueArrayIndexOf(staticKeyValueArray, tStylingKey) > 0) {
      isKeyDuplicateOfStatic = true;
    }
  } else {
    tStylingKey = tStylingKeyWithStatic;
  }
  if (isHostBinding) {
    const hasTemplateBindings = tmplTail !== 0;
    if (hasTemplateBindings) {
      const previousNode = getTStylingRangePrev(tData[tmplHead + 1]);
      tData[index + 1] = toTStylingRange(previousNode, tmplHead);
      if (previousNode !== 0) {
        tData[previousNode + 1] = setTStylingRangeNext(tData[previousNode + 1], index);
      }
      tData[tmplHead + 1] = setTStylingRangePrev(tData[tmplHead + 1], index);
    } else {
      tData[index + 1] = toTStylingRange(tmplHead, 0);
      if (tmplHead !== 0) {
        tData[tmplHead + 1] = setTStylingRangeNext(tData[tmplHead + 1], index);
      }
      tmplHead = index;
    }
  } else {
    tData[index + 1] = toTStylingRange(tmplTail, 0);
    ngDevMode && assertEqual(tmplHead !== 0 && tmplTail === 0, false, "Adding template bindings after hostBindings is not allowed.");
    if (tmplHead === 0) {
      tmplHead = index;
    } else {
      tData[tmplTail + 1] = setTStylingRangeNext(tData[tmplTail + 1], index);
    }
    tmplTail = index;
  }
  if (isKeyDuplicateOfStatic) {
    tData[index + 1] = setTStylingRangePrevDuplicate(tData[index + 1]);
  }
  markDuplicates(tData, tStylingKey, index, true);
  markDuplicates(tData, tStylingKey, index, false);
  markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding);
  tBindings = toTStylingRange(tmplHead, tmplTail);
  if (isClassBinding) {
    tNode.classBindings = tBindings;
  } else {
    tNode.styleBindings = tBindings;
  }
}
function markDuplicateOfResidualStyling(tNode, tStylingKey, tData, index, isClassBinding) {
  const residual = isClassBinding ? tNode.residualClasses : tNode.residualStyles;
  if (residual != null && typeof tStylingKey == "string" && keyValueArrayIndexOf(residual, tStylingKey) >= 0) {
    tData[index + 1] = setTStylingRangeNextDuplicate(tData[index + 1]);
  }
}
function markDuplicates(tData, tStylingKey, index, isPrevDir) {
  const tStylingAtIndex = tData[index + 1];
  const isMap = tStylingKey === null;
  let cursor = isPrevDir ? getTStylingRangePrev(tStylingAtIndex) : getTStylingRangeNext(tStylingAtIndex);
  let foundDuplicate = false;
  while (cursor !== 0 && (foundDuplicate === false || isMap)) {
    ngDevMode && assertIndexInRange(tData, cursor);
    const tStylingValueAtCursor = tData[cursor];
    const tStyleRangeAtCursor = tData[cursor + 1];
    if (isStylingMatch(tStylingValueAtCursor, tStylingKey)) {
      foundDuplicate = true;
      tData[cursor + 1] = isPrevDir ? setTStylingRangeNextDuplicate(tStyleRangeAtCursor) : setTStylingRangePrevDuplicate(tStyleRangeAtCursor);
    }
    cursor = isPrevDir ? getTStylingRangePrev(tStyleRangeAtCursor) : getTStylingRangeNext(tStyleRangeAtCursor);
  }
  if (foundDuplicate) {
    tData[index + 1] = isPrevDir ? setTStylingRangePrevDuplicate(tStylingAtIndex) : setTStylingRangeNextDuplicate(tStylingAtIndex);
  }
}
function isStylingMatch(tStylingKeyCursor, tStylingKey) {
  ngDevMode && assertNotEqual(Array.isArray(tStylingKey), true, "Expected that 'tStylingKey' has been unwrapped");
  if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that
  // location so we must assume that we have a match.
  tStylingKey == null || // If `tStylingKey` is `null` then it is a map therefor assume that it
  // contains a match.
  (Array.isArray(tStylingKeyCursor) ? tStylingKeyCursor[1] : tStylingKeyCursor) === tStylingKey) {
    return true;
  } else if (Array.isArray(tStylingKeyCursor) && typeof tStylingKey === "string") {
    return keyValueArrayIndexOf(tStylingKeyCursor, tStylingKey) >= 0;
  }
  return false;
}
var parserState = {
  textEnd: 0,
  key: 0,
  keyEnd: 0,
  value: 0,
  valueEnd: 0
};
function getLastParsedKey(text) {
  return text.substring(parserState.key, parserState.keyEnd);
}
function getLastParsedValue(text) {
  return text.substring(parserState.value, parserState.valueEnd);
}
function parseClassName(text) {
  resetParserState(text);
  return parseClassNameNext(text, consumeWhitespace(text, 0, parserState.textEnd));
}
function parseClassNameNext(text, index) {
  const end = parserState.textEnd;
  if (end === index) {
    return -1;
  }
  index = parserState.keyEnd = consumeClassToken(text, parserState.key = index, end);
  return consumeWhitespace(text, index, end);
}
function parseStyle(text) {
  resetParserState(text);
  return parseStyleNext(text, consumeWhitespace(text, 0, parserState.textEnd));
}
function parseStyleNext(text, startIndex) {
  const end = parserState.textEnd;
  let index = parserState.key = consumeWhitespace(text, startIndex, end);
  if (end === index) {
    return -1;
  }
  index = parserState.keyEnd = consumeStyleKey(text, index, end);
  index = consumeSeparator(
    text,
    index,
    end,
    58
    /* CharCode.COLON */
  );
  index = parserState.value = consumeWhitespace(text, index, end);
  index = parserState.valueEnd = consumeStyleValue(text, index, end);
  return consumeSeparator(
    text,
    index,
    end,
    59
    /* CharCode.SEMI_COLON */
  );
}
function resetParserState(text) {
  parserState.key = 0;
  parserState.keyEnd = 0;
  parserState.value = 0;
  parserState.valueEnd = 0;
  parserState.textEnd = text.length;
}
function consumeWhitespace(text, startIndex, endIndex) {
  while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32) {
    startIndex++;
  }
  return startIndex;
}
function consumeClassToken(text, startIndex, endIndex) {
  while (startIndex < endIndex && text.charCodeAt(startIndex) > 32) {
    startIndex++;
  }
  return startIndex;
}
function consumeStyleKey(text, startIndex, endIndex) {
  let ch;
  while (startIndex < endIndex && ((ch = text.charCodeAt(startIndex)) === 45 || ch === 95 || (ch & -33) >= 65 && (ch & -33) <= 90 || ch >= 48 && ch <= 57)) {
    startIndex++;
  }
  return startIndex;
}
function consumeSeparator(text, startIndex, endIndex, separator) {
  startIndex = consumeWhitespace(text, startIndex, endIndex);
  if (startIndex < endIndex) {
    if (ngDevMode && text.charCodeAt(startIndex) !== separator) {
      malformedStyleError(text, String.fromCharCode(separator), startIndex);
    }
    startIndex++;
  }
  return startIndex;
}
function consumeStyleValue(text, startIndex, endIndex) {
  let ch1 = -1;
  let ch2 = -1;
  let ch3 = -1;
  let i2 = startIndex;
  let lastChIndex = i2;
  while (i2 < endIndex) {
    const ch = text.charCodeAt(i2++);
    if (ch === 59) {
      return lastChIndex;
    } else if (ch === 34 || ch === 39) {
      lastChIndex = i2 = consumeQuotedText(text, ch, i2, endIndex);
    } else if (startIndex === i2 - 4 && // We have seen only 4 characters so far "URL(" (Ignore "foo_URL()")
    ch3 === 85 && ch2 === 82 && ch1 === 76 && ch === 40) {
      lastChIndex = i2 = consumeQuotedText(text, 41, i2, endIndex);
    } else if (ch > 32) {
      lastChIndex = i2;
    }
    ch3 = ch2;
    ch2 = ch1;
    ch1 = ch & -33;
  }
  return lastChIndex;
}
function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
  let ch1 = -1;
  let index = startIndex;
  while (index < endIndex) {
    const ch = text.charCodeAt(index++);
    if (ch == quoteCharCode && ch1 !== 92) {
      return index;
    }
    if (ch == 92 && ch1 === 92) {
      ch1 = 0;
    } else {
      ch1 = ch;
    }
  }
  throw ngDevMode ? malformedStyleError(text, String.fromCharCode(quoteCharCode), endIndex) : new Error();
}
function malformedStyleError(text, expecting, index) {
  ngDevMode && assertEqual(typeof text === "string", true, "String expected here");
  throw throwError2(`Malformed style at location ${index} in string '` + text.substring(0, index) + "[>>" + text.substring(index, index + 1) + "<<]" + text.slice(index + 1) + `'. Expecting '${expecting}'.`);
}
function \u0275\u0275property(propName, value, sanitizer) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, value)) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
  }
  return \u0275\u0275property;
}
function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased) {
  const inputs = tNode.inputs;
  const property = isClassBased ? "class" : "style";
  setInputsForProperty(tView, lView, inputs[property], property, value);
}
function \u0275\u0275styleProp(prop, value, suffix) {
  checkStylingProperty(prop, value, suffix, false);
  return \u0275\u0275styleProp;
}
function \u0275\u0275classProp(className, value) {
  checkStylingProperty(className, value, null, true);
  return \u0275\u0275classProp;
}
function \u0275\u0275styleMap(styles) {
  checkStylingMap(styleKeyValueArraySet, styleStringParser, styles, false);
}
function styleStringParser(keyValueArray, text) {
  for (let i2 = parseStyle(text); i2 >= 0; i2 = parseStyleNext(text, i2)) {
    styleKeyValueArraySet(keyValueArray, getLastParsedKey(text), getLastParsedValue(text));
  }
}
function \u0275\u0275classMap(classes) {
  checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
}
function classStringParser(keyValueArray, text) {
  for (let i2 = parseClassName(text); i2 >= 0; i2 = parseClassNameNext(text, i2)) {
    keyValueArraySet(keyValueArray, getLastParsedKey(text), true);
  }
}
function checkStylingProperty(prop, value, suffix, isClassBased) {
  const lView = getLView();
  const tView = getTView();
  const bindingIndex = incrementBindingIndex(2);
  if (tView.firstUpdatePass) {
    stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);
  }
  if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
    const tNode = tView.data[getSelectedIndex()];
    updateStyling(tView, tNode, lView, lView[RENDERER], prop, lView[bindingIndex + 1] = normalizeSuffix(value, suffix), isClassBased, bindingIndex);
  }
}
function checkStylingMap(keyValueArraySet2, stringParser, value, isClassBased) {
  const tView = getTView();
  const bindingIndex = incrementBindingIndex(2);
  if (tView.firstUpdatePass) {
    stylingFirstUpdatePass(tView, null, bindingIndex, isClassBased);
  }
  const lView = getLView();
  if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
    const tNode = tView.data[getSelectedIndex()];
    if (hasStylingInputShadow(tNode, isClassBased) && !isInHostBindings(tView, bindingIndex)) {
      if (ngDevMode) {
        const tStylingKey = tView.data[bindingIndex];
        assertEqual(Array.isArray(tStylingKey) ? tStylingKey[1] : tStylingKey, false, "Styling linked list shadow input should be marked as 'false'");
      }
      let staticPrefix = isClassBased ? tNode.classesWithoutHost : tNode.stylesWithoutHost;
      ngDevMode && isClassBased === false && staticPrefix !== null && assertEqual(staticPrefix.endsWith(";"), true, "Expecting static portion to end with ';'");
      if (staticPrefix !== null) {
        value = concatStringsWithSpace(staticPrefix, value ? value : "");
      }
      setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isClassBased);
    } else {
      updateStylingMap(tView, tNode, lView, lView[RENDERER], lView[bindingIndex + 1], lView[bindingIndex + 1] = toStylingKeyValueArray(keyValueArraySet2, stringParser, value), isClassBased, bindingIndex);
    }
  }
}
function isInHostBindings(tView, bindingIndex) {
  return bindingIndex >= tView.expandoStartIndex;
}
function stylingFirstUpdatePass(tView, tStylingKey, bindingIndex, isClassBased) {
  ngDevMode && assertFirstUpdatePass(tView);
  const tData = tView.data;
  if (tData[bindingIndex + 1] === null) {
    const tNode = tData[getSelectedIndex()];
    ngDevMode && assertDefined(tNode, "TNode expected");
    const isHostBindings = isInHostBindings(tView, bindingIndex);
    if (hasStylingInputShadow(tNode, isClassBased) && tStylingKey === null && !isHostBindings) {
      tStylingKey = false;
    }
    tStylingKey = wrapInStaticStylingKey(tData, tNode, tStylingKey, isClassBased);
    insertTStylingBinding(tData, tNode, tStylingKey, bindingIndex, isHostBindings, isClassBased);
  }
}
function wrapInStaticStylingKey(tData, tNode, stylingKey, isClassBased) {
  const hostDirectiveDef = getCurrentDirectiveDef(tData);
  let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
  if (hostDirectiveDef === null) {
    const isFirstStylingInstructionInTemplate = (isClassBased ? tNode.classBindings : tNode.styleBindings) === 0;
    if (isFirstStylingInstructionInTemplate) {
      stylingKey = collectStylingFromDirectives(null, tData, tNode, stylingKey, isClassBased);
      stylingKey = collectStylingFromTAttrs(stylingKey, tNode.attrs, isClassBased);
      residual = null;
    }
  } else {
    const directiveStylingLast = tNode.directiveStylingLast;
    const isFirstStylingInstructionInHostBinding = directiveStylingLast === -1 || tData[directiveStylingLast] !== hostDirectiveDef;
    if (isFirstStylingInstructionInHostBinding) {
      stylingKey = collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased);
      if (residual === null) {
        let templateStylingKey = getTemplateHeadTStylingKey(tData, tNode, isClassBased);
        if (templateStylingKey !== void 0 && Array.isArray(templateStylingKey)) {
          templateStylingKey = collectStylingFromDirectives(null, tData, tNode, templateStylingKey[1], isClassBased);
          templateStylingKey = collectStylingFromTAttrs(templateStylingKey, tNode.attrs, isClassBased);
          setTemplateHeadTStylingKey(tData, tNode, isClassBased, templateStylingKey);
        }
      } else {
        residual = collectResidual(tData, tNode, isClassBased);
      }
    }
  }
  if (residual !== void 0) {
    isClassBased ? tNode.residualClasses = residual : tNode.residualStyles = residual;
  }
  return stylingKey;
}
function getTemplateHeadTStylingKey(tData, tNode, isClassBased) {
  const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
  if (getTStylingRangeNext(bindings) === 0) {
    return void 0;
  }
  return tData[getTStylingRangePrev(bindings)];
}
function setTemplateHeadTStylingKey(tData, tNode, isClassBased, tStylingKey) {
  const bindings = isClassBased ? tNode.classBindings : tNode.styleBindings;
  ngDevMode && assertNotEqual(getTStylingRangeNext(bindings), 0, "Expecting to have at least one template styling binding.");
  tData[getTStylingRangePrev(bindings)] = tStylingKey;
}
function collectResidual(tData, tNode, isClassBased) {
  let residual = void 0;
  const directiveEnd = tNode.directiveEnd;
  ngDevMode && assertNotEqual(tNode.directiveStylingLast, -1, "By the time this function gets called at least one hostBindings-node styling instruction must have executed.");
  for (let i2 = 1 + tNode.directiveStylingLast; i2 < directiveEnd; i2++) {
    const attrs = tData[i2].hostAttrs;
    residual = collectStylingFromTAttrs(residual, attrs, isClassBased);
  }
  return collectStylingFromTAttrs(residual, tNode.attrs, isClassBased);
}
function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey, isClassBased) {
  let currentDirective = null;
  const directiveEnd = tNode.directiveEnd;
  let directiveStylingLast = tNode.directiveStylingLast;
  if (directiveStylingLast === -1) {
    directiveStylingLast = tNode.directiveStart;
  } else {
    directiveStylingLast++;
  }
  while (directiveStylingLast < directiveEnd) {
    currentDirective = tData[directiveStylingLast];
    ngDevMode && assertDefined(currentDirective, "expected to be defined");
    stylingKey = collectStylingFromTAttrs(stylingKey, currentDirective.hostAttrs, isClassBased);
    if (currentDirective === hostDirectiveDef)
      break;
    directiveStylingLast++;
  }
  if (hostDirectiveDef !== null) {
    tNode.directiveStylingLast = directiveStylingLast;
  }
  return stylingKey;
}
function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {
  const desiredMarker = isClassBased ? 1 : 2;
  let currentMarker = -1;
  if (attrs !== null) {
    for (let i2 = 0; i2 < attrs.length; i2++) {
      const item = attrs[i2];
      if (typeof item === "number") {
        currentMarker = item;
      } else {
        if (currentMarker === desiredMarker) {
          if (!Array.isArray(stylingKey)) {
            stylingKey = stylingKey === void 0 ? [] : ["", stylingKey];
          }
          keyValueArraySet(stylingKey, item, isClassBased ? true : attrs[++i2]);
        }
      }
    }
  }
  return stylingKey === void 0 ? null : stylingKey;
}
function toStylingKeyValueArray(keyValueArraySet2, stringParser, value) {
  if (value == null || value === "")
    return EMPTY_ARRAY;
  const styleKeyValueArray = [];
  const unwrappedValue = unwrapSafeValue(value);
  if (Array.isArray(unwrappedValue)) {
    for (let i2 = 0; i2 < unwrappedValue.length; i2++) {
      keyValueArraySet2(styleKeyValueArray, unwrappedValue[i2], true);
    }
  } else if (typeof unwrappedValue === "object") {
    for (const key in unwrappedValue) {
      if (unwrappedValue.hasOwnProperty(key)) {
        keyValueArraySet2(styleKeyValueArray, key, unwrappedValue[key]);
      }
    }
  } else if (typeof unwrappedValue === "string") {
    stringParser(styleKeyValueArray, unwrappedValue);
  } else {
    ngDevMode && throwError2("Unsupported styling type " + typeof unwrappedValue + ": " + unwrappedValue);
  }
  return styleKeyValueArray;
}
function styleKeyValueArraySet(keyValueArray, key, value) {
  keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
}
function classKeyValueArraySet(keyValueArray, key, value) {
  const stringKey = String(key);
  if (stringKey !== "" && !stringKey.includes(" ")) {
    keyValueArraySet(keyValueArray, stringKey, value);
  }
}
function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKeyValueArray, isClassBased, bindingIndex) {
  if (oldKeyValueArray === NO_CHANGE) {
    oldKeyValueArray = EMPTY_ARRAY;
  }
  let oldIndex = 0;
  let newIndex = 0;
  let oldKey = 0 < oldKeyValueArray.length ? oldKeyValueArray[0] : null;
  let newKey = 0 < newKeyValueArray.length ? newKeyValueArray[0] : null;
  while (oldKey !== null || newKey !== null) {
    ngDevMode && assertLessThan(oldIndex, 999, "Are we stuck in infinite loop?");
    ngDevMode && assertLessThan(newIndex, 999, "Are we stuck in infinite loop?");
    const oldValue = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex + 1] : void 0;
    const newValue = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex + 1] : void 0;
    let setKey = null;
    let setValue = void 0;
    if (oldKey === newKey) {
      oldIndex += 2;
      newIndex += 2;
      if (oldValue !== newValue) {
        setKey = newKey;
        setValue = newValue;
      }
    } else if (newKey === null || oldKey !== null && oldKey < newKey) {
      oldIndex += 2;
      setKey = oldKey;
    } else {
      ngDevMode && assertDefined(newKey, "Expecting to have a valid key");
      newIndex += 2;
      setKey = newKey;
      setValue = newValue;
    }
    if (setKey !== null) {
      updateStyling(tView, tNode, lView, renderer, setKey, setValue, isClassBased, bindingIndex);
    }
    oldKey = oldIndex < oldKeyValueArray.length ? oldKeyValueArray[oldIndex] : null;
    newKey = newIndex < newKeyValueArray.length ? newKeyValueArray[newIndex] : null;
  }
}
function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {
  if (!(tNode.type & 3)) {
    return;
  }
  const tData = tView.data;
  const tRange = tData[bindingIndex + 1];
  const higherPriorityValue = getTStylingRangeNextDuplicate(tRange) ? findStylingValue(tData, tNode, lView, prop, getTStylingRangeNext(tRange), isClassBased) : void 0;
  if (!isStylingValuePresent(higherPriorityValue)) {
    if (!isStylingValuePresent(value)) {
      if (getTStylingRangePrevDuplicate(tRange)) {
        value = findStylingValue(tData, null, lView, prop, bindingIndex, isClassBased);
      }
    }
    const rNode = getNativeByIndex(getSelectedIndex(), lView);
    applyStyling(renderer, isClassBased, rNode, prop, value);
  }
}
function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
  const isPrevDirection = tNode === null;
  let value = void 0;
  while (index > 0) {
    const rawKey = tData[index];
    const containsStatics = Array.isArray(rawKey);
    const key = containsStatics ? rawKey[1] : rawKey;
    const isStylingMap = key === null;
    let valueAtLViewIndex = lView[index + 1];
    if (valueAtLViewIndex === NO_CHANGE) {
      valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : void 0;
    }
    let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) : key === prop ? valueAtLViewIndex : void 0;
    if (containsStatics && !isStylingValuePresent(currentValue)) {
      currentValue = keyValueArrayGet(rawKey, prop);
    }
    if (isStylingValuePresent(currentValue)) {
      value = currentValue;
      if (isPrevDirection) {
        return value;
      }
    }
    const tRange = tData[index + 1];
    index = isPrevDirection ? getTStylingRangePrev(tRange) : getTStylingRangeNext(tRange);
  }
  if (tNode !== null) {
    let residual = isClassBased ? tNode.residualClasses : tNode.residualStyles;
    if (residual != null) {
      value = keyValueArrayGet(residual, prop);
    }
  }
  return value;
}
function isStylingValuePresent(value) {
  return value !== void 0;
}
function normalizeSuffix(value, suffix) {
  if (value == null || value === "") {
  } else if (typeof suffix === "string") {
    value = value + suffix;
  } else if (typeof value === "object") {
    value = stringify(unwrapSafeValue(value));
  }
  return value;
}
function hasStylingInputShadow(tNode, isClassBased) {
  return (tNode.flags & (isClassBased ? 8 : 16)) !== 0;
}
function \u0275\u0275classMapInterpolate1(prefix, v0, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate2(prefix, v0, i0, v14, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation2(lView, prefix, v0, i0, v14, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate3(prefix, v0, i0, v14, i1, v2, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate4(prefix, v0, i0, v14, i1, v2, i2, v3, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate5(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate6(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate7(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolate8(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275classMapInterpolateV(values) {
  const lView = getLView();
  const interpolatedValue = interpolationV(lView, values);
  checkStylingMap(keyValueArraySet, classStringParser, interpolatedValue, true);
}
function \u0275\u0275componentInstance() {
  const instance = getLView()[DECLARATION_COMPONENT_VIEW][CONTEXT];
  ngDevMode && assertDefined(instance, "Expected component instance to be defined");
  return instance;
}
var LiveCollection = class {
  destroy(item) {
  }
  updateValue(index, value) {
  }
  // operations below could be implemented on top of the operations defined so far, but having
  // them explicitly allow clear expression of intent and potentially more performant
  // implementations
  swap(index1, index2) {
    const startIdx = Math.min(index1, index2);
    const endIdx = Math.max(index1, index2);
    const endItem = this.detach(endIdx);
    if (endIdx - startIdx > 1) {
      const startItem = this.detach(startIdx);
      this.attach(startIdx, endItem);
      this.attach(endIdx, startItem);
    } else {
      this.attach(startIdx, endItem);
    }
  }
  move(prevIndex, newIdx) {
    this.attach(newIdx, this.detach(prevIndex));
  }
};
function valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {
  if (liveIdx === newIdx && Object.is(liveValue, newValue)) {
    return 1;
  } else if (Object.is(trackBy(liveIdx, liveValue), trackBy(newIdx, newValue))) {
    return -1;
  }
  return 0;
}
function recordDuplicateKeys(keyToIdx, key, idx) {
  const idxSoFar = keyToIdx.get(key);
  if (idxSoFar !== void 0) {
    idxSoFar.add(idx);
  } else {
    keyToIdx.set(key, /* @__PURE__ */ new Set([idx]));
  }
}
function reconcile(liveCollection, newCollection, trackByFn) {
  let detachedItems = void 0;
  let liveKeysInTheFuture = void 0;
  let liveStartIdx = 0;
  let liveEndIdx = liveCollection.length - 1;
  const duplicateKeys = ngDevMode ? /* @__PURE__ */ new Map() : void 0;
  if (Array.isArray(newCollection)) {
    let newEndIdx = newCollection.length - 1;
    while (liveStartIdx <= liveEndIdx && liveStartIdx <= newEndIdx) {
      const liveStartValue = liveCollection.at(liveStartIdx);
      const newStartValue = newCollection[liveStartIdx];
      if (ngDevMode) {
        recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newStartValue), liveStartIdx);
      }
      const isStartMatching = valuesMatching(liveStartIdx, liveStartValue, liveStartIdx, newStartValue, trackByFn);
      if (isStartMatching !== 0) {
        if (isStartMatching < 0) {
          liveCollection.updateValue(liveStartIdx, newStartValue);
        }
        liveStartIdx++;
        continue;
      }
      const liveEndValue = liveCollection.at(liveEndIdx);
      const newEndValue = newCollection[newEndIdx];
      if (ngDevMode) {
        recordDuplicateKeys(duplicateKeys, trackByFn(newEndIdx, newEndValue), newEndIdx);
      }
      const isEndMatching = valuesMatching(liveEndIdx, liveEndValue, newEndIdx, newEndValue, trackByFn);
      if (isEndMatching !== 0) {
        if (isEndMatching < 0) {
          liveCollection.updateValue(liveEndIdx, newEndValue);
        }
        liveEndIdx--;
        newEndIdx--;
        continue;
      }
      const liveStartKey = trackByFn(liveStartIdx, liveStartValue);
      const liveEndKey = trackByFn(liveEndIdx, liveEndValue);
      const newStartKey = trackByFn(liveStartIdx, newStartValue);
      if (Object.is(newStartKey, liveEndKey)) {
        const newEndKey = trackByFn(newEndIdx, newEndValue);
        if (Object.is(newEndKey, liveStartKey)) {
          liveCollection.swap(liveStartIdx, liveEndIdx);
          liveCollection.updateValue(liveEndIdx, newEndValue);
          newEndIdx--;
          liveEndIdx--;
        } else {
          liveCollection.move(liveEndIdx, liveStartIdx);
        }
        liveCollection.updateValue(liveStartIdx, newStartValue);
        liveStartIdx++;
        continue;
      }
      detachedItems ??= new UniqueValueMultiKeyMap();
      liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
      if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newStartKey)) {
        liveCollection.updateValue(liveStartIdx, newStartValue);
        liveStartIdx++;
        liveEndIdx++;
      } else if (!liveKeysInTheFuture.has(newStartKey)) {
        const newItem = liveCollection.create(liveStartIdx, newCollection[liveStartIdx]);
        liveCollection.attach(liveStartIdx, newItem);
        liveStartIdx++;
        liveEndIdx++;
      } else {
        detachedItems.set(liveStartKey, liveCollection.detach(liveStartIdx));
        liveEndIdx--;
      }
    }
    while (liveStartIdx <= newEndIdx) {
      createOrAttach(liveCollection, detachedItems, trackByFn, liveStartIdx, newCollection[liveStartIdx]);
      liveStartIdx++;
    }
  } else if (newCollection != null) {
    const newCollectionIterator = newCollection[Symbol.iterator]();
    let newIterationResult = newCollectionIterator.next();
    while (!newIterationResult.done && liveStartIdx <= liveEndIdx) {
      const liveValue = liveCollection.at(liveStartIdx);
      const newValue = newIterationResult.value;
      if (ngDevMode) {
        recordDuplicateKeys(duplicateKeys, trackByFn(liveStartIdx, newValue), liveStartIdx);
      }
      const isStartMatching = valuesMatching(liveStartIdx, liveValue, liveStartIdx, newValue, trackByFn);
      if (isStartMatching !== 0) {
        if (isStartMatching < 0) {
          liveCollection.updateValue(liveStartIdx, newValue);
        }
        liveStartIdx++;
        newIterationResult = newCollectionIterator.next();
      } else {
        detachedItems ??= new UniqueValueMultiKeyMap();
        liveKeysInTheFuture ??= initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
        const newKey = trackByFn(liveStartIdx, newValue);
        if (attachPreviouslyDetached(liveCollection, detachedItems, liveStartIdx, newKey)) {
          liveCollection.updateValue(liveStartIdx, newValue);
          liveStartIdx++;
          liveEndIdx++;
          newIterationResult = newCollectionIterator.next();
        } else if (!liveKeysInTheFuture.has(newKey)) {
          liveCollection.attach(liveStartIdx, liveCollection.create(liveStartIdx, newValue));
          liveStartIdx++;
          liveEndIdx++;
          newIterationResult = newCollectionIterator.next();
        } else {
          const liveKey = trackByFn(liveStartIdx, liveValue);
          detachedItems.set(liveKey, liveCollection.detach(liveStartIdx));
          liveEndIdx--;
        }
      }
    }
    while (!newIterationResult.done) {
      createOrAttach(liveCollection, detachedItems, trackByFn, liveCollection.length, newIterationResult.value);
      newIterationResult = newCollectionIterator.next();
    }
  }
  while (liveStartIdx <= liveEndIdx) {
    liveCollection.destroy(liveCollection.detach(liveEndIdx--));
  }
  detachedItems?.forEach((item) => {
    liveCollection.destroy(item);
  });
  if (ngDevMode) {
    let duplicatedKeysMsg = [];
    for (const [key, idxSet] of duplicateKeys) {
      if (idxSet.size > 1) {
        const idx = [...idxSet].sort((a, b) => a - b);
        for (let i2 = 1; i2 < idx.length; i2++) {
          duplicatedKeysMsg.push(`key "${stringifyForError(key)}" at index "${idx[i2 - 1]}" and "${idx[i2]}"`);
        }
      }
    }
    if (duplicatedKeysMsg.length > 0) {
      const message = formatRuntimeError(-955, "The provided track expression resulted in duplicated keys for a given collection. Adjust the tracking expression such that it uniquely identifies all the items in the collection. Duplicated keys were: \n" + duplicatedKeysMsg.join(", \n") + ".");
      console.warn(message);
    }
  }
}
function attachPreviouslyDetached(prevCollection, detachedItems, index, key) {
  if (detachedItems !== void 0 && detachedItems.has(key)) {
    prevCollection.attach(index, detachedItems.get(key));
    detachedItems.delete(key);
    return true;
  }
  return false;
}
function createOrAttach(liveCollection, detachedItems, trackByFn, index, value) {
  if (!attachPreviouslyDetached(liveCollection, detachedItems, index, trackByFn(index, value))) {
    const newItem = liveCollection.create(index, value);
    liveCollection.attach(index, newItem);
  } else {
    liveCollection.updateValue(index, value);
  }
}
function initLiveItemsInTheFuture(liveCollection, start2, end, trackByFn) {
  const keys = /* @__PURE__ */ new Set();
  for (let i2 = start2; i2 <= end; i2++) {
    keys.add(trackByFn(i2, liveCollection.at(i2)));
  }
  return keys;
}
var UniqueValueMultiKeyMap = class {
  constructor() {
    this.kvMap = /* @__PURE__ */ new Map();
    this._vMap = void 0;
  }
  has(key) {
    return this.kvMap.has(key);
  }
  delete(key) {
    if (!this.has(key))
      return false;
    const value = this.kvMap.get(key);
    if (this._vMap !== void 0 && this._vMap.has(value)) {
      this.kvMap.set(key, this._vMap.get(value));
      this._vMap.delete(value);
    } else {
      this.kvMap.delete(key);
    }
    return true;
  }
  get(key) {
    return this.kvMap.get(key);
  }
  set(key, value) {
    if (this.kvMap.has(key)) {
      let prevValue = this.kvMap.get(key);
      ngDevMode && assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);
      if (this._vMap === void 0) {
        this._vMap = /* @__PURE__ */ new Map();
      }
      const vMap = this._vMap;
      while (vMap.has(prevValue)) {
        prevValue = vMap.get(prevValue);
      }
      vMap.set(prevValue, value);
    } else {
      this.kvMap.set(key, value);
    }
  }
  forEach(cb) {
    for (let [key, value] of this.kvMap) {
      cb(value, key);
      if (this._vMap !== void 0) {
        const vMap = this._vMap;
        while (vMap.has(value)) {
          value = vMap.get(value);
          cb(value, key);
        }
      }
    }
  }
};
function \u0275\u0275conditional(matchingTemplateIndex, contextValue) {
  performanceMarkFeature("NgControlFlow");
  const hostLView = getLView();
  const bindingIndex = nextBindingIndex();
  const prevMatchingTemplateIndex = hostLView[bindingIndex] !== NO_CHANGE ? hostLView[bindingIndex] : -1;
  const prevContainer = prevMatchingTemplateIndex !== -1 ? getLContainer(hostLView, HEADER_OFFSET + prevMatchingTemplateIndex) : void 0;
  const viewInContainerIdx = 0;
  if (bindingUpdated(hostLView, bindingIndex, matchingTemplateIndex)) {
    const prevConsumer = setActiveConsumer(null);
    try {
      if (prevContainer !== void 0) {
        removeLViewFromLContainer(prevContainer, viewInContainerIdx);
      }
      if (matchingTemplateIndex !== -1) {
        const nextLContainerIndex = HEADER_OFFSET + matchingTemplateIndex;
        const nextContainer = getLContainer(hostLView, nextLContainerIndex);
        const templateTNode = getExistingTNode(hostLView[TVIEW], nextLContainerIndex);
        const dehydratedView = findMatchingDehydratedView(nextContainer, templateTNode.tView.ssrId);
        const embeddedLView = createAndRenderEmbeddedLView(hostLView, templateTNode, contextValue, {
          dehydratedView
        });
        addLViewToLContainer(nextContainer, embeddedLView, viewInContainerIdx, shouldAddViewToDom(templateTNode, dehydratedView));
      }
    } finally {
      setActiveConsumer(prevConsumer);
    }
  } else if (prevContainer !== void 0) {
    const lView = getLViewFromLContainer(prevContainer, viewInContainerIdx);
    if (lView !== void 0) {
      lView[CONTEXT] = contextValue;
    }
  }
}
var RepeaterContext = class {
  constructor(lContainer, $implicit, $index) {
    this.lContainer = lContainer;
    this.$implicit = $implicit;
    this.$index = $index;
  }
  get $count() {
    return this.lContainer.length - CONTAINER_HEADER_OFFSET;
  }
};
function \u0275\u0275repeaterTrackByIndex(index) {
  return index;
}
function \u0275\u0275repeaterTrackByIdentity(_, value) {
  return value;
}
var RepeaterMetadata = class {
  constructor(hasEmptyBlock, trackByFn, liveCollection) {
    this.hasEmptyBlock = hasEmptyBlock;
    this.trackByFn = trackByFn;
    this.liveCollection = liveCollection;
  }
};
function \u0275\u0275repeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {
  performanceMarkFeature("NgControlFlow");
  ngDevMode && assertFunction(trackByFn, `A track expression must be a function, was ${typeof trackByFn} instead.`);
  const lView = getLView();
  const tView = getTView();
  const hasEmptyBlock = emptyTemplateFn !== void 0;
  const hostLView = getLView();
  const boundTrackBy = trackByUsesComponentInstance ? (
    // We only want to bind when necessary, because it produces a
    // new function. For pure functions it's not necessary.
    trackByFn.bind(hostLView[DECLARATION_COMPONENT_VIEW][CONTEXT])
  ) : trackByFn;
  const metadata = new RepeaterMetadata(hasEmptyBlock, boundTrackBy);
  hostLView[HEADER_OFFSET + index] = metadata;
  declareTemplate(lView, tView, index + 1, templateFn, decls, vars, tagName, getConstant(tView.consts, attrsIndex));
  if (hasEmptyBlock) {
    ngDevMode && assertDefined(emptyDecls, "Missing number of declarations for the empty repeater block.");
    ngDevMode && assertDefined(emptyVars, "Missing number of bindings for the empty repeater block.");
    declareTemplate(lView, tView, index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, getConstant(tView.consts, emptyAttrsIndex));
  }
}
function isViewExpensiveToRecreate(lView) {
  return lView.length - HEADER_OFFSET > 2;
}
var OperationsCounter = class {
  constructor() {
    this.created = 0;
    this.destroyed = 0;
  }
  reset() {
    this.created = 0;
    this.destroyed = 0;
  }
  recordCreate() {
    this.created++;
  }
  recordDestroy() {
    this.destroyed++;
  }
  /**
   * A method indicating if the entire collection was re-created as part of the reconciliation pass.
   * Used to warn developers about the usage of a tracking function that might result in excessive
   * amount of view creation / destroy operations.
   *
   * @returns boolean value indicating if a live collection was re-created
   */
  wasReCreated(collectionLen) {
    return collectionLen > 0 && this.created === this.destroyed && this.created === collectionLen;
  }
};
var LiveCollectionLContainerImpl = class extends LiveCollection {
  constructor(lContainer, hostLView, templateTNode) {
    super();
    this.lContainer = lContainer;
    this.hostLView = hostLView;
    this.templateTNode = templateTNode;
    this.operationsCounter = ngDevMode ? new OperationsCounter() : void 0;
    this.needsIndexUpdate = false;
  }
  get length() {
    return this.lContainer.length - CONTAINER_HEADER_OFFSET;
  }
  at(index) {
    return this.getLView(index)[CONTEXT].$implicit;
  }
  attach(index, lView) {
    const dehydratedView = lView[HYDRATION];
    this.needsIndexUpdate ||= index !== this.length;
    addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));
  }
  detach(index) {
    this.needsIndexUpdate ||= index !== this.length - 1;
    return detachExistingView(this.lContainer, index);
  }
  create(index, value) {
    const dehydratedView = findMatchingDehydratedView(this.lContainer, this.templateTNode.tView.ssrId);
    const embeddedLView = createAndRenderEmbeddedLView(this.hostLView, this.templateTNode, new RepeaterContext(this.lContainer, value, index), { dehydratedView });
    this.operationsCounter?.recordCreate();
    return embeddedLView;
  }
  destroy(lView) {
    destroyLView(lView[TVIEW], lView);
    this.operationsCounter?.recordDestroy();
  }
  updateValue(index, value) {
    this.getLView(index)[CONTEXT].$implicit = value;
  }
  reset() {
    this.needsIndexUpdate = false;
    this.operationsCounter?.reset();
  }
  updateIndexes() {
    if (this.needsIndexUpdate) {
      for (let i2 = 0; i2 < this.length; i2++) {
        this.getLView(i2)[CONTEXT].$index = i2;
      }
    }
  }
  getLView(index) {
    return getExistingLViewFromLContainer(this.lContainer, index);
  }
};
function \u0275\u0275repeater(collection) {
  const prevConsumer = setActiveConsumer(null);
  const metadataSlotIdx = getSelectedIndex();
  try {
    const hostLView = getLView();
    const hostTView = hostLView[TVIEW];
    const metadata = hostLView[metadataSlotIdx];
    const containerIndex = metadataSlotIdx + 1;
    const lContainer = getLContainer(hostLView, containerIndex);
    if (metadata.liveCollection === void 0) {
      const itemTemplateTNode = getExistingTNode(hostTView, containerIndex);
      metadata.liveCollection = new LiveCollectionLContainerImpl(lContainer, hostLView, itemTemplateTNode);
    } else {
      metadata.liveCollection.reset();
    }
    const liveCollection = metadata.liveCollection;
    reconcile(liveCollection, collection, metadata.trackByFn);
    if (ngDevMode && metadata.trackByFn === \u0275\u0275repeaterTrackByIdentity && liveCollection.operationsCounter?.wasReCreated(liveCollection.length) && isViewExpensiveToRecreate(getExistingLViewFromLContainer(lContainer, 0))) {
      const message = formatRuntimeError(-956, `The configured tracking expression (track by identity) caused re-creation of the entire collection of size ${liveCollection.length}. This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. Please review the "track expression" and make sure that it uniquely identifies items in a collection.`);
      console.warn(message);
    }
    liveCollection.updateIndexes();
    if (metadata.hasEmptyBlock) {
      const bindingIndex = nextBindingIndex();
      const isCollectionEmpty = liveCollection.length === 0;
      if (bindingUpdated(hostLView, bindingIndex, isCollectionEmpty)) {
        const emptyTemplateIndex = metadataSlotIdx + 2;
        const lContainerForEmpty = getLContainer(hostLView, emptyTemplateIndex);
        if (isCollectionEmpty) {
          const emptyTemplateTNode = getExistingTNode(hostTView, emptyTemplateIndex);
          const dehydratedView = findMatchingDehydratedView(lContainerForEmpty, emptyTemplateTNode.tView.ssrId);
          const embeddedLView = createAndRenderEmbeddedLView(hostLView, emptyTemplateTNode, void 0, { dehydratedView });
          addLViewToLContainer(lContainerForEmpty, embeddedLView, 0, shouldAddViewToDom(emptyTemplateTNode, dehydratedView));
        } else {
          removeLViewFromLContainer(lContainerForEmpty, 0);
        }
      }
    }
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
function getLContainer(lView, index) {
  const lContainer = lView[index];
  ngDevMode && assertLContainer(lContainer);
  return lContainer;
}
function detachExistingView(lContainer, index) {
  const existingLView = detachView(lContainer, index);
  ngDevMode && assertLView(existingLView);
  return existingLView;
}
function getExistingLViewFromLContainer(lContainer, index) {
  const existingLView = getLViewFromLContainer(lContainer, index);
  ngDevMode && assertLView(existingLView);
  return existingLView;
}
function getExistingTNode(tView, index) {
  const tNode = getTNode(tView, index);
  ngDevMode && assertTNode(tNode);
  return tNode;
}
function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
  ngDevMode && assertFirstCreatePass(tView);
  ngDevMode && ngDevMode.firstCreatePass++;
  const tViewConsts = tView.consts;
  const attrs = getConstant(tViewConsts, attrsIndex);
  const tNode = getOrCreateTNode(tView, index, 2, name, attrs);
  resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
  if (tNode.attrs !== null) {
    computeStaticStyling(tNode, tNode.attrs, false);
  }
  if (tNode.mergedAttrs !== null) {
    computeStaticStyling(tNode, tNode.mergedAttrs, true);
  }
  if (tView.queries !== null) {
    tView.queries.elementStart(tView, tNode);
  }
  return tNode;
}
function \u0275\u0275elementStart(index, name, attrsIndex, localRefsIndex) {
  const lView = getLView();
  const tView = getTView();
  const adjustedIndex = HEADER_OFFSET + index;
  ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, "elements should be created before any bindings");
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
  const renderer = lView[RENDERER];
  const tNode = tView.firstCreatePass ? elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
  const native = _locateOrCreateElementNode(tView, lView, tNode, renderer, name, index);
  lView[adjustedIndex] = native;
  const hasDirectives = isDirectiveHost(tNode);
  if (ngDevMode && tView.firstCreatePass) {
    validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
  }
  setCurrentTNode(tNode, true);
  setupStaticAttributes(renderer, native, tNode);
  if (!isDetachedByI18n(tNode) && wasLastNodeCreated()) {
    appendChild(tView, lView, native, tNode);
  }
  if (getElementDepthCount() === 0) {
    attachPatchData(native, lView);
  }
  increaseElementDepthCount();
  if (hasDirectives) {
    createDirectivesInstances(tView, lView, tNode);
    executeContentQueries(tView, tNode, lView);
  }
  if (localRefsIndex !== null) {
    saveResolvedLocalsInData(lView, tNode);
  }
  return \u0275\u0275elementStart;
}
function \u0275\u0275elementEnd() {
  let currentTNode = getCurrentTNode();
  ngDevMode && assertDefined(currentTNode, "No parent node to close.");
  if (isCurrentTNodeParent()) {
    setCurrentTNodeAsNotParent();
  } else {
    ngDevMode && assertHasParent(getCurrentTNode());
    currentTNode = currentTNode.parent;
    setCurrentTNode(currentTNode, false);
  }
  const tNode = currentTNode;
  ngDevMode && assertTNodeType(
    tNode,
    3
    /* TNodeType.AnyRNode */
  );
  if (isSkipHydrationRootTNode(tNode)) {
    leaveSkipHydrationBlock();
  }
  decreaseElementDepthCount();
  const tView = getTView();
  if (tView.firstCreatePass) {
    registerPostOrderHooks(tView, currentTNode);
    if (isContentQueryHost(currentTNode)) {
      tView.queries.elementEnd(currentTNode);
    }
  }
  if (tNode.classesWithoutHost != null && hasClassInput(tNode)) {
    setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.classesWithoutHost, true);
  }
  if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {
    setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);
  }
  return \u0275\u0275elementEnd;
}
function \u0275\u0275element(index, name, attrsIndex, localRefsIndex) {
  \u0275\u0275elementStart(index, name, attrsIndex, localRefsIndex);
  \u0275\u0275elementEnd();
  return \u0275\u0275element;
}
var _locateOrCreateElementNode = (tView, lView, tNode, renderer, name, index) => {
  lastNodeWasCreated(true);
  return createElementNode(renderer, name, getNamespace$1());
};
function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, localRefsIndex) {
  ngDevMode && ngDevMode.firstCreatePass++;
  const tViewConsts = tView.consts;
  const attrs = getConstant(tViewConsts, attrsIndex);
  const tNode = getOrCreateTNode(tView, index, 8, "ng-container", attrs);
  if (attrs !== null) {
    computeStaticStyling(tNode, attrs, true);
  }
  const localRefs = getConstant(tViewConsts, localRefsIndex);
  resolveDirectives(tView, lView, tNode, localRefs);
  if (tView.queries !== null) {
    tView.queries.elementStart(tView, tNode);
  }
  return tNode;
}
function \u0275\u0275elementContainerStart(index, attrsIndex, localRefsIndex) {
  const lView = getLView();
  const tView = getTView();
  const adjustedIndex = index + HEADER_OFFSET;
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
  ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, "element containers should be created before any bindings");
  const tNode = tView.firstCreatePass ? elementContainerStartFirstCreatePass(adjustedIndex, tView, lView, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];
  setCurrentTNode(tNode, true);
  const comment = _locateOrCreateElementContainerNode(tView, lView, tNode, index);
  lView[adjustedIndex] = comment;
  if (wasLastNodeCreated()) {
    appendChild(tView, lView, comment, tNode);
  }
  attachPatchData(comment, lView);
  if (isDirectiveHost(tNode)) {
    createDirectivesInstances(tView, lView, tNode);
    executeContentQueries(tView, tNode, lView);
  }
  if (localRefsIndex != null) {
    saveResolvedLocalsInData(lView, tNode);
  }
  return \u0275\u0275elementContainerStart;
}
function \u0275\u0275elementContainerEnd() {
  let currentTNode = getCurrentTNode();
  const tView = getTView();
  if (isCurrentTNodeParent()) {
    setCurrentTNodeAsNotParent();
  } else {
    ngDevMode && assertHasParent(currentTNode);
    currentTNode = currentTNode.parent;
    setCurrentTNode(currentTNode, false);
  }
  ngDevMode && assertTNodeType(
    currentTNode,
    8
    /* TNodeType.ElementContainer */
  );
  if (tView.firstCreatePass) {
    registerPostOrderHooks(tView, currentTNode);
    if (isContentQueryHost(currentTNode)) {
      tView.queries.elementEnd(currentTNode);
    }
  }
  return \u0275\u0275elementContainerEnd;
}
function \u0275\u0275elementContainer(index, attrsIndex, localRefsIndex) {
  \u0275\u0275elementContainerStart(index, attrsIndex, localRefsIndex);
  \u0275\u0275elementContainerEnd();
  return \u0275\u0275elementContainer;
}
var _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {
  lastNodeWasCreated(true);
  return createCommentNode(lView[RENDERER], ngDevMode ? "ng-container" : "");
};
function \u0275\u0275getCurrentView() {
  return getLView();
}
function \u0275\u0275hostProperty(propName, value, sanitizer) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, value)) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
  }
  return \u0275\u0275hostProperty;
}
function \u0275\u0275syntheticHostProperty(propName, value, sanitizer) {
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, value)) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    const currentDef = getCurrentDirectiveDef(tView.data);
    const renderer = loadComponentRenderer(currentDef, tNode, lView);
    elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
  }
  return \u0275\u0275syntheticHostProperty;
}
if (false) {
  (function() {
    _global["ngI18nClosureMode"] = // TODO(FW-1250): validate that this actually, you know, works.
    // tslint:disable-next-line:no-toplevel-property-access
    typeof goog !== "undefined" && typeof goog.getMsg === "function";
  })();
}
var u = void 0;
function plural(val) {
  const n = val, i2 = Math.floor(Math.abs(val)), v = val.toString().replace(/^[^.]*\.?/, "").length;
  if (i2 === 1 && v === 0)
    return 1;
  return 5;
}
var localeEn = ["en", [["a", "p"], ["AM", "PM"], u], [["AM", "PM"], u, u], [["S", "M", "T", "W", "T", "F", "S"], ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]], u, [["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]], u, [["B", "A"], ["BC", "AD"], ["Before Christ", "Anno Domini"]], 0, [6, 0], ["M/d/yy", "MMM d, y", "MMMM d, y", "EEEE, MMMM d, y"], ["h:mm a", "h:mm:ss a", "h:mm:ss a z", "h:mm:ss a zzzz"], ["{1}, {0}", u, "{1} 'at' {0}", u], [".", ",", ";", "%", "+", "-", "E", "\xD7", "\u2030", "\u221E", "NaN", ":"], ["#,##0.###", "#,##0%", "\xA4#,##0.00", "#E0"], "USD", "$", "US Dollar", {}, "ltr", plural];
var LOCALE_DATA = {};
function findLocaleData(locale) {
  const normalizedLocale = normalizeLocale(locale);
  let match2 = getLocaleData(normalizedLocale);
  if (match2) {
    return match2;
  }
  const parentLocale = normalizedLocale.split("-")[0];
  match2 = getLocaleData(parentLocale);
  if (match2) {
    return match2;
  }
  if (parentLocale === "en") {
    return localeEn;
  }
  throw new RuntimeError(701, ngDevMode && `Missing locale data for the locale "${locale}".`);
}
function getLocalePluralCase(locale) {
  const data = findLocaleData(locale);
  return data[LocaleDataIndex.PluralCase];
}
function getLocaleData(normalizedLocale) {
  if (!(normalizedLocale in LOCALE_DATA)) {
    LOCALE_DATA[normalizedLocale] = _global.ng && _global.ng.common && _global.ng.common.locales && _global.ng.common.locales[normalizedLocale];
  }
  return LOCALE_DATA[normalizedLocale];
}
var LocaleDataIndex;
(function(LocaleDataIndex2) {
  LocaleDataIndex2[LocaleDataIndex2["LocaleId"] = 0] = "LocaleId";
  LocaleDataIndex2[LocaleDataIndex2["DayPeriodsFormat"] = 1] = "DayPeriodsFormat";
  LocaleDataIndex2[LocaleDataIndex2["DayPeriodsStandalone"] = 2] = "DayPeriodsStandalone";
  LocaleDataIndex2[LocaleDataIndex2["DaysFormat"] = 3] = "DaysFormat";
  LocaleDataIndex2[LocaleDataIndex2["DaysStandalone"] = 4] = "DaysStandalone";
  LocaleDataIndex2[LocaleDataIndex2["MonthsFormat"] = 5] = "MonthsFormat";
  LocaleDataIndex2[LocaleDataIndex2["MonthsStandalone"] = 6] = "MonthsStandalone";
  LocaleDataIndex2[LocaleDataIndex2["Eras"] = 7] = "Eras";
  LocaleDataIndex2[LocaleDataIndex2["FirstDayOfWeek"] = 8] = "FirstDayOfWeek";
  LocaleDataIndex2[LocaleDataIndex2["WeekendRange"] = 9] = "WeekendRange";
  LocaleDataIndex2[LocaleDataIndex2["DateFormat"] = 10] = "DateFormat";
  LocaleDataIndex2[LocaleDataIndex2["TimeFormat"] = 11] = "TimeFormat";
  LocaleDataIndex2[LocaleDataIndex2["DateTimeFormat"] = 12] = "DateTimeFormat";
  LocaleDataIndex2[LocaleDataIndex2["NumberSymbols"] = 13] = "NumberSymbols";
  LocaleDataIndex2[LocaleDataIndex2["NumberFormats"] = 14] = "NumberFormats";
  LocaleDataIndex2[LocaleDataIndex2["CurrencyCode"] = 15] = "CurrencyCode";
  LocaleDataIndex2[LocaleDataIndex2["CurrencySymbol"] = 16] = "CurrencySymbol";
  LocaleDataIndex2[LocaleDataIndex2["CurrencyName"] = 17] = "CurrencyName";
  LocaleDataIndex2[LocaleDataIndex2["Currencies"] = 18] = "Currencies";
  LocaleDataIndex2[LocaleDataIndex2["Directionality"] = 19] = "Directionality";
  LocaleDataIndex2[LocaleDataIndex2["PluralCase"] = 20] = "PluralCase";
  LocaleDataIndex2[LocaleDataIndex2["ExtraData"] = 21] = "ExtraData";
})(LocaleDataIndex || (LocaleDataIndex = {}));
function normalizeLocale(locale) {
  return locale.toLowerCase().replace(/_/g, "-");
}
var pluralMapping = ["zero", "one", "two", "few", "many"];
function getPluralCase(value, locale) {
  const plural2 = getLocalePluralCase(locale)(parseInt(value, 10));
  const result = pluralMapping[plural2];
  return result !== void 0 ? result : "other";
}
var DEFAULT_LOCALE_ID = "en-US";
var USD_CURRENCY_CODE = "USD";
var ELEMENT_MARKER = {
  marker: "element"
};
var ICU_MARKER = {
  marker: "ICU"
};
var I18nCreateOpCode;
(function(I18nCreateOpCode2) {
  I18nCreateOpCode2[I18nCreateOpCode2["SHIFT"] = 2] = "SHIFT";
  I18nCreateOpCode2[I18nCreateOpCode2["APPEND_EAGERLY"] = 1] = "APPEND_EAGERLY";
  I18nCreateOpCode2[I18nCreateOpCode2["COMMENT"] = 2] = "COMMENT";
})(I18nCreateOpCode || (I18nCreateOpCode = {}));
var LOCALE_ID$1 = DEFAULT_LOCALE_ID;
function setLocaleId(localeId) {
  ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);
  if (typeof localeId === "string") {
    LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, "-");
  }
}
function getLocaleId() {
  return LOCALE_ID$1;
}
var changeMask = 0;
var changeMaskCounter = 0;
function setMaskBit(hasChange) {
  if (hasChange) {
    changeMask = changeMask | 1 << Math.min(changeMaskCounter, 31);
  }
  changeMaskCounter++;
}
function applyI18n(tView, lView, index) {
  if (changeMaskCounter > 0) {
    ngDevMode && assertDefined(tView, `tView should be defined`);
    const tI18n = tView.data[index];
    const updateOpCodes = Array.isArray(tI18n) ? tI18n : tI18n.update;
    const bindingsStartIndex = getBindingIndex() - changeMaskCounter - 1;
    applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask);
  }
  changeMask = 0;
  changeMaskCounter = 0;
}
function createNodeWithoutHydration(lView, textOrName, nodeType) {
  const renderer = lView[RENDERER];
  switch (nodeType) {
    case Node.COMMENT_NODE:
      return createCommentNode(renderer, textOrName);
    case Node.TEXT_NODE:
      return createTextNode(renderer, textOrName);
    case Node.ELEMENT_NODE:
      return createElementNode(renderer, textOrName, null);
  }
}
var _locateOrCreateNode = (lView, index, textOrName, nodeType) => {
  lastNodeWasCreated(true);
  return createNodeWithoutHydration(lView, textOrName, nodeType);
};
function applyCreateOpCodes(lView, createOpCodes, parentRNode, insertInFrontOf) {
  const renderer = lView[RENDERER];
  for (let i2 = 0; i2 < createOpCodes.length; i2++) {
    const opCode = createOpCodes[i2++];
    const text = createOpCodes[i2];
    const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
    const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
    const index = opCode >>> I18nCreateOpCode.SHIFT;
    let rNode = lView[index];
    let lastNodeWasCreated2 = false;
    if (rNode === null) {
      rNode = lView[index] = _locateOrCreateNode(lView, index, text, isComment ? Node.COMMENT_NODE : Node.TEXT_NODE);
      lastNodeWasCreated2 = wasLastNodeCreated();
    }
    if (appendNow && parentRNode !== null && lastNodeWasCreated2) {
      nativeInsertBefore(renderer, parentRNode, rNode, insertInFrontOf, false);
    }
  }
}
function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
  ngDevMode && assertDomNode(anchorRNode);
  const renderer = lView[RENDERER];
  let rootIdx = null;
  let rootRNode;
  for (let i2 = 0; i2 < mutableOpCodes.length; i2++) {
    const opCode = mutableOpCodes[i2];
    if (typeof opCode == "string") {
      const textNodeIndex = mutableOpCodes[++i2];
      if (lView[textNodeIndex] === null) {
        ngDevMode && ngDevMode.rendererCreateTextNode++;
        ngDevMode && assertIndexInRange(lView, textNodeIndex);
        lView[textNodeIndex] = _locateOrCreateNode(lView, textNodeIndex, opCode, Node.TEXT_NODE);
      }
    } else if (typeof opCode == "number") {
      switch (opCode & 1) {
        case 0:
          const parentIdx = getParentFromIcuCreateOpCode(opCode);
          if (rootIdx === null) {
            rootIdx = parentIdx;
            rootRNode = nativeParentNode(renderer, anchorRNode);
          }
          let insertInFrontOf;
          let parentRNode;
          if (parentIdx === rootIdx) {
            insertInFrontOf = anchorRNode;
            parentRNode = rootRNode;
          } else {
            insertInFrontOf = null;
            parentRNode = unwrapRNode(lView[parentIdx]);
          }
          if (parentRNode !== null) {
            ngDevMode && assertDomNode(parentRNode);
            const refIdx = getRefFromIcuCreateOpCode(opCode);
            ngDevMode && assertGreaterThan(refIdx, HEADER_OFFSET, "Missing ref");
            const child = lView[refIdx];
            ngDevMode && assertDomNode(child);
            nativeInsertBefore(renderer, parentRNode, child, insertInFrontOf, false);
            const tIcu = getTIcu(tView, refIdx);
            if (tIcu !== null && typeof tIcu === "object") {
              ngDevMode && assertTIcu(tIcu);
              const caseIndex = getCurrentICUCaseIndex(tIcu, lView);
              if (caseIndex !== null) {
                applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, lView[tIcu.anchorIdx]);
              }
            }
          }
          break;
        case 1:
          const elementNodeIndex = opCode >>> 1;
          const attrName = mutableOpCodes[++i2];
          const attrValue = mutableOpCodes[++i2];
          setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
          break;
        default:
          if (ngDevMode) {
            throw new RuntimeError(700, `Unable to determine the type of mutate operation for "${opCode}"`);
          }
      }
    } else {
      switch (opCode) {
        case ICU_MARKER:
          const commentValue = mutableOpCodes[++i2];
          const commentNodeIndex = mutableOpCodes[++i2];
          if (lView[commentNodeIndex] === null) {
            ngDevMode && assertEqual(typeof commentValue, "string", `Expected "${commentValue}" to be a comment node value`);
            ngDevMode && ngDevMode.rendererCreateComment++;
            ngDevMode && assertIndexInExpandoRange(lView, commentNodeIndex);
            const commentRNode = lView[commentNodeIndex] = _locateOrCreateNode(lView, commentNodeIndex, commentValue, Node.COMMENT_NODE);
            attachPatchData(commentRNode, lView);
          }
          break;
        case ELEMENT_MARKER:
          const tagName = mutableOpCodes[++i2];
          const elementNodeIndex = mutableOpCodes[++i2];
          if (lView[elementNodeIndex] === null) {
            ngDevMode && assertEqual(typeof tagName, "string", `Expected "${tagName}" to be an element node tag name`);
            ngDevMode && ngDevMode.rendererCreateElement++;
            ngDevMode && assertIndexInExpandoRange(lView, elementNodeIndex);
            const elementRNode = lView[elementNodeIndex] = _locateOrCreateNode(lView, elementNodeIndex, tagName, Node.ELEMENT_NODE);
            attachPatchData(elementRNode, lView);
          }
          break;
        default:
          ngDevMode && throwError2(`Unable to determine the type of mutate operation for "${opCode}"`);
      }
    }
  }
}
function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, changeMask2) {
  for (let i2 = 0; i2 < updateOpCodes.length; i2++) {
    const checkBit = updateOpCodes[i2];
    const skipCodes = updateOpCodes[++i2];
    if (checkBit & changeMask2) {
      let value = "";
      for (let j = i2 + 1; j <= i2 + skipCodes; j++) {
        const opCode = updateOpCodes[j];
        if (typeof opCode == "string") {
          value += opCode;
        } else if (typeof opCode == "number") {
          if (opCode < 0) {
            value += renderStringify(lView[bindingsStartIndex - opCode]);
          } else {
            const nodeIndex = opCode >>> 2;
            switch (opCode & 3) {
              case 1:
                const propName = updateOpCodes[++j];
                const sanitizeFn = updateOpCodes[++j];
                const tNodeOrTagName = tView.data[nodeIndex];
                ngDevMode && assertDefined(tNodeOrTagName, "Experting TNode or string");
                if (typeof tNodeOrTagName === "string") {
                  setElementAttribute(lView[RENDERER], lView[nodeIndex], null, tNodeOrTagName, propName, value, sanitizeFn);
                } else {
                  elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);
                }
                break;
              case 0:
                const rText = lView[nodeIndex];
                rText !== null && updateTextNode(lView[RENDERER], rText, value);
                break;
              case 2:
                applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);
                break;
              case 3:
                applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);
                break;
            }
          }
        }
      }
    } else {
      const opCode = updateOpCodes[i2 + 1];
      if (opCode > 0 && (opCode & 3) === 3) {
        const nodeIndex = opCode >>> 2;
        const tIcu = getTIcu(tView, nodeIndex);
        const currentIndex = lView[tIcu.currentCaseLViewIndex];
        if (currentIndex < 0) {
          applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView);
        }
      }
    }
    i2 += skipCodes;
  }
}
function applyIcuUpdateCase(tView, tIcu, bindingsStartIndex, lView) {
  ngDevMode && assertIndexInRange(lView, tIcu.currentCaseLViewIndex);
  let activeCaseIndex = lView[tIcu.currentCaseLViewIndex];
  if (activeCaseIndex !== null) {
    let mask = changeMask;
    if (activeCaseIndex < 0) {
      activeCaseIndex = lView[tIcu.currentCaseLViewIndex] = ~activeCaseIndex;
      mask = -1;
    }
    applyUpdateOpCodes(tView, lView, tIcu.update[activeCaseIndex], bindingsStartIndex, mask);
  }
}
function applyIcuSwitchCase(tView, tIcu, lView, value) {
  const caseIndex = getCaseIndex(tIcu, value);
  let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
  if (activeCaseIndex !== caseIndex) {
    applyIcuSwitchCaseRemove(tView, tIcu, lView);
    lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex;
    if (caseIndex !== null) {
      const anchorRNode = lView[tIcu.anchorIdx];
      if (anchorRNode) {
        ngDevMode && assertDomNode(anchorRNode);
        applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode);
      }
      claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex);
    }
  }
}
function applyIcuSwitchCaseRemove(tView, tIcu, lView) {
  let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView);
  if (activeCaseIndex !== null) {
    const removeCodes = tIcu.remove[activeCaseIndex];
    for (let i2 = 0; i2 < removeCodes.length; i2++) {
      const nodeOrIcuIndex = removeCodes[i2];
      if (nodeOrIcuIndex > 0) {
        const rNode = getNativeByIndex(nodeOrIcuIndex, lView);
        rNode !== null && nativeRemoveNode(lView[RENDERER], rNode);
      } else {
        applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex), lView);
      }
    }
  }
}
function getCaseIndex(icuExpression, bindingValue) {
  let index = icuExpression.cases.indexOf(bindingValue);
  if (index === -1) {
    switch (icuExpression.type) {
      case 1: {
        const resolvedCase = getPluralCase(bindingValue, getLocaleId());
        index = icuExpression.cases.indexOf(resolvedCase);
        if (index === -1 && resolvedCase !== "other") {
          index = icuExpression.cases.indexOf("other");
        }
        break;
      }
      case 0: {
        index = icuExpression.cases.indexOf("other");
        break;
      }
    }
  }
  return index === -1 ? null : index;
}
function loadIcuContainerVisitor() {
  const _stack = [];
  let _index = -1;
  let _lView;
  let _removes;
  function icuContainerIteratorStart(tIcuContainerNode, lView) {
    _lView = lView;
    while (_stack.length)
      _stack.pop();
    ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);
    enterIcu(tIcuContainerNode.value, lView);
    return icuContainerIteratorNext;
  }
  function enterIcu(tIcu, lView) {
    _index = 0;
    const currentCase = getCurrentICUCaseIndex(tIcu, lView);
    if (currentCase !== null) {
      ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);
      _removes = tIcu.remove[currentCase];
    } else {
      _removes = EMPTY_ARRAY;
    }
  }
  function icuContainerIteratorNext() {
    if (_index < _removes.length) {
      const removeOpCode = _removes[_index++];
      ngDevMode && assertNumber(removeOpCode, "Expecting OpCode number");
      if (removeOpCode > 0) {
        const rNode = _lView[removeOpCode];
        ngDevMode && assertDomNode(rNode);
        return rNode;
      } else {
        _stack.push(_index, _removes);
        const tIcuIndex = ~removeOpCode;
        const tIcu = _lView[TVIEW].data[tIcuIndex];
        ngDevMode && assertTIcu(tIcu);
        enterIcu(tIcu, _lView);
        return icuContainerIteratorNext();
      }
    } else {
      if (_stack.length === 0) {
        return null;
      } else {
        _removes = _stack.pop();
        _index = _stack.pop();
        return icuContainerIteratorNext();
      }
    }
  }
  return icuContainerIteratorStart;
}
function i18nCreateOpCodesToString(opcodes) {
  const createOpCodes = opcodes || (Array.isArray(this) ? this : []);
  let lines = [];
  for (let i2 = 0; i2 < createOpCodes.length; i2++) {
    const opCode = createOpCodes[i2++];
    const text = createOpCodes[i2];
    const isComment = (opCode & I18nCreateOpCode.COMMENT) === I18nCreateOpCode.COMMENT;
    const appendNow = (opCode & I18nCreateOpCode.APPEND_EAGERLY) === I18nCreateOpCode.APPEND_EAGERLY;
    const index = opCode >>> I18nCreateOpCode.SHIFT;
    lines.push(`lView[${index}] = document.${isComment ? "createComment" : "createText"}(${JSON.stringify(text)});`);
    if (appendNow) {
      lines.push(`parent.appendChild(lView[${index}]);`);
    }
  }
  return lines;
}
function i18nUpdateOpCodesToString(opcodes) {
  const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
  let lines = [];
  function consumeOpCode(value) {
    const ref = value >>> 2;
    const opCode = value & 3;
    switch (opCode) {
      case 0:
        return `(lView[${ref}] as Text).textContent = $$$`;
      case 1:
        const attrName = parser.consumeString();
        const sanitizationFn = parser.consumeFunction();
        const value2 = sanitizationFn ? `(${sanitizationFn})($$$)` : "$$$";
        return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value2})`;
      case 2:
        return `icuSwitchCase(${ref}, $$$)`;
      case 3:
        return `icuUpdateCase(${ref})`;
    }
    throw new Error("unexpected OpCode");
  }
  while (parser.hasMore()) {
    let mask = parser.consumeNumber();
    let size = parser.consumeNumber();
    const end = parser.i + size;
    const statements = [];
    let statement = "";
    while (parser.i < end) {
      let value = parser.consumeNumberOrString();
      if (typeof value === "string") {
        statement += value;
      } else if (value < 0) {
        statement += "${lView[i" + value + "]}";
      } else {
        const opCodeText = consumeOpCode(value);
        statements.push(opCodeText.replace("$$$", "`" + statement + "`") + ";");
        statement = "";
      }
    }
    lines.push(`if (mask & 0b${mask.toString(2)}) { ${statements.join(" ")} }`);
  }
  return lines;
}
function icuCreateOpCodesToString(opcodes) {
  const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
  let lines = [];
  function consumeOpCode(opCode) {
    const parent = getParentFromIcuCreateOpCode(opCode);
    const ref = getRefFromIcuCreateOpCode(opCode);
    switch (getInstructionFromIcuCreateOpCode(opCode)) {
      case 0:
        return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;
      case 1:
        return `(lView[${ref}] as Element).setAttribute("${parser.consumeString()}", "${parser.consumeString()}")`;
    }
    throw new Error("Unexpected OpCode: " + getInstructionFromIcuCreateOpCode(opCode));
  }
  let lastRef = -1;
  while (parser.hasMore()) {
    let value = parser.consumeNumberStringOrMarker();
    if (value === ICU_MARKER) {
      const text = parser.consumeString();
      lastRef = parser.consumeNumber();
      lines.push(`lView[${lastRef}] = document.createComment("${text}")`);
    } else if (value === ELEMENT_MARKER) {
      const text = parser.consumeString();
      lastRef = parser.consumeNumber();
      lines.push(`lView[${lastRef}] = document.createElement("${text}")`);
    } else if (typeof value === "string") {
      lastRef = parser.consumeNumber();
      lines.push(`lView[${lastRef}] = document.createTextNode("${value}")`);
    } else if (typeof value === "number") {
      const line = consumeOpCode(value);
      line && lines.push(line);
    } else {
      throw new Error("Unexpected value");
    }
  }
  return lines;
}
function i18nRemoveOpCodesToString(opcodes) {
  const removeCodes = opcodes || (Array.isArray(this) ? this : []);
  let lines = [];
  for (let i2 = 0; i2 < removeCodes.length; i2++) {
    const nodeOrIcuIndex = removeCodes[i2];
    if (nodeOrIcuIndex > 0) {
      lines.push(`remove(lView[${nodeOrIcuIndex}])`);
    } else {
      lines.push(`removeNestedICU(${~nodeOrIcuIndex})`);
    }
  }
  return lines;
}
var OpCodeParser = class {
  constructor(codes2) {
    this.i = 0;
    this.codes = codes2;
  }
  hasMore() {
    return this.i < this.codes.length;
  }
  consumeNumber() {
    let value = this.codes[this.i++];
    assertNumber(value, "expecting number in OpCode");
    return value;
  }
  consumeString() {
    let value = this.codes[this.i++];
    assertString(value, "expecting string in OpCode");
    return value;
  }
  consumeFunction() {
    let value = this.codes[this.i++];
    if (value === null || typeof value === "function") {
      return value;
    }
    throw new Error("expecting function in OpCode");
  }
  consumeNumberOrString() {
    let value = this.codes[this.i++];
    if (typeof value === "string") {
      return value;
    }
    assertNumber(value, "expecting number or string in OpCode");
    return value;
  }
  consumeNumberStringOrMarker() {
    let value = this.codes[this.i++];
    if (typeof value === "string" || typeof value === "number" || value == ICU_MARKER || value == ELEMENT_MARKER) {
      return value;
    }
    assertNumber(value, "expecting number, string, ICU_MARKER or ELEMENT_MARKER in OpCode");
    return value;
  }
};
var BINDING_REGEXP = /�(\d+):?\d*�/gi;
var ICU_REGEXP = /({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi;
var NESTED_ICU = /�(\d+)�/;
var ICU_BLOCK_REGEXP = /^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/;
var MARKER = `\uFFFD`;
var SUBTEMPLATE_REGEXP = /�\/?\*(\d+:\d+)�/gi;
var PH_REGEXP = /�(\/?[#*]\d+):?\d*�/gi;
var NGSP_UNICODE_REGEXP = /\uE500/g;
function replaceNgsp(value) {
  return value.replace(NGSP_UNICODE_REGEXP, " ");
}
function attachDebugGetter(obj, debugGetter) {
  if (ngDevMode) {
    Object.defineProperty(obj, "debug", { get: debugGetter, enumerable: false });
  } else {
    throw new Error("This method should be guarded with `ngDevMode` so that it can be tree shaken in production!");
  }
}
function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message, subTemplateIndex) {
  const rootTNode = getCurrentParentTNode();
  const createOpCodes = [];
  const updateOpCodes = [];
  const existingTNodeStack = [[]];
  const astStack = [[]];
  if (ngDevMode) {
    attachDebugGetter(createOpCodes, i18nCreateOpCodesToString);
    attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
  }
  message = getTranslationForTemplate(message, subTemplateIndex);
  const msgParts = replaceNgsp(message).split(PH_REGEXP);
  for (let i2 = 0; i2 < msgParts.length; i2++) {
    let value = msgParts[i2];
    if ((i2 & 1) === 0) {
      const parts = i18nParseTextIntoPartsAndICU(value);
      for (let j = 0; j < parts.length; j++) {
        let part = parts[j];
        if ((j & 1) === 0) {
          const text = part;
          ngDevMode && assertString(text, "Parsed ICU part should be string");
          if (text !== "") {
            i18nStartFirstCreatePassProcessTextNode(astStack[0], tView, rootTNode, existingTNodeStack[0], createOpCodes, updateOpCodes, lView, text);
          }
        } else {
          const icuExpression = part;
          if (typeof icuExpression !== "object") {
            throw new Error(`Unable to parse ICU expression in "${message}" message.`);
          }
          const icuContainerTNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodeStack[0], lView, createOpCodes, ngDevMode ? `ICU ${index}:${icuExpression.mainBinding}` : "", true);
          const icuNodeIndex = icuContainerTNode.index;
          ngDevMode && assertGreaterThanOrEqual(icuNodeIndex, HEADER_OFFSET, "Index must be in absolute LView offset");
          icuStart(astStack[0], tView, lView, updateOpCodes, parentTNodeIndex, icuExpression, icuNodeIndex);
        }
      }
    } else {
      const isClosing = value.charCodeAt(0) === 47;
      const type = value.charCodeAt(isClosing ? 1 : 0);
      ngDevMode && assertOneOf(
        type,
        42,
        35
        /* CharCode.HASH */
      );
      const index2 = HEADER_OFFSET + Number.parseInt(value.substring(isClosing ? 2 : 1));
      if (isClosing) {
        existingTNodeStack.shift();
        astStack.shift();
        setCurrentTNode(getCurrentParentTNode(), false);
      } else {
        const tNode = createTNodePlaceholder(tView, existingTNodeStack[0], index2);
        existingTNodeStack.unshift([]);
        setCurrentTNode(tNode, true);
        const placeholderNode = {
          kind: 2,
          index: index2,
          children: [],
          type: type === 35 ? 0 : 1
        };
        astStack[0].push(placeholderNode);
        astStack.unshift(placeholderNode.children);
      }
    }
  }
  tView.data[index] = {
    create: createOpCodes,
    update: updateOpCodes,
    ast: astStack[0]
  };
}
function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, text, isICU) {
  const i18nNodeIdx = allocExpando(tView, lView, 1, null);
  let opCode = i18nNodeIdx << I18nCreateOpCode.SHIFT;
  let parentTNode = getCurrentParentTNode();
  if (rootTNode === parentTNode) {
    parentTNode = null;
  }
  if (parentTNode === null) {
    opCode |= I18nCreateOpCode.APPEND_EAGERLY;
  }
  if (isICU) {
    opCode |= I18nCreateOpCode.COMMENT;
    ensureIcuContainerVisitorLoaded(loadIcuContainerVisitor);
  }
  createOpCodes.push(opCode, text === null ? "" : text);
  const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 : 1, text === null ? ngDevMode ? "{{?}}" : "" : text, null);
  addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);
  const tNodeIdx = tNode.index;
  setCurrentTNode(
    tNode,
    false
    /* Text nodes are self closing */
  );
  if (parentTNode !== null && rootTNode !== parentTNode) {
    setTNodeInsertBeforeIndex(parentTNode, tNodeIdx);
  }
  return tNode;
}
function i18nStartFirstCreatePassProcessTextNode(ast, tView, rootTNode, existingTNodes, createOpCodes, updateOpCodes, lView, text) {
  const hasBinding = text.match(BINDING_REGEXP);
  const tNode = createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, createOpCodes, hasBinding ? null : text, false);
  const index = tNode.index;
  if (hasBinding) {
    generateBindingUpdateOpCodes(updateOpCodes, text, index, null, 0, null);
  }
  ast.push({ kind: 0, index });
}
function i18nAttributesFirstPass(tView, index, values) {
  const previousElement = getCurrentTNode();
  const previousElementIndex = previousElement.index;
  const updateOpCodes = [];
  if (ngDevMode) {
    attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
  }
  if (tView.firstCreatePass && tView.data[index] === null) {
    for (let i2 = 0; i2 < values.length; i2 += 2) {
      const attrName = values[i2];
      const message = values[i2 + 1];
      if (message !== "") {
        if (ICU_REGEXP.test(message)) {
          throw new Error(`ICU expressions are not supported in attributes. Message: "${message}".`);
        }
        generateBindingUpdateOpCodes(updateOpCodes, message, previousElementIndex, attrName, countBindings(updateOpCodes), null);
      }
    }
    tView.data[index] = updateOpCodes;
  }
}
function generateBindingUpdateOpCodes(updateOpCodes, str2, destinationNode, attrName, bindingStart, sanitizeFn) {
  ngDevMode && assertGreaterThanOrEqual(destinationNode, HEADER_OFFSET, "Index must be in absolute LView offset");
  const maskIndex = updateOpCodes.length;
  const sizeIndex = maskIndex + 1;
  updateOpCodes.push(null, null);
  const startIndex = maskIndex + 2;
  if (ngDevMode) {
    attachDebugGetter(updateOpCodes, i18nUpdateOpCodesToString);
  }
  const textParts = str2.split(BINDING_REGEXP);
  let mask = 0;
  for (let j = 0; j < textParts.length; j++) {
    const textValue = textParts[j];
    if (j & 1) {
      const bindingIndex = bindingStart + parseInt(textValue, 10);
      updateOpCodes.push(-1 - bindingIndex);
      mask = mask | toMaskBit(bindingIndex);
    } else if (textValue !== "") {
      updateOpCodes.push(textValue);
    }
  }
  updateOpCodes.push(destinationNode << 2 | (attrName ? 1 : 0));
  if (attrName) {
    updateOpCodes.push(attrName, sanitizeFn);
  }
  updateOpCodes[maskIndex] = mask;
  updateOpCodes[sizeIndex] = updateOpCodes.length - startIndex;
  return mask;
}
function countBindings(opCodes) {
  let count = 0;
  for (let i2 = 0; i2 < opCodes.length; i2++) {
    const opCode = opCodes[i2];
    if (typeof opCode === "number" && opCode < 0) {
      count++;
    }
  }
  return count;
}
function toMaskBit(bindingIndex) {
  return 1 << Math.min(bindingIndex, 31);
}
function removeInnerTemplateTranslation(message) {
  let match2;
  let res = "";
  let index = 0;
  let inTemplate = false;
  let tagMatched;
  while ((match2 = SUBTEMPLATE_REGEXP.exec(message)) !== null) {
    if (!inTemplate) {
      res += message.substring(index, match2.index + match2[0].length);
      tagMatched = match2[1];
      inTemplate = true;
    } else {
      if (match2[0] === `${MARKER}/*${tagMatched}${MARKER}`) {
        index = match2.index;
        inTemplate = false;
      }
    }
  }
  ngDevMode && assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation "${message}"`);
  res += message.slice(index);
  return res;
}
function getTranslationForTemplate(message, subTemplateIndex) {
  if (isRootTemplateMessage(subTemplateIndex)) {
    return removeInnerTemplateTranslation(message);
  } else {
    const start2 = message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;
    const end = message.search(new RegExp(`${MARKER}\\/\\*\\d+:${subTemplateIndex}${MARKER}`));
    return removeInnerTemplateTranslation(message.substring(start2, end));
  }
}
function icuStart(ast, tView, lView, updateOpCodes, parentIdx, icuExpression, anchorIdx) {
  ngDevMode && assertDefined(icuExpression, "ICU expression must be defined");
  let bindingMask = 0;
  const tIcu = {
    type: icuExpression.type,
    currentCaseLViewIndex: allocExpando(tView, lView, 1, null),
    anchorIdx,
    cases: [],
    create: [],
    remove: [],
    update: []
  };
  addUpdateIcuSwitch(updateOpCodes, icuExpression, anchorIdx);
  setTIcu(tView, anchorIdx, tIcu);
  const values = icuExpression.values;
  const cases = [];
  for (let i2 = 0; i2 < values.length; i2++) {
    const valueArr = values[i2];
    const nestedIcus = [];
    for (let j = 0; j < valueArr.length; j++) {
      const value = valueArr[j];
      if (typeof value !== "string") {
        const icuIndex = nestedIcus.push(value) - 1;
        valueArr[j] = `<!--\uFFFD${icuIndex}\uFFFD-->`;
      }
    }
    const caseAst = [];
    cases.push(caseAst);
    bindingMask = parseIcuCase(caseAst, tView, tIcu, lView, updateOpCodes, parentIdx, icuExpression.cases[i2], valueArr.join(""), nestedIcus) | bindingMask;
  }
  if (bindingMask) {
    addUpdateIcuUpdate(updateOpCodes, bindingMask, anchorIdx);
  }
  ast.push({
    kind: 3,
    index: anchorIdx,
    cases,
    currentCaseLViewIndex: tIcu.currentCaseLViewIndex
  });
}
function parseICUBlock(pattern) {
  const cases = [];
  const values = [];
  let icuType = 1;
  let mainBinding = 0;
  pattern = pattern.replace(ICU_BLOCK_REGEXP, function(str2, binding, type) {
    if (type === "select") {
      icuType = 0;
    } else {
      icuType = 1;
    }
    mainBinding = parseInt(binding.slice(1), 10);
    return "";
  });
  const parts = i18nParseTextIntoPartsAndICU(pattern);
  for (let pos = 0; pos < parts.length; ) {
    let key = parts[pos++].trim();
    if (icuType === 1) {
      key = key.replace(/\s*(?:=)?(\w+)\s*/, "$1");
    }
    if (key.length) {
      cases.push(key);
    }
    const blocks = i18nParseTextIntoPartsAndICU(parts[pos++]);
    if (cases.length > values.length) {
      values.push(blocks);
    }
  }
  return { type: icuType, mainBinding, cases, values };
}
function i18nParseTextIntoPartsAndICU(pattern) {
  if (!pattern) {
    return [];
  }
  let prevPos = 0;
  const braceStack = [];
  const results = [];
  const braces = /[{}]/g;
  braces.lastIndex = 0;
  let match2;
  while (match2 = braces.exec(pattern)) {
    const pos = match2.index;
    if (match2[0] == "}") {
      braceStack.pop();
      if (braceStack.length == 0) {
        const block = pattern.substring(prevPos, pos);
        if (ICU_BLOCK_REGEXP.test(block)) {
          results.push(parseICUBlock(block));
        } else {
          results.push(block);
        }
        prevPos = pos + 1;
      }
    } else {
      if (braceStack.length == 0) {
        const substring2 = pattern.substring(prevPos, pos);
        results.push(substring2);
        prevPos = pos + 1;
      }
      braceStack.push("{");
    }
  }
  const substring = pattern.substring(prevPos);
  results.push(substring);
  return results;
}
function parseIcuCase(ast, tView, tIcu, lView, updateOpCodes, parentIdx, caseName, unsafeCaseHtml, nestedIcus) {
  const create4 = [];
  const remove2 = [];
  const update = [];
  if (ngDevMode) {
    attachDebugGetter(create4, icuCreateOpCodesToString);
    attachDebugGetter(remove2, i18nRemoveOpCodesToString);
    attachDebugGetter(update, i18nUpdateOpCodesToString);
  }
  tIcu.cases.push(caseName);
  tIcu.create.push(create4);
  tIcu.remove.push(remove2);
  tIcu.update.push(update);
  const inertBodyHelper2 = getInertBodyHelper(getDocument());
  const inertBodyElement = inertBodyHelper2.getInertBodyElement(unsafeCaseHtml);
  ngDevMode && assertDefined(inertBodyElement, "Unable to generate inert body element");
  const inertRootNode = getTemplateContent(inertBodyElement) || inertBodyElement;
  if (inertRootNode) {
    return walkIcuTree(ast, tView, tIcu, lView, updateOpCodes, create4, remove2, update, inertRootNode, parentIdx, nestedIcus, 0);
  } else {
    return 0;
  }
}
function walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create4, remove2, update, parentNode, parentIdx, nestedIcus, depth) {
  let bindingMask = 0;
  let currentNode = parentNode.firstChild;
  while (currentNode) {
    const newIndex = allocExpando(tView, lView, 1, null);
    switch (currentNode.nodeType) {
      case Node.ELEMENT_NODE:
        const element = currentNode;
        const tagName = element.tagName.toLowerCase();
        if (VALID_ELEMENTS.hasOwnProperty(tagName)) {
          addCreateNodeAndAppend(create4, ELEMENT_MARKER, tagName, parentIdx, newIndex);
          tView.data[newIndex] = tagName;
          const elAttrs = element.attributes;
          for (let i2 = 0; i2 < elAttrs.length; i2++) {
            const attr = elAttrs.item(i2);
            const lowerAttrName = attr.name.toLowerCase();
            const hasBinding2 = !!attr.value.match(BINDING_REGEXP);
            if (hasBinding2) {
              if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {
                if (URI_ATTRS[lowerAttrName]) {
                  generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, _sanitizeUrl);
                } else {
                  generateBindingUpdateOpCodes(update, attr.value, newIndex, attr.name, 0, null);
                }
              } else {
                ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ${lowerAttrName} on element ${tagName} (see ${XSS_SECURITY_URL})`);
              }
            } else {
              addCreateAttribute(create4, newIndex, attr);
            }
          }
          const elementNode = {
            kind: 1,
            index: newIndex,
            children: []
          };
          ast.push(elementNode);
          bindingMask = walkIcuTree(elementNode.children, tView, tIcu, lView, sharedUpdateOpCodes, create4, remove2, update, currentNode, newIndex, nestedIcus, depth + 1) | bindingMask;
          addRemoveNode(remove2, newIndex, depth);
        }
        break;
      case Node.TEXT_NODE:
        const value = currentNode.textContent || "";
        const hasBinding = value.match(BINDING_REGEXP);
        addCreateNodeAndAppend(create4, null, hasBinding ? "" : value, parentIdx, newIndex);
        addRemoveNode(remove2, newIndex, depth);
        if (hasBinding) {
          bindingMask = generateBindingUpdateOpCodes(update, value, newIndex, null, 0, null) | bindingMask;
        }
        ast.push({
          kind: 0,
          index: newIndex
        });
        break;
      case Node.COMMENT_NODE:
        const isNestedIcu = NESTED_ICU.exec(currentNode.textContent || "");
        if (isNestedIcu) {
          const nestedIcuIndex = parseInt(isNestedIcu[1], 10);
          const icuExpression = nestedIcus[nestedIcuIndex];
          addCreateNodeAndAppend(create4, ICU_MARKER, ngDevMode ? `nested ICU ${nestedIcuIndex}` : "", parentIdx, newIndex);
          icuStart(ast, tView, lView, sharedUpdateOpCodes, parentIdx, icuExpression, newIndex);
          addRemoveNestedIcu(remove2, newIndex, depth);
        }
        break;
    }
    currentNode = currentNode.nextSibling;
  }
  return bindingMask;
}
function addRemoveNode(remove2, index, depth) {
  if (depth === 0) {
    remove2.push(index);
  }
}
function addRemoveNestedIcu(remove2, index, depth) {
  if (depth === 0) {
    remove2.push(~index);
    remove2.push(index);
  }
}
function addUpdateIcuSwitch(update, icuExpression, index) {
  update.push(
    toMaskBit(icuExpression.mainBinding),
    2,
    -1 - icuExpression.mainBinding,
    index << 2 | 2
    /* I18nUpdateOpCode.IcuSwitch */
  );
}
function addUpdateIcuUpdate(update, bindingMask, index) {
  update.push(
    bindingMask,
    1,
    index << 2 | 3
    /* I18nUpdateOpCode.IcuUpdate */
  );
}
function addCreateNodeAndAppend(create4, marker, text, appendToParentIdx, createAtIdx) {
  if (marker !== null) {
    create4.push(marker);
  }
  create4.push(text, createAtIdx, icuCreateOpCode(0, appendToParentIdx, createAtIdx));
}
function addCreateAttribute(create4, newIndex, attr) {
  create4.push(newIndex << 1 | 1, attr.name, attr.value);
}
var ROOT_TEMPLATE_ID = 0;
var PP_MULTI_VALUE_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]/;
var PP_PLACEHOLDERS_REGEXP = /\[(�.+?�?)\]|(�\/?\*\d+:\d+�)/g;
var PP_ICU_VARS_REGEXP = /({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g;
var PP_ICU_PLACEHOLDERS_REGEXP = /{([A-Z0-9_]+)}/g;
var PP_ICUS_REGEXP = /�I18N_EXP_(ICU(_\d+)?)�/g;
var PP_CLOSE_TEMPLATE_REGEXP = /\/\*/;
var PP_TEMPLATE_ID_REGEXP = /\d+\:(\d+)/;
function i18nPostprocess(message, replacements = {}) {
  let result = message;
  if (PP_MULTI_VALUE_PLACEHOLDERS_REGEXP.test(message)) {
    const matches = {};
    const templateIdsStack = [ROOT_TEMPLATE_ID];
    result = result.replace(PP_PLACEHOLDERS_REGEXP, (m, phs, tmpl2) => {
      const content = phs || tmpl2;
      const placeholders = matches[content] || [];
      if (!placeholders.length) {
        content.split("|").forEach((placeholder2) => {
          const match2 = placeholder2.match(PP_TEMPLATE_ID_REGEXP);
          const templateId2 = match2 ? parseInt(match2[1], 10) : ROOT_TEMPLATE_ID;
          const isCloseTemplateTag2 = PP_CLOSE_TEMPLATE_REGEXP.test(placeholder2);
          placeholders.push([templateId2, isCloseTemplateTag2, placeholder2]);
        });
        matches[content] = placeholders;
      }
      if (!placeholders.length) {
        throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);
      }
      const currentTemplateId = templateIdsStack[templateIdsStack.length - 1];
      let idx = 0;
      for (let i2 = 0; i2 < placeholders.length; i2++) {
        if (placeholders[i2][0] === currentTemplateId) {
          idx = i2;
          break;
        }
      }
      const [templateId, isCloseTemplateTag, placeholder] = placeholders[idx];
      if (isCloseTemplateTag) {
        templateIdsStack.pop();
      } else if (currentTemplateId !== templateId) {
        templateIdsStack.push(templateId);
      }
      placeholders.splice(idx, 1);
      return placeholder;
    });
  }
  if (!Object.keys(replacements).length) {
    return result;
  }
  result = result.replace(PP_ICU_VARS_REGEXP, (match2, start2, key, _type, _idx, end) => {
    return replacements.hasOwnProperty(key) ? `${start2}${replacements[key]}${end}` : match2;
  });
  result = result.replace(PP_ICU_PLACEHOLDERS_REGEXP, (match2, key) => {
    return replacements.hasOwnProperty(key) ? replacements[key] : match2;
  });
  result = result.replace(PP_ICUS_REGEXP, (match2, key) => {
    if (replacements.hasOwnProperty(key)) {
      const list = replacements[key];
      if (!list.length) {
        throw new Error(`i18n postprocess: unmatched ICU - ${match2} with key: ${key}`);
      }
      return list.shift();
    }
    return match2;
  });
  return result;
}
function \u0275\u0275i18nStart(index, messageIndex, subTemplateIndex = -1) {
  const tView = getTView();
  const lView = getLView();
  const adjustedIndex = HEADER_OFFSET + index;
  ngDevMode && assertDefined(tView, `tView should be defined`);
  const message = getConstant(tView.consts, messageIndex);
  const parentTNode = getCurrentParentTNode();
  if (tView.firstCreatePass) {
    i18nStartFirstCreatePass(tView, parentTNode === null ? 0 : parentTNode.index, lView, adjustedIndex, message, subTemplateIndex);
  }
  if (tView.type === 2) {
    const componentLView = lView[DECLARATION_COMPONENT_VIEW];
    componentLView[FLAGS] |= 32;
  } else {
    lView[FLAGS] |= 32;
  }
  const tI18n = tView.data[adjustedIndex];
  const sameViewParentTNode = parentTNode === lView[T_HOST] ? null : parentTNode;
  const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);
  const insertInFrontOf = parentTNode && parentTNode.type & 8 ? lView[parentTNode.index] : null;
  prepareI18nBlockForHydration(lView, adjustedIndex, parentTNode, subTemplateIndex);
  applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);
  setInI18nBlock(true);
}
function \u0275\u0275i18nEnd() {
  setInI18nBlock(false);
}
function \u0275\u0275i18n(index, messageIndex, subTemplateIndex) {
  \u0275\u0275i18nStart(index, messageIndex, subTemplateIndex);
  \u0275\u0275i18nEnd();
}
function \u0275\u0275i18nAttributes(index, attrsIndex) {
  const tView = getTView();
  ngDevMode && assertDefined(tView, `tView should be defined`);
  const attrs = getConstant(tView.consts, attrsIndex);
  i18nAttributesFirstPass(tView, index + HEADER_OFFSET, attrs);
}
function \u0275\u0275i18nExp(value) {
  const lView = getLView();
  setMaskBit(bindingUpdated(lView, nextBindingIndex(), value));
  return \u0275\u0275i18nExp;
}
function \u0275\u0275i18nApply(index) {
  applyI18n(getTView(), getLView(), index + HEADER_OFFSET);
}
function \u0275\u0275i18nPostprocess(message, replacements = {}) {
  return i18nPostprocess(message, replacements);
}
var disableEventReplayFn = (el) => {
};
function \u0275\u0275listener(eventName, listenerFn, useCapture, eventTargetResolver) {
  const lView = getLView();
  const tView = getTView();
  const tNode = getCurrentTNode();
  listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);
  return \u0275\u0275listener;
}
function \u0275\u0275syntheticHostListener(eventName, listenerFn) {
  const tNode = getCurrentTNode();
  const lView = getLView();
  const tView = getTView();
  const currentDef = getCurrentDirectiveDef(tView.data);
  const renderer = loadComponentRenderer(currentDef, tNode, lView);
  listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);
  return \u0275\u0275syntheticHostListener;
}
function findExistingListener(tView, lView, eventName, tNodeIdx) {
  const tCleanup = tView.cleanup;
  if (tCleanup != null) {
    for (let i2 = 0; i2 < tCleanup.length - 1; i2 += 2) {
      const cleanupEventName = tCleanup[i2];
      if (cleanupEventName === eventName && tCleanup[i2 + 1] === tNodeIdx) {
        const lCleanup = lView[CLEANUP];
        const listenerIdxInLCleanup = tCleanup[i2 + 2];
        return lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;
      }
      if (typeof cleanupEventName === "string") {
        i2 += 2;
      }
    }
  }
  return null;
}
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {
  const isTNodeDirectiveHost = isDirectiveHost(tNode);
  const firstCreatePass = tView.firstCreatePass;
  const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);
  const context2 = lView[CONTEXT];
  const lCleanup = getOrCreateLViewCleanup(lView);
  ngDevMode && assertTNodeType(
    tNode,
    3 | 12
    /* TNodeType.AnyContainer */
  );
  let processOutputs = true;
  if (tNode.type & 3 || eventTargetResolver) {
    const native = getNativeByTNode(tNode, lView);
    const target = eventTargetResolver ? eventTargetResolver(native) : native;
    const lCleanupIndex = lCleanup.length;
    const idxOrTargetGetter = eventTargetResolver ? (_lView) => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;
    disableEventReplayFn(native);
    let existingListener = null;
    if (!eventTargetResolver && isTNodeDirectiveHost) {
      existingListener = findExistingListener(tView, lView, eventName, tNode.index);
    }
    if (existingListener !== null) {
      const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
      lastListenerFn.__ngNextListenerFn__ = listenerFn;
      existingListener.__ngLastListenerFn__ = listenerFn;
      processOutputs = false;
    } else {
      listenerFn = wrapListener(
        tNode,
        lView,
        context2,
        listenerFn,
        false
        /** preventDefault */
      );
      const cleanupFn = renderer.listen(target, eventName, listenerFn);
      ngDevMode && ngDevMode.rendererAddEventListener++;
      lCleanup.push(listenerFn, cleanupFn);
      tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
    }
  } else {
    listenerFn = wrapListener(
      tNode,
      lView,
      context2,
      listenerFn,
      false
      /** preventDefault */
    );
  }
  const outputs = tNode.outputs;
  let props;
  if (processOutputs && outputs !== null && (props = outputs[eventName])) {
    const propsLength = props.length;
    if (propsLength) {
      for (let i2 = 0; i2 < propsLength; i2 += 2) {
        const index = props[i2];
        ngDevMode && assertIndexInRange(lView, index);
        const minifiedName = props[i2 + 1];
        const directiveInstance = lView[index];
        const output = directiveInstance[minifiedName];
        if (ngDevMode && !isOutputSubscribable(output)) {
          throw new Error(`@Output ${minifiedName} not initialized in '${directiveInstance.constructor.name}'.`);
        }
        const subscription = output.subscribe(listenerFn);
        const idx = lCleanup.length;
        lCleanup.push(listenerFn, subscription);
        tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));
      }
    }
  }
}
function executeListenerWithErrorHandling(lView, context2, listenerFn, e) {
  const prevConsumer = setActiveConsumer(null);
  try {
    profiler(6, context2, listenerFn);
    return listenerFn(e) !== false;
  } catch (error3) {
    handleError(lView, error3);
    return false;
  } finally {
    profiler(7, context2, listenerFn);
    setActiveConsumer(prevConsumer);
  }
}
function wrapListener(tNode, lView, context2, listenerFn, wrapWithPreventDefault) {
  return function wrapListenerIn_markDirtyAndPreventDefault(e) {
    if (e === Function) {
      return listenerFn;
    }
    const startView = tNode.componentOffset > -1 ? getComponentLViewByIndex(tNode.index, lView) : lView;
    markViewDirty(
      startView,
      5
      /* NotificationSource.Listener */
    );
    let result = executeListenerWithErrorHandling(lView, context2, listenerFn, e);
    let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;
    while (nextListenerFn) {
      result = executeListenerWithErrorHandling(lView, context2, nextListenerFn, e) && result;
      nextListenerFn = nextListenerFn.__ngNextListenerFn__;
    }
    if (wrapWithPreventDefault && result === false) {
      e.preventDefault();
    }
    return result;
  };
}
function isOutputSubscribable(value) {
  return value != null && typeof value.subscribe === "function";
}
function \u0275\u0275nextContext(level = 1) {
  return nextContextImpl(level);
}
function matchingProjectionSlotIndex(tNode, projectionSlots) {
  let wildcardNgContentIndex = null;
  const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
  for (let i2 = 0; i2 < projectionSlots.length; i2++) {
    const slotValue = projectionSlots[i2];
    if (slotValue === "*") {
      wildcardNgContentIndex = i2;
      continue;
    }
    if (ngProjectAsAttrVal === null ? isNodeMatchingSelectorList(
      tNode,
      slotValue,
      /* isProjectionMode */
      true
    ) : isSelectorInSelectorList(ngProjectAsAttrVal, slotValue)) {
      return i2;
    }
  }
  return wildcardNgContentIndex;
}
function \u0275\u0275projectionDef(projectionSlots) {
  const componentNode = getLView()[DECLARATION_COMPONENT_VIEW][T_HOST];
  if (!componentNode.projection) {
    const numProjectionSlots = projectionSlots ? projectionSlots.length : 1;
    const projectionHeads = componentNode.projection = newArray(numProjectionSlots, null);
    const tails = projectionHeads.slice();
    let componentChild = componentNode.child;
    while (componentChild !== null) {
      const slotIndex = projectionSlots ? matchingProjectionSlotIndex(componentChild, projectionSlots) : 0;
      if (slotIndex !== null) {
        if (tails[slotIndex]) {
          tails[slotIndex].projectionNext = componentChild;
        } else {
          projectionHeads[slotIndex] = componentChild;
        }
        tails[slotIndex] = componentChild;
      }
      componentChild = componentChild.next;
    }
  }
}
function \u0275\u0275projection(nodeIndex, selectorIndex = 0, attrs, fallbackTemplateFn, fallbackDecls, fallbackVars) {
  const lView = getLView();
  const tView = getTView();
  const fallbackIndex = fallbackTemplateFn ? nodeIndex + 1 : null;
  if (fallbackIndex !== null) {
    declareTemplate(lView, tView, fallbackIndex, fallbackTemplateFn, fallbackDecls, fallbackVars, null, attrs);
  }
  const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16, null, attrs || null);
  if (tProjectionNode.projection === null) {
    tProjectionNode.projection = selectorIndex;
  }
  setCurrentTNodeAsNotParent();
  const hydrationInfo = lView[HYDRATION];
  const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1();
  const componentHostNode = lView[DECLARATION_COMPONENT_VIEW][T_HOST];
  const isEmpty4 = componentHostNode.projection[tProjectionNode.projection] === null;
  if (isEmpty4 && fallbackIndex !== null) {
    insertFallbackContent(lView, tView, fallbackIndex);
  } else if (isNodeCreationMode && (tProjectionNode.flags & 32) !== 32) {
    applyProjection(tView, lView, tProjectionNode);
  }
}
function insertFallbackContent(lView, tView, fallbackIndex) {
  const adjustedIndex = HEADER_OFFSET + fallbackIndex;
  const fallbackTNode = tView.data[adjustedIndex];
  const fallbackLContainer = lView[adjustedIndex];
  ngDevMode && assertTNode(fallbackTNode);
  ngDevMode && assertLContainer(fallbackLContainer);
  const dehydratedView = findMatchingDehydratedView(fallbackLContainer, fallbackTNode.tView.ssrId);
  const fallbackLView = createAndRenderEmbeddedLView(lView, fallbackTNode, void 0, {
    dehydratedView
  });
  addLViewToLContainer(fallbackLContainer, fallbackLView, 0, shouldAddViewToDom(fallbackTNode, dehydratedView));
}
function \u0275\u0275propertyInterpolate(propName, v0, sanitizer) {
  \u0275\u0275propertyInterpolate1(propName, "", v0, "", sanitizer);
  return \u0275\u0275propertyInterpolate;
}
function \u0275\u0275propertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);
  }
  return \u0275\u0275propertyInterpolate1;
}
function \u0275\u0275propertyInterpolate2(propName, prefix, v0, i0, v14, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation2(lView, prefix, v0, i0, v14, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);
  }
  return \u0275\u0275propertyInterpolate2;
}
function \u0275\u0275propertyInterpolate3(propName, prefix, v0, i0, v14, i1, v2, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
  }
  return \u0275\u0275propertyInterpolate3;
}
function \u0275\u0275propertyInterpolate4(propName, prefix, v0, i0, v14, i1, v2, i2, v3, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
  }
  return \u0275\u0275propertyInterpolate4;
}
function \u0275\u0275propertyInterpolate5(propName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
  }
  return \u0275\u0275propertyInterpolate5;
}
function \u0275\u0275propertyInterpolate6(propName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
  }
  return \u0275\u0275propertyInterpolate6;
}
function \u0275\u0275propertyInterpolate7(propName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
  }
  return \u0275\u0275propertyInterpolate7;
}
function \u0275\u0275propertyInterpolate8(propName, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
  }
  return \u0275\u0275propertyInterpolate8;
}
function \u0275\u0275propertyInterpolateV(propName, values, sanitizer) {
  const lView = getLView();
  const interpolatedValue = interpolationV(lView, values);
  if (interpolatedValue !== NO_CHANGE) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
    if (ngDevMode) {
      const interpolationInBetween = [values[0]];
      for (let i2 = 2; i2 < values.length; i2 += 2) {
        interpolationInBetween.push(values[i2]);
      }
      storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1, ...interpolationInBetween);
    }
  }
  return \u0275\u0275propertyInterpolateV;
}
function \u0275\u0275contentQuery(directiveIndex, predicate, flags, read) {
  createContentQuery(directiveIndex, predicate, flags, read);
}
function \u0275\u0275viewQuery(predicate, flags, read) {
  createViewQuery(predicate, flags, read);
}
function \u0275\u0275queryRefresh(queryList) {
  const lView = getLView();
  const tView = getTView();
  const queryIndex = getCurrentQueryIndex();
  setCurrentQueryIndex(queryIndex + 1);
  const tQuery = getTQuery(tView, queryIndex);
  if (queryList.dirty && isCreationMode(lView) === ((tQuery.metadata.flags & 2) === 2)) {
    if (tQuery.matches === null) {
      queryList.reset([]);
    } else {
      const result = getQueryResults(lView, queryIndex);
      queryList.reset(result, unwrapElementRef);
      queryList.notifyOnChanges();
    }
    return true;
  }
  return false;
}
function \u0275\u0275loadQuery() {
  return loadQueryInternal(getLView(), getCurrentQueryIndex());
}
function \u0275\u0275contentQuerySignal(directiveIndex, target, predicate, flags, read) {
  bindQueryToSignal(target, createContentQuery(directiveIndex, predicate, flags, read));
}
function \u0275\u0275viewQuerySignal(target, predicate, flags, read) {
  bindQueryToSignal(target, createViewQuery(predicate, flags, read));
}
function \u0275\u0275queryAdvance(indexOffset = 1) {
  setCurrentQueryIndex(getCurrentQueryIndex() + indexOffset);
}
function store(tView, lView, index, value) {
  if (index >= tView.data.length) {
    tView.data[index] = null;
    tView.blueprint[index] = null;
  }
  lView[index] = value;
}
function \u0275\u0275reference(index) {
  const contextLView = getContextLView();
  return load(contextLView, HEADER_OFFSET + index);
}
function \u0275\u0275styleMapInterpolate1(prefix, v0, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate2(prefix, v0, i0, v14, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation2(lView, prefix, v0, i0, v14, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate3(prefix, v0, i0, v14, i1, v2, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate4(prefix, v0, i0, v14, i1, v2, i2, v3, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate5(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate6(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate7(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolate8(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
  const lView = getLView();
  const interpolatedValue = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275styleMapInterpolateV(values) {
  const lView = getLView();
  const interpolatedValue = interpolationV(lView, values);
  \u0275\u0275styleMap(interpolatedValue);
}
function \u0275\u0275stylePropInterpolate1(prop, prefix, v0, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate1;
}
function \u0275\u0275stylePropInterpolate2(prop, prefix, v0, i0, v14, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation2(lView, prefix, v0, i0, v14, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate2;
}
function \u0275\u0275stylePropInterpolate3(prop, prefix, v0, i0, v14, i1, v2, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate3;
}
function \u0275\u0275stylePropInterpolate4(prop, prefix, v0, i0, v14, i1, v2, i2, v3, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate4;
}
function \u0275\u0275stylePropInterpolate5(prop, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate5;
}
function \u0275\u0275stylePropInterpolate6(prop, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate6;
}
function \u0275\u0275stylePropInterpolate7(prop, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate7;
}
function \u0275\u0275stylePropInterpolate8(prop, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolate8;
}
function \u0275\u0275stylePropInterpolateV(prop, values, valueSuffix) {
  const lView = getLView();
  const interpolatedValue = interpolationV(lView, values);
  checkStylingProperty(prop, interpolatedValue, valueSuffix, false);
  return \u0275\u0275stylePropInterpolateV;
}
function \u0275\u0275text(index, value = "") {
  const lView = getLView();
  const tView = getTView();
  const adjustedIndex = index + HEADER_OFFSET;
  ngDevMode && assertEqual(getBindingIndex(), tView.bindingStartIndex, "text nodes should be created before any bindings");
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
  const tNode = tView.firstCreatePass ? getOrCreateTNode(tView, adjustedIndex, 1, value, null) : tView.data[adjustedIndex];
  const textNative = _locateOrCreateTextNode(tView, lView, tNode, value, index);
  lView[adjustedIndex] = textNative;
  if (wasLastNodeCreated()) {
    appendChild(tView, lView, textNative, tNode);
  }
  setCurrentTNode(tNode, false);
}
var _locateOrCreateTextNode = (tView, lView, tNode, value, index) => {
  lastNodeWasCreated(true);
  return createTextNode(lView[RENDERER], value);
};
function \u0275\u0275textInterpolate(v0) {
  \u0275\u0275textInterpolate1("", v0, "");
  return \u0275\u0275textInterpolate;
}
function \u0275\u0275textInterpolate1(prefix, v0, suffix) {
  const lView = getLView();
  const interpolated = interpolation1(lView, prefix, v0, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate1;
}
function \u0275\u0275textInterpolate2(prefix, v0, i0, v14, suffix) {
  const lView = getLView();
  const interpolated = interpolation2(lView, prefix, v0, i0, v14, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate2;
}
function \u0275\u0275textInterpolate3(prefix, v0, i0, v14, i1, v2, suffix) {
  const lView = getLView();
  const interpolated = interpolation3(lView, prefix, v0, i0, v14, i1, v2, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate3;
}
function \u0275\u0275textInterpolate4(prefix, v0, i0, v14, i1, v2, i2, v3, suffix) {
  const lView = getLView();
  const interpolated = interpolation4(lView, prefix, v0, i0, v14, i1, v2, i2, v3, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate4;
}
function \u0275\u0275textInterpolate5(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix) {
  const lView = getLView();
  const interpolated = interpolation5(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate5;
}
function \u0275\u0275textInterpolate6(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
  const lView = getLView();
  const interpolated = interpolation6(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate6;
}
function \u0275\u0275textInterpolate7(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
  const lView = getLView();
  const interpolated = interpolation7(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate7;
}
function \u0275\u0275textInterpolate8(prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
  const lView = getLView();
  const interpolated = interpolation8(lView, prefix, v0, i0, v14, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolate8;
}
function \u0275\u0275textInterpolateV(values) {
  const lView = getLView();
  const interpolated = interpolationV(lView, values);
  if (interpolated !== NO_CHANGE) {
    textBindingInternal(lView, getSelectedIndex(), interpolated);
  }
  return \u0275\u0275textInterpolateV;
}
function \u0275\u0275twoWayProperty(propName, value, sanitizer) {
  if (isWritableSignal(value)) {
    value = value();
  }
  const lView = getLView();
  const bindingIndex = nextBindingIndex();
  if (bindingUpdated(lView, bindingIndex, value)) {
    const tView = getTView();
    const tNode = getSelectedTNode();
    elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);
    ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
  }
  return \u0275\u0275twoWayProperty;
}
function \u0275\u0275twoWayBindingSet(target, value) {
  const canWrite = isWritableSignal(target);
  canWrite && target.set(value);
  return canWrite;
}
function \u0275\u0275twoWayListener(eventName, listenerFn) {
  const lView = getLView();
  const tView = getTView();
  const tNode = getCurrentTNode();
  listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn);
  return \u0275\u0275twoWayListener;
}
function providersResolver(def, providers, viewProviders) {
  const tView = getTView();
  if (tView.firstCreatePass) {
    const isComponent2 = isComponentDef(def);
    resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent2, true);
    resolveProvider(providers, tView.data, tView.blueprint, isComponent2, false);
  }
}
function resolveProvider(provider, tInjectables, lInjectablesBlueprint, isComponent2, isViewProvider) {
  provider = resolveForwardRef(provider);
  if (Array.isArray(provider)) {
    for (let i2 = 0; i2 < provider.length; i2++) {
      resolveProvider(provider[i2], tInjectables, lInjectablesBlueprint, isComponent2, isViewProvider);
    }
  } else {
    const tView = getTView();
    const lView = getLView();
    const tNode = getCurrentTNode();
    let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);
    const providerFactory = providerToFactory(provider);
    if (ngDevMode) {
      const injector = new NodeInjector(tNode, lView);
      runInInjectorProfilerContext(injector, token, () => {
        emitProviderConfiguredEvent(provider, isViewProvider);
      });
    }
    const beginIndex = tNode.providerIndexes & 1048575;
    const endIndex = tNode.directiveStart;
    const cptViewProvidersCount = tNode.providerIndexes >> 20;
    if (isTypeProvider(provider) || !provider.multi) {
      const factory2 = new NodeInjectorFactory(providerFactory, isViewProvider, \u0275\u0275directiveInject);
      const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);
      if (existingFactoryIndex === -1) {
        diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
        registerDestroyHooksIfSupported(tView, provider, tInjectables.length);
        tInjectables.push(token);
        tNode.directiveStart++;
        tNode.directiveEnd++;
        if (isViewProvider) {
          tNode.providerIndexes += 1048576;
        }
        lInjectablesBlueprint.push(factory2);
        lView.push(factory2);
      } else {
        lInjectablesBlueprint[existingFactoryIndex] = factory2;
        lView[existingFactoryIndex] = factory2;
      }
    } else {
      const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);
      const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);
      const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingProvidersFactoryIndex];
      const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 && lInjectablesBlueprint[existingViewProvidersFactoryIndex];
      if (isViewProvider && !doesViewProvidersFactoryExist || !isViewProvider && !doesProvidersFactoryExist) {
        diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);
        const factory2 = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent2, providerFactory);
        if (!isViewProvider && doesViewProvidersFactoryExist) {
          lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory2;
        }
        registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);
        tInjectables.push(token);
        tNode.directiveStart++;
        tNode.directiveEnd++;
        if (isViewProvider) {
          tNode.providerIndexes += 1048576;
        }
        lInjectablesBlueprint.push(factory2);
        lView.push(factory2);
      } else {
        const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent2);
        registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex : existingViewProvidersFactoryIndex, indexInFactory);
      }
      if (!isViewProvider && isComponent2 && doesViewProvidersFactoryExist) {
        lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;
      }
    }
  }
}
function registerDestroyHooksIfSupported(tView, provider, contextIndex, indexInFactory) {
  const providerIsTypeProvider = isTypeProvider(provider);
  const providerIsClassProvider = isClassProvider(provider);
  if (providerIsTypeProvider || providerIsClassProvider) {
    const classToken = providerIsClassProvider ? resolveForwardRef(provider.useClass) : provider;
    const prototype = classToken.prototype;
    const ngOnDestroy = prototype.ngOnDestroy;
    if (ngOnDestroy) {
      const hooks = tView.destroyHooks || (tView.destroyHooks = []);
      if (!providerIsTypeProvider && provider.multi) {
        ngDevMode && assertDefined(indexInFactory, "indexInFactory when registering multi factory destroy hook");
        const existingCallbacksIndex = hooks.indexOf(contextIndex);
        if (existingCallbacksIndex === -1) {
          hooks.push(contextIndex, [indexInFactory, ngOnDestroy]);
        } else {
          hooks[existingCallbacksIndex + 1].push(indexInFactory, ngOnDestroy);
        }
      } else {
        hooks.push(contextIndex, ngOnDestroy);
      }
    }
  }
}
function multiFactoryAdd(multiFactory2, factory2, isComponentProvider) {
  if (isComponentProvider) {
    multiFactory2.componentProviders++;
  }
  return multiFactory2.multi.push(factory2) - 1;
}
function indexOf(item, arr, begin, end) {
  for (let i2 = begin; i2 < end; i2++) {
    if (arr[i2] === item)
      return i2;
  }
  return -1;
}
function multiProvidersFactoryResolver(_, tData, lData, tNode) {
  return multiResolve(this.multi, []);
}
function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {
  const factories = this.multi;
  let result;
  if (this.providerFactory) {
    const componentCount = this.providerFactory.componentProviders;
    const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);
    result = multiProviders.slice(0, componentCount);
    multiResolve(factories, result);
    for (let i2 = componentCount; i2 < multiProviders.length; i2++) {
      result.push(multiProviders[i2]);
    }
  } else {
    result = [];
    multiResolve(factories, result);
  }
  return result;
}
function multiResolve(factories, result) {
  for (let i2 = 0; i2 < factories.length; i2++) {
    const factory2 = factories[i2];
    result.push(factory2());
  }
  return result;
}
function multiFactory(factoryFn, index, isViewProvider, isComponent2, f) {
  const factory2 = new NodeInjectorFactory(factoryFn, isViewProvider, \u0275\u0275directiveInject);
  factory2.multi = [];
  factory2.index = index;
  factory2.componentProviders = 0;
  multiFactoryAdd(factory2, f, isComponent2 && !isViewProvider);
  return factory2;
}
function \u0275\u0275ProvidersFeature(providers, viewProviders = []) {
  return (definition) => {
    definition.providersResolver = (def, processProvidersFn) => {
      return providersResolver(
        def,
        //
        processProvidersFn ? processProvidersFn(providers) : providers,
        //
        viewProviders
      );
    };
  };
}
var _StandaloneService = class _StandaloneService {
  constructor(_injector) {
    this._injector = _injector;
    this.cachedInjectors = /* @__PURE__ */ new Map();
  }
  getOrCreateStandaloneInjector(componentDef) {
    if (!componentDef.standalone) {
      return null;
    }
    if (!this.cachedInjectors.has(componentDef)) {
      const providers = internalImportProvidersFrom(false, componentDef.type);
      const standaloneInjector = providers.length > 0 ? createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) : null;
      this.cachedInjectors.set(componentDef, standaloneInjector);
    }
    return this.cachedInjectors.get(componentDef);
  }
  ngOnDestroy() {
    try {
      for (const injector of this.cachedInjectors.values()) {
        if (injector !== null) {
          injector.destroy();
        }
      }
    } finally {
      this.cachedInjectors.clear();
    }
  }
};
_StandaloneService.\u0275prov = \u0275\u0275defineInjectable({
  token: _StandaloneService,
  providedIn: "environment",
  factory: () => new _StandaloneService(\u0275\u0275inject(EnvironmentInjector))
});
var StandaloneService = _StandaloneService;
function \u0275\u0275StandaloneFeature(definition) {
  performanceMarkFeature("NgStandalone");
  definition.getStandaloneInjector = (parentInjector) => {
    return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
  };
}
function \u0275\u0275setComponentScope(type, directives, pipes) {
  const def = type.\u0275cmp;
  def.directiveDefs = extractDefListOrFactory(
    directives,
    /* pipeDef */
    false
  );
  def.pipeDefs = extractDefListOrFactory(
    pipes,
    /* pipeDef */
    true
  );
}
function \u0275\u0275setNgModuleScope(type, scope) {
  return noSideEffects(() => {
    const ngModuleDef = getNgModuleDef(type, true);
    ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);
    ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);
    ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);
    if (scope.bootstrap) {
      ngModuleDef.bootstrap = convertToTypeArray(scope.bootstrap);
    }
    depsTracker.registerNgModule(type, scope);
  });
}
function convertToTypeArray(values) {
  if (typeof values === "function") {
    return values;
  }
  const flattenValues = flatten(values);
  if (flattenValues.some(isForwardRef)) {
    return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
  } else {
    return flattenValues.map(maybeUnwrapModuleWithProviders);
  }
}
function maybeUnwrapModuleWithProviders(value) {
  return isModuleWithProviders(value) ? value.ngModule : value;
}
function \u0275\u0275pureFunction0(slotOffset, pureFn, thisArg) {
  const bindingIndex = getBindingRoot() + slotOffset;
  const lView = getLView();
  return lView[bindingIndex] === NO_CHANGE ? updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) : getBinding(lView, bindingIndex);
}
function \u0275\u0275pureFunction1(slotOffset, pureFn, exp, thisArg) {
  return pureFunction1Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp, thisArg);
}
function \u0275\u0275pureFunction2(slotOffset, pureFn, exp1, exp2, thisArg) {
  return pureFunction2Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, thisArg);
}
function \u0275\u0275pureFunction3(slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
  return pureFunction3Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, thisArg);
}
function \u0275\u0275pureFunction4(slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
  return pureFunction4Internal(getLView(), getBindingRoot(), slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg);
}
function \u0275\u0275pureFunction5(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, thisArg) {
  const bindingIndex = getBindingRoot() + slotOffset;
  const lView = getLView();
  const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
  return bindingUpdated(lView, bindingIndex + 4, exp5) || different ? updateBinding(lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) : pureFn(exp1, exp2, exp3, exp4, exp5)) : getBinding(lView, bindingIndex + 5);
}
function \u0275\u0275pureFunction6(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, thisArg) {
  const bindingIndex = getBindingRoot() + slotOffset;
  const lView = getLView();
  const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
  return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ? updateBinding(lView, bindingIndex + 6, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) : getBinding(lView, bindingIndex + 6);
}
function \u0275\u0275pureFunction7(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, thisArg) {
  const bindingIndex = getBindingRoot() + slotOffset;
  const lView = getLView();
  let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
  return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ? updateBinding(lView, bindingIndex + 7, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) : getBinding(lView, bindingIndex + 7);
}
function \u0275\u0275pureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, thisArg) {
  const bindingIndex = getBindingRoot() + slotOffset;
  const lView = getLView();
  const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);
  return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ? updateBinding(lView, bindingIndex + 8, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) : pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) : getBinding(lView, bindingIndex + 8);
}
function \u0275\u0275pureFunctionV(slotOffset, pureFn, exps, thisArg) {
  return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);
}
function getPureFunctionReturnValue(lView, returnValueIndex) {
  ngDevMode && assertIndexInRange(lView, returnValueIndex);
  const lastReturnValue = lView[returnValueIndex];
  return lastReturnValue === NO_CHANGE ? void 0 : lastReturnValue;
}
function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, thisArg) {
  const bindingIndex = bindingRoot + slotOffset;
  return bindingUpdated(lView, bindingIndex, exp) ? updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) : getPureFunctionReturnValue(lView, bindingIndex + 1);
}
function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, thisArg) {
  const bindingIndex = bindingRoot + slotOffset;
  return bindingUpdated2(lView, bindingIndex, exp1, exp2) ? updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) : getPureFunctionReturnValue(lView, bindingIndex + 2);
}
function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {
  const bindingIndex = bindingRoot + slotOffset;
  return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);
}
function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, exp4, thisArg) {
  const bindingIndex = bindingRoot + slotOffset;
  return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ? updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) : getPureFunctionReturnValue(lView, bindingIndex + 4);
}
function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thisArg) {
  let bindingIndex = bindingRoot + slotOffset;
  let different = false;
  for (let i2 = 0; i2 < exps.length; i2++) {
    bindingUpdated(lView, bindingIndex++, exps[i2]) && (different = true);
  }
  return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) : getPureFunctionReturnValue(lView, bindingIndex);
}
function \u0275\u0275pipe(index, pipeName) {
  const tView = getTView();
  let pipeDef;
  const adjustedIndex = index + HEADER_OFFSET;
  if (tView.firstCreatePass) {
    pipeDef = getPipeDef(pipeName, tView.pipeRegistry);
    tView.data[adjustedIndex] = pipeDef;
    if (pipeDef.onDestroy) {
      (tView.destroyHooks ??= []).push(adjustedIndex, pipeDef.onDestroy);
    }
  } else {
    pipeDef = tView.data[adjustedIndex];
  }
  const pipeFactory = pipeDef.factory || (pipeDef.factory = getFactoryDef(pipeDef.type, true));
  let previousInjectorProfilerContext;
  if (ngDevMode) {
    previousInjectorProfilerContext = setInjectorProfilerContext({
      injector: new NodeInjector(getCurrentTNode(), getLView()),
      token: pipeDef.type
    });
  }
  const previousInjectImplementation = setInjectImplementation(\u0275\u0275directiveInject);
  try {
    const previousIncludeViewProviders = setIncludeViewProviders(false);
    const pipeInstance = pipeFactory();
    setIncludeViewProviders(previousIncludeViewProviders);
    store(tView, getLView(), adjustedIndex, pipeInstance);
    return pipeInstance;
  } finally {
    setInjectImplementation(previousInjectImplementation);
    ngDevMode && setInjectorProfilerContext(previousInjectorProfilerContext);
  }
}
function getPipeDef(name, registry) {
  if (registry) {
    if (ngDevMode) {
      const pipes = registry.filter((pipe) => pipe.name === name);
      if (pipes.length > 1) {
        console.warn(formatRuntimeError(313, getMultipleMatchingPipesMessage(name)));
      }
    }
    for (let i2 = registry.length - 1; i2 >= 0; i2--) {
      const pipeDef = registry[i2];
      if (name === pipeDef.name) {
        return pipeDef;
      }
    }
  }
  if (ngDevMode) {
    throw new RuntimeError(-302, getPipeNotFoundErrorMessage(name));
  }
  return;
}
function getMultipleMatchingPipesMessage(name) {
  const lView = getLView();
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
  const context2 = declarationLView[CONTEXT];
  const hostIsStandalone = isHostComponentStandalone(lView);
  const componentInfoMessage = context2 ? ` in the '${context2.constructor.name}' component` : "";
  const verifyMessage = `check ${hostIsStandalone ? "'@Component.imports' of this component" : "the imports of this module"}`;
  const errorMessage = `Multiple pipes match the name \`${name}\`${componentInfoMessage}. ${verifyMessage}`;
  return errorMessage;
}
function getPipeNotFoundErrorMessage(name) {
  const lView = getLView();
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
  const context2 = declarationLView[CONTEXT];
  const hostIsStandalone = isHostComponentStandalone(lView);
  const componentInfoMessage = context2 ? ` in the '${context2.constructor.name}' component` : "";
  const verifyMessage = `Verify that it is ${hostIsStandalone ? "included in the '@Component.imports' of this component" : "declared or imported in this module"}`;
  const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;
  return errorMessage;
}
function \u0275\u0275pipeBind1(index, offset2, v14) {
  const adjustedIndex = index + HEADER_OFFSET;
  const lView = getLView();
  const pipeInstance = load(lView, adjustedIndex);
  return isPure(lView, adjustedIndex) ? pureFunction1Internal(lView, getBindingRoot(), offset2, pipeInstance.transform, v14, pipeInstance) : pipeInstance.transform(v14);
}
function \u0275\u0275pipeBind2(index, slotOffset, v14, v2) {
  const adjustedIndex = index + HEADER_OFFSET;
  const lView = getLView();
  const pipeInstance = load(lView, adjustedIndex);
  return isPure(lView, adjustedIndex) ? pureFunction2Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v14, v2, pipeInstance) : pipeInstance.transform(v14, v2);
}
function \u0275\u0275pipeBind3(index, slotOffset, v14, v2, v3) {
  const adjustedIndex = index + HEADER_OFFSET;
  const lView = getLView();
  const pipeInstance = load(lView, adjustedIndex);
  return isPure(lView, adjustedIndex) ? pureFunction3Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v14, v2, v3, pipeInstance) : pipeInstance.transform(v14, v2, v3);
}
function \u0275\u0275pipeBind4(index, slotOffset, v14, v2, v3, v4) {
  const adjustedIndex = index + HEADER_OFFSET;
  const lView = getLView();
  const pipeInstance = load(lView, adjustedIndex);
  return isPure(lView, adjustedIndex) ? pureFunction4Internal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, v14, v2, v3, v4, pipeInstance) : pipeInstance.transform(v14, v2, v3, v4);
}
function \u0275\u0275pipeBindV(index, slotOffset, values) {
  const adjustedIndex = index + HEADER_OFFSET;
  const lView = getLView();
  const pipeInstance = load(lView, adjustedIndex);
  return isPure(lView, adjustedIndex) ? pureFunctionVInternal(lView, getBindingRoot(), slotOffset, pipeInstance.transform, values, pipeInstance) : pipeInstance.transform.apply(pipeInstance, values);
}
function isPure(lView, index) {
  return lView[TVIEW].data[index].pure;
}
function \u0275\u0275templateRefExtractor(tNode, lView) {
  return createTemplateRef(tNode, lView);
}
function \u0275\u0275getComponentDepsFactory(type, rawImports) {
  return () => {
    try {
      return depsTracker.getComponentDependencies(type, rawImports).dependencies;
    } catch (e) {
      console.error(`Computing dependencies in local compilation mode for the component "${type.name}" failed with the exception:`, e);
      throw e;
    }
  };
}
function \u0275setClassDebugInfo(type, debugInfo) {
  const def = getComponentDef(type);
  if (def !== null) {
    def.debugInfo = debugInfo;
  }
}
var angularCoreEnv = /* @__PURE__ */ (() => ({
  "\u0275\u0275attribute": \u0275\u0275attribute,
  "\u0275\u0275attributeInterpolate1": \u0275\u0275attributeInterpolate1,
  "\u0275\u0275attributeInterpolate2": \u0275\u0275attributeInterpolate2,
  "\u0275\u0275attributeInterpolate3": \u0275\u0275attributeInterpolate3,
  "\u0275\u0275attributeInterpolate4": \u0275\u0275attributeInterpolate4,
  "\u0275\u0275attributeInterpolate5": \u0275\u0275attributeInterpolate5,
  "\u0275\u0275attributeInterpolate6": \u0275\u0275attributeInterpolate6,
  "\u0275\u0275attributeInterpolate7": \u0275\u0275attributeInterpolate7,
  "\u0275\u0275attributeInterpolate8": \u0275\u0275attributeInterpolate8,
  "\u0275\u0275attributeInterpolateV": \u0275\u0275attributeInterpolateV,
  "\u0275\u0275defineComponent": \u0275\u0275defineComponent,
  "\u0275\u0275defineDirective": \u0275\u0275defineDirective,
  "\u0275\u0275defineInjectable": \u0275\u0275defineInjectable,
  "\u0275\u0275defineInjector": \u0275\u0275defineInjector,
  "\u0275\u0275defineNgModule": \u0275\u0275defineNgModule,
  "\u0275\u0275definePipe": \u0275\u0275definePipe,
  "\u0275\u0275directiveInject": \u0275\u0275directiveInject,
  "\u0275\u0275getInheritedFactory": \u0275\u0275getInheritedFactory,
  "\u0275\u0275inject": \u0275\u0275inject,
  "\u0275\u0275injectAttribute": \u0275\u0275injectAttribute,
  "\u0275\u0275invalidFactory": \u0275\u0275invalidFactory,
  "\u0275\u0275invalidFactoryDep": \u0275\u0275invalidFactoryDep,
  "\u0275\u0275templateRefExtractor": \u0275\u0275templateRefExtractor,
  "\u0275\u0275resetView": \u0275\u0275resetView,
  "\u0275\u0275HostDirectivesFeature": \u0275\u0275HostDirectivesFeature,
  "\u0275\u0275NgOnChangesFeature": \u0275\u0275NgOnChangesFeature,
  "\u0275\u0275ProvidersFeature": \u0275\u0275ProvidersFeature,
  "\u0275\u0275CopyDefinitionFeature": \u0275\u0275CopyDefinitionFeature,
  "\u0275\u0275InheritDefinitionFeature": \u0275\u0275InheritDefinitionFeature,
  "\u0275\u0275InputTransformsFeature": \u0275\u0275InputTransformsFeature,
  "\u0275\u0275StandaloneFeature": \u0275\u0275StandaloneFeature,
  "\u0275\u0275nextContext": \u0275\u0275nextContext,
  "\u0275\u0275namespaceHTML": \u0275\u0275namespaceHTML,
  "\u0275\u0275namespaceMathML": \u0275\u0275namespaceMathML,
  "\u0275\u0275namespaceSVG": \u0275\u0275namespaceSVG,
  "\u0275\u0275enableBindings": \u0275\u0275enableBindings,
  "\u0275\u0275disableBindings": \u0275\u0275disableBindings,
  "\u0275\u0275elementStart": \u0275\u0275elementStart,
  "\u0275\u0275elementEnd": \u0275\u0275elementEnd,
  "\u0275\u0275element": \u0275\u0275element,
  "\u0275\u0275elementContainerStart": \u0275\u0275elementContainerStart,
  "\u0275\u0275elementContainerEnd": \u0275\u0275elementContainerEnd,
  "\u0275\u0275elementContainer": \u0275\u0275elementContainer,
  "\u0275\u0275pureFunction0": \u0275\u0275pureFunction0,
  "\u0275\u0275pureFunction1": \u0275\u0275pureFunction1,
  "\u0275\u0275pureFunction2": \u0275\u0275pureFunction2,
  "\u0275\u0275pureFunction3": \u0275\u0275pureFunction3,
  "\u0275\u0275pureFunction4": \u0275\u0275pureFunction4,
  "\u0275\u0275pureFunction5": \u0275\u0275pureFunction5,
  "\u0275\u0275pureFunction6": \u0275\u0275pureFunction6,
  "\u0275\u0275pureFunction7": \u0275\u0275pureFunction7,
  "\u0275\u0275pureFunction8": \u0275\u0275pureFunction8,
  "\u0275\u0275pureFunctionV": \u0275\u0275pureFunctionV,
  "\u0275\u0275getCurrentView": \u0275\u0275getCurrentView,
  "\u0275\u0275restoreView": \u0275\u0275restoreView,
  "\u0275\u0275listener": \u0275\u0275listener,
  "\u0275\u0275projection": \u0275\u0275projection,
  "\u0275\u0275syntheticHostProperty": \u0275\u0275syntheticHostProperty,
  "\u0275\u0275syntheticHostListener": \u0275\u0275syntheticHostListener,
  "\u0275\u0275pipeBind1": \u0275\u0275pipeBind1,
  "\u0275\u0275pipeBind2": \u0275\u0275pipeBind2,
  "\u0275\u0275pipeBind3": \u0275\u0275pipeBind3,
  "\u0275\u0275pipeBind4": \u0275\u0275pipeBind4,
  "\u0275\u0275pipeBindV": \u0275\u0275pipeBindV,
  "\u0275\u0275projectionDef": \u0275\u0275projectionDef,
  "\u0275\u0275hostProperty": \u0275\u0275hostProperty,
  "\u0275\u0275property": \u0275\u0275property,
  "\u0275\u0275propertyInterpolate": \u0275\u0275propertyInterpolate,
  "\u0275\u0275propertyInterpolate1": \u0275\u0275propertyInterpolate1,
  "\u0275\u0275propertyInterpolate2": \u0275\u0275propertyInterpolate2,
  "\u0275\u0275propertyInterpolate3": \u0275\u0275propertyInterpolate3,
  "\u0275\u0275propertyInterpolate4": \u0275\u0275propertyInterpolate4,
  "\u0275\u0275propertyInterpolate5": \u0275\u0275propertyInterpolate5,
  "\u0275\u0275propertyInterpolate6": \u0275\u0275propertyInterpolate6,
  "\u0275\u0275propertyInterpolate7": \u0275\u0275propertyInterpolate7,
  "\u0275\u0275propertyInterpolate8": \u0275\u0275propertyInterpolate8,
  "\u0275\u0275propertyInterpolateV": \u0275\u0275propertyInterpolateV,
  "\u0275\u0275pipe": \u0275\u0275pipe,
  "\u0275\u0275queryRefresh": \u0275\u0275queryRefresh,
  "\u0275\u0275queryAdvance": \u0275\u0275queryAdvance,
  "\u0275\u0275viewQuery": \u0275\u0275viewQuery,
  "\u0275\u0275viewQuerySignal": \u0275\u0275viewQuerySignal,
  "\u0275\u0275loadQuery": \u0275\u0275loadQuery,
  "\u0275\u0275contentQuery": \u0275\u0275contentQuery,
  "\u0275\u0275contentQuerySignal": \u0275\u0275contentQuerySignal,
  "\u0275\u0275reference": \u0275\u0275reference,
  "\u0275\u0275classMap": \u0275\u0275classMap,
  "\u0275\u0275classMapInterpolate1": \u0275\u0275classMapInterpolate1,
  "\u0275\u0275classMapInterpolate2": \u0275\u0275classMapInterpolate2,
  "\u0275\u0275classMapInterpolate3": \u0275\u0275classMapInterpolate3,
  "\u0275\u0275classMapInterpolate4": \u0275\u0275classMapInterpolate4,
  "\u0275\u0275classMapInterpolate5": \u0275\u0275classMapInterpolate5,
  "\u0275\u0275classMapInterpolate6": \u0275\u0275classMapInterpolate6,
  "\u0275\u0275classMapInterpolate7": \u0275\u0275classMapInterpolate7,
  "\u0275\u0275classMapInterpolate8": \u0275\u0275classMapInterpolate8,
  "\u0275\u0275classMapInterpolateV": \u0275\u0275classMapInterpolateV,
  "\u0275\u0275styleMap": \u0275\u0275styleMap,
  "\u0275\u0275styleMapInterpolate1": \u0275\u0275styleMapInterpolate1,
  "\u0275\u0275styleMapInterpolate2": \u0275\u0275styleMapInterpolate2,
  "\u0275\u0275styleMapInterpolate3": \u0275\u0275styleMapInterpolate3,
  "\u0275\u0275styleMapInterpolate4": \u0275\u0275styleMapInterpolate4,
  "\u0275\u0275styleMapInterpolate5": \u0275\u0275styleMapInterpolate5,
  "\u0275\u0275styleMapInterpolate6": \u0275\u0275styleMapInterpolate6,
  "\u0275\u0275styleMapInterpolate7": \u0275\u0275styleMapInterpolate7,
  "\u0275\u0275styleMapInterpolate8": \u0275\u0275styleMapInterpolate8,
  "\u0275\u0275styleMapInterpolateV": \u0275\u0275styleMapInterpolateV,
  "\u0275\u0275styleProp": \u0275\u0275styleProp,
  "\u0275\u0275stylePropInterpolate1": \u0275\u0275stylePropInterpolate1,
  "\u0275\u0275stylePropInterpolate2": \u0275\u0275stylePropInterpolate2,
  "\u0275\u0275stylePropInterpolate3": \u0275\u0275stylePropInterpolate3,
  "\u0275\u0275stylePropInterpolate4": \u0275\u0275stylePropInterpolate4,
  "\u0275\u0275stylePropInterpolate5": \u0275\u0275stylePropInterpolate5,
  "\u0275\u0275stylePropInterpolate6": \u0275\u0275stylePropInterpolate6,
  "\u0275\u0275stylePropInterpolate7": \u0275\u0275stylePropInterpolate7,
  "\u0275\u0275stylePropInterpolate8": \u0275\u0275stylePropInterpolate8,
  "\u0275\u0275stylePropInterpolateV": \u0275\u0275stylePropInterpolateV,
  "\u0275\u0275classProp": \u0275\u0275classProp,
  "\u0275\u0275advance": \u0275\u0275advance,
  "\u0275\u0275template": \u0275\u0275template,
  "\u0275\u0275conditional": \u0275\u0275conditional,
  "\u0275\u0275defer": \u0275\u0275defer,
  "\u0275\u0275deferWhen": \u0275\u0275deferWhen,
  "\u0275\u0275deferOnIdle": \u0275\u0275deferOnIdle,
  "\u0275\u0275deferOnImmediate": \u0275\u0275deferOnImmediate,
  "\u0275\u0275deferOnTimer": \u0275\u0275deferOnTimer,
  "\u0275\u0275deferOnHover": \u0275\u0275deferOnHover,
  "\u0275\u0275deferOnInteraction": \u0275\u0275deferOnInteraction,
  "\u0275\u0275deferOnViewport": \u0275\u0275deferOnViewport,
  "\u0275\u0275deferPrefetchWhen": \u0275\u0275deferPrefetchWhen,
  "\u0275\u0275deferPrefetchOnIdle": \u0275\u0275deferPrefetchOnIdle,
  "\u0275\u0275deferPrefetchOnImmediate": \u0275\u0275deferPrefetchOnImmediate,
  "\u0275\u0275deferPrefetchOnTimer": \u0275\u0275deferPrefetchOnTimer,
  "\u0275\u0275deferPrefetchOnHover": \u0275\u0275deferPrefetchOnHover,
  "\u0275\u0275deferPrefetchOnInteraction": \u0275\u0275deferPrefetchOnInteraction,
  "\u0275\u0275deferPrefetchOnViewport": \u0275\u0275deferPrefetchOnViewport,
  "\u0275\u0275deferEnableTimerScheduling": \u0275\u0275deferEnableTimerScheduling,
  "\u0275\u0275repeater": \u0275\u0275repeater,
  "\u0275\u0275repeaterCreate": \u0275\u0275repeaterCreate,
  "\u0275\u0275repeaterTrackByIndex": \u0275\u0275repeaterTrackByIndex,
  "\u0275\u0275repeaterTrackByIdentity": \u0275\u0275repeaterTrackByIdentity,
  "\u0275\u0275componentInstance": \u0275\u0275componentInstance,
  "\u0275\u0275text": \u0275\u0275text,
  "\u0275\u0275textInterpolate": \u0275\u0275textInterpolate,
  "\u0275\u0275textInterpolate1": \u0275\u0275textInterpolate1,
  "\u0275\u0275textInterpolate2": \u0275\u0275textInterpolate2,
  "\u0275\u0275textInterpolate3": \u0275\u0275textInterpolate3,
  "\u0275\u0275textInterpolate4": \u0275\u0275textInterpolate4,
  "\u0275\u0275textInterpolate5": \u0275\u0275textInterpolate5,
  "\u0275\u0275textInterpolate6": \u0275\u0275textInterpolate6,
  "\u0275\u0275textInterpolate7": \u0275\u0275textInterpolate7,
  "\u0275\u0275textInterpolate8": \u0275\u0275textInterpolate8,
  "\u0275\u0275textInterpolateV": \u0275\u0275textInterpolateV,
  "\u0275\u0275i18n": \u0275\u0275i18n,
  "\u0275\u0275i18nAttributes": \u0275\u0275i18nAttributes,
  "\u0275\u0275i18nExp": \u0275\u0275i18nExp,
  "\u0275\u0275i18nStart": \u0275\u0275i18nStart,
  "\u0275\u0275i18nEnd": \u0275\u0275i18nEnd,
  "\u0275\u0275i18nApply": \u0275\u0275i18nApply,
  "\u0275\u0275i18nPostprocess": \u0275\u0275i18nPostprocess,
  "\u0275\u0275resolveWindow": \u0275\u0275resolveWindow,
  "\u0275\u0275resolveDocument": \u0275\u0275resolveDocument,
  "\u0275\u0275resolveBody": \u0275\u0275resolveBody,
  "\u0275\u0275setComponentScope": \u0275\u0275setComponentScope,
  "\u0275\u0275setNgModuleScope": \u0275\u0275setNgModuleScope,
  "\u0275\u0275registerNgModuleType": registerNgModuleType,
  "\u0275\u0275getComponentDepsFactory": \u0275\u0275getComponentDepsFactory,
  "\u0275setClassDebugInfo": \u0275setClassDebugInfo,
  "\u0275\u0275sanitizeHtml": \u0275\u0275sanitizeHtml,
  "\u0275\u0275sanitizeStyle": \u0275\u0275sanitizeStyle,
  "\u0275\u0275sanitizeResourceUrl": \u0275\u0275sanitizeResourceUrl,
  "\u0275\u0275sanitizeScript": \u0275\u0275sanitizeScript,
  "\u0275\u0275sanitizeUrl": \u0275\u0275sanitizeUrl,
  "\u0275\u0275sanitizeUrlOrResourceUrl": \u0275\u0275sanitizeUrlOrResourceUrl,
  "\u0275\u0275trustConstantHtml": \u0275\u0275trustConstantHtml,
  "\u0275\u0275trustConstantResourceUrl": \u0275\u0275trustConstantResourceUrl,
  "\u0275\u0275validateIframeAttribute": \u0275\u0275validateIframeAttribute,
  "forwardRef": forwardRef,
  "resolveForwardRef": resolveForwardRef,
  "\u0275\u0275twoWayProperty": \u0275\u0275twoWayProperty,
  "\u0275\u0275twoWayBindingSet": \u0275\u0275twoWayBindingSet,
  "\u0275\u0275twoWayListener": \u0275\u0275twoWayListener
}))();
var jitOptions = null;
function setJitOptions(options) {
  if (jitOptions !== null) {
    if (options.defaultEncapsulation !== jitOptions.defaultEncapsulation) {
      ngDevMode && console.error("Provided value for `defaultEncapsulation` can not be changed once it has been set.");
      return;
    }
    if (options.preserveWhitespaces !== jitOptions.preserveWhitespaces) {
      ngDevMode && console.error("Provided value for `preserveWhitespaces` can not be changed once it has been set.");
      return;
    }
  }
  jitOptions = options;
}
function getJitOptions() {
  return jitOptions;
}
function patchModuleCompilation() {
}
var moduleQueue = [];
function enqueueModuleForDelayedScoping(moduleType, ngModule) {
  moduleQueue.push({ moduleType, ngModule });
}
var flushingModuleQueue = false;
function flushModuleScopingQueueAsMuchAsPossible() {
  if (!flushingModuleQueue) {
    flushingModuleQueue = true;
    try {
      for (let i2 = moduleQueue.length - 1; i2 >= 0; i2--) {
        const { moduleType, ngModule } = moduleQueue[i2];
        if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {
          moduleQueue.splice(i2, 1);
          setScopeOnDeclaredComponents(moduleType, ngModule);
        }
      }
    } finally {
      flushingModuleQueue = false;
    }
  }
}
function isResolvedDeclaration(declaration) {
  if (Array.isArray(declaration)) {
    return declaration.every(isResolvedDeclaration);
  }
  return !!resolveForwardRef(declaration);
}
function compileNgModule(moduleType, ngModule = {}) {
  patchModuleCompilation();
  compileNgModuleDefs(moduleType, ngModule);
  if (ngModule.id !== void 0) {
    registerNgModuleType(moduleType, ngModule.id);
  }
  enqueueModuleForDelayedScoping(moduleType, ngModule);
}
function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInRoot = false) {
  ngDevMode && assertDefined(moduleType, "Required value moduleType");
  ngDevMode && assertDefined(ngModule, "Required value ngModule");
  const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
  let ngModuleDef = null;
  Object.defineProperty(moduleType, NG_MOD_DEF, {
    configurable: true,
    get: () => {
      if (ngModuleDef === null) {
        if (ngDevMode && ngModule.imports && ngModule.imports.indexOf(moduleType) > -1) {
          throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
        }
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "NgModule",
          type: moduleType
        });
        ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/\u0275mod.js`, {
          type: moduleType,
          bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
          declarations: declarations.map(resolveForwardRef),
          imports: flatten(ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),
          exports: flatten(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef).map(expandModuleWithProviders),
          schemas: ngModule.schemas ? flatten(ngModule.schemas) : null,
          id: ngModule.id || null
        });
        if (!ngModuleDef.schemas) {
          ngModuleDef.schemas = [];
        }
      }
      return ngModuleDef;
    }
  });
  let ngFactoryDef = null;
  Object.defineProperty(moduleType, NG_FACTORY_DEF, {
    get: () => {
      if (ngFactoryDef === null) {
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "NgModule",
          type: moduleType
        });
        ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/\u0275fac.js`, {
          name: moduleType.name,
          type: moduleType,
          deps: reflectDependencies(moduleType),
          target: compiler.FactoryTarget.NgModule,
          typeArgumentCount: 0
        });
      }
      return ngFactoryDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
  let ngInjectorDef = null;
  Object.defineProperty(moduleType, NG_INJ_DEF, {
    get: () => {
      if (ngInjectorDef === null) {
        ngDevMode && verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot);
        const meta = {
          name: moduleType.name,
          type: moduleType,
          providers: ngModule.providers || EMPTY_ARRAY,
          imports: [
            (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),
            (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef)
          ]
        };
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "NgModule",
          type: moduleType
        });
        ngInjectorDef = compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/\u0275inj.js`, meta);
      }
      return ngInjectorDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
}
function generateStandaloneInDeclarationsError(type, location2) {
  const prefix = `Unexpected "${stringifyForError(type)}" found in the "declarations" array of the`;
  const suffix = `"${stringifyForError(type)}" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?`;
  return `${prefix} ${location2}, ${suffix}`;
}
function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
  if (verifiedNgModule.get(moduleType))
    return;
  if (isStandalone(moduleType))
    return;
  verifiedNgModule.set(moduleType, true);
  moduleType = resolveForwardRef(moduleType);
  let ngModuleDef;
  if (importingModule) {
    ngModuleDef = getNgModuleDef(moduleType);
    if (!ngModuleDef) {
      throw new Error(`Unexpected value '${moduleType.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
    }
  } else {
    ngModuleDef = getNgModuleDef(moduleType, true);
  }
  const errors = [];
  const declarations = maybeUnwrapFn(ngModuleDef.declarations);
  const imports = maybeUnwrapFn(ngModuleDef.imports);
  flatten(imports).map(unwrapModuleWithProvidersImports).forEach((modOrStandaloneCmpt) => {
    verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
    verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
  });
  const exports4 = maybeUnwrapFn(ngModuleDef.exports);
  declarations.forEach(verifyDeclarationsHaveDefinitions);
  declarations.forEach(verifyDirectivesHaveSelector);
  declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
  const combinedDeclarations = [
    ...declarations.map(resolveForwardRef),
    ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef)
  ];
  exports4.forEach(verifyExportsAreDeclaredOrReExported);
  declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
  const ngModule = getAnnotation(moduleType, "NgModule");
  if (ngModule) {
    ngModule.imports && flatten(ngModule.imports).map(unwrapModuleWithProvidersImports).forEach((mod) => {
      verifySemanticsOfNgModuleImport(mod, moduleType);
      verifySemanticsOfNgModuleDef(mod, false, moduleType);
    });
    ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyCorrectBootstrapType);
    ngModule.bootstrap && deepForEach(ngModule.bootstrap, verifyComponentIsPartOfNgModule);
  }
  if (errors.length) {
    throw new Error(errors.join("\n"));
  }
  function verifyDeclarationsHaveDefinitions(type) {
    type = resolveForwardRef(type);
    const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
    if (!def) {
      errors.push(`Unexpected value '${stringifyForError(type)}' declared by the module '${stringifyForError(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);
    }
  }
  function verifyDirectivesHaveSelector(type) {
    type = resolveForwardRef(type);
    const def = getDirectiveDef(type);
    if (!getComponentDef(type) && def && def.selectors.length == 0) {
      errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);
    }
  }
  function verifyNotStandalone(type, moduleType2) {
    type = resolveForwardRef(type);
    const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
    if (def?.standalone) {
      const location2 = `"${stringifyForError(moduleType2)}" NgModule`;
      errors.push(generateStandaloneInDeclarationsError(type, location2));
    }
  }
  function verifyExportsAreDeclaredOrReExported(type) {
    type = resolveForwardRef(type);
    const kind = getComponentDef(type) && "component" || getDirectiveDef(type) && "directive" || getPipeDef$1(type) && "pipe";
    if (kind) {
      if (combinedDeclarations.lastIndexOf(type) === -1) {
        errors.push(`Can't export ${kind} ${stringifyForError(type)} from ${stringifyForError(moduleType)} as it was neither declared nor imported!`);
      }
    }
  }
  function verifyDeclarationIsUnique(type, suppressErrors) {
    type = resolveForwardRef(type);
    const existingModule = ownerNgModule.get(type);
    if (existingModule && existingModule !== moduleType) {
      if (!suppressErrors) {
        const modules2 = [existingModule, moduleType].map(stringifyForError).sort();
        errors.push(`Type ${stringifyForError(type)} is part of the declarations of 2 modules: ${modules2[0]} and ${modules2[1]}! Please consider moving ${stringifyForError(type)} to a higher module that imports ${modules2[0]} and ${modules2[1]}. You can also create a new NgModule that exports and includes ${stringifyForError(type)} then import that NgModule in ${modules2[0]} and ${modules2[1]}.`);
      }
    } else {
      ownerNgModule.set(type, moduleType);
    }
  }
  function verifyComponentIsPartOfNgModule(type) {
    type = resolveForwardRef(type);
    const existingModule = ownerNgModule.get(type);
    if (!existingModule && !isStandalone(type)) {
      errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);
    }
  }
  function verifyCorrectBootstrapType(type) {
    type = resolveForwardRef(type);
    if (!getComponentDef(type)) {
      errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);
    }
    if (isStandalone(type)) {
      errors.push(`The \`${stringifyForError(type)}\` class is a standalone component, which can not be used in the \`@NgModule.bootstrap\` array. Use the \`bootstrapApplication\` function for bootstrap instead.`);
    }
  }
  function verifySemanticsOfNgModuleImport(type, importingModule2) {
    type = resolveForwardRef(type);
    const directiveDef = getComponentDef(type) || getDirectiveDef(type);
    if (directiveDef !== null && !directiveDef.standalone) {
      throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule2.name}'. Please add an @NgModule annotation.`);
    }
    const pipeDef = getPipeDef$1(type);
    if (pipeDef !== null && !pipeDef.standalone) {
      throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule2.name}'. Please add an @NgModule annotation.`);
    }
  }
}
function unwrapModuleWithProvidersImports(typeOrWithProviders) {
  typeOrWithProviders = resolveForwardRef(typeOrWithProviders);
  return typeOrWithProviders.ngModule || typeOrWithProviders;
}
function getAnnotation(type, name) {
  let annotation = null;
  collect(type.__annotations__);
  collect(type.decorators);
  return annotation;
  function collect(annotations) {
    if (annotations) {
      annotations.forEach(readAnnotation);
    }
  }
  function readAnnotation(decorator) {
    if (!annotation) {
      const proto = Object.getPrototypeOf(decorator);
      if (proto.ngMetadataName == name) {
        annotation = decorator;
      } else if (decorator.type) {
        const proto2 = Object.getPrototypeOf(decorator.type);
        if (proto2.ngMetadataName == name) {
          annotation = decorator.args[0];
        }
      }
    }
  }
}
var ownerNgModule = /* @__PURE__ */ new WeakMap();
var verifiedNgModule = /* @__PURE__ */ new WeakMap();
function computeCombinedExports(type) {
  type = resolveForwardRef(type);
  const ngModuleDef = getNgModuleDef(type);
  if (ngModuleDef === null) {
    return [type];
  }
  return flatten(maybeUnwrapFn(ngModuleDef.exports).map((type2) => {
    const ngModuleDef2 = getNgModuleDef(type2);
    if (ngModuleDef2) {
      verifySemanticsOfNgModuleDef(type2, false);
      return computeCombinedExports(type2);
    } else {
      return type2;
    }
  }));
}
function setScopeOnDeclaredComponents(moduleType, ngModule) {
  const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
  const transitiveScopes = transitiveScopesFor(moduleType);
  declarations.forEach((declaration) => {
    declaration = resolveForwardRef(declaration);
    if (declaration.hasOwnProperty(NG_COMP_DEF)) {
      const component = declaration;
      const componentDef = getComponentDef(component);
      patchComponentDefWithScope(componentDef, transitiveScopes);
    } else if (!declaration.hasOwnProperty(NG_DIR_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {
      declaration.ngSelectorScope = moduleType;
    }
  });
}
function patchComponentDefWithScope(componentDef, transitiveScopes) {
  componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives).map((dir) => dir.hasOwnProperty(NG_COMP_DEF) ? getComponentDef(dir) : getDirectiveDef(dir)).filter((def) => !!def);
  componentDef.pipeDefs = () => Array.from(transitiveScopes.compilation.pipes).map((pipe) => getPipeDef$1(pipe));
  componentDef.schemas = transitiveScopes.schemas;
  componentDef.tView = null;
}
function transitiveScopesFor(type) {
  if (isNgModule(type)) {
    if (USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {
      const scope = depsTracker.getNgModuleScope(type);
      const def = getNgModuleDef(type, true);
      return __spreadValues({
        schemas: def.schemas || null
      }, scope);
    } else {
      return transitiveScopesForNgModule(type);
    }
  } else if (isStandalone(type)) {
    const directiveDef = getComponentDef(type) || getDirectiveDef(type);
    if (directiveDef !== null) {
      return {
        schemas: null,
        compilation: {
          directives: /* @__PURE__ */ new Set(),
          pipes: /* @__PURE__ */ new Set()
        },
        exported: {
          directives: /* @__PURE__ */ new Set([type]),
          pipes: /* @__PURE__ */ new Set()
        }
      };
    }
    const pipeDef = getPipeDef$1(type);
    if (pipeDef !== null) {
      return {
        schemas: null,
        compilation: {
          directives: /* @__PURE__ */ new Set(),
          pipes: /* @__PURE__ */ new Set()
        },
        exported: {
          directives: /* @__PURE__ */ new Set(),
          pipes: /* @__PURE__ */ new Set([type])
        }
      };
    }
  }
  throw new Error(`${type.name} does not have a module def (\u0275mod property)`);
}
function transitiveScopesForNgModule(moduleType) {
  const def = getNgModuleDef(moduleType, true);
  if (def.transitiveCompileScopes !== null) {
    return def.transitiveCompileScopes;
  }
  const scopes = {
    schemas: def.schemas || null,
    compilation: {
      directives: /* @__PURE__ */ new Set(),
      pipes: /* @__PURE__ */ new Set()
    },
    exported: {
      directives: /* @__PURE__ */ new Set(),
      pipes: /* @__PURE__ */ new Set()
    }
  };
  maybeUnwrapFn(def.imports).forEach((imported) => {
    const importedScope = transitiveScopesFor(imported);
    importedScope.exported.directives.forEach((entry) => scopes.compilation.directives.add(entry));
    importedScope.exported.pipes.forEach((entry) => scopes.compilation.pipes.add(entry));
  });
  maybeUnwrapFn(def.declarations).forEach((declared) => {
    const declaredWithDefs = declared;
    if (getPipeDef$1(declaredWithDefs)) {
      scopes.compilation.pipes.add(declared);
    } else {
      scopes.compilation.directives.add(declared);
    }
  });
  maybeUnwrapFn(def.exports).forEach((exported) => {
    const exportedType = exported;
    if (isNgModule(exportedType)) {
      const exportedScope = transitiveScopesFor(exportedType);
      exportedScope.exported.directives.forEach((entry) => {
        scopes.compilation.directives.add(entry);
        scopes.exported.directives.add(entry);
      });
      exportedScope.exported.pipes.forEach((entry) => {
        scopes.compilation.pipes.add(entry);
        scopes.exported.pipes.add(entry);
      });
    } else if (getPipeDef$1(exportedType)) {
      scopes.exported.pipes.add(exportedType);
    } else {
      scopes.exported.directives.add(exportedType);
    }
  });
  def.transitiveCompileScopes = scopes;
  return scopes;
}
function expandModuleWithProviders(value) {
  if (isModuleWithProviders(value)) {
    return value.ngModule;
  }
  return value;
}
var compilationDepth = 0;
function compileComponent(type, metadata) {
  (typeof ngDevMode === "undefined" || ngDevMode) && initNgDevMode();
  let ngComponentDef = null;
  maybeQueueResolutionOfComponentResources(type, metadata);
  addDirectiveFactoryDef(type, metadata);
  Object.defineProperty(type, NG_COMP_DEF, {
    get: () => {
      if (ngComponentDef === null) {
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "component",
          type
        });
        if (componentNeedsResolution(metadata)) {
          const error3 = [`Component '${type.name}' is not resolved:`];
          if (metadata.templateUrl) {
            error3.push(` - templateUrl: ${metadata.templateUrl}`);
          }
          if (metadata.styleUrls && metadata.styleUrls.length) {
            error3.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);
          }
          if (metadata.styleUrl) {
            error3.push(` - styleUrl: ${metadata.styleUrl}`);
          }
          error3.push(`Did you run and wait for 'resolveComponentResources()'?`);
          throw new Error(error3.join("\n"));
        }
        const options = getJitOptions();
        let preserveWhitespaces = metadata.preserveWhitespaces;
        if (preserveWhitespaces === void 0) {
          if (options !== null && options.preserveWhitespaces !== void 0) {
            preserveWhitespaces = options.preserveWhitespaces;
          } else {
            preserveWhitespaces = false;
          }
        }
        let encapsulation = metadata.encapsulation;
        if (encapsulation === void 0) {
          if (options !== null && options.defaultEncapsulation !== void 0) {
            encapsulation = options.defaultEncapsulation;
          } else {
            encapsulation = ViewEncapsulation$1.Emulated;
          }
        }
        const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;
        const meta = __spreadProps(__spreadValues({}, directiveMetadata(type, metadata)), {
          typeSourceSpan: compiler.createParseSourceSpan("Component", type.name, templateUrl),
          template: metadata.template || "",
          preserveWhitespaces,
          styles: typeof metadata.styles === "string" ? [metadata.styles] : metadata.styles || EMPTY_ARRAY,
          animations: metadata.animations,
          // JIT components are always compiled against an empty set of `declarations`. Instead, the
          // `directiveDefs` and `pipeDefs` are updated at a later point:
          //  * for NgModule-based components, they're set when the NgModule which declares the
          //    component resolves in the module scoping queue
          //  * for standalone components, they're set just below, after `compileComponent`.
          declarations: [],
          changeDetection: metadata.changeDetection,
          encapsulation,
          interpolation: metadata.interpolation,
          viewProviders: metadata.viewProviders || null
        });
        compilationDepth++;
        try {
          if (meta.usesInheritance) {
            addDirectiveDefToUndecoratedParents(type);
          }
          ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);
          if (metadata.standalone) {
            const imports = flatten(metadata.imports || EMPTY_ARRAY);
            const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);
            ngComponentDef.directiveDefs = directiveDefs;
            ngComponentDef.pipeDefs = pipeDefs;
            ngComponentDef.dependencies = () => imports.map(resolveForwardRef);
          }
        } finally {
          compilationDepth--;
        }
        if (compilationDepth === 0) {
          flushModuleScopingQueueAsMuchAsPossible();
        }
        if (hasSelectorScope(type)) {
          const scopes = transitiveScopesFor(type.ngSelectorScope);
          patchComponentDefWithScope(ngComponentDef, scopes);
        }
        if (metadata.schemas) {
          if (metadata.standalone) {
            ngComponentDef.schemas = metadata.schemas;
          } else {
            throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);
          }
        } else if (metadata.standalone) {
          ngComponentDef.schemas = [];
        }
      }
      return ngComponentDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
}
function getStandaloneDefFunctions(type, imports) {
  let cachedDirectiveDefs = null;
  let cachedPipeDefs = null;
  const directiveDefs = () => {
    if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {
      if (cachedDirectiveDefs === null) {
        cachedDirectiveDefs = [getComponentDef(type)];
        const seen = /* @__PURE__ */ new Set([type]);
        for (const rawDep of imports) {
          ngDevMode && verifyStandaloneImport(rawDep, type);
          const dep = resolveForwardRef(rawDep);
          if (seen.has(dep)) {
            continue;
          }
          seen.add(dep);
          if (!!getNgModuleDef(dep)) {
            const scope = transitiveScopesFor(dep);
            for (const dir of scope.exported.directives) {
              const def = getComponentDef(dir) || getDirectiveDef(dir);
              if (def && !seen.has(dir)) {
                seen.add(dir);
                cachedDirectiveDefs.push(def);
              }
            }
          } else {
            const def = getComponentDef(dep) || getDirectiveDef(dep);
            if (def) {
              cachedDirectiveDefs.push(def);
            }
          }
        }
      }
      return cachedDirectiveDefs;
    } else {
      if (ngDevMode) {
        for (const rawDep of imports) {
          verifyStandaloneImport(rawDep, type);
        }
      }
      if (!isComponent(type)) {
        return [];
      }
      const scope = depsTracker.getStandaloneComponentScope(type, imports);
      return [...scope.compilation.directives].map((p) => getComponentDef(p) || getDirectiveDef(p)).filter((d) => d !== null);
    }
  };
  const pipeDefs = () => {
    if (!USE_RUNTIME_DEPS_TRACKER_FOR_JIT) {
      if (cachedPipeDefs === null) {
        cachedPipeDefs = [];
        const seen = /* @__PURE__ */ new Set();
        for (const rawDep of imports) {
          const dep = resolveForwardRef(rawDep);
          if (seen.has(dep)) {
            continue;
          }
          seen.add(dep);
          if (!!getNgModuleDef(dep)) {
            const scope = transitiveScopesFor(dep);
            for (const pipe of scope.exported.pipes) {
              const def = getPipeDef$1(pipe);
              if (def && !seen.has(pipe)) {
                seen.add(pipe);
                cachedPipeDefs.push(def);
              }
            }
          } else {
            const def = getPipeDef$1(dep);
            if (def) {
              cachedPipeDefs.push(def);
            }
          }
        }
      }
      return cachedPipeDefs;
    } else {
      if (ngDevMode) {
        for (const rawDep of imports) {
          verifyStandaloneImport(rawDep, type);
        }
      }
      if (!isComponent(type)) {
        return [];
      }
      const scope = depsTracker.getStandaloneComponentScope(type, imports);
      return [...scope.compilation.pipes].map((p) => getPipeDef$1(p)).filter((d) => d !== null);
    }
  };
  return {
    directiveDefs,
    pipeDefs
  };
}
function hasSelectorScope(component) {
  return component.ngSelectorScope !== void 0;
}
function compileDirective(type, directive) {
  let ngDirectiveDef = null;
  addDirectiveFactoryDef(type, directive || {});
  Object.defineProperty(type, NG_DIR_DEF, {
    get: () => {
      if (ngDirectiveDef === null) {
        const meta = getDirectiveMetadata(type, directive || {});
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "directive",
          type
        });
        ngDirectiveDef = compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
      }
      return ngDirectiveDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
}
function getDirectiveMetadata(type, metadata) {
  const name = type && type.name;
  const sourceMapUrl = `ng:///${name}/\u0275dir.js`;
  const compiler = getCompilerFacade({ usage: 0, kind: "directive", type });
  const facade = directiveMetadata(type, metadata);
  facade.typeSourceSpan = compiler.createParseSourceSpan("Directive", name, sourceMapUrl);
  if (facade.usesInheritance) {
    addDirectiveDefToUndecoratedParents(type);
  }
  return { metadata: facade, sourceMapUrl };
}
function addDirectiveFactoryDef(type, metadata) {
  let ngFactoryDef = null;
  Object.defineProperty(type, NG_FACTORY_DEF, {
    get: () => {
      if (ngFactoryDef === null) {
        const meta = getDirectiveMetadata(type, metadata);
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "directive",
          type
        });
        ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/\u0275fac.js`, {
          name: meta.metadata.name,
          type: meta.metadata.type,
          typeArgumentCount: 0,
          deps: reflectDependencies(type),
          target: compiler.FactoryTarget.Directive
        });
      }
      return ngFactoryDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
}
function extendsDirectlyFromObject(type) {
  return Object.getPrototypeOf(type.prototype) === Object.prototype;
}
function directiveMetadata(type, metadata) {
  const reflect = getReflect();
  const propMetadata = reflect.ownPropMetadata(type);
  return {
    name: type.name,
    type,
    selector: metadata.selector !== void 0 ? metadata.selector : null,
    host: metadata.host || EMPTY_OBJ,
    propMetadata,
    inputs: metadata.inputs || EMPTY_ARRAY,
    outputs: metadata.outputs || EMPTY_ARRAY,
    queries: extractQueriesMetadata(type, propMetadata, isContentQuery),
    lifecycle: { usesOnChanges: reflect.hasLifecycleHook(type, "ngOnChanges") },
    typeSourceSpan: null,
    usesInheritance: !extendsDirectlyFromObject(type),
    exportAs: extractExportAs(metadata.exportAs),
    providers: metadata.providers || null,
    viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
    isStandalone: !!metadata.standalone,
    isSignal: !!metadata.signals,
    hostDirectives: metadata.hostDirectives?.map((directive) => typeof directive === "function" ? { directive } : directive) || null
  };
}
function addDirectiveDefToUndecoratedParents(type) {
  const objPrototype = Object.prototype;
  let parent = Object.getPrototypeOf(type.prototype).constructor;
  while (parent && parent !== objPrototype) {
    if (!getDirectiveDef(parent) && !getComponentDef(parent) && shouldAddAbstractDirective(parent)) {
      compileDirective(parent, null);
    }
    parent = Object.getPrototypeOf(parent);
  }
}
function convertToR3QueryPredicate(selector) {
  return typeof selector === "string" ? splitByComma(selector) : resolveForwardRef(selector);
}
function convertToR3QueryMetadata(propertyName, ann) {
  return {
    propertyName,
    predicate: convertToR3QueryPredicate(ann.selector),
    descendants: ann.descendants,
    first: ann.first,
    read: ann.read ? ann.read : null,
    static: !!ann.static,
    emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,
    isSignal: !!ann.isSignal
  };
}
function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
  const queriesMeta = [];
  for (const field in propMetadata) {
    if (propMetadata.hasOwnProperty(field)) {
      const annotations = propMetadata[field];
      annotations.forEach((ann) => {
        if (isQueryAnn(ann)) {
          if (!ann.selector) {
            throw new Error(`Can't construct a query for the property "${field}" of "${stringifyForError(type)}" since the query selector wasn't defined.`);
          }
          if (annotations.some(isInputAnnotation)) {
            throw new Error(`Cannot combine @Input decorators with query decorators`);
          }
          queriesMeta.push(convertToR3QueryMetadata(field, ann));
        }
      });
    }
  }
  return queriesMeta;
}
function extractExportAs(exportAs) {
  return exportAs === void 0 ? null : splitByComma(exportAs);
}
function isContentQuery(value) {
  const name = value.ngMetadataName;
  return name === "ContentChild" || name === "ContentChildren";
}
function isViewQuery(value) {
  const name = value.ngMetadataName;
  return name === "ViewChild" || name === "ViewChildren";
}
function isInputAnnotation(value) {
  return value.ngMetadataName === "Input";
}
function splitByComma(value) {
  return value.split(",").map((piece) => piece.trim());
}
var LIFECYCLE_HOOKS = [
  "ngOnChanges",
  "ngOnInit",
  "ngOnDestroy",
  "ngDoCheck",
  "ngAfterViewInit",
  "ngAfterViewChecked",
  "ngAfterContentInit",
  "ngAfterContentChecked"
];
function shouldAddAbstractDirective(type) {
  const reflect = getReflect();
  if (LIFECYCLE_HOOKS.some((hookName) => reflect.hasLifecycleHook(type, hookName))) {
    return true;
  }
  const propMetadata = reflect.propMetadata(type);
  for (const field in propMetadata) {
    const annotations = propMetadata[field];
    for (let i2 = 0; i2 < annotations.length; i2++) {
      const current = annotations[i2];
      const metadataName = current.ngMetadataName;
      if (isInputAnnotation(current) || isContentQuery(current) || isViewQuery(current) || metadataName === "Output" || metadataName === "HostBinding" || metadataName === "HostListener") {
        return true;
      }
    }
  }
  return false;
}
function compilePipe(type, meta) {
  let ngPipeDef = null;
  let ngFactoryDef = null;
  Object.defineProperty(type, NG_FACTORY_DEF, {
    get: () => {
      if (ngFactoryDef === null) {
        const metadata = getPipeMetadata(type, meta);
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "pipe",
          type: metadata.type
        });
        ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/\u0275fac.js`, {
          name: metadata.name,
          type: metadata.type,
          typeArgumentCount: 0,
          deps: reflectDependencies(type),
          target: compiler.FactoryTarget.Pipe
        });
      }
      return ngFactoryDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
  Object.defineProperty(type, NG_PIPE_DEF, {
    get: () => {
      if (ngPipeDef === null) {
        const metadata = getPipeMetadata(type, meta);
        const compiler = getCompilerFacade({
          usage: 0,
          kind: "pipe",
          type: metadata.type
        });
        ngPipeDef = compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/\u0275pipe.js`, metadata);
      }
      return ngPipeDef;
    },
    // Make the property configurable in dev mode to allow overriding in tests
    configurable: !!ngDevMode
  });
}
function getPipeMetadata(type, meta) {
  return {
    type,
    name: type.name,
    pipeName: meta.name,
    pure: meta.pure !== void 0 ? meta.pure : true,
    isStandalone: !!meta.standalone
  };
}
var Directive = makeDecorator("Directive", (dir = {}) => dir, void 0, void 0, (type, meta) => compileDirective(type, meta));
var Component = makeDecorator("Component", (c = {}) => __spreadValues({ changeDetection: ChangeDetectionStrategy.Default }, c), Directive, void 0, (type, meta) => compileComponent(type, meta));
var Pipe = makeDecorator("Pipe", (p) => __spreadValues({ pure: true }, p), void 0, void 0, (type, meta) => compilePipe(type, meta));
var Input = makePropDecorator("Input", (arg) => {
  if (!arg) {
    return {};
  }
  return typeof arg === "string" ? { alias: arg } : arg;
});
var Output = makePropDecorator("Output", (alias) => ({ alias }));
var HostBinding = makePropDecorator("HostBinding", (hostPropertyName) => ({ hostPropertyName }));
var HostListener = makePropDecorator("HostListener", (eventName, args) => ({ eventName, args }));
var NgModule = makeDecorator(
  "NgModule",
  (ngModule) => ngModule,
  void 0,
  void 0,
  /**
   * Decorator that marks the following class as an NgModule, and supplies
   * configuration metadata for it.
   *
   * * The `declarations` option configures the compiler
   * with information about what belongs to the NgModule.
   * * The `providers` options configures the NgModule's injector to provide
   * dependencies the NgModule members.
   * * The `imports` and `exports` options bring in members from other modules, and make
   * this module's members available to others.
   */
  (type, meta) => compileNgModule(type, meta)
);
var Version = class {
  constructor(full) {
    this.full = full;
    const parts = full.split(".");
    this.major = parts[0];
    this.minor = parts[1];
    this.patch = parts.slice(2).join(".");
  }
};
var VERSION = new Version("18.0.0-rc.1");
var _Console = class _Console {
  log(message) {
    console.log(message);
  }
  // Note: for reporting errors use `DOM.logError()` as it is platform specific
  warn(message) {
    console.warn(message);
  }
};
_Console.\u0275fac = function Console_Factory(t) {
  return new (t || _Console)();
};
_Console.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Console, factory: _Console.\u0275fac, providedIn: "platform" });
var Console = _Console;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
    type: Injectable,
    args: [{ providedIn: "platform" }]
  }], null, null);
})();
var DIDebugData = class {
  constructor() {
    this.resolverToTokenToDependencies = /* @__PURE__ */ new WeakMap();
    this.resolverToProviders = /* @__PURE__ */ new WeakMap();
    this.standaloneInjectorToComponent = /* @__PURE__ */ new WeakMap();
  }
  reset() {
    this.resolverToTokenToDependencies = /* @__PURE__ */ new WeakMap();
    this.resolverToProviders = /* @__PURE__ */ new WeakMap();
    this.standaloneInjectorToComponent = /* @__PURE__ */ new WeakMap();
  }
};
var frameworkDIDebugData = new DIDebugData();
function getFrameworkDIDebugData() {
  return frameworkDIDebugData;
}
function setupFrameworkInjectorProfiler() {
  frameworkDIDebugData.reset();
  setInjectorProfiler((injectorProfilerEvent) => handleInjectorProfilerEvent(injectorProfilerEvent));
}
function handleInjectorProfilerEvent(injectorProfilerEvent) {
  const { context: context2, type } = injectorProfilerEvent;
  if (type === 0) {
    handleInjectEvent(context2, injectorProfilerEvent.service);
  } else if (type === 1) {
    handleInstanceCreatedByInjectorEvent(context2, injectorProfilerEvent.instance);
  } else if (type === 2) {
    handleProviderConfiguredEvent(context2, injectorProfilerEvent.providerRecord);
  }
}
function handleInjectEvent(context2, data) {
  const diResolver = getDIResolver(context2.injector);
  if (diResolver === null) {
    throwError2("An Inject event must be run within an injection context.");
  }
  const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies;
  if (!diResolverToInstantiatedToken.has(diResolver)) {
    diResolverToInstantiatedToken.set(diResolver, /* @__PURE__ */ new WeakMap());
  }
  if (!canBeHeldWeakly(context2.token)) {
    return;
  }
  const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver);
  if (!instantiatedTokenToDependencies.has(context2.token)) {
    instantiatedTokenToDependencies.set(context2.token, []);
  }
  const { token, value, flags } = data;
  assertDefined(context2.token, "Injector profiler context token is undefined.");
  const dependencies = instantiatedTokenToDependencies.get(context2.token);
  assertDefined(dependencies, "Could not resolve dependencies for token.");
  if (context2.injector instanceof NodeInjector) {
    dependencies.push({ token, value, flags, injectedIn: getNodeInjectorContext(context2.injector) });
  } else {
    dependencies.push({ token, value, flags });
  }
}
function getNodeInjectorContext(injector) {
  if (!(injector instanceof NodeInjector)) {
    throwError2("getNodeInjectorContext must be called with a NodeInjector");
  }
  const lView = getNodeInjectorLView(injector);
  const tNode = getNodeInjectorTNode(injector);
  if (tNode === null) {
    return;
  }
  assertTNodeForLView(tNode, lView);
  return { lView, tNode };
}
function handleInstanceCreatedByInjectorEvent(context2, data) {
  const { value } = data;
  if (getDIResolver(context2.injector) === null) {
    throwError2("An InjectorCreatedInstance event must be run within an injection context.");
  }
  let standaloneComponent = void 0;
  if (typeof value === "object") {
    standaloneComponent = value?.constructor;
  }
  if (standaloneComponent === void 0 || !isStandaloneComponent(standaloneComponent)) {
    return;
  }
  const environmentInjector = context2.injector.get(EnvironmentInjector, null, { optional: true });
  if (environmentInjector === null) {
    return;
  }
  const { standaloneInjectorToComponent } = frameworkDIDebugData;
  if (standaloneInjectorToComponent.has(environmentInjector)) {
    return;
  }
  standaloneInjectorToComponent.set(environmentInjector, standaloneComponent);
}
function isStandaloneComponent(value) {
  const def = getComponentDef(value);
  return !!def?.standalone;
}
function handleProviderConfiguredEvent(context2, data) {
  const { resolverToProviders } = frameworkDIDebugData;
  let diResolver;
  if (context2?.injector instanceof NodeInjector) {
    diResolver = getNodeInjectorTNode(context2.injector);
  } else {
    diResolver = context2.injector;
  }
  if (diResolver === null) {
    throwError2("A ProviderConfigured event must be run within an injection context.");
  }
  if (!resolverToProviders.has(diResolver)) {
    resolverToProviders.set(diResolver, []);
  }
  resolverToProviders.get(diResolver).push(data);
}
function getDIResolver(injector) {
  let diResolver = null;
  if (injector === void 0) {
    return diResolver;
  }
  if (injector instanceof NodeInjector) {
    diResolver = getNodeInjectorLView(injector);
  } else {
    diResolver = injector;
  }
  return diResolver;
}
function canBeHeldWeakly(value) {
  return value !== null && (typeof value === "object" || typeof value === "function" || typeof value === "symbol");
}
function applyChanges(component) {
  ngDevMode && assertDefined(component, "component");
  markViewDirty(
    getComponentViewByInstance(component),
    3
    /* NotificationSource.DebugApplyChanges */
  );
  getRootComponents(component).forEach((rootComponent) => detectChanges(rootComponent));
}
function detectChanges(component) {
  const view = getComponentViewByInstance(component);
  view[FLAGS] |= 1024;
  detectChangesInternal(view);
}
function getDependenciesFromInjectable(injector, token) {
  const instance = injector.get(token, null, { self: true, optional: true });
  if (instance === null) {
    throw new Error(`Unable to determine instance of ${token} in given injector`);
  }
  const unformattedDependencies = getDependenciesForTokenInInjector(token, injector);
  const resolutionPath = getInjectorResolutionPath(injector);
  const dependencies = unformattedDependencies.map((dep) => {
    const formattedDependency = {
      value: dep.value
    };
    const flags = dep.flags;
    formattedDependency.flags = {
      optional: (8 & flags) === 8,
      host: (1 & flags) === 1,
      self: (2 & flags) === 2,
      skipSelf: (4 & flags) === 4
    };
    for (let i2 = 0; i2 < resolutionPath.length; i2++) {
      const injectorToCheck = resolutionPath[i2];
      if (i2 === 0 && formattedDependency.flags.skipSelf) {
        continue;
      }
      if (formattedDependency.flags.host && injectorToCheck instanceof EnvironmentInjector) {
        break;
      }
      const instance2 = injectorToCheck.get(dep.token, null, {
        self: true,
        optional: true
      });
      if (instance2 !== null) {
        if (formattedDependency.flags.host) {
          const firstInjector = resolutionPath[0];
          const lookupFromFirstInjector = firstInjector.get(dep.token, null, __spreadProps(__spreadValues({}, formattedDependency.flags), {
            optional: true
          }));
          if (lookupFromFirstInjector !== null) {
            formattedDependency.providedIn = injectorToCheck;
          }
          break;
        }
        formattedDependency.providedIn = injectorToCheck;
        break;
      }
      if (i2 === 0 && formattedDependency.flags.self) {
        break;
      }
    }
    if (dep.token)
      formattedDependency.token = dep.token;
    return formattedDependency;
  });
  return { instance, dependencies };
}
function getDependenciesForTokenInInjector(token, injector) {
  const { resolverToTokenToDependencies } = getFrameworkDIDebugData();
  if (!(injector instanceof NodeInjector)) {
    return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? [];
  }
  const lView = getNodeInjectorLView(injector);
  const tokenDependencyMap = resolverToTokenToDependencies.get(lView);
  const dependencies = tokenDependencyMap?.get(token) ?? [];
  return dependencies.filter((dependency) => {
    const dependencyNode = dependency.injectedIn?.tNode;
    if (dependencyNode === void 0) {
      return false;
    }
    const instanceNode = getNodeInjectorTNode(injector);
    assertTNode(dependencyNode);
    assertTNode(instanceNode);
    return dependencyNode === instanceNode;
  });
}
function getProviderImportsContainer(injector) {
  const { standaloneInjectorToComponent } = getFrameworkDIDebugData();
  if (standaloneInjectorToComponent.has(injector)) {
    return standaloneInjectorToComponent.get(injector);
  }
  const defTypeRef = injector.get(NgModuleRef$1, null, { self: true, optional: true });
  if (defTypeRef === null) {
    return null;
  }
  if (defTypeRef.instance === null) {
    return null;
  }
  return defTypeRef.instance.constructor;
}
function getNodeInjectorProviders(injector) {
  const diResolver = getNodeInjectorTNode(injector);
  const { resolverToProviders } = getFrameworkDIDebugData();
  return resolverToProviders.get(diResolver) ?? [];
}
function getProviderImportPaths(providerImportsContainer) {
  const providerToPath = /* @__PURE__ */ new Map();
  const visitedContainers = /* @__PURE__ */ new Set();
  const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers);
  walkProviderTree(providerImportsContainer, visitor, [], /* @__PURE__ */ new Set());
  return providerToPath;
}
function walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) {
  return (provider, container) => {
    if (!providerToPath.has(provider)) {
      providerToPath.set(provider, [container]);
    }
    if (!visitedContainers.has(container)) {
      for (const prov of providerToPath.keys()) {
        const existingImportPath = providerToPath.get(prov);
        let containerDef = getInjectorDef(container);
        if (!containerDef) {
          const ngModule = container.ngModule;
          containerDef = getInjectorDef(ngModule);
        }
        if (!containerDef) {
          return;
        }
        const lastContainerAddedToPath = existingImportPath[0];
        let isNextStepInPath = false;
        deepForEach(containerDef.imports, (moduleImport) => {
          if (isNextStepInPath) {
            return;
          }
          isNextStepInPath = moduleImport.ngModule === lastContainerAddedToPath || moduleImport === lastContainerAddedToPath;
          if (isNextStepInPath) {
            providerToPath.get(prov)?.unshift(container);
          }
        });
      }
    }
    visitedContainers.add(container);
  };
}
function getEnvironmentInjectorProviders(injector) {
  const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? [];
  if (isPlatformInjector(injector)) {
    return providerRecordsWithoutImportPaths;
  }
  const providerImportsContainer = getProviderImportsContainer(injector);
  if (providerImportsContainer === null) {
    return providerRecordsWithoutImportPaths;
  }
  const providerToPath = getProviderImportPaths(providerImportsContainer);
  const providerRecords = [];
  for (const providerRecord of providerRecordsWithoutImportPaths) {
    const provider = providerRecord.provider;
    const token = provider.provide;
    if (token === ENVIRONMENT_INITIALIZER || token === INJECTOR_DEF_TYPES) {
      continue;
    }
    let importPath = providerToPath.get(provider) ?? [];
    const def = getComponentDef(providerImportsContainer);
    const isStandaloneComponent2 = !!def?.standalone;
    if (isStandaloneComponent2) {
      importPath = [providerImportsContainer, ...importPath];
    }
    providerRecords.push(__spreadProps(__spreadValues({}, providerRecord), { importPath }));
  }
  return providerRecords;
}
function isPlatformInjector(injector) {
  return injector instanceof R3Injector && injector.scopes.has("platform");
}
function getInjectorProviders(injector) {
  if (injector instanceof NodeInjector) {
    return getNodeInjectorProviders(injector);
  } else if (injector instanceof EnvironmentInjector) {
    return getEnvironmentInjectorProviders(injector);
  }
  throwError2("getInjectorProviders only supports NodeInjector and EnvironmentInjector");
}
function getInjectorMetadata(injector) {
  if (injector instanceof NodeInjector) {
    const lView = getNodeInjectorLView(injector);
    const tNode = getNodeInjectorTNode(injector);
    assertTNodeForLView(tNode, lView);
    return { type: "element", source: getNativeByTNode(tNode, lView) };
  }
  if (injector instanceof R3Injector) {
    return { type: "environment", source: injector.source ?? null };
  }
  if (injector instanceof NullInjector) {
    return { type: "null", source: null };
  }
  return null;
}
function getInjectorResolutionPath(injector) {
  const resolutionPath = [injector];
  getInjectorResolutionPathHelper(injector, resolutionPath);
  return resolutionPath;
}
function getInjectorResolutionPathHelper(injector, resolutionPath) {
  const parent = getInjectorParent(injector);
  if (parent === null) {
    if (injector instanceof NodeInjector) {
      const firstInjector = resolutionPath[0];
      if (firstInjector instanceof NodeInjector) {
        const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector);
        if (moduleInjector === null) {
          throwError2("NodeInjector must have some connection to the module injector tree");
        }
        resolutionPath.push(moduleInjector);
        getInjectorResolutionPathHelper(moduleInjector, resolutionPath);
      }
      return resolutionPath;
    }
  } else {
    resolutionPath.push(parent);
    getInjectorResolutionPathHelper(parent, resolutionPath);
  }
  return resolutionPath;
}
function getInjectorParent(injector) {
  if (injector instanceof R3Injector) {
    return injector.parent;
  }
  let tNode;
  let lView;
  if (injector instanceof NodeInjector) {
    tNode = getNodeInjectorTNode(injector);
    lView = getNodeInjectorLView(injector);
  } else if (injector instanceof NullInjector) {
    return null;
  } else if (injector instanceof ChainedInjector) {
    return injector.parentInjector;
  } else {
    throwError2("getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector, ChainedInjector");
  }
  const parentLocation = getParentInjectorLocation(tNode, lView);
  if (hasParentInjector(parentLocation)) {
    const parentInjectorIndex = getParentInjectorIndex(parentLocation);
    const parentLView = getParentInjectorView(parentLocation, lView);
    const parentTView = parentLView[TVIEW];
    const parentTNode = parentTView.data[
      parentInjectorIndex + 8
      /* NodeInjectorOffset.TNODE */
    ];
    return new NodeInjector(parentTNode, parentLView);
  } else {
    const chainedInjector = lView[INJECTOR];
    const injectorParent = chainedInjector.injector?.parent;
    if (injectorParent instanceof NodeInjector) {
      return injectorParent;
    }
  }
  return null;
}
function getModuleInjectorOfNodeInjector(injector) {
  let lView;
  if (injector instanceof NodeInjector) {
    lView = getNodeInjectorLView(injector);
  } else {
    throwError2("getModuleInjectorOfNodeInjector must be called with a NodeInjector");
  }
  const inj = lView[INJECTOR];
  const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent;
  if (!moduleInjector) {
    throwError2("NodeInjector must have some connection to the module injector tree");
  }
  return moduleInjector;
}
var GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
var globalUtilsFunctions = {
  /**
   * Warning: functions that start with `ɵ` are considered *INTERNAL* and should not be relied upon
   * in application's code. The contract of those functions might be changed in any release and/or a
   * function can be removed completely.
   */
  "\u0275getDependenciesFromInjectable": getDependenciesFromInjectable,
  "\u0275getInjectorProviders": getInjectorProviders,
  "\u0275getInjectorResolutionPath": getInjectorResolutionPath,
  "\u0275getInjectorMetadata": getInjectorMetadata,
  "\u0275setProfiler": setProfiler,
  "getDirectiveMetadata": getDirectiveMetadata$1,
  "getComponent": getComponent$1,
  "getContext": getContext,
  "getListeners": getListeners,
  "getOwningComponent": getOwningComponent,
  "getHostElement": getHostElement,
  "getInjector": getInjector,
  "getRootComponents": getRootComponents,
  "getDirectives": getDirectives,
  "applyChanges": applyChanges,
  "isSignal": isSignal
};
var _published = false;
function publishDefaultGlobalUtils$1() {
  if (!_published) {
    _published = true;
    if (typeof window !== "undefined") {
      setupFrameworkInjectorProfiler();
    }
    for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {
      publishGlobalUtil(methodName, method);
    }
  }
}
function publishGlobalUtil(name, fn) {
  if (typeof COMPILED === "undefined" || !COMPILED) {
    const w = _global;
    ngDevMode && assertDefined(fn, "function not defined");
    w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {};
    w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn;
  }
}
var TESTABILITY = new InjectionToken("");
var TESTABILITY_GETTER = new InjectionToken("");
var _Testability = class _Testability {
  constructor(_ngZone, registry, testabilityGetter) {
    this._ngZone = _ngZone;
    this.registry = registry;
    this._isZoneStable = true;
    this._callbacks = [];
    this.taskTrackingZone = null;
    if (!_testabilityGetter) {
      setTestabilityGetter(testabilityGetter);
      testabilityGetter.addToWindow(registry);
    }
    this._watchAngularEvents();
    _ngZone.run(() => {
      this.taskTrackingZone = typeof Zone == "undefined" ? null : Zone.current.get("TaskTrackingZone");
    });
  }
  _watchAngularEvents() {
    this._ngZone.onUnstable.subscribe({
      next: () => {
        this._isZoneStable = false;
      }
    });
    this._ngZone.runOutsideAngular(() => {
      this._ngZone.onStable.subscribe({
        next: () => {
          NgZone.assertNotInAngularZone();
          queueMicrotask(() => {
            this._isZoneStable = true;
            this._runCallbacksIfReady();
          });
        }
      });
    });
  }
  /**
   * Whether an associated application is stable
   */
  isStable() {
    return this._isZoneStable && !this._ngZone.hasPendingMacrotasks;
  }
  _runCallbacksIfReady() {
    if (this.isStable()) {
      queueMicrotask(() => {
        while (this._callbacks.length !== 0) {
          let cb = this._callbacks.pop();
          clearTimeout(cb.timeoutId);
          cb.doneCb();
        }
      });
    } else {
      let pending = this.getPendingTasks();
      this._callbacks = this._callbacks.filter((cb) => {
        if (cb.updateCb && cb.updateCb(pending)) {
          clearTimeout(cb.timeoutId);
          return false;
        }
        return true;
      });
    }
  }
  getPendingTasks() {
    if (!this.taskTrackingZone) {
      return [];
    }
    return this.taskTrackingZone.macroTasks.map((t) => {
      return {
        source: t.source,
        // From TaskTrackingZone:
        // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40
        creationLocation: t.creationLocation,
        data: t.data
      };
    });
  }
  addCallback(cb, timeout, updateCb) {
    let timeoutId = -1;
    if (timeout && timeout > 0) {
      timeoutId = setTimeout(() => {
        this._callbacks = this._callbacks.filter((cb2) => cb2.timeoutId !== timeoutId);
        cb();
      }, timeout);
    }
    this._callbacks.push({ doneCb: cb, timeoutId, updateCb });
  }
  /**
   * Wait for the application to be stable with a timeout. If the timeout is reached before that
   * happens, the callback receives a list of the macro tasks that were pending, otherwise null.
   *
   * @param doneCb The callback to invoke when Angular is stable or the timeout expires
   *    whichever comes first.
   * @param timeout Optional. The maximum time to wait for Angular to become stable. If not
   *    specified, whenStable() will wait forever.
   * @param updateCb Optional. If specified, this callback will be invoked whenever the set of
   *    pending macrotasks changes. If this callback returns true doneCb will not be invoked
   *    and no further updates will be issued.
   */
  whenStable(doneCb, timeout, updateCb) {
    if (updateCb && !this.taskTrackingZone) {
      throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');
    }
    this.addCallback(doneCb, timeout, updateCb);
    this._runCallbacksIfReady();
  }
  /**
   * Registers an application with a testability hook so that it can be tracked.
   * @param token token of application, root element
   *
   * @internal
   */
  registerApplication(token) {
    this.registry.registerApplication(token, this);
  }
  /**
   * Unregisters an application.
   * @param token token of application, root element
   *
   * @internal
   */
  unregisterApplication(token) {
    this.registry.unregisterApplication(token);
  }
  /**
   * Find providers by name
   * @param using The root element to search from
   * @param provider The name of binding variable
   * @param exactMatch Whether using exactMatch
   */
  findProviders(using, provider, exactMatch) {
    return [];
  }
};
_Testability.\u0275fac = function Testability_Factory(t) {
  return new (t || _Testability)(\u0275\u0275inject(NgZone), \u0275\u0275inject(TestabilityRegistry), \u0275\u0275inject(TESTABILITY_GETTER));
};
_Testability.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Testability, factory: _Testability.\u0275fac });
var Testability = _Testability;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Testability, [{
    type: Injectable
  }], () => [{ type: NgZone }, { type: TestabilityRegistry }, { type: void 0, decorators: [{
    type: Inject,
    args: [TESTABILITY_GETTER]
  }] }], null);
})();
var _TestabilityRegistry = class _TestabilityRegistry {
  constructor() {
    this._applications = /* @__PURE__ */ new Map();
  }
  /**
   * Registers an application with a testability hook so that it can be tracked
   * @param token token of application, root element
   * @param testability Testability hook
   */
  registerApplication(token, testability) {
    this._applications.set(token, testability);
  }
  /**
   * Unregisters an application.
   * @param token token of application, root element
   */
  unregisterApplication(token) {
    this._applications.delete(token);
  }
  /**
   * Unregisters all applications
   */
  unregisterAllApplications() {
    this._applications.clear();
  }
  /**
   * Get a testability hook associated with the application
   * @param elem root element
   */
  getTestability(elem) {
    return this._applications.get(elem) || null;
  }
  /**
   * Get all registered testabilities
   */
  getAllTestabilities() {
    return Array.from(this._applications.values());
  }
  /**
   * Get all registered applications(root elements)
   */
  getAllRootElements() {
    return Array.from(this._applications.keys());
  }
  /**
   * Find testability of a node in the Tree
   * @param elem node
   * @param findInAncestors whether finding testability in ancestors if testability was not found in
   * current node
   */
  findTestabilityInTree(elem, findInAncestors = true) {
    return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null;
  }
};
_TestabilityRegistry.\u0275fac = function TestabilityRegistry_Factory(t) {
  return new (t || _TestabilityRegistry)();
};
_TestabilityRegistry.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _TestabilityRegistry, factory: _TestabilityRegistry.\u0275fac, providedIn: "platform" });
var TestabilityRegistry = _TestabilityRegistry;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
    type: Injectable,
    args: [{ providedIn: "platform" }]
  }], null, null);
})();
function setTestabilityGetter(getter) {
  _testabilityGetter = getter;
}
var _testabilityGetter;
function isPromise2(obj) {
  return !!obj && typeof obj.then === "function";
}
function isSubscribable(obj) {
  return !!obj && typeof obj.subscribe === "function";
}
var APP_INITIALIZER = new InjectionToken(ngDevMode ? "Application Initializer" : "");
var _ApplicationInitStatus = class _ApplicationInitStatus {
  constructor() {
    this.initialized = false;
    this.done = false;
    this.donePromise = new Promise((res, rej) => {
      this.resolve = res;
      this.reject = rej;
    });
    this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
    if ((typeof ngDevMode === "undefined" || ngDevMode) && !Array.isArray(this.appInits)) {
      throw new RuntimeError(-209, `Unexpected type of the \`APP_INITIALIZER\` token value (expected an array, but got ${typeof this.appInits}). Please check that the \`APP_INITIALIZER\` token is configured as a \`multi: true\` provider.`);
    }
  }
  /** @internal */
  runInitializers() {
    if (this.initialized) {
      return;
    }
    const asyncInitPromises = [];
    for (const appInits of this.appInits) {
      const initResult = appInits();
      if (isPromise2(initResult)) {
        asyncInitPromises.push(initResult);
      } else if (isSubscribable(initResult)) {
        const observableAsPromise = new Promise((resolve, reject) => {
          initResult.subscribe({ complete: resolve, error: reject });
        });
        asyncInitPromises.push(observableAsPromise);
      }
    }
    const complete = () => {
      this.done = true;
      this.resolve();
    };
    Promise.all(asyncInitPromises).then(() => {
      complete();
    }).catch((e) => {
      this.reject(e);
    });
    if (asyncInitPromises.length === 0) {
      complete();
    }
    this.initialized = true;
  }
};
_ApplicationInitStatus.\u0275fac = function ApplicationInitStatus_Factory(t) {
  return new (t || _ApplicationInitStatus)();
};
_ApplicationInitStatus.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ApplicationInitStatus, factory: _ApplicationInitStatus.\u0275fac, providedIn: "root" });
var ApplicationInitStatus = _ApplicationInitStatus;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], () => [], null);
})();
var APP_BOOTSTRAP_LISTENER = new InjectionToken(ngDevMode ? "appBootstrapListener" : "");
function publishDefaultGlobalUtils() {
  ngDevMode && publishDefaultGlobalUtils$1();
}
function publishSignalConfiguration() {
  setThrowInvalidWriteToSignalError(() => {
    throw new RuntimeError(600, ngDevMode && "Writing to signals is not allowed in a `computed` or an `effect` by default. Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.");
  });
}
function isBoundToModule(cf) {
  return cf.isBoundToModule;
}
var MAXIMUM_REFRESH_RERUNS = 10;
function _callAndReportToErrorHandler(errorHandler2, ngZone, callback) {
  try {
    const result = callback();
    if (isPromise2(result)) {
      return result.catch((e) => {
        ngZone.runOutsideAngular(() => errorHandler2.handleError(e));
        throw e;
      });
    }
    return result;
  } catch (e) {
    ngZone.runOutsideAngular(() => errorHandler2.handleError(e));
    throw e;
  }
}
function optionsReducer(dst, objs) {
  if (Array.isArray(objs)) {
    return objs.reduce(optionsReducer, dst);
  }
  return __spreadValues(__spreadValues({}, dst), objs);
}
var _ApplicationRef = class _ApplicationRef {
  constructor() {
    this._bootstrapListeners = [];
    this._runningTick = false;
    this._destroyed = false;
    this._destroyListeners = [];
    this._views = [];
    this.internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
    this.afterRenderEffectManager = inject(AfterRenderEventManager);
    this.zonelessEnabled = inject(ZONELESS_ENABLED);
    this.externalTestViews = /* @__PURE__ */ new Set();
    this.beforeRender = new Subject();
    this.afterTick = new Subject();
    this.componentTypes = [];
    this.components = [];
    this.isStable = inject(PendingTasks).hasPendingTasks.pipe(map((pending) => !pending));
    this._injector = inject(EnvironmentInjector);
  }
  /** @internal */
  get allViews() {
    return [...this.externalTestViews.keys(), ...this._views];
  }
  /**
   * Indicates whether this instance was destroyed.
   */
  get destroyed() {
    return this._destroyed;
  }
  /**
   * The `EnvironmentInjector` used to create this application.
   */
  get injector() {
    return this._injector;
  }
  /**
   * Bootstrap a component onto the element identified by its selector or, optionally, to a
   * specified element.
   *
   * @usageNotes
   * ### Bootstrap process
   *
   * When bootstrapping a component, Angular mounts it onto a target DOM element
   * and kicks off automatic change detection. The target DOM element can be
   * provided using the `rootSelectorOrNode` argument.
   *
   * If the target DOM element is not provided, Angular tries to find one on a page
   * using the `selector` of the component that is being bootstrapped
   * (first matched element is used).
   *
   * ### Example
   *
   * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
   * but it requires us to know the component while writing the application code.
   *
   * Imagine a situation where we have to wait for an API call to decide about the component to
   * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
   * dynamically bootstrap a component.
   *
   * {@example core/ts/platform/platform.ts region='componentSelector'}
   *
   * Optionally, a component can be mounted onto a DOM element that does not match the
   * selector of the bootstrapped component.
   *
   * In the following example, we are providing a CSS selector to match the target element.
   *
   * {@example core/ts/platform/platform.ts region='cssSelector'}
   *
   * While in this example, we are providing reference to a DOM node.
   *
   * {@example core/ts/platform/platform.ts region='domNode'}
   */
  bootstrap(componentOrFactory, rootSelectorOrNode) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.warnIfDestroyed();
    const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
    const initStatus = this._injector.get(ApplicationInitStatus);
    if (!initStatus.done) {
      const standalone = !isComponentFactory && isStandalone(componentOrFactory);
      const errorMessage = (typeof ngDevMode === "undefined" || ngDevMode) && "Cannot bootstrap as there are still asynchronous initializers running." + (standalone ? "" : " Bootstrap components in the `ngDoBootstrap` method of the root module.");
      throw new RuntimeError(405, errorMessage);
    }
    let componentFactory;
    if (isComponentFactory) {
      componentFactory = componentOrFactory;
    } else {
      const resolver = this._injector.get(ComponentFactoryResolver$1);
      componentFactory = resolver.resolveComponentFactory(componentOrFactory);
    }
    this.componentTypes.push(componentFactory.componentType);
    const ngModule = isBoundToModule(componentFactory) ? void 0 : this._injector.get(NgModuleRef$1);
    const selectorOrNode = rootSelectorOrNode || componentFactory.selector;
    const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);
    const nativeElement = compRef.location.nativeElement;
    const testability = compRef.injector.get(TESTABILITY, null);
    testability?.registerApplication(nativeElement);
    compRef.onDestroy(() => {
      this.detachView(compRef.hostView);
      remove(this.components, compRef);
      testability?.unregisterApplication(nativeElement);
    });
    this._loadComponent(compRef);
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      const _console = this._injector.get(Console);
      _console.log(`Angular is running in development mode.`);
    }
    return compRef;
  }
  /**
   * Invoke this method to explicitly process change detection and its side-effects.
   *
   * In development mode, `tick()` also performs a second change detection cycle to ensure that no
   * further changes are detected. If additional changes are picked up during this second cycle,
   * bindings in the app have side-effects that cannot be resolved in a single change detection
   * pass.
   * In this case, Angular throws an error, since an Angular application can only have one change
   * detection pass during which all change detection must complete.
   */
  tick() {
    this._tick(true);
  }
  /** @internal */
  _tick(refreshViews) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.warnIfDestroyed();
    if (this._runningTick) {
      throw new RuntimeError(101, ngDevMode && "ApplicationRef.tick is called recursively");
    }
    const prevConsumer = setActiveConsumer(null);
    try {
      this._runningTick = true;
      this.detectChangesInAttachedViews(refreshViews);
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        for (let view of this._views) {
          view.checkNoChanges();
        }
      }
    } catch (e) {
      this.internalErrorHandler(e);
    } finally {
      this._runningTick = false;
      setActiveConsumer(prevConsumer);
      this.afterTick.next();
    }
  }
  detectChangesInAttachedViews(refreshViews) {
    let rendererFactory = null;
    if (!this._injector.destroyed) {
      rendererFactory = this._injector.get(RendererFactory2, null, { optional: true });
    }
    let runs = 0;
    const afterRenderEffectManager = this.afterRenderEffectManager;
    while (runs < MAXIMUM_REFRESH_RERUNS) {
      const isFirstPass = runs === 0;
      if (refreshViews || !isFirstPass) {
        this.beforeRender.next(isFirstPass);
        for (let { _lView, notifyErrorHandler } of this._views) {
          detectChangesInViewIfRequired(_lView, notifyErrorHandler, isFirstPass, this.zonelessEnabled);
        }
      } else {
        rendererFactory?.begin?.();
        rendererFactory?.end?.();
      }
      runs++;
      afterRenderEffectManager.executeInternalCallbacks();
      if (this.allViews.some(({ _lView }) => requiresRefreshOrTraversal(_lView))) {
        continue;
      }
      afterRenderEffectManager.execute();
      if (!this.allViews.some(({ _lView }) => requiresRefreshOrTraversal(_lView))) {
        break;
      }
    }
    if ((typeof ngDevMode === "undefined" || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) {
      throw new RuntimeError(103, ngDevMode && "Infinite change detection while refreshing application views. Ensure views are not calling `markForCheck` on every template execution or that afterRender hooks always mark views for check.");
    }
  }
  /**
   * Attaches a view so that it will be dirty checked.
   * The view will be automatically detached when it is destroyed.
   * This will throw if the view is already attached to a ViewContainer.
   */
  attachView(viewRef) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.warnIfDestroyed();
    const view = viewRef;
    this._views.push(view);
    view.attachToAppRef(this);
  }
  /**
   * Detaches a view from dirty checking again.
   */
  detachView(viewRef) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.warnIfDestroyed();
    const view = viewRef;
    remove(this._views, view);
    view.detachFromAppRef();
  }
  _loadComponent(componentRef) {
    this.attachView(componentRef.hostView);
    this.tick();
    this.components.push(componentRef);
    const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []);
    if (ngDevMode && !Array.isArray(listeners)) {
      throw new RuntimeError(-209, `Unexpected type of the \`APP_BOOTSTRAP_LISTENER\` token value (expected an array, but got ${typeof listeners}). Please check that the \`APP_BOOTSTRAP_LISTENER\` token is configured as a \`multi: true\` provider.`);
    }
    [...this._bootstrapListeners, ...listeners].forEach((listener) => listener(componentRef));
  }
  /** @internal */
  ngOnDestroy() {
    if (this._destroyed)
      return;
    try {
      this._destroyListeners.forEach((listener) => listener());
      this._views.slice().forEach((view) => view.destroy());
    } finally {
      this._destroyed = true;
      this._views = [];
      this._bootstrapListeners = [];
      this._destroyListeners = [];
    }
  }
  /**
   * Registers a listener to be called when an instance is destroyed.
   *
   * @param callback A callback function to add as a listener.
   * @returns A function which unregisters a listener.
   */
  onDestroy(callback) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.warnIfDestroyed();
    this._destroyListeners.push(callback);
    return () => remove(this._destroyListeners, callback);
  }
  /**
   * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
   * will destroy the associated environment injectors as well as all the bootstrapped components
   * with their views.
   */
  destroy() {
    if (this._destroyed) {
      throw new RuntimeError(406, ngDevMode && "This instance of the `ApplicationRef` has already been destroyed.");
    }
    const injector = this._injector;
    if (injector.destroy && !injector.destroyed) {
      injector.destroy();
    }
  }
  /**
   * Returns the number of attached views.
   */
  get viewCount() {
    return this._views.length;
  }
  warnIfDestroyed() {
    if ((typeof ngDevMode === "undefined" || ngDevMode) && this._destroyed) {
      console.warn(formatRuntimeError(406, "This instance of the `ApplicationRef` has already been destroyed."));
    }
  }
};
_ApplicationRef.\u0275fac = function ApplicationRef_Factory(t) {
  return new (t || _ApplicationRef)();
};
_ApplicationRef.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ApplicationRef, factory: _ApplicationRef.\u0275fac, providedIn: "root" });
var ApplicationRef = _ApplicationRef;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], null, null);
})();
function remove(list, el) {
  const index = list.indexOf(el);
  if (index > -1) {
    list.splice(index, 1);
  }
}
function detectChangesInViewIfRequired(lView, notifyErrorHandler, isFirstPass, zonelessEnabled) {
  if (!isFirstPass && !requiresRefreshOrTraversal(lView)) {
    return;
  }
  const mode = isFirstPass && !zonelessEnabled ? (
    // The first pass is always in Global mode, which includes `CheckAlways` views.
    0
  ) : (
    // Only refresh views with the `RefreshView` flag or views is a changed signal
    1
  );
  detectChangesInternal(lView, notifyErrorHandler, mode);
}
var ModuleWithComponentFactories = class {
  constructor(ngModuleFactory, componentFactories) {
    this.ngModuleFactory = ngModuleFactory;
    this.componentFactories = componentFactories;
  }
};
var _Compiler = class _Compiler {
  /**
   * Compiles the given NgModule and all of its components. All templates of the components
   * have to be inlined.
   */
  compileModuleSync(moduleType) {
    return new NgModuleFactory(moduleType);
  }
  /**
   * Compiles the given NgModule and all of its components
   */
  compileModuleAsync(moduleType) {
    return Promise.resolve(this.compileModuleSync(moduleType));
  }
  /**
   * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
   */
  compileModuleAndAllComponentsSync(moduleType) {
    const ngModuleFactory = this.compileModuleSync(moduleType);
    const moduleDef = getNgModuleDef(moduleType);
    const componentFactories = maybeUnwrapFn(moduleDef.declarations).reduce((factories, declaration) => {
      const componentDef = getComponentDef(declaration);
      componentDef && factories.push(new ComponentFactory(componentDef));
      return factories;
    }, []);
    return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
  }
  /**
   * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
   */
  compileModuleAndAllComponentsAsync(moduleType) {
    return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
  }
  /**
   * Clears all caches.
   */
  clearCache() {
  }
  /**
   * Clears the cache for the given component/ngModule.
   */
  clearCacheFor(type) {
  }
  /**
   * Returns the id for a given NgModule, if one is defined and known to the compiler.
   */
  getModuleId(moduleType) {
    return void 0;
  }
};
_Compiler.\u0275fac = function Compiler_Factory(t) {
  return new (t || _Compiler)();
};
_Compiler.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _Compiler, factory: _Compiler.\u0275fac, providedIn: "root" });
var Compiler = _Compiler;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], null, null);
})();
var COMPILER_OPTIONS = new InjectionToken(ngDevMode ? "compilerOptions" : "");
function compileNgModuleFactory(injector, options, moduleType) {
  ngDevMode && assertNgModuleType(moduleType);
  const moduleFactory = new NgModuleFactory(moduleType);
  if (true) {
    return Promise.resolve(moduleFactory);
  }
  const compilerOptions = injector.get(COMPILER_OPTIONS, []).concat(options);
  setJitOptions({
    defaultEncapsulation: _lastDefined(compilerOptions.map((opts) => opts.defaultEncapsulation)),
    preserveWhitespaces: _lastDefined(compilerOptions.map((opts) => opts.preserveWhitespaces))
  });
  if (isComponentResourceResolutionQueueEmpty()) {
    return Promise.resolve(moduleFactory);
  }
  const compilerProviders = compilerOptions.flatMap((option) => option.providers ?? []);
  if (compilerProviders.length === 0) {
    return Promise.resolve(moduleFactory);
  }
  const compiler = getCompilerFacade({
    usage: 0,
    kind: "NgModule",
    type: moduleType
  });
  const compilerInjector = Injector.create({ providers: compilerProviders });
  const resourceLoader = compilerInjector.get(compiler.ResourceLoader);
  return resolveComponentResources((url) => Promise.resolve(resourceLoader.get(url))).then(() => moduleFactory);
}
function _lastDefined(args) {
  for (let i2 = args.length - 1; i2 >= 0; i2--) {
    if (args[i2] !== void 0) {
      return args[i2];
    }
  }
  return void 0;
}
var alwaysProvideZonelessScheduler = true;
var CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT = 100;
var consecutiveMicrotaskNotifications = 0;
var stackFromLastFewNotifications = [];
function trackMicrotaskNotificationForDebugging() {
  consecutiveMicrotaskNotifications++;
  if (CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT - consecutiveMicrotaskNotifications < 5) {
    const stack = new Error().stack;
    if (stack) {
      stackFromLastFewNotifications.push(stack);
    }
  }
  if (consecutiveMicrotaskNotifications === CONSECUTIVE_MICROTASK_NOTIFICATION_LIMIT) {
    throw new RuntimeError(103, "Angular could not stabilize because there were endless change notifications within the browser event loop. The stack from the last several notifications: \n" + stackFromLastFewNotifications.join("\n"));
  }
}
var _ChangeDetectionSchedulerImpl = class _ChangeDetectionSchedulerImpl {
  constructor() {
    this.appRef = inject(ApplicationRef);
    this.taskService = inject(PendingTasks);
    this.ngZone = inject(NgZone);
    this.zonelessEnabled = inject(ZONELESS_ENABLED);
    this.disableScheduling = inject(ZONELESS_SCHEDULER_DISABLED, { optional: true }) ?? false;
    this.zoneIsDefined = typeof Zone !== "undefined" && !!Zone.root.run;
    this.schedulerTickApplyArgs = [{ data: { "__scheduler_tick__": true } }];
    this.subscriptions = new Subscription();
    this.cancelScheduledCallback = null;
    this.shouldRefreshViews = false;
    this.useMicrotaskScheduler = false;
    this.runningTick = false;
    this.pendingRenderTaskId = null;
    this.subscriptions.add(this.appRef.afterTick.subscribe(() => {
      if (!this.runningTick) {
        this.cleanup();
      }
    }));
    this.subscriptions.add(this.ngZone.onUnstable.subscribe(() => {
      if (!this.runningTick) {
        this.cleanup();
      }
    }));
    this.disableScheduling ||= !this.zonelessEnabled && // NoopNgZone without enabling zoneless means no scheduling whatsoever
    (this.ngZone instanceof NoopNgZone || // The same goes for the lack of Zone without enabling zoneless scheduling
    !this.zoneIsDefined);
  }
  notify(source) {
    if (!this.zonelessEnabled && source === 5) {
      return;
    }
    switch (source) {
      case 3:
      case 2:
      case 0:
      case 4:
      case 5:
      case 1: {
        this.shouldRefreshViews = true;
        break;
      }
      case 8:
      case 7:
      case 6:
      case 9:
      default: {
      }
    }
    if (!this.shouldScheduleTick()) {
      return;
    }
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (this.useMicrotaskScheduler) {
        trackMicrotaskNotificationForDebugging();
      } else {
        consecutiveMicrotaskNotifications = 0;
        stackFromLastFewNotifications.length = 0;
      }
    }
    const scheduleCallback = this.useMicrotaskScheduler ? scheduleCallbackWithMicrotask : scheduleCallbackWithRafRace;
    this.pendingRenderTaskId = this.taskService.add();
    if (this.zoneIsDefined) {
      Zone.root.run(() => {
        this.cancelScheduledCallback = scheduleCallback(() => {
          this.tick(this.shouldRefreshViews);
        });
      });
    } else {
      this.cancelScheduledCallback = scheduleCallback(() => {
        this.tick(this.shouldRefreshViews);
      });
    }
  }
  shouldScheduleTick() {
    if (this.disableScheduling) {
      return false;
    }
    if (this.pendingRenderTaskId !== null || this.runningTick || this.appRef._runningTick) {
      return false;
    }
    if (!this.zonelessEnabled && this.zoneIsDefined && NgZone.isInAngularZone()) {
      return false;
    }
    return true;
  }
  /**
   * Calls ApplicationRef._tick inside the `NgZone`.
   *
   * Calling `tick` directly runs change detection and cancels any change detection that had been
   * scheduled previously.
   *
   * @param shouldRefreshViews Passed directly to `ApplicationRef._tick` and skips straight to
   *     render hooks when `false`.
   */
  tick(shouldRefreshViews) {
    if (this.runningTick || this.appRef.destroyed) {
      return;
    }
    const task = this.taskService.add();
    try {
      this.ngZone.run(() => {
        this.runningTick = true;
        this.appRef._tick(shouldRefreshViews);
      }, void 0, this.schedulerTickApplyArgs);
    } catch (e) {
      this.taskService.remove(task);
      throw e;
    } finally {
      this.cleanup();
    }
    this.useMicrotaskScheduler = true;
    scheduleCallbackWithMicrotask(() => {
      this.useMicrotaskScheduler = false;
      this.taskService.remove(task);
    });
  }
  ngOnDestroy() {
    this.subscriptions.unsubscribe();
    this.cleanup();
  }
  cleanup() {
    this.shouldRefreshViews = false;
    this.runningTick = false;
    this.cancelScheduledCallback?.();
    this.cancelScheduledCallback = null;
    if (this.pendingRenderTaskId !== null) {
      const taskId = this.pendingRenderTaskId;
      this.pendingRenderTaskId = null;
      this.taskService.remove(taskId);
    }
  }
};
_ChangeDetectionSchedulerImpl.\u0275fac = function ChangeDetectionSchedulerImpl_Factory(t) {
  return new (t || _ChangeDetectionSchedulerImpl)();
};
_ChangeDetectionSchedulerImpl.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ChangeDetectionSchedulerImpl, factory: _ChangeDetectionSchedulerImpl.\u0275fac, providedIn: "root" });
var ChangeDetectionSchedulerImpl = _ChangeDetectionSchedulerImpl;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChangeDetectionSchedulerImpl, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], () => [], null);
})();
var _NgZoneChangeDetectionScheduler = class _NgZoneChangeDetectionScheduler {
  constructor() {
    this.zone = inject(NgZone);
    this.changeDetectionScheduler = inject(ChangeDetectionScheduler, { optional: true });
    this.applicationRef = inject(ApplicationRef);
    this.zonelessEnabled = inject(ZONELESS_ENABLED);
  }
  initialize() {
    if (this._onMicrotaskEmptySubscription) {
      return;
    }
    this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
      next: () => {
        if (this.changeDetectionScheduler?.runningTick) {
          return;
        }
        this.zone.run(() => {
          this.applicationRef.tick();
        });
      }
    });
  }
  ngOnDestroy() {
    this._onMicrotaskEmptySubscription?.unsubscribe();
  }
};
_NgZoneChangeDetectionScheduler.\u0275fac = function NgZoneChangeDetectionScheduler_Factory(t) {
  return new (t || _NgZoneChangeDetectionScheduler)();
};
_NgZoneChangeDetectionScheduler.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _NgZoneChangeDetectionScheduler, factory: _NgZoneChangeDetectionScheduler.\u0275fac, providedIn: "root" });
var NgZoneChangeDetectionScheduler = _NgZoneChangeDetectionScheduler;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], null, null);
})();
var PROVIDED_NG_ZONE = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "provideZoneChangeDetection token" : "");
function internalProvideZoneChangeDetection({ ngZoneFactory, ignoreChangesOutsideZone }) {
  ngZoneFactory ??= () => new NgZone(getNgZoneOptions());
  return [
    { provide: NgZone, useFactory: ngZoneFactory },
    {
      provide: ENVIRONMENT_INITIALIZER,
      multi: true,
      useFactory: () => {
        const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, {
          optional: true
        });
        if ((typeof ngDevMode === "undefined" || ngDevMode) && ngZoneChangeDetectionScheduler === null) {
          throw new RuntimeError(402, `A required Injectable was not found in the dependency injection tree. If you are bootstrapping an NgModule, make sure that the \`BrowserModule\` is imported.`);
        }
        return () => ngZoneChangeDetectionScheduler.initialize();
      }
    },
    {
      provide: ENVIRONMENT_INITIALIZER,
      multi: true,
      useFactory: () => {
        const service = inject(ZoneStablePendingTask);
        return () => {
          service.initialize();
        };
      }
    },
    { provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
    // Always disable scheduler whenever explicitly disabled, even if another place called
    // `provideZoneChangeDetection` without the 'ignore' option.
    ignoreChangesOutsideZone === true ? { provide: ZONELESS_SCHEDULER_DISABLED, useValue: true } : [],
    // TODO(atscott): This should move to the same places that zone change detection is provided by
    // default instead of being in the zone scheduling providers.
    alwaysProvideZonelessScheduler || ignoreChangesOutsideZone === false ? { provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl } : []
  ];
}
function ngZoneApplicationErrorHandlerFactory() {
  const zone = inject(NgZone);
  const userErrorHandler = inject(ErrorHandler);
  return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
}
function getNgZoneOptions(options) {
  return {
    enableLongStackTrace: typeof ngDevMode === "undefined" ? false : !!ngDevMode,
    shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
    shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false
  };
}
var _ZoneStablePendingTask = class _ZoneStablePendingTask {
  constructor() {
    this.subscription = new Subscription();
    this.initialized = false;
    this.zone = inject(NgZone);
    this.pendingTasks = inject(PendingTasks);
  }
  initialize() {
    if (this.initialized) {
      return;
    }
    this.initialized = true;
    let task = null;
    if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
      task = this.pendingTasks.add();
    }
    this.zone.runOutsideAngular(() => {
      this.subscription.add(this.zone.onStable.subscribe(() => {
        NgZone.assertNotInAngularZone();
        queueMicrotask(() => {
          if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
            this.pendingTasks.remove(task);
            task = null;
          }
        });
      }));
    });
    this.subscription.add(this.zone.onUnstable.subscribe(() => {
      NgZone.assertInAngularZone();
      task ??= this.pendingTasks.add();
    }));
  }
  ngOnDestroy() {
    this.subscription.unsubscribe();
  }
};
_ZoneStablePendingTask.\u0275fac = function ZoneStablePendingTask_Factory(t) {
  return new (t || _ZoneStablePendingTask)();
};
_ZoneStablePendingTask.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ZoneStablePendingTask, factory: _ZoneStablePendingTask.\u0275fac, providedIn: "root" });
var ZoneStablePendingTask = _ZoneStablePendingTask;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], null, null);
})();
function getGlobalLocale() {
  if (false) {
    return goog.LOCALE;
  } else {
    return typeof $localize !== "undefined" && $localize.locale || DEFAULT_LOCALE_ID;
  }
}
var LOCALE_ID = new InjectionToken(ngDevMode ? "LocaleId" : "", {
  providedIn: "root",
  factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale()
});
var DEFAULT_CURRENCY_CODE = new InjectionToken(ngDevMode ? "DefaultCurrencyCode" : "", {
  providedIn: "root",
  factory: () => USD_CURRENCY_CODE
});
var TRANSLATIONS = new InjectionToken(ngDevMode ? "Translations" : "");
var TRANSLATIONS_FORMAT = new InjectionToken(ngDevMode ? "TranslationsFormat" : "");
var MissingTranslationStrategy;
(function(MissingTranslationStrategy2) {
  MissingTranslationStrategy2[MissingTranslationStrategy2["Error"] = 0] = "Error";
  MissingTranslationStrategy2[MissingTranslationStrategy2["Warning"] = 1] = "Warning";
  MissingTranslationStrategy2[MissingTranslationStrategy2["Ignore"] = 2] = "Ignore";
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
var PLATFORM_DESTROY_LISTENERS = new InjectionToken(ngDevMode ? "PlatformDestroyListeners" : "");
var _PlatformRef = class _PlatformRef {
  /** @internal */
  constructor(_injector) {
    this._injector = _injector;
    this._modules = [];
    this._destroyListeners = [];
    this._destroyed = false;
  }
  /**
   * Creates an instance of an `@NgModule` for the given platform.
   *
   * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
   *     argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
   */
  bootstrapModuleFactory(moduleFactory, options) {
    const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
      eventCoalescing: options?.ngZoneEventCoalescing,
      runCoalescing: options?.ngZoneRunCoalescing
    }));
    return ngZone.run(() => {
      const ignoreChangesOutsideZone = options?.ignoreChangesOutsideZone;
      const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection({ ngZoneFactory: () => ngZone, ignoreChangesOutsideZone }));
      if ((typeof ngDevMode === "undefined" || ngDevMode) && moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
        throw new RuntimeError(207, "`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.");
      }
      if ((typeof ngDevMode === "undefined" || ngDevMode) && moduleRef.injector.get(ZONELESS_ENABLED, null) && options?.ngZone !== "noop") {
        throw new RuntimeError(408, "Invalid change detection configuration: `ngZone: 'noop'` must be set in `BootstrapOptions` with provideExperimentalZonelessChangeDetection.");
      }
      const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
      if ((typeof ngDevMode === "undefined" || ngDevMode) && exceptionHandler === null) {
        throw new RuntimeError(402, "No ErrorHandler. Is platform module (BrowserModule) included?");
      }
      ngZone.runOutsideAngular(() => {
        const subscription = ngZone.onError.subscribe({
          next: (error3) => {
            exceptionHandler.handleError(error3);
          }
        });
        moduleRef.onDestroy(() => {
          remove(this._modules, moduleRef);
          subscription.unsubscribe();
        });
      });
      return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
        const initStatus = moduleRef.injector.get(ApplicationInitStatus);
        initStatus.runInitializers();
        return initStatus.donePromise.then(() => {
          const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
          setLocaleId(localeId || DEFAULT_LOCALE_ID);
          this._moduleDoBootstrap(moduleRef);
          return moduleRef;
        });
      });
    });
  }
  /**
   * Creates an instance of an `@NgModule` for a given platform.
   *
   * @usageNotes
   * ### Simple Example
   *
   * ```typescript
   * @NgModule({
   *   imports: [BrowserModule]
   * })
   * class MyModule {}
   *
   * let moduleRef = platformBrowser().bootstrapModule(MyModule);
   * ```
   *
   */
  bootstrapModule(moduleType, compilerOptions = []) {
    const options = optionsReducer({}, compilerOptions);
    return compileNgModuleFactory(this.injector, options, moduleType).then((moduleFactory) => this.bootstrapModuleFactory(moduleFactory, options));
  }
  _moduleDoBootstrap(moduleRef) {
    const appRef = moduleRef.injector.get(ApplicationRef);
    if (moduleRef._bootstrapComponents.length > 0) {
      moduleRef._bootstrapComponents.forEach((f) => appRef.bootstrap(f));
    } else if (moduleRef.instance.ngDoBootstrap) {
      moduleRef.instance.ngDoBootstrap(appRef);
    } else {
      throw new RuntimeError(-403, ngDevMode && `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);
    }
    this._modules.push(moduleRef);
  }
  /**
   * Registers a listener to be called when the platform is destroyed.
   */
  onDestroy(callback) {
    this._destroyListeners.push(callback);
  }
  /**
   * Retrieves the platform {@link Injector}, which is the parent injector for
   * every Angular application on the page and provides singleton providers.
   */
  get injector() {
    return this._injector;
  }
  /**
   * Destroys the current Angular platform and all Angular applications on the page.
   * Destroys all modules and listeners registered with the platform.
   */
  destroy() {
    if (this._destroyed) {
      throw new RuntimeError(404, ngDevMode && "The platform has already been destroyed!");
    }
    this._modules.slice().forEach((module2) => module2.destroy());
    this._destroyListeners.forEach((listener) => listener());
    const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
    if (destroyListeners) {
      destroyListeners.forEach((listener) => listener());
      destroyListeners.clear();
    }
    this._destroyed = true;
  }
  /**
   * Indicates whether this instance was destroyed.
   */
  get destroyed() {
    return this._destroyed;
  }
};
_PlatformRef.\u0275fac = function PlatformRef_Factory(t) {
  return new (t || _PlatformRef)(\u0275\u0275inject(Injector));
};
_PlatformRef.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _PlatformRef, factory: _PlatformRef.\u0275fac, providedIn: "platform" });
var PlatformRef = _PlatformRef;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
    type: Injectable,
    args: [{ providedIn: "platform" }]
  }], () => [{ type: Injector }], null);
})();
var _platformInjector = null;
var ALLOW_MULTIPLE_PLATFORMS = new InjectionToken(ngDevMode ? "AllowMultipleToken" : "");
function createPlatform(injector) {
  if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
    throw new RuntimeError(400, ngDevMode && "There can be only one platform. Destroy the previous one to create a new one.");
  }
  publishDefaultGlobalUtils();
  publishSignalConfiguration();
  _platformInjector = injector;
  const platform = injector.get(PlatformRef);
  runPlatformInitializers(injector);
  return platform;
}
function createPlatformFactory(parentPlatformFactory, name, providers = []) {
  const desc = `Platform: ${name}`;
  const marker = new InjectionToken(desc);
  return (extraProviders = []) => {
    let platform = getPlatform();
    if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
      const platformProviders = [
        ...providers,
        ...extraProviders,
        { provide: marker, useValue: true }
      ];
      if (parentPlatformFactory) {
        parentPlatformFactory(platformProviders);
      } else {
        createPlatform(createPlatformInjector(platformProviders, desc));
      }
    }
    return assertPlatform(marker);
  };
}
function createPlatformInjector(providers = [], name) {
  return Injector.create({
    name,
    providers: [
      { provide: INJECTOR_SCOPE, useValue: "platform" },
      { provide: PLATFORM_DESTROY_LISTENERS, useValue: /* @__PURE__ */ new Set([() => _platformInjector = null]) },
      ...providers
    ]
  });
}
function assertPlatform(requiredToken) {
  const platform = getPlatform();
  if (!platform) {
    throw new RuntimeError(401, ngDevMode && "No platform exists!");
  }
  if ((typeof ngDevMode === "undefined" || ngDevMode) && !platform.injector.get(requiredToken, null)) {
    throw new RuntimeError(400, "A platform with a different configuration has been created. Please destroy it first.");
  }
  return platform;
}
function getPlatform() {
  return _platformInjector?.get(PlatformRef) ?? null;
}
function runPlatformInitializers(injector) {
  const inits = injector.get(PLATFORM_INITIALIZER, null);
  inits?.forEach((init31) => init31());
}
function enableProdMode() {
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    _global["ngDevMode"] = false;
  }
}
var _ChangeDetectorRef = class _ChangeDetectorRef {
};
_ChangeDetectorRef.__NG_ELEMENT_ID__ = injectChangeDetectorRef;
var ChangeDetectorRef = _ChangeDetectorRef;
function injectChangeDetectorRef(flags) {
  return createViewRef(
    getCurrentTNode(),
    getLView(),
    (flags & 16) === 16
    /* InternalInjectFlags.ForPipe */
  );
}
function createViewRef(tNode, lView, isPipe2) {
  if (isComponentHost(tNode) && !isPipe2) {
    const componentView = getComponentLViewByIndex(tNode.index, lView);
    return new ViewRef$1(componentView, componentView);
  } else if (tNode.type & (3 | 12 | 32)) {
    const hostComponentView = lView[DECLARATION_COMPONENT_VIEW];
    return new ViewRef$1(hostComponentView, lView);
  }
  return null;
}
var DefaultIterableDifferFactory = class {
  constructor() {
  }
  supports(obj) {
    return isListLikeIterable(obj);
  }
  create(trackByFn) {
    return new DefaultIterableDiffer(trackByFn);
  }
};
var trackByIdentity = (index, item) => item;
var DefaultIterableDiffer = class {
  constructor(trackByFn) {
    this.length = 0;
    this._linkedRecords = null;
    this._unlinkedRecords = null;
    this._previousItHead = null;
    this._itHead = null;
    this._itTail = null;
    this._additionsHead = null;
    this._additionsTail = null;
    this._movesHead = null;
    this._movesTail = null;
    this._removalsHead = null;
    this._removalsTail = null;
    this._identityChangesHead = null;
    this._identityChangesTail = null;
    this._trackByFn = trackByFn || trackByIdentity;
  }
  forEachItem(fn) {
    let record;
    for (record = this._itHead; record !== null; record = record._next) {
      fn(record);
    }
  }
  forEachOperation(fn) {
    let nextIt = this._itHead;
    let nextRemove = this._removalsHead;
    let addRemoveOffset = 0;
    let moveOffsets = null;
    while (nextIt || nextRemove) {
      const record = !nextRemove || nextIt && nextIt.currentIndex < getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? nextIt : nextRemove;
      const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);
      const currentIndex = record.currentIndex;
      if (record === nextRemove) {
        addRemoveOffset--;
        nextRemove = nextRemove._nextRemoved;
      } else {
        nextIt = nextIt._next;
        if (record.previousIndex == null) {
          addRemoveOffset++;
        } else {
          if (!moveOffsets)
            moveOffsets = [];
          const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;
          const localCurrentIndex = currentIndex - addRemoveOffset;
          if (localMovePreviousIndex != localCurrentIndex) {
            for (let i2 = 0; i2 < localMovePreviousIndex; i2++) {
              const offset2 = i2 < moveOffsets.length ? moveOffsets[i2] : moveOffsets[i2] = 0;
              const index = offset2 + i2;
              if (localCurrentIndex <= index && index < localMovePreviousIndex) {
                moveOffsets[i2] = offset2 + 1;
              }
            }
            const previousIndex = record.previousIndex;
            moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;
          }
        }
      }
      if (adjPreviousIndex !== currentIndex) {
        fn(record, adjPreviousIndex, currentIndex);
      }
    }
  }
  forEachPreviousItem(fn) {
    let record;
    for (record = this._previousItHead; record !== null; record = record._nextPrevious) {
      fn(record);
    }
  }
  forEachAddedItem(fn) {
    let record;
    for (record = this._additionsHead; record !== null; record = record._nextAdded) {
      fn(record);
    }
  }
  forEachMovedItem(fn) {
    let record;
    for (record = this._movesHead; record !== null; record = record._nextMoved) {
      fn(record);
    }
  }
  forEachRemovedItem(fn) {
    let record;
    for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
      fn(record);
    }
  }
  forEachIdentityChange(fn) {
    let record;
    for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {
      fn(record);
    }
  }
  diff(collection) {
    if (collection == null)
      collection = [];
    if (!isListLikeIterable(collection)) {
      throw new RuntimeError(900, ngDevMode && `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
    }
    if (this.check(collection)) {
      return this;
    } else {
      return null;
    }
  }
  onDestroy() {
  }
  check(collection) {
    this._reset();
    let record = this._itHead;
    let mayBeDirty = false;
    let index;
    let item;
    let itemTrackBy;
    if (Array.isArray(collection)) {
      this.length = collection.length;
      for (let index2 = 0; index2 < this.length; index2++) {
        item = collection[index2];
        itemTrackBy = this._trackByFn(index2, item);
        if (record === null || !Object.is(record.trackById, itemTrackBy)) {
          record = this._mismatch(record, item, itemTrackBy, index2);
          mayBeDirty = true;
        } else {
          if (mayBeDirty) {
            record = this._verifyReinsertion(record, item, itemTrackBy, index2);
          }
          if (!Object.is(record.item, item))
            this._addIdentityChange(record, item);
        }
        record = record._next;
      }
    } else {
      index = 0;
      iterateListLike(collection, (item2) => {
        itemTrackBy = this._trackByFn(index, item2);
        if (record === null || !Object.is(record.trackById, itemTrackBy)) {
          record = this._mismatch(record, item2, itemTrackBy, index);
          mayBeDirty = true;
        } else {
          if (mayBeDirty) {
            record = this._verifyReinsertion(record, item2, itemTrackBy, index);
          }
          if (!Object.is(record.item, item2))
            this._addIdentityChange(record, item2);
        }
        record = record._next;
        index++;
      });
      this.length = index;
    }
    this._truncate(record);
    this.collection = collection;
    return this.isDirty;
  }
  /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity
   * changes.
   */
  get isDirty() {
    return this._additionsHead !== null || this._movesHead !== null || this._removalsHead !== null || this._identityChangesHead !== null;
  }
  /**
   * Reset the state of the change objects to show no changes. This means set previousKey to
   * currentKey, and clear all of the queues (additions, moves, removals).
   * Set the previousIndexes of moved and added items to their currentIndexes
   * Reset the list of additions, moves and removals
   *
   * @internal
   */
  _reset() {
    if (this.isDirty) {
      let record;
      for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
        record._nextPrevious = record._next;
      }
      for (record = this._additionsHead; record !== null; record = record._nextAdded) {
        record.previousIndex = record.currentIndex;
      }
      this._additionsHead = this._additionsTail = null;
      for (record = this._movesHead; record !== null; record = record._nextMoved) {
        record.previousIndex = record.currentIndex;
      }
      this._movesHead = this._movesTail = null;
      this._removalsHead = this._removalsTail = null;
      this._identityChangesHead = this._identityChangesTail = null;
    }
  }
  /**
   * This is the core function which handles differences between collections.
   *
   * - `record` is the record which we saw at this position last time. If null then it is a new
   *   item.
   * - `item` is the current item in the collection
   * - `index` is the position of the item in the collection
   *
   * @internal
   */
  _mismatch(record, item, itemTrackBy, index) {
    let previousRecord;
    if (record === null) {
      previousRecord = this._itTail;
    } else {
      previousRecord = record._prev;
      this._remove(record);
    }
    record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
    if (record !== null) {
      if (!Object.is(record.item, item))
        this._addIdentityChange(record, item);
      this._reinsertAfter(record, previousRecord, index);
    } else {
      record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);
      if (record !== null) {
        if (!Object.is(record.item, item))
          this._addIdentityChange(record, item);
        this._moveAfter(record, previousRecord, index);
      } else {
        record = this._addAfter(new IterableChangeRecord_(item, itemTrackBy), previousRecord, index);
      }
    }
    return record;
  }
  /**
   * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)
   *
   * Use case: `[a, a]` => `[b, a, a]`
   *
   * If we did not have this check then the insertion of `b` would:
   *   1) evict first `a`
   *   2) insert `b` at `0` index.
   *   3) leave `a` at index `1` as is. <-- this is wrong!
   *   3) reinsert `a` at index 2. <-- this is wrong!
   *
   * The correct behavior is:
   *   1) evict first `a`
   *   2) insert `b` at `0` index.
   *   3) reinsert `a` at index 1.
   *   3) move `a` at from `1` to `2`.
   *
   *
   * Double check that we have not evicted a duplicate item. We need to check if the item type may
   * have already been removed:
   * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted
   * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a
   * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'
   * at the end.
   *
   * @internal
   */
  _verifyReinsertion(record, item, itemTrackBy, index) {
    let reinsertRecord = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);
    if (reinsertRecord !== null) {
      record = this._reinsertAfter(reinsertRecord, record._prev, index);
    } else if (record.currentIndex != index) {
      record.currentIndex = index;
      this._addToMoves(record, index);
    }
    return record;
  }
  /**
   * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection
   *
   * - `record` The first excess {@link IterableChangeRecord_}.
   *
   * @internal
   */
  _truncate(record) {
    while (record !== null) {
      const nextRecord = record._next;
      this._addToRemovals(this._unlink(record));
      record = nextRecord;
    }
    if (this._unlinkedRecords !== null) {
      this._unlinkedRecords.clear();
    }
    if (this._additionsTail !== null) {
      this._additionsTail._nextAdded = null;
    }
    if (this._movesTail !== null) {
      this._movesTail._nextMoved = null;
    }
    if (this._itTail !== null) {
      this._itTail._next = null;
    }
    if (this._removalsTail !== null) {
      this._removalsTail._nextRemoved = null;
    }
    if (this._identityChangesTail !== null) {
      this._identityChangesTail._nextIdentityChange = null;
    }
  }
  /** @internal */
  _reinsertAfter(record, prevRecord, index) {
    if (this._unlinkedRecords !== null) {
      this._unlinkedRecords.remove(record);
    }
    const prev = record._prevRemoved;
    const next = record._nextRemoved;
    if (prev === null) {
      this._removalsHead = next;
    } else {
      prev._nextRemoved = next;
    }
    if (next === null) {
      this._removalsTail = prev;
    } else {
      next._prevRemoved = prev;
    }
    this._insertAfter(record, prevRecord, index);
    this._addToMoves(record, index);
    return record;
  }
  /** @internal */
  _moveAfter(record, prevRecord, index) {
    this._unlink(record);
    this._insertAfter(record, prevRecord, index);
    this._addToMoves(record, index);
    return record;
  }
  /** @internal */
  _addAfter(record, prevRecord, index) {
    this._insertAfter(record, prevRecord, index);
    if (this._additionsTail === null) {
      this._additionsTail = this._additionsHead = record;
    } else {
      this._additionsTail = this._additionsTail._nextAdded = record;
    }
    return record;
  }
  /** @internal */
  _insertAfter(record, prevRecord, index) {
    const next = prevRecord === null ? this._itHead : prevRecord._next;
    record._next = next;
    record._prev = prevRecord;
    if (next === null) {
      this._itTail = record;
    } else {
      next._prev = record;
    }
    if (prevRecord === null) {
      this._itHead = record;
    } else {
      prevRecord._next = record;
    }
    if (this._linkedRecords === null) {
      this._linkedRecords = new _DuplicateMap();
    }
    this._linkedRecords.put(record);
    record.currentIndex = index;
    return record;
  }
  /** @internal */
  _remove(record) {
    return this._addToRemovals(this._unlink(record));
  }
  /** @internal */
  _unlink(record) {
    if (this._linkedRecords !== null) {
      this._linkedRecords.remove(record);
    }
    const prev = record._prev;
    const next = record._next;
    if (prev === null) {
      this._itHead = next;
    } else {
      prev._next = next;
    }
    if (next === null) {
      this._itTail = prev;
    } else {
      next._prev = prev;
    }
    return record;
  }
  /** @internal */
  _addToMoves(record, toIndex) {
    if (record.previousIndex === toIndex) {
      return record;
    }
    if (this._movesTail === null) {
      this._movesTail = this._movesHead = record;
    } else {
      this._movesTail = this._movesTail._nextMoved = record;
    }
    return record;
  }
  _addToRemovals(record) {
    if (this._unlinkedRecords === null) {
      this._unlinkedRecords = new _DuplicateMap();
    }
    this._unlinkedRecords.put(record);
    record.currentIndex = null;
    record._nextRemoved = null;
    if (this._removalsTail === null) {
      this._removalsTail = this._removalsHead = record;
      record._prevRemoved = null;
    } else {
      record._prevRemoved = this._removalsTail;
      this._removalsTail = this._removalsTail._nextRemoved = record;
    }
    return record;
  }
  /** @internal */
  _addIdentityChange(record, item) {
    record.item = item;
    if (this._identityChangesTail === null) {
      this._identityChangesTail = this._identityChangesHead = record;
    } else {
      this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;
    }
    return record;
  }
};
var IterableChangeRecord_ = class {
  constructor(item, trackById) {
    this.item = item;
    this.trackById = trackById;
    this.currentIndex = null;
    this.previousIndex = null;
    this._nextPrevious = null;
    this._prev = null;
    this._next = null;
    this._prevDup = null;
    this._nextDup = null;
    this._prevRemoved = null;
    this._nextRemoved = null;
    this._nextAdded = null;
    this._nextMoved = null;
    this._nextIdentityChange = null;
  }
};
var _DuplicateItemRecordList = class {
  constructor() {
    this._head = null;
    this._tail = null;
  }
  /**
   * Append the record to the list of duplicates.
   *
   * Note: by design all records in the list of duplicates hold the same value in record.item.
   */
  add(record) {
    if (this._head === null) {
      this._head = this._tail = record;
      record._nextDup = null;
      record._prevDup = null;
    } else {
      this._tail._nextDup = record;
      record._prevDup = this._tail;
      record._nextDup = null;
      this._tail = record;
    }
  }
  // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and
  // IterableChangeRecord_.currentIndex >= atOrAfterIndex
  get(trackById, atOrAfterIndex) {
    let record;
    for (record = this._head; record !== null; record = record._nextDup) {
      if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex) && Object.is(record.trackById, trackById)) {
        return record;
      }
    }
    return null;
  }
  /**
   * Remove one {@link IterableChangeRecord_} from the list of duplicates.
   *
   * Returns whether the list of duplicates is empty.
   */
  remove(record) {
    const prev = record._prevDup;
    const next = record._nextDup;
    if (prev === null) {
      this._head = next;
    } else {
      prev._nextDup = next;
    }
    if (next === null) {
      this._tail = prev;
    } else {
      next._prevDup = prev;
    }
    return this._head === null;
  }
};
var _DuplicateMap = class {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  put(record) {
    const key = record.trackById;
    let duplicates = this.map.get(key);
    if (!duplicates) {
      duplicates = new _DuplicateItemRecordList();
      this.map.set(key, duplicates);
    }
    duplicates.add(record);
  }
  /**
   * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we
   * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.
   *
   * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we
   * have any more `a`s needs to return the second `a`.
   */
  get(trackById, atOrAfterIndex) {
    const key = trackById;
    const recordList = this.map.get(key);
    return recordList ? recordList.get(trackById, atOrAfterIndex) : null;
  }
  /**
   * Removes a {@link IterableChangeRecord_} from the list of duplicates.
   *
   * The list of duplicates also is removed from the map if it gets empty.
   */
  remove(record) {
    const key = record.trackById;
    const recordList = this.map.get(key);
    if (recordList.remove(record)) {
      this.map.delete(key);
    }
    return record;
  }
  get isEmpty() {
    return this.map.size === 0;
  }
  clear() {
    this.map.clear();
  }
};
function getPreviousIndex(item, addRemoveOffset, moveOffsets) {
  const previousIndex = item.previousIndex;
  if (previousIndex === null)
    return previousIndex;
  let moveOffset = 0;
  if (moveOffsets && previousIndex < moveOffsets.length) {
    moveOffset = moveOffsets[previousIndex];
  }
  return previousIndex + addRemoveOffset + moveOffset;
}
var DefaultKeyValueDifferFactory = class {
  constructor() {
  }
  supports(obj) {
    return obj instanceof Map || isJsObject(obj);
  }
  create() {
    return new DefaultKeyValueDiffer();
  }
};
var DefaultKeyValueDiffer = class {
  constructor() {
    this._records = /* @__PURE__ */ new Map();
    this._mapHead = null;
    this._appendAfter = null;
    this._previousMapHead = null;
    this._changesHead = null;
    this._changesTail = null;
    this._additionsHead = null;
    this._additionsTail = null;
    this._removalsHead = null;
    this._removalsTail = null;
  }
  get isDirty() {
    return this._additionsHead !== null || this._changesHead !== null || this._removalsHead !== null;
  }
  forEachItem(fn) {
    let record;
    for (record = this._mapHead; record !== null; record = record._next) {
      fn(record);
    }
  }
  forEachPreviousItem(fn) {
    let record;
    for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {
      fn(record);
    }
  }
  forEachChangedItem(fn) {
    let record;
    for (record = this._changesHead; record !== null; record = record._nextChanged) {
      fn(record);
    }
  }
  forEachAddedItem(fn) {
    let record;
    for (record = this._additionsHead; record !== null; record = record._nextAdded) {
      fn(record);
    }
  }
  forEachRemovedItem(fn) {
    let record;
    for (record = this._removalsHead; record !== null; record = record._nextRemoved) {
      fn(record);
    }
  }
  diff(map2) {
    if (!map2) {
      map2 = /* @__PURE__ */ new Map();
    } else if (!(map2 instanceof Map || isJsObject(map2))) {
      throw new RuntimeError(900, ngDevMode && `Error trying to diff '${stringify(map2)}'. Only maps and objects are allowed`);
    }
    return this.check(map2) ? this : null;
  }
  onDestroy() {
  }
  /**
   * Check the current state of the map vs the previous.
   * The algorithm is optimised for when the keys do no change.
   */
  check(map2) {
    this._reset();
    let insertBefore = this._mapHead;
    this._appendAfter = null;
    this._forEach(map2, (value, key) => {
      if (insertBefore && insertBefore.key === key) {
        this._maybeAddToChanges(insertBefore, value);
        this._appendAfter = insertBefore;
        insertBefore = insertBefore._next;
      } else {
        const record = this._getOrCreateRecordForKey(key, value);
        insertBefore = this._insertBeforeOrAppend(insertBefore, record);
      }
    });
    if (insertBefore) {
      if (insertBefore._prev) {
        insertBefore._prev._next = null;
      }
      this._removalsHead = insertBefore;
      for (let record = insertBefore; record !== null; record = record._nextRemoved) {
        if (record === this._mapHead) {
          this._mapHead = null;
        }
        this._records.delete(record.key);
        record._nextRemoved = record._next;
        record.previousValue = record.currentValue;
        record.currentValue = null;
        record._prev = null;
        record._next = null;
      }
    }
    if (this._changesTail)
      this._changesTail._nextChanged = null;
    if (this._additionsTail)
      this._additionsTail._nextAdded = null;
    return this.isDirty;
  }
  /**
   * Inserts a record before `before` or append at the end of the list when `before` is null.
   *
   * Notes:
   * - This method appends at `this._appendAfter`,
   * - This method updates `this._appendAfter`,
   * - The return value is the new value for the insertion pointer.
   */
  _insertBeforeOrAppend(before, record) {
    if (before) {
      const prev = before._prev;
      record._next = before;
      record._prev = prev;
      before._prev = record;
      if (prev) {
        prev._next = record;
      }
      if (before === this._mapHead) {
        this._mapHead = record;
      }
      this._appendAfter = before;
      return before;
    }
    if (this._appendAfter) {
      this._appendAfter._next = record;
      record._prev = this._appendAfter;
    } else {
      this._mapHead = record;
    }
    this._appendAfter = record;
    return null;
  }
  _getOrCreateRecordForKey(key, value) {
    if (this._records.has(key)) {
      const record2 = this._records.get(key);
      this._maybeAddToChanges(record2, value);
      const prev = record2._prev;
      const next = record2._next;
      if (prev) {
        prev._next = next;
      }
      if (next) {
        next._prev = prev;
      }
      record2._next = null;
      record2._prev = null;
      return record2;
    }
    const record = new KeyValueChangeRecord_(key);
    this._records.set(key, record);
    record.currentValue = value;
    this._addToAdditions(record);
    return record;
  }
  /** @internal */
  _reset() {
    if (this.isDirty) {
      let record;
      this._previousMapHead = this._mapHead;
      for (record = this._previousMapHead; record !== null; record = record._next) {
        record._nextPrevious = record._next;
      }
      for (record = this._changesHead; record !== null; record = record._nextChanged) {
        record.previousValue = record.currentValue;
      }
      for (record = this._additionsHead; record != null; record = record._nextAdded) {
        record.previousValue = record.currentValue;
      }
      this._changesHead = this._changesTail = null;
      this._additionsHead = this._additionsTail = null;
      this._removalsHead = null;
    }
  }
  // Add the record or a given key to the list of changes only when the value has actually changed
  _maybeAddToChanges(record, newValue) {
    if (!Object.is(newValue, record.currentValue)) {
      record.previousValue = record.currentValue;
      record.currentValue = newValue;
      this._addToChanges(record);
    }
  }
  _addToAdditions(record) {
    if (this._additionsHead === null) {
      this._additionsHead = this._additionsTail = record;
    } else {
      this._additionsTail._nextAdded = record;
      this._additionsTail = record;
    }
  }
  _addToChanges(record) {
    if (this._changesHead === null) {
      this._changesHead = this._changesTail = record;
    } else {
      this._changesTail._nextChanged = record;
      this._changesTail = record;
    }
  }
  /** @internal */
  _forEach(obj, fn) {
    if (obj instanceof Map) {
      obj.forEach(fn);
    } else {
      Object.keys(obj).forEach((k) => fn(obj[k], k));
    }
  }
};
var KeyValueChangeRecord_ = class {
  constructor(key) {
    this.key = key;
    this.previousValue = null;
    this.currentValue = null;
    this._nextPrevious = null;
    this._next = null;
    this._prev = null;
    this._nextAdded = null;
    this._nextRemoved = null;
    this._nextChanged = null;
  }
};
function defaultIterableDiffersFactory() {
  return new IterableDiffers([new DefaultIterableDifferFactory()]);
}
var _IterableDiffers = class _IterableDiffers {
  constructor(factories) {
    this.factories = factories;
  }
  static create(factories, parent) {
    if (parent != null) {
      const copied = parent.factories.slice();
      factories = factories.concat(copied);
    }
    return new _IterableDiffers(factories);
  }
  /**
   * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the
   * inherited {@link IterableDiffers} instance with the provided factories and return a new
   * {@link IterableDiffers} instance.
   *
   * @usageNotes
   * ### Example
   *
   * The following example shows how to extend an existing list of factories,
   * which will only be applied to the injector for this component and its children.
   * This step is all that's required to make a new {@link IterableDiffer} available.
   *
   * ```
   * @Component({
   *   viewProviders: [
   *     IterableDiffers.extend([new ImmutableListDiffer()])
   *   ]
   * })
   * ```
   */
  static extend(factories) {
    return {
      provide: _IterableDiffers,
      useFactory: (parent) => {
        return _IterableDiffers.create(factories, parent || defaultIterableDiffersFactory());
      },
      // Dependency technically isn't optional, but we can provide a better error message this way.
      deps: [[_IterableDiffers, new SkipSelf(), new Optional()]]
    };
  }
  find(iterable) {
    const factory2 = this.factories.find((f) => f.supports(iterable));
    if (factory2 != null) {
      return factory2;
    } else {
      throw new RuntimeError(901, ngDevMode && `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
    }
  }
};
_IterableDiffers.\u0275prov = \u0275\u0275defineInjectable({
  token: _IterableDiffers,
  providedIn: "root",
  factory: defaultIterableDiffersFactory
});
var IterableDiffers = _IterableDiffers;
function getTypeNameForDebugging(type) {
  return type["name"] || typeof type;
}
function defaultKeyValueDiffersFactory() {
  return new KeyValueDiffers([new DefaultKeyValueDifferFactory()]);
}
var _KeyValueDiffers = class _KeyValueDiffers {
  constructor(factories) {
    this.factories = factories;
  }
  static create(factories, parent) {
    if (parent) {
      const copied = parent.factories.slice();
      factories = factories.concat(copied);
    }
    return new _KeyValueDiffers(factories);
  }
  /**
   * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the
   * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
   * {@link KeyValueDiffers} instance.
   *
   * @usageNotes
   * ### Example
   *
   * The following example shows how to extend an existing list of factories,
   * which will only be applied to the injector for this component and its children.
   * This step is all that's required to make a new {@link KeyValueDiffer} available.
   *
   * ```
   * @Component({
   *   viewProviders: [
   *     KeyValueDiffers.extend([new ImmutableMapDiffer()])
   *   ]
   * })
   * ```
   */
  static extend(factories) {
    return {
      provide: _KeyValueDiffers,
      useFactory: (parent) => {
        return _KeyValueDiffers.create(factories, parent || defaultKeyValueDiffersFactory());
      },
      // Dependency technically isn't optional, but we can provide a better error message this way.
      deps: [[_KeyValueDiffers, new SkipSelf(), new Optional()]]
    };
  }
  find(kv) {
    const factory2 = this.factories.find((f) => f.supports(kv));
    if (factory2) {
      return factory2;
    }
    throw new RuntimeError(901, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
  }
};
_KeyValueDiffers.\u0275prov = \u0275\u0275defineInjectable({
  token: _KeyValueDiffers,
  providedIn: "root",
  factory: defaultKeyValueDiffersFactory
});
var KeyValueDiffers = _KeyValueDiffers;
var keyValDiff = [new DefaultKeyValueDifferFactory()];
var iterableDiff = [new DefaultIterableDifferFactory()];
var defaultIterableDiffers = new IterableDiffers(iterableDiff);
var defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
var platformCore = createPlatformFactory(null, "core", []);
var _ApplicationModule = class _ApplicationModule {
  // Inject ApplicationRef to make it eager...
  constructor(appRef) {
  }
};
_ApplicationModule.\u0275fac = function ApplicationModule_Factory(t) {
  return new (t || _ApplicationModule)(\u0275\u0275inject(ApplicationRef));
};
_ApplicationModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ApplicationModule });
_ApplicationModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var ApplicationModule = _ApplicationModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationModule, [{
    type: NgModule
  }], () => [{ type: ApplicationRef }], null);
})();
var SCAN_DELAY = 200;
var OVERSIZED_IMAGE_TOLERANCE = 1200;
var _ImagePerformanceWarning = class _ImagePerformanceWarning {
  constructor() {
    this.window = null;
    this.observer = null;
    this.options = inject(IMAGE_CONFIG);
    this.ngZone = inject(NgZone);
  }
  start() {
    if (typeof PerformanceObserver === "undefined" || this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning) {
      return;
    }
    this.observer = this.initPerformanceObserver();
    const doc = getDocument();
    const win = doc.defaultView;
    if (typeof win !== "undefined") {
      this.window = win;
      const waitToScan = () => {
        setTimeout(this.scanImages.bind(this), SCAN_DELAY);
      };
      this.ngZone.runOutsideAngular(() => {
        if (doc.readyState === "complete") {
          waitToScan();
        } else {
          this.window?.addEventListener("load", waitToScan, { once: true });
        }
      });
    }
  }
  ngOnDestroy() {
    this.observer?.disconnect();
  }
  initPerformanceObserver() {
    if (typeof PerformanceObserver === "undefined") {
      return null;
    }
    const observer = new PerformanceObserver((entryList) => {
      const entries = entryList.getEntries();
      if (entries.length === 0)
        return;
      const lcpElement = entries[entries.length - 1];
      const imgSrc = lcpElement.element?.src ?? "";
      if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:"))
        return;
      this.lcpImageUrl = imgSrc;
    });
    observer.observe({ type: "largest-contentful-paint", buffered: true });
    return observer;
  }
  scanImages() {
    const images = getDocument().querySelectorAll("img");
    let lcpElementFound, lcpElementLoadedCorrectly = false;
    images.forEach((image) => {
      if (!this.options?.disableImageSizeWarning) {
        for (const image2 of images) {
          if (!image2.getAttribute("ng-img") && this.isOversized(image2)) {
            logOversizedImageWarning(image2.src);
          }
        }
      }
      if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
        if (image.src === this.lcpImageUrl) {
          lcpElementFound = true;
          if (image.loading !== "lazy" || image.getAttribute("ng-img")) {
            lcpElementLoadedCorrectly = true;
          }
        }
      }
    });
    if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl && !this.options?.disableImageLazyLoadWarning) {
      logLazyLCPWarning(this.lcpImageUrl);
    }
  }
  isOversized(image) {
    if (!this.window) {
      return false;
    }
    const computedStyle = this.window.getComputedStyle(image);
    let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
    let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
    const boxSizing = computedStyle.getPropertyValue("box-sizing");
    const objectFit = computedStyle.getPropertyValue("object-fit");
    if (objectFit === `cover`) {
      return false;
    }
    if (boxSizing === "border-box") {
      const paddingTop = computedStyle.getPropertyValue("padding-top");
      const paddingRight = computedStyle.getPropertyValue("padding-right");
      const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
      const paddingLeft = computedStyle.getPropertyValue("padding-left");
      renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
      renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
    }
    const intrinsicWidth = image.naturalWidth;
    const intrinsicHeight = image.naturalHeight;
    const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
    const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
    const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
    const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
    return oversizedWidth || oversizedHeight;
  }
};
_ImagePerformanceWarning.\u0275fac = function ImagePerformanceWarning_Factory(t) {
  return new (t || _ImagePerformanceWarning)();
};
_ImagePerformanceWarning.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ImagePerformanceWarning, factory: _ImagePerformanceWarning.\u0275fac, providedIn: "root" });
var ImagePerformanceWarning = _ImagePerformanceWarning;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
    type: Injectable,
    args: [{ providedIn: "root" }]
  }], null, null);
})();
function logLazyLCPWarning(src) {
  console.warn(formatRuntimeError(-913, `An image with src ${src} is the Largest Contentful Paint (LCP) element but was given a "loading" value of "lazy", which can negatively impact application loading performance. This warning can be addressed by changing the loading value of the LCP image to "eager", or by using the NgOptimizedImage directive's prioritization utilities. For more information about addressing or disabling this warning, see https://angular.io/errors/NG0913`));
}
function logOversizedImageWarning(src) {
  console.warn(formatRuntimeError(-913, `An image with src ${src} has intrinsic file dimensions much larger than its rendered size. This can negatively impact application loading performance. For more information about addressing or disabling this warning, see https://angular.io/errors/NG0913`));
}
function booleanAttribute(value) {
  return typeof value === "boolean" ? value : value != null && value !== "false";
}
function numberAttribute(value, fallbackValue = NaN) {
  const isNumberValue = !isNaN(parseFloat(value)) && !isNaN(Number(value));
  return isNumberValue ? Number(value) : fallbackValue;
}
function untracked(nonReactiveReadsFn) {
  const prevConsumer = setActiveConsumer(null);
  try {
    return nonReactiveReadsFn();
  } finally {
    setActiveConsumer(prevConsumer);
  }
}
var APP_EFFECT_SCHEDULER = new InjectionToken("", {
  providedIn: "root",
  factory: () => inject(EffectScheduler)
});
var _EffectScheduler = class _EffectScheduler {
};
_EffectScheduler.\u0275prov = \u0275\u0275defineInjectable({
  token: _EffectScheduler,
  providedIn: "root",
  factory: () => new ZoneAwareEffectScheduler()
});
var EffectScheduler = _EffectScheduler;
var ZoneAwareEffectScheduler = class {
  constructor() {
    this.queuedEffectCount = 0;
    this.queues = /* @__PURE__ */ new Map();
    this.pendingTasks = inject(PendingTasks);
    this.taskId = null;
  }
  scheduleEffect(handle) {
    this.enqueue(handle);
    if (this.taskId === null) {
      const taskId = this.taskId = this.pendingTasks.add();
      queueMicrotask(() => {
        this.flush();
        this.pendingTasks.remove(taskId);
        this.taskId = null;
      });
    }
  }
  enqueue(handle) {
    const zone = handle.creationZone;
    if (!this.queues.has(zone)) {
      this.queues.set(zone, /* @__PURE__ */ new Set());
    }
    const queue = this.queues.get(zone);
    if (queue.has(handle)) {
      return;
    }
    this.queuedEffectCount++;
    queue.add(handle);
  }
  /**
   * Run all scheduled effects.
   *
   * Execution order of effects within the same zone is guaranteed to be FIFO, but there is no
   * ordering guarantee between effects scheduled in different zones.
   */
  flush() {
    while (this.queuedEffectCount > 0) {
      for (const [zone, queue] of this.queues) {
        if (zone === null) {
          this.flushQueue(queue);
        } else {
          zone.run(() => this.flushQueue(queue));
        }
      }
    }
  }
  flushQueue(queue) {
    for (const handle of queue) {
      queue.delete(handle);
      this.queuedEffectCount--;
      handle.run();
    }
  }
};
var EffectHandle = class {
  constructor(scheduler2, effectFn, creationZone, destroyRef, injector, allowSignalWrites) {
    this.scheduler = scheduler2;
    this.effectFn = effectFn;
    this.creationZone = creationZone;
    this.injector = injector;
    this.watcher = createWatch((onCleanup) => this.runEffect(onCleanup), () => this.schedule(), allowSignalWrites);
    this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());
  }
  runEffect(onCleanup) {
    try {
      this.effectFn(onCleanup);
    } catch (err) {
      const errorHandler2 = this.injector.get(ErrorHandler, null, { optional: true });
      errorHandler2?.handleError(err);
    }
  }
  run() {
    this.watcher.run();
  }
  schedule() {
    this.scheduler.scheduleEffect(this);
  }
  destroy() {
    this.watcher.destroy();
    this.unregisterOnDestroy?.();
  }
};
function effect(effectFn, options) {
  performanceMarkFeature("NgSignals");
  ngDevMode && assertNotInReactiveContext(effect, "Call `effect` outside of a reactive context. For example, schedule the effect inside the component constructor.");
  !options?.injector && assertInInjectionContext(effect);
  const injector = options?.injector ?? inject(Injector);
  const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
  const handle = new EffectHandle(injector.get(APP_EFFECT_SCHEDULER), effectFn, typeof Zone === "undefined" ? null : Zone.current, destroyRef, injector, options?.allowSignalWrites ?? false);
  const cdr = injector.get(ChangeDetectorRef, null, { optional: true });
  if (!cdr || !(cdr._lView[FLAGS] & 8)) {
    handle.watcher.notify();
  } else {
    (cdr._lView[EFFECTS_TO_SCHEDULE] ??= []).push(handle.watcher.notify);
  }
  return handle;
}
if (typeof ngDevMode !== "undefined" && ngDevMode) {
  _global.$localize ??= function() {
    throw new Error("It looks like your application or one of its dependencies is using i18n.\nAngular 9 introduced a global `$localize()` function that needs to be loaded.\nPlease run `ng add @angular/localize` from the Angular CLI.\n(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.\nFor server-side rendering applications add the import to your `main.server.ts` file.)");
  };
}

// node_modules/@angular/common/fesm2022/common.mjs
var _DOM = null;
function getDOM() {
  return _DOM;
}
function setRootDomAdapter(adapter) {
  _DOM ??= adapter;
}
var DomAdapter = class {
};
var _PlatformNavigation = class _PlatformNavigation {
};
_PlatformNavigation.\u0275fac = function PlatformNavigation_Factory(t) {
  return new (t || _PlatformNavigation)();
};
_PlatformNavigation.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _PlatformNavigation,
  factory: () => (() => window.navigation)(),
  providedIn: "platform"
});
var PlatformNavigation = _PlatformNavigation;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformNavigation, [{
    type: Injectable,
    args: [{
      providedIn: "platform",
      useFactory: () => window.navigation
    }]
  }], null, null);
})();
var DOCUMENT2 = new InjectionToken(ngDevMode ? "DocumentToken" : "");
var _PlatformLocation = class _PlatformLocation {
  historyGo(relativePosition) {
    throw new Error(ngDevMode ? "Not implemented" : "");
  }
};
_PlatformLocation.\u0275fac = function PlatformLocation_Factory(t) {
  return new (t || _PlatformLocation)();
};
_PlatformLocation.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _PlatformLocation,
  factory: () => (() => inject(BrowserPlatformLocation))(),
  providedIn: "platform"
});
var PlatformLocation = _PlatformLocation;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformLocation, [{
    type: Injectable,
    args: [{
      providedIn: "platform",
      useFactory: () => inject(BrowserPlatformLocation)
    }]
  }], null, null);
})();
var LOCATION_INITIALIZED = new InjectionToken(ngDevMode ? "Location Initialized" : "");
var _BrowserPlatformLocation = class _BrowserPlatformLocation extends PlatformLocation {
  constructor() {
    super();
    this._doc = inject(DOCUMENT2);
    this._location = window.location;
    this._history = window.history;
  }
  getBaseHrefFromDOM() {
    return getDOM().getBaseHref(this._doc);
  }
  onPopState(fn) {
    const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
    window2.addEventListener("popstate", fn, false);
    return () => window2.removeEventListener("popstate", fn);
  }
  onHashChange(fn) {
    const window2 = getDOM().getGlobalEventTarget(this._doc, "window");
    window2.addEventListener("hashchange", fn, false);
    return () => window2.removeEventListener("hashchange", fn);
  }
  get href() {
    return this._location.href;
  }
  get protocol() {
    return this._location.protocol;
  }
  get hostname() {
    return this._location.hostname;
  }
  get port() {
    return this._location.port;
  }
  get pathname() {
    return this._location.pathname;
  }
  get search() {
    return this._location.search;
  }
  get hash() {
    return this._location.hash;
  }
  set pathname(newPath) {
    this._location.pathname = newPath;
  }
  pushState(state2, title, url) {
    this._history.pushState(state2, title, url);
  }
  replaceState(state2, title, url) {
    this._history.replaceState(state2, title, url);
  }
  forward() {
    this._history.forward();
  }
  back() {
    this._history.back();
  }
  historyGo(relativePosition = 0) {
    this._history.go(relativePosition);
  }
  getState() {
    return this._history.state;
  }
};
_BrowserPlatformLocation.\u0275fac = function BrowserPlatformLocation_Factory(t) {
  return new (t || _BrowserPlatformLocation)();
};
_BrowserPlatformLocation.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _BrowserPlatformLocation,
  factory: () => (() => new _BrowserPlatformLocation())(),
  providedIn: "platform"
});
var BrowserPlatformLocation = _BrowserPlatformLocation;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserPlatformLocation, [{
    type: Injectable,
    args: [{
      providedIn: "platform",
      useFactory: () => new BrowserPlatformLocation()
    }]
  }], () => [], null);
})();
function joinWithSlash(start2, end) {
  if (start2.length == 0) {
    return end;
  }
  if (end.length == 0) {
    return start2;
  }
  let slashes = 0;
  if (start2.endsWith("/")) {
    slashes++;
  }
  if (end.startsWith("/")) {
    slashes++;
  }
  if (slashes == 2) {
    return start2 + end.substring(1);
  }
  if (slashes == 1) {
    return start2 + end;
  }
  return start2 + "/" + end;
}
function stripTrailingSlash(url) {
  const match2 = url.match(/#|\?|$/);
  const pathEndIdx = match2 && match2.index || url.length;
  const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === "/" ? 1 : 0);
  return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);
}
function normalizeQueryParams(params) {
  return params && params[0] !== "?" ? "?" + params : params;
}
var _LocationStrategy = class _LocationStrategy {
  historyGo(relativePosition) {
    throw new Error(ngDevMode ? "Not implemented" : "");
  }
};
_LocationStrategy.\u0275fac = function LocationStrategy_Factory(t) {
  return new (t || _LocationStrategy)();
};
_LocationStrategy.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _LocationStrategy,
  factory: () => (() => inject(PathLocationStrategy))(),
  providedIn: "root"
});
var LocationStrategy = _LocationStrategy;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationStrategy, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      useFactory: () => inject(PathLocationStrategy)
    }]
  }], null, null);
})();
var APP_BASE_HREF = new InjectionToken(ngDevMode ? "appBaseHref" : "");
var _PathLocationStrategy = class _PathLocationStrategy extends LocationStrategy {
  constructor(_platformLocation, href) {
    super();
    this._platformLocation = _platformLocation;
    this._removeListenerFns = [];
    this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject(DOCUMENT2).location?.origin ?? "";
  }
  /** @nodoc */
  ngOnDestroy() {
    while (this._removeListenerFns.length) {
      this._removeListenerFns.pop()();
    }
  }
  onPopState(fn) {
    this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
  }
  getBaseHref() {
    return this._baseHref;
  }
  prepareExternalUrl(internal) {
    return joinWithSlash(this._baseHref, internal);
  }
  path(includeHash = false) {
    const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
    const hash2 = this._platformLocation.hash;
    return hash2 && includeHash ? `${pathname}${hash2}` : pathname;
  }
  pushState(state2, title, url, queryParams) {
    const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
    this._platformLocation.pushState(state2, title, externalUrl);
  }
  replaceState(state2, title, url, queryParams) {
    const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
    this._platformLocation.replaceState(state2, title, externalUrl);
  }
  forward() {
    this._platformLocation.forward();
  }
  back() {
    this._platformLocation.back();
  }
  getState() {
    return this._platformLocation.getState();
  }
  historyGo(relativePosition = 0) {
    this._platformLocation.historyGo?.(relativePosition);
  }
};
_PathLocationStrategy.\u0275fac = function PathLocationStrategy_Factory(t) {
  return new (t || _PathLocationStrategy)(\u0275\u0275inject(PlatformLocation), \u0275\u0275inject(APP_BASE_HREF, 8));
};
_PathLocationStrategy.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _PathLocationStrategy,
  factory: _PathLocationStrategy.\u0275fac,
  providedIn: "root"
});
var PathLocationStrategy = _PathLocationStrategy;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PathLocationStrategy, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: PlatformLocation
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [APP_BASE_HREF]
    }]
  }], null);
})();
var _HashLocationStrategy = class _HashLocationStrategy extends LocationStrategy {
  constructor(_platformLocation, _baseHref) {
    super();
    this._platformLocation = _platformLocation;
    this._baseHref = "";
    this._removeListenerFns = [];
    if (_baseHref != null) {
      this._baseHref = _baseHref;
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    while (this._removeListenerFns.length) {
      this._removeListenerFns.pop()();
    }
  }
  onPopState(fn) {
    this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
  }
  getBaseHref() {
    return this._baseHref;
  }
  path(includeHash = false) {
    const path = this._platformLocation.hash ?? "#";
    return path.length > 0 ? path.substring(1) : path;
  }
  prepareExternalUrl(internal) {
    const url = joinWithSlash(this._baseHref, internal);
    return url.length > 0 ? "#" + url : url;
  }
  pushState(state2, title, path, queryParams) {
    let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
    if (url.length == 0) {
      url = this._platformLocation.pathname;
    }
    this._platformLocation.pushState(state2, title, url);
  }
  replaceState(state2, title, path, queryParams) {
    let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
    if (url.length == 0) {
      url = this._platformLocation.pathname;
    }
    this._platformLocation.replaceState(state2, title, url);
  }
  forward() {
    this._platformLocation.forward();
  }
  back() {
    this._platformLocation.back();
  }
  getState() {
    return this._platformLocation.getState();
  }
  historyGo(relativePosition = 0) {
    this._platformLocation.historyGo?.(relativePosition);
  }
};
_HashLocationStrategy.\u0275fac = function HashLocationStrategy_Factory(t) {
  return new (t || _HashLocationStrategy)(\u0275\u0275inject(PlatformLocation), \u0275\u0275inject(APP_BASE_HREF, 8));
};
_HashLocationStrategy.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HashLocationStrategy,
  factory: _HashLocationStrategy.\u0275fac
});
var HashLocationStrategy = _HashLocationStrategy;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HashLocationStrategy, [{
    type: Injectable
  }], () => [{
    type: PlatformLocation
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [APP_BASE_HREF]
    }]
  }], null);
})();
var _Location = class _Location {
  constructor(locationStrategy) {
    this._subject = new EventEmitter();
    this._urlChangeListeners = [];
    this._urlChangeSubscription = null;
    this._locationStrategy = locationStrategy;
    const baseHref = this._locationStrategy.getBaseHref();
    this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
    this._locationStrategy.onPopState((ev) => {
      this._subject.emit({
        "url": this.path(true),
        "pop": true,
        "state": ev.state,
        "type": ev.type
      });
    });
  }
  /** @nodoc */
  ngOnDestroy() {
    this._urlChangeSubscription?.unsubscribe();
    this._urlChangeListeners = [];
  }
  /**
   * Normalizes the URL path for this location.
   *
   * @param includeHash True to include an anchor fragment in the path.
   *
   * @returns The normalized URL path.
   */
  // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
  // removed.
  path(includeHash = false) {
    return this.normalize(this._locationStrategy.path(includeHash));
  }
  /**
   * Reports the current state of the location history.
   * @returns The current value of the `history.state` object.
   */
  getState() {
    return this._locationStrategy.getState();
  }
  /**
   * Normalizes the given path and compares to the current normalized path.
   *
   * @param path The given URL path.
   * @param query Query parameters.
   *
   * @returns True if the given URL path is equal to the current normalized path, false
   * otherwise.
   */
  isCurrentPathEqualTo(path, query = "") {
    return this.path() == this.normalize(path + normalizeQueryParams(query));
  }
  /**
   * Normalizes a URL path by stripping any trailing slashes.
   *
   * @param url String representing a URL.
   *
   * @returns The normalized URL string.
   */
  normalize(url) {
    return _Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
  }
  /**
   * Normalizes an external URL path.
   * If the given URL doesn't begin with a leading slash (`'/'`), adds one
   * before normalizing. Adds a hash if `HashLocationStrategy` is
   * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
   *
   * @param url String representing a URL.
   *
   * @returns  A normalized platform-specific URL.
   */
  prepareExternalUrl(url) {
    if (url && url[0] !== "/") {
      url = "/" + url;
    }
    return this._locationStrategy.prepareExternalUrl(url);
  }
  // TODO: rename this method to pushState
  /**
   * Changes the browser's URL to a normalized version of a given URL, and pushes a
   * new item onto the platform's history.
   *
   * @param path  URL path to normalize.
   * @param query Query parameters.
   * @param state Location history state.
   *
   */
  go(path, query = "", state2 = null) {
    this._locationStrategy.pushState(state2, "", path, query);
    this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state2);
  }
  /**
   * Changes the browser's URL to a normalized version of the given URL, and replaces
   * the top item on the platform's history stack.
   *
   * @param path  URL path to normalize.
   * @param query Query parameters.
   * @param state Location history state.
   */
  replaceState(path, query = "", state2 = null) {
    this._locationStrategy.replaceState(state2, "", path, query);
    this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state2);
  }
  /**
   * Navigates forward in the platform's history.
   */
  forward() {
    this._locationStrategy.forward();
  }
  /**
   * Navigates back in the platform's history.
   */
  back() {
    this._locationStrategy.back();
  }
  /**
   * Navigate to a specific page from session history, identified by its relative position to the
   * current page.
   *
   * @param relativePosition  Position of the target page in the history relative to the current
   *     page.
   * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
   * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
   * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
   * when `relativePosition` equals 0.
   * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
   */
  historyGo(relativePosition = 0) {
    this._locationStrategy.historyGo?.(relativePosition);
  }
  /**
   * Registers a URL change listener. Use to catch updates performed by the Angular
   * framework that are not detectible through "popstate" or "hashchange" events.
   *
   * @param fn The change handler function, which take a URL and a location history state.
   * @returns A function that, when executed, unregisters a URL change listener.
   */
  onUrlChange(fn) {
    this._urlChangeListeners.push(fn);
    this._urlChangeSubscription ??= this.subscribe((v) => {
      this._notifyUrlChangeListeners(v.url, v.state);
    });
    return () => {
      const fnIndex = this._urlChangeListeners.indexOf(fn);
      this._urlChangeListeners.splice(fnIndex, 1);
      if (this._urlChangeListeners.length === 0) {
        this._urlChangeSubscription?.unsubscribe();
        this._urlChangeSubscription = null;
      }
    };
  }
  /** @internal */
  _notifyUrlChangeListeners(url = "", state2) {
    this._urlChangeListeners.forEach((fn) => fn(url, state2));
  }
  /**
   * Subscribes to the platform's `popState` events.
   *
   * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
   * `Location.onUrlChange()` to subscribe to URL changes instead.
   *
   * @param value Event that is triggered when the state history changes.
   * @param exception The exception to throw.
   *
   * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
   *
   * @returns Subscribed events.
   */
  subscribe(onNext, onThrow, onReturn) {
    return this._subject.subscribe({
      next: onNext,
      error: onThrow,
      complete: onReturn
    });
  }
};
_Location.normalizeQueryParams = normalizeQueryParams;
_Location.joinWithSlash = joinWithSlash;
_Location.stripTrailingSlash = stripTrailingSlash;
_Location.\u0275fac = function Location_Factory(t) {
  return new (t || _Location)(\u0275\u0275inject(LocationStrategy));
};
_Location.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Location,
  factory: () => createLocation(),
  providedIn: "root"
});
var Location = _Location;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Location, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      // See #23917
      useFactory: createLocation
    }]
  }], () => [{
    type: LocationStrategy
  }], null);
})();
function createLocation() {
  return new Location(\u0275\u0275inject(LocationStrategy));
}
function _stripBasePath(basePath, url) {
  if (!basePath || !url.startsWith(basePath)) {
    return url;
  }
  const strippedUrl = url.substring(basePath.length);
  if (strippedUrl === "" || ["/", ";", "?", "#"].includes(strippedUrl[0])) {
    return strippedUrl;
  }
  return url;
}
function _stripIndexHtml(url) {
  return url.replace(/\/index.html$/, "");
}
function _stripOrigin(baseHref) {
  const isAbsoluteUrl2 = new RegExp("^(https?:)?//").test(baseHref);
  if (isAbsoluteUrl2) {
    const [, pathname] = baseHref.split(/\/\/[^\/]+/);
    return pathname;
  }
  return baseHref;
}
var CURRENCIES_EN = {
  "ADP": [void 0, void 0, 0],
  "AFN": [void 0, "\u060B", 0],
  "ALL": [void 0, void 0, 0],
  "AMD": [void 0, "\u058F", 2],
  "AOA": [void 0, "Kz"],
  "ARS": [void 0, "$"],
  "AUD": ["A$", "$"],
  "AZN": [void 0, "\u20BC"],
  "BAM": [void 0, "KM"],
  "BBD": [void 0, "$"],
  "BDT": [void 0, "\u09F3"],
  "BHD": [void 0, void 0, 3],
  "BIF": [void 0, void 0, 0],
  "BMD": [void 0, "$"],
  "BND": [void 0, "$"],
  "BOB": [void 0, "Bs"],
  "BRL": ["R$"],
  "BSD": [void 0, "$"],
  "BWP": [void 0, "P"],
  "BYN": [void 0, void 0, 2],
  "BYR": [void 0, void 0, 0],
  "BZD": [void 0, "$"],
  "CAD": ["CA$", "$", 2],
  "CHF": [void 0, void 0, 2],
  "CLF": [void 0, void 0, 4],
  "CLP": [void 0, "$", 0],
  "CNY": ["CN\xA5", "\xA5"],
  "COP": [void 0, "$", 2],
  "CRC": [void 0, "\u20A1", 2],
  "CUC": [void 0, "$"],
  "CUP": [void 0, "$"],
  "CZK": [void 0, "K\u010D", 2],
  "DJF": [void 0, void 0, 0],
  "DKK": [void 0, "kr", 2],
  "DOP": [void 0, "$"],
  "EGP": [void 0, "E\xA3"],
  "ESP": [void 0, "\u20A7", 0],
  "EUR": ["\u20AC"],
  "FJD": [void 0, "$"],
  "FKP": [void 0, "\xA3"],
  "GBP": ["\xA3"],
  "GEL": [void 0, "\u20BE"],
  "GHS": [void 0, "GH\u20B5"],
  "GIP": [void 0, "\xA3"],
  "GNF": [void 0, "FG", 0],
  "GTQ": [void 0, "Q"],
  "GYD": [void 0, "$", 2],
  "HKD": ["HK$", "$"],
  "HNL": [void 0, "L"],
  "HRK": [void 0, "kn"],
  "HUF": [void 0, "Ft", 2],
  "IDR": [void 0, "Rp", 2],
  "ILS": ["\u20AA"],
  "INR": ["\u20B9"],
  "IQD": [void 0, void 0, 0],
  "IRR": [void 0, void 0, 0],
  "ISK": [void 0, "kr", 0],
  "ITL": [void 0, void 0, 0],
  "JMD": [void 0, "$"],
  "JOD": [void 0, void 0, 3],
  "JPY": ["\xA5", void 0, 0],
  "KHR": [void 0, "\u17DB"],
  "KMF": [void 0, "CF", 0],
  "KPW": [void 0, "\u20A9", 0],
  "KRW": ["\u20A9", void 0, 0],
  "KWD": [void 0, void 0, 3],
  "KYD": [void 0, "$"],
  "KZT": [void 0, "\u20B8"],
  "LAK": [void 0, "\u20AD", 0],
  "LBP": [void 0, "L\xA3", 0],
  "LKR": [void 0, "Rs"],
  "LRD": [void 0, "$"],
  "LTL": [void 0, "Lt"],
  "LUF": [void 0, void 0, 0],
  "LVL": [void 0, "Ls"],
  "LYD": [void 0, void 0, 3],
  "MGA": [void 0, "Ar", 0],
  "MGF": [void 0, void 0, 0],
  "MMK": [void 0, "K", 0],
  "MNT": [void 0, "\u20AE", 2],
  "MRO": [void 0, void 0, 0],
  "MUR": [void 0, "Rs", 2],
  "MXN": ["MX$", "$"],
  "MYR": [void 0, "RM"],
  "NAD": [void 0, "$"],
  "NGN": [void 0, "\u20A6"],
  "NIO": [void 0, "C$"],
  "NOK": [void 0, "kr", 2],
  "NPR": [void 0, "Rs"],
  "NZD": ["NZ$", "$"],
  "OMR": [void 0, void 0, 3],
  "PHP": ["\u20B1"],
  "PKR": [void 0, "Rs", 2],
  "PLN": [void 0, "z\u0142"],
  "PYG": [void 0, "\u20B2", 0],
  "RON": [void 0, "lei"],
  "RSD": [void 0, void 0, 0],
  "RUB": [void 0, "\u20BD"],
  "RWF": [void 0, "RF", 0],
  "SBD": [void 0, "$"],
  "SEK": [void 0, "kr", 2],
  "SGD": [void 0, "$"],
  "SHP": [void 0, "\xA3"],
  "SLE": [void 0, void 0, 2],
  "SLL": [void 0, void 0, 0],
  "SOS": [void 0, void 0, 0],
  "SRD": [void 0, "$"],
  "SSP": [void 0, "\xA3"],
  "STD": [void 0, void 0, 0],
  "STN": [void 0, "Db"],
  "SYP": [void 0, "\xA3", 0],
  "THB": [void 0, "\u0E3F"],
  "TMM": [void 0, void 0, 0],
  "TND": [void 0, void 0, 3],
  "TOP": [void 0, "T$"],
  "TRL": [void 0, void 0, 0],
  "TRY": [void 0, "\u20BA"],
  "TTD": [void 0, "$"],
  "TWD": ["NT$", "$", 2],
  "TZS": [void 0, void 0, 2],
  "UAH": [void 0, "\u20B4"],
  "UGX": [void 0, void 0, 0],
  "USD": ["$"],
  "UYI": [void 0, void 0, 0],
  "UYU": [void 0, "$"],
  "UYW": [void 0, void 0, 4],
  "UZS": [void 0, void 0, 2],
  "VEF": [void 0, "Bs", 2],
  "VND": ["\u20AB", void 0, 0],
  "VUV": [void 0, void 0, 0],
  "XAF": ["FCFA", void 0, 0],
  "XCD": ["EC$", "$"],
  "XOF": ["F\u202FCFA", void 0, 0],
  "XPF": ["CFPF", void 0, 0],
  "XXX": ["\xA4"],
  "YER": [void 0, void 0, 0],
  "ZAR": [void 0, "R"],
  "ZMK": [void 0, void 0, 0],
  "ZMW": [void 0, "ZK"],
  "ZWD": [void 0, void 0, 0]
};
var NumberFormatStyle;
(function(NumberFormatStyle2) {
  NumberFormatStyle2[NumberFormatStyle2["Decimal"] = 0] = "Decimal";
  NumberFormatStyle2[NumberFormatStyle2["Percent"] = 1] = "Percent";
  NumberFormatStyle2[NumberFormatStyle2["Currency"] = 2] = "Currency";
  NumberFormatStyle2[NumberFormatStyle2["Scientific"] = 3] = "Scientific";
})(NumberFormatStyle || (NumberFormatStyle = {}));
var Plural;
(function(Plural2) {
  Plural2[Plural2["Zero"] = 0] = "Zero";
  Plural2[Plural2["One"] = 1] = "One";
  Plural2[Plural2["Two"] = 2] = "Two";
  Plural2[Plural2["Few"] = 3] = "Few";
  Plural2[Plural2["Many"] = 4] = "Many";
  Plural2[Plural2["Other"] = 5] = "Other";
})(Plural || (Plural = {}));
var FormStyle;
(function(FormStyle2) {
  FormStyle2[FormStyle2["Format"] = 0] = "Format";
  FormStyle2[FormStyle2["Standalone"] = 1] = "Standalone";
})(FormStyle || (FormStyle = {}));
var TranslationWidth;
(function(TranslationWidth2) {
  TranslationWidth2[TranslationWidth2["Narrow"] = 0] = "Narrow";
  TranslationWidth2[TranslationWidth2["Abbreviated"] = 1] = "Abbreviated";
  TranslationWidth2[TranslationWidth2["Wide"] = 2] = "Wide";
  TranslationWidth2[TranslationWidth2["Short"] = 3] = "Short";
})(TranslationWidth || (TranslationWidth = {}));
var FormatWidth;
(function(FormatWidth2) {
  FormatWidth2[FormatWidth2["Short"] = 0] = "Short";
  FormatWidth2[FormatWidth2["Medium"] = 1] = "Medium";
  FormatWidth2[FormatWidth2["Long"] = 2] = "Long";
  FormatWidth2[FormatWidth2["Full"] = 3] = "Full";
})(FormatWidth || (FormatWidth = {}));
var NumberSymbol = {
  /**
   * Decimal separator.
   * For `en-US`, the dot character.
   * Example: 2,345`.`67
   */
  Decimal: 0,
  /**
   * Grouping separator, typically for thousands.
   * For `en-US`, the comma character.
   * Example: 2`,`345.67
   */
  Group: 1,
  /**
   * List-item separator.
   * Example: "one, two, and three"
   */
  List: 2,
  /**
   * Sign for percentage (out of 100).
   * Example: 23.4%
   */
  PercentSign: 3,
  /**
   * Sign for positive numbers.
   * Example: +23
   */
  PlusSign: 4,
  /**
   * Sign for negative numbers.
   * Example: -23
   */
  MinusSign: 5,
  /**
   * Computer notation for exponential value (n times a power of 10).
   * Example: 1.2E3
   */
  Exponential: 6,
  /**
   * Human-readable format of exponential.
   * Example: 1.2x103
   */
  SuperscriptingExponent: 7,
  /**
   * Sign for permille (out of 1000).
   * Example: 23.4‰
   */
  PerMille: 8,
  /**
   * Infinity, can be used with plus and minus.
   * Example: ∞, +∞, -∞
   */
  Infinity: 9,
  /**
   * Not a number.
   * Example: NaN
   */
  NaN: 10,
  /**
   * Symbol used between time units.
   * Example: 10:52
   */
  TimeSeparator: 11,
  /**
   * Decimal separator for currency values (fallback to `Decimal`).
   * Example: $2,345.67
   */
  CurrencyDecimal: 12,
  /**
   * Group separator for currency values (fallback to `Group`).
   * Example: $2,345.67
   */
  CurrencyGroup: 13
};
var WeekDay;
(function(WeekDay2) {
  WeekDay2[WeekDay2["Sunday"] = 0] = "Sunday";
  WeekDay2[WeekDay2["Monday"] = 1] = "Monday";
  WeekDay2[WeekDay2["Tuesday"] = 2] = "Tuesday";
  WeekDay2[WeekDay2["Wednesday"] = 3] = "Wednesday";
  WeekDay2[WeekDay2["Thursday"] = 4] = "Thursday";
  WeekDay2[WeekDay2["Friday"] = 5] = "Friday";
  WeekDay2[WeekDay2["Saturday"] = 6] = "Saturday";
})(WeekDay || (WeekDay = {}));
function getLocaleId2(locale) {
  return findLocaleData(locale)[LocaleDataIndex.LocaleId];
}
function getLocaleDayPeriods(locale, formStyle, width) {
  const data = findLocaleData(locale);
  const amPmData = [data[LocaleDataIndex.DayPeriodsFormat], data[LocaleDataIndex.DayPeriodsStandalone]];
  const amPm = getLastDefinedValue(amPmData, formStyle);
  return getLastDefinedValue(amPm, width);
}
function getLocaleDayNames(locale, formStyle, width) {
  const data = findLocaleData(locale);
  const daysData = [data[LocaleDataIndex.DaysFormat], data[LocaleDataIndex.DaysStandalone]];
  const days = getLastDefinedValue(daysData, formStyle);
  return getLastDefinedValue(days, width);
}
function getLocaleMonthNames(locale, formStyle, width) {
  const data = findLocaleData(locale);
  const monthsData = [data[LocaleDataIndex.MonthsFormat], data[LocaleDataIndex.MonthsStandalone]];
  const months = getLastDefinedValue(monthsData, formStyle);
  return getLastDefinedValue(months, width);
}
function getLocaleEraNames(locale, width) {
  const data = findLocaleData(locale);
  const erasData = data[LocaleDataIndex.Eras];
  return getLastDefinedValue(erasData, width);
}
function getLocaleDateFormat(locale, width) {
  const data = findLocaleData(locale);
  return getLastDefinedValue(data[LocaleDataIndex.DateFormat], width);
}
function getLocaleTimeFormat(locale, width) {
  const data = findLocaleData(locale);
  return getLastDefinedValue(data[LocaleDataIndex.TimeFormat], width);
}
function getLocaleDateTimeFormat(locale, width) {
  const data = findLocaleData(locale);
  const dateTimeFormatData = data[LocaleDataIndex.DateTimeFormat];
  return getLastDefinedValue(dateTimeFormatData, width);
}
function getLocaleNumberSymbol(locale, symbol) {
  const data = findLocaleData(locale);
  const res = data[LocaleDataIndex.NumberSymbols][symbol];
  if (typeof res === "undefined") {
    if (symbol === NumberSymbol.CurrencyDecimal) {
      return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
    } else if (symbol === NumberSymbol.CurrencyGroup) {
      return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
    }
  }
  return res;
}
function getLocaleNumberFormat(locale, type) {
  const data = findLocaleData(locale);
  return data[LocaleDataIndex.NumberFormats][type];
}
function getLocaleCurrencies(locale) {
  const data = findLocaleData(locale);
  return data[LocaleDataIndex.Currencies];
}
var getLocalePluralCase2 = getLocalePluralCase;
function checkFullData(data) {
  if (!data[LocaleDataIndex.ExtraData]) {
    throw new Error(`Missing extra locale data for the locale "${data[LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
  }
}
function getLocaleExtraDayPeriodRules(locale) {
  const data = findLocaleData(locale);
  checkFullData(data);
  const rules = data[LocaleDataIndex.ExtraData][
    2
    /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */
  ] || [];
  return rules.map((rule) => {
    if (typeof rule === "string") {
      return extractTime(rule);
    }
    return [extractTime(rule[0]), extractTime(rule[1])];
  });
}
function getLocaleExtraDayPeriods(locale, formStyle, width) {
  const data = findLocaleData(locale);
  checkFullData(data);
  const dayPeriodsData = [data[LocaleDataIndex.ExtraData][
    0
    /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */
  ], data[LocaleDataIndex.ExtraData][
    1
    /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */
  ]];
  const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
  return getLastDefinedValue(dayPeriods, width) || [];
}
function getLastDefinedValue(data, index) {
  for (let i2 = index; i2 > -1; i2--) {
    if (typeof data[i2] !== "undefined") {
      return data[i2];
    }
  }
  throw new Error("Locale data API: locale data undefined");
}
function extractTime(time) {
  const [h, m] = time.split(":");
  return {
    hours: +h,
    minutes: +m
  };
}
function getCurrencySymbol(code, format, locale = "en") {
  const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
  const symbolNarrow = currency[
    1
    /* ɵCurrencyIndex.SymbolNarrow */
  ];
  if (format === "narrow" && typeof symbolNarrow === "string") {
    return symbolNarrow;
  }
  return currency[
    0
    /* ɵCurrencyIndex.Symbol */
  ] || code;
}
var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
function getNumberOfCurrencyDigits(code) {
  let digits;
  const currency = CURRENCIES_EN[code];
  if (currency) {
    digits = currency[
      2
      /* ɵCurrencyIndex.NbOfDigits */
    ];
  }
  return typeof digits === "number" ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
}
var ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
var NAMED_FORMATS = {};
var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
var ZoneWidth;
(function(ZoneWidth2) {
  ZoneWidth2[ZoneWidth2["Short"] = 0] = "Short";
  ZoneWidth2[ZoneWidth2["ShortGMT"] = 1] = "ShortGMT";
  ZoneWidth2[ZoneWidth2["Long"] = 2] = "Long";
  ZoneWidth2[ZoneWidth2["Extended"] = 3] = "Extended";
})(ZoneWidth || (ZoneWidth = {}));
var DateType;
(function(DateType2) {
  DateType2[DateType2["FullYear"] = 0] = "FullYear";
  DateType2[DateType2["Month"] = 1] = "Month";
  DateType2[DateType2["Date"] = 2] = "Date";
  DateType2[DateType2["Hours"] = 3] = "Hours";
  DateType2[DateType2["Minutes"] = 4] = "Minutes";
  DateType2[DateType2["Seconds"] = 5] = "Seconds";
  DateType2[DateType2["FractionalSeconds"] = 6] = "FractionalSeconds";
  DateType2[DateType2["Day"] = 7] = "Day";
})(DateType || (DateType = {}));
var TranslationType;
(function(TranslationType2) {
  TranslationType2[TranslationType2["DayPeriods"] = 0] = "DayPeriods";
  TranslationType2[TranslationType2["Days"] = 1] = "Days";
  TranslationType2[TranslationType2["Months"] = 2] = "Months";
  TranslationType2[TranslationType2["Eras"] = 3] = "Eras";
})(TranslationType || (TranslationType = {}));
function formatDate(value, format, locale, timezone) {
  let date = toDate(value);
  const namedFormat = getNamedFormat(locale, format);
  format = namedFormat || format;
  let parts = [];
  let match2;
  while (format) {
    match2 = DATE_FORMATS_SPLIT.exec(format);
    if (match2) {
      parts = parts.concat(match2.slice(1));
      const part = parts.pop();
      if (!part) {
        break;
      }
      format = part;
    } else {
      parts.push(format);
      break;
    }
  }
  let dateTimezoneOffset = date.getTimezoneOffset();
  if (timezone) {
    dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
    date = convertTimezoneToLocal(date, timezone, true);
  }
  let text = "";
  parts.forEach((value2) => {
    const dateFormatter = getDateFormatter(value2);
    text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
  });
  return text;
}
function createDate(year, month, date) {
  const newDate = /* @__PURE__ */ new Date(0);
  newDate.setFullYear(year, month, date);
  newDate.setHours(0, 0, 0);
  return newDate;
}
function getNamedFormat(locale, format) {
  const localeId = getLocaleId2(locale);
  NAMED_FORMATS[localeId] ??= {};
  if (NAMED_FORMATS[localeId][format]) {
    return NAMED_FORMATS[localeId][format];
  }
  let formatValue2 = "";
  switch (format) {
    case "shortDate":
      formatValue2 = getLocaleDateFormat(locale, FormatWidth.Short);
      break;
    case "mediumDate":
      formatValue2 = getLocaleDateFormat(locale, FormatWidth.Medium);
      break;
    case "longDate":
      formatValue2 = getLocaleDateFormat(locale, FormatWidth.Long);
      break;
    case "fullDate":
      formatValue2 = getLocaleDateFormat(locale, FormatWidth.Full);
      break;
    case "shortTime":
      formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Short);
      break;
    case "mediumTime":
      formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Medium);
      break;
    case "longTime":
      formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Long);
      break;
    case "fullTime":
      formatValue2 = getLocaleTimeFormat(locale, FormatWidth.Full);
      break;
    case "short":
      const shortTime = getNamedFormat(locale, "shortTime");
      const shortDate = getNamedFormat(locale, "shortDate");
      formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
      break;
    case "medium":
      const mediumTime = getNamedFormat(locale, "mediumTime");
      const mediumDate = getNamedFormat(locale, "mediumDate");
      formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
      break;
    case "long":
      const longTime = getNamedFormat(locale, "longTime");
      const longDate = getNamedFormat(locale, "longDate");
      formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
      break;
    case "full":
      const fullTime = getNamedFormat(locale, "fullTime");
      const fullDate = getNamedFormat(locale, "fullDate");
      formatValue2 = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
      break;
  }
  if (formatValue2) {
    NAMED_FORMATS[localeId][format] = formatValue2;
  }
  return formatValue2;
}
function formatDateTime(str2, opt_values) {
  if (opt_values) {
    str2 = str2.replace(/\{([^}]+)}/g, function(match2, key) {
      return opt_values != null && key in opt_values ? opt_values[key] : match2;
    });
  }
  return str2;
}
function padNumber(num, digits, minusSign = "-", trim, negWrap) {
  let neg = "";
  if (num < 0 || negWrap && num <= 0) {
    if (negWrap) {
      num = -num + 1;
    } else {
      num = -num;
      neg = minusSign;
    }
  }
  let strNum = String(num);
  while (strNum.length < digits) {
    strNum = "0" + strNum;
  }
  if (trim) {
    strNum = strNum.slice(strNum.length - digits);
  }
  return neg + strNum;
}
function formatFractionalSeconds(milliseconds, digits) {
  const strMs = padNumber(milliseconds, 3);
  return strMs.substring(0, digits);
}
function dateGetter(name, size, offset2 = 0, trim = false, negWrap = false) {
  return function(date, locale) {
    let part = getDatePart(name, date);
    if (offset2 > 0 || part > -offset2) {
      part += offset2;
    }
    if (name === DateType.Hours) {
      if (part === 0 && offset2 === -12) {
        part = 12;
      }
    } else if (name === DateType.FractionalSeconds) {
      return formatFractionalSeconds(part, size);
    }
    const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
    return padNumber(part, size, localeMinus, trim, negWrap);
  };
}
function getDatePart(part, date) {
  switch (part) {
    case DateType.FullYear:
      return date.getFullYear();
    case DateType.Month:
      return date.getMonth();
    case DateType.Date:
      return date.getDate();
    case DateType.Hours:
      return date.getHours();
    case DateType.Minutes:
      return date.getMinutes();
    case DateType.Seconds:
      return date.getSeconds();
    case DateType.FractionalSeconds:
      return date.getMilliseconds();
    case DateType.Day:
      return date.getDay();
    default:
      throw new Error(`Unknown DateType value "${part}".`);
  }
}
function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
  return function(date, locale) {
    return getDateTranslation(date, locale, name, width, form, extended);
  };
}
function getDateTranslation(date, locale, name, width, form, extended) {
  switch (name) {
    case TranslationType.Months:
      return getLocaleMonthNames(locale, form, width)[date.getMonth()];
    case TranslationType.Days:
      return getLocaleDayNames(locale, form, width)[date.getDay()];
    case TranslationType.DayPeriods:
      const currentHours = date.getHours();
      const currentMinutes = date.getMinutes();
      if (extended) {
        const rules = getLocaleExtraDayPeriodRules(locale);
        const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
        const index = rules.findIndex((rule) => {
          if (Array.isArray(rule)) {
            const [from2, to] = rule;
            const afterFrom = currentHours >= from2.hours && currentMinutes >= from2.minutes;
            const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
            if (from2.hours < to.hours) {
              if (afterFrom && beforeTo) {
                return true;
              }
            } else if (afterFrom || beforeTo) {
              return true;
            }
          } else {
            if (rule.hours === currentHours && rule.minutes === currentMinutes) {
              return true;
            }
          }
          return false;
        });
        if (index !== -1) {
          return dayPeriods[index];
        }
      }
      return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
    case TranslationType.Eras:
      return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
    default:
      const unexpected = name;
      throw new Error(`unexpected translation type ${unexpected}`);
  }
}
function timeZoneGetter(width) {
  return function(date, locale, offset2) {
    const zone = -1 * offset2;
    const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
    const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
    switch (width) {
      case ZoneWidth.Short:
        return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
      case ZoneWidth.ShortGMT:
        return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 1, minusSign);
      case ZoneWidth.Long:
        return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
      case ZoneWidth.Extended:
        if (offset2 === 0) {
          return "Z";
        } else {
          return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
        }
      default:
        throw new Error(`Unknown zone width "${width}"`);
    }
  };
}
var JANUARY = 0;
var THURSDAY = 4;
function getFirstThursdayOfYear(year) {
  const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
  return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
}
function getThursdayThisIsoWeek(datetime) {
  const currentDay = datetime.getDay();
  const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
  return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
}
function weekGetter(size, monthBased = false) {
  return function(date, locale) {
    let result;
    if (monthBased) {
      const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
      const today = date.getDate();
      result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
    } else {
      const thisThurs = getThursdayThisIsoWeek(date);
      const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
      const diff = thisThurs.getTime() - firstThurs.getTime();
      result = 1 + Math.round(diff / 6048e5);
    }
    return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  };
}
function weekNumberingYearGetter(size, trim = false) {
  return function(date, locale) {
    const thisThurs = getThursdayThisIsoWeek(date);
    const weekNumberingYear = thisThurs.getFullYear();
    return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
  };
}
var DATE_FORMATS = {};
function getDateFormatter(format) {
  if (DATE_FORMATS[format]) {
    return DATE_FORMATS[format];
  }
  let formatter;
  switch (format) {
    case "G":
    case "GG":
    case "GGG":
      formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);
      break;
    case "GGGG":
      formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);
      break;
    case "GGGGG":
      formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);
      break;
    case "y":
      formatter = dateGetter(DateType.FullYear, 1, 0, false, true);
      break;
    case "yy":
      formatter = dateGetter(DateType.FullYear, 2, 0, true, true);
      break;
    case "yyy":
      formatter = dateGetter(DateType.FullYear, 3, 0, false, true);
      break;
    case "yyyy":
      formatter = dateGetter(DateType.FullYear, 4, 0, false, true);
      break;
    case "Y":
      formatter = weekNumberingYearGetter(1);
      break;
    case "YY":
      formatter = weekNumberingYearGetter(2, true);
      break;
    case "YYY":
      formatter = weekNumberingYearGetter(3);
      break;
    case "YYYY":
      formatter = weekNumberingYearGetter(4);
      break;
    case "M":
    case "L":
      formatter = dateGetter(DateType.Month, 1, 1);
      break;
    case "MM":
    case "LL":
      formatter = dateGetter(DateType.Month, 2, 1);
      break;
    case "MMM":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);
      break;
    case "MMMM":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);
      break;
    case "MMMMM":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);
      break;
    case "LLL":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);
      break;
    case "LLLL":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);
      break;
    case "LLLLL":
      formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);
      break;
    case "w":
      formatter = weekGetter(1);
      break;
    case "ww":
      formatter = weekGetter(2);
      break;
    case "W":
      formatter = weekGetter(1, true);
      break;
    case "d":
      formatter = dateGetter(DateType.Date, 1);
      break;
    case "dd":
      formatter = dateGetter(DateType.Date, 2);
      break;
    case "c":
    case "cc":
      formatter = dateGetter(DateType.Day, 1);
      break;
    case "ccc":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated, FormStyle.Standalone);
      break;
    case "cccc":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide, FormStyle.Standalone);
      break;
    case "ccccc":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow, FormStyle.Standalone);
      break;
    case "cccccc":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short, FormStyle.Standalone);
      break;
    case "E":
    case "EE":
    case "EEE":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);
      break;
    case "EEEE":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);
      break;
    case "EEEEE":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);
      break;
    case "EEEEEE":
      formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);
      break;
    case "a":
    case "aa":
    case "aaa":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);
      break;
    case "aaaa":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);
      break;
    case "aaaaa":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);
      break;
    case "b":
    case "bb":
    case "bbb":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
      break;
    case "bbbb":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);
      break;
    case "bbbbb":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);
      break;
    case "B":
    case "BB":
    case "BBB":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);
      break;
    case "BBBB":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);
      break;
    case "BBBBB":
      formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);
      break;
    case "h":
      formatter = dateGetter(DateType.Hours, 1, -12);
      break;
    case "hh":
      formatter = dateGetter(DateType.Hours, 2, -12);
      break;
    case "H":
      formatter = dateGetter(DateType.Hours, 1);
      break;
    case "HH":
      formatter = dateGetter(DateType.Hours, 2);
      break;
    case "m":
      formatter = dateGetter(DateType.Minutes, 1);
      break;
    case "mm":
      formatter = dateGetter(DateType.Minutes, 2);
      break;
    case "s":
      formatter = dateGetter(DateType.Seconds, 1);
      break;
    case "ss":
      formatter = dateGetter(DateType.Seconds, 2);
      break;
    case "S":
      formatter = dateGetter(DateType.FractionalSeconds, 1);
      break;
    case "SS":
      formatter = dateGetter(DateType.FractionalSeconds, 2);
      break;
    case "SSS":
      formatter = dateGetter(DateType.FractionalSeconds, 3);
      break;
    case "Z":
    case "ZZ":
    case "ZZZ":
      formatter = timeZoneGetter(ZoneWidth.Short);
      break;
    case "ZZZZZ":
      formatter = timeZoneGetter(ZoneWidth.Extended);
      break;
    case "O":
    case "OO":
    case "OOO":
    case "z":
    case "zz":
    case "zzz":
      formatter = timeZoneGetter(ZoneWidth.ShortGMT);
      break;
    case "OOOO":
    case "ZZZZ":
    case "zzzz":
      formatter = timeZoneGetter(ZoneWidth.Long);
      break;
    default:
      return null;
  }
  DATE_FORMATS[format] = formatter;
  return formatter;
}
function timezoneToOffset(timezone, fallback) {
  timezone = timezone.replace(/:/g, "");
  const requestedTimezoneOffset = Date.parse("Jan 01, 1970 00:00:00 " + timezone) / 6e4;
  return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}
function addDateMinutes(date, minutes) {
  date = new Date(date.getTime());
  date.setMinutes(date.getMinutes() + minutes);
  return date;
}
function convertTimezoneToLocal(date, timezone, reverse) {
  const reverseValue = reverse ? -1 : 1;
  const dateTimezoneOffset = date.getTimezoneOffset();
  const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
  return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
}
function toDate(value) {
  if (isDate(value)) {
    return value;
  }
  if (typeof value === "number" && !isNaN(value)) {
    return new Date(value);
  }
  if (typeof value === "string") {
    value = value.trim();
    if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
      const [y, m = 1, d = 1] = value.split("-").map((val) => +val);
      return createDate(y, m - 1, d);
    }
    const parsedNb = parseFloat(value);
    if (!isNaN(value - parsedNb)) {
      return new Date(parsedNb);
    }
    let match2;
    if (match2 = value.match(ISO8601_DATE_REGEX)) {
      return isoStringToDate(match2);
    }
  }
  const date = new Date(value);
  if (!isDate(date)) {
    throw new Error(`Unable to convert "${value}" into a date`);
  }
  return date;
}
function isoStringToDate(match2) {
  const date = /* @__PURE__ */ new Date(0);
  let tzHour = 0;
  let tzMin = 0;
  const dateSetter = match2[8] ? date.setUTCFullYear : date.setFullYear;
  const timeSetter = match2[8] ? date.setUTCHours : date.setHours;
  if (match2[9]) {
    tzHour = Number(match2[9] + match2[10]);
    tzMin = Number(match2[9] + match2[11]);
  }
  dateSetter.call(date, Number(match2[1]), Number(match2[2]) - 1, Number(match2[3]));
  const h = Number(match2[4] || 0) - tzHour;
  const m = Number(match2[5] || 0) - tzMin;
  const s = Number(match2[6] || 0);
  const ms = Math.floor(parseFloat("0." + (match2[7] || 0)) * 1e3);
  timeSetter.call(date, h, m, s, ms);
  return date;
}
function isDate(value) {
  return value instanceof Date && !isNaN(value.valueOf());
}
var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
var MAX_DIGITS = 22;
var DECIMAL_SEP = ".";
var ZERO_CHAR = "0";
var PATTERN_SEP = ";";
var GROUP_SEP = ",";
var DIGIT_CHAR = "#";
var CURRENCY_CHAR = "\xA4";
var PERCENT_CHAR = "%";
function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
  let formattedText = "";
  let isZero = false;
  if (!isFinite(value)) {
    formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
  } else {
    let parsedNumber = parseNumber(value);
    if (isPercent) {
      parsedNumber = toPercent(parsedNumber);
    }
    let minInt = pattern.minInt;
    let minFraction = pattern.minFrac;
    let maxFraction = pattern.maxFrac;
    if (digitsInfo) {
      const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
      if (parts === null) {
        throw new Error(`${digitsInfo} is not a valid digit info`);
      }
      const minIntPart = parts[1];
      const minFractionPart = parts[3];
      const maxFractionPart = parts[5];
      if (minIntPart != null) {
        minInt = parseIntAutoRadix(minIntPart);
      }
      if (minFractionPart != null) {
        minFraction = parseIntAutoRadix(minFractionPart);
      }
      if (maxFractionPart != null) {
        maxFraction = parseIntAutoRadix(maxFractionPart);
      } else if (minFractionPart != null && minFraction > maxFraction) {
        maxFraction = minFraction;
      }
    }
    roundNumber(parsedNumber, minFraction, maxFraction);
    let digits = parsedNumber.digits;
    let integerLen = parsedNumber.integerLen;
    const exponent = parsedNumber.exponent;
    let decimals = [];
    isZero = digits.every((d) => !d);
    for (; integerLen < minInt; integerLen++) {
      digits.unshift(0);
    }
    for (; integerLen < 0; integerLen++) {
      digits.unshift(0);
    }
    if (integerLen > 0) {
      decimals = digits.splice(integerLen, digits.length);
    } else {
      decimals = digits;
      digits = [0];
    }
    const groups = [];
    if (digits.length >= pattern.lgSize) {
      groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(""));
    }
    while (digits.length > pattern.gSize) {
      groups.unshift(digits.splice(-pattern.gSize, digits.length).join(""));
    }
    if (digits.length) {
      groups.unshift(digits.join(""));
    }
    formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
    if (decimals.length) {
      formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join("");
    }
    if (exponent) {
      formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + "+" + exponent;
    }
  }
  if (value < 0 && !isZero) {
    formattedText = pattern.negPre + formattedText + pattern.negSuf;
  } else {
    formattedText = pattern.posPre + formattedText + pattern.posSuf;
  }
  return formattedText;
}
function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
  const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
  const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
  pattern.maxFrac = pattern.minFrac;
  const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
  return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, "").trim();
}
function formatPercent(value, locale, digitsInfo) {
  const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
  const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
  return res.replace(new RegExp(PERCENT_CHAR, "g"), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
}
function formatNumber(value, locale, digitsInfo) {
  const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
  const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
  return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
}
function parseNumberFormat(format, minusSign = "-") {
  const p = {
    minInt: 1,
    minFrac: 0,
    maxFrac: 0,
    posPre: "",
    posSuf: "",
    negPre: "",
    negSuf: "",
    gSize: 0,
    lgSize: 0
  };
  const patternParts = format.split(PATTERN_SEP);
  const positive = patternParts[0];
  const negative = patternParts[1];
  const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || "";
  p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
  for (let i2 = 0; i2 < fraction.length; i2++) {
    const ch = fraction.charAt(i2);
    if (ch === ZERO_CHAR) {
      p.minFrac = p.maxFrac = i2 + 1;
    } else if (ch === DIGIT_CHAR) {
      p.maxFrac = i2 + 1;
    } else {
      p.posSuf += ch;
    }
  }
  const groups = integer.split(GROUP_SEP);
  p.gSize = groups[1] ? groups[1].length : 0;
  p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
  if (negative) {
    const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
    p.negPre = negative.substring(0, pos).replace(/'/g, "");
    p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, "");
  } else {
    p.negPre = minusSign + p.posPre;
    p.negSuf = p.posSuf;
  }
  return p;
}
function toPercent(parsedNumber) {
  if (parsedNumber.digits[0] === 0) {
    return parsedNumber;
  }
  const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
  if (parsedNumber.exponent) {
    parsedNumber.exponent += 2;
  } else {
    if (fractionLen === 0) {
      parsedNumber.digits.push(0, 0);
    } else if (fractionLen === 1) {
      parsedNumber.digits.push(0);
    }
    parsedNumber.integerLen += 2;
  }
  return parsedNumber;
}
function parseNumber(num) {
  let numStr = Math.abs(num) + "";
  let exponent = 0, digits, integerLen;
  let i2, j, zeros;
  if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
    numStr = numStr.replace(DECIMAL_SEP, "");
  }
  if ((i2 = numStr.search(/e/i)) > 0) {
    if (integerLen < 0) integerLen = i2;
    integerLen += +numStr.slice(i2 + 1);
    numStr = numStr.substring(0, i2);
  } else if (integerLen < 0) {
    integerLen = numStr.length;
  }
  for (i2 = 0; numStr.charAt(i2) === ZERO_CHAR; i2++) {
  }
  if (i2 === (zeros = numStr.length)) {
    digits = [0];
    integerLen = 1;
  } else {
    zeros--;
    while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
    integerLen -= i2;
    digits = [];
    for (j = 0; i2 <= zeros; i2++, j++) {
      digits[j] = Number(numStr.charAt(i2));
    }
  }
  if (integerLen > MAX_DIGITS) {
    digits = digits.splice(0, MAX_DIGITS - 1);
    exponent = integerLen - 1;
    integerLen = 1;
  }
  return {
    digits,
    exponent,
    integerLen
  };
}
function roundNumber(parsedNumber, minFrac, maxFrac) {
  if (minFrac > maxFrac) {
    throw new Error(`The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
  }
  let digits = parsedNumber.digits;
  let fractionLen = digits.length - parsedNumber.integerLen;
  const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
  let roundAt = fractionSize + parsedNumber.integerLen;
  let digit = digits[roundAt];
  if (roundAt > 0) {
    digits.splice(Math.max(parsedNumber.integerLen, roundAt));
    for (let j = roundAt; j < digits.length; j++) {
      digits[j] = 0;
    }
  } else {
    fractionLen = Math.max(0, fractionLen);
    parsedNumber.integerLen = 1;
    digits.length = Math.max(1, roundAt = fractionSize + 1);
    digits[0] = 0;
    for (let i2 = 1; i2 < roundAt; i2++) digits[i2] = 0;
  }
  if (digit >= 5) {
    if (roundAt - 1 < 0) {
      for (let k = 0; k > roundAt; k--) {
        digits.unshift(0);
        parsedNumber.integerLen++;
      }
      digits.unshift(1);
      parsedNumber.integerLen++;
    } else {
      digits[roundAt - 1]++;
    }
  }
  for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
  let dropTrailingZeros = fractionSize !== 0;
  const minLen = minFrac + parsedNumber.integerLen;
  const carry = digits.reduceRight(function(carry2, d, i2, digits2) {
    d = d + carry2;
    digits2[i2] = d < 10 ? d : d - 10;
    if (dropTrailingZeros) {
      if (digits2[i2] === 0 && i2 >= minLen) {
        digits2.pop();
      } else {
        dropTrailingZeros = false;
      }
    }
    return d >= 10 ? 1 : 0;
  }, 0);
  if (carry) {
    digits.unshift(carry);
    parsedNumber.integerLen++;
  }
}
function parseIntAutoRadix(text) {
  const result = parseInt(text);
  if (isNaN(result)) {
    throw new Error("Invalid integer literal when parsing " + text);
  }
  return result;
}
var _NgLocalization = class _NgLocalization {
};
_NgLocalization.\u0275fac = function NgLocalization_Factory(t) {
  return new (t || _NgLocalization)();
};
_NgLocalization.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NgLocalization,
  factory: function NgLocalization_Factory(t) {
    let r = null;
    if (t) {
      r = new t();
    } else {
      r = ((locale) => new NgLocaleLocalization(locale))(\u0275\u0275inject(LOCALE_ID));
    }
    return r;
  },
  providedIn: "root"
});
var NgLocalization = _NgLocalization;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocalization, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      useFactory: (locale) => new NgLocaleLocalization(locale),
      deps: [LOCALE_ID]
    }]
  }], null, null);
})();
function getPluralCategory(value, cases, ngLocalization, locale) {
  let key = `=${value}`;
  if (cases.indexOf(key) > -1) {
    return key;
  }
  key = ngLocalization.getPluralCategory(value, locale);
  if (cases.indexOf(key) > -1) {
    return key;
  }
  if (cases.indexOf("other") > -1) {
    return "other";
  }
  throw new Error(`No plural message found for value "${value}"`);
}
var _NgLocaleLocalization = class _NgLocaleLocalization extends NgLocalization {
  constructor(locale) {
    super();
    this.locale = locale;
  }
  getPluralCategory(value, locale) {
    const plural2 = getLocalePluralCase2(locale || this.locale)(value);
    switch (plural2) {
      case Plural.Zero:
        return "zero";
      case Plural.One:
        return "one";
      case Plural.Two:
        return "two";
      case Plural.Few:
        return "few";
      case Plural.Many:
        return "many";
      default:
        return "other";
    }
  }
};
_NgLocaleLocalization.\u0275fac = function NgLocaleLocalization_Factory(t) {
  return new (t || _NgLocaleLocalization)(\u0275\u0275inject(LOCALE_ID));
};
_NgLocaleLocalization.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NgLocaleLocalization,
  factory: _NgLocaleLocalization.\u0275fac
});
var NgLocaleLocalization = _NgLocaleLocalization;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocaleLocalization, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [LOCALE_ID]
    }]
  }], null);
})();
function parseCookieValue(cookieStr, name) {
  name = encodeURIComponent(name);
  for (const cookie of cookieStr.split(";")) {
    const eqIndex = cookie.indexOf("=");
    const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ""] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
    if (cookieName.trim() === name) {
      return decodeURIComponent(cookieValue);
    }
  }
  return null;
}
var WS_REGEXP = /\s+/;
var EMPTY_ARRAY2 = [];
var _NgClass = class _NgClass {
  constructor(_ngEl, _renderer) {
    this._ngEl = _ngEl;
    this._renderer = _renderer;
    this.initialClasses = EMPTY_ARRAY2;
    this.stateMap = /* @__PURE__ */ new Map();
  }
  set klass(value) {
    this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY2;
  }
  set ngClass(value) {
    this.rawClass = typeof value === "string" ? value.trim().split(WS_REGEXP) : value;
  }
  /*
  The NgClass directive uses the custom change detection algorithm for its inputs. The custom
  algorithm is necessary since inputs are represented as complex object or arrays that need to be
  deeply-compared.
     This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance
  might negatively impact runtime performance of the entire change detection cycle. The design of
  this algorithm is making sure that:
  - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when
  needed), even if references to bound objects change;
  - there is no memory allocation if nothing changes (even relatively modest memory allocation
  during the change detection cycle can result in GC pauses for some of the CD cycles).
     The algorithm works by iterating over the set of bound classes, staring with [class] binding and
  then going over [ngClass] binding. For each CSS class name:
  - check if it was seen before (this information is tracked in the state map) and if its value
  changed;
  - mark it as "touched" - names that are not marked are not present in the latest set of binding
  and we can remove such class name from the internal data structures;
     After iteration over all the CSS class names we've got data structure with all the information
  necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush
  changes to the DOM and reset internal data structures so those are ready for the next change
  detection cycle.
   */
  ngDoCheck() {
    for (const klass of this.initialClasses) {
      this._updateState(klass, true);
    }
    const rawClass = this.rawClass;
    if (Array.isArray(rawClass) || rawClass instanceof Set) {
      for (const klass of rawClass) {
        this._updateState(klass, true);
      }
    } else if (rawClass != null) {
      for (const klass of Object.keys(rawClass)) {
        this._updateState(klass, Boolean(rawClass[klass]));
      }
    }
    this._applyStateDiff();
  }
  _updateState(klass, nextEnabled) {
    const state2 = this.stateMap.get(klass);
    if (state2 !== void 0) {
      if (state2.enabled !== nextEnabled) {
        state2.changed = true;
        state2.enabled = nextEnabled;
      }
      state2.touched = true;
    } else {
      this.stateMap.set(klass, {
        enabled: nextEnabled,
        changed: true,
        touched: true
      });
    }
  }
  _applyStateDiff() {
    for (const stateEntry of this.stateMap) {
      const klass = stateEntry[0];
      const state2 = stateEntry[1];
      if (state2.changed) {
        this._toggleClass(klass, state2.enabled);
        state2.changed = false;
      } else if (!state2.touched) {
        if (state2.enabled) {
          this._toggleClass(klass, false);
        }
        this.stateMap.delete(klass);
      }
      state2.touched = false;
    }
  }
  _toggleClass(klass, enabled) {
    if (ngDevMode) {
      if (typeof klass !== "string") {
        throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
      }
    }
    klass = klass.trim();
    if (klass.length > 0) {
      klass.split(WS_REGEXP).forEach((klass2) => {
        if (enabled) {
          this._renderer.addClass(this._ngEl.nativeElement, klass2);
        } else {
          this._renderer.removeClass(this._ngEl.nativeElement, klass2);
        }
      });
    }
  }
};
_NgClass.\u0275fac = function NgClass_Factory(t) {
  return new (t || _NgClass)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2));
};
_NgClass.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgClass,
  selectors: [["", "ngClass", ""]],
  inputs: {
    klass: [0, "class", "klass"],
    ngClass: "ngClass"
  },
  standalone: true
});
var NgClass = _NgClass;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgClass, [{
    type: Directive,
    args: [{
      selector: "[ngClass]",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Renderer2
  }], {
    klass: [{
      type: Input,
      args: ["class"]
    }],
    ngClass: [{
      type: Input,
      args: ["ngClass"]
    }]
  });
})();
var _NgComponentOutlet = class _NgComponentOutlet {
  constructor(_viewContainerRef) {
    this._viewContainerRef = _viewContainerRef;
    this.ngComponentOutlet = null;
    this._inputsUsed = /* @__PURE__ */ new Map();
  }
  _needToReCreateNgModuleInstance(changes) {
    return changes["ngComponentOutletNgModule"] !== void 0 || changes["ngComponentOutletNgModuleFactory"] !== void 0;
  }
  _needToReCreateComponentInstance(changes) {
    return changes["ngComponentOutlet"] !== void 0 || changes["ngComponentOutletContent"] !== void 0 || changes["ngComponentOutletInjector"] !== void 0 || this._needToReCreateNgModuleInstance(changes);
  }
  /** @nodoc */
  ngOnChanges(changes) {
    if (this._needToReCreateComponentInstance(changes)) {
      this._viewContainerRef.clear();
      this._inputsUsed.clear();
      this._componentRef = void 0;
      if (this.ngComponentOutlet) {
        const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
        if (this._needToReCreateNgModuleInstance(changes)) {
          this._moduleRef?.destroy();
          if (this.ngComponentOutletNgModule) {
            this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
          } else if (this.ngComponentOutletNgModuleFactory) {
            this._moduleRef = this.ngComponentOutletNgModuleFactory.create(getParentInjector(injector));
          } else {
            this._moduleRef = void 0;
          }
        }
        this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
          injector,
          ngModuleRef: this._moduleRef,
          projectableNodes: this.ngComponentOutletContent
        });
      }
    }
  }
  /** @nodoc */
  ngDoCheck() {
    if (this._componentRef) {
      if (this.ngComponentOutletInputs) {
        for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
          this._inputsUsed.set(inputName, true);
        }
      }
      this._applyInputStateDiff(this._componentRef);
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    this._moduleRef?.destroy();
  }
  _applyInputStateDiff(componentRef) {
    for (const [inputName, touched] of this._inputsUsed) {
      if (!touched) {
        componentRef.setInput(inputName, void 0);
        this._inputsUsed.delete(inputName);
      } else {
        componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
        this._inputsUsed.set(inputName, false);
      }
    }
  }
};
_NgComponentOutlet.\u0275fac = function NgComponentOutlet_Factory(t) {
  return new (t || _NgComponentOutlet)(\u0275\u0275directiveInject(ViewContainerRef));
};
_NgComponentOutlet.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgComponentOutlet,
  selectors: [["", "ngComponentOutlet", ""]],
  inputs: {
    ngComponentOutlet: "ngComponentOutlet",
    ngComponentOutletInputs: "ngComponentOutletInputs",
    ngComponentOutletInjector: "ngComponentOutletInjector",
    ngComponentOutletContent: "ngComponentOutletContent",
    ngComponentOutletNgModule: "ngComponentOutletNgModule",
    ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory"
  },
  standalone: true,
  features: [\u0275\u0275NgOnChangesFeature]
});
var NgComponentOutlet = _NgComponentOutlet;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgComponentOutlet, [{
    type: Directive,
    args: [{
      selector: "[ngComponentOutlet]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }], {
    ngComponentOutlet: [{
      type: Input
    }],
    ngComponentOutletInputs: [{
      type: Input
    }],
    ngComponentOutletInjector: [{
      type: Input
    }],
    ngComponentOutletContent: [{
      type: Input
    }],
    ngComponentOutletNgModule: [{
      type: Input
    }],
    ngComponentOutletNgModuleFactory: [{
      type: Input
    }]
  });
})();
function getParentInjector(injector) {
  const parentNgModule = injector.get(NgModuleRef$1);
  return parentNgModule.injector;
}
var NgForOfContext = class {
  constructor($implicit, ngForOf, index, count) {
    this.$implicit = $implicit;
    this.ngForOf = ngForOf;
    this.index = index;
    this.count = count;
  }
  get first() {
    return this.index === 0;
  }
  get last() {
    return this.index === this.count - 1;
  }
  get even() {
    return this.index % 2 === 0;
  }
  get odd() {
    return !this.even;
  }
};
var _NgForOf = class _NgForOf {
  /**
   * The value of the iterable expression, which can be used as a
   * [template input variable](guide/directives/structural-directives#shorthand).
   */
  set ngForOf(ngForOf) {
    this._ngForOf = ngForOf;
    this._ngForOfDirty = true;
  }
  /**
   * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
   *
   * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
   * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
   * as the key.
   *
   * `NgForOf` uses the computed key to associate items in an iterable with DOM elements
   * it produces for these items.
   *
   * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
   * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
   * primary key), and this iterable could be updated with new object instances that still
   * represent the same underlying entity (for example, when data is re-fetched from the server,
   * and the iterable is recreated and re-rendered, but most of the data is still the same).
   *
   * @see {@link TrackByFunction}
   */
  set ngForTrackBy(fn) {
    if ((typeof ngDevMode === "undefined" || ngDevMode) && fn != null && typeof fn !== "function") {
      console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. See https://angular.io/api/common/NgForOf#change-propagation for more information.`);
    }
    this._trackByFn = fn;
  }
  get ngForTrackBy() {
    return this._trackByFn;
  }
  constructor(_viewContainer, _template, _differs) {
    this._viewContainer = _viewContainer;
    this._template = _template;
    this._differs = _differs;
    this._ngForOf = null;
    this._ngForOfDirty = true;
    this._differ = null;
  }
  /**
   * A reference to the template that is stamped out for each item in the iterable.
   * @see [template reference variable](guide/templates/reference-variables)
   */
  set ngForTemplate(value) {
    if (value) {
      this._template = value;
    }
  }
  /**
   * Applies the changes when needed.
   * @nodoc
   */
  ngDoCheck() {
    if (this._ngForOfDirty) {
      this._ngForOfDirty = false;
      const value = this._ngForOf;
      if (!this._differ && value) {
        if (typeof ngDevMode === "undefined" || ngDevMode) {
          try {
            this._differ = this._differs.find(value).create(this.ngForTrackBy);
          } catch {
            let errorMessage = `Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
            if (typeof value === "object") {
              errorMessage += " Did you mean to use the keyvalue pipe?";
            }
            throw new RuntimeError(-2200, errorMessage);
          }
        } else {
          this._differ = this._differs.find(value).create(this.ngForTrackBy);
        }
      }
    }
    if (this._differ) {
      const changes = this._differ.diff(this._ngForOf);
      if (changes) this._applyChanges(changes);
    }
  }
  _applyChanges(changes) {
    const viewContainer = this._viewContainer;
    changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
      if (item.previousIndex == null) {
        viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? void 0 : currentIndex);
      } else if (currentIndex == null) {
        viewContainer.remove(adjustedPreviousIndex === null ? void 0 : adjustedPreviousIndex);
      } else if (adjustedPreviousIndex !== null) {
        const view = viewContainer.get(adjustedPreviousIndex);
        viewContainer.move(view, currentIndex);
        applyViewChange(view, item);
      }
    });
    for (let i2 = 0, ilen = viewContainer.length; i2 < ilen; i2++) {
      const viewRef = viewContainer.get(i2);
      const context2 = viewRef.context;
      context2.index = i2;
      context2.count = ilen;
      context2.ngForOf = this._ngForOf;
    }
    changes.forEachIdentityChange((record) => {
      const viewRef = viewContainer.get(record.currentIndex);
      applyViewChange(viewRef, record);
    });
  }
  /**
   * Asserts the correct type of the context for the template that `NgForOf` will render.
   *
   * The presence of this method is a signal to the Ivy template type-check compiler that the
   * `NgForOf` structural directive renders its template with a specific context type.
   */
  static ngTemplateContextGuard(dir, ctx) {
    return true;
  }
};
_NgForOf.\u0275fac = function NgForOf_Factory(t) {
  return new (t || _NgForOf)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(IterableDiffers));
};
_NgForOf.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgForOf,
  selectors: [["", "ngFor", "", "ngForOf", ""]],
  inputs: {
    ngForOf: "ngForOf",
    ngForTrackBy: "ngForTrackBy",
    ngForTemplate: "ngForTemplate"
  },
  standalone: true
});
var NgForOf = _NgForOf;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForOf, [{
    type: Directive,
    args: [{
      selector: "[ngFor][ngForOf]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }, {
    type: TemplateRef
  }, {
    type: IterableDiffers
  }], {
    ngForOf: [{
      type: Input
    }],
    ngForTrackBy: [{
      type: Input
    }],
    ngForTemplate: [{
      type: Input
    }]
  });
})();
function applyViewChange(view, record) {
  view.context.$implicit = record.item;
}
function getTypeName(type) {
  return type["name"] || typeof type;
}
var _NgIf = class _NgIf {
  constructor(_viewContainer, templateRef) {
    this._viewContainer = _viewContainer;
    this._context = new NgIfContext();
    this._thenTemplateRef = null;
    this._elseTemplateRef = null;
    this._thenViewRef = null;
    this._elseViewRef = null;
    this._thenTemplateRef = templateRef;
  }
  /**
   * The Boolean expression to evaluate as the condition for showing a template.
   */
  set ngIf(condition) {
    this._context.$implicit = this._context.ngIf = condition;
    this._updateView();
  }
  /**
   * A template to show if the condition expression evaluates to true.
   */
  set ngIfThen(templateRef) {
    assertTemplate("ngIfThen", templateRef);
    this._thenTemplateRef = templateRef;
    this._thenViewRef = null;
    this._updateView();
  }
  /**
   * A template to show if the condition expression evaluates to false.
   */
  set ngIfElse(templateRef) {
    assertTemplate("ngIfElse", templateRef);
    this._elseTemplateRef = templateRef;
    this._elseViewRef = null;
    this._updateView();
  }
  _updateView() {
    if (this._context.$implicit) {
      if (!this._thenViewRef) {
        this._viewContainer.clear();
        this._elseViewRef = null;
        if (this._thenTemplateRef) {
          this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
        }
      }
    } else {
      if (!this._elseViewRef) {
        this._viewContainer.clear();
        this._thenViewRef = null;
        if (this._elseTemplateRef) {
          this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
        }
      }
    }
  }
  /**
   * Asserts the correct type of the context for the template that `NgIf` will render.
   *
   * The presence of this method is a signal to the Ivy template type-check compiler that the
   * `NgIf` structural directive renders its template with a specific context type.
   */
  static ngTemplateContextGuard(dir, ctx) {
    return true;
  }
};
_NgIf.\u0275fac = function NgIf_Factory(t) {
  return new (t || _NgIf)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef));
};
_NgIf.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgIf,
  selectors: [["", "ngIf", ""]],
  inputs: {
    ngIf: "ngIf",
    ngIfThen: "ngIfThen",
    ngIfElse: "ngIfElse"
  },
  standalone: true
});
var NgIf = _NgIf;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgIf, [{
    type: Directive,
    args: [{
      selector: "[ngIf]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }, {
    type: TemplateRef
  }], {
    ngIf: [{
      type: Input
    }],
    ngIfThen: [{
      type: Input
    }],
    ngIfElse: [{
      type: Input
    }]
  });
})();
var NgIfContext = class {
  constructor() {
    this.$implicit = null;
    this.ngIf = null;
  }
};
function assertTemplate(property, templateRef) {
  const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);
  if (!isTemplateRefOrNull) {
    throw new Error(`${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);
  }
}
var NG_SWITCH_USE_STRICT_EQUALS = true;
var SwitchView = class {
  constructor(_viewContainerRef, _templateRef) {
    this._viewContainerRef = _viewContainerRef;
    this._templateRef = _templateRef;
    this._created = false;
  }
  create() {
    this._created = true;
    this._viewContainerRef.createEmbeddedView(this._templateRef);
  }
  destroy() {
    this._created = false;
    this._viewContainerRef.clear();
  }
  enforceState(created) {
    if (created && !this._created) {
      this.create();
    } else if (!created && this._created) {
      this.destroy();
    }
  }
};
var _NgSwitch = class _NgSwitch {
  constructor() {
    this._defaultViews = [];
    this._defaultUsed = false;
    this._caseCount = 0;
    this._lastCaseCheckIndex = 0;
    this._lastCasesMatched = false;
  }
  set ngSwitch(newValue) {
    this._ngSwitch = newValue;
    if (this._caseCount === 0) {
      this._updateDefaultCases(true);
    }
  }
  /** @internal */
  _addCase() {
    return this._caseCount++;
  }
  /** @internal */
  _addDefault(view) {
    this._defaultViews.push(view);
  }
  /** @internal */
  _matchCase(value) {
    const matched = NG_SWITCH_USE_STRICT_EQUALS ? value === this._ngSwitch : value == this._ngSwitch;
    if ((typeof ngDevMode === "undefined" || ngDevMode) && matched !== (value == this._ngSwitch)) {
      console.warn(formatRuntimeError(2001, `As of Angular v17 the NgSwitch directive uses strict equality comparison === instead of == to match different cases. Previously the case value "${stringifyValue(value)}" matched switch expression value "${stringifyValue(this._ngSwitch)}", but this is no longer the case with the stricter equality check. Your comparison results return different results using === vs. == and you should adjust your ngSwitch expression and / or values to conform with the strict equality requirements.`));
    }
    this._lastCasesMatched ||= matched;
    this._lastCaseCheckIndex++;
    if (this._lastCaseCheckIndex === this._caseCount) {
      this._updateDefaultCases(!this._lastCasesMatched);
      this._lastCaseCheckIndex = 0;
      this._lastCasesMatched = false;
    }
    return matched;
  }
  _updateDefaultCases(useDefault) {
    if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
      this._defaultUsed = useDefault;
      for (const defaultView of this._defaultViews) {
        defaultView.enforceState(useDefault);
      }
    }
  }
};
_NgSwitch.\u0275fac = function NgSwitch_Factory(t) {
  return new (t || _NgSwitch)();
};
_NgSwitch.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgSwitch,
  selectors: [["", "ngSwitch", ""]],
  inputs: {
    ngSwitch: "ngSwitch"
  },
  standalone: true
});
var NgSwitch = _NgSwitch;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitch, [{
    type: Directive,
    args: [{
      selector: "[ngSwitch]",
      standalone: true
    }]
  }], null, {
    ngSwitch: [{
      type: Input
    }]
  });
})();
var _NgSwitchCase = class _NgSwitchCase {
  constructor(viewContainer, templateRef, ngSwitch) {
    this.ngSwitch = ngSwitch;
    if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
      throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
    }
    ngSwitch._addCase();
    this._view = new SwitchView(viewContainer, templateRef);
  }
  /**
   * Performs case matching. For internal use only.
   * @nodoc
   */
  ngDoCheck() {
    this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
  }
};
_NgSwitchCase.\u0275fac = function NgSwitchCase_Factory(t) {
  return new (t || _NgSwitchCase)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(NgSwitch, 9));
};
_NgSwitchCase.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgSwitchCase,
  selectors: [["", "ngSwitchCase", ""]],
  inputs: {
    ngSwitchCase: "ngSwitchCase"
  },
  standalone: true
});
var NgSwitchCase = _NgSwitchCase;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchCase, [{
    type: Directive,
    args: [{
      selector: "[ngSwitchCase]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }, {
    type: TemplateRef
  }, {
    type: NgSwitch,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }]
  }], {
    ngSwitchCase: [{
      type: Input
    }]
  });
})();
var _NgSwitchDefault = class _NgSwitchDefault {
  constructor(viewContainer, templateRef, ngSwitch) {
    if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
      throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
    }
    ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
  }
};
_NgSwitchDefault.\u0275fac = function NgSwitchDefault_Factory(t) {
  return new (t || _NgSwitchDefault)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(NgSwitch, 9));
};
_NgSwitchDefault.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgSwitchDefault,
  selectors: [["", "ngSwitchDefault", ""]],
  standalone: true
});
var NgSwitchDefault = _NgSwitchDefault;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchDefault, [{
    type: Directive,
    args: [{
      selector: "[ngSwitchDefault]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }, {
    type: TemplateRef
  }, {
    type: NgSwitch,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }]
  }], null);
})();
function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
  throw new RuntimeError(2e3, `An element with the "${attrName}" attribute (matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute (matching "NgSwitch" directive)`);
}
function stringifyValue(value) {
  return typeof value === "string" ? `'${value}'` : String(value);
}
var _NgPlural = class _NgPlural {
  constructor(_localization) {
    this._localization = _localization;
    this._caseViews = {};
  }
  set ngPlural(value) {
    this._updateView(value);
  }
  addCase(value, switchView) {
    this._caseViews[value] = switchView;
  }
  _updateView(switchValue) {
    this._clearViews();
    const cases = Object.keys(this._caseViews);
    const key = getPluralCategory(switchValue, cases, this._localization);
    this._activateView(this._caseViews[key]);
  }
  _clearViews() {
    if (this._activeView) this._activeView.destroy();
  }
  _activateView(view) {
    if (view) {
      this._activeView = view;
      this._activeView.create();
    }
  }
};
_NgPlural.\u0275fac = function NgPlural_Factory(t) {
  return new (t || _NgPlural)(\u0275\u0275directiveInject(NgLocalization));
};
_NgPlural.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgPlural,
  selectors: [["", "ngPlural", ""]],
  inputs: {
    ngPlural: "ngPlural"
  },
  standalone: true
});
var NgPlural = _NgPlural;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPlural, [{
    type: Directive,
    args: [{
      selector: "[ngPlural]",
      standalone: true
    }]
  }], () => [{
    type: NgLocalization
  }], {
    ngPlural: [{
      type: Input
    }]
  });
})();
var _NgPluralCase = class _NgPluralCase {
  constructor(value, template, viewContainer, ngPlural) {
    this.value = value;
    const isANumber = !isNaN(Number(value));
    ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
  }
};
_NgPluralCase.\u0275fac = function NgPluralCase_Factory(t) {
  return new (t || _NgPluralCase)(\u0275\u0275injectAttribute("ngPluralCase"), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(NgPlural, 1));
};
_NgPluralCase.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgPluralCase,
  selectors: [["", "ngPluralCase", ""]],
  standalone: true
});
var NgPluralCase = _NgPluralCase;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPluralCase, [{
    type: Directive,
    args: [{
      selector: "[ngPluralCase]",
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Attribute,
      args: ["ngPluralCase"]
    }]
  }, {
    type: TemplateRef
  }, {
    type: ViewContainerRef
  }, {
    type: NgPlural,
    decorators: [{
      type: Host
    }]
  }], null);
})();
var _NgStyle = class _NgStyle {
  constructor(_ngEl, _differs, _renderer) {
    this._ngEl = _ngEl;
    this._differs = _differs;
    this._renderer = _renderer;
    this._ngStyle = null;
    this._differ = null;
  }
  set ngStyle(values) {
    this._ngStyle = values;
    if (!this._differ && values) {
      this._differ = this._differs.find(values).create();
    }
  }
  ngDoCheck() {
    if (this._differ) {
      const changes = this._differ.diff(this._ngStyle);
      if (changes) {
        this._applyChanges(changes);
      }
    }
  }
  _setStyle(nameAndUnit, value) {
    const [name, unit] = nameAndUnit.split(".");
    const flags = name.indexOf("-") === -1 ? void 0 : RendererStyleFlags2.DashCase;
    if (value != null) {
      this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
    } else {
      this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
    }
  }
  _applyChanges(changes) {
    changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
    changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
    changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
  }
};
_NgStyle.\u0275fac = function NgStyle_Factory(t) {
  return new (t || _NgStyle)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(KeyValueDiffers), \u0275\u0275directiveInject(Renderer2));
};
_NgStyle.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgStyle,
  selectors: [["", "ngStyle", ""]],
  inputs: {
    ngStyle: "ngStyle"
  },
  standalone: true
});
var NgStyle = _NgStyle;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgStyle, [{
    type: Directive,
    args: [{
      selector: "[ngStyle]",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: KeyValueDiffers
  }, {
    type: Renderer2
  }], {
    ngStyle: [{
      type: Input,
      args: ["ngStyle"]
    }]
  });
})();
var _NgTemplateOutlet = class _NgTemplateOutlet {
  constructor(_viewContainerRef) {
    this._viewContainerRef = _viewContainerRef;
    this._viewRef = null;
    this.ngTemplateOutletContext = null;
    this.ngTemplateOutlet = null;
    this.ngTemplateOutletInjector = null;
  }
  ngOnChanges(changes) {
    if (this._shouldRecreateView(changes)) {
      const viewContainerRef = this._viewContainerRef;
      if (this._viewRef) {
        viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
      }
      if (!this.ngTemplateOutlet) {
        this._viewRef = null;
        return;
      }
      const viewContext = this._createContextForwardProxy();
      this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
        injector: this.ngTemplateOutletInjector ?? void 0
      });
    }
  }
  /**
   * We need to re-create existing embedded view if either is true:
   * - the outlet changed.
   * - the injector changed.
   */
  _shouldRecreateView(changes) {
    return !!changes["ngTemplateOutlet"] || !!changes["ngTemplateOutletInjector"];
  }
  /**
   * For a given outlet instance, we create a proxy object that delegates
   * to the user-specified context. This allows changing, or swapping out
   * the context object completely without having to destroy/re-create the view.
   */
  _createContextForwardProxy() {
    return new Proxy({}, {
      set: (_target, prop, newValue) => {
        if (!this.ngTemplateOutletContext) {
          return false;
        }
        return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
      },
      get: (_target, prop, receiver) => {
        if (!this.ngTemplateOutletContext) {
          return void 0;
        }
        return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
      }
    });
  }
};
_NgTemplateOutlet.\u0275fac = function NgTemplateOutlet_Factory(t) {
  return new (t || _NgTemplateOutlet)(\u0275\u0275directiveInject(ViewContainerRef));
};
_NgTemplateOutlet.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgTemplateOutlet,
  selectors: [["", "ngTemplateOutlet", ""]],
  inputs: {
    ngTemplateOutletContext: "ngTemplateOutletContext",
    ngTemplateOutlet: "ngTemplateOutlet",
    ngTemplateOutletInjector: "ngTemplateOutletInjector"
  },
  standalone: true,
  features: [\u0275\u0275NgOnChangesFeature]
});
var NgTemplateOutlet = _NgTemplateOutlet;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTemplateOutlet, [{
    type: Directive,
    args: [{
      selector: "[ngTemplateOutlet]",
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }], {
    ngTemplateOutletContext: [{
      type: Input
    }],
    ngTemplateOutlet: [{
      type: Input
    }],
    ngTemplateOutletInjector: [{
      type: Input
    }]
  });
})();
var COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
function invalidPipeArgumentError(type, value) {
  return new RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);
}
var SubscribableStrategy = class {
  createSubscription(async2, updateLatestValue) {
    return untracked(() => async2.subscribe({
      next: updateLatestValue,
      error: (e) => {
        throw e;
      }
    }));
  }
  dispose(subscription) {
    untracked(() => subscription.unsubscribe());
  }
};
var PromiseStrategy = class {
  createSubscription(async2, updateLatestValue) {
    return async2.then(updateLatestValue, (e) => {
      throw e;
    });
  }
  dispose(subscription) {
  }
};
var _promiseStrategy = new PromiseStrategy();
var _subscribableStrategy = new SubscribableStrategy();
var _AsyncPipe = class _AsyncPipe {
  constructor(ref) {
    this._latestValue = null;
    this.markForCheckOnValueUpdate = true;
    this._subscription = null;
    this._obj = null;
    this._strategy = null;
    this._ref = ref;
  }
  ngOnDestroy() {
    if (this._subscription) {
      this._dispose();
    }
    this._ref = null;
  }
  transform(obj) {
    if (!this._obj) {
      if (obj) {
        try {
          this.markForCheckOnValueUpdate = false;
          this._subscribe(obj);
        } finally {
          this.markForCheckOnValueUpdate = true;
        }
      }
      return this._latestValue;
    }
    if (obj !== this._obj) {
      this._dispose();
      return this.transform(obj);
    }
    return this._latestValue;
  }
  _subscribe(obj) {
    this._obj = obj;
    this._strategy = this._selectStrategy(obj);
    this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value));
  }
  _selectStrategy(obj) {
    if (isPromise2(obj)) {
      return _promiseStrategy;
    }
    if (isSubscribable(obj)) {
      return _subscribableStrategy;
    }
    throw invalidPipeArgumentError(_AsyncPipe, obj);
  }
  _dispose() {
    this._strategy.dispose(this._subscription);
    this._latestValue = null;
    this._subscription = null;
    this._obj = null;
  }
  _updateLatestValue(async2, value) {
    if (async2 === this._obj) {
      this._latestValue = value;
      if (this.markForCheckOnValueUpdate) {
        this._ref?.markForCheck();
      }
    }
  }
};
_AsyncPipe.\u0275fac = function AsyncPipe_Factory(t) {
  return new (t || _AsyncPipe)(\u0275\u0275directiveInject(ChangeDetectorRef, 16));
};
_AsyncPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "async",
  type: _AsyncPipe,
  pure: false,
  standalone: true
});
var AsyncPipe = _AsyncPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AsyncPipe, [{
    type: Pipe,
    args: [{
      name: "async",
      pure: false,
      standalone: true
    }]
  }], () => [{
    type: ChangeDetectorRef
  }], null);
})();
var _LowerCasePipe = class _LowerCasePipe {
  transform(value) {
    if (value == null) return null;
    if (typeof value !== "string") {
      throw invalidPipeArgumentError(_LowerCasePipe, value);
    }
    return value.toLowerCase();
  }
};
_LowerCasePipe.\u0275fac = function LowerCasePipe_Factory(t) {
  return new (t || _LowerCasePipe)();
};
_LowerCasePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "lowercase",
  type: _LowerCasePipe,
  pure: true,
  standalone: true
});
var LowerCasePipe = _LowerCasePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LowerCasePipe, [{
    type: Pipe,
    args: [{
      name: "lowercase",
      standalone: true
    }]
  }], null, null);
})();
var unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
var _TitleCasePipe = class _TitleCasePipe {
  transform(value) {
    if (value == null) return null;
    if (typeof value !== "string") {
      throw invalidPipeArgumentError(_TitleCasePipe, value);
    }
    return value.replace(unicodeWordMatch, (txt) => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
  }
};
_TitleCasePipe.\u0275fac = function TitleCasePipe_Factory(t) {
  return new (t || _TitleCasePipe)();
};
_TitleCasePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "titlecase",
  type: _TitleCasePipe,
  pure: true,
  standalone: true
});
var TitleCasePipe = _TitleCasePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TitleCasePipe, [{
    type: Pipe,
    args: [{
      name: "titlecase",
      standalone: true
    }]
  }], null, null);
})();
var _UpperCasePipe = class _UpperCasePipe {
  transform(value) {
    if (value == null) return null;
    if (typeof value !== "string") {
      throw invalidPipeArgumentError(_UpperCasePipe, value);
    }
    return value.toUpperCase();
  }
};
_UpperCasePipe.\u0275fac = function UpperCasePipe_Factory(t) {
  return new (t || _UpperCasePipe)();
};
_UpperCasePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "uppercase",
  type: _UpperCasePipe,
  pure: true,
  standalone: true
});
var UpperCasePipe = _UpperCasePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UpperCasePipe, [{
    type: Pipe,
    args: [{
      name: "uppercase",
      standalone: true
    }]
  }], null, null);
})();
var DEFAULT_DATE_FORMAT = "mediumDate";
var DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_TIMEZONE" : "");
var DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(ngDevMode ? "DATE_PIPE_DEFAULT_OPTIONS" : "");
var _DatePipe = class _DatePipe {
  constructor(locale, defaultTimezone, defaultOptions2) {
    this.locale = locale;
    this.defaultTimezone = defaultTimezone;
    this.defaultOptions = defaultOptions2;
  }
  transform(value, format, timezone, locale) {
    if (value == null || value === "" || value !== value) return null;
    try {
      const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
      const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? void 0;
      return formatDate(value, _format, locale || this.locale, _timezone);
    } catch (error3) {
      throw invalidPipeArgumentError(_DatePipe, error3.message);
    }
  }
};
_DatePipe.\u0275fac = function DatePipe_Factory(t) {
  return new (t || _DatePipe)(\u0275\u0275directiveInject(LOCALE_ID, 16), \u0275\u0275directiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), \u0275\u0275directiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
};
_DatePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "date",
  type: _DatePipe,
  pure: true,
  standalone: true
});
var DatePipe = _DatePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DatePipe, [{
    type: Pipe,
    args: [{
      name: "date",
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [LOCALE_ID]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DATE_PIPE_DEFAULT_TIMEZONE]
    }, {
      type: Optional
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DATE_PIPE_DEFAULT_OPTIONS]
    }, {
      type: Optional
    }]
  }], null);
})();
var _INTERPOLATION_REGEXP = /#/g;
var _I18nPluralPipe = class _I18nPluralPipe {
  constructor(_localization) {
    this._localization = _localization;
  }
  /**
   * @param value the number to be formatted
   * @param pluralMap an object that mimics the ICU format, see
   * https://unicode-org.github.io/icu/userguide/format_parse/messages/.
   * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
   * default).
   */
  transform(value, pluralMap, locale) {
    if (value == null) return "";
    if (typeof pluralMap !== "object" || pluralMap === null) {
      throw invalidPipeArgumentError(_I18nPluralPipe, pluralMap);
    }
    const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
    return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
  }
};
_I18nPluralPipe.\u0275fac = function I18nPluralPipe_Factory(t) {
  return new (t || _I18nPluralPipe)(\u0275\u0275directiveInject(NgLocalization, 16));
};
_I18nPluralPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "i18nPlural",
  type: _I18nPluralPipe,
  pure: true,
  standalone: true
});
var I18nPluralPipe = _I18nPluralPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nPluralPipe, [{
    type: Pipe,
    args: [{
      name: "i18nPlural",
      standalone: true
    }]
  }], () => [{
    type: NgLocalization
  }], null);
})();
var _I18nSelectPipe = class _I18nSelectPipe {
  /**
   * @param value a string to be internationalized.
   * @param mapping an object that indicates the text that should be displayed
   * for different values of the provided `value`.
   */
  transform(value, mapping) {
    if (value == null) return "";
    if (typeof mapping !== "object" || typeof value !== "string") {
      throw invalidPipeArgumentError(_I18nSelectPipe, mapping);
    }
    if (mapping.hasOwnProperty(value)) {
      return mapping[value];
    }
    if (mapping.hasOwnProperty("other")) {
      return mapping["other"];
    }
    return "";
  }
};
_I18nSelectPipe.\u0275fac = function I18nSelectPipe_Factory(t) {
  return new (t || _I18nSelectPipe)();
};
_I18nSelectPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "i18nSelect",
  type: _I18nSelectPipe,
  pure: true,
  standalone: true
});
var I18nSelectPipe = _I18nSelectPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nSelectPipe, [{
    type: Pipe,
    args: [{
      name: "i18nSelect",
      standalone: true
    }]
  }], null, null);
})();
var _JsonPipe = class _JsonPipe {
  /**
   * @param value A value of any type to convert into a JSON-format string.
   */
  transform(value) {
    return JSON.stringify(value, null, 2);
  }
};
_JsonPipe.\u0275fac = function JsonPipe_Factory(t) {
  return new (t || _JsonPipe)();
};
_JsonPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "json",
  type: _JsonPipe,
  pure: false,
  standalone: true
});
var JsonPipe = _JsonPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonPipe, [{
    type: Pipe,
    args: [{
      name: "json",
      pure: false,
      standalone: true
    }]
  }], null, null);
})();
function makeKeyValuePair(key, value) {
  return {
    key,
    value
  };
}
var _KeyValuePipe = class _KeyValuePipe {
  constructor(differs) {
    this.differs = differs;
    this.keyValues = [];
    this.compareFn = defaultComparator;
  }
  transform(input2, compareFn = defaultComparator) {
    if (!input2 || !(input2 instanceof Map) && typeof input2 !== "object") {
      return null;
    }
    this.differ ??= this.differs.find(input2).create();
    const differChanges = this.differ.diff(input2);
    const compareFnChanged = compareFn !== this.compareFn;
    if (differChanges) {
      this.keyValues = [];
      differChanges.forEachItem((r) => {
        this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
      });
    }
    if (differChanges || compareFnChanged) {
      this.keyValues.sort(compareFn);
      this.compareFn = compareFn;
    }
    return this.keyValues;
  }
};
_KeyValuePipe.\u0275fac = function KeyValuePipe_Factory(t) {
  return new (t || _KeyValuePipe)(\u0275\u0275directiveInject(KeyValueDiffers, 16));
};
_KeyValuePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "keyvalue",
  type: _KeyValuePipe,
  pure: false,
  standalone: true
});
var KeyValuePipe = _KeyValuePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyValuePipe, [{
    type: Pipe,
    args: [{
      name: "keyvalue",
      pure: false,
      standalone: true
    }]
  }], () => [{
    type: KeyValueDiffers
  }], null);
})();
function defaultComparator(keyValueA, keyValueB) {
  const a = keyValueA.key;
  const b = keyValueB.key;
  if (a === b) return 0;
  if (a === void 0) return 1;
  if (b === void 0) return -1;
  if (a === null) return 1;
  if (b === null) return -1;
  if (typeof a == "string" && typeof b == "string") {
    return a < b ? -1 : 1;
  }
  if (typeof a == "number" && typeof b == "number") {
    return a - b;
  }
  if (typeof a == "boolean" && typeof b == "boolean") {
    return a < b ? -1 : 1;
  }
  const aString = String(a);
  const bString = String(b);
  return aString == bString ? 0 : aString < bString ? -1 : 1;
}
var _DecimalPipe = class _DecimalPipe {
  constructor(_locale) {
    this._locale = _locale;
  }
  /**
   * @param value The value to be formatted.
   * @param digitsInfo Sets digit and decimal representation.
   * [See more](#digitsinfo).
   * @param locale Specifies what locale format rules to use.
   * [See more](#locale).
   */
  transform(value, digitsInfo, locale) {
    if (!isValue(value)) return null;
    locale ||= this._locale;
    try {
      const num = strToNumber(value);
      return formatNumber(num, locale, digitsInfo);
    } catch (error3) {
      throw invalidPipeArgumentError(_DecimalPipe, error3.message);
    }
  }
};
_DecimalPipe.\u0275fac = function DecimalPipe_Factory(t) {
  return new (t || _DecimalPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16));
};
_DecimalPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "number",
  type: _DecimalPipe,
  pure: true,
  standalone: true
});
var DecimalPipe = _DecimalPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DecimalPipe, [{
    type: Pipe,
    args: [{
      name: "number",
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [LOCALE_ID]
    }]
  }], null);
})();
var _PercentPipe = class _PercentPipe {
  constructor(_locale) {
    this._locale = _locale;
  }
  /**
   *
   * @param value The number to be formatted as a percentage.
   * @param digitsInfo Decimal representation options, specified by a string
   * in the following format:<br>
   * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
   *   - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
   * Default is `1`.
   *   - `minFractionDigits`: The minimum number of digits after the decimal point.
   * Default is `0`.
   *   - `maxFractionDigits`: The maximum number of digits after the decimal point.
   * Default is `0`.
   * @param locale A locale code for the locale format rules to use.
   * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
   * See [Setting your app locale](guide/i18n/locale-id).
   */
  transform(value, digitsInfo, locale) {
    if (!isValue(value)) return null;
    locale ||= this._locale;
    try {
      const num = strToNumber(value);
      return formatPercent(num, locale, digitsInfo);
    } catch (error3) {
      throw invalidPipeArgumentError(_PercentPipe, error3.message);
    }
  }
};
_PercentPipe.\u0275fac = function PercentPipe_Factory(t) {
  return new (t || _PercentPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16));
};
_PercentPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "percent",
  type: _PercentPipe,
  pure: true,
  standalone: true
});
var PercentPipe = _PercentPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PercentPipe, [{
    type: Pipe,
    args: [{
      name: "percent",
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [LOCALE_ID]
    }]
  }], null);
})();
var _CurrencyPipe = class _CurrencyPipe {
  constructor(_locale, _defaultCurrencyCode = "USD") {
    this._locale = _locale;
    this._defaultCurrencyCode = _defaultCurrencyCode;
  }
  /**
   *
   * @param value The number to be formatted as currency.
   * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code,
   * such as `USD` for the US dollar and `EUR` for the euro. The default currency code can be
   * configured using the `DEFAULT_CURRENCY_CODE` injection token.
   * @param display The format for the currency indicator. One of the following:
   *   - `code`: Show the code (such as `USD`).
   *   - `symbol`(default): Show the symbol (such as `$`).
   *   - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their
   * currency.
   * For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the
   * locale has no narrow symbol, uses the standard symbol for the locale.
   *   - String: Use the given string value instead of a code or a symbol.
   * For example, an empty string will suppress the currency & symbol.
   *   - Boolean (marked deprecated in v5): `true` for symbol and false for `code`.
   *
   * @param digitsInfo Decimal representation options, specified by a string
   * in the following format:<br>
   * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
   *   - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
   * Default is `1`.
   *   - `minFractionDigits`: The minimum number of digits after the decimal point.
   * Default is `2`.
   *   - `maxFractionDigits`: The maximum number of digits after the decimal point.
   * Default is `2`.
   * If not provided, the number will be formatted with the proper amount of digits,
   * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies.
   * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none.
   * @param locale A locale code for the locale format rules to use.
   * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
   * See [Setting your app locale](guide/i18n/locale-id).
   */
  transform(value, currencyCode = this._defaultCurrencyCode, display = "symbol", digitsInfo, locale) {
    if (!isValue(value)) return null;
    locale ||= this._locale;
    if (typeof display === "boolean") {
      if ((typeof ngDevMode === "undefined" || ngDevMode) && console && console.warn) {
        console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
      }
      display = display ? "symbol" : "code";
    }
    let currency = currencyCode || this._defaultCurrencyCode;
    if (display !== "code") {
      if (display === "symbol" || display === "symbol-narrow") {
        currency = getCurrencySymbol(currency, display === "symbol" ? "wide" : "narrow", locale);
      } else {
        currency = display;
      }
    }
    try {
      const num = strToNumber(value);
      return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
    } catch (error3) {
      throw invalidPipeArgumentError(_CurrencyPipe, error3.message);
    }
  }
};
_CurrencyPipe.\u0275fac = function CurrencyPipe_Factory(t) {
  return new (t || _CurrencyPipe)(\u0275\u0275directiveInject(LOCALE_ID, 16), \u0275\u0275directiveInject(DEFAULT_CURRENCY_CODE, 16));
};
_CurrencyPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "currency",
  type: _CurrencyPipe,
  pure: true,
  standalone: true
});
var CurrencyPipe = _CurrencyPipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrencyPipe, [{
    type: Pipe,
    args: [{
      name: "currency",
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [LOCALE_ID]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DEFAULT_CURRENCY_CODE]
    }]
  }], null);
})();
function isValue(value) {
  return !(value == null || value === "" || value !== value);
}
function strToNumber(value) {
  if (typeof value === "string" && !isNaN(Number(value) - parseFloat(value))) {
    return Number(value);
  }
  if (typeof value !== "number") {
    throw new Error(`${value} is not a number`);
  }
  return value;
}
var _SlicePipe = class _SlicePipe {
  transform(value, start2, end) {
    if (value == null) return null;
    if (!this.supports(value)) {
      throw invalidPipeArgumentError(_SlicePipe, value);
    }
    return value.slice(start2, end);
  }
  supports(obj) {
    return typeof obj === "string" || Array.isArray(obj);
  }
};
_SlicePipe.\u0275fac = function SlicePipe_Factory(t) {
  return new (t || _SlicePipe)();
};
_SlicePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
  name: "slice",
  type: _SlicePipe,
  pure: false,
  standalone: true
});
var SlicePipe = _SlicePipe;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SlicePipe, [{
    type: Pipe,
    args: [{
      name: "slice",
      pure: false,
      standalone: true
    }]
  }], null, null);
})();
var COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
var _CommonModule = class _CommonModule {
};
_CommonModule.\u0275fac = function CommonModule_Factory(t) {
  return new (t || _CommonModule)();
};
_CommonModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _CommonModule
});
_CommonModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var CommonModule = _CommonModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CommonModule, [{
    type: NgModule,
    args: [{
      imports: [COMMON_DIRECTIVES, COMMON_PIPES],
      exports: [COMMON_DIRECTIVES, COMMON_PIPES]
    }]
  }], null, null);
})();
var PLATFORM_BROWSER_ID = "browser";
var PLATFORM_SERVER_ID = "server";
function isPlatformBrowser2(platformId) {
  return platformId === PLATFORM_BROWSER_ID;
}
function isPlatformServer(platformId) {
  return platformId === PLATFORM_SERVER_ID;
}
var VERSION2 = new Version("18.0.0-rc.1");
var _ViewportScroller = class _ViewportScroller {
};
_ViewportScroller.\u0275prov = \u0275\u0275defineInjectable({
  token: _ViewportScroller,
  providedIn: "root",
  factory: () => isPlatformBrowser2(inject(PLATFORM_ID)) ? new BrowserViewportScroller(inject(DOCUMENT2), window) : new NullViewportScroller()
});
var ViewportScroller = _ViewportScroller;
var BrowserViewportScroller = class {
  constructor(document2, window2) {
    this.document = document2;
    this.window = window2;
    this.offset = () => [0, 0];
  }
  /**
   * Configures the top offset used when scrolling to an anchor.
   * @param offset A position in screen coordinates (a tuple with x and y values)
   * or a function that returns the top offset position.
   *
   */
  setOffset(offset2) {
    if (Array.isArray(offset2)) {
      this.offset = () => offset2;
    } else {
      this.offset = offset2;
    }
  }
  /**
   * Retrieves the current scroll position.
   * @returns The position in screen coordinates.
   */
  getScrollPosition() {
    return [this.window.scrollX, this.window.scrollY];
  }
  /**
   * Sets the scroll position.
   * @param position The new position in screen coordinates.
   */
  scrollToPosition(position) {
    this.window.scrollTo(position[0], position[1]);
  }
  /**
   * Scrolls to an element and attempts to focus the element.
   *
   * Note that the function name here is misleading in that the target string may be an ID for a
   * non-anchor element.
   *
   * @param target The ID of an element or name of the anchor.
   *
   * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document
   * @see https://html.spec.whatwg.org/#scroll-to-fragid
   */
  scrollToAnchor(target) {
    const elSelected = findAnchorFromDocument(this.document, target);
    if (elSelected) {
      this.scrollToElement(elSelected);
      elSelected.focus();
    }
  }
  /**
   * Disables automatic scroll restoration provided by the browser.
   */
  setHistoryScrollRestoration(scrollRestoration) {
    this.window.history.scrollRestoration = scrollRestoration;
  }
  /**
   * Scrolls to an element using the native offset and the specified offset set on this scroller.
   *
   * The offset can be used when we know that there is a floating header and scrolling naively to an
   * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.
   */
  scrollToElement(el) {
    const rect = el.getBoundingClientRect();
    const left = rect.left + this.window.pageXOffset;
    const top = rect.top + this.window.pageYOffset;
    const offset2 = this.offset();
    this.window.scrollTo(left - offset2[0], top - offset2[1]);
  }
};
function findAnchorFromDocument(document2, target) {
  const documentResult = document2.getElementById(target) || document2.getElementsByName(target)[0];
  if (documentResult) {
    return documentResult;
  }
  if (typeof document2.createTreeWalker === "function" && document2.body && typeof document2.body.attachShadow === "function") {
    const treeWalker = document2.createTreeWalker(document2.body, NodeFilter.SHOW_ELEMENT);
    let currentNode = treeWalker.currentNode;
    while (currentNode) {
      const shadowRoot = currentNode.shadowRoot;
      if (shadowRoot) {
        const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
        if (result) {
          return result;
        }
      }
      currentNode = treeWalker.nextNode();
    }
  }
  return null;
}
var NullViewportScroller = class {
  /**
   * Empty implementation
   */
  setOffset(offset2) {
  }
  /**
   * Empty implementation
   */
  getScrollPosition() {
    return [0, 0];
  }
  /**
   * Empty implementation
   */
  scrollToPosition(position) {
  }
  /**
   * Empty implementation
   */
  scrollToAnchor(anchor2) {
  }
  /**
   * Empty implementation
   */
  setHistoryScrollRestoration(scrollRestoration) {
  }
};
var XhrFactory = class {
};
var PLACEHOLDER_QUALITY = "20";
function getUrl(src, win) {
  return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
}
function isAbsoluteUrl(src) {
  return /^https?:\/\//.test(src);
}
function extractHostname(url) {
  return isAbsoluteUrl(url) ? new URL(url).hostname : url;
}
function isValidPath(path) {
  const isString2 = typeof path === "string";
  if (!isString2 || path.trim() === "") {
    return false;
  }
  try {
    const url = new URL(path);
    return true;
  } catch {
    return false;
  }
}
function normalizePath(path) {
  return path.endsWith("/") ? path.slice(0, -1) : path;
}
function normalizeSrc(src) {
  return src.startsWith("/") ? src.slice(1) : src;
}
var noopImageLoader = (config2) => config2.src;
var IMAGE_LOADER = new InjectionToken(ngDevMode ? "ImageLoader" : "", {
  providedIn: "root",
  factory: () => noopImageLoader
});
function createImageLoader(buildUrlFn, exampleUrls) {
  return function provideImageLoader(path) {
    if (!isValidPath(path)) {
      throwInvalidPathError(path, exampleUrls || []);
    }
    path = normalizePath(path);
    const loaderFn = (config2) => {
      if (isAbsoluteUrl(config2.src)) {
        throwUnexpectedAbsoluteUrlError(path, config2.src);
      }
      return buildUrlFn(path, __spreadProps(__spreadValues({}, config2), {
        src: normalizeSrc(config2.src)
      }));
    };
    const providers = [{
      provide: IMAGE_LOADER,
      useValue: loaderFn
    }];
    return providers;
  };
}
function throwInvalidPathError(path, exampleUrls) {
  throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). To fix this, supply a path using one of the following formats: ${exampleUrls.join(" or ")}`);
}
function throwUnexpectedAbsoluteUrlError(path, url) {
  throw new RuntimeError(2959, ngDevMode && `Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. This image loader expects \`ngSrc\` to be a relative URL - however the provided value is an absolute URL. To fix this, provide \`ngSrc\` as a path relative to the base URL configured for this loader (\`${path}\`).`);
}
var provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ["https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>"] : void 0);
function createCloudflareUrl(path, config2) {
  let params = `format=auto`;
  if (config2.width) {
    params += `,width=${config2.width}`;
  }
  if (config2.isPlaceholder) {
    params += `,quality=${PLACEHOLDER_QUALITY}`;
  }
  return `${path}/cdn-cgi/image/${params}/${config2.src}`;
}
var cloudinaryLoaderInfo = {
  name: "Cloudinary",
  testUrl: isCloudinaryUrl
};
var CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
function isCloudinaryUrl(url) {
  return CLOUDINARY_LOADER_REGEX.test(url);
}
var provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ["https://res.cloudinary.com/mysite", "https://mysite.cloudinary.com", "https://subdomain.mysite.com"] : void 0);
function createCloudinaryUrl(path, config2) {
  const quality = config2.isPlaceholder ? "q_auto:low" : "q_auto";
  let params = `f_auto,${quality}`;
  if (config2.width) {
    params += `,w_${config2.width}`;
  }
  return `${path}/image/upload/${params}/${config2.src}`;
}
var imageKitLoaderInfo = {
  name: "ImageKit",
  testUrl: isImageKitUrl
};
var IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
function isImageKitUrl(url) {
  return IMAGE_KIT_LOADER_REGEX.test(url);
}
var provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ["https://ik.imagekit.io/mysite", "https://subdomain.mysite.com"] : void 0);
function createImagekitUrl(path, config2) {
  const {
    src,
    width
  } = config2;
  const params = [];
  if (width) {
    params.push(`w-${width}`);
  }
  if (config2.isPlaceholder) {
    params.push(`q-${PLACEHOLDER_QUALITY}`);
  }
  const urlSegments = params.length ? [path, `tr:${params.join(",")}`, src] : [path, src];
  const url = new URL(urlSegments.join("/"));
  return url.href;
}
var imgixLoaderInfo = {
  name: "Imgix",
  testUrl: isImgixUrl
};
var IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
function isImgixUrl(url) {
  return IMGIX_LOADER_REGEX.test(url);
}
var provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ["https://somepath.imgix.net/"] : void 0);
function createImgixUrl(path, config2) {
  const url = new URL(`${path}/${config2.src}`);
  url.searchParams.set("auto", "format");
  if (config2.width) {
    url.searchParams.set("w", config2.width.toString());
  }
  if (config2.isPlaceholder) {
    url.searchParams.set("q", PLACEHOLDER_QUALITY);
  }
  return url.href;
}
var netlifyLoaderInfo = {
  name: "Netlify",
  testUrl: isNetlifyUrl
};
var NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/;
function isNetlifyUrl(url) {
  return NETLIFY_LOADER_REGEX.test(url);
}
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
  const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : "";
  return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
}
function assertDevMode(checkName) {
  if (!ngDevMode) {
    throw new RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. Please make sure that the prod mode is enabled for production builds.`);
  }
}
var _LCPImageObserver = class _LCPImageObserver {
  constructor() {
    this.images = /* @__PURE__ */ new Map();
    this.window = null;
    this.observer = null;
    assertDevMode("LCP checker");
    const win = inject(DOCUMENT2).defaultView;
    if (typeof win !== "undefined" && typeof PerformanceObserver !== "undefined") {
      this.window = win;
      this.observer = this.initPerformanceObserver();
    }
  }
  /**
   * Inits PerformanceObserver and subscribes to LCP events.
   * Based on https://web.dev/lcp/#measure-lcp-in-javascript
   */
  initPerformanceObserver() {
    const observer = new PerformanceObserver((entryList) => {
      const entries = entryList.getEntries();
      if (entries.length === 0) return;
      const lcpElement = entries[entries.length - 1];
      const imgSrc = lcpElement.element?.src ?? "";
      if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:")) return;
      const img = this.images.get(imgSrc);
      if (!img) return;
      if (!img.priority && !img.alreadyWarnedPriority) {
        img.alreadyWarnedPriority = true;
        logMissingPriorityError(imgSrc);
      }
      if (img.modified && !img.alreadyWarnedModified) {
        img.alreadyWarnedModified = true;
        logModifiedWarning(imgSrc);
      }
    });
    observer.observe({
      type: "largest-contentful-paint",
      buffered: true
    });
    return observer;
  }
  registerImage(rewrittenSrc, originalNgSrc, isPriority) {
    if (!this.observer) return;
    const newObservedImageState = {
      priority: isPriority,
      modified: false,
      alreadyWarnedModified: false,
      alreadyWarnedPriority: false
    };
    this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);
  }
  unregisterImage(rewrittenSrc) {
    if (!this.observer) return;
    this.images.delete(getUrl(rewrittenSrc, this.window).href);
  }
  updateImage(originalSrc, newSrc) {
    const originalUrl = getUrl(originalSrc, this.window).href;
    const img = this.images.get(originalUrl);
    if (img) {
      img.modified = true;
      this.images.set(getUrl(newSrc, this.window).href, img);
      this.images.delete(originalUrl);
    }
  }
  ngOnDestroy() {
    if (!this.observer) return;
    this.observer.disconnect();
    this.images.clear();
  }
};
_LCPImageObserver.\u0275fac = function LCPImageObserver_Factory(t) {
  return new (t || _LCPImageObserver)();
};
_LCPImageObserver.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _LCPImageObserver,
  factory: _LCPImageObserver.\u0275fac,
  providedIn: "root"
});
var LCPImageObserver = _LCPImageObserver;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LCPImageObserver, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
function logMissingPriorityError(ngSrc) {
  const directiveDetails = imgDirectiveDetails(ngSrc);
  console.error(formatRuntimeError(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element but was not marked "priority". This image should be marked "priority" in order to prioritize its loading. To fix this, add the "priority" attribute.`));
}
function logModifiedWarning(ngSrc) {
  const directiveDetails = imgDirectiveDetails(ngSrc);
  console.warn(formatRuntimeError(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) element and has had its "ngSrc" attribute modified. This can cause slower loading performance. It is recommended not to modify the "ngSrc" property on any image which could be the LCP element.`));
}
var INTERNAL_PRECONNECT_CHECK_BLOCKLIST = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "0.0.0.0"]);
var PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(ngDevMode ? "PRECONNECT_CHECK_BLOCKLIST" : "");
var _PreconnectLinkChecker = class _PreconnectLinkChecker {
  constructor() {
    this.document = inject(DOCUMENT2);
    this.preconnectLinks = null;
    this.alreadySeen = /* @__PURE__ */ new Set();
    this.window = null;
    this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
    assertDevMode("preconnect link checker");
    const win = this.document.defaultView;
    if (typeof win !== "undefined") {
      this.window = win;
    }
    const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {
      optional: true
    });
    if (blocklist) {
      this.populateBlocklist(blocklist);
    }
  }
  populateBlocklist(origins) {
    if (Array.isArray(origins)) {
      deepForEach2(origins, (origin) => {
        this.blocklist.add(extractHostname(origin));
      });
    } else {
      this.blocklist.add(extractHostname(origins));
    }
  }
  /**
   * Checks that a preconnect resource hint exists in the head for the
   * given src.
   *
   * @param rewrittenSrc src formatted with loader
   * @param originalNgSrc ngSrc value
   */
  assertPreconnect(rewrittenSrc, originalNgSrc) {
    if (!this.window) return;
    const imgUrl = getUrl(rewrittenSrc, this.window);
    if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;
    this.alreadySeen.add(imgUrl.origin);
    this.preconnectLinks ??= this.queryPreconnectLinks();
    if (!this.preconnectLinks.has(imgUrl.origin)) {
      console.warn(formatRuntimeError(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this image. Preconnecting to the origin(s) that serve priority images ensures that these images are delivered as soon as possible. To fix this, please add the following element into the <head> of the document:
  <link rel="preconnect" href="${imgUrl.origin}">`));
    }
  }
  queryPreconnectLinks() {
    const preconnectUrls = /* @__PURE__ */ new Set();
    const selector = "link[rel=preconnect]";
    const links = Array.from(this.document.querySelectorAll(selector));
    for (let link of links) {
      const url = getUrl(link.href, this.window);
      preconnectUrls.add(url.origin);
    }
    return preconnectUrls;
  }
  ngOnDestroy() {
    this.preconnectLinks?.clear();
    this.alreadySeen.clear();
  }
};
_PreconnectLinkChecker.\u0275fac = function PreconnectLinkChecker_Factory(t) {
  return new (t || _PreconnectLinkChecker)();
};
_PreconnectLinkChecker.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _PreconnectLinkChecker,
  factory: _PreconnectLinkChecker.\u0275fac,
  providedIn: "root"
});
var PreconnectLinkChecker = _PreconnectLinkChecker;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreconnectLinkChecker, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
function deepForEach2(input2, fn) {
  for (let value of input2) {
    Array.isArray(value) ? deepForEach2(value, fn) : fn(value);
  }
}
var DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
var PRELOADED_IMAGES = new InjectionToken("NG_OPTIMIZED_PRELOADED_IMAGES", {
  providedIn: "root",
  factory: () => /* @__PURE__ */ new Set()
});
var _PreloadLinkCreator = class _PreloadLinkCreator {
  constructor() {
    this.preloadedImages = inject(PRELOADED_IMAGES);
    this.document = inject(DOCUMENT2);
  }
  /**
   * @description Add a preload `<link>` to the `<head>` of the `index.html` that is served from the
   * server while using Angular Universal and SSR to kick off image loads for high priority images.
   *
   * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
   * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
   * respectively, on the preload `<link>` tag so that the correctly sized image is preloaded from
   * the CDN.
   *
   * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
   *
   * @param renderer The `Renderer2` passed in from the directive
   * @param src The original src of the image that is set on the `ngSrc` input.
   * @param srcset The parsed and formatted srcset created from the `ngSrcset` input
   * @param sizes The value of the `sizes` attribute passed in to the `<img>` tag
   */
  createPreloadLinkTag(renderer, src, srcset, sizes) {
    if (ngDevMode) {
      if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
        throw new RuntimeError(2961, ngDevMode && `The \`NgOptimizedImage\` directive has detected that more than ${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. This might negatively affect an overall performance of the page. To fix this, remove the "priority" attribute from images with less priority.`);
      }
    }
    if (this.preloadedImages.has(src)) {
      return;
    }
    this.preloadedImages.add(src);
    const preload = renderer.createElement("link");
    renderer.setAttribute(preload, "as", "image");
    renderer.setAttribute(preload, "href", src);
    renderer.setAttribute(preload, "rel", "preload");
    renderer.setAttribute(preload, "fetchpriority", "high");
    if (sizes) {
      renderer.setAttribute(preload, "imageSizes", sizes);
    }
    if (srcset) {
      renderer.setAttribute(preload, "imageSrcset", srcset);
    }
    renderer.appendChild(this.document.head, preload);
  }
};
_PreloadLinkCreator.\u0275fac = function PreloadLinkCreator_Factory(t) {
  return new (t || _PreloadLinkCreator)();
};
_PreloadLinkCreator.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _PreloadLinkCreator,
  factory: _PreloadLinkCreator.\u0275fac,
  providedIn: "root"
});
var PreloadLinkCreator = _PreloadLinkCreator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreloadLinkCreator, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
var VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
var VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
var ABSOLUTE_SRCSET_DENSITY_CAP = 3;
var RECOMMENDED_SRCSET_DENSITY_CAP = 2;
var DENSITY_SRCSET_MULTIPLIERS = [1, 2];
var VIEWPORT_BREAKPOINT_CUTOFF = 640;
var ASPECT_RATIO_TOLERANCE = 0.1;
var OVERSIZED_IMAGE_TOLERANCE2 = 1e3;
var FIXED_SRCSET_WIDTH_LIMIT = 1920;
var FIXED_SRCSET_HEIGHT_LIMIT = 1080;
var PLACEHOLDER_BLUR_AMOUNT = 15;
var DATA_URL_WARN_LIMIT = 4e3;
var DATA_URL_ERROR_LIMIT = 1e4;
var BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];
var _NgOptimizedImage = class _NgOptimizedImage {
  constructor() {
    this.imageLoader = inject(IMAGE_LOADER);
    this.config = processConfig(inject(IMAGE_CONFIG));
    this.renderer = inject(Renderer2);
    this.imgElement = inject(ElementRef).nativeElement;
    this.injector = inject(Injector);
    this.isServer = isPlatformServer(inject(PLATFORM_ID));
    this.preloadLinkCreator = inject(PreloadLinkCreator);
    this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null;
    this._renderedSrc = null;
    this.priority = false;
    this.disableOptimizedSrcset = false;
    this.fill = false;
  }
  /** @nodoc */
  ngOnInit() {
    performanceMarkFeature("NgOptimizedImage");
    if (ngDevMode) {
      const ngZone = this.injector.get(NgZone);
      assertNonEmptyInput(this, "ngSrc", this.ngSrc);
      assertValidNgSrcset(this, this.ngSrcset);
      assertNoConflictingSrc(this);
      if (this.ngSrcset) {
        assertNoConflictingSrcset(this);
      }
      assertNotBase64Image(this);
      assertNotBlobUrl(this);
      if (this.fill) {
        assertEmptyWidthAndHeight(this);
        ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
      } else {
        assertNonEmptyWidthAndHeight(this);
        if (this.height !== void 0) {
          assertGreaterThanZero(this, this.height, "height");
        }
        if (this.width !== void 0) {
          assertGreaterThanZero(this, this.width, "width");
        }
        ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
      }
      assertValidLoadingInput(this);
      if (!this.ngSrcset) {
        assertNoComplexSizes(this);
      }
      assertValidPlaceholder(this, this.imageLoader);
      assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
      assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
      assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
      if (this.lcpObserver !== null) {
        const ngZone2 = this.injector.get(NgZone);
        ngZone2.runOutsideAngular(() => {
          this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
        });
      }
      if (this.priority) {
        const checker = this.injector.get(PreconnectLinkChecker);
        checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
      }
    }
    if (this.placeholder) {
      this.removePlaceholderOnLoad(this.imgElement);
    }
    this.setHostAttributes();
  }
  setHostAttributes() {
    if (this.fill) {
      this.sizes ||= "100vw";
    } else {
      this.setHostAttribute("width", this.width.toString());
      this.setHostAttribute("height", this.height.toString());
    }
    this.setHostAttribute("loading", this.getLoadingBehavior());
    this.setHostAttribute("fetchpriority", this.getFetchPriority());
    this.setHostAttribute("ng-img", "true");
    const rewrittenSrcset = this.updateSrcAndSrcset();
    if (this.sizes) {
      this.setHostAttribute("sizes", this.sizes);
    }
    if (this.isServer && this.priority) {
      this.preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
    }
  }
  /** @nodoc */
  ngOnChanges(changes) {
    if (ngDevMode) {
      assertNoPostInitInputChange(this, changes, ["ngSrcset", "width", "height", "priority", "fill", "loading", "sizes", "loaderParams", "disableOptimizedSrcset"]);
    }
    if (changes["ngSrc"] && !changes["ngSrc"].isFirstChange()) {
      const oldSrc = this._renderedSrc;
      this.updateSrcAndSrcset(true);
      const newSrc = this._renderedSrc;
      if (this.lcpObserver !== null && oldSrc && newSrc && oldSrc !== newSrc) {
        const ngZone = this.injector.get(NgZone);
        ngZone.runOutsideAngular(() => {
          this.lcpObserver?.updateImage(oldSrc, newSrc);
        });
      }
    }
  }
  callImageLoader(configWithoutCustomParams) {
    let augmentedConfig = configWithoutCustomParams;
    if (this.loaderParams) {
      augmentedConfig.loaderParams = this.loaderParams;
    }
    return this.imageLoader(augmentedConfig);
  }
  getLoadingBehavior() {
    if (!this.priority && this.loading !== void 0) {
      return this.loading;
    }
    return this.priority ? "eager" : "lazy";
  }
  getFetchPriority() {
    return this.priority ? "high" : "auto";
  }
  getRewrittenSrc() {
    if (!this._renderedSrc) {
      const imgConfig = {
        src: this.ngSrc
      };
      this._renderedSrc = this.callImageLoader(imgConfig);
    }
    return this._renderedSrc;
  }
  getRewrittenSrcset() {
    const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
    const finalSrcs = this.ngSrcset.split(",").filter((src) => src !== "").map((srcStr) => {
      srcStr = srcStr.trim();
      const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
      return `${this.callImageLoader({
        src: this.ngSrc,
        width
      })} ${srcStr}`;
    });
    return finalSrcs.join(", ");
  }
  getAutomaticSrcset() {
    if (this.sizes) {
      return this.getResponsiveSrcset();
    } else {
      return this.getFixedSrcset();
    }
  }
  getResponsiveSrcset() {
    const {
      breakpoints
    } = this.config;
    let filteredBreakpoints = breakpoints;
    if (this.sizes?.trim() === "100vw") {
      filteredBreakpoints = breakpoints.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
    }
    const finalSrcs = filteredBreakpoints.map((bp) => `${this.callImageLoader({
      src: this.ngSrc,
      width: bp
    })} ${bp}w`);
    return finalSrcs.join(", ");
  }
  updateSrcAndSrcset(forceSrcRecalc = false) {
    if (forceSrcRecalc) {
      this._renderedSrc = null;
    }
    const rewrittenSrc = this.getRewrittenSrc();
    this.setHostAttribute("src", rewrittenSrc);
    let rewrittenSrcset = void 0;
    if (this.ngSrcset) {
      rewrittenSrcset = this.getRewrittenSrcset();
    } else if (this.shouldGenerateAutomaticSrcset()) {
      rewrittenSrcset = this.getAutomaticSrcset();
    }
    if (rewrittenSrcset) {
      this.setHostAttribute("srcset", rewrittenSrcset);
    }
    return rewrittenSrcset;
  }
  getFixedSrcset() {
    const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map((multiplier) => `${this.callImageLoader({
      src: this.ngSrc,
      width: this.width * multiplier
    })} ${multiplier}x`);
    return finalSrcs.join(", ");
  }
  shouldGenerateAutomaticSrcset() {
    let oversizedImage = false;
    if (!this.sizes) {
      oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
    }
    return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
  }
  /**
   * Returns an image url formatted for use with the CSS background-image property. Expects one of:
   * * A base64 encoded image, which is wrapped and passed through.
   * * A boolean. If true, calls the image loader to generate a small placeholder url.
   */
  generatePlaceholder(placeholderInput) {
    const {
      placeholderResolution
    } = this.config;
    if (placeholderInput === true) {
      return `url(${this.callImageLoader({
        src: this.ngSrc,
        width: placeholderResolution,
        isPlaceholder: true
      })})`;
    } else if (typeof placeholderInput === "string" && placeholderInput.startsWith("data:")) {
      return `url(${placeholderInput})`;
    }
    return null;
  }
  /**
   * Determines if blur should be applied, based on an optional boolean
   * property `blur` within the optional configuration object `placeholderConfig`.
   */
  shouldBlurPlaceholder(placeholderConfig) {
    if (!placeholderConfig || !placeholderConfig.hasOwnProperty("blur")) {
      return true;
    }
    return Boolean(placeholderConfig.blur);
  }
  removePlaceholderOnLoad(img) {
    const callback = () => {
      const changeDetectorRef = this.injector.get(ChangeDetectorRef);
      removeLoadListenerFn();
      removeErrorListenerFn();
      this.placeholder = false;
      changeDetectorRef.markForCheck();
    };
    const removeLoadListenerFn = this.renderer.listen(img, "load", callback);
    const removeErrorListenerFn = this.renderer.listen(img, "error", callback);
  }
  /** @nodoc */
  ngOnDestroy() {
    if (ngDevMode) {
      if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) {
        this.lcpObserver.unregisterImage(this._renderedSrc);
      }
    }
  }
  setHostAttribute(name, value) {
    this.renderer.setAttribute(this.imgElement, name, value);
  }
};
_NgOptimizedImage.\u0275fac = function NgOptimizedImage_Factory(t) {
  return new (t || _NgOptimizedImage)();
};
_NgOptimizedImage.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgOptimizedImage,
  selectors: [["img", "ngSrc", ""]],
  hostVars: 18,
  hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275styleProp("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null);
    }
  },
  inputs: {
    ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl],
    ngSrcset: "ngSrcset",
    sizes: "sizes",
    width: [2, "width", "width", numberAttribute],
    height: [2, "height", "height", numberAttribute],
    loading: "loading",
    priority: [2, "priority", "priority", booleanAttribute],
    loaderParams: "loaderParams",
    disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute],
    fill: [2, "fill", "fill", booleanAttribute],
    placeholder: [2, "placeholder", "placeholder", booleanOrDataUrlAttribute],
    placeholderConfig: "placeholderConfig",
    src: "src",
    srcset: "srcset"
  },
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275NgOnChangesFeature]
});
var NgOptimizedImage = _NgOptimizedImage;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptimizedImage, [{
    type: Directive,
    args: [{
      standalone: true,
      selector: "img[ngSrc]",
      host: {
        "[style.position]": 'fill ? "absolute" : null',
        "[style.width]": 'fill ? "100%" : null',
        "[style.height]": 'fill ? "100%" : null',
        "[style.inset]": 'fill ? "0" : null',
        "[style.background-size]": 'placeholder ? "cover" : null',
        "[style.background-position]": 'placeholder ? "50% 50%" : null',
        "[style.background-repeat]": 'placeholder ? "no-repeat" : null',
        "[style.background-image]": "placeholder ? generatePlaceholder(placeholder) : null",
        "[style.filter]": `placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(${PLACEHOLDER_BLUR_AMOUNT}px)" : null`
      }
    }]
  }], null, {
    ngSrc: [{
      type: Input,
      args: [{
        required: true,
        transform: unwrapSafeUrl
      }]
    }],
    ngSrcset: [{
      type: Input
    }],
    sizes: [{
      type: Input
    }],
    width: [{
      type: Input,
      args: [{
        transform: numberAttribute
      }]
    }],
    height: [{
      type: Input,
      args: [{
        transform: numberAttribute
      }]
    }],
    loading: [{
      type: Input
    }],
    priority: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    loaderParams: [{
      type: Input
    }],
    disableOptimizedSrcset: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    fill: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    placeholder: [{
      type: Input,
      args: [{
        transform: booleanOrDataUrlAttribute
      }]
    }],
    placeholderConfig: [{
      type: Input
    }],
    src: [{
      type: Input
    }],
    srcset: [{
      type: Input
    }]
  });
})();
function processConfig(config2) {
  let sortedBreakpoints = {};
  if (config2.breakpoints) {
    sortedBreakpoints.breakpoints = config2.breakpoints.sort((a, b) => a - b);
  }
  return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config2, sortedBreakpoints);
}
function assertNoConflictingSrc(dir) {
  if (dir.src) {
    throw new RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. To fix this, please remove the \`src\` attribute.`);
  }
}
function assertNoConflictingSrcset(dir) {
  if (dir.srcset) {
    throw new RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. Supplying both of these attributes breaks lazy loading. The NgOptimizedImage directive sets \`srcset\` itself based on the value of \`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
  }
}
function assertNotBase64Image(dir) {
  let ngSrc = dir.ngSrc.trim();
  if (ngSrc.startsWith("data:")) {
    if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
      ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + "...";
    }
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string (${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
  }
}
function assertNoComplexSizes(dir) {
  let sizes = dir.sizes;
  if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
  }
}
function assertValidPlaceholder(dir, imageLoader) {
  assertNoPlaceholderConfigWithoutPlaceholder(dir);
  assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);
  assertNoOversizedDataUrl(dir);
}
function assertNoPlaceholderConfigWithoutPlaceholder(dir) {
  if (dir.placeholderConfig && !dir.placeholder) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an image that does not use the \`placeholder\` attribute, and will have no effect.`);
  }
}
function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {
  if (dir.placeholder === true && imageLoader === noopImageLoader) {
    throw new RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for the primary image and its placeholder. To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`);
  }
}
function assertNoOversizedDataUrl(dir) {
  if (dir.placeholder && typeof dir.placeholder === "string" && dir.placeholder.startsWith("data:")) {
    if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {
      throw new RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. To fix this, generate a smaller data URL placeholder.`);
    }
    if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {
      console.warn(formatRuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders directly increase the bundle size of Angular and hurt page load performance. For better loading performance, generate a smaller data URL placeholder.`));
    }
  }
}
function assertNotBlobUrl(dir) {
  const ngSrc = dir.ngSrc.trim();
  if (ngSrc.startsWith("blob:")) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). Blob URLs are not supported by the NgOptimizedImage directive. To fix this, disable the NgOptimizedImage directive for this element by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
  }
}
function assertNonEmptyInput(dir, name, value) {
  const isString2 = typeof value === "string";
  const isEmptyString = isString2 && value.trim() === "";
  if (!isString2 || isEmptyString) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value (\`${value}\`). To fix this, change the value to a non-empty string.`);
  }
}
function assertValidNgSrcset(dir, value) {
  if (value == null) return;
  assertNonEmptyInput(dir, "ngSrcset", value);
  const stringVal = value;
  const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
  const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
  if (isValidDensityDescriptor) {
    assertUnderDensityCap(dir, stringVal);
  }
  const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
  if (!isValidSrcset) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
  }
}
function assertUnderDensityCap(dir, value) {
  const underDensityCap = value.split(",").every((num) => num === "" || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
  if (!underDensityCap) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:\`${value}\`. NgOptimizedImage generally recommends a max image density of ${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for most use cases. Images that will be pinch-zoomed are typically the primary use case for ${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
  }
}
function postInitInputChangeError(dir, inputName) {
  let reason;
  if (inputName === "width" || inputName === "height") {
    reason = `Changing \`${inputName}\` may result in different attribute value applied to the underlying image element and cause layout shifts on a page.`;
  } else {
    reason = `Changing the \`${inputName}\` would have no effect on the underlying image element, because the resource loading has already occurred.`;
  }
  return new RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. The NgOptimizedImage directive will not react to this input change. ${reason} To fix this, either switch \`${inputName}\` to a static value or wrap the image element in an *ngIf that is gated on the necessary value.`);
}
function assertNoPostInitInputChange(dir, changes, inputs) {
  inputs.forEach((input2) => {
    const isUpdated = changes.hasOwnProperty(input2);
    if (isUpdated && !changes[input2].isFirstChange()) {
      if (input2 === "ngSrc") {
        dir = {
          ngSrc: changes[input2].previousValue
        };
      }
      throw postInitInputChangeError(dir, input2);
    }
  });
}
function assertGreaterThanZero(dir, inputValue, inputName) {
  const validNumber = typeof inputValue === "number" && inputValue > 0;
  const validString = typeof inputValue === "string" && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
  if (!validNumber && !validString) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. To fix this, provide \`${inputName}\` as a number greater than 0.`);
  }
}
function assertNoImageDistortion(dir, img, renderer) {
  const removeLoadListenerFn = renderer.listen(img, "load", () => {
    removeLoadListenerFn();
    removeErrorListenerFn();
    const computedStyle = window.getComputedStyle(img);
    let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
    let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
    const boxSizing = computedStyle.getPropertyValue("box-sizing");
    if (boxSizing === "border-box") {
      const paddingTop = computedStyle.getPropertyValue("padding-top");
      const paddingRight = computedStyle.getPropertyValue("padding-right");
      const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
      const paddingLeft = computedStyle.getPropertyValue("padding-left");
      renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
      renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
    }
    const renderedAspectRatio = renderedWidth / renderedHeight;
    const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
    const intrinsicWidth = img.naturalWidth;
    const intrinsicHeight = img.naturalHeight;
    const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
    const suppliedWidth = dir.width;
    const suppliedHeight = dir.height;
    const suppliedAspectRatio = suppliedWidth / suppliedHeight;
    const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
    const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
    if (inaccurateDimensions) {
      console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match the aspect ratio indicated by the width and height attributes. 
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}). 
Supplied width and height attributes: ${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). 
To fix this, update the width and height attributes.`));
    } else if (stylingDistortion) {
      console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image does not match the image's intrinsic aspect ratio. 
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h (aspect-ratio: ${round(intrinsicAspectRatio)}). 
Rendered image size: ${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ${round(renderedAspectRatio)}). 
This issue can occur if "width" and "height" attributes are added to an image without updating the corresponding image styling. To fix this, adjust image styling. In most cases, adding "height: auto" or "width: auto" to the image styling will fix this issue.`));
    } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
      const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
      const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
      const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE2;
      const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE2;
      if (oversizedWidth || oversizedHeight) {
        console.warn(formatRuntimeError(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly larger than necessary. 
Rendered image size: ${renderedWidth}w x ${renderedHeight}h. 
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. 
Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. 
Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image or consider using the "ngSrcset" and "sizes" attributes.`));
      }
    }
  });
  const removeErrorListenerFn = renderer.listen(img, "error", () => {
    removeLoadListenerFn();
    removeErrorListenerFn();
  });
}
function assertNonEmptyWidthAndHeight(dir) {
  let missingAttributes = [];
  if (dir.width === void 0) missingAttributes.push("width");
  if (dir.height === void 0) missingAttributes.push("height");
  if (missingAttributes.length > 0) {
    throw new RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes are missing: ${missingAttributes.map((attr) => `"${attr}"`).join(", ")}. Including "width" and "height" attributes will prevent image-related layout shifts. To fix this, include "width" and "height" attributes on the image tag or turn on "fill" mode with the \`fill\` attribute.`);
  }
}
function assertEmptyWidthAndHeight(dir) {
  if (dir.width || dir.height) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing element, the size attributes have no effect and should be removed.`);
  }
}
function assertNonZeroRenderedHeight(dir, img, renderer) {
  const removeLoadListenerFn = renderer.listen(img, "load", () => {
    removeLoadListenerFn();
    removeErrorListenerFn();
    const renderedHeight = img.clientHeight;
    if (dir.fill && renderedHeight === 0) {
      console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. This is likely because the containing element does not have the CSS 'position' property set to one of the following: "relative", "fixed", or "absolute". To fix this problem, make sure the container element has the CSS 'position' property defined and the height of the element is not zero.`));
    }
  });
  const removeErrorListenerFn = renderer.listen(img, "error", () => {
    removeLoadListenerFn();
    removeErrorListenerFn();
  });
}
function assertValidLoadingInput(dir) {
  if (dir.loading && dir.priority) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute was used on an image that was marked "priority". Setting \`loading\` on priority images is not allowed because these images will always be eagerly loaded. To fix this, remove the \u201Cloading\u201D attribute from the priority image.`);
  }
  const validInputs = ["auto", "eager", "lazy"];
  if (typeof dir.loading === "string" && !validInputs.includes(dir.loading)) {
    throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute has an invalid value (\`${dir.loading}\`). To fix this, provide a valid value ("lazy", "eager", or "auto").`);
  }
}
function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
  if (imageLoader === noopImageLoader) {
    let builtInLoaderName = "";
    for (const loader of BUILT_IN_LOADERS) {
      if (loader.testUrl(ngSrc)) {
        builtInLoaderName = loader.name;
        break;
      }
    }
    if (builtInLoaderName) {
      console.warn(formatRuntimeError(2962, `NgOptimizedImage: It looks like your images may be hosted on the ${builtInLoaderName} CDN, but your app is not using Angular's built-in loader for that CDN. We recommend switching to use the built-in by calling \`provide${builtInLoaderName}Loader()\` in your \`providers\` and passing it your instance's base URL. If you don't want to use the built-in loader, define a custom loader function using IMAGE_LOADER to silence this warning.`));
    }
  }
}
function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
  if (dir.ngSrcset && imageLoader === noopImageLoader) {
    console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but no image loader is configured (i.e. the default one is being used), which would result in the same image being used for all configured sizes. To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
  }
}
function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
  if (dir.loaderParams && imageLoader === noopImageLoader) {
    console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but no image loader is configured (i.e. the default one is being used), which means that the loaderParams data will not be consumed and will not affect the URL. To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
  }
}
function round(input2) {
  return Number.isInteger(input2) ? input2 : input2.toFixed(2);
}
function unwrapSafeUrl(value) {
  if (typeof value === "string") {
    return value;
  }
  return unwrapSafeValue(value);
}
function booleanOrDataUrlAttribute(value) {
  if (typeof value === "string" && value.startsWith(`data:`)) {
    return value;
  }
  return booleanAttribute(value);
}

// node_modules/@angular/common/fesm2022/http.mjs
var HttpHandler = class {
};
var HttpBackend = class {
};
var HttpHeaders = class _HttpHeaders {
  /**  Constructs a new HTTP header object with the given values.*/
  constructor(headers) {
    this.normalizedNames = /* @__PURE__ */ new Map();
    this.lazyUpdate = null;
    if (!headers) {
      this.headers = /* @__PURE__ */ new Map();
    } else if (typeof headers === "string") {
      this.lazyInit = () => {
        this.headers = /* @__PURE__ */ new Map();
        headers.split("\n").forEach((line) => {
          const index = line.indexOf(":");
          if (index > 0) {
            const name = line.slice(0, index);
            const key = name.toLowerCase();
            const value = line.slice(index + 1).trim();
            this.maybeSetNormalizedName(name, key);
            if (this.headers.has(key)) {
              this.headers.get(key).push(value);
            } else {
              this.headers.set(key, [value]);
            }
          }
        });
      };
    } else if (typeof Headers !== "undefined" && headers instanceof Headers) {
      this.headers = /* @__PURE__ */ new Map();
      headers.forEach((values, name) => {
        this.setHeaderEntries(name, values);
      });
    } else {
      this.lazyInit = () => {
        if (typeof ngDevMode === "undefined" || ngDevMode) {
          assertValidHeaders(headers);
        }
        this.headers = /* @__PURE__ */ new Map();
        Object.entries(headers).forEach(([name, values]) => {
          this.setHeaderEntries(name, values);
        });
      };
    }
  }
  /**
   * Checks for existence of a given header.
   *
   * @param name The header name to check for existence.
   *
   * @returns True if the header exists, false otherwise.
   */
  has(name) {
    this.init();
    return this.headers.has(name.toLowerCase());
  }
  /**
   * Retrieves the first value of a given header.
   *
   * @param name The header name.
   *
   * @returns The value string if the header exists, null otherwise
   */
  get(name) {
    this.init();
    const values = this.headers.get(name.toLowerCase());
    return values && values.length > 0 ? values[0] : null;
  }
  /**
   * Retrieves the names of the headers.
   *
   * @returns A list of header names.
   */
  keys() {
    this.init();
    return Array.from(this.normalizedNames.values());
  }
  /**
   * Retrieves a list of values for a given header.
   *
   * @param name The header name from which to retrieve values.
   *
   * @returns A string of values if the header exists, null otherwise.
   */
  getAll(name) {
    this.init();
    return this.headers.get(name.toLowerCase()) || null;
  }
  /**
   * Appends a new value to the existing set of values for a header
   * and returns them in a clone of the original instance.
   *
   * @param name The header name for which to append the values.
   * @param value The value to append.
   *
   * @returns A clone of the HTTP headers object with the value appended to the given header.
   */
  append(name, value) {
    return this.clone({
      name,
      value,
      op: "a"
    });
  }
  /**
   * Sets or modifies a value for a given header in a clone of the original instance.
   * If the header already exists, its value is replaced with the given value
   * in the returned object.
   *
   * @param name The header name.
   * @param value The value or values to set or override for the given header.
   *
   * @returns A clone of the HTTP headers object with the newly set header value.
   */
  set(name, value) {
    return this.clone({
      name,
      value,
      op: "s"
    });
  }
  /**
   * Deletes values for a given header in a clone of the original instance.
   *
   * @param name The header name.
   * @param value The value or values to delete for the given header.
   *
   * @returns A clone of the HTTP headers object with the given value deleted.
   */
  delete(name, value) {
    return this.clone({
      name,
      value,
      op: "d"
    });
  }
  maybeSetNormalizedName(name, lcName) {
    if (!this.normalizedNames.has(lcName)) {
      this.normalizedNames.set(lcName, name);
    }
  }
  init() {
    if (!!this.lazyInit) {
      if (this.lazyInit instanceof _HttpHeaders) {
        this.copyFrom(this.lazyInit);
      } else {
        this.lazyInit();
      }
      this.lazyInit = null;
      if (!!this.lazyUpdate) {
        this.lazyUpdate.forEach((update) => this.applyUpdate(update));
        this.lazyUpdate = null;
      }
    }
  }
  copyFrom(other) {
    other.init();
    Array.from(other.headers.keys()).forEach((key) => {
      this.headers.set(key, other.headers.get(key));
      this.normalizedNames.set(key, other.normalizedNames.get(key));
    });
  }
  clone(update) {
    const clone2 = new _HttpHeaders();
    clone2.lazyInit = !!this.lazyInit && this.lazyInit instanceof _HttpHeaders ? this.lazyInit : this;
    clone2.lazyUpdate = (this.lazyUpdate || []).concat([update]);
    return clone2;
  }
  applyUpdate(update) {
    const key = update.name.toLowerCase();
    switch (update.op) {
      case "a":
      case "s":
        let value = update.value;
        if (typeof value === "string") {
          value = [value];
        }
        if (value.length === 0) {
          return;
        }
        this.maybeSetNormalizedName(update.name, key);
        const base = (update.op === "a" ? this.headers.get(key) : void 0) || [];
        base.push(...value);
        this.headers.set(key, base);
        break;
      case "d":
        const toDelete = update.value;
        if (!toDelete) {
          this.headers.delete(key);
          this.normalizedNames.delete(key);
        } else {
          let existing = this.headers.get(key);
          if (!existing) {
            return;
          }
          existing = existing.filter((value2) => toDelete.indexOf(value2) === -1);
          if (existing.length === 0) {
            this.headers.delete(key);
            this.normalizedNames.delete(key);
          } else {
            this.headers.set(key, existing);
          }
        }
        break;
    }
  }
  setHeaderEntries(name, values) {
    const headerValues = (Array.isArray(values) ? values : [values]).map((value) => value.toString());
    const key = name.toLowerCase();
    this.headers.set(key, headerValues);
    this.maybeSetNormalizedName(name, key);
  }
  /**
   * @internal
   */
  forEach(fn) {
    this.init();
    Array.from(this.normalizedNames.keys()).forEach((key) => fn(this.normalizedNames.get(key), this.headers.get(key)));
  }
};
function assertValidHeaders(headers) {
  for (const [key, value] of Object.entries(headers)) {
    if (!(typeof value === "string" || typeof value === "number") && !Array.isArray(value)) {
      throw new Error(`Unexpected value of the \`${key}\` header provided. Expecting either a string, a number or an array, but got: \`${value}\`.`);
    }
  }
}
var HttpUrlEncodingCodec = class {
  /**
   * Encodes a key name for a URL parameter or query-string.
   * @param key The key name.
   * @returns The encoded key name.
   */
  encodeKey(key) {
    return standardEncoding(key);
  }
  /**
   * Encodes the value of a URL parameter or query-string.
   * @param value The value.
   * @returns The encoded value.
   */
  encodeValue(value) {
    return standardEncoding(value);
  }
  /**
   * Decodes an encoded URL parameter or query-string key.
   * @param key The encoded key name.
   * @returns The decoded key name.
   */
  decodeKey(key) {
    return decodeURIComponent(key);
  }
  /**
   * Decodes an encoded URL parameter or query-string value.
   * @param value The encoded value.
   * @returns The decoded value.
   */
  decodeValue(value) {
    return decodeURIComponent(value);
  }
};
function paramParser(rawParams, codec) {
  const map2 = /* @__PURE__ */ new Map();
  if (rawParams.length > 0) {
    const params = rawParams.replace(/^\?/, "").split("&");
    params.forEach((param) => {
      const eqIdx = param.indexOf("=");
      const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ""] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
      const list = map2.get(key) || [];
      list.push(val);
      map2.set(key, list);
    });
  }
  return map2;
}
var STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi;
var STANDARD_ENCODING_REPLACEMENTS = {
  "40": "@",
  "3A": ":",
  "24": "$",
  "2C": ",",
  "3B": ";",
  "3D": "=",
  "3F": "?",
  "2F": "/"
};
function standardEncoding(v) {
  return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);
}
function valueToString(value) {
  return `${value}`;
}
var HttpParams = class _HttpParams {
  constructor(options = {}) {
    this.updates = null;
    this.cloneFrom = null;
    this.encoder = options.encoder || new HttpUrlEncodingCodec();
    if (!!options.fromString) {
      if (!!options.fromObject) {
        throw new Error(`Cannot specify both fromString and fromObject.`);
      }
      this.map = paramParser(options.fromString, this.encoder);
    } else if (!!options.fromObject) {
      this.map = /* @__PURE__ */ new Map();
      Object.keys(options.fromObject).forEach((key) => {
        const value = options.fromObject[key];
        const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];
        this.map.set(key, values);
      });
    } else {
      this.map = null;
    }
  }
  /**
   * Reports whether the body includes one or more values for a given parameter.
   * @param param The parameter name.
   * @returns True if the parameter has one or more values,
   * false if it has no value or is not present.
   */
  has(param) {
    this.init();
    return this.map.has(param);
  }
  /**
   * Retrieves the first value for a parameter.
   * @param param The parameter name.
   * @returns The first value of the given parameter,
   * or `null` if the parameter is not present.
   */
  get(param) {
    this.init();
    const res = this.map.get(param);
    return !!res ? res[0] : null;
  }
  /**
   * Retrieves all values for a  parameter.
   * @param param The parameter name.
   * @returns All values in a string array,
   * or `null` if the parameter not present.
   */
  getAll(param) {
    this.init();
    return this.map.get(param) || null;
  }
  /**
   * Retrieves all the parameters for this body.
   * @returns The parameter names in a string array.
   */
  keys() {
    this.init();
    return Array.from(this.map.keys());
  }
  /**
   * Appends a new value to existing values for a parameter.
   * @param param The parameter name.
   * @param value The new value to add.
   * @return A new body with the appended value.
   */
  append(param, value) {
    return this.clone({
      param,
      value,
      op: "a"
    });
  }
  /**
   * Constructs a new body with appended values for the given parameter name.
   * @param params parameters and values
   * @return A new body with the new value.
   */
  appendAll(params) {
    const updates = [];
    Object.keys(params).forEach((param) => {
      const value = params[param];
      if (Array.isArray(value)) {
        value.forEach((_value) => {
          updates.push({
            param,
            value: _value,
            op: "a"
          });
        });
      } else {
        updates.push({
          param,
          value,
          op: "a"
        });
      }
    });
    return this.clone(updates);
  }
  /**
   * Replaces the value for a parameter.
   * @param param The parameter name.
   * @param value The new value.
   * @return A new body with the new value.
   */
  set(param, value) {
    return this.clone({
      param,
      value,
      op: "s"
    });
  }
  /**
   * Removes a given value or all values from a parameter.
   * @param param The parameter name.
   * @param value The value to remove, if provided.
   * @return A new body with the given value removed, or with all values
   * removed if no value is specified.
   */
  delete(param, value) {
    return this.clone({
      param,
      value,
      op: "d"
    });
  }
  /**
   * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
   * separated by `&`s.
   */
  toString() {
    this.init();
    return this.keys().map((key) => {
      const eKey = this.encoder.encodeKey(key);
      return this.map.get(key).map((value) => eKey + "=" + this.encoder.encodeValue(value)).join("&");
    }).filter((param) => param !== "").join("&");
  }
  clone(update) {
    const clone2 = new _HttpParams({
      encoder: this.encoder
    });
    clone2.cloneFrom = this.cloneFrom || this;
    clone2.updates = (this.updates || []).concat(update);
    return clone2;
  }
  init() {
    if (this.map === null) {
      this.map = /* @__PURE__ */ new Map();
    }
    if (this.cloneFrom !== null) {
      this.cloneFrom.init();
      this.cloneFrom.keys().forEach((key) => this.map.set(key, this.cloneFrom.map.get(key)));
      this.updates.forEach((update) => {
        switch (update.op) {
          case "a":
          case "s":
            const base = (update.op === "a" ? this.map.get(update.param) : void 0) || [];
            base.push(valueToString(update.value));
            this.map.set(update.param, base);
            break;
          case "d":
            if (update.value !== void 0) {
              let base2 = this.map.get(update.param) || [];
              const idx = base2.indexOf(valueToString(update.value));
              if (idx !== -1) {
                base2.splice(idx, 1);
              }
              if (base2.length > 0) {
                this.map.set(update.param, base2);
              } else {
                this.map.delete(update.param);
              }
            } else {
              this.map.delete(update.param);
              break;
            }
        }
      });
      this.cloneFrom = this.updates = null;
    }
  }
};
var HttpContext = class {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  /**
   * Store a value in the context. If a value is already present it will be overwritten.
   *
   * @param token The reference to an instance of `HttpContextToken`.
   * @param value The value to store.
   *
   * @returns A reference to itself for easy chaining.
   */
  set(token, value) {
    this.map.set(token, value);
    return this;
  }
  /**
   * Retrieve the value associated with the given token.
   *
   * @param token The reference to an instance of `HttpContextToken`.
   *
   * @returns The stored value or default if one is defined.
   */
  get(token) {
    if (!this.map.has(token)) {
      this.map.set(token, token.defaultValue());
    }
    return this.map.get(token);
  }
  /**
   * Delete the value associated with the given token.
   *
   * @param token The reference to an instance of `HttpContextToken`.
   *
   * @returns A reference to itself for easy chaining.
   */
  delete(token) {
    this.map.delete(token);
    return this;
  }
  /**
   * Checks for existence of a given token.
   *
   * @param token The reference to an instance of `HttpContextToken`.
   *
   * @returns True if the token exists, false otherwise.
   */
  has(token) {
    return this.map.has(token);
  }
  /**
   * @returns a list of tokens currently stored in the context.
   */
  keys() {
    return this.map.keys();
  }
};
function mightHaveBody(method) {
  switch (method) {
    case "DELETE":
    case "GET":
    case "HEAD":
    case "OPTIONS":
    case "JSONP":
      return false;
    default:
      return true;
  }
}
function isArrayBuffer(value) {
  return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
}
function isBlob(value) {
  return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
  return typeof FormData !== "undefined" && value instanceof FormData;
}
function isUrlSearchParams(value) {
  return typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams;
}
var HttpRequest = class _HttpRequest {
  constructor(method, url, third, fourth) {
    this.url = url;
    this.body = null;
    this.reportProgress = false;
    this.withCredentials = false;
    this.responseType = "json";
    this.method = method.toUpperCase();
    let options;
    if (mightHaveBody(this.method) || !!fourth) {
      this.body = third !== void 0 ? third : null;
      options = fourth;
    } else {
      options = third;
    }
    if (options) {
      this.reportProgress = !!options.reportProgress;
      this.withCredentials = !!options.withCredentials;
      if (!!options.responseType) {
        this.responseType = options.responseType;
      }
      if (!!options.headers) {
        this.headers = options.headers;
      }
      if (!!options.context) {
        this.context = options.context;
      }
      if (!!options.params) {
        this.params = options.params;
      }
      this.transferCache = options.transferCache;
    }
    this.headers ??= new HttpHeaders();
    this.context ??= new HttpContext();
    if (!this.params) {
      this.params = new HttpParams();
      this.urlWithParams = url;
    } else {
      const params = this.params.toString();
      if (params.length === 0) {
        this.urlWithParams = url;
      } else {
        const qIdx = url.indexOf("?");
        const sep = qIdx === -1 ? "?" : qIdx < url.length - 1 ? "&" : "";
        this.urlWithParams = url + sep + params;
      }
    }
  }
  /**
   * Transform the free-form body into a serialized format suitable for
   * transmission to the server.
   */
  serializeBody() {
    if (this.body === null) {
      return null;
    }
    if (typeof this.body === "string" || isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body)) {
      return this.body;
    }
    if (this.body instanceof HttpParams) {
      return this.body.toString();
    }
    if (typeof this.body === "object" || typeof this.body === "boolean" || Array.isArray(this.body)) {
      return JSON.stringify(this.body);
    }
    return this.body.toString();
  }
  /**
   * Examine the body and attempt to infer an appropriate MIME type
   * for it.
   *
   * If no such type can be inferred, this method will return `null`.
   */
  detectContentTypeHeader() {
    if (this.body === null) {
      return null;
    }
    if (isFormData(this.body)) {
      return null;
    }
    if (isBlob(this.body)) {
      return this.body.type || null;
    }
    if (isArrayBuffer(this.body)) {
      return null;
    }
    if (typeof this.body === "string") {
      return "text/plain";
    }
    if (this.body instanceof HttpParams) {
      return "application/x-www-form-urlencoded;charset=UTF-8";
    }
    if (typeof this.body === "object" || typeof this.body === "number" || typeof this.body === "boolean") {
      return "application/json";
    }
    return null;
  }
  clone(update = {}) {
    const method = update.method || this.method;
    const url = update.url || this.url;
    const responseType = update.responseType || this.responseType;
    const transferCache = update.transferCache ?? this.transferCache;
    const body = update.body !== void 0 ? update.body : this.body;
    const withCredentials2 = update.withCredentials ?? this.withCredentials;
    const reportProgress = update.reportProgress ?? this.reportProgress;
    let headers = update.headers || this.headers;
    let params = update.params || this.params;
    const context2 = update.context ?? this.context;
    if (update.setHeaders !== void 0) {
      headers = Object.keys(update.setHeaders).reduce((headers2, name) => headers2.set(name, update.setHeaders[name]), headers);
    }
    if (update.setParams) {
      params = Object.keys(update.setParams).reduce((params2, param) => params2.set(param, update.setParams[param]), params);
    }
    return new _HttpRequest(method, url, body, {
      params,
      headers,
      context: context2,
      reportProgress,
      responseType,
      withCredentials: withCredentials2,
      transferCache
    });
  }
};
var HttpEventType;
(function(HttpEventType2) {
  HttpEventType2[HttpEventType2["Sent"] = 0] = "Sent";
  HttpEventType2[HttpEventType2["UploadProgress"] = 1] = "UploadProgress";
  HttpEventType2[HttpEventType2["ResponseHeader"] = 2] = "ResponseHeader";
  HttpEventType2[HttpEventType2["DownloadProgress"] = 3] = "DownloadProgress";
  HttpEventType2[HttpEventType2["Response"] = 4] = "Response";
  HttpEventType2[HttpEventType2["User"] = 5] = "User";
})(HttpEventType || (HttpEventType = {}));
var HttpResponseBase = class {
  /**
   * Super-constructor for all responses.
   *
   * The single parameter accepted is an initialization hash. Any properties
   * of the response passed there will override the default values.
   */
  constructor(init31, defaultStatus = 200, defaultStatusText = "OK") {
    this.headers = init31.headers || new HttpHeaders();
    this.status = init31.status !== void 0 ? init31.status : defaultStatus;
    this.statusText = init31.statusText || defaultStatusText;
    this.url = init31.url || null;
    this.ok = this.status >= 200 && this.status < 300;
  }
};
var HttpHeaderResponse = class _HttpHeaderResponse extends HttpResponseBase {
  /**
   * Create a new `HttpHeaderResponse` with the given parameters.
   */
  constructor(init31 = {}) {
    super(init31);
    this.type = HttpEventType.ResponseHeader;
  }
  /**
   * Copy this `HttpHeaderResponse`, overriding its contents with the
   * given parameter hash.
   */
  clone(update = {}) {
    return new _HttpHeaderResponse({
      headers: update.headers || this.headers,
      status: update.status !== void 0 ? update.status : this.status,
      statusText: update.statusText || this.statusText,
      url: update.url || this.url || void 0
    });
  }
};
var HttpResponse = class _HttpResponse extends HttpResponseBase {
  /**
   * Construct a new `HttpResponse`.
   */
  constructor(init31 = {}) {
    super(init31);
    this.type = HttpEventType.Response;
    this.body = init31.body !== void 0 ? init31.body : null;
  }
  clone(update = {}) {
    return new _HttpResponse({
      body: update.body !== void 0 ? update.body : this.body,
      headers: update.headers || this.headers,
      status: update.status !== void 0 ? update.status : this.status,
      statusText: update.statusText || this.statusText,
      url: update.url || this.url || void 0
    });
  }
};
var HttpErrorResponse = class extends HttpResponseBase {
  constructor(init31) {
    super(init31, 0, "Unknown Error");
    this.name = "HttpErrorResponse";
    this.ok = false;
    if (this.status >= 200 && this.status < 300) {
      this.message = `Http failure during parsing for ${init31.url || "(unknown url)"}`;
    } else {
      this.message = `Http failure response for ${init31.url || "(unknown url)"}: ${init31.status} ${init31.statusText}`;
    }
    this.error = init31.error || null;
  }
};
var HTTP_STATUS_CODE_OK = 200;
var HTTP_STATUS_CODE_NO_CONTENT = 204;
var HttpStatusCode;
(function(HttpStatusCode2) {
  HttpStatusCode2[HttpStatusCode2["Continue"] = 100] = "Continue";
  HttpStatusCode2[HttpStatusCode2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
  HttpStatusCode2[HttpStatusCode2["Processing"] = 102] = "Processing";
  HttpStatusCode2[HttpStatusCode2["EarlyHints"] = 103] = "EarlyHints";
  HttpStatusCode2[HttpStatusCode2["Ok"] = 200] = "Ok";
  HttpStatusCode2[HttpStatusCode2["Created"] = 201] = "Created";
  HttpStatusCode2[HttpStatusCode2["Accepted"] = 202] = "Accepted";
  HttpStatusCode2[HttpStatusCode2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
  HttpStatusCode2[HttpStatusCode2["NoContent"] = 204] = "NoContent";
  HttpStatusCode2[HttpStatusCode2["ResetContent"] = 205] = "ResetContent";
  HttpStatusCode2[HttpStatusCode2["PartialContent"] = 206] = "PartialContent";
  HttpStatusCode2[HttpStatusCode2["MultiStatus"] = 207] = "MultiStatus";
  HttpStatusCode2[HttpStatusCode2["AlreadyReported"] = 208] = "AlreadyReported";
  HttpStatusCode2[HttpStatusCode2["ImUsed"] = 226] = "ImUsed";
  HttpStatusCode2[HttpStatusCode2["MultipleChoices"] = 300] = "MultipleChoices";
  HttpStatusCode2[HttpStatusCode2["MovedPermanently"] = 301] = "MovedPermanently";
  HttpStatusCode2[HttpStatusCode2["Found"] = 302] = "Found";
  HttpStatusCode2[HttpStatusCode2["SeeOther"] = 303] = "SeeOther";
  HttpStatusCode2[HttpStatusCode2["NotModified"] = 304] = "NotModified";
  HttpStatusCode2[HttpStatusCode2["UseProxy"] = 305] = "UseProxy";
  HttpStatusCode2[HttpStatusCode2["Unused"] = 306] = "Unused";
  HttpStatusCode2[HttpStatusCode2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  HttpStatusCode2[HttpStatusCode2["PermanentRedirect"] = 308] = "PermanentRedirect";
  HttpStatusCode2[HttpStatusCode2["BadRequest"] = 400] = "BadRequest";
  HttpStatusCode2[HttpStatusCode2["Unauthorized"] = 401] = "Unauthorized";
  HttpStatusCode2[HttpStatusCode2["PaymentRequired"] = 402] = "PaymentRequired";
  HttpStatusCode2[HttpStatusCode2["Forbidden"] = 403] = "Forbidden";
  HttpStatusCode2[HttpStatusCode2["NotFound"] = 404] = "NotFound";
  HttpStatusCode2[HttpStatusCode2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  HttpStatusCode2[HttpStatusCode2["NotAcceptable"] = 406] = "NotAcceptable";
  HttpStatusCode2[HttpStatusCode2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  HttpStatusCode2[HttpStatusCode2["RequestTimeout"] = 408] = "RequestTimeout";
  HttpStatusCode2[HttpStatusCode2["Conflict"] = 409] = "Conflict";
  HttpStatusCode2[HttpStatusCode2["Gone"] = 410] = "Gone";
  HttpStatusCode2[HttpStatusCode2["LengthRequired"] = 411] = "LengthRequired";
  HttpStatusCode2[HttpStatusCode2["PreconditionFailed"] = 412] = "PreconditionFailed";
  HttpStatusCode2[HttpStatusCode2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
  HttpStatusCode2[HttpStatusCode2["UriTooLong"] = 414] = "UriTooLong";
  HttpStatusCode2[HttpStatusCode2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
  HttpStatusCode2[HttpStatusCode2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
  HttpStatusCode2[HttpStatusCode2["ExpectationFailed"] = 417] = "ExpectationFailed";
  HttpStatusCode2[HttpStatusCode2["ImATeapot"] = 418] = "ImATeapot";
  HttpStatusCode2[HttpStatusCode2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
  HttpStatusCode2[HttpStatusCode2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
  HttpStatusCode2[HttpStatusCode2["Locked"] = 423] = "Locked";
  HttpStatusCode2[HttpStatusCode2["FailedDependency"] = 424] = "FailedDependency";
  HttpStatusCode2[HttpStatusCode2["TooEarly"] = 425] = "TooEarly";
  HttpStatusCode2[HttpStatusCode2["UpgradeRequired"] = 426] = "UpgradeRequired";
  HttpStatusCode2[HttpStatusCode2["PreconditionRequired"] = 428] = "PreconditionRequired";
  HttpStatusCode2[HttpStatusCode2["TooManyRequests"] = 429] = "TooManyRequests";
  HttpStatusCode2[HttpStatusCode2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
  HttpStatusCode2[HttpStatusCode2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
  HttpStatusCode2[HttpStatusCode2["InternalServerError"] = 500] = "InternalServerError";
  HttpStatusCode2[HttpStatusCode2["NotImplemented"] = 501] = "NotImplemented";
  HttpStatusCode2[HttpStatusCode2["BadGateway"] = 502] = "BadGateway";
  HttpStatusCode2[HttpStatusCode2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  HttpStatusCode2[HttpStatusCode2["GatewayTimeout"] = 504] = "GatewayTimeout";
  HttpStatusCode2[HttpStatusCode2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
  HttpStatusCode2[HttpStatusCode2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
  HttpStatusCode2[HttpStatusCode2["InsufficientStorage"] = 507] = "InsufficientStorage";
  HttpStatusCode2[HttpStatusCode2["LoopDetected"] = 508] = "LoopDetected";
  HttpStatusCode2[HttpStatusCode2["NotExtended"] = 510] = "NotExtended";
  HttpStatusCode2[HttpStatusCode2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
})(HttpStatusCode || (HttpStatusCode = {}));
function addBody(options, body) {
  return {
    body,
    headers: options.headers,
    context: options.context,
    observe: options.observe,
    params: options.params,
    reportProgress: options.reportProgress,
    responseType: options.responseType,
    withCredentials: options.withCredentials,
    transferCache: options.transferCache
  };
}
var _HttpClient = class _HttpClient {
  constructor(handler) {
    this.handler = handler;
  }
  /**
   * Constructs an observable for a generic HTTP request that, when subscribed,
   * fires the request through the chain of registered interceptors and on to the
   * server.
   *
   * You can pass an `HttpRequest` directly as the only parameter. In this case,
   * the call returns an observable of the raw `HttpEvent` stream.
   *
   * Alternatively you can pass an HTTP method as the first parameter,
   * a URL string as the second, and an options hash containing the request body as the third.
   * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the
   * type of returned observable.
   *   * The `responseType` value determines how a successful response body is parsed.
   *   * If `responseType` is the default `json`, you can pass a type interface for the resulting
   * object as a type parameter to the call.
   *
   * The `observe` value determines the return type, according to what you are interested in
   * observing.
   *   * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
   * progress events by default.
   *   * An `observe` value of response returns an observable of `HttpResponse<T>`,
   * where the `T` parameter depends on the `responseType` and any optionally provided type
   * parameter.
   *   * An `observe` value of body returns an observable of `<T>` with the same `T` body type.
   *
   */
  request(first2, url, options = {}) {
    let req;
    if (first2 instanceof HttpRequest) {
      req = first2;
    } else {
      let headers = void 0;
      if (options.headers instanceof HttpHeaders) {
        headers = options.headers;
      } else {
        headers = new HttpHeaders(options.headers);
      }
      let params = void 0;
      if (!!options.params) {
        if (options.params instanceof HttpParams) {
          params = options.params;
        } else {
          params = new HttpParams({
            fromObject: options.params
          });
        }
      }
      req = new HttpRequest(first2, url, options.body !== void 0 ? options.body : null, {
        headers,
        context: options.context,
        params,
        reportProgress: options.reportProgress,
        // By default, JSON is assumed to be returned for all calls.
        responseType: options.responseType || "json",
        withCredentials: options.withCredentials,
        transferCache: options.transferCache
      });
    }
    const events$ = of(req).pipe(concatMap((req2) => this.handler.handle(req2)));
    if (first2 instanceof HttpRequest || options.observe === "events") {
      return events$;
    }
    const res$ = events$.pipe(filter((event) => event instanceof HttpResponse));
    switch (options.observe || "body") {
      case "body":
        switch (req.responseType) {
          case "arraybuffer":
            return res$.pipe(map((res) => {
              if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
                throw new Error("Response is not an ArrayBuffer.");
              }
              return res.body;
            }));
          case "blob":
            return res$.pipe(map((res) => {
              if (res.body !== null && !(res.body instanceof Blob)) {
                throw new Error("Response is not a Blob.");
              }
              return res.body;
            }));
          case "text":
            return res$.pipe(map((res) => {
              if (res.body !== null && typeof res.body !== "string") {
                throw new Error("Response is not a string.");
              }
              return res.body;
            }));
          case "json":
          default:
            return res$.pipe(map((res) => res.body));
        }
      case "response":
        return res$;
      default:
        throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);
    }
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `DELETE` request to execute on the server. See the individual overloads for
   * details on the return type.
   *
   * @param url     The endpoint URL.
   * @param options The HTTP options to send with the request.
   *
   */
  delete(url, options = {}) {
    return this.request("DELETE", url, options);
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `GET` request to execute on the server. See the individual overloads for
   * details on the return type.
   */
  get(url, options = {}) {
    return this.request("GET", url, options);
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `HEAD` request to execute on the server. The `HEAD` method returns
   * meta information about the resource without transferring the
   * resource itself. See the individual overloads for
   * details on the return type.
   */
  head(url, options = {}) {
    return this.request("HEAD", url, options);
  }
  /**
   * Constructs an `Observable` that, when subscribed, causes a request with the special method
   * `JSONP` to be dispatched via the interceptor pipeline.
   * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain
   * API endpoints that don't support newer,
   * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.
   * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the
   * requests even if the API endpoint is not located on the same domain (origin) as the client-side
   * application making the request.
   * The endpoint API must support JSONP callback for JSONP requests to work.
   * The resource API returns the JSON response wrapped in a callback function.
   * You can pass the callback function name as one of the query parameters.
   * Note that JSONP requests can only be used with `GET` requests.
   *
   * @param url The resource URL.
   * @param callbackParam The callback function name.
   *
   */
  jsonp(url, callbackParam) {
    return this.request("JSONP", url, {
      params: new HttpParams().append(callbackParam, "JSONP_CALLBACK"),
      observe: "body",
      responseType: "json"
    });
  }
  /**
   * Constructs an `Observable` that, when subscribed, causes the configured
   * `OPTIONS` request to execute on the server. This method allows the client
   * to determine the supported HTTP methods and other capabilities of an endpoint,
   * without implying a resource action. See the individual overloads for
   * details on the return type.
   */
  options(url, options = {}) {
    return this.request("OPTIONS", url, options);
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `PATCH` request to execute on the server. See the individual overloads for
   * details on the return type.
   */
  patch(url, body, options = {}) {
    return this.request("PATCH", url, addBody(options, body));
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `POST` request to execute on the server. The server responds with the location of
   * the replaced resource. See the individual overloads for
   * details on the return type.
   */
  post(url, body, options = {}) {
    return this.request("POST", url, addBody(options, body));
  }
  /**
   * Constructs an observable that, when subscribed, causes the configured
   * `PUT` request to execute on the server. The `PUT` method replaces an existing resource
   * with a new set of values.
   * See the individual overloads for details on the return type.
   */
  put(url, body, options = {}) {
    return this.request("PUT", url, addBody(options, body));
  }
};
_HttpClient.\u0275fac = function HttpClient_Factory(t) {
  return new (t || _HttpClient)(\u0275\u0275inject(HttpHandler));
};
_HttpClient.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HttpClient,
  factory: _HttpClient.\u0275fac
});
var HttpClient = _HttpClient;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClient, [{
    type: Injectable
  }], () => [{
    type: HttpHandler
  }], null);
})();
var XSSI_PREFIX$1 = /^\)\]\}',?\n/;
var REQUEST_URL_HEADER = `X-Request-URL`;
function getResponseUrl$1(response) {
  if (response.url) {
    return response.url;
  }
  const xRequestUrl = REQUEST_URL_HEADER.toLocaleLowerCase();
  return response.headers.get(xRequestUrl);
}
var _FetchBackend = class _FetchBackend {
  constructor() {
    this.fetchImpl = inject(FetchFactory, {
      optional: true
    })?.fetch ?? fetch.bind(globalThis);
    this.ngZone = inject(NgZone);
  }
  handle(request) {
    return new Observable((observer) => {
      const aborter = new AbortController();
      this.doRequest(request, aborter.signal, observer).then(noop3, (error3) => observer.error(new HttpErrorResponse({
        error: error3
      })));
      return () => aborter.abort();
    });
  }
  doRequest(request, signal2, observer) {
    return __async(this, null, function* () {
      const init31 = this.createRequestInit(request);
      let response;
      try {
        const fetchPromise = this.fetchImpl(request.urlWithParams, __spreadValues({
          signal: signal2
        }, init31));
        silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
        observer.next({
          type: HttpEventType.Sent
        });
        response = yield fetchPromise;
      } catch (error3) {
        observer.error(new HttpErrorResponse({
          error: error3,
          status: error3.status ?? 0,
          statusText: error3.statusText,
          url: request.urlWithParams,
          headers: error3.headers
        }));
        return;
      }
      const headers = new HttpHeaders(response.headers);
      const statusText = response.statusText;
      const url = getResponseUrl$1(response) ?? request.urlWithParams;
      let status = response.status;
      let body = null;
      if (request.reportProgress) {
        observer.next(new HttpHeaderResponse({
          headers,
          status,
          statusText,
          url
        }));
      }
      if (response.body) {
        const contentLength = response.headers.get("content-length");
        const chunks = [];
        const reader = response.body.getReader();
        let receivedLength = 0;
        let decoder;
        let partialText;
        const reqZone = typeof Zone !== "undefined" && Zone.current;
        yield this.ngZone.runOutsideAngular(() => __async(this, null, function* () {
          while (true) {
            const {
              done,
              value
            } = yield reader.read();
            if (done) {
              break;
            }
            chunks.push(value);
            receivedLength += value.length;
            if (request.reportProgress) {
              partialText = request.responseType === "text" ? (partialText ?? "") + (decoder ??= new TextDecoder()).decode(value, {
                stream: true
              }) : void 0;
              const reportProgress = () => observer.next({
                type: HttpEventType.DownloadProgress,
                total: contentLength ? +contentLength : void 0,
                loaded: receivedLength,
                partialText
              });
              reqZone ? reqZone.run(reportProgress) : reportProgress();
            }
          }
        }));
        const chunksAll = this.concatChunks(chunks, receivedLength);
        try {
          const contentType = response.headers.get("Content-Type") ?? "";
          body = this.parseBody(request, chunksAll, contentType);
        } catch (error3) {
          observer.error(new HttpErrorResponse({
            error: error3,
            headers: new HttpHeaders(response.headers),
            status: response.status,
            statusText: response.statusText,
            url: getResponseUrl$1(response) ?? request.urlWithParams
          }));
          return;
        }
      }
      if (status === 0) {
        status = body ? HTTP_STATUS_CODE_OK : 0;
      }
      const ok = status >= 200 && status < 300;
      if (ok) {
        observer.next(new HttpResponse({
          body,
          headers,
          status,
          statusText,
          url
        }));
        observer.complete();
      } else {
        observer.error(new HttpErrorResponse({
          error: body,
          headers,
          status,
          statusText,
          url
        }));
      }
    });
  }
  parseBody(request, binContent, contentType) {
    switch (request.responseType) {
      case "json":
        const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, "");
        return text === "" ? null : JSON.parse(text);
      case "text":
        return new TextDecoder().decode(binContent);
      case "blob":
        return new Blob([binContent], {
          type: contentType
        });
      case "arraybuffer":
        return binContent.buffer;
    }
  }
  createRequestInit(req) {
    const headers = {};
    const credentials = req.withCredentials ? "include" : void 0;
    req.headers.forEach((name, values) => headers[name] = values.join(","));
    headers["Accept"] ??= "application/json, text/plain, */*";
    if (!headers["Content-Type"]) {
      const detectedType = req.detectContentTypeHeader();
      if (detectedType !== null) {
        headers["Content-Type"] = detectedType;
      }
    }
    return {
      body: req.serializeBody(),
      method: req.method,
      headers,
      credentials
    };
  }
  concatChunks(chunks, totalLength) {
    const chunksAll = new Uint8Array(totalLength);
    let position = 0;
    for (const chunk2 of chunks) {
      chunksAll.set(chunk2, position);
      position += chunk2.length;
    }
    return chunksAll;
  }
};
_FetchBackend.\u0275fac = function FetchBackend_Factory(t) {
  return new (t || _FetchBackend)();
};
_FetchBackend.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FetchBackend,
  factory: _FetchBackend.\u0275fac
});
var FetchBackend = _FetchBackend;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FetchBackend, [{
    type: Injectable
  }], null, null);
})();
var FetchFactory = class {
};
function noop3() {
}
function silenceSuperfluousUnhandledPromiseRejection(promise) {
  promise.then(noop3, noop3);
}
function interceptorChainEndFn(req, finalHandlerFn) {
  return finalHandlerFn(req);
}
function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
  return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {
    handle: (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)
  });
}
function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
  return (initialRequest, finalHandlerFn) => runInInjectionContext(injector, () => interceptorFn(initialRequest, (downstreamRequest) => chainTailFn(downstreamRequest, finalHandlerFn)));
}
var HTTP_INTERCEPTORS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTORS" : "");
var HTTP_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_INTERCEPTOR_FNS" : "");
var HTTP_ROOT_INTERCEPTOR_FNS = new InjectionToken(ngDevMode ? "HTTP_ROOT_INTERCEPTOR_FNS" : "");
var REQUESTS_CONTRIBUTE_TO_STABILITY = new InjectionToken(ngDevMode ? "REQUESTS_CONTRIBUTE_TO_STABILITY" : "", {
  providedIn: "root",
  factory: () => true
});
function legacyInterceptorFnFactory() {
  let chain = null;
  return (req, handler) => {
    if (chain === null) {
      const interceptors = inject(HTTP_INTERCEPTORS, {
        optional: true
      }) ?? [];
      chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
    }
    const pendingTasks = inject(PendingTasks);
    const contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
    if (contributeToStability) {
      const taskId = pendingTasks.add();
      return chain(req, handler).pipe(finalize(() => pendingTasks.remove(taskId)));
    } else {
      return chain(req, handler);
    }
  };
}
var fetchBackendWarningDisplayed = false;
var _HttpInterceptorHandler = class _HttpInterceptorHandler extends HttpHandler {
  constructor(backend, injector) {
    super();
    this.backend = backend;
    this.injector = injector;
    this.chain = null;
    this.pendingTasks = inject(PendingTasks);
    this.contributeToStability = inject(REQUESTS_CONTRIBUTE_TO_STABILITY);
    if ((typeof ngDevMode === "undefined" || ngDevMode) && !fetchBackendWarningDisplayed) {
      const isServer = isPlatformServer(injector.get(PLATFORM_ID));
      if (isServer && !(this.backend instanceof FetchBackend)) {
        fetchBackendWarningDisplayed = true;
        injector.get(Console).warn(formatRuntimeError(2801, "Angular detected that `HttpClient` is not configured to use `fetch` APIs. It's strongly recommended to enable `fetch` for applications that use Server-Side Rendering for better performance and compatibility. To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` call at the root of the application."));
      }
    }
  }
  handle(initialRequest) {
    if (this.chain === null) {
      const dedupedInterceptorFns = Array.from(/* @__PURE__ */ new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])]));
      this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
    }
    if (this.contributeToStability) {
      const taskId = this.pendingTasks.add();
      return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest)).pipe(finalize(() => this.pendingTasks.remove(taskId)));
    } else {
      return this.chain(initialRequest, (downstreamRequest) => this.backend.handle(downstreamRequest));
    }
  }
};
_HttpInterceptorHandler.\u0275fac = function HttpInterceptorHandler_Factory(t) {
  return new (t || _HttpInterceptorHandler)(\u0275\u0275inject(HttpBackend), \u0275\u0275inject(EnvironmentInjector));
};
_HttpInterceptorHandler.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HttpInterceptorHandler,
  factory: _HttpInterceptorHandler.\u0275fac
});
var HttpInterceptorHandler = _HttpInterceptorHandler;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpInterceptorHandler, [{
    type: Injectable
  }], () => [{
    type: HttpBackend
  }, {
    type: EnvironmentInjector
  }], null);
})();
var nextRequestId = 0;
var foreignDocument;
var JSONP_ERR_NO_CALLBACK = "JSONP injected script did not invoke callback.";
var JSONP_ERR_WRONG_METHOD = "JSONP requests must use JSONP request method.";
var JSONP_ERR_WRONG_RESPONSE_TYPE = "JSONP requests must use Json response type.";
var JSONP_ERR_HEADERS_NOT_SUPPORTED = "JSONP requests do not support headers.";
var JsonpCallbackContext = class {
};
function jsonpCallbackContext() {
  if (typeof window === "object") {
    return window;
  }
  return {};
}
var _JsonpClientBackend = class _JsonpClientBackend {
  constructor(callbackMap, document2) {
    this.callbackMap = callbackMap;
    this.document = document2;
    this.resolvedPromise = Promise.resolve();
  }
  /**
   * Get the name of the next callback method, by incrementing the global `nextRequestId`.
   */
  nextCallback() {
    return `ng_jsonp_callback_${nextRequestId++}`;
  }
  /**
   * Processes a JSONP request and returns an event stream of the results.
   * @param req The request object.
   * @returns An observable of the response events.
   *
   */
  handle(req) {
    if (req.method !== "JSONP") {
      throw new Error(JSONP_ERR_WRONG_METHOD);
    } else if (req.responseType !== "json") {
      throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);
    }
    if (req.headers.keys().length > 0) {
      throw new Error(JSONP_ERR_HEADERS_NOT_SUPPORTED);
    }
    return new Observable((observer) => {
      const callback = this.nextCallback();
      const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`);
      const node = this.document.createElement("script");
      node.src = url;
      let body = null;
      let finished = false;
      this.callbackMap[callback] = (data) => {
        delete this.callbackMap[callback];
        body = data;
        finished = true;
      };
      const cleanup = () => {
        if (node.parentNode) {
          node.parentNode.removeChild(node);
        }
        delete this.callbackMap[callback];
      };
      const onLoad = (event) => {
        this.resolvedPromise.then(() => {
          cleanup();
          if (!finished) {
            observer.error(new HttpErrorResponse({
              url,
              status: 0,
              statusText: "JSONP Error",
              error: new Error(JSONP_ERR_NO_CALLBACK)
            }));
            return;
          }
          observer.next(new HttpResponse({
            body,
            status: HTTP_STATUS_CODE_OK,
            statusText: "OK",
            url
          }));
          observer.complete();
        });
      };
      const onError = (error3) => {
        cleanup();
        observer.error(new HttpErrorResponse({
          error: error3,
          status: 0,
          statusText: "JSONP Error",
          url
        }));
      };
      node.addEventListener("load", onLoad);
      node.addEventListener("error", onError);
      this.document.body.appendChild(node);
      observer.next({
        type: HttpEventType.Sent
      });
      return () => {
        if (!finished) {
          this.removeListeners(node);
        }
        cleanup();
      };
    });
  }
  removeListeners(script) {
    foreignDocument ??= this.document.implementation.createHTMLDocument();
    foreignDocument.adoptNode(script);
  }
};
_JsonpClientBackend.\u0275fac = function JsonpClientBackend_Factory(t) {
  return new (t || _JsonpClientBackend)(\u0275\u0275inject(JsonpCallbackContext), \u0275\u0275inject(DOCUMENT2));
};
_JsonpClientBackend.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _JsonpClientBackend,
  factory: _JsonpClientBackend.\u0275fac
});
var JsonpClientBackend = _JsonpClientBackend;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpClientBackend, [{
    type: Injectable
  }], () => [{
    type: JsonpCallbackContext
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
function jsonpInterceptorFn(req, next) {
  if (req.method === "JSONP") {
    return inject(JsonpClientBackend).handle(req);
  }
  return next(req);
}
var _JsonpInterceptor = class _JsonpInterceptor {
  constructor(injector) {
    this.injector = injector;
  }
  /**
   * Identifies and handles a given JSONP request.
   * @param initialRequest The outgoing request object to handle.
   * @param next The next interceptor in the chain, or the backend
   * if no interceptors remain in the chain.
   * @returns An observable of the event stream.
   */
  intercept(initialRequest, next) {
    return runInInjectionContext(this.injector, () => jsonpInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
  }
};
_JsonpInterceptor.\u0275fac = function JsonpInterceptor_Factory(t) {
  return new (t || _JsonpInterceptor)(\u0275\u0275inject(EnvironmentInjector));
};
_JsonpInterceptor.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _JsonpInterceptor,
  factory: _JsonpInterceptor.\u0275fac
});
var JsonpInterceptor = _JsonpInterceptor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonpInterceptor, [{
    type: Injectable
  }], () => [{
    type: EnvironmentInjector
  }], null);
})();
var XSSI_PREFIX = /^\)\]\}',?\n/;
function getResponseUrl(xhr2) {
  if ("responseURL" in xhr2 && xhr2.responseURL) {
    return xhr2.responseURL;
  }
  if (/^X-Request-URL:/m.test(xhr2.getAllResponseHeaders())) {
    return xhr2.getResponseHeader("X-Request-URL");
  }
  return null;
}
var _HttpXhrBackend = class _HttpXhrBackend {
  constructor(xhrFactory) {
    this.xhrFactory = xhrFactory;
  }
  /**
   * Processes a request and returns a stream of response events.
   * @param req The request object.
   * @returns An observable of the response events.
   */
  handle(req) {
    if (req.method === "JSONP") {
      throw new RuntimeError(-2800, (typeof ngDevMode === "undefined" || ngDevMode) && `Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`);
    }
    const xhrFactory = this.xhrFactory;
    const source = xhrFactory.\u0275loadImpl ? from(xhrFactory.\u0275loadImpl()) : of(null);
    return source.pipe(switchMap(() => {
      return new Observable((observer) => {
        const xhr2 = xhrFactory.build();
        xhr2.open(req.method, req.urlWithParams);
        if (req.withCredentials) {
          xhr2.withCredentials = true;
        }
        req.headers.forEach((name, values) => xhr2.setRequestHeader(name, values.join(",")));
        if (!req.headers.has("Accept")) {
          xhr2.setRequestHeader("Accept", "application/json, text/plain, */*");
        }
        if (!req.headers.has("Content-Type")) {
          const detectedType = req.detectContentTypeHeader();
          if (detectedType !== null) {
            xhr2.setRequestHeader("Content-Type", detectedType);
          }
        }
        if (req.responseType) {
          const responseType = req.responseType.toLowerCase();
          xhr2.responseType = responseType !== "json" ? responseType : "text";
        }
        const reqBody = req.serializeBody();
        let headerResponse = null;
        const partialFromXhr = () => {
          if (headerResponse !== null) {
            return headerResponse;
          }
          const statusText = xhr2.statusText || "OK";
          const headers = new HttpHeaders(xhr2.getAllResponseHeaders());
          const url = getResponseUrl(xhr2) || req.url;
          headerResponse = new HttpHeaderResponse({
            headers,
            status: xhr2.status,
            statusText,
            url
          });
          return headerResponse;
        };
        const onLoad = () => {
          let {
            headers,
            status,
            statusText,
            url
          } = partialFromXhr();
          let body = null;
          if (status !== HTTP_STATUS_CODE_NO_CONTENT) {
            body = typeof xhr2.response === "undefined" ? xhr2.responseText : xhr2.response;
          }
          if (status === 0) {
            status = !!body ? HTTP_STATUS_CODE_OK : 0;
          }
          let ok = status >= 200 && status < 300;
          if (req.responseType === "json" && typeof body === "string") {
            const originalBody = body;
            body = body.replace(XSSI_PREFIX, "");
            try {
              body = body !== "" ? JSON.parse(body) : null;
            } catch (error3) {
              body = originalBody;
              if (ok) {
                ok = false;
                body = {
                  error: error3,
                  text: body
                };
              }
            }
          }
          if (ok) {
            observer.next(new HttpResponse({
              body,
              headers,
              status,
              statusText,
              url: url || void 0
            }));
            observer.complete();
          } else {
            observer.error(new HttpErrorResponse({
              // The error in this case is the response body (error from the server).
              error: body,
              headers,
              status,
              statusText,
              url: url || void 0
            }));
          }
        };
        const onError = (error3) => {
          const {
            url
          } = partialFromXhr();
          const res = new HttpErrorResponse({
            error: error3,
            status: xhr2.status || 0,
            statusText: xhr2.statusText || "Unknown Error",
            url: url || void 0
          });
          observer.error(res);
        };
        let sentHeaders = false;
        const onDownProgress = (event) => {
          if (!sentHeaders) {
            observer.next(partialFromXhr());
            sentHeaders = true;
          }
          let progressEvent = {
            type: HttpEventType.DownloadProgress,
            loaded: event.loaded
          };
          if (event.lengthComputable) {
            progressEvent.total = event.total;
          }
          if (req.responseType === "text" && !!xhr2.responseText) {
            progressEvent.partialText = xhr2.responseText;
          }
          observer.next(progressEvent);
        };
        const onUpProgress = (event) => {
          let progress = {
            type: HttpEventType.UploadProgress,
            loaded: event.loaded
          };
          if (event.lengthComputable) {
            progress.total = event.total;
          }
          observer.next(progress);
        };
        xhr2.addEventListener("load", onLoad);
        xhr2.addEventListener("error", onError);
        xhr2.addEventListener("timeout", onError);
        xhr2.addEventListener("abort", onError);
        if (req.reportProgress) {
          xhr2.addEventListener("progress", onDownProgress);
          if (reqBody !== null && xhr2.upload) {
            xhr2.upload.addEventListener("progress", onUpProgress);
          }
        }
        xhr2.send(reqBody);
        observer.next({
          type: HttpEventType.Sent
        });
        return () => {
          xhr2.removeEventListener("error", onError);
          xhr2.removeEventListener("abort", onError);
          xhr2.removeEventListener("load", onLoad);
          xhr2.removeEventListener("timeout", onError);
          if (req.reportProgress) {
            xhr2.removeEventListener("progress", onDownProgress);
            if (reqBody !== null && xhr2.upload) {
              xhr2.upload.removeEventListener("progress", onUpProgress);
            }
          }
          if (xhr2.readyState !== xhr2.DONE) {
            xhr2.abort();
          }
        };
      });
    }));
  }
};
_HttpXhrBackend.\u0275fac = function HttpXhrBackend_Factory(t) {
  return new (t || _HttpXhrBackend)(\u0275\u0275inject(XhrFactory));
};
_HttpXhrBackend.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HttpXhrBackend,
  factory: _HttpXhrBackend.\u0275fac
});
var HttpXhrBackend = _HttpXhrBackend;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXhrBackend, [{
    type: Injectable
  }], () => [{
    type: XhrFactory
  }], null);
})();
var XSRF_ENABLED = new InjectionToken(ngDevMode ? "XSRF_ENABLED" : "");
var XSRF_DEFAULT_COOKIE_NAME = "XSRF-TOKEN";
var XSRF_COOKIE_NAME = new InjectionToken(ngDevMode ? "XSRF_COOKIE_NAME" : "", {
  providedIn: "root",
  factory: () => XSRF_DEFAULT_COOKIE_NAME
});
var XSRF_DEFAULT_HEADER_NAME = "X-XSRF-TOKEN";
var XSRF_HEADER_NAME = new InjectionToken(ngDevMode ? "XSRF_HEADER_NAME" : "", {
  providedIn: "root",
  factory: () => XSRF_DEFAULT_HEADER_NAME
});
var HttpXsrfTokenExtractor = class {
};
var _HttpXsrfCookieExtractor = class _HttpXsrfCookieExtractor {
  constructor(doc, platform, cookieName) {
    this.doc = doc;
    this.platform = platform;
    this.cookieName = cookieName;
    this.lastCookieString = "";
    this.lastToken = null;
    this.parseCount = 0;
  }
  getToken() {
    if (this.platform === "server") {
      return null;
    }
    const cookieString = this.doc.cookie || "";
    if (cookieString !== this.lastCookieString) {
      this.parseCount++;
      this.lastToken = parseCookieValue(cookieString, this.cookieName);
      this.lastCookieString = cookieString;
    }
    return this.lastToken;
  }
};
_HttpXsrfCookieExtractor.\u0275fac = function HttpXsrfCookieExtractor_Factory(t) {
  return new (t || _HttpXsrfCookieExtractor)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(PLATFORM_ID), \u0275\u0275inject(XSRF_COOKIE_NAME));
};
_HttpXsrfCookieExtractor.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HttpXsrfCookieExtractor,
  factory: _HttpXsrfCookieExtractor.\u0275fac
});
var HttpXsrfCookieExtractor = _HttpXsrfCookieExtractor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfCookieExtractor, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [PLATFORM_ID]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [XSRF_COOKIE_NAME]
    }]
  }], null);
})();
function xsrfInterceptorFn(req, next) {
  const lcUrl = req.url.toLowerCase();
  if (!inject(XSRF_ENABLED) || req.method === "GET" || req.method === "HEAD" || lcUrl.startsWith("http://") || lcUrl.startsWith("https://")) {
    return next(req);
  }
  const token = inject(HttpXsrfTokenExtractor).getToken();
  const headerName = inject(XSRF_HEADER_NAME);
  if (token != null && !req.headers.has(headerName)) {
    req = req.clone({
      headers: req.headers.set(headerName, token)
    });
  }
  return next(req);
}
var _HttpXsrfInterceptor = class _HttpXsrfInterceptor {
  constructor(injector) {
    this.injector = injector;
  }
  intercept(initialRequest, next) {
    return runInInjectionContext(this.injector, () => xsrfInterceptorFn(initialRequest, (downstreamRequest) => next.handle(downstreamRequest)));
  }
};
_HttpXsrfInterceptor.\u0275fac = function HttpXsrfInterceptor_Factory(t) {
  return new (t || _HttpXsrfInterceptor)(\u0275\u0275inject(EnvironmentInjector));
};
_HttpXsrfInterceptor.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HttpXsrfInterceptor,
  factory: _HttpXsrfInterceptor.\u0275fac
});
var HttpXsrfInterceptor = _HttpXsrfInterceptor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpXsrfInterceptor, [{
    type: Injectable
  }], () => [{
    type: EnvironmentInjector
  }], null);
})();
var HttpFeatureKind;
(function(HttpFeatureKind2) {
  HttpFeatureKind2[HttpFeatureKind2["Interceptors"] = 0] = "Interceptors";
  HttpFeatureKind2[HttpFeatureKind2["LegacyInterceptors"] = 1] = "LegacyInterceptors";
  HttpFeatureKind2[HttpFeatureKind2["CustomXsrfConfiguration"] = 2] = "CustomXsrfConfiguration";
  HttpFeatureKind2[HttpFeatureKind2["NoXsrfProtection"] = 3] = "NoXsrfProtection";
  HttpFeatureKind2[HttpFeatureKind2["JsonpSupport"] = 4] = "JsonpSupport";
  HttpFeatureKind2[HttpFeatureKind2["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent";
  HttpFeatureKind2[HttpFeatureKind2["Fetch"] = 6] = "Fetch";
})(HttpFeatureKind || (HttpFeatureKind = {}));
function makeHttpFeature(kind, providers) {
  return {
    \u0275kind: kind,
    \u0275providers: providers
  };
}
function provideHttpClient(...features) {
  if (ngDevMode) {
    const featureKinds = new Set(features.map((f) => f.\u0275kind));
    if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) && featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) {
      throw new Error(ngDevMode ? `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` : "");
    }
  }
  const providers = [HttpClient, HttpXhrBackend, HttpInterceptorHandler, {
    provide: HttpHandler,
    useExisting: HttpInterceptorHandler
  }, {
    provide: HttpBackend,
    useFactory: () => {
      return inject(FetchBackend, {
        optional: true
      }) ?? inject(HttpXhrBackend);
    }
  }, {
    provide: HTTP_INTERCEPTOR_FNS,
    useValue: xsrfInterceptorFn,
    multi: true
  }, {
    provide: XSRF_ENABLED,
    useValue: true
  }, {
    provide: HttpXsrfTokenExtractor,
    useClass: HttpXsrfCookieExtractor
  }];
  for (const feature of features) {
    providers.push(...feature.\u0275providers);
  }
  return makeEnvironmentProviders(providers);
}
var LEGACY_INTERCEPTOR_FN = new InjectionToken(ngDevMode ? "LEGACY_INTERCEPTOR_FN" : "");
function withInterceptorsFromDi() {
  return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [{
    provide: LEGACY_INTERCEPTOR_FN,
    useFactory: legacyInterceptorFnFactory
  }, {
    provide: HTTP_INTERCEPTOR_FNS,
    useExisting: LEGACY_INTERCEPTOR_FN,
    multi: true
  }]);
}
function withXsrfConfiguration({
  cookieName,
  headerName
}) {
  const providers = [];
  if (cookieName !== void 0) {
    providers.push({
      provide: XSRF_COOKIE_NAME,
      useValue: cookieName
    });
  }
  if (headerName !== void 0) {
    providers.push({
      provide: XSRF_HEADER_NAME,
      useValue: headerName
    });
  }
  return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers);
}
function withNoXsrfProtection() {
  return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [{
    provide: XSRF_ENABLED,
    useValue: false
  }]);
}
function withJsonpSupport() {
  return makeHttpFeature(HttpFeatureKind.JsonpSupport, [JsonpClientBackend, {
    provide: JsonpCallbackContext,
    useFactory: jsonpCallbackContext
  }, {
    provide: HTTP_INTERCEPTOR_FNS,
    useValue: jsonpInterceptorFn,
    multi: true
  }]);
}
var _HttpClientXsrfModule = class _HttpClientXsrfModule {
  /**
   * Disable the default XSRF protection.
   */
  static disable() {
    return {
      ngModule: _HttpClientXsrfModule,
      providers: [withNoXsrfProtection().\u0275providers]
    };
  }
  /**
   * Configure XSRF protection.
   * @param options An object that can specify either or both
   * cookie name or header name.
   * - Cookie name default is `XSRF-TOKEN`.
   * - Header name default is `X-XSRF-TOKEN`.
   *
   */
  static withOptions(options = {}) {
    return {
      ngModule: _HttpClientXsrfModule,
      providers: withXsrfConfiguration(options).\u0275providers
    };
  }
};
_HttpClientXsrfModule.\u0275fac = function HttpClientXsrfModule_Factory(t) {
  return new (t || _HttpClientXsrfModule)();
};
_HttpClientXsrfModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _HttpClientXsrfModule
});
_HttpClientXsrfModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [HttpXsrfInterceptor, {
    provide: HTTP_INTERCEPTORS,
    useExisting: HttpXsrfInterceptor,
    multi: true
  }, {
    provide: HttpXsrfTokenExtractor,
    useClass: HttpXsrfCookieExtractor
  }, withXsrfConfiguration({
    cookieName: XSRF_DEFAULT_COOKIE_NAME,
    headerName: XSRF_DEFAULT_HEADER_NAME
  }).\u0275providers, {
    provide: XSRF_ENABLED,
    useValue: true
  }]
});
var HttpClientXsrfModule = _HttpClientXsrfModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientXsrfModule, [{
    type: NgModule,
    args: [{
      providers: [HttpXsrfInterceptor, {
        provide: HTTP_INTERCEPTORS,
        useExisting: HttpXsrfInterceptor,
        multi: true
      }, {
        provide: HttpXsrfTokenExtractor,
        useClass: HttpXsrfCookieExtractor
      }, withXsrfConfiguration({
        cookieName: XSRF_DEFAULT_COOKIE_NAME,
        headerName: XSRF_DEFAULT_HEADER_NAME
      }).\u0275providers, {
        provide: XSRF_ENABLED,
        useValue: true
      }]
    }]
  }], null, null);
})();
var _HttpClientModule = class _HttpClientModule {
};
_HttpClientModule.\u0275fac = function HttpClientModule_Factory(t) {
  return new (t || _HttpClientModule)();
};
_HttpClientModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _HttpClientModule
});
_HttpClientModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [provideHttpClient(withInterceptorsFromDi())]
});
var HttpClientModule = _HttpClientModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientModule, [{
    type: NgModule,
    args: [{
      /**
       * Configures the dependency injector where it is imported
       * with supporting services for HTTP communications.
       */
      providers: [provideHttpClient(withInterceptorsFromDi())]
    }]
  }], null, null);
})();
var _HttpClientJsonpModule = class _HttpClientJsonpModule {
};
_HttpClientJsonpModule.\u0275fac = function HttpClientJsonpModule_Factory(t) {
  return new (t || _HttpClientJsonpModule)();
};
_HttpClientJsonpModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _HttpClientJsonpModule
});
_HttpClientJsonpModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [withJsonpSupport().\u0275providers]
});
var HttpClientJsonpModule = _HttpClientJsonpModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HttpClientJsonpModule, [{
    type: NgModule,
    args: [{
      providers: [withJsonpSupport().\u0275providers]
    }]
  }], null, null);
})();
var HTTP_TRANSFER_CACHE_ORIGIN_MAP = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_CACHE_ORIGIN_MAP" : "");
var CACHE_OPTIONS = new InjectionToken(ngDevMode ? "HTTP_TRANSFER_STATE_CACHE_OPTIONS" : "");

// node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs
var GenericBrowserDomAdapter = class extends DomAdapter {
  constructor() {
    super(...arguments);
    this.supportsDOMEvents = true;
  }
};
var BrowserDomAdapter = class _BrowserDomAdapter extends GenericBrowserDomAdapter {
  static makeCurrent() {
    setRootDomAdapter(new _BrowserDomAdapter());
  }
  onAndCancel(el, evt, listener) {
    el.addEventListener(evt, listener);
    return () => {
      el.removeEventListener(evt, listener);
    };
  }
  dispatchEvent(el, evt) {
    el.dispatchEvent(evt);
  }
  remove(node) {
    if (node.parentNode) {
      node.parentNode.removeChild(node);
    }
  }
  createElement(tagName, doc) {
    doc = doc || this.getDefaultDocument();
    return doc.createElement(tagName);
  }
  createHtmlDocument() {
    return document.implementation.createHTMLDocument("fakeTitle");
  }
  getDefaultDocument() {
    return document;
  }
  isElementNode(node) {
    return node.nodeType === Node.ELEMENT_NODE;
  }
  isShadowRoot(node) {
    return node instanceof DocumentFragment;
  }
  /** @deprecated No longer being used in Ivy code. To be removed in version 14. */
  getGlobalEventTarget(doc, target) {
    if (target === "window") {
      return window;
    }
    if (target === "document") {
      return doc;
    }
    if (target === "body") {
      return doc.body;
    }
    return null;
  }
  getBaseHref(doc) {
    const href = getBaseElementHref();
    return href == null ? null : relativePath(href);
  }
  resetBaseElement() {
    baseElement = null;
  }
  getUserAgent() {
    return window.navigator.userAgent;
  }
  getCookie(name) {
    return parseCookieValue(document.cookie, name);
  }
};
var baseElement = null;
function getBaseElementHref() {
  baseElement = baseElement || document.querySelector("base");
  return baseElement ? baseElement.getAttribute("href") : null;
}
function relativePath(url) {
  return new URL(url, document.baseURI).pathname;
}
var BrowserGetTestability = class {
  addToWindow(registry) {
    _global["getAngularTestability"] = (elem, findInAncestors = true) => {
      const testability = registry.findTestabilityInTree(elem, findInAncestors);
      if (testability == null) {
        throw new RuntimeError(5103, (typeof ngDevMode === "undefined" || ngDevMode) && "Could not find testability for element.");
      }
      return testability;
    };
    _global["getAllAngularTestabilities"] = () => registry.getAllTestabilities();
    _global["getAllAngularRootElements"] = () => registry.getAllRootElements();
    const whenAllStable = (callback) => {
      const testabilities = _global["getAllAngularTestabilities"]();
      let count = testabilities.length;
      const decrement = function() {
        count--;
        if (count == 0) {
          callback();
        }
      };
      testabilities.forEach((testability) => {
        testability.whenStable(decrement);
      });
    };
    if (!_global["frameworkStabilizers"]) {
      _global["frameworkStabilizers"] = [];
    }
    _global["frameworkStabilizers"].push(whenAllStable);
  }
  findTestabilityInTree(registry, elem, findInAncestors) {
    if (elem == null) {
      return null;
    }
    const t = registry.getTestability(elem);
    if (t != null) {
      return t;
    } else if (!findInAncestors) {
      return null;
    }
    if (getDOM().isShadowRoot(elem)) {
      return this.findTestabilityInTree(registry, elem.host, true);
    }
    return this.findTestabilityInTree(registry, elem.parentElement, true);
  }
};
var _BrowserXhr = class _BrowserXhr {
  build() {
    return new XMLHttpRequest();
  }
};
_BrowserXhr.\u0275fac = function BrowserXhr_Factory(t) {
  return new (t || _BrowserXhr)();
};
_BrowserXhr.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _BrowserXhr,
  factory: _BrowserXhr.\u0275fac
});
var BrowserXhr = _BrowserXhr;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserXhr, [{
    type: Injectable
  }], null, null);
})();
var EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? "EventManagerPlugins" : "");
var _EventManager = class _EventManager {
  /**
   * Initializes an instance of the event-manager service.
   */
  constructor(plugins, _zone) {
    this._zone = _zone;
    this._eventNameToPlugin = /* @__PURE__ */ new Map();
    plugins.forEach((plugin) => {
      plugin.manager = this;
    });
    this._plugins = plugins.slice().reverse();
  }
  /**
   * Registers a handler for a specific element and event.
   *
   * @param element The HTML element to receive event notifications.
   * @param eventName The name of the event to listen for.
   * @param handler A function to call when the notification occurs. Receives the
   * event object as an argument.
   * @returns  A callback function that can be used to remove the handler.
   */
  addEventListener(element, eventName, handler) {
    const plugin = this._findPluginFor(eventName);
    return plugin.addEventListener(element, eventName, handler);
  }
  /**
   * Retrieves the compilation zone in which event listeners are registered.
   */
  getZone() {
    return this._zone;
  }
  /** @internal */
  _findPluginFor(eventName) {
    let plugin = this._eventNameToPlugin.get(eventName);
    if (plugin) {
      return plugin;
    }
    const plugins = this._plugins;
    plugin = plugins.find((plugin2) => plugin2.supports(eventName));
    if (!plugin) {
      throw new RuntimeError(5101, (typeof ngDevMode === "undefined" || ngDevMode) && `No event manager plugin found for event ${eventName}`);
    }
    this._eventNameToPlugin.set(eventName, plugin);
    return plugin;
  }
};
_EventManager.\u0275fac = function EventManager_Factory(t) {
  return new (t || _EventManager)(\u0275\u0275inject(EVENT_MANAGER_PLUGINS), \u0275\u0275inject(NgZone));
};
_EventManager.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _EventManager,
  factory: _EventManager.\u0275fac
});
var EventManager = _EventManager;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EventManager, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [EVENT_MANAGER_PLUGINS]
    }]
  }, {
    type: NgZone
  }], null);
})();
var EventManagerPlugin = class {
  // TODO: remove (has some usage in G3)
  constructor(_doc) {
    this._doc = _doc;
  }
};
var APP_ID_ATTRIBUTE_NAME = "ng-app-id";
var _SharedStylesHost = class _SharedStylesHost {
  constructor(doc, appId, nonce, platformId = {}) {
    this.doc = doc;
    this.appId = appId;
    this.nonce = nonce;
    this.platformId = platformId;
    this.styleRef = /* @__PURE__ */ new Map();
    this.hostNodes = /* @__PURE__ */ new Set();
    this.styleNodesInDOM = this.collectServerRenderedStyles();
    this.platformIsServer = isPlatformServer(platformId);
    this.resetHostNodes();
  }
  addStyles(styles) {
    for (const style2 of styles) {
      const usageCount = this.changeUsageCount(style2, 1);
      if (usageCount === 1) {
        this.onStyleAdded(style2);
      }
    }
  }
  removeStyles(styles) {
    for (const style2 of styles) {
      const usageCount = this.changeUsageCount(style2, -1);
      if (usageCount <= 0) {
        this.onStyleRemoved(style2);
      }
    }
  }
  ngOnDestroy() {
    const styleNodesInDOM = this.styleNodesInDOM;
    if (styleNodesInDOM) {
      styleNodesInDOM.forEach((node) => node.remove());
      styleNodesInDOM.clear();
    }
    for (const style2 of this.getAllStyles()) {
      this.onStyleRemoved(style2);
    }
    this.resetHostNodes();
  }
  addHost(hostNode) {
    this.hostNodes.add(hostNode);
    for (const style2 of this.getAllStyles()) {
      this.addStyleToHost(hostNode, style2);
    }
  }
  removeHost(hostNode) {
    this.hostNodes.delete(hostNode);
  }
  getAllStyles() {
    return this.styleRef.keys();
  }
  onStyleAdded(style2) {
    for (const host of this.hostNodes) {
      this.addStyleToHost(host, style2);
    }
  }
  onStyleRemoved(style2) {
    const styleRef = this.styleRef;
    styleRef.get(style2)?.elements?.forEach((node) => node.remove());
    styleRef.delete(style2);
  }
  collectServerRenderedStyles() {
    const styles = this.doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${this.appId}"]`);
    if (styles?.length) {
      const styleMap = /* @__PURE__ */ new Map();
      styles.forEach((style2) => {
        if (style2.textContent != null) {
          styleMap.set(style2.textContent, style2);
        }
      });
      return styleMap;
    }
    return null;
  }
  changeUsageCount(style2, delta) {
    const map2 = this.styleRef;
    if (map2.has(style2)) {
      const styleRefValue = map2.get(style2);
      styleRefValue.usage += delta;
      return styleRefValue.usage;
    }
    map2.set(style2, {
      usage: delta,
      elements: []
    });
    return delta;
  }
  getStyleElement(host, style2) {
    const styleNodesInDOM = this.styleNodesInDOM;
    const styleEl = styleNodesInDOM?.get(style2);
    if (styleEl?.parentNode === host) {
      styleNodesInDOM.delete(style2);
      styleEl.removeAttribute(APP_ID_ATTRIBUTE_NAME);
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        styleEl.setAttribute("ng-style-reused", "");
      }
      return styleEl;
    } else {
      const styleEl2 = this.doc.createElement("style");
      if (this.nonce) {
        styleEl2.setAttribute("nonce", this.nonce);
      }
      styleEl2.textContent = style2;
      if (this.platformIsServer) {
        styleEl2.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
      }
      host.appendChild(styleEl2);
      return styleEl2;
    }
  }
  addStyleToHost(host, style2) {
    const styleEl = this.getStyleElement(host, style2);
    const styleRef = this.styleRef;
    const styleElRef = styleRef.get(style2)?.elements;
    if (styleElRef) {
      styleElRef.push(styleEl);
    } else {
      styleRef.set(style2, {
        elements: [styleEl],
        usage: 1
      });
    }
  }
  resetHostNodes() {
    const hostNodes = this.hostNodes;
    hostNodes.clear();
    hostNodes.add(this.doc.head);
  }
};
_SharedStylesHost.\u0275fac = function SharedStylesHost_Factory(t) {
  return new (t || _SharedStylesHost)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(APP_ID), \u0275\u0275inject(CSP_NONCE, 8), \u0275\u0275inject(PLATFORM_ID));
};
_SharedStylesHost.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _SharedStylesHost,
  factory: _SharedStylesHost.\u0275fac
});
var SharedStylesHost = _SharedStylesHost;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedStylesHost, [{
    type: Injectable
  }], () => [{
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [APP_ID]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [CSP_NONCE]
    }, {
      type: Optional
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [PLATFORM_ID]
    }]
  }], null);
})();
var NAMESPACE_URIS = {
  "svg": "http://www.w3.org/2000/svg",
  "xhtml": "http://www.w3.org/1999/xhtml",
  "xlink": "http://www.w3.org/1999/xlink",
  "xml": "http://www.w3.org/XML/1998/namespace",
  "xmlns": "http://www.w3.org/2000/xmlns/",
  "math": "http://www.w3.org/1998/Math/MathML"
};
var COMPONENT_REGEX = /%COMP%/g;
var COMPONENT_VARIABLE = "%COMP%";
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
var CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
var REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
var REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? "RemoveStylesOnCompDestroy" : "", {
  providedIn: "root",
  factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT
});
function shimContentAttribute(componentShortId) {
  return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function shimHostAttribute(componentShortId) {
  return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
function shimStylesContent(compId, styles) {
  return styles.map((s) => s.replace(COMPONENT_REGEX, compId));
}
var _DomRendererFactory2 = class _DomRendererFactory2 {
  constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null) {
    this.eventManager = eventManager;
    this.sharedStylesHost = sharedStylesHost;
    this.appId = appId;
    this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
    this.doc = doc;
    this.platformId = platformId;
    this.ngZone = ngZone;
    this.nonce = nonce;
    this.rendererByCompId = /* @__PURE__ */ new Map();
    this.platformIsServer = isPlatformServer(platformId);
    this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer);
  }
  createRenderer(element, type) {
    if (!element || !type) {
      return this.defaultRenderer;
    }
    if (this.platformIsServer && type.encapsulation === ViewEncapsulation$1.ShadowDom) {
      type = __spreadProps(__spreadValues({}, type), {
        encapsulation: ViewEncapsulation$1.Emulated
      });
    }
    const renderer = this.getOrCreateRenderer(element, type);
    if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
      renderer.applyToHost(element);
    } else if (renderer instanceof NoneEncapsulationDomRenderer) {
      renderer.applyStyles();
    }
    return renderer;
  }
  getOrCreateRenderer(element, type) {
    const rendererByCompId = this.rendererByCompId;
    let renderer = rendererByCompId.get(type.id);
    if (!renderer) {
      const doc = this.doc;
      const ngZone = this.ngZone;
      const eventManager = this.eventManager;
      const sharedStylesHost = this.sharedStylesHost;
      const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
      const platformIsServer = this.platformIsServer;
      switch (type.encapsulation) {
        case ViewEncapsulation$1.Emulated:
          renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer);
          break;
        case ViewEncapsulation$1.ShadowDom:
          return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer);
        default:
          renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer);
          break;
      }
      rendererByCompId.set(type.id, renderer);
    }
    return renderer;
  }
  ngOnDestroy() {
    this.rendererByCompId.clear();
  }
};
_DomRendererFactory2.\u0275fac = function DomRendererFactory2_Factory(t) {
  return new (t || _DomRendererFactory2)(\u0275\u0275inject(EventManager), \u0275\u0275inject(SharedStylesHost), \u0275\u0275inject(APP_ID), \u0275\u0275inject(REMOVE_STYLES_ON_COMPONENT_DESTROY), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(PLATFORM_ID), \u0275\u0275inject(NgZone), \u0275\u0275inject(CSP_NONCE));
};
_DomRendererFactory2.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _DomRendererFactory2,
  factory: _DomRendererFactory2.\u0275fac
});
var DomRendererFactory2 = _DomRendererFactory2;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomRendererFactory2, [{
    type: Injectable
  }], () => [{
    type: EventManager
  }, {
    type: SharedStylesHost
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [APP_ID]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
    }]
  }, {
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Object,
    decorators: [{
      type: Inject,
      args: [PLATFORM_ID]
    }]
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [CSP_NONCE]
    }]
  }], null);
})();
var DefaultDomRenderer2 = class {
  constructor(eventManager, doc, ngZone, platformIsServer) {
    this.eventManager = eventManager;
    this.doc = doc;
    this.ngZone = ngZone;
    this.platformIsServer = platformIsServer;
    this.data = /* @__PURE__ */ Object.create(null);
    this.throwOnSyntheticProps = true;
    this.destroyNode = null;
  }
  destroy() {
  }
  createElement(name, namespace) {
    if (namespace) {
      return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
    }
    return this.doc.createElement(name);
  }
  createComment(value) {
    return this.doc.createComment(value);
  }
  createText(value) {
    return this.doc.createTextNode(value);
  }
  appendChild(parent, newChild) {
    const targetParent = isTemplateNode(parent) ? parent.content : parent;
    targetParent.appendChild(newChild);
  }
  insertBefore(parent, newChild, refChild) {
    if (parent) {
      const targetParent = isTemplateNode(parent) ? parent.content : parent;
      targetParent.insertBefore(newChild, refChild);
    }
  }
  removeChild(parent, oldChild) {
    if (parent) {
      parent.removeChild(oldChild);
    }
  }
  selectRootElement(selectorOrNode, preserveContent) {
    let el = typeof selectorOrNode === "string" ? this.doc.querySelector(selectorOrNode) : selectorOrNode;
    if (!el) {
      throw new RuntimeError(-5104, (typeof ngDevMode === "undefined" || ngDevMode) && `The selector "${selectorOrNode}" did not match any elements`);
    }
    if (!preserveContent) {
      el.textContent = "";
    }
    return el;
  }
  parentNode(node) {
    return node.parentNode;
  }
  nextSibling(node) {
    return node.nextSibling;
  }
  setAttribute(el, name, value, namespace) {
    if (namespace) {
      name = namespace + ":" + name;
      const namespaceUri = NAMESPACE_URIS[namespace];
      if (namespaceUri) {
        el.setAttributeNS(namespaceUri, name, value);
      } else {
        el.setAttribute(name, value);
      }
    } else {
      el.setAttribute(name, value);
    }
  }
  removeAttribute(el, name, namespace) {
    if (namespace) {
      const namespaceUri = NAMESPACE_URIS[namespace];
      if (namespaceUri) {
        el.removeAttributeNS(namespaceUri, name);
      } else {
        el.removeAttribute(`${namespace}:${name}`);
      }
    } else {
      el.removeAttribute(name);
    }
  }
  addClass(el, name) {
    el.classList.add(name);
  }
  removeClass(el, name) {
    el.classList.remove(name);
  }
  setStyle(el, style2, value, flags) {
    if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
      el.style.setProperty(style2, value, flags & RendererStyleFlags2.Important ? "important" : "");
    } else {
      el.style[style2] = value;
    }
  }
  removeStyle(el, style2, flags) {
    if (flags & RendererStyleFlags2.DashCase) {
      el.style.removeProperty(style2);
    } else {
      el.style[style2] = "";
    }
  }
  setProperty(el, name, value) {
    if (el == null) {
      return;
    }
    (typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(name, "property");
    el[name] = value;
  }
  setValue(node, value) {
    node.nodeValue = value;
  }
  listen(target, event, callback) {
    (typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(event, "listener");
    if (typeof target === "string") {
      target = getDOM().getGlobalEventTarget(this.doc, target);
      if (!target) {
        throw new Error(`Unsupported event target ${target} for event ${event}`);
      }
    }
    return this.eventManager.addEventListener(target, event, this.decoratePreventDefault(callback));
  }
  decoratePreventDefault(eventHandler) {
    return (event) => {
      if (event === "__ngUnwrap__") {
        return eventHandler;
      }
      const allowDefaultBehavior = this.platformIsServer ? this.ngZone.runGuarded(() => eventHandler(event)) : eventHandler(event);
      if (allowDefaultBehavior === false) {
        event.preventDefault();
      }
      return void 0;
    };
  }
};
var AT_CHARCODE = (() => "@".charCodeAt(0))();
function checkNoSyntheticProp(name, nameKind) {
  if (name.charCodeAt(0) === AT_CHARCODE) {
    throw new RuntimeError(5105, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
  - Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application.
  - There is corresponding configuration for the animation named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`);
  }
}
function isTemplateNode(node) {
  return node.tagName === "TEMPLATE" && node.content !== void 0;
}
var ShadowDomRenderer = class extends DefaultDomRenderer2 {
  constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer) {
    super(eventManager, doc, ngZone, platformIsServer);
    this.sharedStylesHost = sharedStylesHost;
    this.hostEl = hostEl;
    this.shadowRoot = hostEl.attachShadow({
      mode: "open"
    });
    this.sharedStylesHost.addHost(this.shadowRoot);
    const styles = shimStylesContent(component.id, component.styles);
    for (const style2 of styles) {
      const styleEl = document.createElement("style");
      if (nonce) {
        styleEl.setAttribute("nonce", nonce);
      }
      styleEl.textContent = style2;
      this.shadowRoot.appendChild(styleEl);
    }
  }
  nodeOrShadowRoot(node) {
    return node === this.hostEl ? this.shadowRoot : node;
  }
  appendChild(parent, newChild) {
    return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
  }
  insertBefore(parent, newChild, refChild) {
    return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
  }
  removeChild(parent, oldChild) {
    return super.removeChild(this.nodeOrShadowRoot(parent), oldChild);
  }
  parentNode(node) {
    return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
  }
  destroy() {
    this.sharedStylesHost.removeHost(this.shadowRoot);
  }
};
var NoneEncapsulationDomRenderer = class extends DefaultDomRenderer2 {
  constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, compId) {
    super(eventManager, doc, ngZone, platformIsServer);
    this.sharedStylesHost = sharedStylesHost;
    this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
    this.styles = compId ? shimStylesContent(compId, component.styles) : component.styles;
  }
  applyStyles() {
    this.sharedStylesHost.addStyles(this.styles);
  }
  destroy() {
    if (!this.removeStylesOnCompDestroy) {
      return;
    }
    this.sharedStylesHost.removeStyles(this.styles);
  }
};
var EmulatedEncapsulationDomRenderer2 = class extends NoneEncapsulationDomRenderer {
  constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer) {
    const compId = appId + "-" + component.id;
    super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, compId);
    this.contentAttr = shimContentAttribute(compId);
    this.hostAttr = shimHostAttribute(compId);
  }
  applyToHost(element) {
    this.applyStyles();
    this.setAttribute(element, this.hostAttr, "");
  }
  createElement(parent, name) {
    const el = super.createElement(parent, name);
    super.setAttribute(el, this.contentAttr, "");
    return el;
  }
};
var _DomEventsPlugin = class _DomEventsPlugin extends EventManagerPlugin {
  constructor(doc) {
    super(doc);
  }
  // This plugin should come last in the list of plugins, because it accepts all
  // events.
  supports(eventName) {
    return true;
  }
  addEventListener(element, eventName, handler) {
    element.addEventListener(eventName, handler, false);
    return () => this.removeEventListener(element, eventName, handler);
  }
  removeEventListener(target, eventName, callback) {
    return target.removeEventListener(eventName, callback);
  }
};
_DomEventsPlugin.\u0275fac = function DomEventsPlugin_Factory(t) {
  return new (t || _DomEventsPlugin)(\u0275\u0275inject(DOCUMENT2));
};
_DomEventsPlugin.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _DomEventsPlugin,
  factory: _DomEventsPlugin.\u0275fac
});
var DomEventsPlugin = _DomEventsPlugin;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomEventsPlugin, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var MODIFIER_KEYS = ["alt", "control", "meta", "shift"];
var _keyMap = {
  "\b": "Backspace",
  "	": "Tab",
  "\x7F": "Delete",
  "\x1B": "Escape",
  "Del": "Delete",
  "Esc": "Escape",
  "Left": "ArrowLeft",
  "Right": "ArrowRight",
  "Up": "ArrowUp",
  "Down": "ArrowDown",
  "Menu": "ContextMenu",
  "Scroll": "ScrollLock",
  "Win": "OS"
};
var MODIFIER_KEY_GETTERS = {
  "alt": (event) => event.altKey,
  "control": (event) => event.ctrlKey,
  "meta": (event) => event.metaKey,
  "shift": (event) => event.shiftKey
};
var _KeyEventsPlugin = class _KeyEventsPlugin extends EventManagerPlugin {
  /**
   * Initializes an instance of the browser plug-in.
   * @param doc The document in which key events will be detected.
   */
  constructor(doc) {
    super(doc);
  }
  /**
   * Reports whether a named key event is supported.
   * @param eventName The event name to query.
   * @return True if the named key event is supported.
   */
  supports(eventName) {
    return _KeyEventsPlugin.parseEventName(eventName) != null;
  }
  /**
   * Registers a handler for a specific element and key event.
   * @param element The HTML element to receive event notifications.
   * @param eventName The name of the key event to listen for.
   * @param handler A function to call when the notification occurs. Receives the
   * event object as an argument.
   * @returns The key event that was registered.
   */
  addEventListener(element, eventName, handler) {
    const parsedEvent = _KeyEventsPlugin.parseEventName(eventName);
    const outsideHandler = _KeyEventsPlugin.eventCallback(parsedEvent["fullKey"], handler, this.manager.getZone());
    return this.manager.getZone().runOutsideAngular(() => {
      return getDOM().onAndCancel(element, parsedEvent["domEventName"], outsideHandler);
    });
  }
  /**
   * Parses the user provided full keyboard event definition and normalizes it for
   * later internal use. It ensures the string is all lowercase, converts special
   * characters to a standard spelling, and orders all the values consistently.
   *
   * @param eventName The name of the key event to listen for.
   * @returns an object with the full, normalized string, and the dom event name
   * or null in the case when the event doesn't match a keyboard event.
   */
  static parseEventName(eventName) {
    const parts = eventName.toLowerCase().split(".");
    const domEventName = parts.shift();
    if (parts.length === 0 || !(domEventName === "keydown" || domEventName === "keyup")) {
      return null;
    }
    const key = _KeyEventsPlugin._normalizeKey(parts.pop());
    let fullKey = "";
    let codeIX = parts.indexOf("code");
    if (codeIX > -1) {
      parts.splice(codeIX, 1);
      fullKey = "code.";
    }
    MODIFIER_KEYS.forEach((modifierName) => {
      const index = parts.indexOf(modifierName);
      if (index > -1) {
        parts.splice(index, 1);
        fullKey += modifierName + ".";
      }
    });
    fullKey += key;
    if (parts.length != 0 || key.length === 0) {
      return null;
    }
    const result = {};
    result["domEventName"] = domEventName;
    result["fullKey"] = fullKey;
    return result;
  }
  /**
   * Determines whether the actual keys pressed match the configured key code string.
   * The `fullKeyCode` event is normalized in the `parseEventName` method when the
   * event is attached to the DOM during the `addEventListener` call. This is unseen
   * by the end user and is normalized for internal consistency and parsing.
   *
   * @param event The keyboard event.
   * @param fullKeyCode The normalized user defined expected key event string
   * @returns boolean.
   */
  static matchEventFullKeyCode(event, fullKeyCode) {
    let keycode = _keyMap[event.key] || event.key;
    let key = "";
    if (fullKeyCode.indexOf("code.") > -1) {
      keycode = event.code;
      key = "code.";
    }
    if (keycode == null || !keycode) return false;
    keycode = keycode.toLowerCase();
    if (keycode === " ") {
      keycode = "space";
    } else if (keycode === ".") {
      keycode = "dot";
    }
    MODIFIER_KEYS.forEach((modifierName) => {
      if (modifierName !== keycode) {
        const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
        if (modifierGetter(event)) {
          key += modifierName + ".";
        }
      }
    });
    key += keycode;
    return key === fullKeyCode;
  }
  /**
   * Configures a handler callback for a key event.
   * @param fullKey The event name that combines all simultaneous keystrokes.
   * @param handler The function that responds to the key event.
   * @param zone The zone in which the event occurred.
   * @returns A callback function.
   */
  static eventCallback(fullKey, handler, zone) {
    return (event) => {
      if (_KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {
        zone.runGuarded(() => handler(event));
      }
    };
  }
  /** @internal */
  static _normalizeKey(keyName) {
    return keyName === "esc" ? "escape" : keyName;
  }
};
_KeyEventsPlugin.\u0275fac = function KeyEventsPlugin_Factory(t) {
  return new (t || _KeyEventsPlugin)(\u0275\u0275inject(DOCUMENT2));
};
_KeyEventsPlugin.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _KeyEventsPlugin,
  factory: _KeyEventsPlugin.\u0275fac
});
var KeyEventsPlugin = _KeyEventsPlugin;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyEventsPlugin, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
function initDomAdapter() {
  BrowserDomAdapter.makeCurrent();
}
function errorHandler() {
  return new ErrorHandler();
}
function _document() {
  setDocument(document);
  return document;
}
var INTERNAL_BROWSER_PLATFORM_PROVIDERS = [{
  provide: PLATFORM_ID,
  useValue: PLATFORM_BROWSER_ID
}, {
  provide: PLATFORM_INITIALIZER,
  useValue: initDomAdapter,
  multi: true
}, {
  provide: DOCUMENT2,
  useFactory: _document,
  deps: []
}];
var platformBrowser = createPlatformFactory(platformCore, "browser", INTERNAL_BROWSER_PLATFORM_PROVIDERS);
var BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "BrowserModule Providers Marker" : "");
var TESTABILITY_PROVIDERS = [{
  provide: TESTABILITY_GETTER,
  useClass: BrowserGetTestability,
  deps: []
}, {
  provide: TESTABILITY,
  useClass: Testability,
  deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
}, {
  provide: Testability,
  // Also provide as `Testability` for backwards-compatibility.
  useClass: Testability,
  deps: [NgZone, TestabilityRegistry, TESTABILITY_GETTER]
}];
var BROWSER_MODULE_PROVIDERS = [{
  provide: INJECTOR_SCOPE,
  useValue: "root"
}, {
  provide: ErrorHandler,
  useFactory: errorHandler,
  deps: []
}, {
  provide: EVENT_MANAGER_PLUGINS,
  useClass: DomEventsPlugin,
  multi: true,
  deps: [DOCUMENT2, NgZone, PLATFORM_ID]
}, {
  provide: EVENT_MANAGER_PLUGINS,
  useClass: KeyEventsPlugin,
  multi: true,
  deps: [DOCUMENT2]
}, DomRendererFactory2, SharedStylesHost, EventManager, {
  provide: RendererFactory2,
  useExisting: DomRendererFactory2
}, {
  provide: XhrFactory,
  useClass: BrowserXhr,
  deps: []
}, typeof ngDevMode === "undefined" || ngDevMode ? {
  provide: BROWSER_MODULE_PROVIDERS_MARKER,
  useValue: true
} : []];
var _BrowserModule = class _BrowserModule {
  constructor(providersAlreadyPresent) {
    if ((typeof ngDevMode === "undefined" || ngDevMode) && providersAlreadyPresent) {
      throw new RuntimeError(5100, `Providers from the \`BrowserModule\` have already been loaded. If you need access to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`);
    }
  }
  /**
   * Configures a browser-based app to transition from a server-rendered app, if
   * one is present on the page.
   *
   * @param params An object containing an identifier for the app to transition.
   * The ID must match between the client and server versions of the app.
   * @returns The reconfigured `BrowserModule` to import into the app's root `AppModule`.
   *
   * @deprecated Use {@link APP_ID} instead to set the application ID.
   */
  static withServerTransition(params) {
    return {
      ngModule: _BrowserModule,
      providers: [{
        provide: APP_ID,
        useValue: params.appId
      }]
    };
  }
};
_BrowserModule.\u0275fac = function BrowserModule_Factory(t) {
  return new (t || _BrowserModule)(\u0275\u0275inject(BROWSER_MODULE_PROVIDERS_MARKER, 12));
};
_BrowserModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _BrowserModule
});
_BrowserModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
  imports: [CommonModule, ApplicationModule]
});
var BrowserModule = _BrowserModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserModule, [{
    type: NgModule,
    args: [{
      providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
      exports: [CommonModule, ApplicationModule]
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: SkipSelf
    }, {
      type: Inject,
      args: [BROWSER_MODULE_PROVIDERS_MARKER]
    }]
  }], null);
})();
var _Meta = class _Meta {
  constructor(_doc) {
    this._doc = _doc;
    this._dom = getDOM();
  }
  /**
   * Retrieves or creates a specific `<meta>` tag element in the current HTML document.
   * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
   * values in the provided tag definition, and verifies that all other attribute values are equal.
   * If an existing element is found, it is returned and is not modified in any way.
   * @param tag The definition of a `<meta>` element to match or create.
   * @param forceCreation True to create a new element without checking whether one already exists.
   * @returns The existing element with the same attributes and values if found,
   * the new element if no match is found, or `null` if the tag parameter is not defined.
   */
  addTag(tag, forceCreation = false) {
    if (!tag) return null;
    return this._getOrCreateElement(tag, forceCreation);
  }
  /**
   * Retrieves or creates a set of `<meta>` tag elements in the current HTML document.
   * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute
   * values in the provided tag definition, and verifies that all other attribute values are equal.
   * @param tags An array of tag definitions to match or create.
   * @param forceCreation True to create new elements without checking whether they already exist.
   * @returns The matching elements if found, or the new elements.
   */
  addTags(tags, forceCreation = false) {
    if (!tags) return [];
    return tags.reduce((result, tag) => {
      if (tag) {
        result.push(this._getOrCreateElement(tag, forceCreation));
      }
      return result;
    }, []);
  }
  /**
   * Retrieves a `<meta>` tag element in the current HTML document.
   * @param attrSelector The tag attribute and value to match against, in the format
   * `"tag_attribute='value string'"`.
   * @returns The matching element, if any.
   */
  getTag(attrSelector) {
    if (!attrSelector) return null;
    return this._doc.querySelector(`meta[${attrSelector}]`) || null;
  }
  /**
   * Retrieves a set of `<meta>` tag elements in the current HTML document.
   * @param attrSelector The tag attribute and value to match against, in the format
   * `"tag_attribute='value string'"`.
   * @returns The matching elements, if any.
   */
  getTags(attrSelector) {
    if (!attrSelector) return [];
    const list = this._doc.querySelectorAll(`meta[${attrSelector}]`);
    return list ? [].slice.call(list) : [];
  }
  /**
   * Modifies an existing `<meta>` tag element in the current HTML document.
   * @param tag The tag description with which to replace the existing tag content.
   * @param selector A tag attribute and value to match against, to identify
   * an existing tag. A string in the format `"tag_attribute=`value string`"`.
   * If not supplied, matches a tag with the same `name` or `property` attribute value as the
   * replacement tag.
   * @return The modified element.
   */
  updateTag(tag, selector) {
    if (!tag) return null;
    selector = selector || this._parseSelector(tag);
    const meta = this.getTag(selector);
    if (meta) {
      return this._setMetaElementAttributes(tag, meta);
    }
    return this._getOrCreateElement(tag, true);
  }
  /**
   * Removes an existing `<meta>` tag element from the current HTML document.
   * @param attrSelector A tag attribute and value to match against, to identify
   * an existing tag. A string in the format `"tag_attribute=`value string`"`.
   */
  removeTag(attrSelector) {
    this.removeTagElement(this.getTag(attrSelector));
  }
  /**
   * Removes an existing `<meta>` tag element from the current HTML document.
   * @param meta The tag definition to match against to identify an existing tag.
   */
  removeTagElement(meta) {
    if (meta) {
      this._dom.remove(meta);
    }
  }
  _getOrCreateElement(meta, forceCreation = false) {
    if (!forceCreation) {
      const selector = this._parseSelector(meta);
      const elem = this.getTags(selector).filter((elem2) => this._containsAttributes(meta, elem2))[0];
      if (elem !== void 0) return elem;
    }
    const element = this._dom.createElement("meta");
    this._setMetaElementAttributes(meta, element);
    const head = this._doc.getElementsByTagName("head")[0];
    head.appendChild(element);
    return element;
  }
  _setMetaElementAttributes(tag, el) {
    Object.keys(tag).forEach((prop) => el.setAttribute(this._getMetaKeyMap(prop), tag[prop]));
    return el;
  }
  _parseSelector(tag) {
    const attr = tag.name ? "name" : "property";
    return `${attr}="${tag[attr]}"`;
  }
  _containsAttributes(tag, elem) {
    return Object.keys(tag).every((key) => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]);
  }
  _getMetaKeyMap(prop) {
    return META_KEYS_MAP[prop] || prop;
  }
};
_Meta.\u0275fac = function Meta_Factory(t) {
  return new (t || _Meta)(\u0275\u0275inject(DOCUMENT2));
};
_Meta.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Meta,
  factory: _Meta.\u0275fac,
  providedIn: "root"
});
var Meta = _Meta;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Meta, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var META_KEYS_MAP = {
  httpEquiv: "http-equiv"
};
var _Title = class _Title {
  constructor(_doc) {
    this._doc = _doc;
  }
  /**
   * Get the title of the current HTML document.
   */
  getTitle() {
    return this._doc.title;
  }
  /**
   * Set the title of the current HTML document.
   * @param newTitle
   */
  setTitle(newTitle) {
    this._doc.title = newTitle || "";
  }
};
_Title.\u0275fac = function Title_Factory(t) {
  return new (t || _Title)(\u0275\u0275inject(DOCUMENT2));
};
_Title.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Title,
  factory: _Title.\u0275fac,
  providedIn: "root"
});
var Title = _Title;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Title, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var EVENT_NAMES = {
  // pan
  "pan": true,
  "panstart": true,
  "panmove": true,
  "panend": true,
  "pancancel": true,
  "panleft": true,
  "panright": true,
  "panup": true,
  "pandown": true,
  // pinch
  "pinch": true,
  "pinchstart": true,
  "pinchmove": true,
  "pinchend": true,
  "pinchcancel": true,
  "pinchin": true,
  "pinchout": true,
  // press
  "press": true,
  "pressup": true,
  // rotate
  "rotate": true,
  "rotatestart": true,
  "rotatemove": true,
  "rotateend": true,
  "rotatecancel": true,
  // swipe
  "swipe": true,
  "swipeleft": true,
  "swiperight": true,
  "swipeup": true,
  "swipedown": true,
  // tap
  "tap": true,
  "doubletap": true
};
var HAMMER_GESTURE_CONFIG = new InjectionToken("HammerGestureConfig");
var HAMMER_LOADER = new InjectionToken("HammerLoader");
var _HammerGestureConfig = class _HammerGestureConfig {
  constructor() {
    this.events = [];
    this.overrides = {};
  }
  /**
   * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager)
   * and attaches it to a given HTML element.
   * @param element The element that will recognize gestures.
   * @returns A HammerJS event-manager object.
   */
  buildHammer(element) {
    const mc = new Hammer(element, this.options);
    mc.get("pinch").set({
      enable: true
    });
    mc.get("rotate").set({
      enable: true
    });
    for (const eventName in this.overrides) {
      mc.get(eventName).set(this.overrides[eventName]);
    }
    return mc;
  }
};
_HammerGestureConfig.\u0275fac = function HammerGestureConfig_Factory(t) {
  return new (t || _HammerGestureConfig)();
};
_HammerGestureConfig.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HammerGestureConfig,
  factory: _HammerGestureConfig.\u0275fac
});
var HammerGestureConfig = _HammerGestureConfig;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGestureConfig, [{
    type: Injectable
  }], null, null);
})();
var _HammerGesturesPlugin = class _HammerGesturesPlugin extends EventManagerPlugin {
  constructor(doc, _config, console2, loader) {
    super(doc);
    this._config = _config;
    this.console = console2;
    this.loader = loader;
    this._loaderPromise = null;
  }
  supports(eventName) {
    if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
      return false;
    }
    if (!window.Hammer && !this.loader) {
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.`);
      }
      return false;
    }
    return true;
  }
  addEventListener(element, eventName, handler) {
    const zone = this.manager.getZone();
    eventName = eventName.toLowerCase();
    if (!window.Hammer && this.loader) {
      this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader());
      let cancelRegistration = false;
      let deregister = () => {
        cancelRegistration = true;
      };
      zone.runOutsideAngular(() => this._loaderPromise.then(() => {
        if (!window.Hammer) {
          if (typeof ngDevMode === "undefined" || ngDevMode) {
            this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
          }
          deregister = () => {
          };
          return;
        }
        if (!cancelRegistration) {
          deregister = this.addEventListener(element, eventName, handler);
        }
      }).catch(() => {
        if (typeof ngDevMode === "undefined" || ngDevMode) {
          this.console.warn(`The "${eventName}" event cannot be bound because the custom Hammer.JS loader failed.`);
        }
        deregister = () => {
        };
      }));
      return () => {
        deregister();
      };
    }
    return zone.runOutsideAngular(() => {
      const mc = this._config.buildHammer(element);
      const callback = function(eventObj) {
        zone.runGuarded(function() {
          handler(eventObj);
        });
      };
      mc.on(eventName, callback);
      return () => {
        mc.off(eventName, callback);
        if (typeof mc.destroy === "function") {
          mc.destroy();
        }
      };
    });
  }
  isCustomEvent(eventName) {
    return this._config.events.indexOf(eventName) > -1;
  }
};
_HammerGesturesPlugin.\u0275fac = function HammerGesturesPlugin_Factory(t) {
  return new (t || _HammerGesturesPlugin)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(HAMMER_GESTURE_CONFIG), \u0275\u0275inject(Console), \u0275\u0275inject(HAMMER_LOADER, 8));
};
_HammerGesturesPlugin.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HammerGesturesPlugin,
  factory: _HammerGesturesPlugin.\u0275fac
});
var HammerGesturesPlugin = _HammerGesturesPlugin;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerGesturesPlugin, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: HammerGestureConfig,
    decorators: [{
      type: Inject,
      args: [HAMMER_GESTURE_CONFIG]
    }]
  }, {
    type: Console
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [HAMMER_LOADER]
    }]
  }], null);
})();
var _HammerModule = class _HammerModule {
};
_HammerModule.\u0275fac = function HammerModule_Factory(t) {
  return new (t || _HammerModule)();
};
_HammerModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _HammerModule
});
_HammerModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [{
    provide: EVENT_MANAGER_PLUGINS,
    useClass: HammerGesturesPlugin,
    multi: true,
    deps: [DOCUMENT2, HAMMER_GESTURE_CONFIG, Console, [new Optional(), HAMMER_LOADER]]
  }, {
    provide: HAMMER_GESTURE_CONFIG,
    useClass: HammerGestureConfig,
    deps: []
  }]
});
var HammerModule = _HammerModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HammerModule, [{
    type: NgModule,
    args: [{
      providers: [{
        provide: EVENT_MANAGER_PLUGINS,
        useClass: HammerGesturesPlugin,
        multi: true,
        deps: [DOCUMENT2, HAMMER_GESTURE_CONFIG, Console, [new Optional(), HAMMER_LOADER]]
      }, {
        provide: HAMMER_GESTURE_CONFIG,
        useClass: HammerGestureConfig,
        deps: []
      }]
    }]
  }], null, null);
})();
var _DomSanitizer = class _DomSanitizer {
};
_DomSanitizer.\u0275fac = function DomSanitizer_Factory(t) {
  return new (t || _DomSanitizer)();
};
_DomSanitizer.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _DomSanitizer,
  factory: function DomSanitizer_Factory(t) {
    let r = null;
    if (t) {
      r = new (t || _DomSanitizer)();
    } else {
      r = \u0275\u0275inject(DomSanitizerImpl);
    }
    return r;
  },
  providedIn: "root"
});
var DomSanitizer = _DomSanitizer;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizer, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      useExisting: forwardRef(() => DomSanitizerImpl)
    }]
  }], null, null);
})();
var _DomSanitizerImpl = class _DomSanitizerImpl extends DomSanitizer {
  constructor(_doc) {
    super();
    this._doc = _doc;
  }
  sanitize(ctx, value) {
    if (value == null) return null;
    switch (ctx) {
      case SecurityContext.NONE:
        return value;
      case SecurityContext.HTML:
        if (allowSanitizationBypassAndThrow(
          value,
          "HTML"
          /* BypassType.Html */
        )) {
          return unwrapSafeValue(value);
        }
        return _sanitizeHtml(this._doc, String(value)).toString();
      case SecurityContext.STYLE:
        if (allowSanitizationBypassAndThrow(
          value,
          "Style"
          /* BypassType.Style */
        )) {
          return unwrapSafeValue(value);
        }
        return value;
      case SecurityContext.SCRIPT:
        if (allowSanitizationBypassAndThrow(
          value,
          "Script"
          /* BypassType.Script */
        )) {
          return unwrapSafeValue(value);
        }
        throw new RuntimeError(5200, (typeof ngDevMode === "undefined" || ngDevMode) && "unsafe value used in a script context");
      case SecurityContext.URL:
        if (allowSanitizationBypassAndThrow(
          value,
          "URL"
          /* BypassType.Url */
        )) {
          return unwrapSafeValue(value);
        }
        return _sanitizeUrl(String(value));
      case SecurityContext.RESOURCE_URL:
        if (allowSanitizationBypassAndThrow(
          value,
          "ResourceURL"
          /* BypassType.ResourceUrl */
        )) {
          return unwrapSafeValue(value);
        }
        throw new RuntimeError(5201, (typeof ngDevMode === "undefined" || ngDevMode) && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
      default:
        throw new RuntimeError(5202, (typeof ngDevMode === "undefined" || ngDevMode) && `Unexpected SecurityContext ${ctx} (see ${XSS_SECURITY_URL})`);
    }
  }
  bypassSecurityTrustHtml(value) {
    return bypassSanitizationTrustHtml(value);
  }
  bypassSecurityTrustStyle(value) {
    return bypassSanitizationTrustStyle(value);
  }
  bypassSecurityTrustScript(value) {
    return bypassSanitizationTrustScript(value);
  }
  bypassSecurityTrustUrl(value) {
    return bypassSanitizationTrustUrl(value);
  }
  bypassSecurityTrustResourceUrl(value) {
    return bypassSanitizationTrustResourceUrl(value);
  }
};
_DomSanitizerImpl.\u0275fac = function DomSanitizerImpl_Factory(t) {
  return new (t || _DomSanitizerImpl)(\u0275\u0275inject(DOCUMENT2));
};
_DomSanitizerImpl.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _DomSanitizerImpl,
  factory: _DomSanitizerImpl.\u0275fac,
  providedIn: "root"
});
var DomSanitizerImpl = _DomSanitizerImpl;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomSanitizerImpl, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var HydrationFeatureKind;
(function(HydrationFeatureKind2) {
  HydrationFeatureKind2[HydrationFeatureKind2["NoHttpTransferCache"] = 0] = "NoHttpTransferCache";
  HydrationFeatureKind2[HydrationFeatureKind2["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions";
  HydrationFeatureKind2[HydrationFeatureKind2["I18nSupport"] = 2] = "I18nSupport";
  HydrationFeatureKind2[HydrationFeatureKind2["EventReplay"] = 3] = "EventReplay";
})(HydrationFeatureKind || (HydrationFeatureKind = {}));
var VERSION3 = new Version("18.0.0-rc.1");

// node_modules/@angular/forms/fesm2022/forms.mjs
var _BaseControlValueAccessor = class _BaseControlValueAccessor {
  constructor(_renderer, _elementRef) {
    this._renderer = _renderer;
    this._elementRef = _elementRef;
    this.onChange = (_) => {
    };
    this.onTouched = () => {
    };
  }
  /**
   * Helper method that sets a property on a target element using the current Renderer
   * implementation.
   * @nodoc
   */
  setProperty(key, value) {
    this._renderer.setProperty(this._elementRef.nativeElement, key, value);
  }
  /**
   * Registers a function called when the control is touched.
   * @nodoc
   */
  registerOnTouched(fn) {
    this.onTouched = fn;
  }
  /**
   * Registers a function called when the control value changes.
   * @nodoc
   */
  registerOnChange(fn) {
    this.onChange = fn;
  }
  /**
   * Sets the "disabled" property on the range input element.
   * @nodoc
   */
  setDisabledState(isDisabled) {
    this.setProperty("disabled", isDisabled);
  }
};
_BaseControlValueAccessor.\u0275fac = function BaseControlValueAccessor_Factory(t) {
  return new (t || _BaseControlValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef));
};
_BaseControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _BaseControlValueAccessor
});
var BaseControlValueAccessor = _BaseControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BaseControlValueAccessor, [{
    type: Directive
  }], () => [{
    type: Renderer2
  }, {
    type: ElementRef
  }], null);
})();
var _BuiltInControlValueAccessor = class _BuiltInControlValueAccessor extends BaseControlValueAccessor {
};
_BuiltInControlValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275BuiltInControlValueAccessor_BaseFactory;
  return function BuiltInControlValueAccessor_Factory(t) {
    return (\u0275BuiltInControlValueAccessor_BaseFactory || (\u0275BuiltInControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_BuiltInControlValueAccessor)))(t || _BuiltInControlValueAccessor);
  };
})();
_BuiltInControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _BuiltInControlValueAccessor,
  features: [\u0275\u0275InheritDefinitionFeature]
});
var BuiltInControlValueAccessor = _BuiltInControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BuiltInControlValueAccessor, [{
    type: Directive
  }], null, null);
})();
var NG_VALUE_ACCESSOR = new InjectionToken(ngDevMode ? "NgValueAccessor" : "");
var CHECKBOX_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => CheckboxControlValueAccessor),
  multi: true
};
var _CheckboxControlValueAccessor = class _CheckboxControlValueAccessor extends BuiltInControlValueAccessor {
  /**
   * Sets the "checked" property on the input element.
   * @nodoc
   */
  writeValue(value) {
    this.setProperty("checked", value);
  }
};
_CheckboxControlValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275CheckboxControlValueAccessor_BaseFactory;
  return function CheckboxControlValueAccessor_Factory(t) {
    return (\u0275CheckboxControlValueAccessor_BaseFactory || (\u0275CheckboxControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_CheckboxControlValueAccessor)))(t || _CheckboxControlValueAccessor);
  };
})();
_CheckboxControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CheckboxControlValueAccessor,
  selectors: [["input", "type", "checkbox", "formControlName", ""], ["input", "type", "checkbox", "formControl", ""], ["input", "type", "checkbox", "ngModel", ""]],
  hostBindings: function CheckboxControlValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("change", function CheckboxControlValueAccessor_change_HostBindingHandler($event) {
        return ctx.onChange($event.target.checked);
      })("blur", function CheckboxControlValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  features: [\u0275\u0275ProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var CheckboxControlValueAccessor = _CheckboxControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CheckboxControlValueAccessor, [{
    type: Directive,
    args: [{
      selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",
      host: {
        "(change)": "onChange($event.target.checked)",
        "(blur)": "onTouched()"
      },
      providers: [CHECKBOX_VALUE_ACCESSOR]
    }]
  }], null, null);
})();
var DEFAULT_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => DefaultValueAccessor),
  multi: true
};
function _isAndroid() {
  const userAgent = getDOM() ? getDOM().getUserAgent() : "";
  return /android (\d+)/.test(userAgent.toLowerCase());
}
var COMPOSITION_BUFFER_MODE = new InjectionToken(ngDevMode ? "CompositionEventMode" : "");
var _DefaultValueAccessor = class _DefaultValueAccessor extends BaseControlValueAccessor {
  constructor(renderer, elementRef, _compositionMode) {
    super(renderer, elementRef);
    this._compositionMode = _compositionMode;
    this._composing = false;
    if (this._compositionMode == null) {
      this._compositionMode = !_isAndroid();
    }
  }
  /**
   * Sets the "value" property on the input element.
   * @nodoc
   */
  writeValue(value) {
    const normalizedValue = value == null ? "" : value;
    this.setProperty("value", normalizedValue);
  }
  /** @internal */
  _handleInput(value) {
    if (!this._compositionMode || this._compositionMode && !this._composing) {
      this.onChange(value);
    }
  }
  /** @internal */
  _compositionStart() {
    this._composing = true;
  }
  /** @internal */
  _compositionEnd(value) {
    this._composing = false;
    this._compositionMode && this.onChange(value);
  }
};
_DefaultValueAccessor.\u0275fac = function DefaultValueAccessor_Factory(t) {
  return new (t || _DefaultValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(COMPOSITION_BUFFER_MODE, 8));
};
_DefaultValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _DefaultValueAccessor,
  selectors: [["input", "formControlName", "", 3, "type", "checkbox"], ["textarea", "formControlName", ""], ["input", "formControl", "", 3, "type", "checkbox"], ["textarea", "formControl", ""], ["input", "ngModel", "", 3, "type", "checkbox"], ["textarea", "ngModel", ""], ["", "ngDefaultControl", ""]],
  hostBindings: function DefaultValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("input", function DefaultValueAccessor_input_HostBindingHandler($event) {
        return ctx._handleInput($event.target.value);
      })("blur", function DefaultValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      })("compositionstart", function DefaultValueAccessor_compositionstart_HostBindingHandler() {
        return ctx._compositionStart();
      })("compositionend", function DefaultValueAccessor_compositionend_HostBindingHandler($event) {
        return ctx._compositionEnd($event.target.value);
      });
    }
  },
  features: [\u0275\u0275ProvidersFeature([DEFAULT_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var DefaultValueAccessor = _DefaultValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DefaultValueAccessor, [{
    type: Directive,
    args: [{
      selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",
      // TODO: vsavkin replace the above selector with the one below it once
      // https://github.com/angular/angular/issues/3011 is implemented
      // selector: '[ngModel],[formControl],[formControlName]',
      host: {
        "(input)": "$any(this)._handleInput($event.target.value)",
        "(blur)": "onTouched()",
        "(compositionstart)": "$any(this)._compositionStart()",
        "(compositionend)": "$any(this)._compositionEnd($event.target.value)"
      },
      providers: [DEFAULT_VALUE_ACCESSOR]
    }]
  }], () => [{
    type: Renderer2
  }, {
    type: ElementRef
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [COMPOSITION_BUFFER_MODE]
    }]
  }], null);
})();
function isEmptyInputValue(value) {
  return value == null || (typeof value === "string" || Array.isArray(value)) && value.length === 0;
}
function hasValidLength(value) {
  return value != null && typeof value.length === "number";
}
var NG_VALIDATORS = new InjectionToken(ngDevMode ? "NgValidators" : "");
var NG_ASYNC_VALIDATORS = new InjectionToken(ngDevMode ? "NgAsyncValidators" : "");
var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
var Validators = class {
  /**
   * @description
   * Validator that requires the control's value to be greater than or equal to the provided number.
   *
   * @usageNotes
   *
   * ### Validate against a minimum of 3
   *
   * ```typescript
   * const control = new FormControl(2, Validators.min(3));
   *
   * console.log(control.errors); // {min: {min: 3, actual: 2}}
   * ```
   *
   * @returns A validator function that returns an error map with the
   * `min` property if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static min(min) {
    return minValidator(min);
  }
  /**
   * @description
   * Validator that requires the control's value to be less than or equal to the provided number.
   *
   * @usageNotes
   *
   * ### Validate against a maximum of 15
   *
   * ```typescript
   * const control = new FormControl(16, Validators.max(15));
   *
   * console.log(control.errors); // {max: {max: 15, actual: 16}}
   * ```
   *
   * @returns A validator function that returns an error map with the
   * `max` property if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static max(max) {
    return maxValidator(max);
  }
  /**
   * @description
   * Validator that requires the control have a non-empty value.
   *
   * @usageNotes
   *
   * ### Validate that the field is non-empty
   *
   * ```typescript
   * const control = new FormControl('', Validators.required);
   *
   * console.log(control.errors); // {required: true}
   * ```
   *
   * @returns An error map with the `required` property
   * if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static required(control) {
    return requiredValidator(control);
  }
  /**
   * @description
   * Validator that requires the control's value be true. This validator is commonly
   * used for required checkboxes.
   *
   * @usageNotes
   *
   * ### Validate that the field value is true
   *
   * ```typescript
   * const control = new FormControl('some value', Validators.requiredTrue);
   *
   * console.log(control.errors); // {required: true}
   * ```
   *
   * @returns An error map that contains the `required` property
   * set to `true` if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static requiredTrue(control) {
    return requiredTrueValidator(control);
  }
  /**
   * @description
   * Validator that requires the control's value pass an email validation test.
   *
   * Tests the value using a [regular
   * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
   * pattern suitable for common use cases. The pattern is based on the definition of a valid email
   * address in the [WHATWG HTML
   * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with
   * some enhancements to incorporate more RFC rules (such as rules related to domain names and the
   * lengths of different parts of the address).
   *
   * The differences from the WHATWG version include:
   * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`).
   * - Disallow `local-part` to be longer than 64 characters.
   * - Disallow the whole address to be longer than 254 characters.
   *
   * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to
   * validate the value against a different pattern.
   *
   * @usageNotes
   *
   * ### Validate that the field matches a valid email pattern
   *
   * ```typescript
   * const control = new FormControl('bad@', Validators.email);
   *
   * console.log(control.errors); // {email: true}
   * ```
   *
   * @returns An error map with the `email` property
   * if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static email(control) {
    return emailValidator(control);
  }
  /**
   * @description
   * Validator that requires the length of the control's value to be greater than or equal
   * to the provided minimum length. This validator is also provided by default if you use the
   * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used
   * only for types that have a numeric `length` property, such as strings or arrays. The
   * `minLength` validator logic is also not invoked for values when their `length` property is 0
   * (for example in case of an empty string or an empty array), to support optional controls. You
   * can use the standard `required` validator if empty values should not be considered valid.
   *
   * @usageNotes
   *
   * ### Validate that the field has a minimum of 3 characters
   *
   * ```typescript
   * const control = new FormControl('ng', Validators.minLength(3));
   *
   * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}}
   * ```
   *
   * ```html
   * <input minlength="5">
   * ```
   *
   * @returns A validator function that returns an error map with the
   * `minlength` property if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static minLength(minLength) {
    return minLengthValidator(minLength);
  }
  /**
   * @description
   * Validator that requires the length of the control's value to be less than or equal
   * to the provided maximum length. This validator is also provided by default if you use the
   * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used
   * only for types that have a numeric `length` property, such as strings or arrays.
   *
   * @usageNotes
   *
   * ### Validate that the field has maximum of 5 characters
   *
   * ```typescript
   * const control = new FormControl('Angular', Validators.maxLength(5));
   *
   * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}}
   * ```
   *
   * ```html
   * <input maxlength="5">
   * ```
   *
   * @returns A validator function that returns an error map with the
   * `maxlength` property if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static maxLength(maxLength) {
    return maxLengthValidator(maxLength);
  }
  /**
   * @description
   * Validator that requires the control's value to match a regex pattern. This validator is also
   * provided by default if you use the HTML5 `pattern` attribute.
   *
   * @usageNotes
   *
   * ### Validate that the field only contains letters or spaces
   *
   * ```typescript
   * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*'));
   *
   * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}}
   * ```
   *
   * ```html
   * <input pattern="[a-zA-Z ]*">
   * ```
   *
   * ### Pattern matching with the global or sticky flag
   *
   * `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern`
   * can produce different results on the same input when validations are run consecutively. This is
   * due to how the behavior of `RegExp.prototype.test` is
   * specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec)
   * (`RegExp` preserves the index of the last match when the global or sticky flag is used).
   * Due to this behavior, it is recommended that when using
   * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky
   * flag enabled.
   *
   * ```typescript
   * // Not recommended (since the `g` flag is used)
   * const controlOne = new FormControl('1', Validators.pattern(/foo/g));
   *
   * // Good
   * const controlTwo = new FormControl('1', Validators.pattern(/foo/));
   * ```
   *
   * @param pattern A regular expression to be used as is to test the values, or a string.
   * If a string is passed, the `^` character is prepended and the `$` character is
   * appended to the provided string (if not already present), and the resulting regular
   * expression is used to test the values.
   *
   * @returns A validator function that returns an error map with the
   * `pattern` property if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static pattern(pattern) {
    return patternValidator(pattern);
  }
  /**
   * @description
   * Validator that performs no operation.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static nullValidator(control) {
    return nullValidator(control);
  }
  static compose(validators) {
    return compose(validators);
  }
  /**
   * @description
   * Compose multiple async validators into a single function that returns the union
   * of the individual error objects for the provided control.
   *
   * @returns A validator function that returns an error map with the
   * merged error objects of the async validators if the validation check fails, otherwise `null`.
   *
   * @see {@link updateValueAndValidity()}
   *
   */
  static composeAsync(validators) {
    return composeAsync(validators);
  }
};
function minValidator(min) {
  return (control) => {
    if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) {
      return null;
    }
    const value = parseFloat(control.value);
    return !isNaN(value) && value < min ? {
      "min": {
        "min": min,
        "actual": control.value
      }
    } : null;
  };
}
function maxValidator(max) {
  return (control) => {
    if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) {
      return null;
    }
    const value = parseFloat(control.value);
    return !isNaN(value) && value > max ? {
      "max": {
        "max": max,
        "actual": control.value
      }
    } : null;
  };
}
function requiredValidator(control) {
  return isEmptyInputValue(control.value) ? {
    "required": true
  } : null;
}
function requiredTrueValidator(control) {
  return control.value === true ? null : {
    "required": true
  };
}
function emailValidator(control) {
  if (isEmptyInputValue(control.value)) {
    return null;
  }
  return EMAIL_REGEXP.test(control.value) ? null : {
    "email": true
  };
}
function minLengthValidator(minLength) {
  return (control) => {
    if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) {
      return null;
    }
    return control.value.length < minLength ? {
      "minlength": {
        "requiredLength": minLength,
        "actualLength": control.value.length
      }
    } : null;
  };
}
function maxLengthValidator(maxLength) {
  return (control) => {
    return hasValidLength(control.value) && control.value.length > maxLength ? {
      "maxlength": {
        "requiredLength": maxLength,
        "actualLength": control.value.length
      }
    } : null;
  };
}
function patternValidator(pattern) {
  if (!pattern) return nullValidator;
  let regex;
  let regexStr;
  if (typeof pattern === "string") {
    regexStr = "";
    if (pattern.charAt(0) !== "^") regexStr += "^";
    regexStr += pattern;
    if (pattern.charAt(pattern.length - 1) !== "$") regexStr += "$";
    regex = new RegExp(regexStr);
  } else {
    regexStr = pattern.toString();
    regex = pattern;
  }
  return (control) => {
    if (isEmptyInputValue(control.value)) {
      return null;
    }
    const value = control.value;
    return regex.test(value) ? null : {
      "pattern": {
        "requiredPattern": regexStr,
        "actualValue": value
      }
    };
  };
}
function nullValidator(control) {
  return null;
}
function isPresent(o) {
  return o != null;
}
function toObservable(value) {
  const obs = isPromise2(value) ? from(value) : value;
  if ((typeof ngDevMode === "undefined" || ngDevMode) && !isSubscribable(obs)) {
    let errorMessage = `Expected async validator to return Promise or Observable.`;
    if (typeof value === "object") {
      errorMessage += " Are you using a synchronous validator where an async validator is expected?";
    }
    throw new RuntimeError(-1101, errorMessage);
  }
  return obs;
}
function mergeErrors(arrayOfErrors) {
  let res = {};
  arrayOfErrors.forEach((errors) => {
    res = errors != null ? __spreadValues(__spreadValues({}, res), errors) : res;
  });
  return Object.keys(res).length === 0 ? null : res;
}
function executeValidators(control, validators) {
  return validators.map((validator) => validator(control));
}
function isValidatorFn(validator) {
  return !validator.validate;
}
function normalizeValidators(validators) {
  return validators.map((validator) => {
    return isValidatorFn(validator) ? validator : (c) => validator.validate(c);
  });
}
function compose(validators) {
  if (!validators) return null;
  const presentValidators = validators.filter(isPresent);
  if (presentValidators.length == 0) return null;
  return function(control) {
    return mergeErrors(executeValidators(control, presentValidators));
  };
}
function composeValidators(validators) {
  return validators != null ? compose(normalizeValidators(validators)) : null;
}
function composeAsync(validators) {
  if (!validators) return null;
  const presentValidators = validators.filter(isPresent);
  if (presentValidators.length == 0) return null;
  return function(control) {
    const observables = executeValidators(control, presentValidators).map(toObservable);
    return forkJoin(observables).pipe(map(mergeErrors));
  };
}
function composeAsyncValidators(validators) {
  return validators != null ? composeAsync(normalizeValidators(validators)) : null;
}
function mergeValidators(controlValidators, dirValidator) {
  if (controlValidators === null) return [dirValidator];
  return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] : [controlValidators, dirValidator];
}
function getControlValidators(control) {
  return control._rawValidators;
}
function getControlAsyncValidators(control) {
  return control._rawAsyncValidators;
}
function makeValidatorsArray(validators) {
  if (!validators) return [];
  return Array.isArray(validators) ? validators : [validators];
}
function hasValidator(validators, validator) {
  return Array.isArray(validators) ? validators.includes(validator) : validators === validator;
}
function addValidators(validators, currentValidators) {
  const current = makeValidatorsArray(currentValidators);
  const validatorsToAdd = makeValidatorsArray(validators);
  validatorsToAdd.forEach((v) => {
    if (!hasValidator(current, v)) {
      current.push(v);
    }
  });
  return current;
}
function removeValidators(validators, currentValidators) {
  return makeValidatorsArray(currentValidators).filter((v) => !hasValidator(validators, v));
}
var AbstractControlDirective = class {
  constructor() {
    this._rawValidators = [];
    this._rawAsyncValidators = [];
    this._onDestroyCallbacks = [];
  }
  /**
   * @description
   * Reports the value of the control if it is present, otherwise null.
   */
  get value() {
    return this.control ? this.control.value : null;
  }
  /**
   * @description
   * Reports whether the control is valid. A control is considered valid if no
   * validation errors exist with the current value.
   * If the control is not present, null is returned.
   */
  get valid() {
    return this.control ? this.control.valid : null;
  }
  /**
   * @description
   * Reports whether the control is invalid, meaning that an error exists in the input value.
   * If the control is not present, null is returned.
   */
  get invalid() {
    return this.control ? this.control.invalid : null;
  }
  /**
   * @description
   * Reports whether a control is pending, meaning that async validation is occurring and
   * errors are not yet available for the input value. If the control is not present, null is
   * returned.
   */
  get pending() {
    return this.control ? this.control.pending : null;
  }
  /**
   * @description
   * Reports whether the control is disabled, meaning that the control is disabled
   * in the UI and is exempt from validation checks and excluded from aggregate
   * values of ancestor controls. If the control is not present, null is returned.
   */
  get disabled() {
    return this.control ? this.control.disabled : null;
  }
  /**
   * @description
   * Reports whether the control is enabled, meaning that the control is included in ancestor
   * calculations of validity or value. If the control is not present, null is returned.
   */
  get enabled() {
    return this.control ? this.control.enabled : null;
  }
  /**
   * @description
   * Reports the control's validation errors. If the control is not present, null is returned.
   */
  get errors() {
    return this.control ? this.control.errors : null;
  }
  /**
   * @description
   * Reports whether the control is pristine, meaning that the user has not yet changed
   * the value in the UI. If the control is not present, null is returned.
   */
  get pristine() {
    return this.control ? this.control.pristine : null;
  }
  /**
   * @description
   * Reports whether the control is dirty, meaning that the user has changed
   * the value in the UI. If the control is not present, null is returned.
   */
  get dirty() {
    return this.control ? this.control.dirty : null;
  }
  /**
   * @description
   * Reports whether the control is touched, meaning that the user has triggered
   * a `blur` event on it. If the control is not present, null is returned.
   */
  get touched() {
    return this.control ? this.control.touched : null;
  }
  /**
   * @description
   * Reports the validation status of the control. Possible values include:
   * 'VALID', 'INVALID', 'DISABLED', and 'PENDING'.
   * If the control is not present, null is returned.
   */
  get status() {
    return this.control ? this.control.status : null;
  }
  /**
   * @description
   * Reports whether the control is untouched, meaning that the user has not yet triggered
   * a `blur` event on it. If the control is not present, null is returned.
   */
  get untouched() {
    return this.control ? this.control.untouched : null;
  }
  /**
   * @description
   * Returns a multicasting observable that emits a validation status whenever it is
   * calculated for the control. If the control is not present, null is returned.
   */
  get statusChanges() {
    return this.control ? this.control.statusChanges : null;
  }
  /**
   * @description
   * Returns a multicasting observable of value changes for the control that emits every time the
   * value of the control changes in the UI or programmatically.
   * If the control is not present, null is returned.
   */
  get valueChanges() {
    return this.control ? this.control.valueChanges : null;
  }
  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  get path() {
    return null;
  }
  /**
   * Sets synchronous validators for this directive.
   * @internal
   */
  _setValidators(validators) {
    this._rawValidators = validators || [];
    this._composedValidatorFn = composeValidators(this._rawValidators);
  }
  /**
   * Sets asynchronous validators for this directive.
   * @internal
   */
  _setAsyncValidators(validators) {
    this._rawAsyncValidators = validators || [];
    this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators);
  }
  /**
   * @description
   * Synchronous validator function composed of all the synchronous validators registered with this
   * directive.
   */
  get validator() {
    return this._composedValidatorFn || null;
  }
  /**
   * @description
   * Asynchronous validator function composed of all the asynchronous validators registered with
   * this directive.
   */
  get asyncValidator() {
    return this._composedAsyncValidatorFn || null;
  }
  /**
   * Internal function to register callbacks that should be invoked
   * when directive instance is being destroyed.
   * @internal
   */
  _registerOnDestroy(fn) {
    this._onDestroyCallbacks.push(fn);
  }
  /**
   * Internal function to invoke all registered "on destroy" callbacks.
   * Note: calling this function also clears the list of callbacks.
   * @internal
   */
  _invokeOnDestroyCallbacks() {
    this._onDestroyCallbacks.forEach((fn) => fn());
    this._onDestroyCallbacks = [];
  }
  /**
   * @description
   * Resets the control with the provided value if the control is present.
   */
  reset(value = void 0) {
    if (this.control) this.control.reset(value);
  }
  /**
   * @description
   * Reports whether the control with the given path has the error specified.
   *
   * @param errorCode The code of the error to check
   * @param path A list of control names that designates how to move from the current control
   * to the control that should be queried for errors.
   *
   * @usageNotes
   * For example, for the following `FormGroup`:
   *
   * ```
   * form = new FormGroup({
   *   address: new FormGroup({ street: new FormControl() })
   * });
   * ```
   *
   * The path to the 'street' control from the root form would be 'address' -> 'street'.
   *
   * It can be provided to this method in one of two formats:
   *
   * 1. An array of string control names, e.g. `['address', 'street']`
   * 1. A period-delimited list of control names in one string, e.g. `'address.street'`
   *
   * If no path is given, this method checks for the error on the current control.
   *
   * @returns whether the given error is present in the control at the given path.
   *
   * If the control is not present, false is returned.
   */
  hasError(errorCode, path) {
    return this.control ? this.control.hasError(errorCode, path) : false;
  }
  /**
   * @description
   * Reports error data for the control with the given path.
   *
   * @param errorCode The code of the error to check
   * @param path A list of control names that designates how to move from the current control
   * to the control that should be queried for errors.
   *
   * @usageNotes
   * For example, for the following `FormGroup`:
   *
   * ```
   * form = new FormGroup({
   *   address: new FormGroup({ street: new FormControl() })
   * });
   * ```
   *
   * The path to the 'street' control from the root form would be 'address' -> 'street'.
   *
   * It can be provided to this method in one of two formats:
   *
   * 1. An array of string control names, e.g. `['address', 'street']`
   * 1. A period-delimited list of control names in one string, e.g. `'address.street'`
   *
   * @returns error data for that particular error. If the control or error is not present,
   * null is returned.
   */
  getError(errorCode, path) {
    return this.control ? this.control.getError(errorCode, path) : null;
  }
};
var ControlContainer = class extends AbstractControlDirective {
  /**
   * @description
   * The top-level form directive for the control.
   */
  get formDirective() {
    return null;
  }
  /**
   * @description
   * The path to this group.
   */
  get path() {
    return null;
  }
};
var NgControl = class extends AbstractControlDirective {
  constructor() {
    super(...arguments);
    this._parent = null;
    this.name = null;
    this.valueAccessor = null;
  }
};
var AbstractControlStatus = class {
  constructor(cd) {
    this._cd = cd;
  }
  get isTouched() {
    return !!this._cd?.control?.touched;
  }
  get isUntouched() {
    return !!this._cd?.control?.untouched;
  }
  get isPristine() {
    return !!this._cd?.control?.pristine;
  }
  get isDirty() {
    return !!this._cd?.control?.dirty;
  }
  get isValid() {
    return !!this._cd?.control?.valid;
  }
  get isInvalid() {
    return !!this._cd?.control?.invalid;
  }
  get isPending() {
    return !!this._cd?.control?.pending;
  }
  get isSubmitted() {
    return !!this._cd?.submitted;
  }
};
var ngControlStatusHost = {
  "[class.ng-untouched]": "isUntouched",
  "[class.ng-touched]": "isTouched",
  "[class.ng-pristine]": "isPristine",
  "[class.ng-dirty]": "isDirty",
  "[class.ng-valid]": "isValid",
  "[class.ng-invalid]": "isInvalid",
  "[class.ng-pending]": "isPending"
};
var ngGroupStatusHost = __spreadProps(__spreadValues({}, ngControlStatusHost), {
  "[class.ng-submitted]": "isSubmitted"
});
var _NgControlStatus = class _NgControlStatus extends AbstractControlStatus {
  constructor(cd) {
    super(cd);
  }
};
_NgControlStatus.\u0275fac = function NgControlStatus_Factory(t) {
  return new (t || _NgControlStatus)(\u0275\u0275directiveInject(NgControl, 2));
};
_NgControlStatus.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgControlStatus,
  selectors: [["", "formControlName", ""], ["", "ngModel", ""], ["", "formControl", ""]],
  hostVars: 14,
  hostBindings: function NgControlStatus_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("ng-untouched", ctx.isUntouched)("ng-touched", ctx.isTouched)("ng-pristine", ctx.isPristine)("ng-dirty", ctx.isDirty)("ng-valid", ctx.isValid)("ng-invalid", ctx.isInvalid)("ng-pending", ctx.isPending);
    }
  },
  features: [\u0275\u0275InheritDefinitionFeature]
});
var NgControlStatus = _NgControlStatus;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgControlStatus, [{
    type: Directive,
    args: [{
      selector: "[formControlName],[ngModel],[formControl]",
      host: ngControlStatusHost
    }]
  }], () => [{
    type: NgControl,
    decorators: [{
      type: Self
    }]
  }], null);
})();
var _NgControlStatusGroup = class _NgControlStatusGroup extends AbstractControlStatus {
  constructor(cd) {
    super(cd);
  }
};
_NgControlStatusGroup.\u0275fac = function NgControlStatusGroup_Factory(t) {
  return new (t || _NgControlStatusGroup)(\u0275\u0275directiveInject(ControlContainer, 10));
};
_NgControlStatusGroup.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgControlStatusGroup,
  selectors: [["", "formGroupName", ""], ["", "formArrayName", ""], ["", "ngModelGroup", ""], ["", "formGroup", ""], ["form", 3, "ngNoForm", ""], ["", "ngForm", ""]],
  hostVars: 16,
  hostBindings: function NgControlStatusGroup_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("ng-untouched", ctx.isUntouched)("ng-touched", ctx.isTouched)("ng-pristine", ctx.isPristine)("ng-dirty", ctx.isDirty)("ng-valid", ctx.isValid)("ng-invalid", ctx.isInvalid)("ng-pending", ctx.isPending)("ng-submitted", ctx.isSubmitted);
    }
  },
  features: [\u0275\u0275InheritDefinitionFeature]
});
var NgControlStatusGroup = _NgControlStatusGroup;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgControlStatusGroup, [{
    type: Directive,
    args: [{
      selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",
      host: ngGroupStatusHost
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }]
  }], null);
})();
var formControlNameExample = `
  <div [formGroup]="myGroup">
    <input formControlName="firstName">
  </div>

  In your class:

  this.myGroup = new FormGroup({
      firstName: new FormControl()
  });`;
var formGroupNameExample = `
  <div [formGroup]="myGroup">
      <div formGroupName="person">
        <input formControlName="firstName">
      </div>
  </div>

  In your class:

  this.myGroup = new FormGroup({
      person: new FormGroup({ firstName: new FormControl() })
  });`;
var formArrayNameExample = `
  <div [formGroup]="myGroup">
    <div formArrayName="cities">
      <div *ngFor="let city of cityArray.controls; index as i">
        <input [formControlName]="i">
      </div>
    </div>
  </div>

  In your class:

  this.cityArray = new FormArray([new FormControl('SF')]);
  this.myGroup = new FormGroup({
    cities: this.cityArray
  });`;
var ngModelGroupExample = `
  <form>
      <div ngModelGroup="person">
        <input [(ngModel)]="person.name" name="firstName">
      </div>
  </form>`;
var ngModelWithFormGroupExample = `
  <div [formGroup]="myGroup">
      <input formControlName="firstName">
      <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">
  </div>
`;
function controlParentException(nameOrIndex) {
  return new RuntimeError(1050, `formControlName must be used with a parent formGroup directive. You'll want to add a formGroup
      directive and pass it an existing FormGroup instance (you can create one in your class).

      ${describeFormControl(nameOrIndex)}

    Example:

    ${formControlNameExample}`);
}
function describeFormControl(nameOrIndex) {
  if (nameOrIndex == null || nameOrIndex === "") {
    return "";
  }
  const valueType = typeof nameOrIndex === "string" ? "name" : "index";
  return `Affected Form Control ${valueType}: "${nameOrIndex}"`;
}
function ngModelGroupException() {
  return new RuntimeError(1051, `formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents
      that also have a "form" prefix: formGroupName, formArrayName, or formGroup.

      Option 1:  Update the parent to be formGroupName (reactive form strategy)

      ${formGroupNameExample}

      Option 2: Use ngModel instead of formControlName (template-driven strategy)

      ${ngModelGroupExample}`);
}
function missingFormException() {
  return new RuntimeError(1052, `formGroup expects a FormGroup instance. Please pass one in.

      Example:

      ${formControlNameExample}`);
}
function groupParentException() {
  return new RuntimeError(1053, `formGroupName must be used with a parent formGroup directive.  You'll want to add a formGroup
    directive and pass it an existing FormGroup instance (you can create one in your class).

    Example:

    ${formGroupNameExample}`);
}
function arrayParentException() {
  return new RuntimeError(1054, `formArrayName must be used with a parent formGroup directive.  You'll want to add a formGroup
      directive and pass it an existing FormGroup instance (you can create one in your class).

      Example:

      ${formArrayNameExample}`);
}
var disabledAttrWarning = `
  It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true
  when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
  you. We recommend using this approach to avoid 'changed after checked' errors.

  Example:
  // Specify the \`disabled\` property at control creation time:
  form = new FormGroup({
    first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
    last: new FormControl('Drew', Validators.required)
  });

  // Controls can also be enabled/disabled after creation:
  form.get('first')?.enable();
  form.get('last')?.disable();
`;
var asyncValidatorsDroppedWithOptsWarning = `
  It looks like you're constructing using a FormControl with both an options argument and an
  async validators argument. Mixing these arguments will cause your async validators to be dropped.
  You should either put all your validators in the options object, or in separate validators
  arguments. For example:

  // Using validators arguments
  fc = new FormControl(42, Validators.required, myAsyncValidator);

  // Using AbstractControlOptions
  fc = new FormControl(42, {validators: Validators.required, asyncValidators: myAV});

  // Do NOT mix them: async validators will be dropped!
  fc = new FormControl(42, {validators: Validators.required}, /* Oops! */ myAsyncValidator);
`;
function ngModelWarning(directiveName) {
  return `
  It looks like you're using ngModel on the same form field as ${directiveName}.
  Support for using the ngModel input property and ngModelChange event with
  reactive form directives has been deprecated in Angular v6 and will be removed
  in a future version of Angular.

  For more information on this, see our API docs here:
  https://angular.io/api/forms/${directiveName === "formControl" ? "FormControlDirective" : "FormControlName"}#use-with-ngmodel
  `;
}
function describeKey(isFormGroup, key) {
  return isFormGroup ? `with name: '${key}'` : `at index: ${key}`;
}
function noControlsError(isFormGroup) {
  return `
    There are no form controls registered with this ${isFormGroup ? "group" : "array"} yet. If you're using ngModel,
    you may want to check next tick (e.g. use setTimeout).
  `;
}
function missingControlError(isFormGroup, key) {
  return `Cannot find form control ${describeKey(isFormGroup, key)}`;
}
function missingControlValueError(isFormGroup, key) {
  return `Must supply a value for form control ${describeKey(isFormGroup, key)}`;
}
var VALID = "VALID";
var INVALID = "INVALID";
var PENDING = "PENDING";
var DISABLED = "DISABLED";
var ControlEvent = class {
};
var ValueChangeEvent = class extends ControlEvent {
  constructor(value, source) {
    super();
    this.value = value;
    this.source = source;
  }
};
var PristineChangeEvent = class extends ControlEvent {
  constructor(pristine, source) {
    super();
    this.pristine = pristine;
    this.source = source;
  }
};
var TouchedChangeEvent = class extends ControlEvent {
  constructor(touched, source) {
    super();
    this.touched = touched;
    this.source = source;
  }
};
var StatusChangeEvent = class extends ControlEvent {
  constructor(status, source) {
    super();
    this.status = status;
    this.source = source;
  }
};
function pickValidators(validatorOrOpts) {
  return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null;
}
function coerceToValidator(validator) {
  return Array.isArray(validator) ? composeValidators(validator) : validator || null;
}
function pickAsyncValidators(asyncValidator, validatorOrOpts) {
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    if (isOptionsObj(validatorOrOpts) && asyncValidator) {
      console.warn(asyncValidatorsDroppedWithOptsWarning);
    }
  }
  return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null;
}
function coerceToAsyncValidator(asyncValidator) {
  return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator || null;
}
function isOptionsObj(validatorOrOpts) {
  return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === "object";
}
function assertControlPresent(parent, isGroup, key) {
  const controls = parent.controls;
  const collection = isGroup ? Object.keys(controls) : controls;
  if (!collection.length) {
    throw new RuntimeError(1e3, typeof ngDevMode === "undefined" || ngDevMode ? noControlsError(isGroup) : "");
  }
  if (!controls[key]) {
    throw new RuntimeError(1001, typeof ngDevMode === "undefined" || ngDevMode ? missingControlError(isGroup, key) : "");
  }
}
function assertAllValuesPresent(control, isGroup, value) {
  control._forEachChild((_, key) => {
    if (value[key] === void 0) {
      throw new RuntimeError(1002, typeof ngDevMode === "undefined" || ngDevMode ? missingControlValueError(isGroup, key) : "");
    }
  });
}
var AbstractControl = class {
  /**
   * Initialize the AbstractControl instance.
   *
   * @param validators The function or array of functions that is used to determine the validity of
   *     this control synchronously.
   * @param asyncValidators The function or array of functions that is used to determine validity of
   *     this control asynchronously.
   */
  constructor(validators, asyncValidators) {
    this._pendingDirty = false;
    this._hasOwnPendingAsyncValidator = false;
    this._pendingTouched = false;
    this._onCollectionChange = () => {
    };
    this._parent = null;
    this.pristine = true;
    this.touched = false;
    this._events = new Subject();
    this.events = this._events.asObservable();
    this._onDisabledChange = [];
    this._assignValidators(validators);
    this._assignAsyncValidators(asyncValidators);
  }
  /**
   * Returns the function that is used to determine the validity of this control synchronously.
   * If multiple validators have been added, this will be a single composed function.
   * See `Validators.compose()` for additional information.
   */
  get validator() {
    return this._composedValidatorFn;
  }
  set validator(validatorFn) {
    this._rawValidators = this._composedValidatorFn = validatorFn;
  }
  /**
   * Returns the function that is used to determine the validity of this control asynchronously.
   * If multiple validators have been added, this will be a single composed function.
   * See `Validators.compose()` for additional information.
   */
  get asyncValidator() {
    return this._composedAsyncValidatorFn;
  }
  set asyncValidator(asyncValidatorFn) {
    this._rawAsyncValidators = this._composedAsyncValidatorFn = asyncValidatorFn;
  }
  /**
   * The parent control.
   */
  get parent() {
    return this._parent;
  }
  /**
   * A control is `valid` when its `status` is `VALID`.
   *
   * @see {@link AbstractControl.status}
   *
   * @returns True if the control has passed all of its validation tests,
   * false otherwise.
   */
  get valid() {
    return this.status === VALID;
  }
  /**
   * A control is `invalid` when its `status` is `INVALID`.
   *
   * @see {@link AbstractControl.status}
   *
   * @returns True if this control has failed one or more of its validation checks,
   * false otherwise.
   */
  get invalid() {
    return this.status === INVALID;
  }
  /**
   * A control is `pending` when its `status` is `PENDING`.
   *
   * @see {@link AbstractControl.status}
   *
   * @returns True if this control is in the process of conducting a validation check,
   * false otherwise.
   */
  get pending() {
    return this.status == PENDING;
  }
  /**
   * A control is `disabled` when its `status` is `DISABLED`.
   *
   * Disabled controls are exempt from validation checks and
   * are not included in the aggregate value of their ancestor
   * controls.
   *
   * @see {@link AbstractControl.status}
   *
   * @returns True if the control is disabled, false otherwise.
   */
  get disabled() {
    return this.status === DISABLED;
  }
  /**
   * A control is `enabled` as long as its `status` is not `DISABLED`.
   *
   * @returns True if the control has any status other than 'DISABLED',
   * false if the status is 'DISABLED'.
   *
   * @see {@link AbstractControl.status}
   *
   */
  get enabled() {
    return this.status !== DISABLED;
  }
  /**
   * A control is `dirty` if the user has changed the value
   * in the UI.
   *
   * @returns True if the user has changed the value of this control in the UI; compare `pristine`.
   * Programmatic changes to a control's value do not mark it dirty.
   */
  get dirty() {
    return !this.pristine;
  }
  /**
   * True if the control has not been marked as touched
   *
   * A control is `untouched` if the user has not yet triggered
   * a `blur` event on it.
   */
  get untouched() {
    return !this.touched;
  }
  /**
   * Reports the update strategy of the `AbstractControl` (meaning
   * the event on which the control updates itself).
   * Possible values: `'change'` | `'blur'` | `'submit'`
   * Default value: `'change'`
   */
  get updateOn() {
    return this._updateOn ? this._updateOn : this.parent ? this.parent.updateOn : "change";
  }
  /**
   * Sets the synchronous validators that are active on this control.  Calling
   * this overwrites any existing synchronous validators.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * If you want to add a new validator without affecting existing ones, consider
   * using `addValidators()` method instead.
   */
  setValidators(validators) {
    this._assignValidators(validators);
  }
  /**
   * Sets the asynchronous validators that are active on this control. Calling this
   * overwrites any existing asynchronous validators.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * If you want to add a new validator without affecting existing ones, consider
   * using `addAsyncValidators()` method instead.
   */
  setAsyncValidators(validators) {
    this._assignAsyncValidators(validators);
  }
  /**
   * Add a synchronous validator or validators to this control, without affecting other validators.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * Adding a validator that already exists will have no effect. If duplicate validator functions
   * are present in the `validators` array, only the first instance would be added to a form
   * control.
   *
   * @param validators The new validator function or functions to add to this control.
   */
  addValidators(validators) {
    this.setValidators(addValidators(validators, this._rawValidators));
  }
  /**
   * Add an asynchronous validator or validators to this control, without affecting other
   * validators.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * Adding a validator that already exists will have no effect.
   *
   * @param validators The new asynchronous validator function or functions to add to this control.
   */
  addAsyncValidators(validators) {
    this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators));
  }
  /**
   * Remove a synchronous validator from this control, without affecting other validators.
   * Validators are compared by function reference; you must pass a reference to the exact same
   * validator function as the one that was originally set. If a provided validator is not found,
   * it is ignored.
   *
   * @usageNotes
   *
   * ### Reference to a ValidatorFn
   *
   * ```
   * // Reference to the RequiredValidator
   * const ctrl = new FormControl<string | null>('', Validators.required);
   * ctrl.removeValidators(Validators.required);
   *
   * // Reference to anonymous function inside MinValidator
   * const minValidator = Validators.min(3);
   * const ctrl = new FormControl<string | null>('', minValidator);
   * expect(ctrl.hasValidator(minValidator)).toEqual(true)
   * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)
   *
   * ctrl.removeValidators(minValidator);
   * ```
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * @param validators The validator or validators to remove.
   */
  removeValidators(validators) {
    this.setValidators(removeValidators(validators, this._rawValidators));
  }
  /**
   * Remove an asynchronous validator from this control, without affecting other validators.
   * Validators are compared by function reference; you must pass a reference to the exact same
   * validator function as the one that was originally set. If a provided validator is not found, it
   * is ignored.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   * @param validators The asynchronous validator or validators to remove.
   */
  removeAsyncValidators(validators) {
    this.setAsyncValidators(removeValidators(validators, this._rawAsyncValidators));
  }
  /**
   * Check whether a synchronous validator function is present on this control. The provided
   * validator must be a reference to the exact same function that was provided.
   *
   * @usageNotes
   *
   * ### Reference to a ValidatorFn
   *
   * ```
   * // Reference to the RequiredValidator
   * const ctrl = new FormControl<number | null>(0, Validators.required);
   * expect(ctrl.hasValidator(Validators.required)).toEqual(true)
   *
   * // Reference to anonymous function inside MinValidator
   * const minValidator = Validators.min(3);
   * const ctrl = new FormControl<number | null>(0, minValidator);
   * expect(ctrl.hasValidator(minValidator)).toEqual(true)
   * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false)
   * ```
   *
   * @param validator The validator to check for presence. Compared by function reference.
   * @returns Whether the provided validator was found on this control.
   */
  hasValidator(validator) {
    return hasValidator(this._rawValidators, validator);
  }
  /**
   * Check whether an asynchronous validator function is present on this control. The provided
   * validator must be a reference to the exact same function that was provided.
   *
   * @param validator The asynchronous validator to check for presence. Compared by function
   *     reference.
   * @returns Whether the provided asynchronous validator was found on this control.
   */
  hasAsyncValidator(validator) {
    return hasValidator(this._rawAsyncValidators, validator);
  }
  /**
   * Empties out the synchronous validator list.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   */
  clearValidators() {
    this.validator = null;
  }
  /**
   * Empties out the async validator list.
   *
   * When you add or remove a validator at run time, you must call
   * `updateValueAndValidity()` for the new validation to take effect.
   *
   */
  clearAsyncValidators() {
    this.asyncValidator = null;
  }
  markAsTouched(opts = {}) {
    const changed = this.touched === false;
    this.touched = true;
    const sourceControl = opts.sourceControl ?? this;
    if (this._parent && !opts.onlySelf) {
      this._parent.markAsTouched(__spreadProps(__spreadValues({}, opts), {
        sourceControl
      }));
    }
    if (changed && opts.emitEvent !== false) {
      this._events.next(new TouchedChangeEvent(true, sourceControl));
    }
  }
  /**
   * Marks the control and all its descendant controls as `touched`.
   * @see {@link markAsTouched()}
   *
   * @param opts Configuration options that determine how the control propagates changes
   * and emits events after marking is applied.
   * * `emitEvent`: When true or not supplied (the default), the `events`
   * observable emits a `TouchedChangeEvent` with the `touched` property being `true`.
   * When false, no events are emitted.
   */
  markAllAsTouched(opts = {}) {
    this.markAsTouched({
      onlySelf: true,
      emitEvent: opts.emitEvent,
      sourceControl: this
    });
    this._forEachChild((control) => control.markAllAsTouched(opts));
  }
  markAsUntouched(opts = {}) {
    const changed = this.touched === true;
    this.touched = false;
    this._pendingTouched = false;
    const sourceControl = opts.sourceControl ?? this;
    this._forEachChild((control) => {
      control.markAsUntouched({
        onlySelf: true,
        emitEvent: opts.emitEvent,
        sourceControl
      });
    });
    if (this._parent && !opts.onlySelf) {
      this._parent._updateTouched(opts, sourceControl);
    }
    if (changed && opts.emitEvent !== false) {
      this._events.next(new TouchedChangeEvent(false, sourceControl));
    }
  }
  markAsDirty(opts = {}) {
    const changed = this.pristine === true;
    this.pristine = false;
    const sourceControl = opts.sourceControl ?? this;
    if (this._parent && !opts.onlySelf) {
      this._parent.markAsDirty(__spreadProps(__spreadValues({}, opts), {
        sourceControl
      }));
    }
    if (changed && opts.emitEvent !== false) {
      this._events.next(new PristineChangeEvent(false, sourceControl));
    }
  }
  markAsPristine(opts = {}) {
    const changed = this.pristine === false;
    this.pristine = true;
    this._pendingDirty = false;
    const sourceControl = opts.sourceControl ?? this;
    this._forEachChild((control) => {
      control.markAsPristine({
        onlySelf: true,
        emitEvent: opts.emitEvent
      });
    });
    if (this._parent && !opts.onlySelf) {
      this._parent._updatePristine(opts, sourceControl);
    }
    if (changed && opts.emitEvent !== false) {
      this._events.next(new PristineChangeEvent(true, sourceControl));
    }
  }
  markAsPending(opts = {}) {
    this.status = PENDING;
    const sourceControl = opts.sourceControl ?? this;
    if (opts.emitEvent !== false) {
      this._events.next(new StatusChangeEvent(this.status, sourceControl));
      this.statusChanges.emit(this.status);
    }
    if (this._parent && !opts.onlySelf) {
      this._parent.markAsPending(__spreadProps(__spreadValues({}, opts), {
        sourceControl
      }));
    }
  }
  disable(opts = {}) {
    const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
    this.status = DISABLED;
    this.errors = null;
    this._forEachChild((control) => {
      control.disable(__spreadProps(__spreadValues({}, opts), {
        onlySelf: true
      }));
    });
    this._updateValue();
    const sourceControl = opts.sourceControl ?? this;
    if (opts.emitEvent !== false) {
      this._events.next(new ValueChangeEvent(this.value, sourceControl));
      this._events.next(new StatusChangeEvent(this.status, sourceControl));
      this.valueChanges.emit(this.value);
      this.statusChanges.emit(this.status);
    }
    this._updateAncestors(__spreadProps(__spreadValues({}, opts), {
      skipPristineCheck
    }), this);
    this._onDisabledChange.forEach((changeFn) => changeFn(true));
  }
  /**
   * Enables the control. This means the control is included in validation checks and
   * the aggregate value of its parent. Its status recalculates based on its value and
   * its validators.
   *
   * By default, if the control has children, all children are enabled.
   *
   * @see {@link AbstractControl.status}
   *
   * @param opts Configure options that control how the control propagates changes and
   * emits events when marked as untouched
   * * `onlySelf`: When true, mark only this control. When false or not supplied,
   * marks all direct ancestors. Default is false.
   * * `emitEvent`: When true or not supplied (the default), the `statusChanges`,
   * `valueChanges` and `events`
   * observables emit events with the latest status and value when the control is enabled.
   * When false, no events are emitted.
   */
  enable(opts = {}) {
    const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf);
    this.status = VALID;
    this._forEachChild((control) => {
      control.enable(__spreadProps(__spreadValues({}, opts), {
        onlySelf: true
      }));
    });
    this.updateValueAndValidity({
      onlySelf: true,
      emitEvent: opts.emitEvent
    });
    this._updateAncestors(__spreadProps(__spreadValues({}, opts), {
      skipPristineCheck
    }), this);
    this._onDisabledChange.forEach((changeFn) => changeFn(false));
  }
  _updateAncestors(opts, sourceControl) {
    if (this._parent && !opts.onlySelf) {
      this._parent.updateValueAndValidity(opts);
      if (!opts.skipPristineCheck) {
        this._parent._updatePristine({}, sourceControl);
      }
      this._parent._updateTouched({}, sourceControl);
    }
  }
  /**
   * Sets the parent of the control
   *
   * @param parent The new parent.
   */
  setParent(parent) {
    this._parent = parent;
  }
  /**
   * The raw value of this control. For most control implementations, the raw value will include
   * disabled children.
   */
  getRawValue() {
    return this.value;
  }
  updateValueAndValidity(opts = {}) {
    this._setInitialStatus();
    this._updateValue();
    if (this.enabled) {
      this._cancelExistingSubscription();
      this.errors = this._runValidator();
      this.status = this._calculateStatus();
      if (this.status === VALID || this.status === PENDING) {
        this._runAsyncValidator(opts.emitEvent);
      }
    }
    const sourceControl = opts.sourceControl ?? this;
    if (opts.emitEvent !== false) {
      this._events.next(new ValueChangeEvent(this.value, sourceControl));
      this._events.next(new StatusChangeEvent(this.status, sourceControl));
      this.valueChanges.emit(this.value);
      this.statusChanges.emit(this.status);
    }
    if (this._parent && !opts.onlySelf) {
      this._parent.updateValueAndValidity(__spreadProps(__spreadValues({}, opts), {
        sourceControl
      }));
    }
  }
  /** @internal */
  _updateTreeValidity(opts = {
    emitEvent: true
  }) {
    this._forEachChild((ctrl) => ctrl._updateTreeValidity(opts));
    this.updateValueAndValidity({
      onlySelf: true,
      emitEvent: opts.emitEvent
    });
  }
  _setInitialStatus() {
    this.status = this._allControlsDisabled() ? DISABLED : VALID;
  }
  _runValidator() {
    return this.validator ? this.validator(this) : null;
  }
  _runAsyncValidator(emitEvent) {
    if (this.asyncValidator) {
      this.status = PENDING;
      this._hasOwnPendingAsyncValidator = true;
      const obs = toObservable(this.asyncValidator(this));
      this._asyncValidationSubscription = obs.subscribe((errors) => {
        this._hasOwnPendingAsyncValidator = false;
        this.setErrors(errors, {
          emitEvent
        });
      });
    }
  }
  _cancelExistingSubscription() {
    if (this._asyncValidationSubscription) {
      this._asyncValidationSubscription.unsubscribe();
      this._hasOwnPendingAsyncValidator = false;
    }
  }
  /**
   * Sets errors on a form control when running validations manually, rather than automatically.
   *
   * Calling `setErrors` also updates the validity of the parent control.
   *
   * @param opts Configuration options that determine how the control propagates
   * changes and emits events after the control errors are set.
   * * `emitEvent`: When true or not supplied (the default), the `statusChanges`
   * observable emits an event after the errors are set.
   *
   * @usageNotes
   *
   * ### Manually set the errors for a control
   *
   * ```
   * const login = new FormControl('someLogin');
   * login.setErrors({
   *   notUnique: true
   * });
   *
   * expect(login.valid).toEqual(false);
   * expect(login.errors).toEqual({ notUnique: true });
   *
   * login.setValue('someOtherLogin');
   *
   * expect(login.valid).toEqual(true);
   * ```
   */
  setErrors(errors, opts = {}) {
    this.errors = errors;
    this._updateControlsErrors(opts.emitEvent !== false, this);
  }
  /**
   * Retrieves a child control given the control's name or path.
   *
   * @param path A dot-delimited string or array of string/number values that define the path to the
   * control. If a string is provided, passing it as a string literal will result in improved type
   * information. Likewise, if an array is provided, passing it `as const` will cause improved type
   * information to be available.
   *
   * @usageNotes
   * ### Retrieve a nested control
   *
   * For example, to get a `name` control nested within a `person` sub-group:
   *
   * * `this.form.get('person.name');`
   *
   * -OR-
   *
   * * `this.form.get(['person', 'name'] as const);` // `as const` gives improved typings
   *
   * ### Retrieve a control in a FormArray
   *
   * When accessing an element inside a FormArray, you can use an element index.
   * For example, to get a `price` control from the first element in an `items` array you can use:
   *
   * * `this.form.get('items.0.price');`
   *
   * -OR-
   *
   * * `this.form.get(['items', 0, 'price']);`
   */
  get(path) {
    let currPath = path;
    if (currPath == null) return null;
    if (!Array.isArray(currPath)) currPath = currPath.split(".");
    if (currPath.length === 0) return null;
    return currPath.reduce((control, name) => control && control._find(name), this);
  }
  /**
   * @description
   * Reports error data for the control with the given path.
   *
   * @param errorCode The code of the error to check
   * @param path A list of control names that designates how to move from the current control
   * to the control that should be queried for errors.
   *
   * @usageNotes
   * For example, for the following `FormGroup`:
   *
   * ```
   * form = new FormGroup({
   *   address: new FormGroup({ street: new FormControl() })
   * });
   * ```
   *
   * The path to the 'street' control from the root form would be 'address' -> 'street'.
   *
   * It can be provided to this method in one of two formats:
   *
   * 1. An array of string control names, e.g. `['address', 'street']`
   * 1. A period-delimited list of control names in one string, e.g. `'address.street'`
   *
   * @returns error data for that particular error. If the control or error is not present,
   * null is returned.
   */
  getError(errorCode, path) {
    const control = path ? this.get(path) : this;
    return control && control.errors ? control.errors[errorCode] : null;
  }
  /**
   * @description
   * Reports whether the control with the given path has the error specified.
   *
   * @param errorCode The code of the error to check
   * @param path A list of control names that designates how to move from the current control
   * to the control that should be queried for errors.
   *
   * @usageNotes
   * For example, for the following `FormGroup`:
   *
   * ```
   * form = new FormGroup({
   *   address: new FormGroup({ street: new FormControl() })
   * });
   * ```
   *
   * The path to the 'street' control from the root form would be 'address' -> 'street'.
   *
   * It can be provided to this method in one of two formats:
   *
   * 1. An array of string control names, e.g. `['address', 'street']`
   * 1. A period-delimited list of control names in one string, e.g. `'address.street'`
   *
   * If no path is given, this method checks for the error on the current control.
   *
   * @returns whether the given error is present in the control at the given path.
   *
   * If the control is not present, false is returned.
   */
  hasError(errorCode, path) {
    return !!this.getError(errorCode, path);
  }
  /**
   * Retrieves the top-level ancestor of this control.
   */
  get root() {
    let x = this;
    while (x._parent) {
      x = x._parent;
    }
    return x;
  }
  /** @internal */
  _updateControlsErrors(emitEvent, changedControl) {
    this.status = this._calculateStatus();
    if (emitEvent) {
      this.statusChanges.emit(this.status);
      this._events.next(new StatusChangeEvent(this.status, changedControl));
    }
    if (this._parent) {
      this._parent._updateControlsErrors(emitEvent, changedControl);
    }
  }
  /** @internal */
  _initObservables() {
    this.valueChanges = new EventEmitter();
    this.statusChanges = new EventEmitter();
  }
  _calculateStatus() {
    if (this._allControlsDisabled()) return DISABLED;
    if (this.errors) return INVALID;
    if (this._hasOwnPendingAsyncValidator || this._anyControlsHaveStatus(PENDING)) return PENDING;
    if (this._anyControlsHaveStatus(INVALID)) return INVALID;
    return VALID;
  }
  /** @internal */
  _anyControlsHaveStatus(status) {
    return this._anyControls((control) => control.status === status);
  }
  /** @internal */
  _anyControlsDirty() {
    return this._anyControls((control) => control.dirty);
  }
  /** @internal */
  _anyControlsTouched() {
    return this._anyControls((control) => control.touched);
  }
  /** @internal */
  _updatePristine(opts, changedControl) {
    const newPristine = !this._anyControlsDirty();
    const changed = this.pristine !== newPristine;
    this.pristine = newPristine;
    if (this._parent && !opts.onlySelf) {
      this._parent._updatePristine(opts, changedControl);
    }
    if (changed) {
      this._events.next(new PristineChangeEvent(this.pristine, changedControl));
    }
  }
  /** @internal */
  _updateTouched(opts = {}, changedControl) {
    this.touched = this._anyControlsTouched();
    this._events.next(new TouchedChangeEvent(this.touched, changedControl));
    if (this._parent && !opts.onlySelf) {
      this._parent._updateTouched(opts, changedControl);
    }
  }
  /** @internal */
  _registerOnCollectionChange(fn) {
    this._onCollectionChange = fn;
  }
  /** @internal */
  _setUpdateStrategy(opts) {
    if (isOptionsObj(opts) && opts.updateOn != null) {
      this._updateOn = opts.updateOn;
    }
  }
  /**
   * Check to see if parent has been marked artificially dirty.
   *
   * @internal
   */
  _parentMarkedDirty(onlySelf) {
    const parentDirty = this._parent && this._parent.dirty;
    return !onlySelf && !!parentDirty && !this._parent._anyControlsDirty();
  }
  /** @internal */
  _find(name) {
    return null;
  }
  /**
   * Internal implementation of the `setValidators` method. Needs to be separated out into a
   * different method, because it is called in the constructor and it can break cases where
   * a control is extended.
   */
  _assignValidators(validators) {
    this._rawValidators = Array.isArray(validators) ? validators.slice() : validators;
    this._composedValidatorFn = coerceToValidator(this._rawValidators);
  }
  /**
   * Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a
   * different method, because it is called in the constructor and it can break cases where
   * a control is extended.
   */
  _assignAsyncValidators(validators) {
    this._rawAsyncValidators = Array.isArray(validators) ? validators.slice() : validators;
    this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators);
  }
};
var FormGroup = class extends AbstractControl {
  /**
   * Creates a new `FormGroup` instance.
   *
   * @param controls A collection of child controls. The key for each child is the name
   * under which it is registered.
   *
   * @param validatorOrOpts A synchronous validator function, or an array of
   * such functions, or an `AbstractControlOptions` object that contains validation functions
   * and a validation trigger.
   *
   * @param asyncValidator A single async validator or array of async validator functions
   *
   */
  constructor(controls, validatorOrOpts, asyncValidator) {
    super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
    (typeof ngDevMode === "undefined" || ngDevMode) && validateFormGroupControls(controls);
    this.controls = controls;
    this._initObservables();
    this._setUpdateStrategy(validatorOrOpts);
    this._setUpControls();
    this.updateValueAndValidity({
      onlySelf: true,
      // If `asyncValidator` is present, it will trigger control status change from `PENDING` to
      // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable,
      // so we set `emitEvent` to `true` to allow that during the control creation process.
      emitEvent: !!this.asyncValidator
    });
  }
  registerControl(name, control) {
    if (this.controls[name]) return this.controls[name];
    this.controls[name] = control;
    control.setParent(this);
    control._registerOnCollectionChange(this._onCollectionChange);
    return control;
  }
  addControl(name, control, options = {}) {
    this.registerControl(name, control);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
    this._onCollectionChange();
  }
  /**
   * Remove a control from this group. In a strongly-typed group, required controls cannot be
   * removed.
   *
   * This method also updates the value and validity of the control.
   *
   * @param name The control name to remove from the collection
   * @param options Specifies whether this FormGroup instance should emit events after a
   *     control is removed.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control is
   * removed. When false, no events are emitted.
   */
  removeControl(name, options = {}) {
    if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {
    });
    delete this.controls[name];
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
    this._onCollectionChange();
  }
  setControl(name, control, options = {}) {
    if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {
    });
    delete this.controls[name];
    if (control) this.registerControl(name, control);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
    this._onCollectionChange();
  }
  contains(controlName) {
    return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled;
  }
  /**
   * Sets the value of the `FormGroup`. It accepts an object that matches
   * the structure of the group, with control names as keys.
   *
   * @usageNotes
   * ### Set the complete value for the form group
   *
   * ```
   * const form = new FormGroup({
   *   first: new FormControl(),
   *   last: new FormControl()
   * });
   *
   * console.log(form.value);   // {first: null, last: null}
   *
   * form.setValue({first: 'Nancy', last: 'Drew'});
   * console.log(form.value);   // {first: 'Nancy', last: 'Drew'}
   * ```
   *
   * @throws When strict checks fail, such as setting the value of a control
   * that doesn't exist or if you exclude a value of a control that does exist.
   *
   * @param value The new value for the control that matches the structure of the group.
   * @param options Configuration options that determine how the control propagates changes
   * and emits events after the value changes.
   * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
   * updateValueAndValidity} method.
   *
   * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
   * false.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges`
   * observables emit events with the latest status and value when the control value is updated.
   * When false, no events are emitted.
   */
  setValue(value, options = {}) {
    assertAllValuesPresent(this, true, value);
    Object.keys(value).forEach((name) => {
      assertControlPresent(this, true, name);
      this.controls[name].setValue(value[name], {
        onlySelf: true,
        emitEvent: options.emitEvent
      });
    });
    this.updateValueAndValidity(options);
  }
  /**
   * Patches the value of the `FormGroup`. It accepts an object with control
   * names as keys, and does its best to match the values to the correct controls
   * in the group.
   *
   * It accepts both super-sets and sub-sets of the group without throwing an error.
   *
   * @usageNotes
   * ### Patch the value for a form group
   *
   * ```
   * const form = new FormGroup({
   *    first: new FormControl(),
   *    last: new FormControl()
   * });
   * console.log(form.value);   // {first: null, last: null}
   *
   * form.patchValue({first: 'Nancy'});
   * console.log(form.value);   // {first: 'Nancy', last: null}
   * ```
   *
   * @param value The object that matches the structure of the group.
   * @param options Configuration options that determine how the control propagates changes and
   * emits events after the value is patched.
   * * `onlySelf`: When true, each change only affects this control and not its parent. Default is
   * true.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control value
   * is updated. When false, no events are emitted. The configuration options are passed to
   * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
   */
  patchValue(value, options = {}) {
    if (value == null) return;
    Object.keys(value).forEach((name) => {
      const control = this.controls[name];
      if (control) {
        control.patchValue(
          /* Guaranteed to be present, due to the outer forEach. */
          value[name],
          {
            onlySelf: true,
            emitEvent: options.emitEvent
          }
        );
      }
    });
    this.updateValueAndValidity(options);
  }
  /**
   * Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets
   * the value of all descendants to their default values, or null if no defaults were provided.
   *
   * You reset to a specific form state by passing in a map of states
   * that matches the structure of your form, with control names as keys. The state
   * is a standalone value or a form state object with both a value and a disabled
   * status.
   *
   * @param value Resets the control with an initial value,
   * or an object that defines the initial value and disabled state.
   *
   * @param options Configuration options that determine how the control propagates changes
   * and emits events when the group is reset.
   * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
   * false.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges`
   * observables emit events with the latest status and value when the control is reset.
   * When false, no events are emitted.
   * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
   * updateValueAndValidity} method.
   *
   * @usageNotes
   *
   * ### Reset the form group values
   *
   * ```ts
   * const form = new FormGroup({
   *   first: new FormControl('first name'),
   *   last: new FormControl('last name')
   * });
   *
   * console.log(form.value);  // {first: 'first name', last: 'last name'}
   *
   * form.reset({ first: 'name', last: 'last name' });
   *
   * console.log(form.value);  // {first: 'name', last: 'last name'}
   * ```
   *
   * ### Reset the form group values and disabled status
   *
   * ```
   * const form = new FormGroup({
   *   first: new FormControl('first name'),
   *   last: new FormControl('last name')
   * });
   *
   * form.reset({
   *   first: {value: 'name', disabled: true},
   *   last: 'last'
   * });
   *
   * console.log(form.value);  // {last: 'last'}
   * console.log(form.get('first').status);  // 'DISABLED'
   * ```
   */
  reset(value = {}, options = {}) {
    this._forEachChild((control, name) => {
      control.reset(value ? value[name] : null, {
        onlySelf: true,
        emitEvent: options.emitEvent
      });
    });
    this._updatePristine(options, this);
    this._updateTouched(options, this);
    this.updateValueAndValidity(options);
  }
  /**
   * The aggregate value of the `FormGroup`, including any disabled controls.
   *
   * Retrieves all values regardless of disabled status.
   */
  getRawValue() {
    return this._reduceChildren({}, (acc, control, name) => {
      acc[name] = control.getRawValue();
      return acc;
    });
  }
  /** @internal */
  _syncPendingControls() {
    let subtreeUpdated = this._reduceChildren(false, (updated, child) => {
      return child._syncPendingControls() ? true : updated;
    });
    if (subtreeUpdated) this.updateValueAndValidity({
      onlySelf: true
    });
    return subtreeUpdated;
  }
  /** @internal */
  _forEachChild(cb) {
    Object.keys(this.controls).forEach((key) => {
      const control = this.controls[key];
      control && cb(control, key);
    });
  }
  /** @internal */
  _setUpControls() {
    this._forEachChild((control) => {
      control.setParent(this);
      control._registerOnCollectionChange(this._onCollectionChange);
    });
  }
  /** @internal */
  _updateValue() {
    this.value = this._reduceValue();
  }
  /** @internal */
  _anyControls(condition) {
    for (const [controlName, control] of Object.entries(this.controls)) {
      if (this.contains(controlName) && condition(control)) {
        return true;
      }
    }
    return false;
  }
  /** @internal */
  _reduceValue() {
    let acc = {};
    return this._reduceChildren(acc, (acc2, control, name) => {
      if (control.enabled || this.disabled) {
        acc2[name] = control.value;
      }
      return acc2;
    });
  }
  /** @internal */
  _reduceChildren(initValue, fn) {
    let res = initValue;
    this._forEachChild((control, name) => {
      res = fn(res, control, name);
    });
    return res;
  }
  /** @internal */
  _allControlsDisabled() {
    for (const controlName of Object.keys(this.controls)) {
      if (this.controls[controlName].enabled) {
        return false;
      }
    }
    return Object.keys(this.controls).length > 0 || this.disabled;
  }
  /** @internal */
  _find(name) {
    return this.controls.hasOwnProperty(name) ? this.controls[name] : null;
  }
};
function validateFormGroupControls(controls) {
  const invalidKeys = Object.keys(controls).filter((key) => key.includes("."));
  if (invalidKeys.length > 0) {
    console.warn(`FormGroup keys cannot include \`.\`, please replace the keys for: ${invalidKeys.join(",")}.`);
  }
}
var UntypedFormGroup = FormGroup;
var FormRecord = class extends FormGroup {
};
var CALL_SET_DISABLED_STATE = new InjectionToken("CallSetDisabledState", {
  providedIn: "root",
  factory: () => setDisabledStateDefault
});
var setDisabledStateDefault = "always";
function controlPath(name, parent) {
  return [...parent.path, name];
}
function setUpControl(control, dir, callSetDisabledState = setDisabledStateDefault) {
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    if (!control) _throwError(dir, "Cannot find control with");
    if (!dir.valueAccessor) _throwMissingValueAccessorError(dir);
  }
  setUpValidators(control, dir);
  dir.valueAccessor.writeValue(control.value);
  if (control.disabled || callSetDisabledState === "always") {
    dir.valueAccessor.setDisabledState?.(control.disabled);
  }
  setUpViewChangePipeline(control, dir);
  setUpModelChangePipeline(control, dir);
  setUpBlurPipeline(control, dir);
  setUpDisabledChangeHandler(control, dir);
}
function cleanUpControl(control, dir, validateControlPresenceOnChange = true) {
  const noop5 = () => {
    if (validateControlPresenceOnChange && (typeof ngDevMode === "undefined" || ngDevMode)) {
      _noControlError(dir);
    }
  };
  if (dir.valueAccessor) {
    dir.valueAccessor.registerOnChange(noop5);
    dir.valueAccessor.registerOnTouched(noop5);
  }
  cleanUpValidators(control, dir);
  if (control) {
    dir._invokeOnDestroyCallbacks();
    control._registerOnCollectionChange(() => {
    });
  }
}
function registerOnValidatorChange(validators, onChange) {
  validators.forEach((validator) => {
    if (validator.registerOnValidatorChange) validator.registerOnValidatorChange(onChange);
  });
}
function setUpDisabledChangeHandler(control, dir) {
  if (dir.valueAccessor.setDisabledState) {
    const onDisabledChange = (isDisabled) => {
      dir.valueAccessor.setDisabledState(isDisabled);
    };
    control.registerOnDisabledChange(onDisabledChange);
    dir._registerOnDestroy(() => {
      control._unregisterOnDisabledChange(onDisabledChange);
    });
  }
}
function setUpValidators(control, dir) {
  const validators = getControlValidators(control);
  if (dir.validator !== null) {
    control.setValidators(mergeValidators(validators, dir.validator));
  } else if (typeof validators === "function") {
    control.setValidators([validators]);
  }
  const asyncValidators = getControlAsyncValidators(control);
  if (dir.asyncValidator !== null) {
    control.setAsyncValidators(mergeValidators(asyncValidators, dir.asyncValidator));
  } else if (typeof asyncValidators === "function") {
    control.setAsyncValidators([asyncValidators]);
  }
  const onValidatorChange = () => control.updateValueAndValidity();
  registerOnValidatorChange(dir._rawValidators, onValidatorChange);
  registerOnValidatorChange(dir._rawAsyncValidators, onValidatorChange);
}
function cleanUpValidators(control, dir) {
  let isControlUpdated = false;
  if (control !== null) {
    if (dir.validator !== null) {
      const validators = getControlValidators(control);
      if (Array.isArray(validators) && validators.length > 0) {
        const updatedValidators = validators.filter((validator) => validator !== dir.validator);
        if (updatedValidators.length !== validators.length) {
          isControlUpdated = true;
          control.setValidators(updatedValidators);
        }
      }
    }
    if (dir.asyncValidator !== null) {
      const asyncValidators = getControlAsyncValidators(control);
      if (Array.isArray(asyncValidators) && asyncValidators.length > 0) {
        const updatedAsyncValidators = asyncValidators.filter((asyncValidator) => asyncValidator !== dir.asyncValidator);
        if (updatedAsyncValidators.length !== asyncValidators.length) {
          isControlUpdated = true;
          control.setAsyncValidators(updatedAsyncValidators);
        }
      }
    }
  }
  const noop5 = () => {
  };
  registerOnValidatorChange(dir._rawValidators, noop5);
  registerOnValidatorChange(dir._rawAsyncValidators, noop5);
  return isControlUpdated;
}
function setUpViewChangePipeline(control, dir) {
  dir.valueAccessor.registerOnChange((newValue) => {
    control._pendingValue = newValue;
    control._pendingChange = true;
    control._pendingDirty = true;
    if (control.updateOn === "change") updateControl(control, dir);
  });
}
function setUpBlurPipeline(control, dir) {
  dir.valueAccessor.registerOnTouched(() => {
    control._pendingTouched = true;
    if (control.updateOn === "blur" && control._pendingChange) updateControl(control, dir);
    if (control.updateOn !== "submit") control.markAsTouched();
  });
}
function updateControl(control, dir) {
  if (control._pendingDirty) control.markAsDirty();
  control.setValue(control._pendingValue, {
    emitModelToViewChange: false
  });
  dir.viewToModelUpdate(control._pendingValue);
  control._pendingChange = false;
}
function setUpModelChangePipeline(control, dir) {
  const onChange = (newValue, emitModelEvent) => {
    dir.valueAccessor.writeValue(newValue);
    if (emitModelEvent) dir.viewToModelUpdate(newValue);
  };
  control.registerOnChange(onChange);
  dir._registerOnDestroy(() => {
    control._unregisterOnChange(onChange);
  });
}
function setUpFormContainer(control, dir) {
  if (control == null && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "Cannot find control with");
  setUpValidators(control, dir);
}
function cleanUpFormContainer(control, dir) {
  return cleanUpValidators(control, dir);
}
function _noControlError(dir) {
  return _throwError(dir, "There is no FormControl instance attached to form control element with");
}
function _throwError(dir, message) {
  const messageEnd = _describeControlLocation(dir);
  throw new Error(`${message} ${messageEnd}`);
}
function _describeControlLocation(dir) {
  const path = dir.path;
  if (path && path.length > 1) return `path: '${path.join(" -> ")}'`;
  if (path?.[0]) return `name: '${path}'`;
  return "unspecified name attribute";
}
function _throwMissingValueAccessorError(dir) {
  const loc = _describeControlLocation(dir);
  throw new RuntimeError(-1203, `No value accessor for form control ${loc}.`);
}
function _throwInvalidValueAccessorError(dir) {
  const loc = _describeControlLocation(dir);
  throw new RuntimeError(1200, `Value accessor was not provided as an array for form control with ${loc}. Check that the \`NG_VALUE_ACCESSOR\` token is configured as a \`multi: true\` provider.`);
}
function isPropertyUpdated(changes, viewModel) {
  if (!changes.hasOwnProperty("model")) return false;
  const change = changes["model"];
  if (change.isFirstChange()) return true;
  return !Object.is(viewModel, change.currentValue);
}
function isBuiltInAccessor(valueAccessor) {
  return Object.getPrototypeOf(valueAccessor.constructor) === BuiltInControlValueAccessor;
}
function syncPendingControls(form, directives) {
  form._syncPendingControls();
  directives.forEach((dir) => {
    const control = dir.control;
    if (control.updateOn === "submit" && control._pendingChange) {
      dir.viewToModelUpdate(control._pendingValue);
      control._pendingChange = false;
    }
  });
}
function selectValueAccessor(dir, valueAccessors) {
  if (!valueAccessors) return null;
  if (!Array.isArray(valueAccessors) && (typeof ngDevMode === "undefined" || ngDevMode)) _throwInvalidValueAccessorError(dir);
  let defaultAccessor = void 0;
  let builtinAccessor = void 0;
  let customAccessor = void 0;
  valueAccessors.forEach((v) => {
    if (v.constructor === DefaultValueAccessor) {
      defaultAccessor = v;
    } else if (isBuiltInAccessor(v)) {
      if (builtinAccessor && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "More than one built-in value accessor matches form control with");
      builtinAccessor = v;
    } else {
      if (customAccessor && (typeof ngDevMode === "undefined" || ngDevMode)) _throwError(dir, "More than one custom value accessor matches form control with");
      customAccessor = v;
    }
  });
  if (customAccessor) return customAccessor;
  if (builtinAccessor) return builtinAccessor;
  if (defaultAccessor) return defaultAccessor;
  if (typeof ngDevMode === "undefined" || ngDevMode) {
    _throwError(dir, "No valid value accessor for form control with");
  }
  return null;
}
function removeListItem$1(list, el) {
  const index = list.indexOf(el);
  if (index > -1) list.splice(index, 1);
}
function _ngModelWarning(name, type, instance, warningConfig) {
  if (warningConfig === "never") return;
  if ((warningConfig === null || warningConfig === "once") && !type._ngModelWarningSentOnce || warningConfig === "always" && !instance._ngModelWarningSent) {
    console.warn(ngModelWarning(name));
    type._ngModelWarningSentOnce = true;
    instance._ngModelWarningSent = true;
  }
}
var formDirectiveProvider$1 = {
  provide: ControlContainer,
  useExisting: forwardRef(() => NgForm)
};
var resolvedPromise$1 = (() => Promise.resolve())();
var _NgForm = class _NgForm extends ControlContainer {
  constructor(validators, asyncValidators, callSetDisabledState) {
    super();
    this.callSetDisabledState = callSetDisabledState;
    this.submitted = false;
    this._directives = /* @__PURE__ */ new Set();
    this.ngSubmit = new EventEmitter();
    this.form = new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators));
  }
  /** @nodoc */
  ngAfterViewInit() {
    this._setUpdateStrategy();
  }
  /**
   * @description
   * The directive instance.
   */
  get formDirective() {
    return this;
  }
  /**
   * @description
   * The internal `FormGroup` instance.
   */
  get control() {
    return this.form;
  }
  /**
   * @description
   * Returns an array representing the path to this group. Because this directive
   * always lives at the top level of a form, it is always an empty array.
   */
  get path() {
    return [];
  }
  /**
   * @description
   * Returns a map of the controls in this group.
   */
  get controls() {
    return this.form.controls;
  }
  /**
   * @description
   * Method that sets up the control directive in this group, re-calculates its value
   * and validity, and adds the instance to the internal list of directives.
   *
   * @param dir The `NgModel` directive instance.
   */
  addControl(dir) {
    resolvedPromise$1.then(() => {
      const container = this._findContainer(dir.path);
      dir.control = container.registerControl(dir.name, dir.control);
      setUpControl(dir.control, dir, this.callSetDisabledState);
      dir.control.updateValueAndValidity({
        emitEvent: false
      });
      this._directives.add(dir);
    });
  }
  /**
   * @description
   * Retrieves the `FormControl` instance from the provided `NgModel` directive.
   *
   * @param dir The `NgModel` directive instance.
   */
  getControl(dir) {
    return this.form.get(dir.path);
  }
  /**
   * @description
   * Removes the `NgModel` instance from the internal list of directives
   *
   * @param dir The `NgModel` directive instance.
   */
  removeControl(dir) {
    resolvedPromise$1.then(() => {
      const container = this._findContainer(dir.path);
      if (container) {
        container.removeControl(dir.name);
      }
      this._directives.delete(dir);
    });
  }
  /**
   * @description
   * Adds a new `NgModelGroup` directive instance to the form.
   *
   * @param dir The `NgModelGroup` directive instance.
   */
  addFormGroup(dir) {
    resolvedPromise$1.then(() => {
      const container = this._findContainer(dir.path);
      const group2 = new FormGroup({});
      setUpFormContainer(group2, dir);
      container.registerControl(dir.name, group2);
      group2.updateValueAndValidity({
        emitEvent: false
      });
    });
  }
  /**
   * @description
   * Removes the `NgModelGroup` directive instance from the form.
   *
   * @param dir The `NgModelGroup` directive instance.
   */
  removeFormGroup(dir) {
    resolvedPromise$1.then(() => {
      const container = this._findContainer(dir.path);
      if (container) {
        container.removeControl(dir.name);
      }
    });
  }
  /**
   * @description
   * Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance
   *
   * @param dir The `NgModelGroup` directive instance.
   */
  getFormGroup(dir) {
    return this.form.get(dir.path);
  }
  /**
   * Sets the new value for the provided `NgControl` directive.
   *
   * @param dir The `NgControl` directive instance.
   * @param value The new value for the directive's control.
   */
  updateModel(dir, value) {
    resolvedPromise$1.then(() => {
      const ctrl = this.form.get(dir.path);
      ctrl.setValue(value);
    });
  }
  /**
   * @description
   * Sets the value for this `FormGroup`.
   *
   * @param value The new value
   */
  setValue(value) {
    this.control.setValue(value);
  }
  /**
   * @description
   * Method called when the "submit" event is triggered on the form.
   * Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
   *
   * @param $event The "submit" event object
   */
  onSubmit($event) {
    this.submitted = true;
    syncPendingControls(this.form, this._directives);
    this.ngSubmit.emit($event);
    return $event?.target?.method === "dialog";
  }
  /**
   * @description
   * Method called when the "reset" event is triggered on the form.
   */
  onReset() {
    this.resetForm();
  }
  /**
   * @description
   * Resets the form to an initial value and resets its submitted status.
   *
   * @param value The new value for the form.
   */
  resetForm(value = void 0) {
    this.form.reset(value);
    this.submitted = false;
  }
  _setUpdateStrategy() {
    if (this.options && this.options.updateOn != null) {
      this.form._updateOn = this.options.updateOn;
    }
  }
  _findContainer(path) {
    path.pop();
    return path.length ? this.form.get(path) : this.form;
  }
};
_NgForm.\u0275fac = function NgForm_Factory(t) {
  return new (t || _NgForm)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
_NgForm.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgForm,
  selectors: [["form", 3, "ngNoForm", "", 3, "formGroup", ""], ["ng-form"], ["", "ngForm", ""]],
  hostBindings: function NgForm_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("submit", function NgForm_submit_HostBindingHandler($event) {
        return ctx.onSubmit($event);
      })("reset", function NgForm_reset_HostBindingHandler() {
        return ctx.onReset();
      });
    }
  },
  inputs: {
    options: [0, "ngFormOptions", "options"]
  },
  outputs: {
    ngSubmit: "ngSubmit"
  },
  exportAs: ["ngForm"],
  features: [\u0275\u0275ProvidersFeature([formDirectiveProvider$1]), \u0275\u0275InheritDefinitionFeature]
});
var NgForm = _NgForm;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForm, [{
    type: Directive,
    args: [{
      selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",
      providers: [formDirectiveProvider$1],
      host: {
        "(submit)": "onSubmit($event)",
        "(reset)": "onReset()"
      },
      outputs: ["ngSubmit"],
      exportAs: "ngForm"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [CALL_SET_DISABLED_STATE]
    }]
  }], {
    options: [{
      type: Input,
      args: ["ngFormOptions"]
    }]
  });
})();
function removeListItem(list, el) {
  const index = list.indexOf(el);
  if (index > -1) list.splice(index, 1);
}
function isFormControlState(formState) {
  return typeof formState === "object" && formState !== null && Object.keys(formState).length === 2 && "value" in formState && "disabled" in formState;
}
var FormControl = class FormControl2 extends AbstractControl {
  constructor(formState = null, validatorOrOpts, asyncValidator) {
    super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
    this.defaultValue = null;
    this._onChange = [];
    this._pendingChange = false;
    this._applyFormState(formState);
    this._setUpdateStrategy(validatorOrOpts);
    this._initObservables();
    this.updateValueAndValidity({
      onlySelf: true,
      // If `asyncValidator` is present, it will trigger control status change from `PENDING` to
      // `VALID` or `INVALID`.
      // The status should be broadcasted via the `statusChanges` observable, so we set
      // `emitEvent` to `true` to allow that during the control creation process.
      emitEvent: !!this.asyncValidator
    });
    if (isOptionsObj(validatorOrOpts) && (validatorOrOpts.nonNullable || validatorOrOpts.initialValueIsDefault)) {
      if (isFormControlState(formState)) {
        this.defaultValue = formState.value;
      } else {
        this.defaultValue = formState;
      }
    }
  }
  setValue(value, options = {}) {
    this.value = this._pendingValue = value;
    if (this._onChange.length && options.emitModelToViewChange !== false) {
      this._onChange.forEach((changeFn) => changeFn(this.value, options.emitViewToModelChange !== false));
    }
    this.updateValueAndValidity(options);
  }
  patchValue(value, options = {}) {
    this.setValue(value, options);
  }
  reset(formState = this.defaultValue, options = {}) {
    this._applyFormState(formState);
    this.markAsPristine(options);
    this.markAsUntouched(options);
    this.setValue(this.value, options);
    this._pendingChange = false;
  }
  /**  @internal */
  _updateValue() {
  }
  /**  @internal */
  _anyControls(condition) {
    return false;
  }
  /**  @internal */
  _allControlsDisabled() {
    return this.disabled;
  }
  registerOnChange(fn) {
    this._onChange.push(fn);
  }
  /** @internal */
  _unregisterOnChange(fn) {
    removeListItem(this._onChange, fn);
  }
  registerOnDisabledChange(fn) {
    this._onDisabledChange.push(fn);
  }
  /** @internal */
  _unregisterOnDisabledChange(fn) {
    removeListItem(this._onDisabledChange, fn);
  }
  /** @internal */
  _forEachChild(cb) {
  }
  /** @internal */
  _syncPendingControls() {
    if (this.updateOn === "submit") {
      if (this._pendingDirty) this.markAsDirty();
      if (this._pendingTouched) this.markAsTouched();
      if (this._pendingChange) {
        this.setValue(this._pendingValue, {
          onlySelf: true,
          emitModelToViewChange: false
        });
        return true;
      }
    }
    return false;
  }
  _applyFormState(formState) {
    if (isFormControlState(formState)) {
      this.value = this._pendingValue = formState.value;
      formState.disabled ? this.disable({
        onlySelf: true,
        emitEvent: false
      }) : this.enable({
        onlySelf: true,
        emitEvent: false
      });
    } else {
      this.value = this._pendingValue = formState;
    }
  }
};
var UntypedFormControl = FormControl;
var isFormControl = (control) => control instanceof FormControl;
var _AbstractFormGroupDirective = class _AbstractFormGroupDirective extends ControlContainer {
  /** @nodoc */
  ngOnInit() {
    this._checkParentType();
    this.formDirective.addFormGroup(this);
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this.formDirective) {
      this.formDirective.removeFormGroup(this);
    }
  }
  /**
   * @description
   * The `FormGroup` bound to this directive.
   */
  get control() {
    return this.formDirective.getFormGroup(this);
  }
  /**
   * @description
   * The path to this group from the top-level directive.
   */
  get path() {
    return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
  }
  /**
   * @description
   * The top-level directive for this group if present, otherwise null.
   */
  get formDirective() {
    return this._parent ? this._parent.formDirective : null;
  }
  /** @internal */
  _checkParentType() {
  }
};
_AbstractFormGroupDirective.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275AbstractFormGroupDirective_BaseFactory;
  return function AbstractFormGroupDirective_Factory(t) {
    return (\u0275AbstractFormGroupDirective_BaseFactory || (\u0275AbstractFormGroupDirective_BaseFactory = \u0275\u0275getInheritedFactory(_AbstractFormGroupDirective)))(t || _AbstractFormGroupDirective);
  };
})();
_AbstractFormGroupDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _AbstractFormGroupDirective,
  features: [\u0275\u0275InheritDefinitionFeature]
});
var AbstractFormGroupDirective = _AbstractFormGroupDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractFormGroupDirective, [{
    type: Directive
  }], null, null);
})();
function modelParentException() {
  return new RuntimeError(1350, `
    ngModel cannot be used to register form controls with a parent formGroup directive.  Try using
    formGroup's partner directive "formControlName" instead.  Example:

    ${formControlNameExample}

    Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:

    Example:

    ${ngModelWithFormGroupExample}`);
}
function formGroupNameException() {
  return new RuntimeError(1351, `
    ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.

    Option 1: Use formControlName instead of ngModel (reactive strategy):

    ${formGroupNameExample}

    Option 2:  Update ngModel's parent be ngModelGroup (template-driven strategy):

    ${ngModelGroupExample}`);
}
function missingNameException() {
  return new RuntimeError(1352, `If ngModel is used within a form tag, either the name attribute must be set or the form
    control must be defined as 'standalone' in ngModelOptions.

    Example 1: <input [(ngModel)]="person.firstName" name="first">
    Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">`);
}
function modelGroupParentException() {
  return new RuntimeError(1353, `
    ngModelGroup cannot be used with a parent formGroup directive.

    Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):

    ${formGroupNameExample}

    Option 2:  Use a regular form tag instead of the formGroup directive (template-driven strategy):

    ${ngModelGroupExample}`);
}
var modelGroupProvider = {
  provide: ControlContainer,
  useExisting: forwardRef(() => NgModelGroup)
};
var _NgModelGroup = class _NgModelGroup extends AbstractFormGroupDirective {
  constructor(parent, validators, asyncValidators) {
    super();
    this.name = "";
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
  }
  /** @internal */
  _checkParentType() {
    if (!(this._parent instanceof _NgModelGroup) && !(this._parent instanceof NgForm) && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw modelGroupParentException();
    }
  }
};
_NgModelGroup.\u0275fac = function NgModelGroup_Factory(t) {
  return new (t || _NgModelGroup)(\u0275\u0275directiveInject(ControlContainer, 5), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
_NgModelGroup.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgModelGroup,
  selectors: [["", "ngModelGroup", ""]],
  inputs: {
    name: [0, "ngModelGroup", "name"]
  },
  exportAs: ["ngModelGroup"],
  features: [\u0275\u0275ProvidersFeature([modelGroupProvider]), \u0275\u0275InheritDefinitionFeature]
});
var NgModelGroup = _NgModelGroup;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgModelGroup, [{
    type: Directive,
    args: [{
      selector: "[ngModelGroup]",
      providers: [modelGroupProvider],
      exportAs: "ngModelGroup"
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Host
    }, {
      type: SkipSelf
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }], {
    name: [{
      type: Input,
      args: ["ngModelGroup"]
    }]
  });
})();
var formControlBinding$1 = {
  provide: NgControl,
  useExisting: forwardRef(() => NgModel)
};
var resolvedPromise = (() => Promise.resolve())();
var _NgModel = class _NgModel extends NgControl {
  constructor(parent, validators, asyncValidators, valueAccessors, _changeDetectorRef, callSetDisabledState) {
    super();
    this._changeDetectorRef = _changeDetectorRef;
    this.callSetDisabledState = callSetDisabledState;
    this.control = new FormControl();
    this._registered = false;
    this.name = "";
    this.update = new EventEmitter();
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
    this.valueAccessor = selectValueAccessor(this, valueAccessors);
  }
  /** @nodoc */
  ngOnChanges(changes) {
    this._checkForErrors();
    if (!this._registered || "name" in changes) {
      if (this._registered) {
        this._checkName();
        if (this.formDirective) {
          const oldName = changes["name"].previousValue;
          this.formDirective.removeControl({
            name: oldName,
            path: this._getPath(oldName)
          });
        }
      }
      this._setUpControl();
    }
    if ("isDisabled" in changes) {
      this._updateDisabled(changes);
    }
    if (isPropertyUpdated(changes, this.viewModel)) {
      this._updateValue(this.model);
      this.viewModel = this.model;
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    this.formDirective && this.formDirective.removeControl(this);
  }
  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  get path() {
    return this._getPath(this.name);
  }
  /**
   * @description
   * The top-level directive for this control if present, otherwise null.
   */
  get formDirective() {
    return this._parent ? this._parent.formDirective : null;
  }
  /**
   * @description
   * Sets the new value for the view model and emits an `ngModelChange` event.
   *
   * @param newValue The new value emitted by `ngModelChange`.
   */
  viewToModelUpdate(newValue) {
    this.viewModel = newValue;
    this.update.emit(newValue);
  }
  _setUpControl() {
    this._setUpdateStrategy();
    this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this);
    this._registered = true;
  }
  _setUpdateStrategy() {
    if (this.options && this.options.updateOn != null) {
      this.control._updateOn = this.options.updateOn;
    }
  }
  _isStandalone() {
    return !this._parent || !!(this.options && this.options.standalone);
  }
  _setUpStandalone() {
    setUpControl(this.control, this, this.callSetDisabledState);
    this.control.updateValueAndValidity({
      emitEvent: false
    });
  }
  _checkForErrors() {
    if (!this._isStandalone()) {
      this._checkParentType();
    }
    this._checkName();
  }
  _checkParentType() {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (!(this._parent instanceof NgModelGroup) && this._parent instanceof AbstractFormGroupDirective) {
        throw formGroupNameException();
      } else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
        throw modelParentException();
      }
    }
  }
  _checkName() {
    if (this.options && this.options.name) this.name = this.options.name;
    if (!this._isStandalone() && !this.name && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw missingNameException();
    }
  }
  _updateValue(value) {
    resolvedPromise.then(() => {
      this.control.setValue(value, {
        emitViewToModelChange: false
      });
      this._changeDetectorRef?.markForCheck();
    });
  }
  _updateDisabled(changes) {
    const disabledValue = changes["isDisabled"].currentValue;
    const isDisabled = disabledValue !== 0 && booleanAttribute(disabledValue);
    resolvedPromise.then(() => {
      if (isDisabled && !this.control.disabled) {
        this.control.disable();
      } else if (!isDisabled && this.control.disabled) {
        this.control.enable();
      }
      this._changeDetectorRef?.markForCheck();
    });
  }
  _getPath(controlName) {
    return this._parent ? controlPath(controlName, this._parent) : [controlName];
  }
};
_NgModel.\u0275fac = function NgModel_Factory(t) {
  return new (t || _NgModel)(\u0275\u0275directiveInject(ControlContainer, 9), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(ChangeDetectorRef, 8), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
_NgModel.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgModel,
  selectors: [["", "ngModel", "", 3, "formControlName", "", 3, "formControl", ""]],
  inputs: {
    name: "name",
    isDisabled: [0, "disabled", "isDisabled"],
    model: [0, "ngModel", "model"],
    options: [0, "ngModelOptions", "options"]
  },
  outputs: {
    update: "ngModelChange"
  },
  exportAs: ["ngModel"],
  features: [\u0275\u0275ProvidersFeature([formControlBinding$1]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
var NgModel = _NgModel;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgModel, [{
    type: Directive,
    args: [{
      selector: "[ngModel]:not([formControlName]):not([formControl])",
      providers: [formControlBinding$1],
      exportAs: "ngModel"
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALUE_ACCESSOR]
    }]
  }, {
    type: ChangeDetectorRef,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ChangeDetectorRef]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [CALL_SET_DISABLED_STATE]
    }]
  }], {
    name: [{
      type: Input
    }],
    isDisabled: [{
      type: Input,
      args: ["disabled"]
    }],
    model: [{
      type: Input,
      args: ["ngModel"]
    }],
    options: [{
      type: Input,
      args: ["ngModelOptions"]
    }],
    update: [{
      type: Output,
      args: ["ngModelChange"]
    }]
  });
})();
var _\u0275NgNoValidate = class _\u0275NgNoValidate {
};
_\u0275NgNoValidate.\u0275fac = function \u0275NgNoValidate_Factory(t) {
  return new (t || _\u0275NgNoValidate)();
};
_\u0275NgNoValidate.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _\u0275NgNoValidate,
  selectors: [["form", 3, "ngNoForm", "", 3, "ngNativeValidate", ""]],
  hostAttrs: ["novalidate", ""]
});
var \u0275NgNoValidate = _\u0275NgNoValidate;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275NgNoValidate, [{
    type: Directive,
    args: [{
      selector: "form:not([ngNoForm]):not([ngNativeValidate])",
      host: {
        "novalidate": ""
      }
    }]
  }], null, null);
})();
var NUMBER_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => NumberValueAccessor),
  multi: true
};
var _NumberValueAccessor = class _NumberValueAccessor extends BuiltInControlValueAccessor {
  /**
   * Sets the "value" property on the input element.
   * @nodoc
   */
  writeValue(value) {
    const normalizedValue = value == null ? "" : value;
    this.setProperty("value", normalizedValue);
  }
  /**
   * Registers a function called when the control value changes.
   * @nodoc
   */
  registerOnChange(fn) {
    this.onChange = (value) => {
      fn(value == "" ? null : parseFloat(value));
    };
  }
};
_NumberValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275NumberValueAccessor_BaseFactory;
  return function NumberValueAccessor_Factory(t) {
    return (\u0275NumberValueAccessor_BaseFactory || (\u0275NumberValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_NumberValueAccessor)))(t || _NumberValueAccessor);
  };
})();
_NumberValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NumberValueAccessor,
  selectors: [["input", "type", "number", "formControlName", ""], ["input", "type", "number", "formControl", ""], ["input", "type", "number", "ngModel", ""]],
  hostBindings: function NumberValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("input", function NumberValueAccessor_input_HostBindingHandler($event) {
        return ctx.onChange($event.target.value);
      })("blur", function NumberValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  features: [\u0275\u0275ProvidersFeature([NUMBER_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var NumberValueAccessor = _NumberValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NumberValueAccessor, [{
    type: Directive,
    args: [{
      selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",
      host: {
        "(input)": "onChange($event.target.value)",
        "(blur)": "onTouched()"
      },
      providers: [NUMBER_VALUE_ACCESSOR]
    }]
  }], null, null);
})();
var RADIO_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => RadioControlValueAccessor),
  multi: true
};
function throwNameError() {
  throw new RuntimeError(1202, `
      If you define both a name and a formControlName attribute on your radio button, their values
      must match. Ex: <input type="radio" formControlName="food" name="food">
    `);
}
var _RadioControlRegistry = class _RadioControlRegistry {
  constructor() {
    this._accessors = [];
  }
  /**
   * @description
   * Adds a control to the internal registry. For internal use only.
   */
  add(control, accessor) {
    this._accessors.push([control, accessor]);
  }
  /**
   * @description
   * Removes a control from the internal registry. For internal use only.
   */
  remove(accessor) {
    for (let i2 = this._accessors.length - 1; i2 >= 0; --i2) {
      if (this._accessors[i2][1] === accessor) {
        this._accessors.splice(i2, 1);
        return;
      }
    }
  }
  /**
   * @description
   * Selects a radio button. For internal use only.
   */
  select(accessor) {
    this._accessors.forEach((c) => {
      if (this._isSameGroup(c, accessor) && c[1] !== accessor) {
        c[1].fireUncheck(accessor.value);
      }
    });
  }
  _isSameGroup(controlPair, accessor) {
    if (!controlPair[0].control) return false;
    return controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name;
  }
};
_RadioControlRegistry.\u0275fac = function RadioControlRegistry_Factory(t) {
  return new (t || _RadioControlRegistry)();
};
_RadioControlRegistry.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _RadioControlRegistry,
  factory: _RadioControlRegistry.\u0275fac,
  providedIn: "root"
});
var RadioControlRegistry = _RadioControlRegistry;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RadioControlRegistry, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _RadioControlValueAccessor = class _RadioControlValueAccessor extends BuiltInControlValueAccessor {
  constructor(renderer, elementRef, _registry, _injector) {
    super(renderer, elementRef);
    this._registry = _registry;
    this._injector = _injector;
    this.setDisabledStateFired = false;
    this.onChange = () => {
    };
    this.callSetDisabledState = inject(CALL_SET_DISABLED_STATE, {
      optional: true
    }) ?? setDisabledStateDefault;
  }
  /** @nodoc */
  ngOnInit() {
    this._control = this._injector.get(NgControl);
    this._checkName();
    this._registry.add(this._control, this);
  }
  /** @nodoc */
  ngOnDestroy() {
    this._registry.remove(this);
  }
  /**
   * Sets the "checked" property value on the radio input element.
   * @nodoc
   */
  writeValue(value) {
    this._state = value === this.value;
    this.setProperty("checked", this._state);
  }
  /**
   * Registers a function called when the control value changes.
   * @nodoc
   */
  registerOnChange(fn) {
    this._fn = fn;
    this.onChange = () => {
      fn(this.value);
      this._registry.select(this);
    };
  }
  /** @nodoc */
  setDisabledState(isDisabled) {
    if (this.setDisabledStateFired || isDisabled || this.callSetDisabledState === "whenDisabledForLegacyCode") {
      this.setProperty("disabled", isDisabled);
    }
    this.setDisabledStateFired = true;
  }
  /**
   * Sets the "value" on the radio input element and unchecks it.
   *
   * @param value
   */
  fireUncheck(value) {
    this.writeValue(value);
  }
  _checkName() {
    if (this.name && this.formControlName && this.name !== this.formControlName && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throwNameError();
    }
    if (!this.name && this.formControlName) this.name = this.formControlName;
  }
};
_RadioControlValueAccessor.\u0275fac = function RadioControlValueAccessor_Factory(t) {
  return new (t || _RadioControlValueAccessor)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(RadioControlRegistry), \u0275\u0275directiveInject(Injector));
};
_RadioControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _RadioControlValueAccessor,
  selectors: [["input", "type", "radio", "formControlName", ""], ["input", "type", "radio", "formControl", ""], ["input", "type", "radio", "ngModel", ""]],
  hostBindings: function RadioControlValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("change", function RadioControlValueAccessor_change_HostBindingHandler() {
        return ctx.onChange();
      })("blur", function RadioControlValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  inputs: {
    name: "name",
    formControlName: "formControlName",
    value: "value"
  },
  features: [\u0275\u0275ProvidersFeature([RADIO_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var RadioControlValueAccessor = _RadioControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RadioControlValueAccessor, [{
    type: Directive,
    args: [{
      selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",
      host: {
        "(change)": "onChange()",
        "(blur)": "onTouched()"
      },
      providers: [RADIO_VALUE_ACCESSOR]
    }]
  }], () => [{
    type: Renderer2
  }, {
    type: ElementRef
  }, {
    type: RadioControlRegistry
  }, {
    type: Injector
  }], {
    name: [{
      type: Input
    }],
    formControlName: [{
      type: Input
    }],
    value: [{
      type: Input
    }]
  });
})();
var RANGE_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => RangeValueAccessor),
  multi: true
};
var _RangeValueAccessor = class _RangeValueAccessor extends BuiltInControlValueAccessor {
  /**
   * Sets the "value" property on the input element.
   * @nodoc
   */
  writeValue(value) {
    this.setProperty("value", parseFloat(value));
  }
  /**
   * Registers a function called when the control value changes.
   * @nodoc
   */
  registerOnChange(fn) {
    this.onChange = (value) => {
      fn(value == "" ? null : parseFloat(value));
    };
  }
};
_RangeValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275RangeValueAccessor_BaseFactory;
  return function RangeValueAccessor_Factory(t) {
    return (\u0275RangeValueAccessor_BaseFactory || (\u0275RangeValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_RangeValueAccessor)))(t || _RangeValueAccessor);
  };
})();
_RangeValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _RangeValueAccessor,
  selectors: [["input", "type", "range", "formControlName", ""], ["input", "type", "range", "formControl", ""], ["input", "type", "range", "ngModel", ""]],
  hostBindings: function RangeValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("change", function RangeValueAccessor_change_HostBindingHandler($event) {
        return ctx.onChange($event.target.value);
      })("input", function RangeValueAccessor_input_HostBindingHandler($event) {
        return ctx.onChange($event.target.value);
      })("blur", function RangeValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  features: [\u0275\u0275ProvidersFeature([RANGE_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var RangeValueAccessor = _RangeValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RangeValueAccessor, [{
    type: Directive,
    args: [{
      selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",
      host: {
        "(change)": "onChange($event.target.value)",
        "(input)": "onChange($event.target.value)",
        "(blur)": "onTouched()"
      },
      providers: [RANGE_VALUE_ACCESSOR]
    }]
  }], null, null);
})();
var NG_MODEL_WITH_FORM_CONTROL_WARNING = new InjectionToken(ngDevMode ? "NgModelWithFormControlWarning" : "");
var formControlBinding = {
  provide: NgControl,
  useExisting: forwardRef(() => FormControlDirective)
};
var _FormControlDirective = class _FormControlDirective extends NgControl {
  /**
   * @description
   * Triggers a warning in dev mode that this input should not be used with reactive forms.
   */
  set isDisabled(isDisabled) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      console.warn(disabledAttrWarning);
    }
  }
  constructor(validators, asyncValidators, valueAccessors, _ngModelWarningConfig, callSetDisabledState) {
    super();
    this._ngModelWarningConfig = _ngModelWarningConfig;
    this.callSetDisabledState = callSetDisabledState;
    this.update = new EventEmitter();
    this._ngModelWarningSent = false;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
    this.valueAccessor = selectValueAccessor(this, valueAccessors);
  }
  /** @nodoc */
  ngOnChanges(changes) {
    if (this._isControlChanged(changes)) {
      const previousForm = changes["form"].previousValue;
      if (previousForm) {
        cleanUpControl(
          previousForm,
          this,
          /* validateControlPresenceOnChange */
          false
        );
      }
      setUpControl(this.form, this, this.callSetDisabledState);
      this.form.updateValueAndValidity({
        emitEvent: false
      });
    }
    if (isPropertyUpdated(changes, this.viewModel)) {
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        _ngModelWarning("formControl", _FormControlDirective, this, this._ngModelWarningConfig);
      }
      this.form.setValue(this.model);
      this.viewModel = this.model;
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this.form) {
      cleanUpControl(
        this.form,
        this,
        /* validateControlPresenceOnChange */
        false
      );
    }
  }
  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  get path() {
    return [];
  }
  /**
   * @description
   * The `FormControl` bound to this directive.
   */
  get control() {
    return this.form;
  }
  /**
   * @description
   * Sets the new value for the view model and emits an `ngModelChange` event.
   *
   * @param newValue The new value for the view model.
   */
  viewToModelUpdate(newValue) {
    this.viewModel = newValue;
    this.update.emit(newValue);
  }
  _isControlChanged(changes) {
    return changes.hasOwnProperty("form");
  }
};
_FormControlDirective._ngModelWarningSentOnce = false;
_FormControlDirective.\u0275fac = function FormControlDirective_Factory(t) {
  return new (t || _FormControlDirective)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(NG_MODEL_WITH_FORM_CONTROL_WARNING, 8), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
_FormControlDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _FormControlDirective,
  selectors: [["", "formControl", ""]],
  inputs: {
    form: [0, "formControl", "form"],
    isDisabled: [0, "disabled", "isDisabled"],
    model: [0, "ngModel", "model"]
  },
  outputs: {
    update: "ngModelChange"
  },
  exportAs: ["ngForm"],
  features: [\u0275\u0275ProvidersFeature([formControlBinding]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
var FormControlDirective = _FormControlDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormControlDirective, [{
    type: Directive,
    args: [{
      selector: "[formControl]",
      providers: [formControlBinding],
      exportAs: "ngForm"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALUE_ACCESSOR]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [NG_MODEL_WITH_FORM_CONTROL_WARNING]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [CALL_SET_DISABLED_STATE]
    }]
  }], {
    form: [{
      type: Input,
      args: ["formControl"]
    }],
    isDisabled: [{
      type: Input,
      args: ["disabled"]
    }],
    model: [{
      type: Input,
      args: ["ngModel"]
    }],
    update: [{
      type: Output,
      args: ["ngModelChange"]
    }]
  });
})();
var formDirectiveProvider = {
  provide: ControlContainer,
  useExisting: forwardRef(() => FormGroupDirective)
};
var _FormGroupDirective = class _FormGroupDirective extends ControlContainer {
  constructor(validators, asyncValidators, callSetDisabledState) {
    super();
    this.callSetDisabledState = callSetDisabledState;
    this.submitted = false;
    this._onCollectionChange = () => this._updateDomValue();
    this.directives = [];
    this.form = null;
    this.ngSubmit = new EventEmitter();
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
  }
  /** @nodoc */
  ngOnChanges(changes) {
    this._checkFormPresent();
    if (changes.hasOwnProperty("form")) {
      this._updateValidators();
      this._updateDomValue();
      this._updateRegistrations();
      this._oldForm = this.form;
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this.form) {
      cleanUpValidators(this.form, this);
      if (this.form._onCollectionChange === this._onCollectionChange) {
        this.form._registerOnCollectionChange(() => {
        });
      }
    }
  }
  /**
   * @description
   * Returns this directive's instance.
   */
  get formDirective() {
    return this;
  }
  /**
   * @description
   * Returns the `FormGroup` bound to this directive.
   */
  get control() {
    return this.form;
  }
  /**
   * @description
   * Returns an array representing the path to this group. Because this directive
   * always lives at the top level of a form, it always an empty array.
   */
  get path() {
    return [];
  }
  /**
   * @description
   * Method that sets up the control directive in this group, re-calculates its value
   * and validity, and adds the instance to the internal list of directives.
   *
   * @param dir The `FormControlName` directive instance.
   */
  addControl(dir) {
    const ctrl = this.form.get(dir.path);
    setUpControl(ctrl, dir, this.callSetDisabledState);
    ctrl.updateValueAndValidity({
      emitEvent: false
    });
    this.directives.push(dir);
    return ctrl;
  }
  /**
   * @description
   * Retrieves the `FormControl` instance from the provided `FormControlName` directive
   *
   * @param dir The `FormControlName` directive instance.
   */
  getControl(dir) {
    return this.form.get(dir.path);
  }
  /**
   * @description
   * Removes the `FormControlName` instance from the internal list of directives
   *
   * @param dir The `FormControlName` directive instance.
   */
  removeControl(dir) {
    cleanUpControl(
      dir.control || null,
      dir,
      /* validateControlPresenceOnChange */
      false
    );
    removeListItem$1(this.directives, dir);
  }
  /**
   * Adds a new `FormGroupName` directive instance to the form.
   *
   * @param dir The `FormGroupName` directive instance.
   */
  addFormGroup(dir) {
    this._setUpFormContainer(dir);
  }
  /**
   * Performs the necessary cleanup when a `FormGroupName` directive instance is removed from the
   * view.
   *
   * @param dir The `FormGroupName` directive instance.
   */
  removeFormGroup(dir) {
    this._cleanUpFormContainer(dir);
  }
  /**
   * @description
   * Retrieves the `FormGroup` for a provided `FormGroupName` directive instance
   *
   * @param dir The `FormGroupName` directive instance.
   */
  getFormGroup(dir) {
    return this.form.get(dir.path);
  }
  /**
   * Performs the necessary setup when a `FormArrayName` directive instance is added to the view.
   *
   * @param dir The `FormArrayName` directive instance.
   */
  addFormArray(dir) {
    this._setUpFormContainer(dir);
  }
  /**
   * Performs the necessary cleanup when a `FormArrayName` directive instance is removed from the
   * view.
   *
   * @param dir The `FormArrayName` directive instance.
   */
  removeFormArray(dir) {
    this._cleanUpFormContainer(dir);
  }
  /**
   * @description
   * Retrieves the `FormArray` for a provided `FormArrayName` directive instance.
   *
   * @param dir The `FormArrayName` directive instance.
   */
  getFormArray(dir) {
    return this.form.get(dir.path);
  }
  /**
   * Sets the new value for the provided `FormControlName` directive.
   *
   * @param dir The `FormControlName` directive instance.
   * @param value The new value for the directive's control.
   */
  updateModel(dir, value) {
    const ctrl = this.form.get(dir.path);
    ctrl.setValue(value);
  }
  /**
   * @description
   * Method called with the "submit" event is triggered on the form.
   * Triggers the `ngSubmit` emitter to emit the "submit" event as its payload.
   *
   * @param $event The "submit" event object
   */
  onSubmit($event) {
    this.submitted = true;
    syncPendingControls(this.form, this.directives);
    this.ngSubmit.emit($event);
    return $event?.target?.method === "dialog";
  }
  /**
   * @description
   * Method called when the "reset" event is triggered on the form.
   */
  onReset() {
    this.resetForm();
  }
  /**
   * @description
   * Resets the form to an initial value and resets its submitted status.
   *
   * @param value The new value for the form.
   */
  resetForm(value = void 0) {
    this.form.reset(value);
    this.submitted = false;
  }
  /** @internal */
  _updateDomValue() {
    this.directives.forEach((dir) => {
      const oldCtrl = dir.control;
      const newCtrl = this.form.get(dir.path);
      if (oldCtrl !== newCtrl) {
        cleanUpControl(oldCtrl || null, dir);
        if (isFormControl(newCtrl)) {
          setUpControl(newCtrl, dir, this.callSetDisabledState);
          dir.control = newCtrl;
        }
      }
    });
    this.form._updateTreeValidity({
      emitEvent: false
    });
  }
  _setUpFormContainer(dir) {
    const ctrl = this.form.get(dir.path);
    setUpFormContainer(ctrl, dir);
    ctrl.updateValueAndValidity({
      emitEvent: false
    });
  }
  _cleanUpFormContainer(dir) {
    if (this.form) {
      const ctrl = this.form.get(dir.path);
      if (ctrl) {
        const isControlUpdated = cleanUpFormContainer(ctrl, dir);
        if (isControlUpdated) {
          ctrl.updateValueAndValidity({
            emitEvent: false
          });
        }
      }
    }
  }
  _updateRegistrations() {
    this.form._registerOnCollectionChange(this._onCollectionChange);
    if (this._oldForm) {
      this._oldForm._registerOnCollectionChange(() => {
      });
    }
  }
  _updateValidators() {
    setUpValidators(this.form, this);
    if (this._oldForm) {
      cleanUpValidators(this._oldForm, this);
    }
  }
  _checkFormPresent() {
    if (!this.form && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw missingFormException();
    }
  }
};
_FormGroupDirective.\u0275fac = function FormGroupDirective_Factory(t) {
  return new (t || _FormGroupDirective)(\u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(CALL_SET_DISABLED_STATE, 8));
};
_FormGroupDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _FormGroupDirective,
  selectors: [["", "formGroup", ""]],
  hostBindings: function FormGroupDirective_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("submit", function FormGroupDirective_submit_HostBindingHandler($event) {
        return ctx.onSubmit($event);
      })("reset", function FormGroupDirective_reset_HostBindingHandler() {
        return ctx.onReset();
      });
    }
  },
  inputs: {
    form: [0, "formGroup", "form"]
  },
  outputs: {
    ngSubmit: "ngSubmit"
  },
  exportAs: ["ngForm"],
  features: [\u0275\u0275ProvidersFeature([formDirectiveProvider]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
var FormGroupDirective = _FormGroupDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormGroupDirective, [{
    type: Directive,
    args: [{
      selector: "[formGroup]",
      providers: [formDirectiveProvider],
      host: {
        "(submit)": "onSubmit($event)",
        "(reset)": "onReset()"
      },
      exportAs: "ngForm"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [CALL_SET_DISABLED_STATE]
    }]
  }], {
    form: [{
      type: Input,
      args: ["formGroup"]
    }],
    ngSubmit: [{
      type: Output
    }]
  });
})();
var formGroupNameProvider = {
  provide: ControlContainer,
  useExisting: forwardRef(() => FormGroupName)
};
var _FormGroupName = class _FormGroupName extends AbstractFormGroupDirective {
  constructor(parent, validators, asyncValidators) {
    super();
    this.name = null;
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
  }
  /** @internal */
  _checkParentType() {
    if (_hasInvalidParent(this._parent) && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw groupParentException();
    }
  }
};
_FormGroupName.\u0275fac = function FormGroupName_Factory(t) {
  return new (t || _FormGroupName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
_FormGroupName.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _FormGroupName,
  selectors: [["", "formGroupName", ""]],
  inputs: {
    name: [0, "formGroupName", "name"]
  },
  features: [\u0275\u0275ProvidersFeature([formGroupNameProvider]), \u0275\u0275InheritDefinitionFeature]
});
var FormGroupName = _FormGroupName;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormGroupName, [{
    type: Directive,
    args: [{
      selector: "[formGroupName]",
      providers: [formGroupNameProvider]
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }, {
      type: SkipSelf
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }], {
    name: [{
      type: Input,
      args: ["formGroupName"]
    }]
  });
})();
var formArrayNameProvider = {
  provide: ControlContainer,
  useExisting: forwardRef(() => FormArrayName)
};
var _FormArrayName = class _FormArrayName extends ControlContainer {
  constructor(parent, validators, asyncValidators) {
    super();
    this.name = null;
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
  }
  /**
   * A lifecycle method called when the directive's inputs are initialized. For internal use only.
   * @throws If the directive does not have a valid parent.
   * @nodoc
   */
  ngOnInit() {
    this._checkParentType();
    this.formDirective.addFormArray(this);
  }
  /**
   * A lifecycle method called before the directive's instance is destroyed. For internal use only.
   * @nodoc
   */
  ngOnDestroy() {
    if (this.formDirective) {
      this.formDirective.removeFormArray(this);
    }
  }
  /**
   * @description
   * The `FormArray` bound to this directive.
   */
  get control() {
    return this.formDirective.getFormArray(this);
  }
  /**
   * @description
   * The top-level directive for this group if present, otherwise null.
   */
  get formDirective() {
    return this._parent ? this._parent.formDirective : null;
  }
  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  get path() {
    return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
  }
  _checkParentType() {
    if (_hasInvalidParent(this._parent) && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw arrayParentException();
    }
  }
};
_FormArrayName.\u0275fac = function FormArrayName_Factory(t) {
  return new (t || _FormArrayName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10));
};
_FormArrayName.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _FormArrayName,
  selectors: [["", "formArrayName", ""]],
  inputs: {
    name: [0, "formArrayName", "name"]
  },
  features: [\u0275\u0275ProvidersFeature([formArrayNameProvider]), \u0275\u0275InheritDefinitionFeature]
});
var FormArrayName = _FormArrayName;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormArrayName, [{
    type: Directive,
    args: [{
      selector: "[formArrayName]",
      providers: [formArrayNameProvider]
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }, {
      type: SkipSelf
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }], {
    name: [{
      type: Input,
      args: ["formArrayName"]
    }]
  });
})();
function _hasInvalidParent(parent) {
  return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && !(parent instanceof FormArrayName);
}
var controlNameBinding = {
  provide: NgControl,
  useExisting: forwardRef(() => FormControlName)
};
var _FormControlName = class _FormControlName extends NgControl {
  /**
   * @description
   * Triggers a warning in dev mode that this input should not be used with reactive forms.
   */
  set isDisabled(isDisabled) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      console.warn(disabledAttrWarning);
    }
  }
  constructor(parent, validators, asyncValidators, valueAccessors, _ngModelWarningConfig) {
    super();
    this._ngModelWarningConfig = _ngModelWarningConfig;
    this._added = false;
    this.name = null;
    this.update = new EventEmitter();
    this._ngModelWarningSent = false;
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
    this.valueAccessor = selectValueAccessor(this, valueAccessors);
  }
  /** @nodoc */
  ngOnChanges(changes) {
    if (!this._added) this._setUpControl();
    if (isPropertyUpdated(changes, this.viewModel)) {
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        _ngModelWarning("formControlName", _FormControlName, this, this._ngModelWarningConfig);
      }
      this.viewModel = this.model;
      this.formDirective.updateModel(this, this.model);
    }
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this.formDirective) {
      this.formDirective.removeControl(this);
    }
  }
  /**
   * @description
   * Sets the new value for the view model and emits an `ngModelChange` event.
   *
   * @param newValue The new value for the view model.
   */
  viewToModelUpdate(newValue) {
    this.viewModel = newValue;
    this.update.emit(newValue);
  }
  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  get path() {
    return controlPath(this.name == null ? this.name : this.name.toString(), this._parent);
  }
  /**
   * @description
   * The top-level directive for this group if present, otherwise null.
   */
  get formDirective() {
    return this._parent ? this._parent.formDirective : null;
  }
  _checkParentType() {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (!(this._parent instanceof FormGroupName) && this._parent instanceof AbstractFormGroupDirective) {
        throw ngModelGroupException();
      } else if (!(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) && !(this._parent instanceof FormArrayName)) {
        throw controlParentException(this.name);
      }
    }
  }
  _setUpControl() {
    this._checkParentType();
    this.control = this.formDirective.addControl(this);
    this._added = true;
  }
};
_FormControlName._ngModelWarningSentOnce = false;
_FormControlName.\u0275fac = function FormControlName_Factory(t) {
  return new (t || _FormControlName)(\u0275\u0275directiveInject(ControlContainer, 13), \u0275\u0275directiveInject(NG_VALIDATORS, 10), \u0275\u0275directiveInject(NG_ASYNC_VALIDATORS, 10), \u0275\u0275directiveInject(NG_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(NG_MODEL_WITH_FORM_CONTROL_WARNING, 8));
};
_FormControlName.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _FormControlName,
  selectors: [["", "formControlName", ""]],
  inputs: {
    name: [0, "formControlName", "name"],
    isDisabled: [0, "disabled", "isDisabled"],
    model: [0, "ngModel", "model"]
  },
  outputs: {
    update: "ngModelChange"
  },
  features: [\u0275\u0275ProvidersFeature([controlNameBinding]), \u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature]
});
var FormControlName = _FormControlName;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormControlName, [{
    type: Directive,
    args: [{
      selector: "[formControlName]",
      providers: [controlNameBinding]
    }]
  }], () => [{
    type: ControlContainer,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }, {
      type: SkipSelf
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_ASYNC_VALIDATORS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [NG_VALUE_ACCESSOR]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [NG_MODEL_WITH_FORM_CONTROL_WARNING]
    }]
  }], {
    name: [{
      type: Input,
      args: ["formControlName"]
    }],
    isDisabled: [{
      type: Input,
      args: ["disabled"]
    }],
    model: [{
      type: Input,
      args: ["ngModel"]
    }],
    update: [{
      type: Output,
      args: ["ngModelChange"]
    }]
  });
})();
var SELECT_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => SelectControlValueAccessor),
  multi: true
};
function _buildValueString$1(id2, value) {
  if (id2 == null) return `${value}`;
  if (value && typeof value === "object") value = "Object";
  return `${id2}: ${value}`.slice(0, 50);
}
function _extractId$1(valueString) {
  return valueString.split(":")[0];
}
var _SelectControlValueAccessor = class _SelectControlValueAccessor extends BuiltInControlValueAccessor {
  constructor() {
    super(...arguments);
    this._optionMap = /* @__PURE__ */ new Map();
    this._idCounter = 0;
    this._compareWith = Object.is;
  }
  /**
   * @description
   * Tracks the option comparison algorithm for tracking identities when
   * checking for changes.
   */
  set compareWith(fn) {
    if (typeof fn !== "function" && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw new RuntimeError(1201, `compareWith must be a function, but received ${JSON.stringify(fn)}`);
    }
    this._compareWith = fn;
  }
  /**
   * Sets the "value" property on the select element.
   * @nodoc
   */
  writeValue(value) {
    this.value = value;
    const id2 = this._getOptionId(value);
    const valueString = _buildValueString$1(id2, value);
    this.setProperty("value", valueString);
  }
  /**
   * Registers a function called when the control value changes.
   * @nodoc
   */
  registerOnChange(fn) {
    this.onChange = (valueString) => {
      this.value = this._getOptionValue(valueString);
      fn(this.value);
    };
  }
  /** @internal */
  _registerOption() {
    return (this._idCounter++).toString();
  }
  /** @internal */
  _getOptionId(value) {
    for (const id2 of this._optionMap.keys()) {
      if (this._compareWith(this._optionMap.get(id2), value)) return id2;
    }
    return null;
  }
  /** @internal */
  _getOptionValue(valueString) {
    const id2 = _extractId$1(valueString);
    return this._optionMap.has(id2) ? this._optionMap.get(id2) : valueString;
  }
};
_SelectControlValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275SelectControlValueAccessor_BaseFactory;
  return function SelectControlValueAccessor_Factory(t) {
    return (\u0275SelectControlValueAccessor_BaseFactory || (\u0275SelectControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_SelectControlValueAccessor)))(t || _SelectControlValueAccessor);
  };
})();
_SelectControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _SelectControlValueAccessor,
  selectors: [["select", "formControlName", "", 3, "multiple", ""], ["select", "formControl", "", 3, "multiple", ""], ["select", "ngModel", "", 3, "multiple", ""]],
  hostBindings: function SelectControlValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("change", function SelectControlValueAccessor_change_HostBindingHandler($event) {
        return ctx.onChange($event.target.value);
      })("blur", function SelectControlValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  inputs: {
    compareWith: "compareWith"
  },
  features: [\u0275\u0275ProvidersFeature([SELECT_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var SelectControlValueAccessor = _SelectControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SelectControlValueAccessor, [{
    type: Directive,
    args: [{
      selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",
      host: {
        "(change)": "onChange($event.target.value)",
        "(blur)": "onTouched()"
      },
      providers: [SELECT_VALUE_ACCESSOR]
    }]
  }], null, {
    compareWith: [{
      type: Input
    }]
  });
})();
var _NgSelectOption = class _NgSelectOption {
  constructor(_element, _renderer, _select) {
    this._element = _element;
    this._renderer = _renderer;
    this._select = _select;
    if (this._select) this.id = this._select._registerOption();
  }
  /**
   * @description
   * Tracks the value bound to the option element. Unlike the value binding,
   * ngValue supports binding to objects.
   */
  set ngValue(value) {
    if (this._select == null) return;
    this._select._optionMap.set(this.id, value);
    this._setElementValue(_buildValueString$1(this.id, value));
    this._select.writeValue(this._select.value);
  }
  /**
   * @description
   * Tracks simple string values bound to the option element.
   * For objects, use the `ngValue` input binding.
   */
  set value(value) {
    this._setElementValue(value);
    if (this._select) this._select.writeValue(this._select.value);
  }
  /** @internal */
  _setElementValue(value) {
    this._renderer.setProperty(this._element.nativeElement, "value", value);
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this._select) {
      this._select._optionMap.delete(this.id);
      this._select.writeValue(this._select.value);
    }
  }
};
_NgSelectOption.\u0275fac = function NgSelectOption_Factory(t) {
  return new (t || _NgSelectOption)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(SelectControlValueAccessor, 9));
};
_NgSelectOption.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgSelectOption,
  selectors: [["option"]],
  inputs: {
    ngValue: "ngValue",
    value: "value"
  }
});
var NgSelectOption = _NgSelectOption;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSelectOption, [{
    type: Directive,
    args: [{
      selector: "option"
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Renderer2
  }, {
    type: SelectControlValueAccessor,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }]
  }], {
    ngValue: [{
      type: Input,
      args: ["ngValue"]
    }],
    value: [{
      type: Input,
      args: ["value"]
    }]
  });
})();
var SELECT_MULTIPLE_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => SelectMultipleControlValueAccessor),
  multi: true
};
function _buildValueString(id2, value) {
  if (id2 == null) return `${value}`;
  if (typeof value === "string") value = `'${value}'`;
  if (value && typeof value === "object") value = "Object";
  return `${id2}: ${value}`.slice(0, 50);
}
function _extractId(valueString) {
  return valueString.split(":")[0];
}
var _SelectMultipleControlValueAccessor = class _SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor {
  constructor() {
    super(...arguments);
    this._optionMap = /* @__PURE__ */ new Map();
    this._idCounter = 0;
    this._compareWith = Object.is;
  }
  /**
   * @description
   * Tracks the option comparison algorithm for tracking identities when
   * checking for changes.
   */
  set compareWith(fn) {
    if (typeof fn !== "function" && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw new RuntimeError(1201, `compareWith must be a function, but received ${JSON.stringify(fn)}`);
    }
    this._compareWith = fn;
  }
  /**
   * Sets the "value" property on one or of more of the select's options.
   * @nodoc
   */
  writeValue(value) {
    this.value = value;
    let optionSelectedStateSetter;
    if (Array.isArray(value)) {
      const ids = value.map((v) => this._getOptionId(v));
      optionSelectedStateSetter = (opt, o) => {
        opt._setSelected(ids.indexOf(o.toString()) > -1);
      };
    } else {
      optionSelectedStateSetter = (opt, o) => {
        opt._setSelected(false);
      };
    }
    this._optionMap.forEach(optionSelectedStateSetter);
  }
  /**
   * Registers a function called when the control value changes
   * and writes an array of the selected options.
   * @nodoc
   */
  registerOnChange(fn) {
    this.onChange = (element) => {
      const selected = [];
      const selectedOptions = element.selectedOptions;
      if (selectedOptions !== void 0) {
        const options = selectedOptions;
        for (let i2 = 0; i2 < options.length; i2++) {
          const opt = options[i2];
          const val = this._getOptionValue(opt.value);
          selected.push(val);
        }
      } else {
        const options = element.options;
        for (let i2 = 0; i2 < options.length; i2++) {
          const opt = options[i2];
          if (opt.selected) {
            const val = this._getOptionValue(opt.value);
            selected.push(val);
          }
        }
      }
      this.value = selected;
      fn(selected);
    };
  }
  /** @internal */
  _registerOption(value) {
    const id2 = (this._idCounter++).toString();
    this._optionMap.set(id2, value);
    return id2;
  }
  /** @internal */
  _getOptionId(value) {
    for (const id2 of this._optionMap.keys()) {
      if (this._compareWith(this._optionMap.get(id2)._value, value)) return id2;
    }
    return null;
  }
  /** @internal */
  _getOptionValue(valueString) {
    const id2 = _extractId(valueString);
    return this._optionMap.has(id2) ? this._optionMap.get(id2)._value : valueString;
  }
};
_SelectMultipleControlValueAccessor.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275SelectMultipleControlValueAccessor_BaseFactory;
  return function SelectMultipleControlValueAccessor_Factory(t) {
    return (\u0275SelectMultipleControlValueAccessor_BaseFactory || (\u0275SelectMultipleControlValueAccessor_BaseFactory = \u0275\u0275getInheritedFactory(_SelectMultipleControlValueAccessor)))(t || _SelectMultipleControlValueAccessor);
  };
})();
_SelectMultipleControlValueAccessor.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _SelectMultipleControlValueAccessor,
  selectors: [["select", "multiple", "", "formControlName", ""], ["select", "multiple", "", "formControl", ""], ["select", "multiple", "", "ngModel", ""]],
  hostBindings: function SelectMultipleControlValueAccessor_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("change", function SelectMultipleControlValueAccessor_change_HostBindingHandler($event) {
        return ctx.onChange($event.target);
      })("blur", function SelectMultipleControlValueAccessor_blur_HostBindingHandler() {
        return ctx.onTouched();
      });
    }
  },
  inputs: {
    compareWith: "compareWith"
  },
  features: [\u0275\u0275ProvidersFeature([SELECT_MULTIPLE_VALUE_ACCESSOR]), \u0275\u0275InheritDefinitionFeature]
});
var SelectMultipleControlValueAccessor = _SelectMultipleControlValueAccessor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SelectMultipleControlValueAccessor, [{
    type: Directive,
    args: [{
      selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",
      host: {
        "(change)": "onChange($event.target)",
        "(blur)": "onTouched()"
      },
      providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]
    }]
  }], null, {
    compareWith: [{
      type: Input
    }]
  });
})();
var _\u0275NgSelectMultipleOption = class _\u0275NgSelectMultipleOption {
  constructor(_element, _renderer, _select) {
    this._element = _element;
    this._renderer = _renderer;
    this._select = _select;
    if (this._select) {
      this.id = this._select._registerOption(this);
    }
  }
  /**
   * @description
   * Tracks the value bound to the option element. Unlike the value binding,
   * ngValue supports binding to objects.
   */
  set ngValue(value) {
    if (this._select == null) return;
    this._value = value;
    this._setElementValue(_buildValueString(this.id, value));
    this._select.writeValue(this._select.value);
  }
  /**
   * @description
   * Tracks simple string values bound to the option element.
   * For objects, use the `ngValue` input binding.
   */
  set value(value) {
    if (this._select) {
      this._value = value;
      this._setElementValue(_buildValueString(this.id, value));
      this._select.writeValue(this._select.value);
    } else {
      this._setElementValue(value);
    }
  }
  /** @internal */
  _setElementValue(value) {
    this._renderer.setProperty(this._element.nativeElement, "value", value);
  }
  /** @internal */
  _setSelected(selected) {
    this._renderer.setProperty(this._element.nativeElement, "selected", selected);
  }
  /** @nodoc */
  ngOnDestroy() {
    if (this._select) {
      this._select._optionMap.delete(this.id);
      this._select.writeValue(this._select.value);
    }
  }
};
_\u0275NgSelectMultipleOption.\u0275fac = function \u0275NgSelectMultipleOption_Factory(t) {
  return new (t || _\u0275NgSelectMultipleOption)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(SelectMultipleControlValueAccessor, 9));
};
_\u0275NgSelectMultipleOption.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _\u0275NgSelectMultipleOption,
  selectors: [["option"]],
  inputs: {
    ngValue: "ngValue",
    value: "value"
  }
});
var \u0275NgSelectMultipleOption = _\u0275NgSelectMultipleOption;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275NgSelectMultipleOption, [{
    type: Directive,
    args: [{
      selector: "option"
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Renderer2
  }, {
    type: SelectMultipleControlValueAccessor,
    decorators: [{
      type: Optional
    }, {
      type: Host
    }]
  }], {
    ngValue: [{
      type: Input,
      args: ["ngValue"]
    }],
    value: [{
      type: Input,
      args: ["value"]
    }]
  });
})();
function toInteger(value) {
  return typeof value === "number" ? value : parseInt(value, 10);
}
function toFloat(value) {
  return typeof value === "number" ? value : parseFloat(value);
}
var _AbstractValidatorDirective = class _AbstractValidatorDirective {
  constructor() {
    this._validator = nullValidator;
  }
  /** @nodoc */
  ngOnChanges(changes) {
    if (this.inputName in changes) {
      const input2 = this.normalizeInput(changes[this.inputName].currentValue);
      this._enabled = this.enabled(input2);
      this._validator = this._enabled ? this.createValidator(input2) : nullValidator;
      if (this._onChange) {
        this._onChange();
      }
    }
  }
  /** @nodoc */
  validate(control) {
    return this._validator(control);
  }
  /** @nodoc */
  registerOnValidatorChange(fn) {
    this._onChange = fn;
  }
  /**
   * @description
   * Determines whether this validator should be active or not based on an input.
   * Base class implementation checks whether an input is defined (if the value is different from
   * `null` and `undefined`). Validator classes that extend this base class can override this
   * function with the logic specific to a particular validator directive.
   */
  enabled(input2) {
    return input2 != null;
  }
};
_AbstractValidatorDirective.\u0275fac = function AbstractValidatorDirective_Factory(t) {
  return new (t || _AbstractValidatorDirective)();
};
_AbstractValidatorDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _AbstractValidatorDirective,
  features: [\u0275\u0275NgOnChangesFeature]
});
var AbstractValidatorDirective = _AbstractValidatorDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractValidatorDirective, [{
    type: Directive
  }], null, null);
})();
var MAX_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MaxValidator),
  multi: true
};
var _MaxValidator = class _MaxValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "max";
    this.normalizeInput = (input2) => toFloat(input2);
    this.createValidator = (max) => maxValidator(max);
  }
};
_MaxValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275MaxValidator_BaseFactory;
  return function MaxValidator_Factory(t) {
    return (\u0275MaxValidator_BaseFactory || (\u0275MaxValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MaxValidator)))(t || _MaxValidator);
  };
})();
_MaxValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MaxValidator,
  selectors: [["input", "type", "number", "max", "", "formControlName", ""], ["input", "type", "number", "max", "", "formControl", ""], ["input", "type", "number", "max", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function MaxValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("max", ctx._enabled ? ctx.max : null);
    }
  },
  inputs: {
    max: "max"
  },
  features: [\u0275\u0275ProvidersFeature([MAX_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var MaxValidator = _MaxValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MaxValidator, [{
    type: Directive,
    args: [{
      selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
      providers: [MAX_VALIDATOR],
      host: {
        "[attr.max]": "_enabled ? max : null"
      }
    }]
  }], null, {
    max: [{
      type: Input
    }]
  });
})();
var MIN_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MinValidator),
  multi: true
};
var _MinValidator = class _MinValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "min";
    this.normalizeInput = (input2) => toFloat(input2);
    this.createValidator = (min) => minValidator(min);
  }
};
_MinValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275MinValidator_BaseFactory;
  return function MinValidator_Factory(t) {
    return (\u0275MinValidator_BaseFactory || (\u0275MinValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MinValidator)))(t || _MinValidator);
  };
})();
_MinValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MinValidator,
  selectors: [["input", "type", "number", "min", "", "formControlName", ""], ["input", "type", "number", "min", "", "formControl", ""], ["input", "type", "number", "min", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function MinValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("min", ctx._enabled ? ctx.min : null);
    }
  },
  inputs: {
    min: "min"
  },
  features: [\u0275\u0275ProvidersFeature([MIN_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var MinValidator = _MinValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MinValidator, [{
    type: Directive,
    args: [{
      selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
      providers: [MIN_VALIDATOR],
      host: {
        "[attr.min]": "_enabled ? min : null"
      }
    }]
  }], null, {
    min: [{
      type: Input
    }]
  });
})();
var REQUIRED_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => RequiredValidator),
  multi: true
};
var CHECKBOX_REQUIRED_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => CheckboxRequiredValidator),
  multi: true
};
var _RequiredValidator = class _RequiredValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "required";
    this.normalizeInput = booleanAttribute;
    this.createValidator = (input2) => requiredValidator;
  }
  /** @nodoc */
  enabled(input2) {
    return input2;
  }
};
_RequiredValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275RequiredValidator_BaseFactory;
  return function RequiredValidator_Factory(t) {
    return (\u0275RequiredValidator_BaseFactory || (\u0275RequiredValidator_BaseFactory = \u0275\u0275getInheritedFactory(_RequiredValidator)))(t || _RequiredValidator);
  };
})();
_RequiredValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _RequiredValidator,
  selectors: [["", "required", "", "formControlName", "", 3, "type", "checkbox"], ["", "required", "", "formControl", "", 3, "type", "checkbox"], ["", "required", "", "ngModel", "", 3, "type", "checkbox"]],
  hostVars: 1,
  hostBindings: function RequiredValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("required", ctx._enabled ? "" : null);
    }
  },
  inputs: {
    required: "required"
  },
  features: [\u0275\u0275ProvidersFeature([REQUIRED_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var RequiredValidator = _RequiredValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RequiredValidator, [{
    type: Directive,
    args: [{
      selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
      providers: [REQUIRED_VALIDATOR],
      host: {
        "[attr.required]": '_enabled ? "" : null'
      }
    }]
  }], null, {
    required: [{
      type: Input
    }]
  });
})();
var _CheckboxRequiredValidator = class _CheckboxRequiredValidator extends RequiredValidator {
  constructor() {
    super(...arguments);
    this.createValidator = (input2) => requiredTrueValidator;
  }
};
_CheckboxRequiredValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275CheckboxRequiredValidator_BaseFactory;
  return function CheckboxRequiredValidator_Factory(t) {
    return (\u0275CheckboxRequiredValidator_BaseFactory || (\u0275CheckboxRequiredValidator_BaseFactory = \u0275\u0275getInheritedFactory(_CheckboxRequiredValidator)))(t || _CheckboxRequiredValidator);
  };
})();
_CheckboxRequiredValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CheckboxRequiredValidator,
  selectors: [["input", "type", "checkbox", "required", "", "formControlName", ""], ["input", "type", "checkbox", "required", "", "formControl", ""], ["input", "type", "checkbox", "required", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function CheckboxRequiredValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("required", ctx._enabled ? "" : null);
    }
  },
  features: [\u0275\u0275ProvidersFeature([CHECKBOX_REQUIRED_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var CheckboxRequiredValidator = _CheckboxRequiredValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CheckboxRequiredValidator, [{
    type: Directive,
    args: [{
      selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",
      providers: [CHECKBOX_REQUIRED_VALIDATOR],
      host: {
        "[attr.required]": '_enabled ? "" : null'
      }
    }]
  }], null, null);
})();
var EMAIL_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => EmailValidator),
  multi: true
};
var _EmailValidator = class _EmailValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "email";
    this.normalizeInput = booleanAttribute;
    this.createValidator = (input2) => emailValidator;
  }
  /** @nodoc */
  enabled(input2) {
    return input2;
  }
};
_EmailValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275EmailValidator_BaseFactory;
  return function EmailValidator_Factory(t) {
    return (\u0275EmailValidator_BaseFactory || (\u0275EmailValidator_BaseFactory = \u0275\u0275getInheritedFactory(_EmailValidator)))(t || _EmailValidator);
  };
})();
_EmailValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _EmailValidator,
  selectors: [["", "email", "", "formControlName", ""], ["", "email", "", "formControl", ""], ["", "email", "", "ngModel", ""]],
  inputs: {
    email: "email"
  },
  features: [\u0275\u0275ProvidersFeature([EMAIL_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var EmailValidator = _EmailValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EmailValidator, [{
    type: Directive,
    args: [{
      selector: "[email][formControlName],[email][formControl],[email][ngModel]",
      providers: [EMAIL_VALIDATOR]
    }]
  }], null, {
    email: [{
      type: Input
    }]
  });
})();
var MIN_LENGTH_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MinLengthValidator),
  multi: true
};
var _MinLengthValidator = class _MinLengthValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "minlength";
    this.normalizeInput = (input2) => toInteger(input2);
    this.createValidator = (minlength) => minLengthValidator(minlength);
  }
};
_MinLengthValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275MinLengthValidator_BaseFactory;
  return function MinLengthValidator_Factory(t) {
    return (\u0275MinLengthValidator_BaseFactory || (\u0275MinLengthValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MinLengthValidator)))(t || _MinLengthValidator);
  };
})();
_MinLengthValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MinLengthValidator,
  selectors: [["", "minlength", "", "formControlName", ""], ["", "minlength", "", "formControl", ""], ["", "minlength", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function MinLengthValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("minlength", ctx._enabled ? ctx.minlength : null);
    }
  },
  inputs: {
    minlength: "minlength"
  },
  features: [\u0275\u0275ProvidersFeature([MIN_LENGTH_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var MinLengthValidator = _MinLengthValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MinLengthValidator, [{
    type: Directive,
    args: [{
      selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",
      providers: [MIN_LENGTH_VALIDATOR],
      host: {
        "[attr.minlength]": "_enabled ? minlength : null"
      }
    }]
  }], null, {
    minlength: [{
      type: Input
    }]
  });
})();
var MAX_LENGTH_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MaxLengthValidator),
  multi: true
};
var _MaxLengthValidator = class _MaxLengthValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "maxlength";
    this.normalizeInput = (input2) => toInteger(input2);
    this.createValidator = (maxlength) => maxLengthValidator(maxlength);
  }
};
_MaxLengthValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275MaxLengthValidator_BaseFactory;
  return function MaxLengthValidator_Factory(t) {
    return (\u0275MaxLengthValidator_BaseFactory || (\u0275MaxLengthValidator_BaseFactory = \u0275\u0275getInheritedFactory(_MaxLengthValidator)))(t || _MaxLengthValidator);
  };
})();
_MaxLengthValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MaxLengthValidator,
  selectors: [["", "maxlength", "", "formControlName", ""], ["", "maxlength", "", "formControl", ""], ["", "maxlength", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function MaxLengthValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("maxlength", ctx._enabled ? ctx.maxlength : null);
    }
  },
  inputs: {
    maxlength: "maxlength"
  },
  features: [\u0275\u0275ProvidersFeature([MAX_LENGTH_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var MaxLengthValidator = _MaxLengthValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MaxLengthValidator, [{
    type: Directive,
    args: [{
      selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
      providers: [MAX_LENGTH_VALIDATOR],
      host: {
        "[attr.maxlength]": "_enabled ? maxlength : null"
      }
    }]
  }], null, {
    maxlength: [{
      type: Input
    }]
  });
})();
var PATTERN_VALIDATOR = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => PatternValidator),
  multi: true
};
var _PatternValidator = class _PatternValidator extends AbstractValidatorDirective {
  constructor() {
    super(...arguments);
    this.inputName = "pattern";
    this.normalizeInput = (input2) => input2;
    this.createValidator = (input2) => patternValidator(input2);
  }
};
_PatternValidator.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275PatternValidator_BaseFactory;
  return function PatternValidator_Factory(t) {
    return (\u0275PatternValidator_BaseFactory || (\u0275PatternValidator_BaseFactory = \u0275\u0275getInheritedFactory(_PatternValidator)))(t || _PatternValidator);
  };
})();
_PatternValidator.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _PatternValidator,
  selectors: [["", "pattern", "", "formControlName", ""], ["", "pattern", "", "formControl", ""], ["", "pattern", "", "ngModel", ""]],
  hostVars: 1,
  hostBindings: function PatternValidator_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("pattern", ctx._enabled ? ctx.pattern : null);
    }
  },
  inputs: {
    pattern: "pattern"
  },
  features: [\u0275\u0275ProvidersFeature([PATTERN_VALIDATOR]), \u0275\u0275InheritDefinitionFeature]
});
var PatternValidator = _PatternValidator;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PatternValidator, [{
    type: Directive,
    args: [{
      selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
      providers: [PATTERN_VALIDATOR],
      host: {
        "[attr.pattern]": "_enabled ? pattern : null"
      }
    }]
  }], null, {
    pattern: [{
      type: Input
    }]
  });
})();
var SHARED_FORM_DIRECTIVES = [\u0275NgNoValidate, NgSelectOption, \u0275NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator];
var TEMPLATE_DRIVEN_DIRECTIVES = [NgModel, NgModelGroup, NgForm];
var REACTIVE_DRIVEN_DIRECTIVES = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName];
var _\u0275InternalFormsSharedModule = class _\u0275InternalFormsSharedModule {
};
_\u0275InternalFormsSharedModule.\u0275fac = function \u0275InternalFormsSharedModule_Factory(t) {
  return new (t || _\u0275InternalFormsSharedModule)();
};
_\u0275InternalFormsSharedModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _\u0275InternalFormsSharedModule
});
_\u0275InternalFormsSharedModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var \u0275InternalFormsSharedModule = _\u0275InternalFormsSharedModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(\u0275InternalFormsSharedModule, [{
    type: NgModule,
    args: [{
      declarations: SHARED_FORM_DIRECTIVES,
      exports: SHARED_FORM_DIRECTIVES
    }]
  }], null, null);
})();
var FormArray = class extends AbstractControl {
  /**
   * Creates a new `FormArray` instance.
   *
   * @param controls An array of child controls. Each child control is given an index
   * where it is registered.
   *
   * @param validatorOrOpts A synchronous validator function, or an array of
   * such functions, or an `AbstractControlOptions` object that contains validation functions
   * and a validation trigger.
   *
   * @param asyncValidator A single async validator or array of async validator functions
   *
   */
  constructor(controls, validatorOrOpts, asyncValidator) {
    super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts));
    this.controls = controls;
    this._initObservables();
    this._setUpdateStrategy(validatorOrOpts);
    this._setUpControls();
    this.updateValueAndValidity({
      onlySelf: true,
      // If `asyncValidator` is present, it will trigger control status change from `PENDING` to
      // `VALID` or `INVALID`.
      // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent`
      // to `true` to allow that during the control creation process.
      emitEvent: !!this.asyncValidator
    });
  }
  /**
   * Get the `AbstractControl` at the given `index` in the array.
   *
   * @param index Index in the array to retrieve the control. If `index` is negative, it will wrap
   *     around from the back, and if index is greatly negative (less than `-length`), the result is
   * undefined. This behavior is the same as `Array.at(index)`.
   */
  at(index) {
    return this.controls[this._adjustIndex(index)];
  }
  /**
   * Insert a new `AbstractControl` at the end of the array.
   *
   * @param control Form control to be inserted
   * @param options Specifies whether this FormArray instance should emit events after a new
   *     control is added.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control is
   * inserted. When false, no events are emitted.
   */
  push(control, options = {}) {
    this.controls.push(control);
    this._registerControl(control);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
    this._onCollectionChange();
  }
  /**
   * Insert a new `AbstractControl` at the given `index` in the array.
   *
   * @param index Index in the array to insert the control. If `index` is negative, wraps around
   *     from the back. If `index` is greatly negative (less than `-length`), prepends to the array.
   * This behavior is the same as `Array.splice(index, 0, control)`.
   * @param control Form control to be inserted
   * @param options Specifies whether this FormArray instance should emit events after a new
   *     control is inserted.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control is
   * inserted. When false, no events are emitted.
   */
  insert(index, control, options = {}) {
    this.controls.splice(index, 0, control);
    this._registerControl(control);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
  }
  /**
   * Remove the control at the given `index` in the array.
   *
   * @param index Index in the array to remove the control.  If `index` is negative, wraps around
   *     from the back. If `index` is greatly negative (less than `-length`), removes the first
   *     element. This behavior is the same as `Array.splice(index, 1)`.
   * @param options Specifies whether this FormArray instance should emit events after a
   *     control is removed.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control is
   * removed. When false, no events are emitted.
   */
  removeAt(index, options = {}) {
    let adjustedIndex = this._adjustIndex(index);
    if (adjustedIndex < 0) adjustedIndex = 0;
    if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {
    });
    this.controls.splice(adjustedIndex, 1);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
  }
  /**
   * Replace an existing control.
   *
   * @param index Index in the array to replace the control. If `index` is negative, wraps around
   *     from the back. If `index` is greatly negative (less than `-length`), replaces the first
   *     element. This behavior is the same as `Array.splice(index, 1, control)`.
   * @param control The `AbstractControl` control to replace the existing control
   * @param options Specifies whether this FormArray instance should emit events after an
   *     existing control is replaced with a new one.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control is
   * replaced with a new one. When false, no events are emitted.
   */
  setControl(index, control, options = {}) {
    let adjustedIndex = this._adjustIndex(index);
    if (adjustedIndex < 0) adjustedIndex = 0;
    if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {
    });
    this.controls.splice(adjustedIndex, 1);
    if (control) {
      this.controls.splice(adjustedIndex, 0, control);
      this._registerControl(control);
    }
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
    this._onCollectionChange();
  }
  /**
   * Length of the control array.
   */
  get length() {
    return this.controls.length;
  }
  /**
   * Sets the value of the `FormArray`. It accepts an array that matches
   * the structure of the control.
   *
   * This method performs strict checks, and throws an error if you try
   * to set the value of a control that doesn't exist or if you exclude the
   * value of a control.
   *
   * @usageNotes
   * ### Set the values for the controls in the form array
   *
   * ```
   * const arr = new FormArray([
   *   new FormControl(),
   *   new FormControl()
   * ]);
   * console.log(arr.value);   // [null, null]
   *
   * arr.setValue(['Nancy', 'Drew']);
   * console.log(arr.value);   // ['Nancy', 'Drew']
   * ```
   *
   * @param value Array of values for the controls
   * @param options Configure options that determine how the control propagates changes and
   * emits events after the value changes
   *
   * * `onlySelf`: When true, each change only affects this control, and not its parent. Default
   * is false.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges`
   * observables emit events with the latest status and value when the control value is updated.
   * When false, no events are emitted.
   * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
   * updateValueAndValidity} method.
   */
  setValue(value, options = {}) {
    assertAllValuesPresent(this, false, value);
    value.forEach((newValue, index) => {
      assertControlPresent(this, false, index);
      this.at(index).setValue(newValue, {
        onlySelf: true,
        emitEvent: options.emitEvent
      });
    });
    this.updateValueAndValidity(options);
  }
  /**
   * Patches the value of the `FormArray`. It accepts an array that matches the
   * structure of the control, and does its best to match the values to the correct
   * controls in the group.
   *
   * It accepts both super-sets and sub-sets of the array without throwing an error.
   *
   * @usageNotes
   * ### Patch the values for controls in a form array
   *
   * ```
   * const arr = new FormArray([
   *    new FormControl(),
   *    new FormControl()
   * ]);
   * console.log(arr.value);   // [null, null]
   *
   * arr.patchValue(['Nancy']);
   * console.log(arr.value);   // ['Nancy', null]
   * ```
   *
   * @param value Array of latest values for the controls
   * @param options Configure options that determine how the control propagates changes and
   * emits events after the value changes
   *
   * * `onlySelf`: When true, each change only affects this control, and not its parent. Default
   * is false.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when the control
   * value is updated. When false, no events are emitted. The configuration options are passed to
   * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
   */
  patchValue(value, options = {}) {
    if (value == null) return;
    value.forEach((newValue, index) => {
      if (this.at(index)) {
        this.at(index).patchValue(newValue, {
          onlySelf: true,
          emitEvent: options.emitEvent
        });
      }
    });
    this.updateValueAndValidity(options);
  }
  /**
   * Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the
   * value of all descendants to null or null maps.
   *
   * You reset to a specific form state by passing in an array of states
   * that matches the structure of the control. The state is a standalone value
   * or a form state object with both a value and a disabled status.
   *
   * @usageNotes
   * ### Reset the values in a form array
   *
   * ```ts
   * const arr = new FormArray([
   *    new FormControl(),
   *    new FormControl()
   * ]);
   * arr.reset(['name', 'last name']);
   *
   * console.log(arr.value);  // ['name', 'last name']
   * ```
   *
   * ### Reset the values in a form array and the disabled status for the first control
   *
   * ```
   * arr.reset([
   *   {value: 'name', disabled: true},
   *   'last'
   * ]);
   *
   * console.log(arr.value);  // ['last']
   * console.log(arr.at(0).status);  // 'DISABLED'
   * ```
   *
   * @param value Array of values for the controls
   * @param options Configure options that determine how the control propagates changes and
   * emits events after the value changes
   *
   * * `onlySelf`: When true, each change only affects this control, and not its parent. Default
   * is false.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges`
   * observables emit events with the latest status and value when the control is reset.
   * When false, no events are emitted.
   * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
   * updateValueAndValidity} method.
   */
  reset(value = [], options = {}) {
    this._forEachChild((control, index) => {
      control.reset(value[index], {
        onlySelf: true,
        emitEvent: options.emitEvent
      });
    });
    this._updatePristine(options, this);
    this._updateTouched(options, this);
    this.updateValueAndValidity(options);
  }
  /**
   * The aggregate value of the array, including any disabled controls.
   *
   * Reports all values regardless of disabled status.
   */
  getRawValue() {
    return this.controls.map((control) => control.getRawValue());
  }
  /**
   * Remove all controls in the `FormArray`.
   *
   * @param options Specifies whether this FormArray instance should emit events after all
   *     controls are removed.
   * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
   * `valueChanges` observables emit events with the latest status and value when all controls
   * in this FormArray instance are removed. When false, no events are emitted.
   *
   * @usageNotes
   * ### Remove all elements from a FormArray
   *
   * ```ts
   * const arr = new FormArray([
   *    new FormControl(),
   *    new FormControl()
   * ]);
   * console.log(arr.length);  // 2
   *
   * arr.clear();
   * console.log(arr.length);  // 0
   * ```
   *
   * It's a simpler and more efficient alternative to removing all elements one by one:
   *
   * ```ts
   * const arr = new FormArray([
   *    new FormControl(),
   *    new FormControl()
   * ]);
   *
   * while (arr.length) {
   *    arr.removeAt(0);
   * }
   * ```
   */
  clear(options = {}) {
    if (this.controls.length < 1) return;
    this._forEachChild((control) => control._registerOnCollectionChange(() => {
    }));
    this.controls.splice(0);
    this.updateValueAndValidity({
      emitEvent: options.emitEvent
    });
  }
  /**
   * Adjusts a negative index by summing it with the length of the array. For very negative
   * indices, the result may remain negative.
   * @internal
   */
  _adjustIndex(index) {
    return index < 0 ? index + this.length : index;
  }
  /** @internal */
  _syncPendingControls() {
    let subtreeUpdated = this.controls.reduce((updated, child) => {
      return child._syncPendingControls() ? true : updated;
    }, false);
    if (subtreeUpdated) this.updateValueAndValidity({
      onlySelf: true
    });
    return subtreeUpdated;
  }
  /** @internal */
  _forEachChild(cb) {
    this.controls.forEach((control, index) => {
      cb(control, index);
    });
  }
  /** @internal */
  _updateValue() {
    this.value = this.controls.filter((control) => control.enabled || this.disabled).map((control) => control.value);
  }
  /** @internal */
  _anyControls(condition) {
    return this.controls.some((control) => control.enabled && condition(control));
  }
  /** @internal */
  _setUpControls() {
    this._forEachChild((control) => this._registerControl(control));
  }
  /** @internal */
  _allControlsDisabled() {
    for (const control of this.controls) {
      if (control.enabled) return false;
    }
    return this.controls.length > 0 || this.disabled;
  }
  _registerControl(control) {
    control.setParent(this);
    control._registerOnCollectionChange(this._onCollectionChange);
  }
  /** @internal */
  _find(name) {
    return this.at(name) ?? null;
  }
};
function isAbstractControlOptions(options) {
  return !!options && (options.asyncValidators !== void 0 || options.validators !== void 0 || options.updateOn !== void 0);
}
var _FormBuilder = class _FormBuilder {
  constructor() {
    this.useNonNullable = false;
  }
  /**
   * @description
   * Returns a FormBuilder in which automatically constructed `FormControl` elements
   * have `{nonNullable: true}` and are non-nullable.
   *
   * **Constructing non-nullable controls**
   *
   * When constructing a control, it will be non-nullable, and will reset to its initial value.
   *
   * ```ts
   * let nnfb = new FormBuilder().nonNullable;
   * let name = nnfb.control('Alex'); // FormControl<string>
   * name.reset();
   * console.log(name); // 'Alex'
   * ```
   *
   * **Constructing non-nullable groups or arrays**
   *
   * When constructing a group or array, all automatically created inner controls will be
   * non-nullable, and will reset to their initial values.
   *
   * ```ts
   * let nnfb = new FormBuilder().nonNullable;
   * let name = nnfb.group({who: 'Alex'}); // FormGroup<{who: FormControl<string>}>
   * name.reset();
   * console.log(name); // {who: 'Alex'}
   * ```
   * **Constructing *nullable* fields on groups or arrays**
   *
   * It is still possible to have a nullable field. In particular, any `FormControl` which is
   * *already* constructed will not be altered. For example:
   *
   * ```ts
   * let nnfb = new FormBuilder().nonNullable;
   * // FormGroup<{who: FormControl<string|null>}>
   * let name = nnfb.group({who: new FormControl('Alex')});
   * name.reset(); console.log(name); // {who: null}
   * ```
   *
   * Because the inner control is constructed explicitly by the caller, the builder has
   * no control over how it is created, and cannot exclude the `null`.
   */
  get nonNullable() {
    const nnfb = new _FormBuilder();
    nnfb.useNonNullable = true;
    return nnfb;
  }
  group(controls, options = null) {
    const reducedControls = this._reduceControls(controls);
    let newOptions = {};
    if (isAbstractControlOptions(options)) {
      newOptions = options;
    } else if (options !== null) {
      newOptions.validators = options.validator;
      newOptions.asyncValidators = options.asyncValidator;
    }
    return new FormGroup(reducedControls, newOptions);
  }
  /**
   * @description
   * Constructs a new `FormRecord` instance. Accepts a single generic argument, which is an object
   * containing all the keys and corresponding inner control types.
   *
   * @param controls A collection of child controls. The key for each child is the name
   * under which it is registered.
   *
   * @param options Configuration options object for the `FormRecord`. The object should have the
   * `AbstractControlOptions` type and might contain the following fields:
   * * `validators`: A synchronous validator function, or an array of validator functions.
   * * `asyncValidators`: A single async validator or array of async validator functions.
   * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur'
   * | submit').
   */
  record(controls, options = null) {
    const reducedControls = this._reduceControls(controls);
    return new FormRecord(reducedControls, options);
  }
  /**
   * @description
   * Constructs a new `FormControl` with the given state, validators and options. Sets
   * `{nonNullable: true}` in the options to get a non-nullable control. Otherwise, the
   * control will be nullable. Accepts a single generic argument, which is the type  of the
   * control's value.
   *
   * @param formState Initializes the control with an initial state value, or
   * with an object that contains both a value and a disabled status.
   *
   * @param validatorOrOpts A synchronous validator function, or an array of
   * such functions, or a `FormControlOptions` object that contains
   * validation functions and a validation trigger.
   *
   * @param asyncValidator A single async validator or array of async validator
   * functions.
   *
   * @usageNotes
   *
   * ### Initialize a control as disabled
   *
   * The following example returns a control with an initial value in a disabled state.
   *
   * <code-example path="forms/ts/formBuilder/form_builder_example.ts" region="disabled-control">
   * </code-example>
   */
  control(formState, validatorOrOpts, asyncValidator) {
    let newOptions = {};
    if (!this.useNonNullable) {
      return new FormControl(formState, validatorOrOpts, asyncValidator);
    }
    if (isAbstractControlOptions(validatorOrOpts)) {
      newOptions = validatorOrOpts;
    } else {
      newOptions.validators = validatorOrOpts;
      newOptions.asyncValidators = asyncValidator;
    }
    return new FormControl(formState, __spreadProps(__spreadValues({}, newOptions), {
      nonNullable: true
    }));
  }
  /**
   * Constructs a new `FormArray` from the given array of configurations,
   * validators and options. Accepts a single generic argument, which is the type of each control
   * inside the array.
   *
   * @param controls An array of child controls or control configs. Each child control is given an
   *     index when it is registered.
   *
   * @param validatorOrOpts A synchronous validator function, or an array of such functions, or an
   *     `AbstractControlOptions` object that contains
   * validation functions and a validation trigger.
   *
   * @param asyncValidator A single async validator or array of async validator functions.
   */
  array(controls, validatorOrOpts, asyncValidator) {
    const createdControls = controls.map((c) => this._createControl(c));
    return new FormArray(createdControls, validatorOrOpts, asyncValidator);
  }
  /** @internal */
  _reduceControls(controls) {
    const createdControls = {};
    Object.keys(controls).forEach((controlName) => {
      createdControls[controlName] = this._createControl(controls[controlName]);
    });
    return createdControls;
  }
  /** @internal */
  _createControl(controls) {
    if (controls instanceof FormControl) {
      return controls;
    } else if (controls instanceof AbstractControl) {
      return controls;
    } else if (Array.isArray(controls)) {
      const value = controls[0];
      const validator = controls.length > 1 ? controls[1] : null;
      const asyncValidator = controls.length > 2 ? controls[2] : null;
      return this.control(value, validator, asyncValidator);
    } else {
      return this.control(controls);
    }
  }
};
_FormBuilder.\u0275fac = function FormBuilder_Factory(t) {
  return new (t || _FormBuilder)();
};
_FormBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FormBuilder,
  factory: _FormBuilder.\u0275fac,
  providedIn: "root"
});
var FormBuilder = _FormBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _NonNullableFormBuilder = class _NonNullableFormBuilder {
};
_NonNullableFormBuilder.\u0275fac = function NonNullableFormBuilder_Factory(t) {
  return new (t || _NonNullableFormBuilder)();
};
_NonNullableFormBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NonNullableFormBuilder,
  factory: () => (() => inject(FormBuilder).nonNullable)(),
  providedIn: "root"
});
var NonNullableFormBuilder = _NonNullableFormBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NonNullableFormBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      useFactory: () => inject(FormBuilder).nonNullable
    }]
  }], null, null);
})();
var _UntypedFormBuilder = class _UntypedFormBuilder extends FormBuilder {
  group(controlsConfig, options = null) {
    return super.group(controlsConfig, options);
  }
  /**
   * Like `FormBuilder#control`, except the resulting control is untyped.
   */
  control(formState, validatorOrOpts, asyncValidator) {
    return super.control(formState, validatorOrOpts, asyncValidator);
  }
  /**
   * Like `FormBuilder#array`, except the resulting array is untyped.
   */
  array(controlsConfig, validatorOrOpts, asyncValidator) {
    return super.array(controlsConfig, validatorOrOpts, asyncValidator);
  }
};
_UntypedFormBuilder.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275UntypedFormBuilder_BaseFactory;
  return function UntypedFormBuilder_Factory(t) {
    return (\u0275UntypedFormBuilder_BaseFactory || (\u0275UntypedFormBuilder_BaseFactory = \u0275\u0275getInheritedFactory(_UntypedFormBuilder)))(t || _UntypedFormBuilder);
  };
})();
_UntypedFormBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _UntypedFormBuilder,
  factory: _UntypedFormBuilder.\u0275fac,
  providedIn: "root"
});
var UntypedFormBuilder = _UntypedFormBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UntypedFormBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var VERSION4 = new Version("18.0.0-rc.1");
var _FormsModule = class _FormsModule {
  /**
   * @description
   * Provides options for configuring the forms module.
   *
   * @param opts An object of configuration options
   * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more
   * correct, or to only call it `whenDisabled`, which is the legacy behavior.
   */
  static withConfig(opts) {
    return {
      ngModule: _FormsModule,
      providers: [{
        provide: CALL_SET_DISABLED_STATE,
        useValue: opts.callSetDisabledState ?? setDisabledStateDefault
      }]
    };
  }
};
_FormsModule.\u0275fac = function FormsModule_Factory(t) {
  return new (t || _FormsModule)();
};
_FormsModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _FormsModule
});
_FormsModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [\u0275InternalFormsSharedModule]
});
var FormsModule = _FormsModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormsModule, [{
    type: NgModule,
    args: [{
      declarations: TEMPLATE_DRIVEN_DIRECTIVES,
      exports: [\u0275InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]
    }]
  }], null, null);
})();
var _ReactiveFormsModule = class _ReactiveFormsModule {
  /**
   * @description
   * Provides options for configuring the reactive forms module.
   *
   * @param opts An object of configuration options
   * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel`
   * binding is used with reactive form directives.
   * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more
   * correct, or to only call it `whenDisabled`, which is the legacy behavior.
   */
  static withConfig(opts) {
    return {
      ngModule: _ReactiveFormsModule,
      providers: [{
        provide: NG_MODEL_WITH_FORM_CONTROL_WARNING,
        useValue: opts.warnOnNgModelWithFormControl ?? "always"
      }, {
        provide: CALL_SET_DISABLED_STATE,
        useValue: opts.callSetDisabledState ?? setDisabledStateDefault
      }]
    };
  }
};
_ReactiveFormsModule.\u0275fac = function ReactiveFormsModule_Factory(t) {
  return new (t || _ReactiveFormsModule)();
};
_ReactiveFormsModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _ReactiveFormsModule
});
_ReactiveFormsModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [\u0275InternalFormsSharedModule]
});
var ReactiveFormsModule = _ReactiveFormsModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ReactiveFormsModule, [{
    type: NgModule,
    args: [{
      declarations: [REACTIVE_DRIVEN_DIRECTIVES],
      exports: [\u0275InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/bidi.mjs
var DIR_DOCUMENT = new InjectionToken("cdk-dir-doc", {
  providedIn: "root",
  factory: DIR_DOCUMENT_FACTORY
});
function DIR_DOCUMENT_FACTORY() {
  return inject(DOCUMENT2);
}
var RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;
function _resolveDirectionality(rawValue) {
  const value = rawValue?.toLowerCase() || "";
  if (value === "auto" && typeof navigator !== "undefined" && navigator?.language) {
    return RTL_LOCALE_PATTERN.test(navigator.language) ? "rtl" : "ltr";
  }
  return value === "rtl" ? "rtl" : "ltr";
}
var _Directionality = class _Directionality {
  constructor(_document2) {
    this.value = "ltr";
    this.change = new EventEmitter();
    if (_document2) {
      const bodyDir = _document2.body ? _document2.body.dir : null;
      const htmlDir = _document2.documentElement ? _document2.documentElement.dir : null;
      this.value = _resolveDirectionality(bodyDir || htmlDir || "ltr");
    }
  }
  ngOnDestroy() {
    this.change.complete();
  }
};
_Directionality.\u0275fac = function Directionality_Factory(t) {
  return new (t || _Directionality)(\u0275\u0275inject(DIR_DOCUMENT, 8));
};
_Directionality.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Directionality,
  factory: _Directionality.\u0275fac,
  providedIn: "root"
});
var Directionality = _Directionality;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Directionality, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DIR_DOCUMENT]
    }]
  }], null);
})();
var _Dir = class _Dir {
  constructor() {
    this._dir = "ltr";
    this._isInitialized = false;
    this.change = new EventEmitter();
  }
  /** @docs-private */
  get dir() {
    return this._dir;
  }
  set dir(value) {
    const previousValue = this._dir;
    this._dir = _resolveDirectionality(value);
    this._rawDir = value;
    if (previousValue !== this._dir && this._isInitialized) {
      this.change.emit(this._dir);
    }
  }
  /** Current layout direction of the element. */
  get value() {
    return this.dir;
  }
  /** Initialize once default value has been set. */
  ngAfterContentInit() {
    this._isInitialized = true;
  }
  ngOnDestroy() {
    this.change.complete();
  }
};
_Dir.\u0275fac = function Dir_Factory(t) {
  return new (t || _Dir)();
};
_Dir.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _Dir,
  selectors: [["", "dir", ""]],
  hostVars: 1,
  hostBindings: function Dir_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("dir", ctx._rawDir);
    }
  },
  inputs: {
    dir: "dir"
  },
  outputs: {
    change: "dirChange"
  },
  exportAs: ["dir"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: Directionality,
    useExisting: _Dir
  }])]
});
var Dir = _Dir;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Dir, [{
    type: Directive,
    args: [{
      selector: "[dir]",
      providers: [{
        provide: Directionality,
        useExisting: Dir
      }],
      host: {
        "[attr.dir]": "_rawDir"
      },
      exportAs: "dir",
      standalone: true
    }]
  }], null, {
    change: [{
      type: Output,
      args: ["dirChange"]
    }],
    dir: [{
      type: Input
    }]
  });
})();
var _BidiModule = class _BidiModule {
};
_BidiModule.\u0275fac = function BidiModule_Factory(t) {
  return new (t || _BidiModule)();
};
_BidiModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _BidiModule
});
_BidiModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var BidiModule = _BidiModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BidiModule, [{
    type: NgModule,
    args: [{
      imports: [Dir],
      exports: [Dir]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/platform.mjs
var hasV8BreakIterator;
try {
  hasV8BreakIterator = typeof Intl !== "undefined" && Intl.v8BreakIterator;
} catch {
  hasV8BreakIterator = false;
}
var _Platform = class _Platform {
  constructor(_platformId) {
    this._platformId = _platformId;
    this.isBrowser = this._platformId ? isPlatformBrowser2(this._platformId) : typeof document === "object" && !!document;
    this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);
    this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
    this.BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== "undefined" && !this.EDGE && !this.TRIDENT;
    this.WEBKIT = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
    this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window);
    this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
    this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;
    this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
  }
};
_Platform.\u0275fac = function Platform_Factory(t) {
  return new (t || _Platform)(\u0275\u0275inject(PLATFORM_ID));
};
_Platform.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Platform,
  factory: _Platform.\u0275fac,
  providedIn: "root"
});
var Platform = _Platform;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Platform, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Object,
    decorators: [{
      type: Inject,
      args: [PLATFORM_ID]
    }]
  }], null);
})();
var _PlatformModule = class _PlatformModule {
};
_PlatformModule.\u0275fac = function PlatformModule_Factory(t) {
  return new (t || _PlatformModule)();
};
_PlatformModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _PlatformModule
});
_PlatformModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var PlatformModule = _PlatformModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformModule, [{
    type: NgModule,
    args: [{}]
  }], null, null);
})();
var supportedInputTypes;
var candidateInputTypes = [
  // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after
  // first changing it to something else:
  // The specified value "" does not conform to the required format.
  // The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
  "color",
  "button",
  "checkbox",
  "date",
  "datetime-local",
  "email",
  "file",
  "hidden",
  "image",
  "month",
  "number",
  "password",
  "radio",
  "range",
  "reset",
  "search",
  "submit",
  "tel",
  "text",
  "time",
  "url",
  "week"
];
function getSupportedInputTypes() {
  if (supportedInputTypes) {
    return supportedInputTypes;
  }
  if (typeof document !== "object" || !document) {
    supportedInputTypes = new Set(candidateInputTypes);
    return supportedInputTypes;
  }
  let featureTestInput = document.createElement("input");
  supportedInputTypes = new Set(candidateInputTypes.filter((value) => {
    featureTestInput.setAttribute("type", value);
    return featureTestInput.type === value;
  }));
  return supportedInputTypes;
}
var supportsPassiveEvents;
function supportsPassiveEventListeners() {
  if (supportsPassiveEvents == null && typeof window !== "undefined") {
    try {
      window.addEventListener("test", null, Object.defineProperty({}, "passive", {
        get: () => supportsPassiveEvents = true
      }));
    } finally {
      supportsPassiveEvents = supportsPassiveEvents || false;
    }
  }
  return supportsPassiveEvents;
}
function normalizePassiveListenerOptions(options) {
  return supportsPassiveEventListeners() ? options : !!options.capture;
}
var RtlScrollAxisType;
(function(RtlScrollAxisType2) {
  RtlScrollAxisType2[RtlScrollAxisType2["NORMAL"] = 0] = "NORMAL";
  RtlScrollAxisType2[RtlScrollAxisType2["NEGATED"] = 1] = "NEGATED";
  RtlScrollAxisType2[RtlScrollAxisType2["INVERTED"] = 2] = "INVERTED";
})(RtlScrollAxisType || (RtlScrollAxisType = {}));
var rtlScrollAxisType;
var scrollBehaviorSupported;
function supportsScrollBehavior() {
  if (scrollBehaviorSupported == null) {
    if (typeof document !== "object" || !document || typeof Element !== "function" || !Element) {
      scrollBehaviorSupported = false;
      return scrollBehaviorSupported;
    }
    if ("scrollBehavior" in document.documentElement.style) {
      scrollBehaviorSupported = true;
    } else {
      const scrollToFunction = Element.prototype.scrollTo;
      if (scrollToFunction) {
        scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString());
      } else {
        scrollBehaviorSupported = false;
      }
    }
  }
  return scrollBehaviorSupported;
}
function getRtlScrollAxisType() {
  if (typeof document !== "object" || !document) {
    return RtlScrollAxisType.NORMAL;
  }
  if (rtlScrollAxisType == null) {
    const scrollContainer = document.createElement("div");
    const containerStyle = scrollContainer.style;
    scrollContainer.dir = "rtl";
    containerStyle.width = "1px";
    containerStyle.overflow = "auto";
    containerStyle.visibility = "hidden";
    containerStyle.pointerEvents = "none";
    containerStyle.position = "absolute";
    const content = document.createElement("div");
    const contentStyle = content.style;
    contentStyle.width = "2px";
    contentStyle.height = "1px";
    scrollContainer.appendChild(content);
    document.body.appendChild(scrollContainer);
    rtlScrollAxisType = RtlScrollAxisType.NORMAL;
    if (scrollContainer.scrollLeft === 0) {
      scrollContainer.scrollLeft = 1;
      rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;
    }
    scrollContainer.remove();
  }
  return rtlScrollAxisType;
}
var shadowDomIsSupported;
function _supportsShadowDom() {
  if (shadowDomIsSupported == null) {
    const head = typeof document !== "undefined" ? document.head : null;
    shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow));
  }
  return shadowDomIsSupported;
}
function _getShadowRoot(element) {
  if (_supportsShadowDom()) {
    const rootNode = element.getRootNode ? element.getRootNode() : null;
    if (typeof ShadowRoot !== "undefined" && ShadowRoot && rootNode instanceof ShadowRoot) {
      return rootNode;
    }
  }
  return null;
}
function _getFocusedElementPierceShadowDom() {
  let activeElement = typeof document !== "undefined" && document ? document.activeElement : null;
  while (activeElement && activeElement.shadowRoot) {
    const newActiveElement = activeElement.shadowRoot.activeElement;
    if (newActiveElement === activeElement) {
      break;
    } else {
      activeElement = newActiveElement;
    }
  }
  return activeElement;
}
function _getEventTarget(event) {
  return event.composedPath ? event.composedPath()[0] : event.target;
}
function _isTestEnvironment() {
  return (
    // @ts-ignore
    typeof __karma__ !== "undefined" && !!__karma__ || // @ts-ignore
    typeof jasmine !== "undefined" && !!jasmine || // @ts-ignore
    typeof jest !== "undefined" && !!jest || // @ts-ignore
    typeof Mocha !== "undefined" && !!Mocha
  );
}

// node_modules/@angular/cdk/fesm2022/observers/private.mjs
var loopLimitExceededErrorHandler = (e) => {
  if (e instanceof Error && e.message === "ResizeObserver loop limit exceeded") {
    console.error(`${e.message}. This could indicate a performance issue with your app. See https://github.com/WICG/resize-observer/blob/master/explainer.md#error-handling`);
  }
};
var SingleBoxSharedResizeObserver = class {
  constructor(_box) {
    this._box = _box;
    this._destroyed = new Subject();
    this._resizeSubject = new Subject();
    this._elementObservables = /* @__PURE__ */ new Map();
    if (typeof ResizeObserver !== "undefined") {
      this._resizeObserver = new ResizeObserver((entries) => this._resizeSubject.next(entries));
    }
  }
  /**
   * Gets a stream of resize events for the given element.
   * @param target The element to observe.
   * @return The stream of resize events for the element.
   */
  observe(target) {
    if (!this._elementObservables.has(target)) {
      this._elementObservables.set(target, new Observable((observer) => {
        const subscription = this._resizeSubject.subscribe(observer);
        this._resizeObserver?.observe(target, {
          box: this._box
        });
        return () => {
          this._resizeObserver?.unobserve(target);
          subscription.unsubscribe();
          this._elementObservables.delete(target);
        };
      }).pipe(
        filter((entries) => entries.some((entry) => entry.target === target)),
        // Share a replay of the last event so that subsequent calls to observe the same element
        // receive initial sizing info like the first one. Also enable ref counting so the
        // element will be automatically unobserved when there are no more subscriptions.
        shareReplay({
          bufferSize: 1,
          refCount: true
        }),
        takeUntil(this._destroyed)
      ));
    }
    return this._elementObservables.get(target);
  }
  /** Destroys this instance. */
  destroy() {
    this._destroyed.next();
    this._destroyed.complete();
    this._resizeSubject.complete();
    this._elementObservables.clear();
  }
};
var _SharedResizeObserver = class _SharedResizeObserver {
  constructor() {
    this._observers = /* @__PURE__ */ new Map();
    this._ngZone = inject(NgZone);
    if (typeof ResizeObserver !== "undefined" && (typeof ngDevMode === "undefined" || ngDevMode)) {
      this._ngZone.runOutsideAngular(() => {
        window.addEventListener("error", loopLimitExceededErrorHandler);
      });
    }
  }
  ngOnDestroy() {
    for (const [, observer] of this._observers) {
      observer.destroy();
    }
    this._observers.clear();
    if (typeof ResizeObserver !== "undefined" && (typeof ngDevMode === "undefined" || ngDevMode)) {
      window.removeEventListener("error", loopLimitExceededErrorHandler);
    }
  }
  /**
   * Gets a stream of resize events for the given target element and box type.
   * @param target The element to observe for resizes.
   * @param options Options to pass to the `ResizeObserver`
   * @return The stream of resize events for the element.
   */
  observe(target, options) {
    const box = options?.box || "content-box";
    if (!this._observers.has(box)) {
      this._observers.set(box, new SingleBoxSharedResizeObserver(box));
    }
    return this._observers.get(box).observe(target);
  }
};
_SharedResizeObserver.\u0275fac = function SharedResizeObserver_Factory(t) {
  return new (t || _SharedResizeObserver)();
};
_SharedResizeObserver.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _SharedResizeObserver,
  factory: _SharedResizeObserver.\u0275fac,
  providedIn: "root"
});
var SharedResizeObserver = _SharedResizeObserver;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedResizeObserver, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();

// node_modules/@angular/cdk/fesm2022/coercion.mjs
function coerceBooleanProperty(value) {
  return value != null && `${value}` !== "false";
}
function coerceNumberProperty(value, fallbackValue = 0) {
  return _isNumberValue(value) ? Number(value) : fallbackValue;
}
function _isNumberValue(value) {
  return !isNaN(parseFloat(value)) && !isNaN(Number(value));
}
function coerceArray(value) {
  return Array.isArray(value) ? value : [value];
}
function coerceCssPixelValue(value) {
  if (value == null) {
    return "";
  }
  return typeof value === "string" ? value : `${value}px`;
}
function coerceElement(elementOrRef) {
  return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
}

// node_modules/@angular/animations/fesm2022/animations.mjs
var AnimationMetadataType;
(function(AnimationMetadataType2) {
  AnimationMetadataType2[AnimationMetadataType2["State"] = 0] = "State";
  AnimationMetadataType2[AnimationMetadataType2["Transition"] = 1] = "Transition";
  AnimationMetadataType2[AnimationMetadataType2["Sequence"] = 2] = "Sequence";
  AnimationMetadataType2[AnimationMetadataType2["Group"] = 3] = "Group";
  AnimationMetadataType2[AnimationMetadataType2["Animate"] = 4] = "Animate";
  AnimationMetadataType2[AnimationMetadataType2["Keyframes"] = 5] = "Keyframes";
  AnimationMetadataType2[AnimationMetadataType2["Style"] = 6] = "Style";
  AnimationMetadataType2[AnimationMetadataType2["Trigger"] = 7] = "Trigger";
  AnimationMetadataType2[AnimationMetadataType2["Reference"] = 8] = "Reference";
  AnimationMetadataType2[AnimationMetadataType2["AnimateChild"] = 9] = "AnimateChild";
  AnimationMetadataType2[AnimationMetadataType2["AnimateRef"] = 10] = "AnimateRef";
  AnimationMetadataType2[AnimationMetadataType2["Query"] = 11] = "Query";
  AnimationMetadataType2[AnimationMetadataType2["Stagger"] = 12] = "Stagger";
})(AnimationMetadataType || (AnimationMetadataType = {}));
var AUTO_STYLE = "*";
function trigger(name, definitions) {
  return {
    type: AnimationMetadataType.Trigger,
    name,
    definitions,
    options: {}
  };
}
function animate(timings, styles = null) {
  return {
    type: AnimationMetadataType.Animate,
    styles,
    timings
  };
}
function group(steps, options = null) {
  return {
    type: AnimationMetadataType.Group,
    steps,
    options
  };
}
function sequence(steps, options = null) {
  return {
    type: AnimationMetadataType.Sequence,
    steps,
    options
  };
}
function style(tokens) {
  return {
    type: AnimationMetadataType.Style,
    styles: tokens,
    offset: null
  };
}
function state(name, styles, options) {
  return {
    type: AnimationMetadataType.State,
    name,
    styles,
    options
  };
}
function transition(stateChangeExpr, steps, options = null) {
  return {
    type: AnimationMetadataType.Transition,
    expr: stateChangeExpr,
    animation: steps,
    options
  };
}
var _AnimationBuilder = class _AnimationBuilder {
};
_AnimationBuilder.\u0275fac = function AnimationBuilder_Factory(t) {
  return new (t || _AnimationBuilder)();
};
_AnimationBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _AnimationBuilder,
  factory: () => (() => inject(BrowserAnimationBuilder))(),
  providedIn: "root"
});
var AnimationBuilder = _AnimationBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AnimationBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root",
      useFactory: () => inject(BrowserAnimationBuilder)
    }]
  }], null, null);
})();
var AnimationFactory = class {
};
var _BrowserAnimationBuilder = class _BrowserAnimationBuilder extends AnimationBuilder {
  constructor(rootRenderer, doc) {
    super();
    this.animationModuleType = inject(ANIMATION_MODULE_TYPE, {
      optional: true
    });
    this._nextAnimationId = 0;
    const typeData = {
      id: "0",
      encapsulation: ViewEncapsulation$1.None,
      styles: [],
      data: {
        animation: []
      }
    };
    this._renderer = rootRenderer.createRenderer(doc.body, typeData);
    if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) {
      throw new RuntimeError(3600, (typeof ngDevMode === "undefined" || ngDevMode) && "Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.");
    }
  }
  build(animation) {
    const id2 = this._nextAnimationId;
    this._nextAnimationId++;
    const entry = Array.isArray(animation) ? sequence(animation) : animation;
    issueAnimationCommand(this._renderer, null, id2, "register", [entry]);
    return new BrowserAnimationFactory(id2, this._renderer);
  }
};
_BrowserAnimationBuilder.\u0275fac = function BrowserAnimationBuilder_Factory(t) {
  return new (t || _BrowserAnimationBuilder)(\u0275\u0275inject(RendererFactory2), \u0275\u0275inject(DOCUMENT2));
};
_BrowserAnimationBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _BrowserAnimationBuilder,
  factory: _BrowserAnimationBuilder.\u0275fac,
  providedIn: "root"
});
var BrowserAnimationBuilder = _BrowserAnimationBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserAnimationBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: RendererFactory2
  }, {
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var BrowserAnimationFactory = class extends AnimationFactory {
  constructor(_id, _renderer) {
    super();
    this._id = _id;
    this._renderer = _renderer;
  }
  create(element, options) {
    return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);
  }
};
var RendererAnimationPlayer = class {
  constructor(id2, element, options, _renderer) {
    this.id = id2;
    this.element = element;
    this._renderer = _renderer;
    this.parentPlayer = null;
    this._started = false;
    this.totalTime = 0;
    this._command("create", options);
  }
  _listen(eventName, callback) {
    return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);
  }
  _command(command, ...args) {
    issueAnimationCommand(this._renderer, this.element, this.id, command, args);
  }
  onDone(fn) {
    this._listen("done", fn);
  }
  onStart(fn) {
    this._listen("start", fn);
  }
  onDestroy(fn) {
    this._listen("destroy", fn);
  }
  init() {
    this._command("init");
  }
  hasStarted() {
    return this._started;
  }
  play() {
    this._command("play");
    this._started = true;
  }
  pause() {
    this._command("pause");
  }
  restart() {
    this._command("restart");
  }
  finish() {
    this._command("finish");
  }
  destroy() {
    this._command("destroy");
  }
  reset() {
    this._command("reset");
    this._started = false;
  }
  setPosition(p) {
    this._command("setPosition", p);
  }
  getPosition() {
    return unwrapAnimationRenderer(this._renderer)?.engine?.players[this.id]?.getPosition() ?? 0;
  }
};
function issueAnimationCommand(renderer, element, id2, command, args) {
  renderer.setProperty(element, `@@${id2}:${command}`, args);
}
function unwrapAnimationRenderer(renderer) {
  const type = renderer.\u0275type;
  if (type === 0) {
    return renderer;
  } else if (type === 1) {
    return renderer.animationRenderer;
  }
  return null;
}
function isAnimationRenderer(renderer) {
  const type = renderer.\u0275type;
  return type === 0 || type === 1;
}
var NoopAnimationPlayer = class {
  constructor(duration = 0, delay2 = 0) {
    this._onDoneFns = [];
    this._onStartFns = [];
    this._onDestroyFns = [];
    this._originalOnDoneFns = [];
    this._originalOnStartFns = [];
    this._started = false;
    this._destroyed = false;
    this._finished = false;
    this._position = 0;
    this.parentPlayer = null;
    this.totalTime = duration + delay2;
  }
  _onFinish() {
    if (!this._finished) {
      this._finished = true;
      this._onDoneFns.forEach((fn) => fn());
      this._onDoneFns = [];
    }
  }
  onStart(fn) {
    this._originalOnStartFns.push(fn);
    this._onStartFns.push(fn);
  }
  onDone(fn) {
    this._originalOnDoneFns.push(fn);
    this._onDoneFns.push(fn);
  }
  onDestroy(fn) {
    this._onDestroyFns.push(fn);
  }
  hasStarted() {
    return this._started;
  }
  init() {
  }
  play() {
    if (!this.hasStarted()) {
      this._onStart();
      this.triggerMicrotask();
    }
    this._started = true;
  }
  /** @internal */
  triggerMicrotask() {
    queueMicrotask(() => this._onFinish());
  }
  _onStart() {
    this._onStartFns.forEach((fn) => fn());
    this._onStartFns = [];
  }
  pause() {
  }
  restart() {
  }
  finish() {
    this._onFinish();
  }
  destroy() {
    if (!this._destroyed) {
      this._destroyed = true;
      if (!this.hasStarted()) {
        this._onStart();
      }
      this.finish();
      this._onDestroyFns.forEach((fn) => fn());
      this._onDestroyFns = [];
    }
  }
  reset() {
    this._started = false;
    this._finished = false;
    this._onStartFns = this._originalOnStartFns;
    this._onDoneFns = this._originalOnDoneFns;
  }
  setPosition(position) {
    this._position = this.totalTime ? position * this.totalTime : 1;
  }
  getPosition() {
    return this.totalTime ? this._position / this.totalTime : 1;
  }
  /** @internal */
  triggerCallback(phaseName) {
    const methods = phaseName == "start" ? this._onStartFns : this._onDoneFns;
    methods.forEach((fn) => fn());
    methods.length = 0;
  }
};
var AnimationGroupPlayer = class {
  constructor(_players) {
    this._onDoneFns = [];
    this._onStartFns = [];
    this._finished = false;
    this._started = false;
    this._destroyed = false;
    this._onDestroyFns = [];
    this.parentPlayer = null;
    this.totalTime = 0;
    this.players = _players;
    let doneCount = 0;
    let destroyCount = 0;
    let startCount = 0;
    const total = this.players.length;
    if (total == 0) {
      queueMicrotask(() => this._onFinish());
    } else {
      this.players.forEach((player) => {
        player.onDone(() => {
          if (++doneCount == total) {
            this._onFinish();
          }
        });
        player.onDestroy(() => {
          if (++destroyCount == total) {
            this._onDestroy();
          }
        });
        player.onStart(() => {
          if (++startCount == total) {
            this._onStart();
          }
        });
      });
    }
    this.totalTime = this.players.reduce((time, player) => Math.max(time, player.totalTime), 0);
  }
  _onFinish() {
    if (!this._finished) {
      this._finished = true;
      this._onDoneFns.forEach((fn) => fn());
      this._onDoneFns = [];
    }
  }
  init() {
    this.players.forEach((player) => player.init());
  }
  onStart(fn) {
    this._onStartFns.push(fn);
  }
  _onStart() {
    if (!this.hasStarted()) {
      this._started = true;
      this._onStartFns.forEach((fn) => fn());
      this._onStartFns = [];
    }
  }
  onDone(fn) {
    this._onDoneFns.push(fn);
  }
  onDestroy(fn) {
    this._onDestroyFns.push(fn);
  }
  hasStarted() {
    return this._started;
  }
  play() {
    if (!this.parentPlayer) {
      this.init();
    }
    this._onStart();
    this.players.forEach((player) => player.play());
  }
  pause() {
    this.players.forEach((player) => player.pause());
  }
  restart() {
    this.players.forEach((player) => player.restart());
  }
  finish() {
    this._onFinish();
    this.players.forEach((player) => player.finish());
  }
  destroy() {
    this._onDestroy();
  }
  _onDestroy() {
    if (!this._destroyed) {
      this._destroyed = true;
      this._onFinish();
      this.players.forEach((player) => player.destroy());
      this._onDestroyFns.forEach((fn) => fn());
      this._onDestroyFns = [];
    }
  }
  reset() {
    this.players.forEach((player) => player.reset());
    this._destroyed = false;
    this._finished = false;
    this._started = false;
  }
  setPosition(p) {
    const timeAtPosition = p * this.totalTime;
    this.players.forEach((player) => {
      const position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;
      player.setPosition(position);
    });
  }
  getPosition() {
    const longestPlayer = this.players.reduce((longestSoFar, player) => {
      const newPlayerIsLongest = longestSoFar === null || player.totalTime > longestSoFar.totalTime;
      return newPlayerIsLongest ? player : longestSoFar;
    }, null);
    return longestPlayer != null ? longestPlayer.getPosition() : 0;
  }
  beforeDestroy() {
    this.players.forEach((player) => {
      if (player.beforeDestroy) {
        player.beforeDestroy();
      }
    });
  }
  /** @internal */
  triggerCallback(phaseName) {
    const methods = phaseName == "start" ? this._onStartFns : this._onDoneFns;
    methods.forEach((fn) => fn());
    methods.length = 0;
  }
};
var \u0275PRE_STYLE = "!";

// node_modules/@angular/cdk/fesm2022/observers.mjs
function shouldIgnoreRecord(record) {
  if (record.type === "characterData" && record.target instanceof Comment) {
    return true;
  }
  if (record.type === "childList") {
    for (let i2 = 0; i2 < record.addedNodes.length; i2++) {
      if (!(record.addedNodes[i2] instanceof Comment)) {
        return false;
      }
    }
    for (let i2 = 0; i2 < record.removedNodes.length; i2++) {
      if (!(record.removedNodes[i2] instanceof Comment)) {
        return false;
      }
    }
    return true;
  }
  return false;
}
var _MutationObserverFactory = class _MutationObserverFactory {
  create(callback) {
    return typeof MutationObserver === "undefined" ? null : new MutationObserver(callback);
  }
};
_MutationObserverFactory.\u0275fac = function MutationObserverFactory_Factory(t) {
  return new (t || _MutationObserverFactory)();
};
_MutationObserverFactory.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _MutationObserverFactory,
  factory: _MutationObserverFactory.\u0275fac,
  providedIn: "root"
});
var MutationObserverFactory = _MutationObserverFactory;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MutationObserverFactory, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _ContentObserver = class _ContentObserver {
  constructor(_mutationObserverFactory) {
    this._mutationObserverFactory = _mutationObserverFactory;
    this._observedElements = /* @__PURE__ */ new Map();
    this._ngZone = inject(NgZone);
  }
  ngOnDestroy() {
    this._observedElements.forEach((_, element) => this._cleanupObserver(element));
  }
  observe(elementOrRef) {
    const element = coerceElement(elementOrRef);
    return new Observable((observer) => {
      const stream = this._observeElement(element);
      const subscription = stream.pipe(map((records) => records.filter((record) => !shouldIgnoreRecord(record))), filter((records) => !!records.length)).subscribe((records) => {
        this._ngZone.run(() => {
          observer.next(records);
        });
      });
      return () => {
        subscription.unsubscribe();
        this._unobserveElement(element);
      };
    });
  }
  /**
   * Observes the given element by using the existing MutationObserver if available, or creating a
   * new one if not.
   */
  _observeElement(element) {
    return this._ngZone.runOutsideAngular(() => {
      if (!this._observedElements.has(element)) {
        const stream = new Subject();
        const observer = this._mutationObserverFactory.create((mutations) => stream.next(mutations));
        if (observer) {
          observer.observe(element, {
            characterData: true,
            childList: true,
            subtree: true
          });
        }
        this._observedElements.set(element, {
          observer,
          stream,
          count: 1
        });
      } else {
        this._observedElements.get(element).count++;
      }
      return this._observedElements.get(element).stream;
    });
  }
  /**
   * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
   * observing this element.
   */
  _unobserveElement(element) {
    if (this._observedElements.has(element)) {
      this._observedElements.get(element).count--;
      if (!this._observedElements.get(element).count) {
        this._cleanupObserver(element);
      }
    }
  }
  /** Clean up the underlying MutationObserver for the specified element. */
  _cleanupObserver(element) {
    if (this._observedElements.has(element)) {
      const {
        observer,
        stream
      } = this._observedElements.get(element);
      if (observer) {
        observer.disconnect();
      }
      stream.complete();
      this._observedElements.delete(element);
    }
  }
};
_ContentObserver.\u0275fac = function ContentObserver_Factory(t) {
  return new (t || _ContentObserver)(\u0275\u0275inject(MutationObserverFactory));
};
_ContentObserver.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ContentObserver,
  factory: _ContentObserver.\u0275fac,
  providedIn: "root"
});
var ContentObserver = _ContentObserver;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ContentObserver, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: MutationObserverFactory
  }], null);
})();
var _CdkObserveContent = class _CdkObserveContent {
  /**
   * Whether observing content is disabled. This option can be used
   * to disconnect the underlying MutationObserver until it is needed.
   */
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    this._disabled = value;
    this._disabled ? this._unsubscribe() : this._subscribe();
  }
  /** Debounce interval for emitting the changes. */
  get debounce() {
    return this._debounce;
  }
  set debounce(value) {
    this._debounce = coerceNumberProperty(value);
    this._subscribe();
  }
  constructor(_contentObserver, _elementRef) {
    this._contentObserver = _contentObserver;
    this._elementRef = _elementRef;
    this.event = new EventEmitter();
    this._disabled = false;
    this._currentSubscription = null;
  }
  ngAfterContentInit() {
    if (!this._currentSubscription && !this.disabled) {
      this._subscribe();
    }
  }
  ngOnDestroy() {
    this._unsubscribe();
  }
  _subscribe() {
    this._unsubscribe();
    const stream = this._contentObserver.observe(this._elementRef);
    this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
  }
  _unsubscribe() {
    this._currentSubscription?.unsubscribe();
  }
};
_CdkObserveContent.\u0275fac = function CdkObserveContent_Factory(t) {
  return new (t || _CdkObserveContent)(\u0275\u0275directiveInject(ContentObserver), \u0275\u0275directiveInject(ElementRef));
};
_CdkObserveContent.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkObserveContent,
  selectors: [["", "cdkObserveContent", ""]],
  inputs: {
    disabled: [2, "cdkObserveContentDisabled", "disabled", booleanAttribute],
    debounce: "debounce"
  },
  outputs: {
    event: "cdkObserveContent"
  },
  exportAs: ["cdkObserveContent"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature]
});
var CdkObserveContent = _CdkObserveContent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkObserveContent, [{
    type: Directive,
    args: [{
      selector: "[cdkObserveContent]",
      exportAs: "cdkObserveContent",
      standalone: true
    }]
  }], () => [{
    type: ContentObserver
  }, {
    type: ElementRef
  }], {
    event: [{
      type: Output,
      args: ["cdkObserveContent"]
    }],
    disabled: [{
      type: Input,
      args: [{
        alias: "cdkObserveContentDisabled",
        transform: booleanAttribute
      }]
    }],
    debounce: [{
      type: Input
    }]
  });
})();
var _ObserversModule = class _ObserversModule {
};
_ObserversModule.\u0275fac = function ObserversModule_Factory(t) {
  return new (t || _ObserversModule)();
};
_ObserversModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _ObserversModule
});
_ObserversModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [MutationObserverFactory]
});
var ObserversModule = _ObserversModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ObserversModule, [{
    type: NgModule,
    args: [{
      imports: [CdkObserveContent],
      exports: [CdkObserveContent],
      providers: [MutationObserverFactory]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/keycodes.mjs
var TAB = 9;
var ENTER = 13;
var SHIFT = 16;
var CONTROL = 17;
var ALT = 18;
var ESCAPE = 27;
var SPACE = 32;
var PAGE_UP = 33;
var PAGE_DOWN = 34;
var END = 35;
var HOME = 36;
var LEFT_ARROW = 37;
var UP_ARROW = 38;
var RIGHT_ARROW = 39;
var DOWN_ARROW = 40;
var ZERO = 48;
var NINE = 57;
var A = 65;
var Z = 90;
var META = 91;
var MAC_META = 224;
function hasModifierKey(event, ...modifiers) {
  if (modifiers.length) {
    return modifiers.some((modifier) => event[modifier]);
  }
  return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;
}

// node_modules/@angular/cdk/fesm2022/layout.mjs
var _LayoutModule = class _LayoutModule {
};
_LayoutModule.\u0275fac = function LayoutModule_Factory(t) {
  return new (t || _LayoutModule)();
};
_LayoutModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _LayoutModule
});
_LayoutModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var LayoutModule = _LayoutModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LayoutModule, [{
    type: NgModule,
    args: [{}]
  }], null, null);
})();
var mediaQueriesForWebkitCompatibility = /* @__PURE__ */ new Set();
var mediaQueryStyleNode;
var _MediaMatcher = class _MediaMatcher {
  constructor(_platform, _nonce) {
    this._platform = _platform;
    this._nonce = _nonce;
    this._matchMedia = this._platform.isBrowser && window.matchMedia ? (
      // matchMedia is bound to the window scope intentionally as it is an illegal invocation to
      // call it from a different scope.
      window.matchMedia.bind(window)
    ) : noopMatchMedia;
  }
  /**
   * Evaluates the given media query and returns the native MediaQueryList from which results
   * can be retrieved.
   * Confirms the layout engine will trigger for the selector query provided and returns the
   * MediaQueryList for the query provided.
   */
  matchMedia(query) {
    if (this._platform.WEBKIT || this._platform.BLINK) {
      createEmptyStyleRule(query, this._nonce);
    }
    return this._matchMedia(query);
  }
};
_MediaMatcher.\u0275fac = function MediaMatcher_Factory(t) {
  return new (t || _MediaMatcher)(\u0275\u0275inject(Platform), \u0275\u0275inject(CSP_NONCE, 8));
};
_MediaMatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _MediaMatcher,
  factory: _MediaMatcher.\u0275fac,
  providedIn: "root"
});
var MediaMatcher = _MediaMatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MediaMatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [CSP_NONCE]
    }]
  }], null);
})();
function createEmptyStyleRule(query, nonce) {
  if (mediaQueriesForWebkitCompatibility.has(query)) {
    return;
  }
  try {
    if (!mediaQueryStyleNode) {
      mediaQueryStyleNode = document.createElement("style");
      if (nonce) {
        mediaQueryStyleNode.setAttribute("nonce", nonce);
      }
      mediaQueryStyleNode.setAttribute("type", "text/css");
      document.head.appendChild(mediaQueryStyleNode);
    }
    if (mediaQueryStyleNode.sheet) {
      mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
      mediaQueriesForWebkitCompatibility.add(query);
    }
  } catch (e) {
    console.error(e);
  }
}
function noopMatchMedia(query) {
  return {
    matches: query === "all" || query === "",
    media: query,
    addListener: () => {
    },
    removeListener: () => {
    }
  };
}
var _BreakpointObserver = class _BreakpointObserver {
  constructor(_mediaMatcher, _zone) {
    this._mediaMatcher = _mediaMatcher;
    this._zone = _zone;
    this._queries = /* @__PURE__ */ new Map();
    this._destroySubject = new Subject();
  }
  /** Completes the active subject, signalling to all other observables to complete. */
  ngOnDestroy() {
    this._destroySubject.next();
    this._destroySubject.complete();
  }
  /**
   * Whether one or more media queries match the current viewport size.
   * @param value One or more media queries to check.
   * @returns Whether any of the media queries match.
   */
  isMatched(value) {
    const queries = splitQueries(coerceArray(value));
    return queries.some((mediaQuery) => this._registerQuery(mediaQuery).mql.matches);
  }
  /**
   * Gets an observable of results for the given queries that will emit new results for any changes
   * in matching of the given queries.
   * @param value One or more media queries to check.
   * @returns A stream of matches for the given queries.
   */
  observe(value) {
    const queries = splitQueries(coerceArray(value));
    const observables = queries.map((query) => this._registerQuery(query).observable);
    let stateObservable = combineLatest(observables);
    stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0)));
    return stateObservable.pipe(map((breakpointStates) => {
      const response = {
        matches: false,
        breakpoints: {}
      };
      breakpointStates.forEach(({
        matches,
        query
      }) => {
        response.matches = response.matches || matches;
        response.breakpoints[query] = matches;
      });
      return response;
    }));
  }
  /** Registers a specific query to be listened for. */
  _registerQuery(query) {
    if (this._queries.has(query)) {
      return this._queries.get(query);
    }
    const mql = this._mediaMatcher.matchMedia(query);
    const queryObservable = new Observable((observer) => {
      const handler = (e) => this._zone.run(() => observer.next(e));
      mql.addListener(handler);
      return () => {
        mql.removeListener(handler);
      };
    }).pipe(startWith(mql), map(({
      matches
    }) => ({
      query,
      matches
    })), takeUntil(this._destroySubject));
    const output = {
      observable: queryObservable,
      mql
    };
    this._queries.set(query, output);
    return output;
  }
};
_BreakpointObserver.\u0275fac = function BreakpointObserver_Factory(t) {
  return new (t || _BreakpointObserver)(\u0275\u0275inject(MediaMatcher), \u0275\u0275inject(NgZone));
};
_BreakpointObserver.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _BreakpointObserver,
  factory: _BreakpointObserver.\u0275fac,
  providedIn: "root"
});
var BreakpointObserver = _BreakpointObserver;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BreakpointObserver, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: MediaMatcher
  }, {
    type: NgZone
  }], null);
})();
function splitQueries(queries) {
  return queries.map((query) => query.split(",")).reduce((a1, a2) => a1.concat(a2)).map((query) => query.trim());
}

// node_modules/@angular/cdk/fesm2022/a11y.mjs
var ID_DELIMITER = " ";
function addAriaReferencedId(el, attr, id2) {
  const ids = getAriaReferenceIds(el, attr);
  id2 = id2.trim();
  if (ids.some((existingId) => existingId.trim() === id2)) {
    return;
  }
  ids.push(id2);
  el.setAttribute(attr, ids.join(ID_DELIMITER));
}
function removeAriaReferencedId(el, attr, id2) {
  const ids = getAriaReferenceIds(el, attr);
  id2 = id2.trim();
  const filteredIds = ids.filter((val) => val !== id2);
  if (filteredIds.length) {
    el.setAttribute(attr, filteredIds.join(ID_DELIMITER));
  } else {
    el.removeAttribute(attr);
  }
}
function getAriaReferenceIds(el, attr) {
  const attrValue = el.getAttribute(attr);
  return attrValue?.match(/\S+/g) ?? [];
}
var CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
var CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host";
var nextId = 0;
var _AriaDescriber = class _AriaDescriber {
  constructor(_document2, _platform) {
    this._platform = _platform;
    this._messageRegistry = /* @__PURE__ */ new Map();
    this._messagesContainer = null;
    this._id = `${nextId++}`;
    this._document = _document2;
    this._id = inject(APP_ID) + "-" + nextId++;
  }
  describe(hostElement, message, role) {
    if (!this._canBeDescribed(hostElement, message)) {
      return;
    }
    const key = getKey(message, role);
    if (typeof message !== "string") {
      setMessageId(message, this._id);
      this._messageRegistry.set(key, {
        messageElement: message,
        referenceCount: 0
      });
    } else if (!this._messageRegistry.has(key)) {
      this._createMessageElement(message, role);
    }
    if (!this._isElementDescribedByMessage(hostElement, key)) {
      this._addMessageReference(hostElement, key);
    }
  }
  removeDescription(hostElement, message, role) {
    if (!message || !this._isElementNode(hostElement)) {
      return;
    }
    const key = getKey(message, role);
    if (this._isElementDescribedByMessage(hostElement, key)) {
      this._removeMessageReference(hostElement, key);
    }
    if (typeof message === "string") {
      const registeredMessage = this._messageRegistry.get(key);
      if (registeredMessage && registeredMessage.referenceCount === 0) {
        this._deleteMessageElement(key);
      }
    }
    if (this._messagesContainer?.childNodes.length === 0) {
      this._messagesContainer.remove();
      this._messagesContainer = null;
    }
  }
  /** Unregisters all created message elements and removes the message container. */
  ngOnDestroy() {
    const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`);
    for (let i2 = 0; i2 < describedElements.length; i2++) {
      this._removeCdkDescribedByReferenceIds(describedElements[i2]);
      describedElements[i2].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
    }
    this._messagesContainer?.remove();
    this._messagesContainer = null;
    this._messageRegistry.clear();
  }
  /**
   * Creates a new element in the visually hidden message container element with the message
   * as its content and adds it to the message registry.
   */
  _createMessageElement(message, role) {
    const messageElement = this._document.createElement("div");
    setMessageId(messageElement, this._id);
    messageElement.textContent = message;
    if (role) {
      messageElement.setAttribute("role", role);
    }
    this._createMessagesContainer();
    this._messagesContainer.appendChild(messageElement);
    this._messageRegistry.set(getKey(message, role), {
      messageElement,
      referenceCount: 0
    });
  }
  /** Deletes the message element from the global messages container. */
  _deleteMessageElement(key) {
    this._messageRegistry.get(key)?.messageElement?.remove();
    this._messageRegistry.delete(key);
  }
  /** Creates the global container for all aria-describedby messages. */
  _createMessagesContainer() {
    if (this._messagesContainer) {
      return;
    }
    const containerClassName = "cdk-describedby-message-container";
    const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`);
    for (let i2 = 0; i2 < serverContainers.length; i2++) {
      serverContainers[i2].remove();
    }
    const messagesContainer = this._document.createElement("div");
    messagesContainer.style.visibility = "hidden";
    messagesContainer.classList.add(containerClassName);
    messagesContainer.classList.add("cdk-visually-hidden");
    if (this._platform && !this._platform.isBrowser) {
      messagesContainer.setAttribute("platform", "server");
    }
    this._document.body.appendChild(messagesContainer);
    this._messagesContainer = messagesContainer;
  }
  /** Removes all cdk-describedby messages that are hosted through the element. */
  _removeCdkDescribedByReferenceIds(element) {
    const originalReferenceIds = getAriaReferenceIds(element, "aria-describedby").filter((id2) => id2.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0);
    element.setAttribute("aria-describedby", originalReferenceIds.join(" "));
  }
  /**
   * Adds a message reference to the element using aria-describedby and increments the registered
   * message's reference count.
   */
  _addMessageReference(element, key) {
    const registeredMessage = this._messageRegistry.get(key);
    addAriaReferencedId(element, "aria-describedby", registeredMessage.messageElement.id);
    element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);
    registeredMessage.referenceCount++;
  }
  /**
   * Removes a message reference from the element using aria-describedby
   * and decrements the registered message's reference count.
   */
  _removeMessageReference(element, key) {
    const registeredMessage = this._messageRegistry.get(key);
    registeredMessage.referenceCount--;
    removeAriaReferencedId(element, "aria-describedby", registeredMessage.messageElement.id);
    element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
  }
  /** Returns true if the element has been described by the provided message ID. */
  _isElementDescribedByMessage(element, key) {
    const referenceIds = getAriaReferenceIds(element, "aria-describedby");
    const registeredMessage = this._messageRegistry.get(key);
    const messageId = registeredMessage && registeredMessage.messageElement.id;
    return !!messageId && referenceIds.indexOf(messageId) != -1;
  }
  /** Determines whether a message can be described on a particular element. */
  _canBeDescribed(element, message) {
    if (!this._isElementNode(element)) {
      return false;
    }
    if (message && typeof message === "object") {
      return true;
    }
    const trimmedMessage = message == null ? "" : `${message}`.trim();
    const ariaLabel = element.getAttribute("aria-label");
    return trimmedMessage ? !ariaLabel || ariaLabel.trim() !== trimmedMessage : false;
  }
  /** Checks whether a node is an Element node. */
  _isElementNode(element) {
    return element.nodeType === this._document.ELEMENT_NODE;
  }
};
_AriaDescriber.\u0275fac = function AriaDescriber_Factory(t) {
  return new (t || _AriaDescriber)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Platform));
};
_AriaDescriber.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _AriaDescriber,
  factory: _AriaDescriber.\u0275fac,
  providedIn: "root"
});
var AriaDescriber = _AriaDescriber;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AriaDescriber, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Platform
  }], null);
})();
function getKey(message, role) {
  return typeof message === "string" ? `${role || ""}/${message}` : message;
}
function setMessageId(element, serviceId) {
  if (!element.id) {
    element.id = `${CDK_DESCRIBEDBY_ID_PREFIX}-${serviceId}-${nextId++}`;
  }
}
var ListKeyManager = class {
  constructor(_items, injector) {
    this._items = _items;
    this._activeItemIndex = -1;
    this._activeItem = null;
    this._wrap = false;
    this._letterKeyStream = new Subject();
    this._typeaheadSubscription = Subscription.EMPTY;
    this._vertical = true;
    this._allowedModifierKeys = [];
    this._homeAndEnd = false;
    this._pageUpAndDown = {
      enabled: false,
      delta: 10
    };
    this._skipPredicateFn = (item) => item.disabled;
    this._pressedLetters = [];
    this.tabOut = new Subject();
    this.change = new Subject();
    if (_items instanceof QueryList) {
      this._itemChangesSubscription = _items.changes.subscribe((newItems) => this._itemsChanged(newItems.toArray()));
    } else if (isSignal(_items)) {
      if (!injector && (typeof ngDevMode === "undefined" || ngDevMode)) {
        throw new Error("ListKeyManager constructed with a signal must receive an injector");
      }
      this._effectRef = effect(() => this._itemsChanged(_items()), {
        injector
      });
    }
  }
  /**
   * Sets the predicate function that determines which items should be skipped by the
   * list key manager.
   * @param predicate Function that determines whether the given item should be skipped.
   */
  skipPredicate(predicate) {
    this._skipPredicateFn = predicate;
    return this;
  }
  /**
   * Configures wrapping mode, which determines whether the active item will wrap to
   * the other end of list when there are no more items in the given direction.
   * @param shouldWrap Whether the list should wrap when reaching the end.
   */
  withWrap(shouldWrap = true) {
    this._wrap = shouldWrap;
    return this;
  }
  /**
   * Configures whether the key manager should be able to move the selection vertically.
   * @param enabled Whether vertical selection should be enabled.
   */
  withVerticalOrientation(enabled = true) {
    this._vertical = enabled;
    return this;
  }
  /**
   * Configures the key manager to move the selection horizontally.
   * Passing in `null` will disable horizontal movement.
   * @param direction Direction in which the selection can be moved.
   */
  withHorizontalOrientation(direction) {
    this._horizontal = direction;
    return this;
  }
  /**
   * Modifier keys which are allowed to be held down and whose default actions will be prevented
   * as the user is pressing the arrow keys. Defaults to not allowing any modifier keys.
   */
  withAllowedModifierKeys(keys) {
    this._allowedModifierKeys = keys;
    return this;
  }
  /**
   * Turns on typeahead mode which allows users to set the active item by typing.
   * @param debounceInterval Time to wait after the last keystroke before setting the active item.
   */
  withTypeAhead(debounceInterval = 200) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      const items = this._getItemsArray();
      if (items.length > 0 && items.some((item) => typeof item.getLabel !== "function")) {
        throw Error("ListKeyManager items in typeahead mode must implement the `getLabel` method.");
      }
    }
    this._typeaheadSubscription.unsubscribe();
    this._typeaheadSubscription = this._letterKeyStream.pipe(tap((letter) => this._pressedLetters.push(letter)), debounceTime(debounceInterval), filter(() => this._pressedLetters.length > 0), map(() => this._pressedLetters.join(""))).subscribe((inputString) => {
      const items = this._getItemsArray();
      for (let i2 = 1; i2 < items.length + 1; i2++) {
        const index = (this._activeItemIndex + i2) % items.length;
        const item = items[index];
        if (!this._skipPredicateFn(item) && item.getLabel().toUpperCase().trim().indexOf(inputString) === 0) {
          this.setActiveItem(index);
          break;
        }
      }
      this._pressedLetters = [];
    });
    return this;
  }
  /** Cancels the current typeahead sequence. */
  cancelTypeahead() {
    this._pressedLetters = [];
    return this;
  }
  /**
   * Configures the key manager to activate the first and last items
   * respectively when the Home or End key is pressed.
   * @param enabled Whether pressing the Home or End key activates the first/last item.
   */
  withHomeAndEnd(enabled = true) {
    this._homeAndEnd = enabled;
    return this;
  }
  /**
   * Configures the key manager to activate every 10th, configured or first/last element in up/down direction
   * respectively when the Page-Up or Page-Down key is pressed.
   * @param enabled Whether pressing the Page-Up or Page-Down key activates the first/last item.
   * @param delta Whether pressing the Home or End key activates the first/last item.
   */
  withPageUpDown(enabled = true, delta = 10) {
    this._pageUpAndDown = {
      enabled,
      delta
    };
    return this;
  }
  setActiveItem(item) {
    const previousActiveItem = this._activeItem;
    this.updateActiveItem(item);
    if (this._activeItem !== previousActiveItem) {
      this.change.next(this._activeItemIndex);
    }
  }
  /**
   * Sets the active item depending on the key event passed in.
   * @param event Keyboard event to be used for determining which element should be active.
   */
  onKeydown(event) {
    const keyCode = event.keyCode;
    const modifiers = ["altKey", "ctrlKey", "metaKey", "shiftKey"];
    const isModifierAllowed = modifiers.every((modifier) => {
      return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;
    });
    switch (keyCode) {
      case TAB:
        this.tabOut.next();
        return;
      case DOWN_ARROW:
        if (this._vertical && isModifierAllowed) {
          this.setNextItemActive();
          break;
        } else {
          return;
        }
      case UP_ARROW:
        if (this._vertical && isModifierAllowed) {
          this.setPreviousItemActive();
          break;
        } else {
          return;
        }
      case RIGHT_ARROW:
        if (this._horizontal && isModifierAllowed) {
          this._horizontal === "rtl" ? this.setPreviousItemActive() : this.setNextItemActive();
          break;
        } else {
          return;
        }
      case LEFT_ARROW:
        if (this._horizontal && isModifierAllowed) {
          this._horizontal === "rtl" ? this.setNextItemActive() : this.setPreviousItemActive();
          break;
        } else {
          return;
        }
      case HOME:
        if (this._homeAndEnd && isModifierAllowed) {
          this.setFirstItemActive();
          break;
        } else {
          return;
        }
      case END:
        if (this._homeAndEnd && isModifierAllowed) {
          this.setLastItemActive();
          break;
        } else {
          return;
        }
      case PAGE_UP:
        if (this._pageUpAndDown.enabled && isModifierAllowed) {
          const targetIndex = this._activeItemIndex - this._pageUpAndDown.delta;
          this._setActiveItemByIndex(targetIndex > 0 ? targetIndex : 0, 1);
          break;
        } else {
          return;
        }
      case PAGE_DOWN:
        if (this._pageUpAndDown.enabled && isModifierAllowed) {
          const targetIndex = this._activeItemIndex + this._pageUpAndDown.delta;
          const itemsLength = this._getItemsArray().length;
          this._setActiveItemByIndex(targetIndex < itemsLength ? targetIndex : itemsLength - 1, -1);
          break;
        } else {
          return;
        }
      default:
        if (isModifierAllowed || hasModifierKey(event, "shiftKey")) {
          if (event.key && event.key.length === 1) {
            this._letterKeyStream.next(event.key.toLocaleUpperCase());
          } else if (keyCode >= A && keyCode <= Z || keyCode >= ZERO && keyCode <= NINE) {
            this._letterKeyStream.next(String.fromCharCode(keyCode));
          }
        }
        return;
    }
    this._pressedLetters = [];
    event.preventDefault();
  }
  /** Index of the currently active item. */
  get activeItemIndex() {
    return this._activeItemIndex;
  }
  /** The active item. */
  get activeItem() {
    return this._activeItem;
  }
  /** Gets whether the user is currently typing into the manager using the typeahead feature. */
  isTyping() {
    return this._pressedLetters.length > 0;
  }
  /** Sets the active item to the first enabled item in the list. */
  setFirstItemActive() {
    this._setActiveItemByIndex(0, 1);
  }
  /** Sets the active item to the last enabled item in the list. */
  setLastItemActive() {
    this._setActiveItemByIndex(this._getItemsArray().length - 1, -1);
  }
  /** Sets the active item to the next enabled item in the list. */
  setNextItemActive() {
    this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);
  }
  /** Sets the active item to a previous enabled item in the list. */
  setPreviousItemActive() {
    this._activeItemIndex < 0 && this._wrap ? this.setLastItemActive() : this._setActiveItemByDelta(-1);
  }
  updateActiveItem(item) {
    const itemArray = this._getItemsArray();
    const index = typeof item === "number" ? item : itemArray.indexOf(item);
    const activeItem = itemArray[index];
    this._activeItem = activeItem == null ? null : activeItem;
    this._activeItemIndex = index;
  }
  /** Cleans up the key manager. */
  destroy() {
    this._typeaheadSubscription.unsubscribe();
    this._itemChangesSubscription?.unsubscribe();
    this._effectRef?.destroy();
    this._letterKeyStream.complete();
    this.tabOut.complete();
    this.change.complete();
    this._pressedLetters = [];
  }
  /**
   * This method sets the active item, given a list of items and the delta between the
   * currently active item and the new active item. It will calculate differently
   * depending on whether wrap mode is turned on.
   */
  _setActiveItemByDelta(delta) {
    this._wrap ? this._setActiveInWrapMode(delta) : this._setActiveInDefaultMode(delta);
  }
  /**
   * Sets the active item properly given "wrap" mode. In other words, it will continue to move
   * down the list until it finds an item that is not disabled, and it will wrap if it
   * encounters either end of the list.
   */
  _setActiveInWrapMode(delta) {
    const items = this._getItemsArray();
    for (let i2 = 1; i2 <= items.length; i2++) {
      const index = (this._activeItemIndex + delta * i2 + items.length) % items.length;
      const item = items[index];
      if (!this._skipPredicateFn(item)) {
        this.setActiveItem(index);
        return;
      }
    }
  }
  /**
   * Sets the active item properly given the default mode. In other words, it will
   * continue to move down the list until it finds an item that is not disabled. If
   * it encounters either end of the list, it will stop and not wrap.
   */
  _setActiveInDefaultMode(delta) {
    this._setActiveItemByIndex(this._activeItemIndex + delta, delta);
  }
  /**
   * Sets the active item to the first enabled item starting at the index specified. If the
   * item is disabled, it will move in the fallbackDelta direction until it either
   * finds an enabled item or encounters the end of the list.
   */
  _setActiveItemByIndex(index, fallbackDelta) {
    const items = this._getItemsArray();
    if (!items[index]) {
      return;
    }
    while (this._skipPredicateFn(items[index])) {
      index += fallbackDelta;
      if (!items[index]) {
        return;
      }
    }
    this.setActiveItem(index);
  }
  /** Returns the items as an array. */
  _getItemsArray() {
    if (isSignal(this._items)) {
      return this._items();
    }
    return this._items instanceof QueryList ? this._items.toArray() : this._items;
  }
  /** Callback for when the items have changed. */
  _itemsChanged(newItems) {
    if (this._activeItem) {
      const newIndex = newItems.indexOf(this._activeItem);
      if (newIndex > -1 && newIndex !== this._activeItemIndex) {
        this._activeItemIndex = newIndex;
      }
    }
  }
};
var ActiveDescendantKeyManager = class extends ListKeyManager {
  setActiveItem(index) {
    if (this.activeItem) {
      this.activeItem.setInactiveStyles();
    }
    super.setActiveItem(index);
    if (this.activeItem) {
      this.activeItem.setActiveStyles();
    }
  }
};
var _InteractivityChecker = class _InteractivityChecker {
  constructor(_platform) {
    this._platform = _platform;
  }
  /**
   * Gets whether an element is disabled.
   *
   * @param element Element to be checked.
   * @returns Whether the element is disabled.
   */
  isDisabled(element) {
    return element.hasAttribute("disabled");
  }
  /**
   * Gets whether an element is visible for the purposes of interactivity.
   *
   * This will capture states like `display: none` and `visibility: hidden`, but not things like
   * being clipped by an `overflow: hidden` parent or being outside the viewport.
   *
   * @returns Whether the element is visible.
   */
  isVisible(element) {
    return hasGeometry(element) && getComputedStyle(element).visibility === "visible";
  }
  /**
   * Gets whether an element can be reached via Tab key.
   * Assumes that the element has already been checked with isFocusable.
   *
   * @param element Element to be checked.
   * @returns Whether the element is tabbable.
   */
  isTabbable(element) {
    if (!this._platform.isBrowser) {
      return false;
    }
    const frameElement = getFrameElement(getWindow(element));
    if (frameElement) {
      if (getTabIndexValue(frameElement) === -1) {
        return false;
      }
      if (!this.isVisible(frameElement)) {
        return false;
      }
    }
    let nodeName = element.nodeName.toLowerCase();
    let tabIndexValue = getTabIndexValue(element);
    if (element.hasAttribute("contenteditable")) {
      return tabIndexValue !== -1;
    }
    if (nodeName === "iframe" || nodeName === "object") {
      return false;
    }
    if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
      return false;
    }
    if (nodeName === "audio") {
      if (!element.hasAttribute("controls")) {
        return false;
      }
      return tabIndexValue !== -1;
    }
    if (nodeName === "video") {
      if (tabIndexValue === -1) {
        return false;
      }
      if (tabIndexValue !== null) {
        return true;
      }
      return this._platform.FIREFOX || element.hasAttribute("controls");
    }
    return element.tabIndex >= 0;
  }
  /**
   * Gets whether an element can be focused by the user.
   *
   * @param element Element to be checked.
   * @param config The config object with options to customize this method's behavior
   * @returns Whether the element is focusable.
   */
  isFocusable(element, config2) {
    return isPotentiallyFocusable(element) && !this.isDisabled(element) && (config2?.ignoreVisibility || this.isVisible(element));
  }
};
_InteractivityChecker.\u0275fac = function InteractivityChecker_Factory(t) {
  return new (t || _InteractivityChecker)(\u0275\u0275inject(Platform));
};
_InteractivityChecker.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _InteractivityChecker,
  factory: _InteractivityChecker.\u0275fac,
  providedIn: "root"
});
var InteractivityChecker = _InteractivityChecker;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InteractivityChecker, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }], null);
})();
function getFrameElement(window2) {
  try {
    return window2.frameElement;
  } catch {
    return null;
  }
}
function hasGeometry(element) {
  return !!(element.offsetWidth || element.offsetHeight || typeof element.getClientRects === "function" && element.getClientRects().length);
}
function isNativeFormElement(element) {
  let nodeName = element.nodeName.toLowerCase();
  return nodeName === "input" || nodeName === "select" || nodeName === "button" || nodeName === "textarea";
}
function isHiddenInput(element) {
  return isInputElement(element) && element.type == "hidden";
}
function isAnchorWithHref(element) {
  return isAnchorElement(element) && element.hasAttribute("href");
}
function isInputElement(element) {
  return element.nodeName.toLowerCase() == "input";
}
function isAnchorElement(element) {
  return element.nodeName.toLowerCase() == "a";
}
function hasValidTabIndex(element) {
  if (!element.hasAttribute("tabindex") || element.tabIndex === void 0) {
    return false;
  }
  let tabIndex = element.getAttribute("tabindex");
  return !!(tabIndex && !isNaN(parseInt(tabIndex, 10)));
}
function getTabIndexValue(element) {
  if (!hasValidTabIndex(element)) {
    return null;
  }
  const tabIndex = parseInt(element.getAttribute("tabindex") || "", 10);
  return isNaN(tabIndex) ? -1 : tabIndex;
}
function isPotentiallyTabbableIOS(element) {
  let nodeName = element.nodeName.toLowerCase();
  let inputType = nodeName === "input" && element.type;
  return inputType === "text" || inputType === "password" || nodeName === "select" || nodeName === "textarea";
}
function isPotentiallyFocusable(element) {
  if (isHiddenInput(element)) {
    return false;
  }
  return isNativeFormElement(element) || isAnchorWithHref(element) || element.hasAttribute("contenteditable") || hasValidTabIndex(element);
}
function getWindow(node) {
  return node.ownerDocument && node.ownerDocument.defaultView || window;
}
var FocusTrap = class {
  /** Whether the focus trap is active. */
  get enabled() {
    return this._enabled;
  }
  set enabled(value) {
    this._enabled = value;
    if (this._startAnchor && this._endAnchor) {
      this._toggleAnchorTabIndex(value, this._startAnchor);
      this._toggleAnchorTabIndex(value, this._endAnchor);
    }
  }
  constructor(_element, _checker, _ngZone, _document2, deferAnchors = false) {
    this._element = _element;
    this._checker = _checker;
    this._ngZone = _ngZone;
    this._document = _document2;
    this._hasAttached = false;
    this.startAnchorListener = () => this.focusLastTabbableElement();
    this.endAnchorListener = () => this.focusFirstTabbableElement();
    this._enabled = true;
    if (!deferAnchors) {
      this.attachAnchors();
    }
  }
  /** Destroys the focus trap by cleaning up the anchors. */
  destroy() {
    const startAnchor = this._startAnchor;
    const endAnchor = this._endAnchor;
    if (startAnchor) {
      startAnchor.removeEventListener("focus", this.startAnchorListener);
      startAnchor.remove();
    }
    if (endAnchor) {
      endAnchor.removeEventListener("focus", this.endAnchorListener);
      endAnchor.remove();
    }
    this._startAnchor = this._endAnchor = null;
    this._hasAttached = false;
  }
  /**
   * Inserts the anchors into the DOM. This is usually done automatically
   * in the constructor, but can be deferred for cases like directives with `*ngIf`.
   * @returns Whether the focus trap managed to attach successfully. This may not be the case
   * if the target element isn't currently in the DOM.
   */
  attachAnchors() {
    if (this._hasAttached) {
      return true;
    }
    this._ngZone.runOutsideAngular(() => {
      if (!this._startAnchor) {
        this._startAnchor = this._createAnchor();
        this._startAnchor.addEventListener("focus", this.startAnchorListener);
      }
      if (!this._endAnchor) {
        this._endAnchor = this._createAnchor();
        this._endAnchor.addEventListener("focus", this.endAnchorListener);
      }
    });
    if (this._element.parentNode) {
      this._element.parentNode.insertBefore(this._startAnchor, this._element);
      this._element.parentNode.insertBefore(this._endAnchor, this._element.nextSibling);
      this._hasAttached = true;
    }
    return this._hasAttached;
  }
  /**
   * Waits for the zone to stabilize, then focuses the first tabbable element.
   * @returns Returns a promise that resolves with a boolean, depending
   * on whether focus was moved successfully.
   */
  focusInitialElementWhenReady(options) {
    return new Promise((resolve) => {
      this._executeOnStable(() => resolve(this.focusInitialElement(options)));
    });
  }
  /**
   * Waits for the zone to stabilize, then focuses
   * the first tabbable element within the focus trap region.
   * @returns Returns a promise that resolves with a boolean, depending
   * on whether focus was moved successfully.
   */
  focusFirstTabbableElementWhenReady(options) {
    return new Promise((resolve) => {
      this._executeOnStable(() => resolve(this.focusFirstTabbableElement(options)));
    });
  }
  /**
   * Waits for the zone to stabilize, then focuses
   * the last tabbable element within the focus trap region.
   * @returns Returns a promise that resolves with a boolean, depending
   * on whether focus was moved successfully.
   */
  focusLastTabbableElementWhenReady(options) {
    return new Promise((resolve) => {
      this._executeOnStable(() => resolve(this.focusLastTabbableElement(options)));
    });
  }
  /**
   * Get the specified boundary element of the trapped region.
   * @param bound The boundary to get (start or end of trapped region).
   * @returns The boundary element.
   */
  _getRegionBoundary(bound) {
    const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], [cdkFocusRegion${bound}], [cdk-focus-${bound}]`);
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      for (let i2 = 0; i2 < markers.length; i2++) {
        if (markers[i2].hasAttribute(`cdk-focus-${bound}`)) {
          console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', use 'cdkFocusRegion${bound}' instead. The deprecated attribute will be removed in 8.0.0.`, markers[i2]);
        } else if (markers[i2].hasAttribute(`cdk-focus-region-${bound}`)) {
          console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', use 'cdkFocusRegion${bound}' instead. The deprecated attribute will be removed in 8.0.0.`, markers[i2]);
        }
      }
    }
    if (bound == "start") {
      return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);
    }
    return markers.length ? markers[markers.length - 1] : this._getLastTabbableElement(this._element);
  }
  /**
   * Focuses the element that should be focused when the focus trap is initialized.
   * @returns Whether focus was moved successfully.
   */
  focusInitialElement(options) {
    const redirectToElement = this._element.querySelector(`[cdk-focus-initial], [cdkFocusInitial]`);
    if (redirectToElement) {
      if ((typeof ngDevMode === "undefined" || ngDevMode) && redirectToElement.hasAttribute(`cdk-focus-initial`)) {
        console.warn(`Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead. The deprecated attribute will be removed in 8.0.0`, redirectToElement);
      }
      if ((typeof ngDevMode === "undefined" || ngDevMode) && !this._checker.isFocusable(redirectToElement)) {
        console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement);
      }
      if (!this._checker.isFocusable(redirectToElement)) {
        const focusableChild = this._getFirstTabbableElement(redirectToElement);
        focusableChild?.focus(options);
        return !!focusableChild;
      }
      redirectToElement.focus(options);
      return true;
    }
    return this.focusFirstTabbableElement(options);
  }
  /**
   * Focuses the first tabbable element within the focus trap region.
   * @returns Whether focus was moved successfully.
   */
  focusFirstTabbableElement(options) {
    const redirectToElement = this._getRegionBoundary("start");
    if (redirectToElement) {
      redirectToElement.focus(options);
    }
    return !!redirectToElement;
  }
  /**
   * Focuses the last tabbable element within the focus trap region.
   * @returns Whether focus was moved successfully.
   */
  focusLastTabbableElement(options) {
    const redirectToElement = this._getRegionBoundary("end");
    if (redirectToElement) {
      redirectToElement.focus(options);
    }
    return !!redirectToElement;
  }
  /**
   * Checks whether the focus trap has successfully been attached.
   */
  hasAttached() {
    return this._hasAttached;
  }
  /** Get the first tabbable element from a DOM subtree (inclusive). */
  _getFirstTabbableElement(root) {
    if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
      return root;
    }
    const children = root.children;
    for (let i2 = 0; i2 < children.length; i2++) {
      const tabbableChild = children[i2].nodeType === this._document.ELEMENT_NODE ? this._getFirstTabbableElement(children[i2]) : null;
      if (tabbableChild) {
        return tabbableChild;
      }
    }
    return null;
  }
  /** Get the last tabbable element from a DOM subtree (inclusive). */
  _getLastTabbableElement(root) {
    if (this._checker.isFocusable(root) && this._checker.isTabbable(root)) {
      return root;
    }
    const children = root.children;
    for (let i2 = children.length - 1; i2 >= 0; i2--) {
      const tabbableChild = children[i2].nodeType === this._document.ELEMENT_NODE ? this._getLastTabbableElement(children[i2]) : null;
      if (tabbableChild) {
        return tabbableChild;
      }
    }
    return null;
  }
  /** Creates an anchor element. */
  _createAnchor() {
    const anchor2 = this._document.createElement("div");
    this._toggleAnchorTabIndex(this._enabled, anchor2);
    anchor2.classList.add("cdk-visually-hidden");
    anchor2.classList.add("cdk-focus-trap-anchor");
    anchor2.setAttribute("aria-hidden", "true");
    return anchor2;
  }
  /**
   * Toggles the `tabindex` of an anchor, based on the enabled state of the focus trap.
   * @param isEnabled Whether the focus trap is enabled.
   * @param anchor Anchor on which to toggle the tabindex.
   */
  _toggleAnchorTabIndex(isEnabled, anchor2) {
    isEnabled ? anchor2.setAttribute("tabindex", "0") : anchor2.removeAttribute("tabindex");
  }
  /**
   * Toggles the`tabindex` of both anchors to either trap Tab focus or allow it to escape.
   * @param enabled: Whether the anchors should trap Tab.
   */
  toggleAnchors(enabled) {
    if (this._startAnchor && this._endAnchor) {
      this._toggleAnchorTabIndex(enabled, this._startAnchor);
      this._toggleAnchorTabIndex(enabled, this._endAnchor);
    }
  }
  /** Executes a function when the zone is stable. */
  _executeOnStable(fn) {
    if (this._ngZone.isStable) {
      fn();
    } else {
      this._ngZone.onStable.pipe(take(1)).subscribe(fn);
    }
  }
};
var _FocusTrapFactory = class _FocusTrapFactory {
  constructor(_checker, _ngZone, _document2) {
    this._checker = _checker;
    this._ngZone = _ngZone;
    this._document = _document2;
  }
  /**
   * Creates a focus-trapped region around the given element.
   * @param element The element around which focus will be trapped.
   * @param deferCaptureElements Defers the creation of focus-capturing elements to be done
   *     manually by the user.
   * @returns The created focus trap instance.
   */
  create(element, deferCaptureElements = false) {
    return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements);
  }
};
_FocusTrapFactory.\u0275fac = function FocusTrapFactory_Factory(t) {
  return new (t || _FocusTrapFactory)(\u0275\u0275inject(InteractivityChecker), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2));
};
_FocusTrapFactory.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FocusTrapFactory,
  factory: _FocusTrapFactory.\u0275fac,
  providedIn: "root"
});
var FocusTrapFactory = _FocusTrapFactory;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusTrapFactory, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: InteractivityChecker
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var _CdkTrapFocus = class _CdkTrapFocus {
  /** Whether the focus trap is active. */
  get enabled() {
    return this.focusTrap?.enabled || false;
  }
  set enabled(value) {
    if (this.focusTrap) {
      this.focusTrap.enabled = value;
    }
  }
  constructor(_elementRef, _focusTrapFactory, _document2) {
    this._elementRef = _elementRef;
    this._focusTrapFactory = _focusTrapFactory;
    this._previouslyFocusedElement = null;
    const platform = inject(Platform);
    if (platform.isBrowser) {
      this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);
    }
  }
  ngOnDestroy() {
    this.focusTrap?.destroy();
    if (this._previouslyFocusedElement) {
      this._previouslyFocusedElement.focus();
      this._previouslyFocusedElement = null;
    }
  }
  ngAfterContentInit() {
    this.focusTrap?.attachAnchors();
    if (this.autoCapture) {
      this._captureFocus();
    }
  }
  ngDoCheck() {
    if (this.focusTrap && !this.focusTrap.hasAttached()) {
      this.focusTrap.attachAnchors();
    }
  }
  ngOnChanges(changes) {
    const autoCaptureChange = changes["autoCapture"];
    if (autoCaptureChange && !autoCaptureChange.firstChange && this.autoCapture && this.focusTrap?.hasAttached()) {
      this._captureFocus();
    }
  }
  _captureFocus() {
    this._previouslyFocusedElement = _getFocusedElementPierceShadowDom();
    this.focusTrap?.focusInitialElementWhenReady();
  }
};
_CdkTrapFocus.\u0275fac = function CdkTrapFocus_Factory(t) {
  return new (t || _CdkTrapFocus)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(FocusTrapFactory), \u0275\u0275directiveInject(DOCUMENT2));
};
_CdkTrapFocus.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkTrapFocus,
  selectors: [["", "cdkTrapFocus", ""]],
  inputs: {
    enabled: [2, "cdkTrapFocus", "enabled", booleanAttribute],
    autoCapture: [2, "cdkTrapFocusAutoCapture", "autoCapture", booleanAttribute]
  },
  exportAs: ["cdkTrapFocus"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275NgOnChangesFeature]
});
var CdkTrapFocus = _CdkTrapFocus;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkTrapFocus, [{
    type: Directive,
    args: [{
      selector: "[cdkTrapFocus]",
      exportAs: "cdkTrapFocus",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: FocusTrapFactory
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    enabled: [{
      type: Input,
      args: [{
        alias: "cdkTrapFocus",
        transform: booleanAttribute
      }]
    }],
    autoCapture: [{
      type: Input,
      args: [{
        alias: "cdkTrapFocusAutoCapture",
        transform: booleanAttribute
      }]
    }]
  });
})();
var ConfigurableFocusTrap = class extends FocusTrap {
  /** Whether the FocusTrap is enabled. */
  get enabled() {
    return this._enabled;
  }
  set enabled(value) {
    this._enabled = value;
    if (this._enabled) {
      this._focusTrapManager.register(this);
    } else {
      this._focusTrapManager.deregister(this);
    }
  }
  constructor(_element, _checker, _ngZone, _document2, _focusTrapManager, _inertStrategy, config2) {
    super(_element, _checker, _ngZone, _document2, config2.defer);
    this._focusTrapManager = _focusTrapManager;
    this._inertStrategy = _inertStrategy;
    this._focusTrapManager.register(this);
  }
  /** Notifies the FocusTrapManager that this FocusTrap will be destroyed. */
  destroy() {
    this._focusTrapManager.deregister(this);
    super.destroy();
  }
  /** @docs-private Implemented as part of ManagedFocusTrap. */
  _enable() {
    this._inertStrategy.preventFocus(this);
    this.toggleAnchors(true);
  }
  /** @docs-private Implemented as part of ManagedFocusTrap. */
  _disable() {
    this._inertStrategy.allowFocus(this);
    this.toggleAnchors(false);
  }
};
var FOCUS_TRAP_INERT_STRATEGY = new InjectionToken("FOCUS_TRAP_INERT_STRATEGY");
var EventListenerFocusTrapInertStrategy = class {
  constructor() {
    this._listener = null;
  }
  /** Adds a document event listener that keeps focus inside the FocusTrap. */
  preventFocus(focusTrap) {
    if (this._listener) {
      focusTrap._document.removeEventListener("focus", this._listener, true);
    }
    this._listener = (e) => this._trapFocus(focusTrap, e);
    focusTrap._ngZone.runOutsideAngular(() => {
      focusTrap._document.addEventListener("focus", this._listener, true);
    });
  }
  /** Removes the event listener added in preventFocus. */
  allowFocus(focusTrap) {
    if (!this._listener) {
      return;
    }
    focusTrap._document.removeEventListener("focus", this._listener, true);
    this._listener = null;
  }
  /**
   * Refocuses the first element in the FocusTrap if the focus event target was outside
   * the FocusTrap.
   *
   * This is an event listener callback. The event listener is added in runOutsideAngular,
   * so all this code runs outside Angular as well.
   */
  _trapFocus(focusTrap, event) {
    const target = event.target;
    const focusTrapRoot = focusTrap._element;
    if (target && !focusTrapRoot.contains(target) && !target.closest?.("div.cdk-overlay-pane")) {
      setTimeout(() => {
        if (focusTrap.enabled && !focusTrapRoot.contains(focusTrap._document.activeElement)) {
          focusTrap.focusFirstTabbableElement();
        }
      });
    }
  }
};
var _FocusTrapManager = class _FocusTrapManager {
  constructor() {
    this._focusTrapStack = [];
  }
  /**
   * Disables the FocusTrap at the top of the stack, and then pushes
   * the new FocusTrap onto the stack.
   */
  register(focusTrap) {
    this._focusTrapStack = this._focusTrapStack.filter((ft) => ft !== focusTrap);
    let stack = this._focusTrapStack;
    if (stack.length) {
      stack[stack.length - 1]._disable();
    }
    stack.push(focusTrap);
    focusTrap._enable();
  }
  /**
   * Removes the FocusTrap from the stack, and activates the
   * FocusTrap that is the new top of the stack.
   */
  deregister(focusTrap) {
    focusTrap._disable();
    const stack = this._focusTrapStack;
    const i2 = stack.indexOf(focusTrap);
    if (i2 !== -1) {
      stack.splice(i2, 1);
      if (stack.length) {
        stack[stack.length - 1]._enable();
      }
    }
  }
};
_FocusTrapManager.\u0275fac = function FocusTrapManager_Factory(t) {
  return new (t || _FocusTrapManager)();
};
_FocusTrapManager.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FocusTrapManager,
  factory: _FocusTrapManager.\u0275fac,
  providedIn: "root"
});
var FocusTrapManager = _FocusTrapManager;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusTrapManager, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _ConfigurableFocusTrapFactory = class _ConfigurableFocusTrapFactory {
  constructor(_checker, _ngZone, _focusTrapManager, _document2, _inertStrategy) {
    this._checker = _checker;
    this._ngZone = _ngZone;
    this._focusTrapManager = _focusTrapManager;
    this._document = _document2;
    this._inertStrategy = _inertStrategy || new EventListenerFocusTrapInertStrategy();
  }
  create(element, config2 = {
    defer: false
  }) {
    let configObject;
    if (typeof config2 === "boolean") {
      configObject = {
        defer: config2
      };
    } else {
      configObject = config2;
    }
    return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject);
  }
};
_ConfigurableFocusTrapFactory.\u0275fac = function ConfigurableFocusTrapFactory_Factory(t) {
  return new (t || _ConfigurableFocusTrapFactory)(\u0275\u0275inject(InteractivityChecker), \u0275\u0275inject(NgZone), \u0275\u0275inject(FocusTrapManager), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(FOCUS_TRAP_INERT_STRATEGY, 8));
};
_ConfigurableFocusTrapFactory.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ConfigurableFocusTrapFactory,
  factory: _ConfigurableFocusTrapFactory.\u0275fac,
  providedIn: "root"
});
var ConfigurableFocusTrapFactory = _ConfigurableFocusTrapFactory;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ConfigurableFocusTrapFactory, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: InteractivityChecker
  }, {
    type: NgZone
  }, {
    type: FocusTrapManager
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [FOCUS_TRAP_INERT_STRATEGY]
    }]
  }], null);
})();
function isFakeMousedownFromScreenReader(event) {
  return event.buttons === 0 || event.detail === 0;
}
function isFakeTouchstartFromScreenReader(event) {
  const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0];
  return !!touch && touch.identifier === -1 && (touch.radiusX == null || touch.radiusX === 1) && (touch.radiusY == null || touch.radiusY === 1);
}
var INPUT_MODALITY_DETECTOR_OPTIONS = new InjectionToken("cdk-input-modality-detector-options");
var INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS = {
  ignoreKeys: [ALT, CONTROL, MAC_META, META, SHIFT]
};
var TOUCH_BUFFER_MS = 650;
var modalityEventListenerOptions = normalizePassiveListenerOptions({
  passive: true,
  capture: true
});
var _InputModalityDetector = class _InputModalityDetector {
  /** The most recently detected input modality. */
  get mostRecentModality() {
    return this._modality.value;
  }
  constructor(_platform, ngZone, document2, options) {
    this._platform = _platform;
    this._mostRecentTarget = null;
    this._modality = new BehaviorSubject(null);
    this._lastTouchMs = 0;
    this._onKeydown = (event) => {
      if (this._options?.ignoreKeys?.some((keyCode) => keyCode === event.keyCode)) {
        return;
      }
      this._modality.next("keyboard");
      this._mostRecentTarget = _getEventTarget(event);
    };
    this._onMousedown = (event) => {
      if (Date.now() - this._lastTouchMs < TOUCH_BUFFER_MS) {
        return;
      }
      this._modality.next(isFakeMousedownFromScreenReader(event) ? "keyboard" : "mouse");
      this._mostRecentTarget = _getEventTarget(event);
    };
    this._onTouchstart = (event) => {
      if (isFakeTouchstartFromScreenReader(event)) {
        this._modality.next("keyboard");
        return;
      }
      this._lastTouchMs = Date.now();
      this._modality.next("touch");
      this._mostRecentTarget = _getEventTarget(event);
    };
    this._options = __spreadValues(__spreadValues({}, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS), options);
    this.modalityDetected = this._modality.pipe(skip(1));
    this.modalityChanged = this.modalityDetected.pipe(distinctUntilChanged());
    if (_platform.isBrowser) {
      ngZone.runOutsideAngular(() => {
        document2.addEventListener("keydown", this._onKeydown, modalityEventListenerOptions);
        document2.addEventListener("mousedown", this._onMousedown, modalityEventListenerOptions);
        document2.addEventListener("touchstart", this._onTouchstart, modalityEventListenerOptions);
      });
    }
  }
  ngOnDestroy() {
    this._modality.complete();
    if (this._platform.isBrowser) {
      document.removeEventListener("keydown", this._onKeydown, modalityEventListenerOptions);
      document.removeEventListener("mousedown", this._onMousedown, modalityEventListenerOptions);
      document.removeEventListener("touchstart", this._onTouchstart, modalityEventListenerOptions);
    }
  }
};
_InputModalityDetector.\u0275fac = function InputModalityDetector_Factory(t) {
  return new (t || _InputModalityDetector)(\u0275\u0275inject(Platform), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(INPUT_MODALITY_DETECTOR_OPTIONS, 8));
};
_InputModalityDetector.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _InputModalityDetector,
  factory: _InputModalityDetector.\u0275fac,
  providedIn: "root"
});
var InputModalityDetector = _InputModalityDetector;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InputModalityDetector, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }, {
    type: NgZone
  }, {
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [INPUT_MODALITY_DETECTOR_OPTIONS]
    }]
  }], null);
})();
var LIVE_ANNOUNCER_ELEMENT_TOKEN = new InjectionToken("liveAnnouncerElement", {
  providedIn: "root",
  factory: LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY
});
function LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY() {
  return null;
}
var LIVE_ANNOUNCER_DEFAULT_OPTIONS = new InjectionToken("LIVE_ANNOUNCER_DEFAULT_OPTIONS");
var uniqueIds = 0;
var _LiveAnnouncer = class _LiveAnnouncer {
  constructor(elementToken, _ngZone, _document2, _defaultOptions) {
    this._ngZone = _ngZone;
    this._defaultOptions = _defaultOptions;
    this._document = _document2;
    this._liveElement = elementToken || this._createLiveElement();
  }
  announce(message, ...args) {
    const defaultOptions2 = this._defaultOptions;
    let politeness;
    let duration;
    if (args.length === 1 && typeof args[0] === "number") {
      duration = args[0];
    } else {
      [politeness, duration] = args;
    }
    this.clear();
    clearTimeout(this._previousTimeout);
    if (!politeness) {
      politeness = defaultOptions2 && defaultOptions2.politeness ? defaultOptions2.politeness : "polite";
    }
    if (duration == null && defaultOptions2) {
      duration = defaultOptions2.duration;
    }
    this._liveElement.setAttribute("aria-live", politeness);
    if (this._liveElement.id) {
      this._exposeAnnouncerToModals(this._liveElement.id);
    }
    return this._ngZone.runOutsideAngular(() => {
      if (!this._currentPromise) {
        this._currentPromise = new Promise((resolve) => this._currentResolve = resolve);
      }
      clearTimeout(this._previousTimeout);
      this._previousTimeout = setTimeout(() => {
        this._liveElement.textContent = message;
        if (typeof duration === "number") {
          this._previousTimeout = setTimeout(() => this.clear(), duration);
        }
        this._currentResolve?.();
        this._currentPromise = this._currentResolve = void 0;
      }, 100);
      return this._currentPromise;
    });
  }
  /**
   * Clears the current text from the announcer element. Can be used to prevent
   * screen readers from reading the text out again while the user is going
   * through the page landmarks.
   */
  clear() {
    if (this._liveElement) {
      this._liveElement.textContent = "";
    }
  }
  ngOnDestroy() {
    clearTimeout(this._previousTimeout);
    this._liveElement?.remove();
    this._liveElement = null;
    this._currentResolve?.();
    this._currentPromise = this._currentResolve = void 0;
  }
  _createLiveElement() {
    const elementClass = "cdk-live-announcer-element";
    const previousElements = this._document.getElementsByClassName(elementClass);
    const liveEl = this._document.createElement("div");
    for (let i2 = 0; i2 < previousElements.length; i2++) {
      previousElements[i2].remove();
    }
    liveEl.classList.add(elementClass);
    liveEl.classList.add("cdk-visually-hidden");
    liveEl.setAttribute("aria-atomic", "true");
    liveEl.setAttribute("aria-live", "polite");
    liveEl.id = `cdk-live-announcer-${uniqueIds++}`;
    this._document.body.appendChild(liveEl);
    return liveEl;
  }
  /**
   * Some browsers won't expose the accessibility node of the live announcer element if there is an
   * `aria-modal` and the live announcer is outside of it. This method works around the issue by
   * pointing the `aria-owns` of all modals to the live announcer element.
   */
  _exposeAnnouncerToModals(id2) {
    const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');
    for (let i2 = 0; i2 < modals.length; i2++) {
      const modal = modals[i2];
      const ariaOwns = modal.getAttribute("aria-owns");
      if (!ariaOwns) {
        modal.setAttribute("aria-owns", id2);
      } else if (ariaOwns.indexOf(id2) === -1) {
        modal.setAttribute("aria-owns", ariaOwns + " " + id2);
      }
    }
  }
};
_LiveAnnouncer.\u0275fac = function LiveAnnouncer_Factory(t) {
  return new (t || _LiveAnnouncer)(\u0275\u0275inject(LIVE_ANNOUNCER_ELEMENT_TOKEN, 8), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(LIVE_ANNOUNCER_DEFAULT_OPTIONS, 8));
};
_LiveAnnouncer.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _LiveAnnouncer,
  factory: _LiveAnnouncer.\u0275fac,
  providedIn: "root"
});
var LiveAnnouncer = _LiveAnnouncer;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LiveAnnouncer, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [LIVE_ANNOUNCER_ELEMENT_TOKEN]
    }]
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [LIVE_ANNOUNCER_DEFAULT_OPTIONS]
    }]
  }], null);
})();
var _CdkAriaLive = class _CdkAriaLive {
  /** The aria-live politeness level to use when announcing messages. */
  get politeness() {
    return this._politeness;
  }
  set politeness(value) {
    this._politeness = value === "off" || value === "assertive" ? value : "polite";
    if (this._politeness === "off") {
      if (this._subscription) {
        this._subscription.unsubscribe();
        this._subscription = null;
      }
    } else if (!this._subscription) {
      this._subscription = this._ngZone.runOutsideAngular(() => {
        return this._contentObserver.observe(this._elementRef).subscribe(() => {
          const elementText = this._elementRef.nativeElement.textContent;
          if (elementText !== this._previousAnnouncedText) {
            this._liveAnnouncer.announce(elementText, this._politeness, this.duration);
            this._previousAnnouncedText = elementText;
          }
        });
      });
    }
  }
  constructor(_elementRef, _liveAnnouncer, _contentObserver, _ngZone) {
    this._elementRef = _elementRef;
    this._liveAnnouncer = _liveAnnouncer;
    this._contentObserver = _contentObserver;
    this._ngZone = _ngZone;
    this._politeness = "polite";
  }
  ngOnDestroy() {
    if (this._subscription) {
      this._subscription.unsubscribe();
    }
  }
};
_CdkAriaLive.\u0275fac = function CdkAriaLive_Factory(t) {
  return new (t || _CdkAriaLive)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(LiveAnnouncer), \u0275\u0275directiveInject(ContentObserver), \u0275\u0275directiveInject(NgZone));
};
_CdkAriaLive.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkAriaLive,
  selectors: [["", "cdkAriaLive", ""]],
  inputs: {
    politeness: [0, "cdkAriaLive", "politeness"],
    duration: [0, "cdkAriaLiveDuration", "duration"]
  },
  exportAs: ["cdkAriaLive"],
  standalone: true
});
var CdkAriaLive = _CdkAriaLive;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkAriaLive, [{
    type: Directive,
    args: [{
      selector: "[cdkAriaLive]",
      exportAs: "cdkAriaLive",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: LiveAnnouncer
  }, {
    type: ContentObserver
  }, {
    type: NgZone
  }], {
    politeness: [{
      type: Input,
      args: ["cdkAriaLive"]
    }],
    duration: [{
      type: Input,
      args: ["cdkAriaLiveDuration"]
    }]
  });
})();
var FocusMonitorDetectionMode;
(function(FocusMonitorDetectionMode2) {
  FocusMonitorDetectionMode2[FocusMonitorDetectionMode2["IMMEDIATE"] = 0] = "IMMEDIATE";
  FocusMonitorDetectionMode2[FocusMonitorDetectionMode2["EVENTUAL"] = 1] = "EVENTUAL";
})(FocusMonitorDetectionMode || (FocusMonitorDetectionMode = {}));
var FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken("cdk-focus-monitor-default-options");
var captureEventListenerOptions = normalizePassiveListenerOptions({
  passive: true,
  capture: true
});
var _FocusMonitor = class _FocusMonitor {
  constructor(_ngZone, _platform, _inputModalityDetector, document2, options) {
    this._ngZone = _ngZone;
    this._platform = _platform;
    this._inputModalityDetector = _inputModalityDetector;
    this._origin = null;
    this._windowFocused = false;
    this._originFromTouchInteraction = false;
    this._elementInfo = /* @__PURE__ */ new Map();
    this._monitoredElementCount = 0;
    this._rootNodeFocusListenerCount = /* @__PURE__ */ new Map();
    this._windowFocusListener = () => {
      this._windowFocused = true;
      this._windowFocusTimeoutId = window.setTimeout(() => this._windowFocused = false);
    };
    this._stopInputModalityDetector = new Subject();
    this._rootNodeFocusAndBlurListener = (event) => {
      const target = _getEventTarget(event);
      for (let element = target; element; element = element.parentElement) {
        if (event.type === "focus") {
          this._onFocus(event, element);
        } else {
          this._onBlur(event, element);
        }
      }
    };
    this._document = document2;
    this._detectionMode = options?.detectionMode || FocusMonitorDetectionMode.IMMEDIATE;
  }
  monitor(element, checkChildren = false) {
    const nativeElement = coerceElement(element);
    if (!this._platform.isBrowser || nativeElement.nodeType !== 1) {
      return of();
    }
    const rootNode = _getShadowRoot(nativeElement) || this._getDocument();
    const cachedInfo = this._elementInfo.get(nativeElement);
    if (cachedInfo) {
      if (checkChildren) {
        cachedInfo.checkChildren = true;
      }
      return cachedInfo.subject;
    }
    const info = {
      checkChildren,
      subject: new Subject(),
      rootNode
    };
    this._elementInfo.set(nativeElement, info);
    this._registerGlobalListeners(info);
    return info.subject;
  }
  stopMonitoring(element) {
    const nativeElement = coerceElement(element);
    const elementInfo = this._elementInfo.get(nativeElement);
    if (elementInfo) {
      elementInfo.subject.complete();
      this._setClasses(nativeElement);
      this._elementInfo.delete(nativeElement);
      this._removeGlobalListeners(elementInfo);
    }
  }
  focusVia(element, origin, options) {
    const nativeElement = coerceElement(element);
    const focusedElement = this._getDocument().activeElement;
    if (nativeElement === focusedElement) {
      this._getClosestElementsInfo(nativeElement).forEach(([currentElement, info]) => this._originChanged(currentElement, origin, info));
    } else {
      this._setOrigin(origin);
      if (typeof nativeElement.focus === "function") {
        nativeElement.focus(options);
      }
    }
  }
  ngOnDestroy() {
    this._elementInfo.forEach((_info, element) => this.stopMonitoring(element));
  }
  /** Access injected document if available or fallback to global document reference */
  _getDocument() {
    return this._document || document;
  }
  /** Use defaultView of injected document if available or fallback to global window reference */
  _getWindow() {
    const doc = this._getDocument();
    return doc.defaultView || window;
  }
  _getFocusOrigin(focusEventTarget) {
    if (this._origin) {
      if (this._originFromTouchInteraction) {
        return this._shouldBeAttributedToTouch(focusEventTarget) ? "touch" : "program";
      } else {
        return this._origin;
      }
    }
    if (this._windowFocused && this._lastFocusOrigin) {
      return this._lastFocusOrigin;
    }
    if (focusEventTarget && this._isLastInteractionFromInputLabel(focusEventTarget)) {
      return "mouse";
    }
    return "program";
  }
  /**
   * Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a
   * touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we
   * handle a focus event following a touch interaction, we need to determine whether (1) the focus
   * event was directly caused by the touch interaction or (2) the focus event was caused by a
   * subsequent programmatic focus call triggered by the touch interaction.
   * @param focusEventTarget The target of the focus event under examination.
   */
  _shouldBeAttributedToTouch(focusEventTarget) {
    return this._detectionMode === FocusMonitorDetectionMode.EVENTUAL || !!focusEventTarget?.contains(this._inputModalityDetector._mostRecentTarget);
  }
  /**
   * Sets the focus classes on the element based on the given focus origin.
   * @param element The element to update the classes on.
   * @param origin The focus origin.
   */
  _setClasses(element, origin) {
    element.classList.toggle("cdk-focused", !!origin);
    element.classList.toggle("cdk-touch-focused", origin === "touch");
    element.classList.toggle("cdk-keyboard-focused", origin === "keyboard");
    element.classList.toggle("cdk-mouse-focused", origin === "mouse");
    element.classList.toggle("cdk-program-focused", origin === "program");
  }
  /**
   * Updates the focus origin. If we're using immediate detection mode, we schedule an async
   * function to clear the origin at the end of a timeout. The duration of the timeout depends on
   * the origin being set.
   * @param origin The origin to set.
   * @param isFromInteraction Whether we are setting the origin from an interaction event.
   */
  _setOrigin(origin, isFromInteraction = false) {
    this._ngZone.runOutsideAngular(() => {
      this._origin = origin;
      this._originFromTouchInteraction = origin === "touch" && isFromInteraction;
      if (this._detectionMode === FocusMonitorDetectionMode.IMMEDIATE) {
        clearTimeout(this._originTimeoutId);
        const ms = this._originFromTouchInteraction ? TOUCH_BUFFER_MS : 1;
        this._originTimeoutId = setTimeout(() => this._origin = null, ms);
      }
    });
  }
  /**
   * Handles focus events on a registered element.
   * @param event The focus event.
   * @param element The monitored element.
   */
  _onFocus(event, element) {
    const elementInfo = this._elementInfo.get(element);
    const focusEventTarget = _getEventTarget(event);
    if (!elementInfo || !elementInfo.checkChildren && element !== focusEventTarget) {
      return;
    }
    this._originChanged(element, this._getFocusOrigin(focusEventTarget), elementInfo);
  }
  /**
   * Handles blur events on a registered element.
   * @param event The blur event.
   * @param element The monitored element.
   */
  _onBlur(event, element) {
    const elementInfo = this._elementInfo.get(element);
    if (!elementInfo || elementInfo.checkChildren && event.relatedTarget instanceof Node && element.contains(event.relatedTarget)) {
      return;
    }
    this._setClasses(element);
    this._emitOrigin(elementInfo, null);
  }
  _emitOrigin(info, origin) {
    if (info.subject.observers.length) {
      this._ngZone.run(() => info.subject.next(origin));
    }
  }
  _registerGlobalListeners(elementInfo) {
    if (!this._platform.isBrowser) {
      return;
    }
    const rootNode = elementInfo.rootNode;
    const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;
    if (!rootNodeFocusListeners) {
      this._ngZone.runOutsideAngular(() => {
        rootNode.addEventListener("focus", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
        rootNode.addEventListener("blur", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
      });
    }
    this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);
    if (++this._monitoredElementCount === 1) {
      this._ngZone.runOutsideAngular(() => {
        const window2 = this._getWindow();
        window2.addEventListener("focus", this._windowFocusListener);
      });
      this._inputModalityDetector.modalityDetected.pipe(takeUntil(this._stopInputModalityDetector)).subscribe((modality) => {
        this._setOrigin(
          modality,
          true
          /* isFromInteraction */
        );
      });
    }
  }
  _removeGlobalListeners(elementInfo) {
    const rootNode = elementInfo.rootNode;
    if (this._rootNodeFocusListenerCount.has(rootNode)) {
      const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode);
      if (rootNodeFocusListeners > 1) {
        this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);
      } else {
        rootNode.removeEventListener("focus", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
        rootNode.removeEventListener("blur", this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
        this._rootNodeFocusListenerCount.delete(rootNode);
      }
    }
    if (!--this._monitoredElementCount) {
      const window2 = this._getWindow();
      window2.removeEventListener("focus", this._windowFocusListener);
      this._stopInputModalityDetector.next();
      clearTimeout(this._windowFocusTimeoutId);
      clearTimeout(this._originTimeoutId);
    }
  }
  /** Updates all the state on an element once its focus origin has changed. */
  _originChanged(element, origin, elementInfo) {
    this._setClasses(element, origin);
    this._emitOrigin(elementInfo, origin);
    this._lastFocusOrigin = origin;
  }
  /**
   * Collects the `MonitoredElementInfo` of a particular element and
   * all of its ancestors that have enabled `checkChildren`.
   * @param element Element from which to start the search.
   */
  _getClosestElementsInfo(element) {
    const results = [];
    this._elementInfo.forEach((info, currentElement) => {
      if (currentElement === element || info.checkChildren && currentElement.contains(element)) {
        results.push([currentElement, info]);
      }
    });
    return results;
  }
  /**
   * Returns whether an interaction is likely to have come from the user clicking the `label` of
   * an `input` or `textarea` in order to focus it.
   * @param focusEventTarget Target currently receiving focus.
   */
  _isLastInteractionFromInputLabel(focusEventTarget) {
    const {
      _mostRecentTarget: mostRecentTarget,
      mostRecentModality
    } = this._inputModalityDetector;
    if (mostRecentModality !== "mouse" || !mostRecentTarget || mostRecentTarget === focusEventTarget || focusEventTarget.nodeName !== "INPUT" && focusEventTarget.nodeName !== "TEXTAREA" || focusEventTarget.disabled) {
      return false;
    }
    const labels = focusEventTarget.labels;
    if (labels) {
      for (let i2 = 0; i2 < labels.length; i2++) {
        if (labels[i2].contains(mostRecentTarget)) {
          return true;
        }
      }
    }
    return false;
  }
};
_FocusMonitor.\u0275fac = function FocusMonitor_Factory(t) {
  return new (t || _FocusMonitor)(\u0275\u0275inject(NgZone), \u0275\u0275inject(Platform), \u0275\u0275inject(InputModalityDetector), \u0275\u0275inject(DOCUMENT2, 8), \u0275\u0275inject(FOCUS_MONITOR_DEFAULT_OPTIONS, 8));
};
_FocusMonitor.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FocusMonitor,
  factory: _FocusMonitor.\u0275fac,
  providedIn: "root"
});
var FocusMonitor = _FocusMonitor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FocusMonitor, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: NgZone
  }, {
    type: Platform
  }, {
    type: InputModalityDetector
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [FOCUS_MONITOR_DEFAULT_OPTIONS]
    }]
  }], null);
})();
var _CdkMonitorFocus = class _CdkMonitorFocus {
  constructor(_elementRef, _focusMonitor) {
    this._elementRef = _elementRef;
    this._focusMonitor = _focusMonitor;
    this._focusOrigin = null;
    this.cdkFocusChange = new EventEmitter();
  }
  get focusOrigin() {
    return this._focusOrigin;
  }
  ngAfterViewInit() {
    const element = this._elementRef.nativeElement;
    this._monitorSubscription = this._focusMonitor.monitor(element, element.nodeType === 1 && element.hasAttribute("cdkMonitorSubtreeFocus")).subscribe((origin) => {
      this._focusOrigin = origin;
      this.cdkFocusChange.emit(origin);
    });
  }
  ngOnDestroy() {
    this._focusMonitor.stopMonitoring(this._elementRef);
    if (this._monitorSubscription) {
      this._monitorSubscription.unsubscribe();
    }
  }
};
_CdkMonitorFocus.\u0275fac = function CdkMonitorFocus_Factory(t) {
  return new (t || _CdkMonitorFocus)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(FocusMonitor));
};
_CdkMonitorFocus.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkMonitorFocus,
  selectors: [["", "cdkMonitorElementFocus", ""], ["", "cdkMonitorSubtreeFocus", ""]],
  outputs: {
    cdkFocusChange: "cdkFocusChange"
  },
  exportAs: ["cdkMonitorFocus"],
  standalone: true
});
var CdkMonitorFocus = _CdkMonitorFocus;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkMonitorFocus, [{
    type: Directive,
    args: [{
      selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]",
      exportAs: "cdkMonitorFocus",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: FocusMonitor
  }], {
    cdkFocusChange: [{
      type: Output
    }]
  });
})();
var HighContrastMode;
(function(HighContrastMode2) {
  HighContrastMode2[HighContrastMode2["NONE"] = 0] = "NONE";
  HighContrastMode2[HighContrastMode2["BLACK_ON_WHITE"] = 1] = "BLACK_ON_WHITE";
  HighContrastMode2[HighContrastMode2["WHITE_ON_BLACK"] = 2] = "WHITE_ON_BLACK";
})(HighContrastMode || (HighContrastMode = {}));
var BLACK_ON_WHITE_CSS_CLASS = "cdk-high-contrast-black-on-white";
var WHITE_ON_BLACK_CSS_CLASS = "cdk-high-contrast-white-on-black";
var HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS = "cdk-high-contrast-active";
var _HighContrastModeDetector = class _HighContrastModeDetector {
  constructor(_platform, document2) {
    this._platform = _platform;
    this._document = document2;
    this._breakpointSubscription = inject(BreakpointObserver).observe("(forced-colors: active)").subscribe(() => {
      if (this._hasCheckedHighContrastMode) {
        this._hasCheckedHighContrastMode = false;
        this._applyBodyHighContrastModeCssClasses();
      }
    });
  }
  /** Gets the current high-contrast-mode for the page. */
  getHighContrastMode() {
    if (!this._platform.isBrowser) {
      return HighContrastMode.NONE;
    }
    const testElement = this._document.createElement("div");
    testElement.style.backgroundColor = "rgb(1,2,3)";
    testElement.style.position = "absolute";
    this._document.body.appendChild(testElement);
    const documentWindow = this._document.defaultView || window;
    const computedStyle = documentWindow && documentWindow.getComputedStyle ? documentWindow.getComputedStyle(testElement) : null;
    const computedColor = (computedStyle && computedStyle.backgroundColor || "").replace(/ /g, "");
    testElement.remove();
    switch (computedColor) {
      case "rgb(0,0,0)":
      case "rgb(45,50,54)":
      case "rgb(32,32,32)":
        return HighContrastMode.WHITE_ON_BLACK;
      case "rgb(255,255,255)":
      case "rgb(255,250,239)":
        return HighContrastMode.BLACK_ON_WHITE;
    }
    return HighContrastMode.NONE;
  }
  ngOnDestroy() {
    this._breakpointSubscription.unsubscribe();
  }
  /** Applies CSS classes indicating high-contrast mode to document body (browser-only). */
  _applyBodyHighContrastModeCssClasses() {
    if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {
      const bodyClasses = this._document.body.classList;
      bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
      this._hasCheckedHighContrastMode = true;
      const mode = this.getHighContrastMode();
      if (mode === HighContrastMode.BLACK_ON_WHITE) {
        bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);
      } else if (mode === HighContrastMode.WHITE_ON_BLACK) {
        bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
      }
    }
  }
};
_HighContrastModeDetector.\u0275fac = function HighContrastModeDetector_Factory(t) {
  return new (t || _HighContrastModeDetector)(\u0275\u0275inject(Platform), \u0275\u0275inject(DOCUMENT2));
};
_HighContrastModeDetector.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _HighContrastModeDetector,
  factory: _HighContrastModeDetector.\u0275fac,
  providedIn: "root"
});
var HighContrastModeDetector = _HighContrastModeDetector;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HighContrastModeDetector, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var _A11yModule = class _A11yModule {
  constructor(highContrastModeDetector) {
    highContrastModeDetector._applyBodyHighContrastModeCssClasses();
  }
};
_A11yModule.\u0275fac = function A11yModule_Factory(t) {
  return new (t || _A11yModule)(\u0275\u0275inject(HighContrastModeDetector));
};
_A11yModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _A11yModule
});
_A11yModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [ObserversModule]
});
var A11yModule = _A11yModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(A11yModule, [{
    type: NgModule,
    args: [{
      imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
      exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus]
    }]
  }], () => [{
    type: HighContrastModeDetector
  }], null);
})();

// node_modules/@angular/cdk/fesm2022/cdk.mjs
var VERSION5 = new Version("18.0.0-rc.1");

// node_modules/@angular/material/fesm2022/core.mjs
var _c0 = ["*", [["mat-option"], ["ng-container"]]];
var _c1 = ["*", "mat-option, ng-container"];
var _c2 = ["text"];
var _c3 = [[["mat-icon"]], "*"];
var _c4 = ["mat-icon", "*"];
function MatOption_Conditional_0_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "mat-pseudo-checkbox", 1);
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275property("disabled", ctx_r0.disabled)("state", ctx_r0.selected ? "checked" : "unchecked");
  }
}
function MatOption_Conditional_5_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "mat-pseudo-checkbox", 3);
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275property("disabled", ctx_r0.disabled);
  }
}
function MatOption_Conditional_6_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "span", 4);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1("(", ctx_r0.group.label, ")");
  }
}
var _c5 = ["mat-internal-form-field", ""];
var _c6 = ["*"];
var VERSION6 = new Version("18.0.0-rc.1");
var _AnimationCurves = class _AnimationCurves {
};
_AnimationCurves.STANDARD_CURVE = "cubic-bezier(0.4,0.0,0.2,1)";
_AnimationCurves.DECELERATION_CURVE = "cubic-bezier(0.0,0.0,0.2,1)";
_AnimationCurves.ACCELERATION_CURVE = "cubic-bezier(0.4,0.0,1,1)";
_AnimationCurves.SHARP_CURVE = "cubic-bezier(0.4,0.0,0.6,1)";
var AnimationCurves = _AnimationCurves;
var _AnimationDurations = class _AnimationDurations {
};
_AnimationDurations.COMPLEX = "375ms";
_AnimationDurations.ENTERING = "225ms";
_AnimationDurations.EXITING = "195ms";
var AnimationDurations = _AnimationDurations;
function MATERIAL_SANITY_CHECKS_FACTORY() {
  return true;
}
var MATERIAL_SANITY_CHECKS = new InjectionToken("mat-sanity-checks", {
  providedIn: "root",
  factory: MATERIAL_SANITY_CHECKS_FACTORY
});
var _MatCommonModule = class _MatCommonModule {
  constructor(highContrastModeDetector, _sanityChecks, _document2) {
    this._sanityChecks = _sanityChecks;
    this._document = _document2;
    this._hasDoneGlobalChecks = false;
    highContrastModeDetector._applyBodyHighContrastModeCssClasses();
    if (!this._hasDoneGlobalChecks) {
      this._hasDoneGlobalChecks = true;
      if (typeof ngDevMode === "undefined" || ngDevMode) {
        const platform = inject(Platform, {
          optional: true
        });
        if (this._checkIsEnabled("doctype")) {
          _checkDoctypeIsDefined(this._document);
        }
        if (this._checkIsEnabled("theme")) {
          _checkThemeIsPresent(this._document, !!platform?.isBrowser);
        }
        if (this._checkIsEnabled("version")) {
          _checkCdkVersionMatch();
        }
      }
    }
  }
  /** Gets whether a specific sanity check is enabled. */
  _checkIsEnabled(name) {
    if (_isTestEnvironment()) {
      return false;
    }
    if (typeof this._sanityChecks === "boolean") {
      return this._sanityChecks;
    }
    return !!this._sanityChecks[name];
  }
};
_MatCommonModule.\u0275fac = function MatCommonModule_Factory(t) {
  return new (t || _MatCommonModule)(\u0275\u0275inject(HighContrastModeDetector), \u0275\u0275inject(MATERIAL_SANITY_CHECKS, 8), \u0275\u0275inject(DOCUMENT2));
};
_MatCommonModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatCommonModule
});
_MatCommonModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [BidiModule, BidiModule]
});
var MatCommonModule = _MatCommonModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatCommonModule, [{
    type: NgModule,
    args: [{
      imports: [BidiModule],
      exports: [BidiModule]
    }]
  }], () => [{
    type: HighContrastModeDetector
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MATERIAL_SANITY_CHECKS]
    }]
  }, {
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
function _checkDoctypeIsDefined(doc) {
  if (!doc.doctype) {
    console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.");
  }
}
function _checkThemeIsPresent(doc, isBrowser) {
  if (!doc.body || !isBrowser) {
    return;
  }
  const testElement = doc.createElement("div");
  testElement.classList.add("mat-theme-loaded-marker");
  doc.body.appendChild(testElement);
  const computedStyle = getComputedStyle(testElement);
  if (computedStyle && computedStyle.display !== "none") {
    console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming");
  }
  testElement.remove();
}
function _checkCdkVersionMatch() {
  if (VERSION6.full !== VERSION5.full) {
    console.warn("The Angular Material version (" + VERSION6.full + ") does not match the Angular CDK version (" + VERSION5.full + ").\nPlease ensure the versions of these two packages exactly match.");
  }
}
var _ErrorStateTracker = class {
  constructor(_defaultMatcher, ngControl, _parentFormGroup, _parentForm, _stateChanges) {
    this._defaultMatcher = _defaultMatcher;
    this.ngControl = ngControl;
    this._parentFormGroup = _parentFormGroup;
    this._parentForm = _parentForm;
    this._stateChanges = _stateChanges;
    this.errorState = false;
  }
  /** Updates the error state based on the provided error state matcher. */
  updateErrorState() {
    const oldState = this.errorState;
    const parent = this._parentFormGroup || this._parentForm;
    const matcher = this.matcher || this._defaultMatcher;
    const control = this.ngControl ? this.ngControl.control : null;
    const newState = matcher?.isErrorState(control, parent) ?? false;
    if (newState !== oldState) {
      this.errorState = newState;
      this._stateChanges.next();
    }
  }
};
var MAT_DATE_LOCALE = new InjectionToken("MAT_DATE_LOCALE", {
  providedIn: "root",
  factory: MAT_DATE_LOCALE_FACTORY
});
function MAT_DATE_LOCALE_FACTORY() {
  return inject(LOCALE_ID);
}
var DateAdapter = class {
  constructor() {
    this._localeChanges = new Subject();
    this.localeChanges = this._localeChanges;
  }
  /**
   * Given a potential date object, returns that same date object if it is
   * a valid date, or `null` if it's not a valid date.
   * @param obj The object to check.
   * @returns A date or `null`.
   */
  getValidDateOrNull(obj) {
    return this.isDateInstance(obj) && this.isValid(obj) ? obj : null;
  }
  /**
   * Attempts to deserialize a value to a valid date object. This is different from parsing in that
   * deserialize should only accept non-ambiguous, locale-independent formats (e.g. a ISO 8601
   * string). The default implementation does not allow any deserialization, it simply checks that
   * the given value is already a valid date object or null. The `<mat-datepicker>` will call this
   * method on all of its `@Input()` properties that accept dates. It is therefore possible to
   * support passing values from your backend directly to these properties by overriding this method
   * to also deserialize the format used by your backend.
   * @param value The value to be deserialized into a date object.
   * @returns The deserialized date object, either a valid date, null if the value can be
   *     deserialized into a null date (e.g. the empty string), or an invalid date.
   */
  deserialize(value) {
    if (value == null || this.isDateInstance(value) && this.isValid(value)) {
      return value;
    }
    return this.invalid();
  }
  /**
   * Sets the locale used for all dates.
   * @param locale The new locale.
   */
  setLocale(locale) {
    this.locale = locale;
    this._localeChanges.next();
  }
  /**
   * Compares two dates.
   * @param first The first date to compare.
   * @param second The second date to compare.
   * @returns 0 if the dates are equal, a number less than 0 if the first date is earlier,
   *     a number greater than 0 if the first date is later.
   */
  compareDate(first2, second) {
    return this.getYear(first2) - this.getYear(second) || this.getMonth(first2) - this.getMonth(second) || this.getDate(first2) - this.getDate(second);
  }
  /**
   * Checks if two dates are equal.
   * @param first The first date to check.
   * @param second The second date to check.
   * @returns Whether the two dates are equal.
   *     Null dates are considered equal to other null dates.
   */
  sameDate(first2, second) {
    if (first2 && second) {
      let firstValid = this.isValid(first2);
      let secondValid = this.isValid(second);
      if (firstValid && secondValid) {
        return !this.compareDate(first2, second);
      }
      return firstValid == secondValid;
    }
    return first2 == second;
  }
  /**
   * Clamp the given date between min and max dates.
   * @param date The date to clamp.
   * @param min The minimum value to allow. If null or omitted no min is enforced.
   * @param max The maximum value to allow. If null or omitted no max is enforced.
   * @returns `min` if `date` is less than `min`, `max` if date is greater than `max`,
   *     otherwise `date`.
   */
  clampDate(date, min, max) {
    if (min && this.compareDate(date, min) < 0) {
      return min;
    }
    if (max && this.compareDate(date, max) > 0) {
      return max;
    }
    return date;
  }
};
var MAT_DATE_FORMATS = new InjectionToken("mat-date-formats");
var ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
function range(length, valueFunction) {
  const valuesArray = Array(length);
  for (let i2 = 0; i2 < length; i2++) {
    valuesArray[i2] = valueFunction(i2);
  }
  return valuesArray;
}
var _NativeDateAdapter = class _NativeDateAdapter extends DateAdapter {
  constructor(matDateLocale) {
    super();
    this.useUtcForDisplay = false;
    this._matDateLocale = inject(MAT_DATE_LOCALE, {
      optional: true
    });
    if (matDateLocale !== void 0) {
      this._matDateLocale = matDateLocale;
    }
    super.setLocale(this._matDateLocale);
  }
  getYear(date) {
    return date.getFullYear();
  }
  getMonth(date) {
    return date.getMonth();
  }
  getDate(date) {
    return date.getDate();
  }
  getDayOfWeek(date) {
    return date.getDay();
  }
  getMonthNames(style2) {
    const dtf = new Intl.DateTimeFormat(this.locale, {
      month: style2,
      timeZone: "utc"
    });
    return range(12, (i2) => this._format(dtf, new Date(2017, i2, 1)));
  }
  getDateNames() {
    const dtf = new Intl.DateTimeFormat(this.locale, {
      day: "numeric",
      timeZone: "utc"
    });
    return range(31, (i2) => this._format(dtf, new Date(2017, 0, i2 + 1)));
  }
  getDayOfWeekNames(style2) {
    const dtf = new Intl.DateTimeFormat(this.locale, {
      weekday: style2,
      timeZone: "utc"
    });
    return range(7, (i2) => this._format(dtf, new Date(2017, 0, i2 + 1)));
  }
  getYearName(date) {
    const dtf = new Intl.DateTimeFormat(this.locale, {
      year: "numeric",
      timeZone: "utc"
    });
    return this._format(dtf, date);
  }
  getFirstDayOfWeek() {
    return 0;
  }
  getNumDaysInMonth(date) {
    return this.getDate(this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0));
  }
  clone(date) {
    return new Date(date.getTime());
  }
  createDate(year, month, date) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (month < 0 || month > 11) {
        throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
      }
      if (date < 1) {
        throw Error(`Invalid date "${date}". Date has to be greater than 0.`);
      }
    }
    let result = this._createDateWithOverflow(year, month, date);
    if (result.getMonth() != month && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error(`Invalid date "${date}" for month with index "${month}".`);
    }
    return result;
  }
  today() {
    return /* @__PURE__ */ new Date();
  }
  parse(value, parseFormat) {
    if (typeof value == "number") {
      return new Date(value);
    }
    return value ? new Date(Date.parse(value)) : null;
  }
  format(date, displayFormat) {
    if (!this.isValid(date)) {
      throw Error("NativeDateAdapter: Cannot format invalid date.");
    }
    const dtf = new Intl.DateTimeFormat(this.locale, __spreadProps(__spreadValues({}, displayFormat), {
      timeZone: "utc"
    }));
    return this._format(dtf, date);
  }
  addCalendarYears(date, years) {
    return this.addCalendarMonths(date, years * 12);
  }
  addCalendarMonths(date, months) {
    let newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date));
    if (this.getMonth(newDate) != ((this.getMonth(date) + months) % 12 + 12) % 12) {
      newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);
    }
    return newDate;
  }
  addCalendarDays(date, days) {
    return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days);
  }
  toIso8601(date) {
    return [date.getUTCFullYear(), this._2digit(date.getUTCMonth() + 1), this._2digit(date.getUTCDate())].join("-");
  }
  /**
   * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
   * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
   * invalid date for all other values.
   */
  deserialize(value) {
    if (typeof value === "string") {
      if (!value) {
        return null;
      }
      if (ISO_8601_REGEX.test(value)) {
        let date = new Date(value);
        if (this.isValid(date)) {
          return date;
        }
      }
    }
    return super.deserialize(value);
  }
  isDateInstance(obj) {
    return obj instanceof Date;
  }
  isValid(date) {
    return !isNaN(date.getTime());
  }
  invalid() {
    return /* @__PURE__ */ new Date(NaN);
  }
  /** Creates a date but allows the month and date to overflow. */
  _createDateWithOverflow(year, month, date) {
    const d = /* @__PURE__ */ new Date();
    d.setFullYear(year, month, date);
    d.setHours(0, 0, 0, 0);
    return d;
  }
  /**
   * Pads a number to make it two digits.
   * @param n The number to pad.
   * @returns The padded number.
   */
  _2digit(n) {
    return ("00" + n).slice(-2);
  }
  /**
   * When converting Date object to string, javascript built-in functions may return wrong
   * results because it applies its internal DST rules. The DST rules around the world change
   * very frequently, and the current valid rule is not always valid in previous years though.
   * We work around this problem building a new Date object which has its internal UTC
   * representation with the local date and time.
   * @param dtf Intl.DateTimeFormat object, containing the desired string format. It must have
   *    timeZone set to 'utc' to work fine.
   * @param date Date from which we want to get the string representation according to dtf
   * @returns A Date object with its UTC representation based on the passed in date info
   */
  _format(dtf, date) {
    const d = /* @__PURE__ */ new Date();
    d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());
    d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
    return dtf.format(d);
  }
};
_NativeDateAdapter.\u0275fac = function NativeDateAdapter_Factory(t) {
  return new (t || _NativeDateAdapter)(\u0275\u0275inject(MAT_DATE_LOCALE, 8));
};
_NativeDateAdapter.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NativeDateAdapter,
  factory: _NativeDateAdapter.\u0275fac
});
var NativeDateAdapter = _NativeDateAdapter;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NativeDateAdapter, [{
    type: Injectable
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_DATE_LOCALE]
    }]
  }], null);
})();
var MAT_NATIVE_DATE_FORMATS = {
  parse: {
    dateInput: null
  },
  display: {
    dateInput: {
      year: "numeric",
      month: "numeric",
      day: "numeric"
    },
    monthYearLabel: {
      year: "numeric",
      month: "short"
    },
    dateA11yLabel: {
      year: "numeric",
      month: "long",
      day: "numeric"
    },
    monthYearA11yLabel: {
      year: "numeric",
      month: "long"
    }
  }
};
var _NativeDateModule = class _NativeDateModule {
};
_NativeDateModule.\u0275fac = function NativeDateModule_Factory(t) {
  return new (t || _NativeDateModule)();
};
_NativeDateModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _NativeDateModule
});
_NativeDateModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [{
    provide: DateAdapter,
    useClass: NativeDateAdapter
  }]
});
var NativeDateModule = _NativeDateModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NativeDateModule, [{
    type: NgModule,
    args: [{
      providers: [{
        provide: DateAdapter,
        useClass: NativeDateAdapter
      }]
    }]
  }], null, null);
})();
var _MatNativeDateModule = class _MatNativeDateModule {
};
_MatNativeDateModule.\u0275fac = function MatNativeDateModule_Factory(t) {
  return new (t || _MatNativeDateModule)();
};
_MatNativeDateModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatNativeDateModule
});
_MatNativeDateModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [provideNativeDateAdapter()]
});
var MatNativeDateModule = _MatNativeDateModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatNativeDateModule, [{
    type: NgModule,
    args: [{
      providers: [provideNativeDateAdapter()]
    }]
  }], null, null);
})();
function provideNativeDateAdapter(formats = MAT_NATIVE_DATE_FORMATS) {
  return [{
    provide: DateAdapter,
    useClass: NativeDateAdapter
  }, {
    provide: MAT_DATE_FORMATS,
    useValue: formats
  }];
}
var _ShowOnDirtyErrorStateMatcher = class _ShowOnDirtyErrorStateMatcher {
  isErrorState(control, form) {
    return !!(control && control.invalid && (control.dirty || form && form.submitted));
  }
};
_ShowOnDirtyErrorStateMatcher.\u0275fac = function ShowOnDirtyErrorStateMatcher_Factory(t) {
  return new (t || _ShowOnDirtyErrorStateMatcher)();
};
_ShowOnDirtyErrorStateMatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ShowOnDirtyErrorStateMatcher,
  factory: _ShowOnDirtyErrorStateMatcher.\u0275fac
});
var ShowOnDirtyErrorStateMatcher = _ShowOnDirtyErrorStateMatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ShowOnDirtyErrorStateMatcher, [{
    type: Injectable
  }], null, null);
})();
var _ErrorStateMatcher = class _ErrorStateMatcher {
  isErrorState(control, form) {
    return !!(control && control.invalid && (control.touched || form && form.submitted));
  }
};
_ErrorStateMatcher.\u0275fac = function ErrorStateMatcher_Factory(t) {
  return new (t || _ErrorStateMatcher)();
};
_ErrorStateMatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ErrorStateMatcher,
  factory: _ErrorStateMatcher.\u0275fac,
  providedIn: "root"
});
var ErrorStateMatcher = _ErrorStateMatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ErrorStateMatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _MatLine = class _MatLine {
};
_MatLine.\u0275fac = function MatLine_Factory(t) {
  return new (t || _MatLine)();
};
_MatLine.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatLine,
  selectors: [["", "mat-line", ""], ["", "matLine", ""]],
  hostAttrs: [1, "mat-line"],
  standalone: true
});
var MatLine = _MatLine;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatLine, [{
    type: Directive,
    args: [{
      selector: "[mat-line], [matLine]",
      host: {
        "class": "mat-line"
      },
      standalone: true
    }]
  }], null, null);
})();
var _MatLineModule = class _MatLineModule {
};
_MatLineModule.\u0275fac = function MatLineModule_Factory(t) {
  return new (t || _MatLineModule)();
};
_MatLineModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatLineModule
});
_MatLineModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, MatCommonModule]
});
var MatLineModule = _MatLineModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatLineModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatLine],
      exports: [MatLine, MatCommonModule]
    }]
  }], null, null);
})();
var RippleState;
(function(RippleState2) {
  RippleState2[RippleState2["FADING_IN"] = 0] = "FADING_IN";
  RippleState2[RippleState2["VISIBLE"] = 1] = "VISIBLE";
  RippleState2[RippleState2["FADING_OUT"] = 2] = "FADING_OUT";
  RippleState2[RippleState2["HIDDEN"] = 3] = "HIDDEN";
})(RippleState || (RippleState = {}));
var RippleRef = class {
  constructor(_renderer, element, config2, _animationForciblyDisabledThroughCss = false) {
    this._renderer = _renderer;
    this.element = element;
    this.config = config2;
    this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;
    this.state = RippleState.HIDDEN;
  }
  /** Fades out the ripple element. */
  fadeOut() {
    this._renderer.fadeOutRipple(this);
  }
};
var passiveCapturingEventOptions$1 = normalizePassiveListenerOptions({
  passive: true,
  capture: true
});
var RippleEventManager = class {
  constructor() {
    this._events = /* @__PURE__ */ new Map();
    this._delegateEventHandler = (event) => {
      const target = _getEventTarget(event);
      if (target) {
        this._events.get(event.type)?.forEach((handlers, element) => {
          if (element === target || element.contains(target)) {
            handlers.forEach((handler) => handler.handleEvent(event));
          }
        });
      }
    };
  }
  /** Adds an event handler. */
  addHandler(ngZone, name, element, handler) {
    const handlersForEvent = this._events.get(name);
    if (handlersForEvent) {
      const handlersForElement = handlersForEvent.get(element);
      if (handlersForElement) {
        handlersForElement.add(handler);
      } else {
        handlersForEvent.set(element, /* @__PURE__ */ new Set([handler]));
      }
    } else {
      this._events.set(name, /* @__PURE__ */ new Map([[element, /* @__PURE__ */ new Set([handler])]]));
      ngZone.runOutsideAngular(() => {
        document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
      });
    }
  }
  /** Removes an event handler. */
  removeHandler(name, element, handler) {
    const handlersForEvent = this._events.get(name);
    if (!handlersForEvent) {
      return;
    }
    const handlersForElement = handlersForEvent.get(element);
    if (!handlersForElement) {
      return;
    }
    handlersForElement.delete(handler);
    if (handlersForElement.size === 0) {
      handlersForEvent.delete(element);
    }
    if (handlersForEvent.size === 0) {
      this._events.delete(name);
      document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);
    }
  }
};
var defaultRippleAnimationConfig = {
  enterDuration: 225,
  exitDuration: 150
};
var ignoreMouseEventsTimeout = 800;
var passiveCapturingEventOptions = normalizePassiveListenerOptions({
  passive: true,
  capture: true
});
var pointerDownEvents = ["mousedown", "touchstart"];
var pointerUpEvents = ["mouseup", "mouseleave", "touchend", "touchcancel"];
var _RippleRenderer = class _RippleRenderer {
  constructor(_target, _ngZone, elementOrElementRef, _platform) {
    this._target = _target;
    this._ngZone = _ngZone;
    this._platform = _platform;
    this._isPointerDown = false;
    this._activeRipples = /* @__PURE__ */ new Map();
    this._pointerUpEventsRegistered = false;
    if (_platform.isBrowser) {
      this._containerElement = coerceElement(elementOrElementRef);
    }
  }
  /**
   * Fades in a ripple at the given coordinates.
   * @param x Coordinate within the element, along the X axis at which to start the ripple.
   * @param y Coordinate within the element, along the Y axis at which to start the ripple.
   * @param config Extra ripple options.
   */
  fadeInRipple(x, y, config2 = {}) {
    const containerRect = this._containerRect = this._containerRect || this._containerElement.getBoundingClientRect();
    const animationConfig = __spreadValues(__spreadValues({}, defaultRippleAnimationConfig), config2.animation);
    if (config2.centered) {
      x = containerRect.left + containerRect.width / 2;
      y = containerRect.top + containerRect.height / 2;
    }
    const radius = config2.radius || distanceToFurthestCorner(x, y, containerRect);
    const offsetX = x - containerRect.left;
    const offsetY = y - containerRect.top;
    const enterDuration = animationConfig.enterDuration;
    const ripple = document.createElement("div");
    ripple.classList.add("mat-ripple-element");
    ripple.style.left = `${offsetX - radius}px`;
    ripple.style.top = `${offsetY - radius}px`;
    ripple.style.height = `${radius * 2}px`;
    ripple.style.width = `${radius * 2}px`;
    if (config2.color != null) {
      ripple.style.backgroundColor = config2.color;
    }
    ripple.style.transitionDuration = `${enterDuration}ms`;
    this._containerElement.appendChild(ripple);
    const computedStyles = window.getComputedStyle(ripple);
    const userTransitionProperty = computedStyles.transitionProperty;
    const userTransitionDuration = computedStyles.transitionDuration;
    const animationForciblyDisabledThroughCss = userTransitionProperty === "none" || // Note: The canonical unit for serialized CSS `<time>` properties is seconds. Additionally
    // some browsers expand the duration for every property (in our case `opacity` and `transform`).
    userTransitionDuration === "0s" || userTransitionDuration === "0s, 0s" || // If the container is 0x0, it's likely `display: none`.
    containerRect.width === 0 && containerRect.height === 0;
    const rippleRef = new RippleRef(this, ripple, config2, animationForciblyDisabledThroughCss);
    ripple.style.transform = "scale3d(1, 1, 1)";
    rippleRef.state = RippleState.FADING_IN;
    if (!config2.persistent) {
      this._mostRecentTransientRipple = rippleRef;
    }
    let eventListeners = null;
    if (!animationForciblyDisabledThroughCss && (enterDuration || animationConfig.exitDuration)) {
      this._ngZone.runOutsideAngular(() => {
        const onTransitionEnd = () => this._finishRippleTransition(rippleRef);
        const onTransitionCancel = () => this._destroyRipple(rippleRef);
        ripple.addEventListener("transitionend", onTransitionEnd);
        ripple.addEventListener("transitioncancel", onTransitionCancel);
        eventListeners = {
          onTransitionEnd,
          onTransitionCancel
        };
      });
    }
    this._activeRipples.set(rippleRef, eventListeners);
    if (animationForciblyDisabledThroughCss || !enterDuration) {
      this._finishRippleTransition(rippleRef);
    }
    return rippleRef;
  }
  /** Fades out a ripple reference. */
  fadeOutRipple(rippleRef) {
    if (rippleRef.state === RippleState.FADING_OUT || rippleRef.state === RippleState.HIDDEN) {
      return;
    }
    const rippleEl = rippleRef.element;
    const animationConfig = __spreadValues(__spreadValues({}, defaultRippleAnimationConfig), rippleRef.config.animation);
    rippleEl.style.transitionDuration = `${animationConfig.exitDuration}ms`;
    rippleEl.style.opacity = "0";
    rippleRef.state = RippleState.FADING_OUT;
    if (rippleRef._animationForciblyDisabledThroughCss || !animationConfig.exitDuration) {
      this._finishRippleTransition(rippleRef);
    }
  }
  /** Fades out all currently active ripples. */
  fadeOutAll() {
    this._getActiveRipples().forEach((ripple) => ripple.fadeOut());
  }
  /** Fades out all currently active non-persistent ripples. */
  fadeOutAllNonPersistent() {
    this._getActiveRipples().forEach((ripple) => {
      if (!ripple.config.persistent) {
        ripple.fadeOut();
      }
    });
  }
  /** Sets up the trigger event listeners */
  setupTriggerEvents(elementOrElementRef) {
    const element = coerceElement(elementOrElementRef);
    if (!this._platform.isBrowser || !element || element === this._triggerElement) {
      return;
    }
    this._removeTriggerEvents();
    this._triggerElement = element;
    pointerDownEvents.forEach((type) => {
      _RippleRenderer._eventManager.addHandler(this._ngZone, type, element, this);
    });
  }
  /**
   * Handles all registered events.
   * @docs-private
   */
  handleEvent(event) {
    if (event.type === "mousedown") {
      this._onMousedown(event);
    } else if (event.type === "touchstart") {
      this._onTouchStart(event);
    } else {
      this._onPointerUp();
    }
    if (!this._pointerUpEventsRegistered) {
      this._ngZone.runOutsideAngular(() => {
        pointerUpEvents.forEach((type) => {
          this._triggerElement.addEventListener(type, this, passiveCapturingEventOptions);
        });
      });
      this._pointerUpEventsRegistered = true;
    }
  }
  /** Method that will be called if the fade-in or fade-in transition completed. */
  _finishRippleTransition(rippleRef) {
    if (rippleRef.state === RippleState.FADING_IN) {
      this._startFadeOutTransition(rippleRef);
    } else if (rippleRef.state === RippleState.FADING_OUT) {
      this._destroyRipple(rippleRef);
    }
  }
  /**
   * Starts the fade-out transition of the given ripple if it's not persistent and the pointer
   * is not held down anymore.
   */
  _startFadeOutTransition(rippleRef) {
    const isMostRecentTransientRipple = rippleRef === this._mostRecentTransientRipple;
    const {
      persistent
    } = rippleRef.config;
    rippleRef.state = RippleState.VISIBLE;
    if (!persistent && (!isMostRecentTransientRipple || !this._isPointerDown)) {
      rippleRef.fadeOut();
    }
  }
  /** Destroys the given ripple by removing it from the DOM and updating its state. */
  _destroyRipple(rippleRef) {
    const eventListeners = this._activeRipples.get(rippleRef) ?? null;
    this._activeRipples.delete(rippleRef);
    if (!this._activeRipples.size) {
      this._containerRect = null;
    }
    if (rippleRef === this._mostRecentTransientRipple) {
      this._mostRecentTransientRipple = null;
    }
    rippleRef.state = RippleState.HIDDEN;
    if (eventListeners !== null) {
      rippleRef.element.removeEventListener("transitionend", eventListeners.onTransitionEnd);
      rippleRef.element.removeEventListener("transitioncancel", eventListeners.onTransitionCancel);
    }
    rippleRef.element.remove();
  }
  /** Function being called whenever the trigger is being pressed using mouse. */
  _onMousedown(event) {
    const isFakeMousedown = isFakeMousedownFromScreenReader(event);
    const isSyntheticEvent = this._lastTouchStartEvent && Date.now() < this._lastTouchStartEvent + ignoreMouseEventsTimeout;
    if (!this._target.rippleDisabled && !isFakeMousedown && !isSyntheticEvent) {
      this._isPointerDown = true;
      this.fadeInRipple(event.clientX, event.clientY, this._target.rippleConfig);
    }
  }
  /** Function being called whenever the trigger is being pressed using touch. */
  _onTouchStart(event) {
    if (!this._target.rippleDisabled && !isFakeTouchstartFromScreenReader(event)) {
      this._lastTouchStartEvent = Date.now();
      this._isPointerDown = true;
      const touches = event.changedTouches;
      if (touches) {
        for (let i2 = 0; i2 < touches.length; i2++) {
          this.fadeInRipple(touches[i2].clientX, touches[i2].clientY, this._target.rippleConfig);
        }
      }
    }
  }
  /** Function being called whenever the trigger is being released. */
  _onPointerUp() {
    if (!this._isPointerDown) {
      return;
    }
    this._isPointerDown = false;
    this._getActiveRipples().forEach((ripple) => {
      const isVisible = ripple.state === RippleState.VISIBLE || ripple.config.terminateOnPointerUp && ripple.state === RippleState.FADING_IN;
      if (!ripple.config.persistent && isVisible) {
        ripple.fadeOut();
      }
    });
  }
  _getActiveRipples() {
    return Array.from(this._activeRipples.keys());
  }
  /** Removes previously registered event listeners from the trigger element. */
  _removeTriggerEvents() {
    const trigger2 = this._triggerElement;
    if (trigger2) {
      pointerDownEvents.forEach((type) => _RippleRenderer._eventManager.removeHandler(type, trigger2, this));
      if (this._pointerUpEventsRegistered) {
        pointerUpEvents.forEach((type) => trigger2.removeEventListener(type, this, passiveCapturingEventOptions));
      }
    }
  }
};
_RippleRenderer._eventManager = new RippleEventManager();
var RippleRenderer = _RippleRenderer;
function distanceToFurthestCorner(x, y, rect) {
  const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
  const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
  return Math.sqrt(distX * distX + distY * distY);
}
var MAT_RIPPLE_GLOBAL_OPTIONS = new InjectionToken("mat-ripple-global-options");
var _MatRipple = class _MatRipple {
  /**
   * Whether click events will not trigger the ripple. Ripples can be still launched manually
   * by using the `launch()` method.
   */
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    if (value) {
      this.fadeOutAllNonPersistent();
    }
    this._disabled = value;
    this._setupTriggerEventsIfEnabled();
  }
  /**
   * The element that triggers the ripple when click events are received.
   * Defaults to the directive's host element.
   */
  get trigger() {
    return this._trigger || this._elementRef.nativeElement;
  }
  set trigger(trigger2) {
    this._trigger = trigger2;
    this._setupTriggerEventsIfEnabled();
  }
  constructor(_elementRef, ngZone, platform, globalOptions, _animationMode) {
    this._elementRef = _elementRef;
    this._animationMode = _animationMode;
    this.radius = 0;
    this._disabled = false;
    this._isInitialized = false;
    this._globalOptions = globalOptions || {};
    this._rippleRenderer = new RippleRenderer(this, ngZone, _elementRef, platform);
  }
  ngOnInit() {
    this._isInitialized = true;
    this._setupTriggerEventsIfEnabled();
  }
  ngOnDestroy() {
    this._rippleRenderer._removeTriggerEvents();
  }
  /** Fades out all currently showing ripple elements. */
  fadeOutAll() {
    this._rippleRenderer.fadeOutAll();
  }
  /** Fades out all currently showing non-persistent ripple elements. */
  fadeOutAllNonPersistent() {
    this._rippleRenderer.fadeOutAllNonPersistent();
  }
  /**
   * Ripple configuration from the directive's input values.
   * @docs-private Implemented as part of RippleTarget
   */
  get rippleConfig() {
    return {
      centered: this.centered,
      radius: this.radius,
      color: this.color,
      animation: __spreadValues(__spreadValues(__spreadValues({}, this._globalOptions.animation), this._animationMode === "NoopAnimations" ? {
        enterDuration: 0,
        exitDuration: 0
      } : {}), this.animation),
      terminateOnPointerUp: this._globalOptions.terminateOnPointerUp
    };
  }
  /**
   * Whether ripples on pointer-down are disabled or not.
   * @docs-private Implemented as part of RippleTarget
   */
  get rippleDisabled() {
    return this.disabled || !!this._globalOptions.disabled;
  }
  /** Sets up the trigger event listeners if ripples are enabled. */
  _setupTriggerEventsIfEnabled() {
    if (!this.disabled && this._isInitialized) {
      this._rippleRenderer.setupTriggerEvents(this.trigger);
    }
  }
  /** Launches a manual ripple at the specified coordinated or just by the ripple config. */
  launch(configOrX, y = 0, config2) {
    if (typeof configOrX === "number") {
      return this._rippleRenderer.fadeInRipple(configOrX, y, __spreadValues(__spreadValues({}, this.rippleConfig), config2));
    } else {
      return this._rippleRenderer.fadeInRipple(0, 0, __spreadValues(__spreadValues({}, this.rippleConfig), configOrX));
    }
  }
};
_MatRipple.\u0275fac = function MatRipple_Factory(t) {
  return new (t || _MatRipple)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(MAT_RIPPLE_GLOBAL_OPTIONS, 8), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatRipple.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatRipple,
  selectors: [["", "mat-ripple", ""], ["", "matRipple", ""]],
  hostAttrs: [1, "mat-ripple"],
  hostVars: 2,
  hostBindings: function MatRipple_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mat-ripple-unbounded", ctx.unbounded);
    }
  },
  inputs: {
    color: [0, "matRippleColor", "color"],
    unbounded: [0, "matRippleUnbounded", "unbounded"],
    centered: [0, "matRippleCentered", "centered"],
    radius: [0, "matRippleRadius", "radius"],
    animation: [0, "matRippleAnimation", "animation"],
    disabled: [0, "matRippleDisabled", "disabled"],
    trigger: [0, "matRippleTrigger", "trigger"]
  },
  exportAs: ["matRipple"],
  standalone: true
});
var MatRipple = _MatRipple;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRipple, [{
    type: Directive,
    args: [{
      selector: "[mat-ripple], [matRipple]",
      exportAs: "matRipple",
      host: {
        "class": "mat-ripple",
        "[class.mat-ripple-unbounded]": "unbounded"
      },
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: NgZone
  }, {
    type: Platform
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_RIPPLE_GLOBAL_OPTIONS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], {
    color: [{
      type: Input,
      args: ["matRippleColor"]
    }],
    unbounded: [{
      type: Input,
      args: ["matRippleUnbounded"]
    }],
    centered: [{
      type: Input,
      args: ["matRippleCentered"]
    }],
    radius: [{
      type: Input,
      args: ["matRippleRadius"]
    }],
    animation: [{
      type: Input,
      args: ["matRippleAnimation"]
    }],
    disabled: [{
      type: Input,
      args: ["matRippleDisabled"]
    }],
    trigger: [{
      type: Input,
      args: ["matRippleTrigger"]
    }]
  });
})();
var _MatRippleModule = class _MatRippleModule {
};
_MatRippleModule.\u0275fac = function MatRippleModule_Factory(t) {
  return new (t || _MatRippleModule)();
};
_MatRippleModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatRippleModule
});
_MatRippleModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, MatCommonModule]
});
var MatRippleModule = _MatRippleModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRippleModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatRipple],
      exports: [MatRipple, MatCommonModule]
    }]
  }], null, null);
})();
var _MatPseudoCheckbox = class _MatPseudoCheckbox {
  constructor(_animationMode) {
    this._animationMode = _animationMode;
    this.state = "unchecked";
    this.disabled = false;
    this.appearance = "full";
  }
};
_MatPseudoCheckbox.\u0275fac = function MatPseudoCheckbox_Factory(t) {
  return new (t || _MatPseudoCheckbox)(\u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatPseudoCheckbox.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatPseudoCheckbox,
  selectors: [["mat-pseudo-checkbox"]],
  hostAttrs: [1, "mat-pseudo-checkbox"],
  hostVars: 12,
  hostBindings: function MatPseudoCheckbox_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mat-pseudo-checkbox-indeterminate", ctx.state === "indeterminate")("mat-pseudo-checkbox-checked", ctx.state === "checked")("mat-pseudo-checkbox-disabled", ctx.disabled)("mat-pseudo-checkbox-minimal", ctx.appearance === "minimal")("mat-pseudo-checkbox-full", ctx.appearance === "full")("_mat-animation-noopable", ctx._animationMode === "NoopAnimations");
    }
  },
  inputs: {
    state: "state",
    disabled: "disabled",
    appearance: "appearance"
  },
  standalone: true,
  features: [\u0275\u0275StandaloneFeature],
  decls: 0,
  vars: 0,
  template: function MatPseudoCheckbox_Template(rf, ctx) {
  },
  styles: ['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color)}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color);border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color);border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}'],
  encapsulation: 2,
  changeDetection: 0
});
var MatPseudoCheckbox = _MatPseudoCheckbox;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPseudoCheckbox, [{
    type: Component,
    args: [{
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      selector: "mat-pseudo-checkbox",
      template: "",
      host: {
        "class": "mat-pseudo-checkbox",
        "[class.mat-pseudo-checkbox-indeterminate]": 'state === "indeterminate"',
        "[class.mat-pseudo-checkbox-checked]": 'state === "checked"',
        "[class.mat-pseudo-checkbox-disabled]": "disabled",
        "[class.mat-pseudo-checkbox-minimal]": 'appearance === "minimal"',
        "[class.mat-pseudo-checkbox-full]": 'appearance === "full"',
        "[class._mat-animation-noopable]": '_animationMode === "NoopAnimations"'
      },
      standalone: true,
      styles: ['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color)}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color);border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color);border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}']
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], {
    state: [{
      type: Input
    }],
    disabled: [{
      type: Input
    }],
    appearance: [{
      type: Input
    }]
  });
})();
var _MatPseudoCheckboxModule = class _MatPseudoCheckboxModule {
};
_MatPseudoCheckboxModule.\u0275fac = function MatPseudoCheckboxModule_Factory(t) {
  return new (t || _MatPseudoCheckboxModule)();
};
_MatPseudoCheckboxModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatPseudoCheckboxModule
});
_MatPseudoCheckboxModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule]
});
var MatPseudoCheckboxModule = _MatPseudoCheckboxModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPseudoCheckboxModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatPseudoCheckbox],
      exports: [MatPseudoCheckbox]
    }]
  }], null, null);
})();
var MAT_OPTION_PARENT_COMPONENT = new InjectionToken("MAT_OPTION_PARENT_COMPONENT");
var _uniqueOptgroupIdCounter = 0;
var MAT_OPTGROUP = new InjectionToken("MatOptgroup");
var _MatOptgroup = class _MatOptgroup {
  constructor(parent) {
    this.disabled = false;
    this._labelId = `mat-optgroup-label-${_uniqueOptgroupIdCounter++}`;
    this._inert = parent?.inertGroups ?? false;
  }
};
_MatOptgroup.\u0275fac = function MatOptgroup_Factory(t) {
  return new (t || _MatOptgroup)(\u0275\u0275directiveInject(MAT_OPTION_PARENT_COMPONENT, 8));
};
_MatOptgroup.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatOptgroup,
  selectors: [["mat-optgroup"]],
  hostAttrs: [1, "mat-mdc-optgroup"],
  hostVars: 3,
  hostBindings: function MatOptgroup_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("role", ctx._inert ? null : "group")("aria-disabled", ctx._inert ? null : ctx.disabled.toString())("aria-labelledby", ctx._inert ? null : ctx._labelId);
    }
  },
  inputs: {
    label: "label",
    disabled: [2, "disabled", "disabled", booleanAttribute]
  },
  exportAs: ["matOptgroup"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_OPTGROUP,
    useExisting: _MatOptgroup
  }]), \u0275\u0275InputTransformsFeature, \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c1,
  decls: 5,
  vars: 4,
  consts: [["role", "presentation", 1, "mat-mdc-optgroup-label", 3, "id"], [1, "mdc-list-item__primary-text"]],
  template: function MatOptgroup_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c0);
      \u0275\u0275elementStart(0, "span", 0)(1, "span", 1);
      \u0275\u0275text(2);
      \u0275\u0275projection(3);
      \u0275\u0275elementEnd()();
      \u0275\u0275projection(4, 1);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-list-item--disabled", ctx.disabled);
      \u0275\u0275property("id", ctx._labelId);
      \u0275\u0275advance(2);
      \u0275\u0275textInterpolate1("", ctx.label, " ");
    }
  },
  styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color);font-family:var(--mat-optgroup-label-text-font);line-height:var(--mat-optgroup-label-text-line-height);font-size:var(--mat-optgroup-label-text-size);letter-spacing:var(--mat-optgroup-label-text-tracking);font-weight:var(--mat-optgroup-label-text-weight)}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;min-height:48px}.mat-mdc-optgroup-label:focus{outline:none}[dir=rtl] .mat-mdc-optgroup-label,.mat-mdc-optgroup-label[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal}"],
  encapsulation: 2,
  changeDetection: 0
});
var MatOptgroup = _MatOptgroup;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOptgroup, [{
    type: Component,
    args: [{
      selector: "mat-optgroup",
      exportAs: "matOptgroup",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      host: {
        "class": "mat-mdc-optgroup",
        "[attr.role]": '_inert ? null : "group"',
        "[attr.aria-disabled]": "_inert ? null : disabled.toString()",
        "[attr.aria-labelledby]": "_inert ? null : _labelId"
      },
      providers: [{
        provide: MAT_OPTGROUP,
        useExisting: MatOptgroup
      }],
      standalone: true,
      template: '<span\n  class="mat-mdc-optgroup-label"\n  role="presentation"\n  [class.mdc-list-item--disabled]="disabled"\n  [id]="_labelId">\n  <span class="mdc-list-item__primary-text">{{ label }} <ng-content></ng-content></span>\n</span>\n\n<ng-content select="mat-option, ng-container"></ng-content>\n',
      styles: [".mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color);font-family:var(--mat-optgroup-label-text-font);line-height:var(--mat-optgroup-label-text-line-height);font-size:var(--mat-optgroup-label-text-size);letter-spacing:var(--mat-optgroup-label-text-tracking);font-weight:var(--mat-optgroup-label-text-weight)}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;min-height:48px}.mat-mdc-optgroup-label:focus{outline:none}[dir=rtl] .mat-mdc-optgroup-label,.mat-mdc-optgroup-label[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal}"]
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [MAT_OPTION_PARENT_COMPONENT]
    }, {
      type: Optional
    }]
  }], {
    label: [{
      type: Input
    }],
    disabled: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }]
  });
})();
var _uniqueIdCounter = 0;
var MatOptionSelectionChange = class {
  constructor(source, isUserInput = false) {
    this.source = source;
    this.isUserInput = isUserInput;
  }
};
var _MatOption = class _MatOption {
  /** Whether the wrapping component is in multiple selection mode. */
  get multiple() {
    return this._parent && this._parent.multiple;
  }
  /** Whether or not the option is currently selected. */
  get selected() {
    return this._selected;
  }
  /** Whether the option is disabled. */
  get disabled() {
    return this.group && this.group.disabled || this._disabled;
  }
  set disabled(value) {
    this._disabled = value;
  }
  /** Whether ripples for the option are disabled. */
  get disableRipple() {
    return !!(this._parent && this._parent.disableRipple);
  }
  /** Whether to display checkmark for single-selection. */
  get hideSingleSelectionIndicator() {
    return !!(this._parent && this._parent.hideSingleSelectionIndicator);
  }
  constructor(_element, _changeDetectorRef, _parent, group2) {
    this._element = _element;
    this._changeDetectorRef = _changeDetectorRef;
    this._parent = _parent;
    this.group = group2;
    this._selected = false;
    this._active = false;
    this._disabled = false;
    this._mostRecentViewValue = "";
    this.id = `mat-option-${_uniqueIdCounter++}`;
    this.onSelectionChange = new EventEmitter();
    this._stateChanges = new Subject();
  }
  /**
   * Whether or not the option is currently active and ready to be selected.
   * An active option displays styles as if it is focused, but the
   * focus is actually retained somewhere else. This comes in handy
   * for components like autocomplete where focus must remain on the input.
   */
  get active() {
    return this._active;
  }
  /**
   * The displayed value of the option. It is necessary to show the selected option in the
   * select's trigger.
   */
  get viewValue() {
    return (this._text?.nativeElement.textContent || "").trim();
  }
  /** Selects the option. */
  select(emitEvent = true) {
    if (!this._selected) {
      this._selected = true;
      this._changeDetectorRef.markForCheck();
      if (emitEvent) {
        this._emitSelectionChangeEvent();
      }
    }
  }
  /** Deselects the option. */
  deselect(emitEvent = true) {
    if (this._selected) {
      this._selected = false;
      this._changeDetectorRef.markForCheck();
      if (emitEvent) {
        this._emitSelectionChangeEvent();
      }
    }
  }
  /** Sets focus onto this option. */
  focus(_origin, options) {
    const element = this._getHostElement();
    if (typeof element.focus === "function") {
      element.focus(options);
    }
  }
  /**
   * This method sets display styles on the option to make it appear
   * active. This is used by the ActiveDescendantKeyManager so key
   * events will display the proper options as active on arrow key events.
   */
  setActiveStyles() {
    if (!this._active) {
      this._active = true;
      this._changeDetectorRef.markForCheck();
    }
  }
  /**
   * This method removes display styles on the option that made it appear
   * active. This is used by the ActiveDescendantKeyManager so key
   * events will display the proper options as active on arrow key events.
   */
  setInactiveStyles() {
    if (this._active) {
      this._active = false;
      this._changeDetectorRef.markForCheck();
    }
  }
  /** Gets the label to be used when determining whether the option should be focused. */
  getLabel() {
    return this.viewValue;
  }
  /** Ensures the option is selected when activated from the keyboard. */
  _handleKeydown(event) {
    if ((event.keyCode === ENTER || event.keyCode === SPACE) && !hasModifierKey(event)) {
      this._selectViaInteraction();
      event.preventDefault();
    }
  }
  /**
   * `Selects the option while indicating the selection came from the user. Used to
   * determine if the select's view -> model callback should be invoked.`
   */
  _selectViaInteraction() {
    if (!this.disabled) {
      this._selected = this.multiple ? !this._selected : true;
      this._changeDetectorRef.markForCheck();
      this._emitSelectionChangeEvent(true);
    }
  }
  /** Returns the correct tabindex for the option depending on disabled state. */
  // This method is only used by `MatLegacyOption`. Keeping it here to avoid breaking the types.
  // That's because `MatLegacyOption` use `MatOption` type in a few places such as
  // `MatOptionSelectionChange`. It is safe to delete this when `MatLegacyOption` is deleted.
  _getTabIndex() {
    return this.disabled ? "-1" : "0";
  }
  /** Gets the host DOM element. */
  _getHostElement() {
    return this._element.nativeElement;
  }
  ngAfterViewChecked() {
    if (this._selected) {
      const viewValue = this.viewValue;
      if (viewValue !== this._mostRecentViewValue) {
        if (this._mostRecentViewValue) {
          this._stateChanges.next();
        }
        this._mostRecentViewValue = viewValue;
      }
    }
  }
  ngOnDestroy() {
    this._stateChanges.complete();
  }
  /** Emits the selection change event. */
  _emitSelectionChangeEvent(isUserInput = false) {
    this.onSelectionChange.emit(new MatOptionSelectionChange(this, isUserInput));
  }
};
_MatOption.\u0275fac = function MatOption_Factory(t) {
  return new (t || _MatOption)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(MAT_OPTION_PARENT_COMPONENT, 8), \u0275\u0275directiveInject(MAT_OPTGROUP, 8));
};
_MatOption.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatOption,
  selectors: [["mat-option"]],
  viewQuery: function MatOption_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c2, 7);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._text = _t.first);
    }
  },
  hostAttrs: ["role", "option", 1, "mat-mdc-option", "mdc-list-item"],
  hostVars: 11,
  hostBindings: function MatOption_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("click", function MatOption_click_HostBindingHandler() {
        return ctx._selectViaInteraction();
      })("keydown", function MatOption_keydown_HostBindingHandler($event) {
        return ctx._handleKeydown($event);
      });
    }
    if (rf & 2) {
      \u0275\u0275hostProperty("id", ctx.id);
      \u0275\u0275attribute("aria-selected", ctx.selected)("aria-disabled", ctx.disabled.toString());
      \u0275\u0275classProp("mdc-list-item--selected", ctx.selected)("mat-mdc-option-multiple", ctx.multiple)("mat-mdc-option-active", ctx.active)("mdc-list-item--disabled", ctx.disabled);
    }
  },
  inputs: {
    value: "value",
    id: "id",
    disabled: [2, "disabled", "disabled", booleanAttribute]
  },
  outputs: {
    onSelectionChange: "onSelectionChange"
  },
  exportAs: ["matOption"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c4,
  decls: 8,
  vars: 5,
  consts: [["text", ""], ["aria-hidden", "true", 1, "mat-mdc-option-pseudo-checkbox", 3, "disabled", "state"], [1, "mdc-list-item__primary-text"], ["state", "checked", "aria-hidden", "true", "appearance", "minimal", 1, "mat-mdc-option-pseudo-checkbox", 3, "disabled"], [1, "cdk-visually-hidden"], ["aria-hidden", "true", "mat-ripple", "", 1, "mat-mdc-option-ripple", "mat-mdc-focus-indicator", 3, "matRippleTrigger", "matRippleDisabled"]],
  template: function MatOption_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c3);
      \u0275\u0275template(0, MatOption_Conditional_0_Template, 1, 2, "mat-pseudo-checkbox", 1);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 2, 0);
      \u0275\u0275projection(4, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275template(5, MatOption_Conditional_5_Template, 1, 1, "mat-pseudo-checkbox", 3)(6, MatOption_Conditional_6_Template, 2, 1, "span", 4);
      \u0275\u0275element(7, "div", 5);
    }
    if (rf & 2) {
      \u0275\u0275conditional(ctx.multiple ? 0 : -1);
      \u0275\u0275advance(5);
      \u0275\u0275conditional(!ctx.multiple && ctx.selected && !ctx.hideSingleSelectionIndicator ? 5 : -1);
      \u0275\u0275advance();
      \u0275\u0275conditional(ctx.group && ctx.group._inert ? 6 : -1);
      \u0275\u0275advance();
      \u0275\u0275property("matRippleTrigger", ctx._getHostElement())("matRippleDisabled", ctx.disabled || ctx.disableRipple);
    }
  },
  dependencies: [MatPseudoCheckbox, MatRipple],
  styles: ['.mat-mdc-option{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color);font-family:var(--mat-option-label-text-font);line-height:var(--mat-option-label-text-line-height);font-size:var(--mat-option-label-text-size);letter-spacing:var(--mat-option-label-text-tracking);font-weight:var(--mat-option-label-text-weight);min-height:48px}.mat-mdc-option:focus{outline:none}[dir=rtl] .mat-mdc-option,.mat-mdc-option[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color)}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color)}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color)}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color)}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-mdc-focus-indicator::before{content:""}'],
  encapsulation: 2,
  changeDetection: 0
});
var MatOption = _MatOption;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOption, [{
    type: Component,
    args: [{
      selector: "mat-option",
      exportAs: "matOption",
      host: {
        "role": "option",
        "[class.mdc-list-item--selected]": "selected",
        "[class.mat-mdc-option-multiple]": "multiple",
        "[class.mat-mdc-option-active]": "active",
        "[class.mdc-list-item--disabled]": "disabled",
        "[id]": "id",
        // Set aria-selected to false for non-selected items and true for selected items. Conform to
        // [WAI ARIA Listbox authoring practices guide](
        //  https://www.w3.org/WAI/ARIA/apg/patterns/listbox/), "If any options are selected, each
        // selected option has either aria-selected or aria-checked  set to true. All options that are
        // selectable but not selected have either aria-selected or aria-checked set to false." Align
        // aria-selected implementation of Chips and List components.
        //
        // Set `aria-selected="false"` on not-selected listbox options to fix VoiceOver announcing
        // every option as "selected" (#21491).
        "[attr.aria-selected]": "selected",
        "[attr.aria-disabled]": "disabled.toString()",
        "(click)": "_selectViaInteraction()",
        "(keydown)": "_handleKeydown($event)",
        "class": "mat-mdc-option mdc-list-item"
      },
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      imports: [MatPseudoCheckbox, MatRipple],
      template: `<!-- Set aria-hidden="true" to this DOM node and other decorative nodes in this file. This might
 be contributing to issue where sometimes VoiceOver focuses on a TextNode in the a11y tree instead
 of the Option node (#23202). Most assistive technology will generally ignore non-role,
 non-text-content elements. Adding aria-hidden seems to make VoiceOver behave more consistently. -->
@if (multiple) {
    <mat-pseudo-checkbox
        class="mat-mdc-option-pseudo-checkbox"
        [disabled]="disabled"
        [state]="selected ? 'checked' : 'unchecked'"
        aria-hidden="true"></mat-pseudo-checkbox>
}

<ng-content select="mat-icon"></ng-content>

<span class="mdc-list-item__primary-text" #text><ng-content></ng-content></span>

<!-- Render checkmark at the end for single-selection. -->
@if (!multiple && selected && !hideSingleSelectionIndicator) {
    <mat-pseudo-checkbox
        class="mat-mdc-option-pseudo-checkbox"
        [disabled]="disabled"
        state="checked"
        aria-hidden="true"
        appearance="minimal"></mat-pseudo-checkbox>
}

<!-- See a11y notes inside optgroup.ts for context behind this element. -->
@if (group && group._inert) {
    <span class="cdk-visually-hidden">({{ group.label }})</span>
}

<div class="mat-mdc-option-ripple mat-mdc-focus-indicator" aria-hidden="true" mat-ripple
     [matRippleTrigger]="_getHostElement()" [matRippleDisabled]="disabled || disableRipple">
</div>
`,
      styles: ['.mat-mdc-option{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:16px;padding-right:16px;-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color);font-family:var(--mat-option-label-text-font);line-height:var(--mat-option-label-text-line-height);font-size:var(--mat-option-label-text-size);letter-spacing:var(--mat-option-label-text-tracking);font-weight:var(--mat-option-label-text-weight);min-height:48px}.mat-mdc-option:focus{outline:none}[dir=rtl] .mat-mdc-option,.mat-mdc-option[dir=rtl]{padding-left:16px;padding-right:16px}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color)}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color)}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color)}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color)}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-mdc-focus-indicator::before{content:""}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: ChangeDetectorRef
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_OPTION_PARENT_COMPONENT]
    }]
  }, {
    type: MatOptgroup,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_OPTGROUP]
    }]
  }], {
    value: [{
      type: Input
    }],
    id: [{
      type: Input
    }],
    disabled: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    onSelectionChange: [{
      type: Output
    }],
    _text: [{
      type: ViewChild,
      args: ["text", {
        static: true
      }]
    }]
  });
})();
function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
  if (optionGroups.length) {
    let optionsArray = options.toArray();
    let groups = optionGroups.toArray();
    let groupCounter = 0;
    for (let i2 = 0; i2 < optionIndex + 1; i2++) {
      if (optionsArray[i2].group && optionsArray[i2].group === groups[groupCounter]) {
        groupCounter++;
      }
    }
    return groupCounter;
  }
  return 0;
}
function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
  if (optionOffset < currentScrollPosition) {
    return optionOffset;
  }
  if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
    return Math.max(0, optionOffset - panelHeight + optionHeight);
  }
  return currentScrollPosition;
}
var _MatOptionModule = class _MatOptionModule {
};
_MatOptionModule.\u0275fac = function MatOptionModule_Factory(t) {
  return new (t || _MatOptionModule)();
};
_MatOptionModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatOptionModule
});
_MatOptionModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule]
});
var MatOptionModule = _MatOptionModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatOptionModule, [{
    type: NgModule,
    args: [{
      imports: [MatRippleModule, MatCommonModule, MatPseudoCheckboxModule, MatOption, MatOptgroup],
      exports: [MatOption, MatOptgroup]
    }]
  }], null, null);
})();
var eventListenerOptions2 = {
  capture: true
};
var rippleInteractionEvents = ["focus", "click", "mouseenter", "touchstart"];
var matRippleUninitialized = "mat-ripple-loader-uninitialized";
var matRippleClassName = "mat-ripple-loader-class-name";
var matRippleCentered = "mat-ripple-loader-centered";
var matRippleDisabled = "mat-ripple-loader-disabled";
var _MatRippleLoader = class _MatRippleLoader {
  constructor() {
    this._document = inject(DOCUMENT2, {
      optional: true
    });
    this._animationMode = inject(ANIMATION_MODULE_TYPE, {
      optional: true
    });
    this._globalRippleOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, {
      optional: true
    });
    this._platform = inject(Platform);
    this._ngZone = inject(NgZone);
    this._hosts = /* @__PURE__ */ new Map();
    this._onInteraction = (event) => {
      if (!(event.target instanceof HTMLElement)) {
        return;
      }
      const eventTarget = event.target;
      const element = eventTarget.closest(`[${matRippleUninitialized}="${this._globalRippleOptions?.namespace ?? ""}"]`);
      if (element) {
        this._createRipple(element);
      }
    };
    this._ngZone.runOutsideAngular(() => {
      for (const event of rippleInteractionEvents) {
        this._document?.addEventListener(event, this._onInteraction, eventListenerOptions2);
      }
    });
  }
  ngOnDestroy() {
    const hosts = this._hosts.keys();
    for (const host of hosts) {
      this.destroyRipple(host);
    }
    for (const event of rippleInteractionEvents) {
      this._document?.removeEventListener(event, this._onInteraction, eventListenerOptions2);
    }
  }
  /**
   * Configures the ripple that will be rendered by the ripple loader.
   *
   * Stores the given information about how the ripple should be configured on the host
   * element so that it can later be retrived & used when the ripple is actually created.
   */
  configureRipple(host, config2) {
    host.setAttribute(matRippleUninitialized, this._globalRippleOptions?.namespace ?? "");
    if (config2.className || !host.hasAttribute(matRippleClassName)) {
      host.setAttribute(matRippleClassName, config2.className || "");
    }
    if (config2.centered) {
      host.setAttribute(matRippleCentered, "");
    }
    if (config2.disabled) {
      host.setAttribute(matRippleDisabled, "");
    }
  }
  /** Returns the ripple instance for the given host element. */
  getRipple(host) {
    const ripple = this._hosts.get(host);
    return ripple || this._createRipple(host);
  }
  /** Sets the disabled state on the ripple instance corresponding to the given host element. */
  setDisabled(host, disabled) {
    const ripple = this._hosts.get(host);
    if (ripple) {
      ripple.disabled = disabled;
      return;
    }
    if (disabled) {
      host.setAttribute(matRippleDisabled, "");
    } else {
      host.removeAttribute(matRippleDisabled);
    }
  }
  /** Creates a MatRipple and appends it to the given element. */
  _createRipple(host) {
    if (!this._document) {
      return;
    }
    const existingRipple = this._hosts.get(host);
    if (existingRipple) {
      return existingRipple;
    }
    host.querySelector(".mat-ripple")?.remove();
    const rippleEl = this._document.createElement("span");
    rippleEl.classList.add("mat-ripple", host.getAttribute(matRippleClassName));
    host.append(rippleEl);
    const ripple = new MatRipple(new ElementRef(rippleEl), this._ngZone, this._platform, this._globalRippleOptions ? this._globalRippleOptions : void 0, this._animationMode ? this._animationMode : void 0);
    ripple._isInitialized = true;
    ripple.trigger = host;
    ripple.centered = host.hasAttribute(matRippleCentered);
    ripple.disabled = host.hasAttribute(matRippleDisabled);
    this.attachRipple(host, ripple);
    return ripple;
  }
  attachRipple(host, ripple) {
    host.removeAttribute(matRippleUninitialized);
    this._hosts.set(host, ripple);
  }
  destroyRipple(host) {
    const ripple = this._hosts.get(host);
    if (ripple) {
      ripple.ngOnDestroy();
      this._hosts.delete(host);
    }
  }
};
_MatRippleLoader.\u0275fac = function MatRippleLoader_Factory(t) {
  return new (t || _MatRippleLoader)();
};
_MatRippleLoader.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _MatRippleLoader,
  factory: _MatRippleLoader.\u0275fac,
  providedIn: "root"
});
var MatRippleLoader = _MatRippleLoader;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatRippleLoader, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var __MatInternalFormField = class __MatInternalFormField {
};
__MatInternalFormField.\u0275fac = function _MatInternalFormField_Factory(t) {
  return new (t || __MatInternalFormField)();
};
__MatInternalFormField.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: __MatInternalFormField,
  selectors: [["div", "mat-internal-form-field", ""]],
  hostAttrs: [1, "mdc-form-field", "mat-internal-form-field"],
  hostVars: 2,
  hostBindings: function _MatInternalFormField_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mdc-form-field--align-end", ctx.labelPosition === "before");
    }
  },
  inputs: {
    labelPosition: "labelPosition"
  },
  standalone: true,
  features: [\u0275\u0275StandaloneFeature],
  attrs: _c5,
  ngContentSelectors: _c6,
  decls: 1,
  vars: 0,
  template: function _MatInternalFormField_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275projection(0);
    }
  },
  styles: [".mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mdc-form-field{font-family:var(--mdc-form-field-label-text-font);line-height:var(--mdc-form-field-label-text-line-height);font-size:var(--mdc-form-field-label-text-size);font-weight:var(--mdc-form-field-label-text-weight);letter-spacing:var(--mdc-form-field-label-text-tracking);color:var(--mdc-form-field-label-text-color)}.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}"],
  encapsulation: 2,
  changeDetection: 0
});
var _MatInternalFormField = __MatInternalFormField;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(_MatInternalFormField, [{
    type: Component,
    args: [{
      selector: "div[mat-internal-form-field]",
      standalone: true,
      template: "<ng-content></ng-content>",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      host: {
        "class": "mdc-form-field mat-internal-form-field",
        "[class.mdc-form-field--align-end]": 'labelPosition === "before"'
      },
      styles: [".mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mdc-form-field{font-family:var(--mdc-form-field-label-text-font);line-height:var(--mdc-form-field-label-text-line-height);font-size:var(--mdc-form-field-label-text-size);font-weight:var(--mdc-form-field-label-text-weight);letter-spacing:var(--mdc-form-field-label-text-tracking);color:var(--mdc-form-field-label-text-color)}.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}"]
    }]
  }], null, {
    labelPosition: [{
      type: Input,
      args: [{
        required: true
      }]
    }]
  });
})();

// node_modules/@angular/material/fesm2022/form-field.mjs
var _c02 = ["notch"];
var _c12 = ["matFormFieldNotchedOutline", ""];
var _c22 = ["*"];
var _c32 = ["textField"];
var _c42 = ["iconPrefixContainer"];
var _c52 = ["textPrefixContainer"];
var _c62 = ["*", [["mat-label"]], [["", "matPrefix", ""], ["", "matIconPrefix", ""]], [["", "matTextPrefix", ""]], [["", "matTextSuffix", ""]], [["", "matSuffix", ""], ["", "matIconSuffix", ""]], [["mat-error"], ["", "matError", ""]], [["mat-hint", 3, "align", "end"]], [["mat-hint", "align", "end"]]];
var _c7 = ["*", "mat-label", "[matPrefix], [matIconPrefix]", "[matTextPrefix]", "[matTextSuffix]", "[matSuffix], [matIconSuffix]", "mat-error, [matError]", "mat-hint:not([align='end'])", "mat-hint[align='end']"];
function MatFormField_ng_template_0_Conditional_0_Conditional_2_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "span", 19);
  }
}
function MatFormField_ng_template_0_Conditional_0_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "label", 18);
    \u0275\u0275projection(1, 1);
    \u0275\u0275template(2, MatFormField_ng_template_0_Conditional_0_Conditional_2_Template, 1, 0, "span", 19);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext(2);
    \u0275\u0275property("floating", ctx_r1._shouldLabelFloat())("monitorResize", ctx_r1._hasOutline())("id", ctx_r1._labelId);
    \u0275\u0275attribute("for", ctx_r1._control.disableAutomaticLabeling ? null : ctx_r1._control.id);
    \u0275\u0275advance(2);
    \u0275\u0275conditional(!ctx_r1.hideRequiredMarker && ctx_r1._control.required ? 2 : -1);
  }
}
function MatFormField_ng_template_0_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, MatFormField_ng_template_0_Conditional_0_Template, 3, 5, "label", 18);
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275conditional(ctx_r1._hasFloatingLabel() ? 0 : -1);
  }
}
function MatFormField_Conditional_4_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "div", 5);
  }
}
function MatFormField_Conditional_6_Conditional_1_ng_template_0_Template(rf, ctx) {
}
function MatFormField_Conditional_6_Conditional_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, MatFormField_Conditional_6_Conditional_1_ng_template_0_Template, 0, 0, "ng-template", 11);
  }
  if (rf & 2) {
    \u0275\u0275nextContext(2);
    const labelTemplate_r3 = \u0275\u0275reference(1);
    \u0275\u0275property("ngTemplateOutlet", labelTemplate_r3);
  }
}
function MatFormField_Conditional_6_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 7);
    \u0275\u0275template(1, MatFormField_Conditional_6_Conditional_1_Template, 1, 1, null, 11);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275property("matFormFieldNotchedOutlineOpen", ctx_r1._shouldLabelFloat());
    \u0275\u0275advance();
    \u0275\u0275conditional(!ctx_r1._forceDisplayInfixLabel() ? 1 : -1);
  }
}
function MatFormField_Conditional_7_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 8, 2);
    \u0275\u0275projection(2, 2);
    \u0275\u0275elementEnd();
  }
}
function MatFormField_Conditional_8_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 9, 3);
    \u0275\u0275projection(2, 3);
    \u0275\u0275elementEnd();
  }
}
function MatFormField_Conditional_10_ng_template_0_Template(rf, ctx) {
}
function MatFormField_Conditional_10_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, MatFormField_Conditional_10_ng_template_0_Template, 0, 0, "ng-template", 11);
  }
  if (rf & 2) {
    \u0275\u0275nextContext();
    const labelTemplate_r3 = \u0275\u0275reference(1);
    \u0275\u0275property("ngTemplateOutlet", labelTemplate_r3);
  }
}
function MatFormField_Conditional_12_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 12);
    \u0275\u0275projection(1, 4);
    \u0275\u0275elementEnd();
  }
}
function MatFormField_Conditional_13_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 13);
    \u0275\u0275projection(1, 5);
    \u0275\u0275elementEnd();
  }
}
function MatFormField_Conditional_14_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "div", 14);
  }
}
function MatFormField_Case_16_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 16);
    \u0275\u0275projection(1, 6);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275property("@transitionMessages", ctx_r1._subscriptAnimationState);
  }
}
function MatFormField_Case_17_Conditional_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "mat-hint", 20);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext(2);
    \u0275\u0275property("id", ctx_r1._hintLabelId);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(ctx_r1.hintLabel);
  }
}
function MatFormField_Case_17_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 17);
    \u0275\u0275template(1, MatFormField_Case_17_Conditional_1_Template, 2, 2, "mat-hint", 20);
    \u0275\u0275projection(2, 7);
    \u0275\u0275element(3, "div", 21);
    \u0275\u0275projection(4, 8);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275property("@transitionMessages", ctx_r1._subscriptAnimationState);
    \u0275\u0275advance();
    \u0275\u0275conditional(ctx_r1.hintLabel ? 1 : -1);
  }
}
var _MatLabel = class _MatLabel {
};
_MatLabel.\u0275fac = function MatLabel_Factory(t) {
  return new (t || _MatLabel)();
};
_MatLabel.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatLabel,
  selectors: [["mat-label"]],
  standalone: true
});
var MatLabel = _MatLabel;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatLabel, [{
    type: Directive,
    args: [{
      selector: "mat-label",
      standalone: true
    }]
  }], null, null);
})();
var nextUniqueId$2 = 0;
var MAT_ERROR = new InjectionToken("MatError");
var _MatError = class _MatError {
  constructor(ariaLive, elementRef) {
    this.id = `mat-mdc-error-${nextUniqueId$2++}`;
    if (!ariaLive) {
      elementRef.nativeElement.setAttribute("aria-live", "polite");
    }
  }
};
_MatError.\u0275fac = function MatError_Factory(t) {
  return new (t || _MatError)(\u0275\u0275injectAttribute("aria-live"), \u0275\u0275directiveInject(ElementRef));
};
_MatError.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatError,
  selectors: [["mat-error"], ["", "matError", ""]],
  hostAttrs: ["aria-atomic", "true", 1, "mat-mdc-form-field-error", "mat-mdc-form-field-bottom-align"],
  hostVars: 1,
  hostBindings: function MatError_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275hostProperty("id", ctx.id);
    }
  },
  inputs: {
    id: "id"
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_ERROR,
    useExisting: _MatError
  }])]
});
var MatError = _MatError;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatError, [{
    type: Directive,
    args: [{
      selector: "mat-error, [matError]",
      host: {
        "class": "mat-mdc-form-field-error mat-mdc-form-field-bottom-align",
        "aria-atomic": "true",
        "[id]": "id"
      },
      providers: [{
        provide: MAT_ERROR,
        useExisting: MatError
      }],
      standalone: true
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Attribute,
      args: ["aria-live"]
    }]
  }, {
    type: ElementRef
  }], {
    id: [{
      type: Input
    }]
  });
})();
var nextUniqueId$1 = 0;
var _MatHint = class _MatHint {
  constructor() {
    this.align = "start";
    this.id = `mat-mdc-hint-${nextUniqueId$1++}`;
  }
};
_MatHint.\u0275fac = function MatHint_Factory(t) {
  return new (t || _MatHint)();
};
_MatHint.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatHint,
  selectors: [["mat-hint"]],
  hostAttrs: [1, "mat-mdc-form-field-hint", "mat-mdc-form-field-bottom-align"],
  hostVars: 4,
  hostBindings: function MatHint_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275hostProperty("id", ctx.id);
      \u0275\u0275attribute("align", null);
      \u0275\u0275classProp("mat-mdc-form-field-hint-end", ctx.align === "end");
    }
  },
  inputs: {
    align: "align",
    id: "id"
  },
  standalone: true
});
var MatHint = _MatHint;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatHint, [{
    type: Directive,
    args: [{
      selector: "mat-hint",
      host: {
        "class": "mat-mdc-form-field-hint mat-mdc-form-field-bottom-align",
        "[class.mat-mdc-form-field-hint-end]": 'align === "end"',
        "[id]": "id",
        // Remove align attribute to prevent it from interfering with layout.
        "[attr.align]": "null"
      },
      standalone: true
    }]
  }], null, {
    align: [{
      type: Input
    }],
    id: [{
      type: Input
    }]
  });
})();
var MAT_PREFIX = new InjectionToken("MatPrefix");
var _MatPrefix = class _MatPrefix {
  constructor() {
    this._isText = false;
  }
  set _isTextSelector(value) {
    this._isText = true;
  }
};
_MatPrefix.\u0275fac = function MatPrefix_Factory(t) {
  return new (t || _MatPrefix)();
};
_MatPrefix.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatPrefix,
  selectors: [["", "matPrefix", ""], ["", "matIconPrefix", ""], ["", "matTextPrefix", ""]],
  inputs: {
    _isTextSelector: [0, "matTextPrefix", "_isTextSelector"]
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_PREFIX,
    useExisting: _MatPrefix
  }])]
});
var MatPrefix = _MatPrefix;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatPrefix, [{
    type: Directive,
    args: [{
      selector: "[matPrefix], [matIconPrefix], [matTextPrefix]",
      providers: [{
        provide: MAT_PREFIX,
        useExisting: MatPrefix
      }],
      standalone: true
    }]
  }], null, {
    _isTextSelector: [{
      type: Input,
      args: ["matTextPrefix"]
    }]
  });
})();
var MAT_SUFFIX = new InjectionToken("MatSuffix");
var _MatSuffix = class _MatSuffix {
  constructor() {
    this._isText = false;
  }
  set _isTextSelector(value) {
    this._isText = true;
  }
};
_MatSuffix.\u0275fac = function MatSuffix_Factory(t) {
  return new (t || _MatSuffix)();
};
_MatSuffix.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatSuffix,
  selectors: [["", "matSuffix", ""], ["", "matIconSuffix", ""], ["", "matTextSuffix", ""]],
  inputs: {
    _isTextSelector: [0, "matTextSuffix", "_isTextSelector"]
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_SUFFIX,
    useExisting: _MatSuffix
  }])]
});
var MatSuffix = _MatSuffix;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatSuffix, [{
    type: Directive,
    args: [{
      selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
      providers: [{
        provide: MAT_SUFFIX,
        useExisting: MatSuffix
      }],
      standalone: true
    }]
  }], null, {
    _isTextSelector: [{
      type: Input,
      args: ["matTextSuffix"]
    }]
  });
})();
var FLOATING_LABEL_PARENT = new InjectionToken("FloatingLabelParent");
var _MatFormFieldFloatingLabel = class _MatFormFieldFloatingLabel {
  /** Whether the label is floating. */
  get floating() {
    return this._floating;
  }
  set floating(value) {
    this._floating = value;
    if (this.monitorResize) {
      this._handleResize();
    }
  }
  /** Whether to monitor for resize events on the floating label. */
  get monitorResize() {
    return this._monitorResize;
  }
  set monitorResize(value) {
    this._monitorResize = value;
    if (this._monitorResize) {
      this._subscribeToResize();
    } else {
      this._resizeSubscription.unsubscribe();
    }
  }
  constructor(_elementRef) {
    this._elementRef = _elementRef;
    this._floating = false;
    this._monitorResize = false;
    this._resizeObserver = inject(SharedResizeObserver);
    this._ngZone = inject(NgZone);
    this._parent = inject(FLOATING_LABEL_PARENT);
    this._resizeSubscription = new Subscription();
  }
  ngOnDestroy() {
    this._resizeSubscription.unsubscribe();
  }
  /** Gets the width of the label. Used for the outline notch. */
  getWidth() {
    return estimateScrollWidth(this._elementRef.nativeElement);
  }
  /** Gets the HTML element for the floating label. */
  get element() {
    return this._elementRef.nativeElement;
  }
  /** Handles resize events from the ResizeObserver. */
  _handleResize() {
    setTimeout(() => this._parent._handleLabelResized());
  }
  /** Subscribes to resize events. */
  _subscribeToResize() {
    this._resizeSubscription.unsubscribe();
    this._ngZone.runOutsideAngular(() => {
      this._resizeSubscription = this._resizeObserver.observe(this._elementRef.nativeElement, {
        box: "border-box"
      }).subscribe(() => this._handleResize());
    });
  }
};
_MatFormFieldFloatingLabel.\u0275fac = function MatFormFieldFloatingLabel_Factory(t) {
  return new (t || _MatFormFieldFloatingLabel)(\u0275\u0275directiveInject(ElementRef));
};
_MatFormFieldFloatingLabel.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatFormFieldFloatingLabel,
  selectors: [["label", "matFormFieldFloatingLabel", ""]],
  hostAttrs: [1, "mdc-floating-label", "mat-mdc-floating-label"],
  hostVars: 2,
  hostBindings: function MatFormFieldFloatingLabel_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mdc-floating-label--float-above", ctx.floating);
    }
  },
  inputs: {
    floating: "floating",
    monitorResize: "monitorResize"
  },
  standalone: true
});
var MatFormFieldFloatingLabel = _MatFormFieldFloatingLabel;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldFloatingLabel, [{
    type: Directive,
    args: [{
      selector: "label[matFormFieldFloatingLabel]",
      host: {
        "class": "mdc-floating-label mat-mdc-floating-label",
        "[class.mdc-floating-label--float-above]": "floating"
      },
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }], {
    floating: [{
      type: Input
    }],
    monitorResize: [{
      type: Input
    }]
  });
})();
function estimateScrollWidth(element) {
  const htmlEl = element;
  if (htmlEl.offsetParent !== null) {
    return htmlEl.scrollWidth;
  }
  const clone2 = htmlEl.cloneNode(true);
  clone2.style.setProperty("position", "absolute");
  clone2.style.setProperty("transform", "translate(-9999px, -9999px)");
  document.documentElement.appendChild(clone2);
  const scrollWidth = clone2.scrollWidth;
  clone2.remove();
  return scrollWidth;
}
var ACTIVATE_CLASS = "mdc-line-ripple--active";
var DEACTIVATING_CLASS = "mdc-line-ripple--deactivating";
var _MatFormFieldLineRipple = class _MatFormFieldLineRipple {
  constructor(_elementRef, ngZone) {
    this._elementRef = _elementRef;
    this._handleTransitionEnd = (event) => {
      const classList = this._elementRef.nativeElement.classList;
      const isDeactivating = classList.contains(DEACTIVATING_CLASS);
      if (event.propertyName === "opacity" && isDeactivating) {
        classList.remove(ACTIVATE_CLASS, DEACTIVATING_CLASS);
      }
    };
    ngZone.runOutsideAngular(() => {
      _elementRef.nativeElement.addEventListener("transitionend", this._handleTransitionEnd);
    });
  }
  activate() {
    const classList = this._elementRef.nativeElement.classList;
    classList.remove(DEACTIVATING_CLASS);
    classList.add(ACTIVATE_CLASS);
  }
  deactivate() {
    this._elementRef.nativeElement.classList.add(DEACTIVATING_CLASS);
  }
  ngOnDestroy() {
    this._elementRef.nativeElement.removeEventListener("transitionend", this._handleTransitionEnd);
  }
};
_MatFormFieldLineRipple.\u0275fac = function MatFormFieldLineRipple_Factory(t) {
  return new (t || _MatFormFieldLineRipple)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(NgZone));
};
_MatFormFieldLineRipple.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatFormFieldLineRipple,
  selectors: [["div", "matFormFieldLineRipple", ""]],
  hostAttrs: [1, "mdc-line-ripple"],
  standalone: true
});
var MatFormFieldLineRipple = _MatFormFieldLineRipple;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldLineRipple, [{
    type: Directive,
    args: [{
      selector: "div[matFormFieldLineRipple]",
      host: {
        "class": "mdc-line-ripple"
      },
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: NgZone
  }], null);
})();
var _MatFormFieldNotchedOutline = class _MatFormFieldNotchedOutline {
  constructor(_elementRef, _ngZone) {
    this._elementRef = _elementRef;
    this._ngZone = _ngZone;
    this.open = false;
  }
  ngAfterViewInit() {
    const label = this._elementRef.nativeElement.querySelector(".mdc-floating-label");
    if (label) {
      this._elementRef.nativeElement.classList.add("mdc-notched-outline--upgraded");
      if (typeof requestAnimationFrame === "function") {
        label.style.transitionDuration = "0s";
        this._ngZone.runOutsideAngular(() => {
          requestAnimationFrame(() => label.style.transitionDuration = "");
        });
      }
    } else {
      this._elementRef.nativeElement.classList.add("mdc-notched-outline--no-label");
    }
  }
  _setNotchWidth(labelWidth) {
    if (!this.open || !labelWidth) {
      this._notch.nativeElement.style.width = "";
    } else {
      const NOTCH_ELEMENT_PADDING = 8;
      const NOTCH_ELEMENT_BORDER = 1;
      this._notch.nativeElement.style.width = `calc(${labelWidth}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + ${NOTCH_ELEMENT_PADDING + NOTCH_ELEMENT_BORDER}px)`;
    }
  }
};
_MatFormFieldNotchedOutline.\u0275fac = function MatFormFieldNotchedOutline_Factory(t) {
  return new (t || _MatFormFieldNotchedOutline)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(NgZone));
};
_MatFormFieldNotchedOutline.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatFormFieldNotchedOutline,
  selectors: [["div", "matFormFieldNotchedOutline", ""]],
  viewQuery: function MatFormFieldNotchedOutline_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c02, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._notch = _t.first);
    }
  },
  hostAttrs: [1, "mdc-notched-outline"],
  hostVars: 2,
  hostBindings: function MatFormFieldNotchedOutline_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mdc-notched-outline--notched", ctx.open);
    }
  },
  inputs: {
    open: [0, "matFormFieldNotchedOutlineOpen", "open"]
  },
  standalone: true,
  features: [\u0275\u0275StandaloneFeature],
  attrs: _c12,
  ngContentSelectors: _c22,
  decls: 5,
  vars: 0,
  consts: [["notch", ""], [1, "mdc-notched-outline__leading"], [1, "mdc-notched-outline__notch"], [1, "mdc-notched-outline__trailing"]],
  template: function MatFormFieldNotchedOutline_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275element(0, "div", 1);
      \u0275\u0275elementStart(1, "div", 2, 0);
      \u0275\u0275projection(3);
      \u0275\u0275elementEnd();
      \u0275\u0275element(4, "div", 3);
    }
  },
  encapsulation: 2,
  changeDetection: 0
});
var MatFormFieldNotchedOutline = _MatFormFieldNotchedOutline;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldNotchedOutline, [{
    type: Component,
    args: [{
      selector: "div[matFormFieldNotchedOutline]",
      host: {
        "class": "mdc-notched-outline",
        // Besides updating the notch state through the MDC component, we toggle this class through
        // a host binding in order to ensure that the notched-outline renders correctly on the server.
        "[class.mdc-notched-outline--notched]": "open"
      },
      changeDetection: ChangeDetectionStrategy.OnPush,
      encapsulation: ViewEncapsulation$1.None,
      standalone: true,
      template: '<div class="mdc-notched-outline__leading"></div>\n<div class="mdc-notched-outline__notch" #notch>\n  <ng-content></ng-content>\n</div>\n<div class="mdc-notched-outline__trailing"></div>\n'
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: NgZone
  }], {
    open: [{
      type: Input,
      args: ["matFormFieldNotchedOutlineOpen"]
    }],
    _notch: [{
      type: ViewChild,
      args: ["notch"]
    }]
  });
})();
var matFormFieldAnimations = {
  /** Animation that transitions the form field's error and hint messages. */
  transitionMessages: trigger("transitionMessages", [
    // TODO(mmalerba): Use angular animations for label animation as well.
    state("enter", style({
      opacity: 1,
      transform: "translateY(0%)"
    })),
    transition("void => enter", [style({
      opacity: 0,
      transform: "translateY(-5px)"
    }), animate("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])
  ])
};
var _MatFormFieldControl = class _MatFormFieldControl {
};
_MatFormFieldControl.\u0275fac = function MatFormFieldControl_Factory(t) {
  return new (t || _MatFormFieldControl)();
};
_MatFormFieldControl.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatFormFieldControl
});
var MatFormFieldControl = _MatFormFieldControl;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldControl, [{
    type: Directive
  }], null, null);
})();
function getMatFormFieldDuplicatedHintError(align) {
  return Error(`A hint was already declared for 'align="${align}"'.`);
}
function getMatFormFieldMissingControlError() {
  return Error("mat-form-field must contain a MatFormFieldControl.");
}
var MAT_FORM_FIELD = new InjectionToken("MatFormField");
var MAT_FORM_FIELD_DEFAULT_OPTIONS = new InjectionToken("MAT_FORM_FIELD_DEFAULT_OPTIONS");
var nextUniqueId = 0;
var DEFAULT_APPEARANCE = "fill";
var DEFAULT_FLOAT_LABEL = "auto";
var DEFAULT_SUBSCRIPT_SIZING = "fixed";
var FLOATING_LABEL_DEFAULT_DOCKED_TRANSFORM = `translateY(-50%)`;
var _MatFormField = class _MatFormField {
  /** Whether the required marker should be hidden. */
  get hideRequiredMarker() {
    return this._hideRequiredMarker;
  }
  set hideRequiredMarker(value) {
    this._hideRequiredMarker = coerceBooleanProperty(value);
  }
  /** Whether the label should always float or float as the user types. */
  get floatLabel() {
    return this._floatLabel || this._defaults?.floatLabel || DEFAULT_FLOAT_LABEL;
  }
  set floatLabel(value) {
    if (value !== this._floatLabel) {
      this._floatLabel = value;
      this._changeDetectorRef.markForCheck();
    }
  }
  /** The form field appearance style. */
  get appearance() {
    return this._appearance;
  }
  set appearance(value) {
    const oldValue = this._appearance;
    const newAppearance = value || this._defaults?.appearance || DEFAULT_APPEARANCE;
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (newAppearance !== "fill" && newAppearance !== "outline") {
        throw new Error(`MatFormField: Invalid appearance "${newAppearance}", valid values are "fill" or "outline".`);
      }
    }
    this._appearance = newAppearance;
    if (this._appearance === "outline" && this._appearance !== oldValue) {
      this._needsOutlineLabelOffsetUpdate = true;
    }
  }
  /**
   * Whether the form field should reserve space for one line of hint/error text (default)
   * or to have the spacing grow from 0px as needed based on the size of the hint/error content.
   * Note that when using dynamic sizing, layout shifts will occur when hint/error text changes.
   */
  get subscriptSizing() {
    return this._subscriptSizing || this._defaults?.subscriptSizing || DEFAULT_SUBSCRIPT_SIZING;
  }
  set subscriptSizing(value) {
    this._subscriptSizing = value || this._defaults?.subscriptSizing || DEFAULT_SUBSCRIPT_SIZING;
  }
  /** Text for the form field hint. */
  get hintLabel() {
    return this._hintLabel;
  }
  set hintLabel(value) {
    this._hintLabel = value;
    this._processHints();
  }
  /** Gets the current form field control */
  get _control() {
    return this._explicitFormFieldControl || this._formFieldControl;
  }
  set _control(value) {
    this._explicitFormFieldControl = value;
  }
  constructor(_elementRef, _changeDetectorRef, _unusedNgZone, _dir, _platform, _defaults, _animationMode, _unusedDocument) {
    this._elementRef = _elementRef;
    this._changeDetectorRef = _changeDetectorRef;
    this._dir = _dir;
    this._platform = _platform;
    this._defaults = _defaults;
    this._animationMode = _animationMode;
    this._hideRequiredMarker = false;
    this.color = "primary";
    this._appearance = DEFAULT_APPEARANCE;
    this._subscriptSizing = null;
    this._hintLabel = "";
    this._hasIconPrefix = false;
    this._hasTextPrefix = false;
    this._hasIconSuffix = false;
    this._hasTextSuffix = false;
    this._labelId = `mat-mdc-form-field-label-${nextUniqueId++}`;
    this._hintLabelId = `mat-mdc-hint-${nextUniqueId++}`;
    this._subscriptAnimationState = "";
    this._destroyed = new Subject();
    this._isFocused = null;
    this._needsOutlineLabelOffsetUpdate = false;
    this._injector = inject(Injector);
    if (_defaults) {
      if (_defaults.appearance) {
        this.appearance = _defaults.appearance;
      }
      this._hideRequiredMarker = Boolean(_defaults?.hideRequiredMarker);
      if (_defaults.color) {
        this.color = _defaults.color;
      }
    }
  }
  ngAfterViewInit() {
    this._updateFocusState();
    this._subscriptAnimationState = "enter";
    this._changeDetectorRef.detectChanges();
  }
  ngAfterContentInit() {
    this._assertFormFieldControl();
    this._initializeControl();
    this._initializeSubscript();
    this._initializePrefixAndSuffix();
    this._initializeOutlineLabelOffsetSubscriptions();
  }
  ngAfterContentChecked() {
    this._assertFormFieldControl();
  }
  ngOnDestroy() {
    this._destroyed.next();
    this._destroyed.complete();
  }
  /**
   * Gets the id of the label element. If no label is present, returns `null`.
   */
  getLabelId() {
    return this._hasFloatingLabel() ? this._labelId : null;
  }
  /**
   * Gets an ElementRef for the element that a overlay attached to the form field
   * should be positioned relative to.
   */
  getConnectedOverlayOrigin() {
    return this._textField || this._elementRef;
  }
  /** Animates the placeholder up and locks it in position. */
  _animateAndLockLabel() {
    if (this._hasFloatingLabel()) {
      this.floatLabel = "always";
    }
  }
  /** Initializes the registered form field control. */
  _initializeControl() {
    const control = this._control;
    if (control.controlType) {
      this._elementRef.nativeElement.classList.add(`mat-mdc-form-field-type-${control.controlType}`);
    }
    control.stateChanges.subscribe(() => {
      this._updateFocusState();
      this._syncDescribedByIds();
      this._changeDetectorRef.markForCheck();
    });
    if (control.ngControl && control.ngControl.valueChanges) {
      control.ngControl.valueChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this._changeDetectorRef.markForCheck());
    }
  }
  _checkPrefixAndSuffixTypes() {
    this._hasIconPrefix = !!this._prefixChildren.find((p) => !p._isText);
    this._hasTextPrefix = !!this._prefixChildren.find((p) => p._isText);
    this._hasIconSuffix = !!this._suffixChildren.find((s) => !s._isText);
    this._hasTextSuffix = !!this._suffixChildren.find((s) => s._isText);
  }
  /** Initializes the prefix and suffix containers. */
  _initializePrefixAndSuffix() {
    this._checkPrefixAndSuffixTypes();
    merge(this._prefixChildren.changes, this._suffixChildren.changes).subscribe(() => {
      this._checkPrefixAndSuffixTypes();
      this._changeDetectorRef.markForCheck();
    });
  }
  /**
   * Initializes the subscript by validating hints and synchronizing "aria-describedby" ids
   * with the custom form field control. Also subscribes to hint and error changes in order
   * to be able to validate and synchronize ids on change.
   */
  _initializeSubscript() {
    this._hintChildren.changes.subscribe(() => {
      this._processHints();
      this._changeDetectorRef.markForCheck();
    });
    this._errorChildren.changes.subscribe(() => {
      this._syncDescribedByIds();
      this._changeDetectorRef.markForCheck();
    });
    this._validateHints();
    this._syncDescribedByIds();
  }
  /** Throws an error if the form field's control is missing. */
  _assertFormFieldControl() {
    if (!this._control && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw getMatFormFieldMissingControlError();
    }
  }
  _updateFocusState() {
    if (this._control.focused && !this._isFocused) {
      this._isFocused = true;
      this._lineRipple?.activate();
    } else if (!this._control.focused && (this._isFocused || this._isFocused === null)) {
      this._isFocused = false;
      this._lineRipple?.deactivate();
    }
    this._textField?.nativeElement.classList.toggle("mdc-text-field--focused", this._control.focused);
  }
  /**
   * The floating label in the docked state needs to account for prefixes. The horizontal offset
   * is calculated whenever the appearance changes to `outline`, the prefixes change, or when the
   * form field is added to the DOM. This method sets up all subscriptions which are needed to
   * trigger the label offset update.
   */
  _initializeOutlineLabelOffsetSubscriptions() {
    this._prefixChildren.changes.subscribe(() => this._needsOutlineLabelOffsetUpdate = true);
    afterRender(() => {
      if (this._needsOutlineLabelOffsetUpdate) {
        this._needsOutlineLabelOffsetUpdate = false;
        this._updateOutlineLabelOffset();
      }
    }, {
      injector: this._injector
    });
    this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => this._needsOutlineLabelOffsetUpdate = true);
  }
  /** Whether the floating label should always float or not. */
  _shouldAlwaysFloat() {
    return this.floatLabel === "always";
  }
  _hasOutline() {
    return this.appearance === "outline";
  }
  /**
   * Whether the label should display in the infix. Labels in the outline appearance are
   * displayed as part of the notched-outline and are horizontally offset to account for
   * form field prefix content. This won't work in server side rendering since we cannot
   * measure the width of the prefix container. To make the docked label appear as if the
   * right offset has been calculated, we forcibly render the label inside the infix. Since
   * the label is part of the infix, the label cannot overflow the prefix content.
   */
  _forceDisplayInfixLabel() {
    return !this._platform.isBrowser && this._prefixChildren.length && !this._shouldLabelFloat();
  }
  _hasFloatingLabel() {
    return !!this._labelChildNonStatic || !!this._labelChildStatic;
  }
  _shouldLabelFloat() {
    return this._control.shouldLabelFloat || this._shouldAlwaysFloat();
  }
  /**
   * Determines whether a class from the AbstractControlDirective
   * should be forwarded to the host element.
   */
  _shouldForward(prop) {
    const control = this._control ? this._control.ngControl : null;
    return control && control[prop];
  }
  /** Determines whether to display hints or errors. */
  _getDisplayedMessages() {
    return this._errorChildren && this._errorChildren.length > 0 && this._control.errorState ? "error" : "hint";
  }
  /** Handle label resize events. */
  _handleLabelResized() {
    this._refreshOutlineNotchWidth();
  }
  /** Refreshes the width of the outline-notch, if present. */
  _refreshOutlineNotchWidth() {
    if (!this._hasOutline() || !this._floatingLabel || !this._shouldLabelFloat()) {
      this._notchedOutline?._setNotchWidth(0);
    } else {
      this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth());
    }
  }
  /** Does any extra processing that is required when handling the hints. */
  _processHints() {
    this._validateHints();
    this._syncDescribedByIds();
  }
  /**
   * Ensure that there is a maximum of one of each "mat-hint" alignment specified. The hint
   * label specified set through the input is being considered as "start" aligned.
   *
   * This method is a noop if Angular runs in production mode.
   */
  _validateHints() {
    if (this._hintChildren && (typeof ngDevMode === "undefined" || ngDevMode)) {
      let startHint;
      let endHint;
      this._hintChildren.forEach((hint) => {
        if (hint.align === "start") {
          if (startHint || this.hintLabel) {
            throw getMatFormFieldDuplicatedHintError("start");
          }
          startHint = hint;
        } else if (hint.align === "end") {
          if (endHint) {
            throw getMatFormFieldDuplicatedHintError("end");
          }
          endHint = hint;
        }
      });
    }
  }
  /**
   * Sets the list of element IDs that describe the child control. This allows the control to update
   * its `aria-describedby` attribute accordingly.
   */
  _syncDescribedByIds() {
    if (this._control) {
      let ids = [];
      if (this._control.userAriaDescribedBy && typeof this._control.userAriaDescribedBy === "string") {
        ids.push(...this._control.userAriaDescribedBy.split(" "));
      }
      if (this._getDisplayedMessages() === "hint") {
        const startHint = this._hintChildren ? this._hintChildren.find((hint) => hint.align === "start") : null;
        const endHint = this._hintChildren ? this._hintChildren.find((hint) => hint.align === "end") : null;
        if (startHint) {
          ids.push(startHint.id);
        } else if (this._hintLabel) {
          ids.push(this._hintLabelId);
        }
        if (endHint) {
          ids.push(endHint.id);
        }
      } else if (this._errorChildren) {
        ids.push(...this._errorChildren.map((error3) => error3.id));
      }
      this._control.setDescribedByIds(ids);
    }
  }
  /**
   * Updates the horizontal offset of the label in the outline appearance. In the outline
   * appearance, the notched-outline and label are not relative to the infix container because
   * the outline intends to surround prefixes, suffixes and the infix. This means that the
   * floating label by default overlaps prefixes in the docked state. To avoid this, we need to
   * horizontally offset the label by the width of the prefix container. The MDC text-field does
   * not need to do this because they use a fixed width for prefixes. Hence, they can simply
   * incorporate the horizontal offset into their default text-field styles.
   */
  _updateOutlineLabelOffset() {
    if (!this._hasOutline() || !this._floatingLabel) {
      return;
    }
    const floatingLabel = this._floatingLabel.element;
    if (!(this._iconPrefixContainer || this._textPrefixContainer)) {
      floatingLabel.style.transform = "";
      return;
    }
    if (!this._isAttachedToDom()) {
      this._needsOutlineLabelOffsetUpdate = true;
      return;
    }
    const iconPrefixContainer = this._iconPrefixContainer?.nativeElement;
    const textPrefixContainer = this._textPrefixContainer?.nativeElement;
    const iconPrefixContainerWidth = iconPrefixContainer?.getBoundingClientRect().width ?? 0;
    const textPrefixContainerWidth = textPrefixContainer?.getBoundingClientRect().width ?? 0;
    const negate = this._dir.value === "rtl" ? "-1" : "1";
    const prefixWidth = `${iconPrefixContainerWidth + textPrefixContainerWidth}px`;
    const labelOffset = `var(--mat-mdc-form-field-label-offset-x, 0px)`;
    const labelHorizontalOffset = `calc(${negate} * (${prefixWidth} + ${labelOffset}))`;
    floatingLabel.style.transform = `var(
        --mat-mdc-form-field-label-transform,
        ${FLOATING_LABEL_DEFAULT_DOCKED_TRANSFORM} translateX(${labelHorizontalOffset})
    )`;
  }
  /** Checks whether the form field is attached to the DOM. */
  _isAttachedToDom() {
    const element = this._elementRef.nativeElement;
    if (element.getRootNode) {
      const rootNode = element.getRootNode();
      return rootNode && rootNode !== element;
    }
    return document.documentElement.contains(element);
  }
};
_MatFormField.\u0275fac = function MatFormField_Factory(t) {
  return new (t || _MatFormField)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Directionality), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(MAT_FORM_FIELD_DEFAULT_OPTIONS, 8), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8), \u0275\u0275directiveInject(DOCUMENT2));
};
_MatFormField.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatFormField,
  selectors: [["mat-form-field"]],
  contentQueries: function MatFormField_ContentQueries(rf, ctx, dirIndex) {
    if (rf & 1) {
      \u0275\u0275contentQuery(dirIndex, MatLabel, 5);
      \u0275\u0275contentQuery(dirIndex, MatLabel, 7);
      \u0275\u0275contentQuery(dirIndex, MatFormFieldControl, 5);
      \u0275\u0275contentQuery(dirIndex, MAT_PREFIX, 5);
      \u0275\u0275contentQuery(dirIndex, MAT_SUFFIX, 5);
      \u0275\u0275contentQuery(dirIndex, MAT_ERROR, 5);
      \u0275\u0275contentQuery(dirIndex, MatHint, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._labelChildNonStatic = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._labelChildStatic = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._formFieldControl = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._prefixChildren = _t);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._suffixChildren = _t);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._errorChildren = _t);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._hintChildren = _t);
    }
  },
  viewQuery: function MatFormField_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c32, 5);
      \u0275\u0275viewQuery(_c42, 5);
      \u0275\u0275viewQuery(_c52, 5);
      \u0275\u0275viewQuery(MatFormFieldFloatingLabel, 5);
      \u0275\u0275viewQuery(MatFormFieldNotchedOutline, 5);
      \u0275\u0275viewQuery(MatFormFieldLineRipple, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._textField = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._iconPrefixContainer = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._textPrefixContainer = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._floatingLabel = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._notchedOutline = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._lineRipple = _t.first);
    }
  },
  hostAttrs: [1, "mat-mdc-form-field"],
  hostVars: 42,
  hostBindings: function MatFormField_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mat-mdc-form-field-label-always-float", ctx._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix", ctx._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix", ctx._hasIconSuffix)("mat-form-field-invalid", ctx._control.errorState)("mat-form-field-disabled", ctx._control.disabled)("mat-form-field-autofilled", ctx._control.autofilled)("mat-form-field-no-animations", ctx._animationMode === "NoopAnimations")("mat-form-field-appearance-fill", ctx.appearance == "fill")("mat-form-field-appearance-outline", ctx.appearance == "outline")("mat-form-field-hide-placeholder", ctx._hasFloatingLabel() && !ctx._shouldLabelFloat())("mat-focused", ctx._control.focused)("mat-primary", ctx.color !== "accent" && ctx.color !== "warn")("mat-accent", ctx.color === "accent")("mat-warn", ctx.color === "warn")("ng-untouched", ctx._shouldForward("untouched"))("ng-touched", ctx._shouldForward("touched"))("ng-pristine", ctx._shouldForward("pristine"))("ng-dirty", ctx._shouldForward("dirty"))("ng-valid", ctx._shouldForward("valid"))("ng-invalid", ctx._shouldForward("invalid"))("ng-pending", ctx._shouldForward("pending"));
    }
  },
  inputs: {
    hideRequiredMarker: "hideRequiredMarker",
    color: "color",
    floatLabel: "floatLabel",
    appearance: "appearance",
    subscriptSizing: "subscriptSizing",
    hintLabel: "hintLabel"
  },
  exportAs: ["matFormField"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_FORM_FIELD,
    useExisting: _MatFormField
  }, {
    provide: FLOATING_LABEL_PARENT,
    useExisting: _MatFormField
  }]), \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c7,
  decls: 18,
  vars: 21,
  consts: [["labelTemplate", ""], ["textField", ""], ["iconPrefixContainer", ""], ["textPrefixContainer", ""], [1, "mat-mdc-text-field-wrapper", "mdc-text-field", 3, "click"], [1, "mat-mdc-form-field-focus-overlay"], [1, "mat-mdc-form-field-flex"], ["matFormFieldNotchedOutline", "", 3, "matFormFieldNotchedOutlineOpen"], [1, "mat-mdc-form-field-icon-prefix"], [1, "mat-mdc-form-field-text-prefix"], [1, "mat-mdc-form-field-infix"], [3, "ngTemplateOutlet"], [1, "mat-mdc-form-field-text-suffix"], [1, "mat-mdc-form-field-icon-suffix"], ["matFormFieldLineRipple", ""], [1, "mat-mdc-form-field-subscript-wrapper", "mat-mdc-form-field-bottom-align"], [1, "mat-mdc-form-field-error-wrapper"], [1, "mat-mdc-form-field-hint-wrapper"], ["matFormFieldFloatingLabel", "", 3, "floating", "monitorResize", "id"], ["aria-hidden", "true", 1, "mat-mdc-form-field-required-marker", "mdc-floating-label--required"], [3, "id"], [1, "mat-mdc-form-field-hint-spacer"]],
  template: function MatFormField_Template(rf, ctx) {
    if (rf & 1) {
      const _r1 = \u0275\u0275getCurrentView();
      \u0275\u0275projectionDef(_c62);
      \u0275\u0275template(0, MatFormField_ng_template_0_Template, 1, 1, "ng-template", null, 0, \u0275\u0275templateRefExtractor);
      \u0275\u0275elementStart(2, "div", 4, 1);
      \u0275\u0275listener("click", function MatFormField_Template_div_click_2_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx._control.onContainerClick($event));
      });
      \u0275\u0275template(4, MatFormField_Conditional_4_Template, 1, 0, "div", 5);
      \u0275\u0275elementStart(5, "div", 6);
      \u0275\u0275template(6, MatFormField_Conditional_6_Template, 2, 2, "div", 7)(7, MatFormField_Conditional_7_Template, 3, 0, "div", 8)(8, MatFormField_Conditional_8_Template, 3, 0, "div", 9);
      \u0275\u0275elementStart(9, "div", 10);
      \u0275\u0275template(10, MatFormField_Conditional_10_Template, 1, 1, null, 11);
      \u0275\u0275projection(11);
      \u0275\u0275elementEnd();
      \u0275\u0275template(12, MatFormField_Conditional_12_Template, 2, 0, "div", 12)(13, MatFormField_Conditional_13_Template, 2, 0, "div", 13);
      \u0275\u0275elementEnd();
      \u0275\u0275template(14, MatFormField_Conditional_14_Template, 1, 0, "div", 14);
      \u0275\u0275elementEnd();
      \u0275\u0275elementStart(15, "div", 15);
      \u0275\u0275template(16, MatFormField_Case_16_Template, 2, 1, "div", 16)(17, MatFormField_Case_17_Template, 5, 2, "div", 17);
      \u0275\u0275elementEnd();
    }
    if (rf & 2) {
      let tmp_16_0;
      \u0275\u0275advance(2);
      \u0275\u0275classProp("mdc-text-field--filled", !ctx._hasOutline())("mdc-text-field--outlined", ctx._hasOutline())("mdc-text-field--no-label", !ctx._hasFloatingLabel())("mdc-text-field--disabled", ctx._control.disabled)("mdc-text-field--invalid", ctx._control.errorState);
      \u0275\u0275advance(2);
      \u0275\u0275conditional(!ctx._hasOutline() && !ctx._control.disabled ? 4 : -1);
      \u0275\u0275advance(2);
      \u0275\u0275conditional(ctx._hasOutline() ? 6 : -1);
      \u0275\u0275advance();
      \u0275\u0275conditional(ctx._hasIconPrefix ? 7 : -1);
      \u0275\u0275advance();
      \u0275\u0275conditional(ctx._hasTextPrefix ? 8 : -1);
      \u0275\u0275advance(2);
      \u0275\u0275conditional(!ctx._hasOutline() || ctx._forceDisplayInfixLabel() ? 10 : -1);
      \u0275\u0275advance(2);
      \u0275\u0275conditional(ctx._hasTextSuffix ? 12 : -1);
      \u0275\u0275advance();
      \u0275\u0275conditional(ctx._hasIconSuffix ? 13 : -1);
      \u0275\u0275advance();
      \u0275\u0275conditional(!ctx._hasOutline() ? 14 : -1);
      \u0275\u0275advance();
      \u0275\u0275classProp("mat-mdc-form-field-subscript-dynamic-size", ctx.subscriptSizing === "dynamic");
      \u0275\u0275advance();
      \u0275\u0275conditional((tmp_16_0 = ctx._getDisplayedMessages()) === "error" ? 16 : tmp_16_0 === "hint" ? 17 : -1);
    }
  },
  dependencies: [MatFormFieldFloatingLabel, MatFormFieldNotchedOutline, NgTemplateOutlet, MatFormFieldLineRipple, MatHint],
  styles: ['.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-text-field__input{height:28px;width:100%;min-width:0;border:none;border-radius:0;background:none;appearance:none;padding:0}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}@media all{.mdc-text-field__input::placeholder{opacity:0}}@media all{.mdc-text-field__input:-ms-input-placeholder{opacity:0}}@media all{.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}}@media all{.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}}.mdc-text-field__affix{height:28px;opacity:0;white-space:nowrap}.mdc-text-field--label-floating .mdc-text-field__affix,.mdc-text-field--no-label .mdc-text-field__affix{opacity:1}@supports(-webkit-hyphens: none){.mdc-text-field--outlined .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field__affix--prefix,.mdc-text-field__affix--prefix[dir=rtl]{padding-left:2px;padding-right:0}.mdc-text-field--end-aligned .mdc-text-field__affix--prefix{padding-left:0;padding-right:12px}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--end-aligned .mdc-text-field__affix--prefix[dir=rtl]{padding-left:12px;padding-right:0}.mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field__affix--suffix,.mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:12px}.mdc-text-field--end-aligned .mdc-text-field__affix--suffix{padding-left:2px;padding-right:0}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--end-aligned .mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:2px}.mdc-text-field--filled{height:56px}.mdc-text-field--filled::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-text-field--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-text-field--filled .mdc-floating-label,.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled.mdc-text-field--no-label::before{display:none}@supports(-webkit-hyphens: none){.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field--outlined{height:56px;overflow:visible}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--outlined .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px,var(--mdc-shape-small, 4px))*2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px,var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px,var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px,var(--mdc-shape-small, 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px,var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:initial}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mdc-text-field--textarea{flex-direction:column;align-items:center;width:auto;height:auto;padding:0}.mdc-text-field--textarea .mdc-floating-label{top:19px}.mdc-text-field--textarea .mdc-floating-label:not(.mdc-floating-label--float-above){transform:none}.mdc-text-field--textarea .mdc-text-field__input{flex-grow:1;height:auto;min-height:1.5rem;overflow-x:hidden;overflow-y:auto;box-sizing:border-box;resize:none;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--filled::before{display:none}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-10.25px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--filled .mdc-text-field__input{margin-top:23px;margin-bottom:9px}.mdc-text-field--textarea.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-27.25px) scale(1)}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-24.75px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label{top:18px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field__input{margin-bottom:2px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter{align-self:flex-end;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::after{display:inline-block;width:0;height:16px;content:"";vertical-align:-16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::before{display:none}.mdc-text-field__resizer{align-self:stretch;display:inline-flex;flex-direction:column;flex-grow:1;max-height:100%;max-width:100%;min-height:56px;min-width:fit-content;min-width:-moz-available;min-width:-webkit-fill-available;overflow:hidden;resize:both}.mdc-text-field--filled .mdc-text-field__resizer{transform:translateY(-1px)}.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateY(1px)}.mdc-text-field--outlined .mdc-text-field__resizer{transform:translateX(-1px) translateY(-1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer,.mdc-text-field--outlined .mdc-text-field__resizer[dir=rtl]{transform:translateX(1px) translateY(-1px)}.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateX(1px) translateY(1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input[dir=rtl],.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter[dir=rtl]{transform:translateX(-1px) translateY(1px)}.mdc-text-field--with-leading-icon{padding-left:0;padding-right:16px}[dir=rtl] .mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:16px;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px);left:48px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 64px/0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-text-field--with-leading-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--with-trailing-icon{padding-left:16px;padding-right:0}[dir=rtl] .mdc-text-field--with-trailing-icon,.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 64px/0.75)}.mdc-text-field--with-trailing-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 96px/0.75)}.mdc-text-field-helper-line{display:flex;justify-content:space-between;box-sizing:border-box}.mdc-text-field+.mdc-text-field-helper-line{padding-right:16px;padding-left:16px}.mdc-form-field>.mdc-text-field+label{align-self:flex-start}.mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--focused .mdc-notched-outline__trailing{border-width:2px}.mdc-text-field--focused+.mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg){opacity:1}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-text-field--focused.mdc-text-field--outlined.mdc-text-field--textarea .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{opacity:1}.mdc-text-field--disabled{pointer-events:none}@media screen and (forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--disabled .mdc-floating-label{cursor:default}.mdc-text-field--disabled.mdc-text-field--filled .mdc-text-field__ripple{display:none}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--end-aligned .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--end-aligned .mdc-text-field__input[dir=rtl]{text-align:left}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix{direction:ltr}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--leading,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--leading{order:1}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{order:2}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input{order:3}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{order:4}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--trailing,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--trailing{order:5}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--prefix{padding-right:12px}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--suffix{padding-left:2px}.mdc-floating-label{position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after,.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;pointer-events:none}.mdc-notched-outline__trailing{flex-grow:1}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-top:1px solid;border-bottom:1px solid}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{max-width:calc(100% - 12px*2)}.mdc-line-ripple::before{border-bottom-width:1px}.mdc-line-ripple::after{border-bottom-width:2px}.mdc-text-field--filled{border-top-left-radius:var(--mdc-filled-text-field-container-shape);border-top-right-radius:var(--mdc-filled-text-field-container-shape);border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-caret-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-error-caret-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-filled-text-field-input-text-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-filled-text-field-disabled-input-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-label-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-focus-label-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-hover-label-text-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-disabled-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-focus-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-hover-label-text-color)}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mdc-filled-text-field-label-text-font);font-size:var(--mdc-filled-text-field-label-text-size);font-weight:var(--mdc-filled-text-field-label-text-weight);letter-spacing:var(--mdc-filled-text-field-label-text-tracking)}@media all{.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color)}}@media all{.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color)}}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mdc-filled-text-field-container-color)}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mdc-filled-text-field-disabled-container-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-active-indicator-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-hover-active-indicator-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-focus-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-disabled-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-hover-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-error-focus-active-indicator-color)}.mdc-text-field--filled .mdc-line-ripple::before{border-bottom-width:var(--mdc-filled-text-field-active-indicator-height)}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mdc-filled-text-field-focus-active-indicator-height)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-caret-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-error-caret-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-outlined-text-field-input-text-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-outlined-text-field-disabled-input-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-label-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-focus-label-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-hover-label-text-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-disabled-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-focus-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-hover-label-text-color)}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mdc-outlined-text-field-label-text-font);font-size:var(--mdc-outlined-text-field-label-text-size);font-weight:var(--mdc-outlined-text-field-label-text-weight);letter-spacing:var(--mdc-outlined-text-field-label-text-tracking)}@media all{.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color)}}@media all{.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color)}}.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(.75*var(--mdc-outlined-text-field-label-text-size))}.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mdc-outlined-text-field-label-text-size)}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:var(--mdc-outlined-text-field-container-shape);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-outlined-text-field-container-shape))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px,var(--mdc-outlined-text-field-container-shape))*2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:var(--mdc-outlined-text-field-container-shape);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px,var(--mdc-outlined-text-field-container-shape))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-hover-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-focus-outline-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-disabled-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-hover-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-focus-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__trailing{border-width:var(--mdc-outlined-text-field-outline-width)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:var(--mdc-outlined-text-field-focus-outline-width)}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-text-field-wrapper::before{content:none}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height);padding-top:var(--mat-form-field-filled-with-label-container-padding-top);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding);padding-bottom:var(--mat-form-field-container-vertical-padding)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color)}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font);line-height:var(--mat-form-field-subscript-text-line-height);font-size:var(--mat-form-field-subscript-text-size);letter-spacing:var(--mat-form-field-subscript-text-tracking);font-weight:var(--mat-form-field-subscript-text-weight)}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color)}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity)}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color)}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color)}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color)}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color)}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color)}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}.cdk-high-contrast-active .mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}.cdk-high-contrast-active .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}.cdk-high-contrast-active .mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}.cdk-high-contrast-active .mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font);line-height:var(--mat-form-field-container-text-line-height);font-size:var(--mat-form-field-container-text-size);letter-spacing:var(--mat-form-field-container-text-tracking);font-weight:var(--mat-form-field-container-text-weight)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color)}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color)}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color)}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color)}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color)}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color)}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color)}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input{transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}@media all{.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}}@media all{.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}}@media all{.mdc-text-field--no-label .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder,.mdc-text-field--focused .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}}@media all{.mdc-text-field--no-label .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__affix{transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled.mdc-ripple-upgraded--background-focused .mdc-text-field__ripple::before,.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea{transition:none}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-filled 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-filled{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-outlined{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon{0%{transform:translateX(calc(0% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}}[dir=rtl] .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake,.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon-rtl{0%{transform:translateX(calc(0% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}'],
  encapsulation: 2,
  data: {
    animation: [matFormFieldAnimations.transitionMessages]
  },
  changeDetection: 0
});
var MatFormField = _MatFormField;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormField, [{
    type: Component,
    args: [{
      selector: "mat-form-field",
      exportAs: "matFormField",
      animations: [matFormFieldAnimations.transitionMessages],
      host: {
        "class": "mat-mdc-form-field",
        "[class.mat-mdc-form-field-label-always-float]": "_shouldAlwaysFloat()",
        "[class.mat-mdc-form-field-has-icon-prefix]": "_hasIconPrefix",
        "[class.mat-mdc-form-field-has-icon-suffix]": "_hasIconSuffix",
        // Note that these classes reuse the same names as the non-MDC version, because they can be
        // considered a public API since custom form controls may use them to style themselves.
        // See https://github.com/angular/components/pull/20502#discussion_r486124901.
        "[class.mat-form-field-invalid]": "_control.errorState",
        "[class.mat-form-field-disabled]": "_control.disabled",
        "[class.mat-form-field-autofilled]": "_control.autofilled",
        "[class.mat-form-field-no-animations]": '_animationMode === "NoopAnimations"',
        "[class.mat-form-field-appearance-fill]": 'appearance == "fill"',
        "[class.mat-form-field-appearance-outline]": 'appearance == "outline"',
        "[class.mat-form-field-hide-placeholder]": "_hasFloatingLabel() && !_shouldLabelFloat()",
        "[class.mat-focused]": "_control.focused",
        "[class.mat-primary]": 'color !== "accent" && color !== "warn"',
        "[class.mat-accent]": 'color === "accent"',
        "[class.mat-warn]": 'color === "warn"',
        "[class.ng-untouched]": '_shouldForward("untouched")',
        "[class.ng-touched]": '_shouldForward("touched")',
        "[class.ng-pristine]": '_shouldForward("pristine")',
        "[class.ng-dirty]": '_shouldForward("dirty")',
        "[class.ng-valid]": '_shouldForward("valid")',
        "[class.ng-invalid]": '_shouldForward("invalid")',
        "[class.ng-pending]": '_shouldForward("pending")'
      },
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      providers: [{
        provide: MAT_FORM_FIELD,
        useExisting: MatFormField
      }, {
        provide: FLOATING_LABEL_PARENT,
        useExisting: MatFormField
      }],
      standalone: true,
      imports: [MatFormFieldFloatingLabel, MatFormFieldNotchedOutline, NgTemplateOutlet, MatFormFieldLineRipple, MatHint],
      template: '<ng-template #labelTemplate>\n  <!--\n    MDC recommends that the text-field is a `<label>` element. This rather complicates the\n    setup because it would require every form-field control to explicitly set `aria-labelledby`.\n    This is because the `<label>` itself contains more than the actual label (e.g. prefix, suffix\n    or other projected content), and screen readers could potentially read out undesired content.\n    Excluding elements from being printed out requires them to be marked with `aria-hidden`, or\n    the form control is set to a scoped element for the label (using `aria-labelledby`). Both of\n    these options seem to complicate the setup because we know exactly what content is rendered\n    as part of the label, and we don\'t want to spend resources on walking through projected content\n    to set `aria-hidden`. Nor do we want to set `aria-labelledby` on every form control if we could\n    simply link the label to the control using the label `for` attribute.\n  -->\n  @if (_hasFloatingLabel()) {\n    <label matFormFieldFloatingLabel\n           [floating]="_shouldLabelFloat()"\n           [monitorResize]="_hasOutline()"\n           [id]="_labelId"\n           [attr.for]="_control.disableAutomaticLabeling ? null : _control.id">\n      <ng-content select="mat-label"></ng-content>\n      <!--\n        We set the required marker as a separate element, in order to make it easier to target if\n        apps want to override it and to be able to set `aria-hidden` so that screen readers don\'t\n        pick it up.\n       -->\n       @if (!hideRequiredMarker && _control.required) {\n         <span\n           aria-hidden="true"\n           class="mat-mdc-form-field-required-marker mdc-floating-label--required"></span>\n       }\n    </label>\n  }\n</ng-template>\n\n<div class="mat-mdc-text-field-wrapper mdc-text-field" #textField\n     [class.mdc-text-field--filled]="!_hasOutline()"\n     [class.mdc-text-field--outlined]="_hasOutline()"\n     [class.mdc-text-field--no-label]="!_hasFloatingLabel()"\n     [class.mdc-text-field--disabled]="_control.disabled"\n     [class.mdc-text-field--invalid]="_control.errorState"\n     (click)="_control.onContainerClick($event)">\n  @if (!_hasOutline() && !_control.disabled) {\n    <div class="mat-mdc-form-field-focus-overlay"></div>\n  }\n  <div class="mat-mdc-form-field-flex">\n    @if (_hasOutline()) {\n      <div matFormFieldNotchedOutline [matFormFieldNotchedOutlineOpen]="_shouldLabelFloat()">\n        @if (!_forceDisplayInfixLabel()) {\n          <ng-template [ngTemplateOutlet]="labelTemplate"></ng-template>\n        }\n      </div>\n    }\n\n    @if (_hasIconPrefix) {\n      <div class="mat-mdc-form-field-icon-prefix" #iconPrefixContainer>\n        <ng-content select="[matPrefix], [matIconPrefix]"></ng-content>\n      </div>\n    }\n\n    @if (_hasTextPrefix) {\n      <div class="mat-mdc-form-field-text-prefix" #textPrefixContainer>\n        <ng-content select="[matTextPrefix]"></ng-content>\n      </div>\n    }\n\n    <div class="mat-mdc-form-field-infix">\n      @if (!_hasOutline() || _forceDisplayInfixLabel()) {\n        <ng-template [ngTemplateOutlet]="labelTemplate"></ng-template>\n      }\n\n      <ng-content></ng-content>\n    </div>\n\n    @if (_hasTextSuffix) {\n      <div class="mat-mdc-form-field-text-suffix">\n        <ng-content select="[matTextSuffix]"></ng-content>\n      </div>\n    }\n\n    @if (_hasIconSuffix) {\n      <div class="mat-mdc-form-field-icon-suffix">\n        <ng-content select="[matSuffix], [matIconSuffix]"></ng-content>\n      </div>\n    }\n  </div>\n\n  @if (!_hasOutline()) {\n    <div matFormFieldLineRipple></div>\n  }\n</div>\n\n<div class="mat-mdc-form-field-subscript-wrapper mat-mdc-form-field-bottom-align"\n     [class.mat-mdc-form-field-subscript-dynamic-size]="subscriptSizing === \'dynamic\'">\n\n  @switch (_getDisplayedMessages()) {\n    @case (\'error\') {\n      <div class="mat-mdc-form-field-error-wrapper"\n           [@transitionMessages]="_subscriptAnimationState">\n        <ng-content select="mat-error, [matError]"></ng-content>\n      </div>\n    }\n\n    @case (\'hint\') {\n      <div class="mat-mdc-form-field-hint-wrapper" [@transitionMessages]="_subscriptAnimationState">\n        @if (hintLabel) {\n          <mat-hint [id]="_hintLabelId">{{hintLabel}}</mat-hint>\n        }\n        <ng-content select="mat-hint:not([align=\'end\'])"></ng-content>\n        <div class="mat-mdc-form-field-hint-spacer"></div>\n        <ng-content select="mat-hint[align=\'end\']"></ng-content>\n      </div>\n    }\n  }\n</div>\n',
      styles: ['.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-text-field__input{height:28px;width:100%;min-width:0;border:none;border-radius:0;background:none;appearance:none;padding:0}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}@media all{.mdc-text-field__input::placeholder{opacity:0}}@media all{.mdc-text-field__input:-ms-input-placeholder{opacity:0}}@media all{.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}}@media all{.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}}.mdc-text-field__affix{height:28px;opacity:0;white-space:nowrap}.mdc-text-field--label-floating .mdc-text-field__affix,.mdc-text-field--no-label .mdc-text-field__affix{opacity:1}@supports(-webkit-hyphens: none){.mdc-text-field--outlined .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field__affix--prefix,.mdc-text-field__affix--prefix[dir=rtl]{padding-left:2px;padding-right:0}.mdc-text-field--end-aligned .mdc-text-field__affix--prefix{padding-left:0;padding-right:12px}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--end-aligned .mdc-text-field__affix--prefix[dir=rtl]{padding-left:12px;padding-right:0}.mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field__affix--suffix,.mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:12px}.mdc-text-field--end-aligned .mdc-text-field__affix--suffix{padding-left:2px;padding-right:0}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--end-aligned .mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:2px}.mdc-text-field--filled{height:56px}.mdc-text-field--filled::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-text-field--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-text-field--filled .mdc-floating-label,.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled.mdc-text-field--no-label::before{display:none}@supports(-webkit-hyphens: none){.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field--outlined{height:56px;overflow:visible}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--outlined .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px,var(--mdc-shape-small, 4px))*2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px,var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px,var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px,var(--mdc-shape-small, 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px,var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px,calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:initial}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mdc-text-field--textarea{flex-direction:column;align-items:center;width:auto;height:auto;padding:0}.mdc-text-field--textarea .mdc-floating-label{top:19px}.mdc-text-field--textarea .mdc-floating-label:not(.mdc-floating-label--float-above){transform:none}.mdc-text-field--textarea .mdc-text-field__input{flex-grow:1;height:auto;min-height:1.5rem;overflow-x:hidden;overflow-y:auto;box-sizing:border-box;resize:none;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--filled::before{display:none}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-10.25px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--filled .mdc-text-field__input{margin-top:23px;margin-bottom:9px}.mdc-text-field--textarea.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-27.25px) scale(1)}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-24.75px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label{top:18px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field__input{margin-bottom:2px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter{align-self:flex-end;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::after{display:inline-block;width:0;height:16px;content:"";vertical-align:-16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::before{display:none}.mdc-text-field__resizer{align-self:stretch;display:inline-flex;flex-direction:column;flex-grow:1;max-height:100%;max-width:100%;min-height:56px;min-width:fit-content;min-width:-moz-available;min-width:-webkit-fill-available;overflow:hidden;resize:both}.mdc-text-field--filled .mdc-text-field__resizer{transform:translateY(-1px)}.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateY(1px)}.mdc-text-field--outlined .mdc-text-field__resizer{transform:translateX(-1px) translateY(-1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer,.mdc-text-field--outlined .mdc-text-field__resizer[dir=rtl]{transform:translateX(1px) translateY(-1px)}.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateX(1px) translateY(1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input[dir=rtl],.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter[dir=rtl]{transform:translateX(-1px) translateY(1px)}.mdc-text-field--with-leading-icon{padding-left:0;padding-right:16px}[dir=rtl] .mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:16px;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px);left:48px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 64px/0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-text-field--with-leading-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--with-trailing-icon{padding-left:16px;padding-right:0}[dir=rtl] .mdc-text-field--with-trailing-icon,.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 64px/0.75)}.mdc-text-field--with-trailing-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 96px/0.75)}.mdc-text-field-helper-line{display:flex;justify-content:space-between;box-sizing:border-box}.mdc-text-field+.mdc-text-field-helper-line{padding-right:16px;padding-left:16px}.mdc-form-field>.mdc-text-field+label{align-self:flex-start}.mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--focused .mdc-notched-outline__trailing{border-width:2px}.mdc-text-field--focused+.mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg){opacity:1}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-text-field--focused.mdc-text-field--outlined.mdc-text-field--textarea .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{opacity:1}.mdc-text-field--disabled{pointer-events:none}@media screen and (forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--disabled .mdc-floating-label{cursor:default}.mdc-text-field--disabled.mdc-text-field--filled .mdc-text-field__ripple{display:none}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--end-aligned .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--end-aligned .mdc-text-field__input[dir=rtl]{text-align:left}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix{direction:ltr}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--leading,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--leading{order:1}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{order:2}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input{order:3}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{order:4}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--trailing,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--trailing{order:5}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--prefix{padding-right:12px}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--suffix{padding-left:2px}.mdc-floating-label{position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after,.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;pointer-events:none}.mdc-notched-outline__trailing{flex-grow:1}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-top:1px solid;border-bottom:1px solid}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{max-width:calc(100% - 12px*2)}.mdc-line-ripple::before{border-bottom-width:1px}.mdc-line-ripple::after{border-bottom-width:2px}.mdc-text-field--filled{border-top-left-radius:var(--mdc-filled-text-field-container-shape);border-top-right-radius:var(--mdc-filled-text-field-container-shape);border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-caret-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-error-caret-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-filled-text-field-input-text-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-filled-text-field-disabled-input-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-label-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-focus-label-text-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-hover-label-text-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-disabled-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-focus-label-text-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-filled-text-field-error-hover-label-text-color)}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mdc-filled-text-field-label-text-font);font-size:var(--mdc-filled-text-field-label-text-size);font-weight:var(--mdc-filled-text-field-label-text-weight);letter-spacing:var(--mdc-filled-text-field-label-text-tracking)}@media all{.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color)}}@media all{.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color)}}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mdc-filled-text-field-container-color)}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mdc-filled-text-field-disabled-container-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-active-indicator-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-hover-active-indicator-color)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-focus-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-disabled-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-hover-active-indicator-color)}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-error-focus-active-indicator-color)}.mdc-text-field--filled .mdc-line-ripple::before{border-bottom-width:var(--mdc-filled-text-field-active-indicator-height)}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mdc-filled-text-field-focus-active-indicator-height)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-caret-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-error-caret-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-outlined-text-field-input-text-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-outlined-text-field-disabled-input-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-label-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-focus-label-text-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-hover-label-text-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-disabled-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-focus-label-text-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label--float-above{color:var(--mdc-outlined-text-field-error-hover-label-text-color)}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mdc-outlined-text-field-label-text-font);font-size:var(--mdc-outlined-text-field-label-text-size);font-weight:var(--mdc-outlined-text-field-label-text-weight);letter-spacing:var(--mdc-outlined-text-field-label-text-tracking)}@media all{.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color)}}@media all{.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color)}}.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(.75*var(--mdc-outlined-text-field-label-text-size))}.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mdc-outlined-text-field-label-text-size)}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:var(--mdc-outlined-text-field-container-shape);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-outlined-text-field-container-shape))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px,var(--mdc-outlined-text-field-container-shape))*2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:var(--mdc-outlined-text-field-container-shape);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px,var(--mdc-outlined-text-field-container-shape))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px,calc(var(--mdc-outlined-text-field-container-shape) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-hover-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-focus-outline-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-disabled-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-hover-outline-color)}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:var(--mdc-outlined-text-field-error-focus-outline-color)}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline .mdc-notched-outline__trailing{border-width:var(--mdc-outlined-text-field-outline-width)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:var(--mdc-outlined-text-field-focus-outline-width)}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color)}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-text-field-wrapper::before{content:none}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height);padding-top:var(--mat-form-field-filled-with-label-container-padding-top);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding);padding-bottom:var(--mat-form-field-container-vertical-padding)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color)}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font);line-height:var(--mat-form-field-subscript-text-line-height);font-size:var(--mat-form-field-subscript-text-size);letter-spacing:var(--mat-form-field-subscript-text-tracking);font-weight:var(--mat-form-field-subscript-text-weight)}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color)}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity)}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color)}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color)}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color)}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color)}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color)}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}.cdk-high-contrast-active .mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}.cdk-high-contrast-active .mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}.cdk-high-contrast-active .mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}.cdk-high-contrast-active .mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font);line-height:var(--mat-form-field-container-text-line-height);font-size:var(--mat-form-field-container-text-size);letter-spacing:var(--mat-form-field-container-text-tracking);font-weight:var(--mat-form-field-container-text-weight)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color)}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color)}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color)}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color)}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color)}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color)}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color)}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input{transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}@media all{.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}}@media all{.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}}@media all{.mdc-text-field--no-label .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder,.mdc-text-field--focused .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}}@media all{.mdc-text-field--no-label .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__affix{transition:opacity 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled.mdc-ripple-upgraded--background-focused .mdc-text-field__ripple::before,.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 34.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea{transition:none}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-filled 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-filled{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 10.25px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-outlined{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 24.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon{0%{transform:translateX(calc(0% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - 32px)) translateY(calc(0% - 34.75px)) scale(0.75)}}[dir=rtl] .mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake,.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--with-leading-icon.mdc-text-field--outlined[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon-rtl{0%{transform:translateX(calc(0% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}100%{transform:translateX(calc(0% - -32px)) translateY(calc(0% - 34.75px)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}100%{transform:translateX(calc(0% - 0%)) translateY(calc(0% - 106%)) scale(0.75)}}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: ChangeDetectorRef
  }, {
    type: NgZone
  }, {
    type: Directionality
  }, {
    type: Platform
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FORM_FIELD_DEFAULT_OPTIONS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    _textField: [{
      type: ViewChild,
      args: ["textField"]
    }],
    _iconPrefixContainer: [{
      type: ViewChild,
      args: ["iconPrefixContainer"]
    }],
    _textPrefixContainer: [{
      type: ViewChild,
      args: ["textPrefixContainer"]
    }],
    _floatingLabel: [{
      type: ViewChild,
      args: [MatFormFieldFloatingLabel]
    }],
    _notchedOutline: [{
      type: ViewChild,
      args: [MatFormFieldNotchedOutline]
    }],
    _lineRipple: [{
      type: ViewChild,
      args: [MatFormFieldLineRipple]
    }],
    _labelChildNonStatic: [{
      type: ContentChild,
      args: [MatLabel]
    }],
    _labelChildStatic: [{
      type: ContentChild,
      args: [MatLabel, {
        static: true
      }]
    }],
    _formFieldControl: [{
      type: ContentChild,
      args: [MatFormFieldControl]
    }],
    _prefixChildren: [{
      type: ContentChildren,
      args: [MAT_PREFIX, {
        descendants: true
      }]
    }],
    _suffixChildren: [{
      type: ContentChildren,
      args: [MAT_SUFFIX, {
        descendants: true
      }]
    }],
    _errorChildren: [{
      type: ContentChildren,
      args: [MAT_ERROR, {
        descendants: true
      }]
    }],
    _hintChildren: [{
      type: ContentChildren,
      args: [MatHint, {
        descendants: true
      }]
    }],
    hideRequiredMarker: [{
      type: Input
    }],
    color: [{
      type: Input
    }],
    floatLabel: [{
      type: Input
    }],
    appearance: [{
      type: Input
    }],
    subscriptSizing: [{
      type: Input
    }],
    hintLabel: [{
      type: Input
    }]
  });
})();
var _MatFormFieldModule = class _MatFormFieldModule {
};
_MatFormFieldModule.\u0275fac = function MatFormFieldModule_Factory(t) {
  return new (t || _MatFormFieldModule)();
};
_MatFormFieldModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatFormFieldModule
});
_MatFormFieldModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, CommonModule, ObserversModule, MatCommonModule]
});
var MatFormFieldModule = _MatFormFieldModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFormFieldModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, CommonModule, ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
      exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, MatCommonModule]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/text-field.mjs
var listenerOptions = normalizePassiveListenerOptions({
  passive: true
});
var _AutofillMonitor = class _AutofillMonitor {
  constructor(_platform, _ngZone) {
    this._platform = _platform;
    this._ngZone = _ngZone;
    this._monitoredElements = /* @__PURE__ */ new Map();
  }
  monitor(elementOrRef) {
    if (!this._platform.isBrowser) {
      return EMPTY;
    }
    const element = coerceElement(elementOrRef);
    const info = this._monitoredElements.get(element);
    if (info) {
      return info.subject;
    }
    const result = new Subject();
    const cssClass = "cdk-text-field-autofilled";
    const listener = (event) => {
      if (event.animationName === "cdk-text-field-autofill-start" && !element.classList.contains(cssClass)) {
        element.classList.add(cssClass);
        this._ngZone.run(() => result.next({
          target: event.target,
          isAutofilled: true
        }));
      } else if (event.animationName === "cdk-text-field-autofill-end" && element.classList.contains(cssClass)) {
        element.classList.remove(cssClass);
        this._ngZone.run(() => result.next({
          target: event.target,
          isAutofilled: false
        }));
      }
    };
    this._ngZone.runOutsideAngular(() => {
      element.addEventListener("animationstart", listener, listenerOptions);
      element.classList.add("cdk-text-field-autofill-monitored");
    });
    this._monitoredElements.set(element, {
      subject: result,
      unlisten: () => {
        element.removeEventListener("animationstart", listener, listenerOptions);
      }
    });
    return result;
  }
  stopMonitoring(elementOrRef) {
    const element = coerceElement(elementOrRef);
    const info = this._monitoredElements.get(element);
    if (info) {
      info.unlisten();
      info.subject.complete();
      element.classList.remove("cdk-text-field-autofill-monitored");
      element.classList.remove("cdk-text-field-autofilled");
      this._monitoredElements.delete(element);
    }
  }
  ngOnDestroy() {
    this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element));
  }
};
_AutofillMonitor.\u0275fac = function AutofillMonitor_Factory(t) {
  return new (t || _AutofillMonitor)(\u0275\u0275inject(Platform), \u0275\u0275inject(NgZone));
};
_AutofillMonitor.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _AutofillMonitor,
  factory: _AutofillMonitor.\u0275fac,
  providedIn: "root"
});
var AutofillMonitor = _AutofillMonitor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AutofillMonitor, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }, {
    type: NgZone
  }], null);
})();
var _CdkAutofill = class _CdkAutofill {
  constructor(_elementRef, _autofillMonitor) {
    this._elementRef = _elementRef;
    this._autofillMonitor = _autofillMonitor;
    this.cdkAutofill = new EventEmitter();
  }
  ngOnInit() {
    this._autofillMonitor.monitor(this._elementRef).subscribe((event) => this.cdkAutofill.emit(event));
  }
  ngOnDestroy() {
    this._autofillMonitor.stopMonitoring(this._elementRef);
  }
};
_CdkAutofill.\u0275fac = function CdkAutofill_Factory(t) {
  return new (t || _CdkAutofill)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(AutofillMonitor));
};
_CdkAutofill.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkAutofill,
  selectors: [["", "cdkAutofill", ""]],
  outputs: {
    cdkAutofill: "cdkAutofill"
  },
  standalone: true
});
var CdkAutofill = _CdkAutofill;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkAutofill, [{
    type: Directive,
    args: [{
      selector: "[cdkAutofill]",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: AutofillMonitor
  }], {
    cdkAutofill: [{
      type: Output
    }]
  });
})();
var _CdkTextareaAutosize = class _CdkTextareaAutosize {
  /** Minimum amount of rows in the textarea. */
  get minRows() {
    return this._minRows;
  }
  set minRows(value) {
    this._minRows = coerceNumberProperty(value);
    this._setMinHeight();
  }
  /** Maximum amount of rows in the textarea. */
  get maxRows() {
    return this._maxRows;
  }
  set maxRows(value) {
    this._maxRows = coerceNumberProperty(value);
    this._setMaxHeight();
  }
  /** Whether autosizing is enabled or not */
  get enabled() {
    return this._enabled;
  }
  set enabled(value) {
    if (this._enabled !== value) {
      (this._enabled = value) ? this.resizeToFitContent(true) : this.reset();
    }
  }
  get placeholder() {
    return this._textareaElement.placeholder;
  }
  set placeholder(value) {
    this._cachedPlaceholderHeight = void 0;
    if (value) {
      this._textareaElement.setAttribute("placeholder", value);
    } else {
      this._textareaElement.removeAttribute("placeholder");
    }
    this._cacheTextareaPlaceholderHeight();
  }
  constructor(_elementRef, _platform, _ngZone, document2) {
    this._elementRef = _elementRef;
    this._platform = _platform;
    this._ngZone = _ngZone;
    this._destroyed = new Subject();
    this._enabled = true;
    this._previousMinRows = -1;
    this._isViewInited = false;
    this._handleFocusEvent = (event) => {
      this._hasFocus = event.type === "focus";
    };
    this._document = document2;
    this._textareaElement = this._elementRef.nativeElement;
  }
  /** Sets the minimum height of the textarea as determined by minRows. */
  _setMinHeight() {
    const minHeight = this.minRows && this._cachedLineHeight ? `${this.minRows * this._cachedLineHeight}px` : null;
    if (minHeight) {
      this._textareaElement.style.minHeight = minHeight;
    }
  }
  /** Sets the maximum height of the textarea as determined by maxRows. */
  _setMaxHeight() {
    const maxHeight = this.maxRows && this._cachedLineHeight ? `${this.maxRows * this._cachedLineHeight}px` : null;
    if (maxHeight) {
      this._textareaElement.style.maxHeight = maxHeight;
    }
  }
  ngAfterViewInit() {
    if (this._platform.isBrowser) {
      this._initialHeight = this._textareaElement.style.height;
      this.resizeToFitContent();
      this._ngZone.runOutsideAngular(() => {
        const window2 = this._getWindow();
        fromEvent(window2, "resize").pipe(auditTime(16), takeUntil(this._destroyed)).subscribe(() => this.resizeToFitContent(true));
        this._textareaElement.addEventListener("focus", this._handleFocusEvent);
        this._textareaElement.addEventListener("blur", this._handleFocusEvent);
      });
      this._isViewInited = true;
      this.resizeToFitContent(true);
    }
  }
  ngOnDestroy() {
    this._textareaElement.removeEventListener("focus", this._handleFocusEvent);
    this._textareaElement.removeEventListener("blur", this._handleFocusEvent);
    this._destroyed.next();
    this._destroyed.complete();
  }
  /**
   * Cache the height of a single-row textarea if it has not already been cached.
   *
   * We need to know how large a single "row" of a textarea is in order to apply minRows and
   * maxRows. For the initial version, we will assume that the height of a single line in the
   * textarea does not ever change.
   */
  _cacheTextareaLineHeight() {
    if (this._cachedLineHeight) {
      return;
    }
    let textareaClone = this._textareaElement.cloneNode(false);
    textareaClone.rows = 1;
    textareaClone.style.position = "absolute";
    textareaClone.style.visibility = "hidden";
    textareaClone.style.border = "none";
    textareaClone.style.padding = "0";
    textareaClone.style.height = "";
    textareaClone.style.minHeight = "";
    textareaClone.style.maxHeight = "";
    textareaClone.style.overflow = "hidden";
    this._textareaElement.parentNode.appendChild(textareaClone);
    this._cachedLineHeight = textareaClone.clientHeight;
    textareaClone.remove();
    this._setMinHeight();
    this._setMaxHeight();
  }
  _measureScrollHeight() {
    const element = this._textareaElement;
    const previousMargin = element.style.marginBottom || "";
    const isFirefox = this._platform.FIREFOX;
    const needsMarginFiller = isFirefox && this._hasFocus;
    const measuringClass = isFirefox ? "cdk-textarea-autosize-measuring-firefox" : "cdk-textarea-autosize-measuring";
    if (needsMarginFiller) {
      element.style.marginBottom = `${element.clientHeight}px`;
    }
    element.classList.add(measuringClass);
    const scrollHeight = element.scrollHeight - 4;
    element.classList.remove(measuringClass);
    if (needsMarginFiller) {
      element.style.marginBottom = previousMargin;
    }
    return scrollHeight;
  }
  _cacheTextareaPlaceholderHeight() {
    if (!this._isViewInited || this._cachedPlaceholderHeight != void 0) {
      return;
    }
    if (!this.placeholder) {
      this._cachedPlaceholderHeight = 0;
      return;
    }
    const value = this._textareaElement.value;
    this._textareaElement.value = this._textareaElement.placeholder;
    this._cachedPlaceholderHeight = this._measureScrollHeight();
    this._textareaElement.value = value;
  }
  ngDoCheck() {
    if (this._platform.isBrowser) {
      this.resizeToFitContent();
    }
  }
  /**
   * Resize the textarea to fit its content.
   * @param force Whether to force a height recalculation. By default the height will be
   *    recalculated only if the value changed since the last call.
   */
  resizeToFitContent(force = false) {
    if (!this._enabled) {
      return;
    }
    this._cacheTextareaLineHeight();
    this._cacheTextareaPlaceholderHeight();
    if (!this._cachedLineHeight) {
      return;
    }
    const textarea = this._elementRef.nativeElement;
    const value = textarea.value;
    if (!force && this._minRows === this._previousMinRows && value === this._previousValue) {
      return;
    }
    const scrollHeight = this._measureScrollHeight();
    const height = Math.max(scrollHeight, this._cachedPlaceholderHeight || 0);
    textarea.style.height = `${height}px`;
    this._ngZone.runOutsideAngular(() => {
      if (typeof requestAnimationFrame !== "undefined") {
        requestAnimationFrame(() => this._scrollToCaretPosition(textarea));
      } else {
        setTimeout(() => this._scrollToCaretPosition(textarea));
      }
    });
    this._previousValue = value;
    this._previousMinRows = this._minRows;
  }
  /**
   * Resets the textarea to its original size
   */
  reset() {
    if (this._initialHeight !== void 0) {
      this._textareaElement.style.height = this._initialHeight;
    }
  }
  _noopInputHandler() {
  }
  /** Access injected document if available or fallback to global document reference */
  _getDocument() {
    return this._document || document;
  }
  /** Use defaultView of injected document if available or fallback to global window reference */
  _getWindow() {
    const doc = this._getDocument();
    return doc.defaultView || window;
  }
  /**
   * Scrolls a textarea to the caret position. On Firefox resizing the textarea will
   * prevent it from scrolling to the caret position. We need to re-set the selection
   * in order for it to scroll to the proper position.
   */
  _scrollToCaretPosition(textarea) {
    const {
      selectionStart,
      selectionEnd
    } = textarea;
    if (!this._destroyed.isStopped && this._hasFocus) {
      textarea.setSelectionRange(selectionStart, selectionEnd);
    }
  }
};
_CdkTextareaAutosize.\u0275fac = function CdkTextareaAutosize_Factory(t) {
  return new (t || _CdkTextareaAutosize)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(DOCUMENT2, 8));
};
_CdkTextareaAutosize.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkTextareaAutosize,
  selectors: [["textarea", "cdkTextareaAutosize", ""]],
  hostAttrs: ["rows", "1", 1, "cdk-textarea-autosize"],
  hostBindings: function CdkTextareaAutosize_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("input", function CdkTextareaAutosize_input_HostBindingHandler() {
        return ctx._noopInputHandler();
      });
    }
  },
  inputs: {
    minRows: [0, "cdkAutosizeMinRows", "minRows"],
    maxRows: [0, "cdkAutosizeMaxRows", "maxRows"],
    enabled: [2, "cdkTextareaAutosize", "enabled", booleanAttribute],
    placeholder: "placeholder"
  },
  exportAs: ["cdkTextareaAutosize"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature]
});
var CdkTextareaAutosize = _CdkTextareaAutosize;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkTextareaAutosize, [{
    type: Directive,
    args: [{
      selector: "textarea[cdkTextareaAutosize]",
      exportAs: "cdkTextareaAutosize",
      host: {
        "class": "cdk-textarea-autosize",
        // Textarea elements that have the directive applied should have a single row by default.
        // Browsers normally show two rows by default and therefore this limits the minRows binding.
        "rows": "1",
        "(input)": "_noopInputHandler()"
      },
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    minRows: [{
      type: Input,
      args: ["cdkAutosizeMinRows"]
    }],
    maxRows: [{
      type: Input,
      args: ["cdkAutosizeMaxRows"]
    }],
    enabled: [{
      type: Input,
      args: [{
        alias: "cdkTextareaAutosize",
        transform: booleanAttribute
      }]
    }],
    placeholder: [{
      type: Input
    }]
  });
})();
var _TextFieldModule = class _TextFieldModule {
};
_TextFieldModule.\u0275fac = function TextFieldModule_Factory(t) {
  return new (t || _TextFieldModule)();
};
_TextFieldModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _TextFieldModule
});
_TextFieldModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var TextFieldModule = _TextFieldModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TextFieldModule, [{
    type: NgModule,
    args: [{
      imports: [CdkAutofill, CdkTextareaAutosize],
      exports: [CdkAutofill, CdkTextareaAutosize]
    }]
  }], null, null);
})();

// node_modules/@angular/material/fesm2022/input.mjs
function getMatInputUnsupportedTypeError(type) {
  return Error(`Input type "${type}" isn't supported by matInput.`);
}
var MAT_INPUT_VALUE_ACCESSOR = new InjectionToken("MAT_INPUT_VALUE_ACCESSOR");
var MAT_INPUT_INVALID_TYPES = ["button", "checkbox", "file", "hidden", "image", "radio", "range", "reset", "submit"];
var nextUniqueId2 = 0;
var _MatInput = class _MatInput {
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    this._disabled = coerceBooleanProperty(value);
    if (this.focused) {
      this.focused = false;
      this.stateChanges.next();
    }
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get id() {
    return this._id;
  }
  set id(value) {
    this._id = value || this._uid;
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get required() {
    return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
  }
  set required(value) {
    this._required = coerceBooleanProperty(value);
  }
  /** Input type of the element. */
  get type() {
    return this._type;
  }
  set type(value) {
    this._type = value || "text";
    this._validateType();
    if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {
      this._elementRef.nativeElement.type = this._type;
    }
  }
  /** An object used to control when error messages are shown. */
  get errorStateMatcher() {
    return this._errorStateTracker.matcher;
  }
  set errorStateMatcher(value) {
    this._errorStateTracker.matcher = value;
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get value() {
    return this._inputValueAccessor.value;
  }
  set value(value) {
    if (value !== this.value) {
      this._inputValueAccessor.value = value;
      this.stateChanges.next();
    }
  }
  /** Whether the element is readonly. */
  get readonly() {
    return this._readonly;
  }
  set readonly(value) {
    this._readonly = coerceBooleanProperty(value);
  }
  /** Whether the input is in an error state. */
  get errorState() {
    return this._errorStateTracker.errorState;
  }
  set errorState(value) {
    this._errorStateTracker.errorState = value;
  }
  constructor(_elementRef, _platform, ngControl, parentForm, parentFormGroup, defaultErrorStateMatcher, inputValueAccessor, _autofillMonitor, ngZone, _formField) {
    this._elementRef = _elementRef;
    this._platform = _platform;
    this.ngControl = ngControl;
    this._autofillMonitor = _autofillMonitor;
    this._formField = _formField;
    this._uid = `mat-input-${nextUniqueId2++}`;
    this.focused = false;
    this.stateChanges = new Subject();
    this.controlType = "mat-input";
    this.autofilled = false;
    this._disabled = false;
    this._type = "text";
    this._readonly = false;
    this._neverEmptyInputTypes = ["date", "datetime", "datetime-local", "month", "time", "week"].filter((t) => getSupportedInputTypes().has(t));
    this._iOSKeyupListener = (event) => {
      const el = event.target;
      if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {
        el.setSelectionRange(1, 1);
        el.setSelectionRange(0, 0);
      }
    };
    const element = this._elementRef.nativeElement;
    const nodeName = element.nodeName.toLowerCase();
    this._inputValueAccessor = inputValueAccessor || element;
    this._previousNativeValue = this.value;
    this.id = this.id;
    if (_platform.IOS) {
      ngZone.runOutsideAngular(() => {
        _elementRef.nativeElement.addEventListener("keyup", this._iOSKeyupListener);
      });
    }
    this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, ngControl, parentFormGroup, parentForm, this.stateChanges);
    this._isServer = !this._platform.isBrowser;
    this._isNativeSelect = nodeName === "select";
    this._isTextarea = nodeName === "textarea";
    this._isInFormField = !!_formField;
    if (this._isNativeSelect) {
      this.controlType = element.multiple ? "mat-native-select-multiple" : "mat-native-select";
    }
  }
  ngAfterViewInit() {
    if (this._platform.isBrowser) {
      this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe((event) => {
        this.autofilled = event.isAutofilled;
        this.stateChanges.next();
      });
    }
  }
  ngOnChanges() {
    this.stateChanges.next();
  }
  ngOnDestroy() {
    this.stateChanges.complete();
    if (this._platform.isBrowser) {
      this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
    }
    if (this._platform.IOS) {
      this._elementRef.nativeElement.removeEventListener("keyup", this._iOSKeyupListener);
    }
  }
  ngDoCheck() {
    if (this.ngControl) {
      this.updateErrorState();
      if (this.ngControl.disabled !== null && this.ngControl.disabled !== this.disabled) {
        this.disabled = this.ngControl.disabled;
        this.stateChanges.next();
      }
    }
    this._dirtyCheckNativeValue();
    this._dirtyCheckPlaceholder();
  }
  /** Focuses the input. */
  focus(options) {
    this._elementRef.nativeElement.focus(options);
  }
  /** Refreshes the error state of the input. */
  updateErrorState() {
    this._errorStateTracker.updateErrorState();
  }
  /** Callback for the cases where the focused state of the input changes. */
  _focusChanged(isFocused) {
    if (isFocused !== this.focused) {
      this.focused = isFocused;
      this.stateChanges.next();
    }
  }
  _onInput() {
  }
  /** Does some manual dirty checking on the native input `value` property. */
  _dirtyCheckNativeValue() {
    const newValue = this._elementRef.nativeElement.value;
    if (this._previousNativeValue !== newValue) {
      this._previousNativeValue = newValue;
      this.stateChanges.next();
    }
  }
  /** Does some manual dirty checking on the native input `placeholder` attribute. */
  _dirtyCheckPlaceholder() {
    const placeholder = this._getPlaceholder();
    if (placeholder !== this._previousPlaceholder) {
      const element = this._elementRef.nativeElement;
      this._previousPlaceholder = placeholder;
      placeholder ? element.setAttribute("placeholder", placeholder) : element.removeAttribute("placeholder");
    }
  }
  /** Gets the current placeholder of the form field. */
  _getPlaceholder() {
    return this.placeholder || null;
  }
  /** Make sure the input is a supported type. */
  _validateType() {
    if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw getMatInputUnsupportedTypeError(this._type);
    }
  }
  /** Checks whether the input type is one of the types that are never empty. */
  _isNeverEmpty() {
    return this._neverEmptyInputTypes.indexOf(this._type) > -1;
  }
  /** Checks whether the input is invalid based on the native validation. */
  _isBadInput() {
    let validity = this._elementRef.nativeElement.validity;
    return validity && validity.badInput;
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get empty() {
    return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  get shouldLabelFloat() {
    if (this._isNativeSelect) {
      const selectElement = this._elementRef.nativeElement;
      const firstOption = selectElement.options[0];
      return this.focused || selectElement.multiple || !this.empty || !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);
    } else {
      return this.focused || !this.empty;
    }
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  setDescribedByIds(ids) {
    if (ids.length) {
      this._elementRef.nativeElement.setAttribute("aria-describedby", ids.join(" "));
    } else {
      this._elementRef.nativeElement.removeAttribute("aria-describedby");
    }
  }
  /**
   * Implemented as part of MatFormFieldControl.
   * @docs-private
   */
  onContainerClick() {
    if (!this.focused) {
      this.focus();
    }
  }
  /** Whether the form control is a native select that is displayed inline. */
  _isInlineSelect() {
    const element = this._elementRef.nativeElement;
    return this._isNativeSelect && (element.multiple || element.size > 1);
  }
};
_MatInput.\u0275fac = function MatInput_Factory(t) {
  return new (t || _MatInput)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgControl, 10), \u0275\u0275directiveInject(NgForm, 8), \u0275\u0275directiveInject(FormGroupDirective, 8), \u0275\u0275directiveInject(ErrorStateMatcher), \u0275\u0275directiveInject(MAT_INPUT_VALUE_ACCESSOR, 10), \u0275\u0275directiveInject(AutofillMonitor), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(MAT_FORM_FIELD, 8));
};
_MatInput.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatInput,
  selectors: [["input", "matInput", ""], ["textarea", "matInput", ""], ["select", "matNativeControl", ""], ["input", "matNativeControl", ""], ["textarea", "matNativeControl", ""]],
  hostAttrs: [1, "mat-mdc-input-element"],
  hostVars: 18,
  hostBindings: function MatInput_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("focus", function MatInput_focus_HostBindingHandler() {
        return ctx._focusChanged(true);
      })("blur", function MatInput_blur_HostBindingHandler() {
        return ctx._focusChanged(false);
      })("input", function MatInput_input_HostBindingHandler() {
        return ctx._onInput();
      });
    }
    if (rf & 2) {
      \u0275\u0275hostProperty("id", ctx.id)("disabled", ctx.disabled)("required", ctx.required);
      \u0275\u0275attribute("name", ctx.name || null)("readonly", ctx.readonly && !ctx._isNativeSelect || null)("aria-invalid", ctx.empty && ctx.required ? null : ctx.errorState)("aria-required", ctx.required)("id", ctx.id);
      \u0275\u0275classProp("mat-input-server", ctx._isServer)("mat-mdc-form-field-textarea-control", ctx._isInFormField && ctx._isTextarea)("mat-mdc-form-field-input-control", ctx._isInFormField)("mdc-text-field__input", ctx._isInFormField)("mat-mdc-native-select-inline", ctx._isInlineSelect());
    }
  },
  inputs: {
    disabled: "disabled",
    id: "id",
    placeholder: "placeholder",
    name: "name",
    required: "required",
    type: "type",
    errorStateMatcher: "errorStateMatcher",
    userAriaDescribedBy: [0, "aria-describedby", "userAriaDescribedBy"],
    value: "value",
    readonly: "readonly"
  },
  exportAs: ["matInput"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MatFormFieldControl,
    useExisting: _MatInput
  }]), \u0275\u0275NgOnChangesFeature]
});
var MatInput = _MatInput;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatInput, [{
    type: Directive,
    args: [{
      selector: `input[matInput], textarea[matInput], select[matNativeControl],
      input[matNativeControl], textarea[matNativeControl]`,
      exportAs: "matInput",
      host: {
        "class": "mat-mdc-input-element",
        // The BaseMatInput parent class adds `mat-input-element`, `mat-form-field-control` and
        // `mat-form-field-autofill-control` to the CSS class list, but this should not be added for
        // this MDC equivalent input.
        "[class.mat-input-server]": "_isServer",
        "[class.mat-mdc-form-field-textarea-control]": "_isInFormField && _isTextarea",
        "[class.mat-mdc-form-field-input-control]": "_isInFormField",
        "[class.mdc-text-field__input]": "_isInFormField",
        "[class.mat-mdc-native-select-inline]": "_isInlineSelect()",
        // Native input properties that are overwritten by Angular inputs need to be synced with
        // the native input element. Otherwise property bindings for those don't work.
        "[id]": "id",
        "[disabled]": "disabled",
        "[required]": "required",
        "[attr.name]": "name || null",
        "[attr.readonly]": "readonly && !_isNativeSelect || null",
        // Only mark the input as invalid for assistive technology if it has a value since the
        // state usually overlaps with `aria-required` when the input is empty and can be redundant.
        "[attr.aria-invalid]": "(empty && required) ? null : errorState",
        "[attr.aria-required]": "required",
        // Native input properties that are overwritten by Angular inputs need to be synced with
        // the native input element. Otherwise property bindings for those don't work.
        "[attr.id]": "id",
        "(focus)": "_focusChanged(true)",
        "(blur)": "_focusChanged(false)",
        "(input)": "_onInput()"
      },
      providers: [{
        provide: MatFormFieldControl,
        useExisting: MatInput
      }],
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgControl,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }]
  }, {
    type: NgForm,
    decorators: [{
      type: Optional
    }]
  }, {
    type: FormGroupDirective,
    decorators: [{
      type: Optional
    }]
  }, {
    type: ErrorStateMatcher
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Self
    }, {
      type: Inject,
      args: [MAT_INPUT_VALUE_ACCESSOR]
    }]
  }, {
    type: AutofillMonitor
  }, {
    type: NgZone
  }, {
    type: MatFormField,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FORM_FIELD]
    }]
  }], {
    disabled: [{
      type: Input
    }],
    id: [{
      type: Input
    }],
    placeholder: [{
      type: Input
    }],
    name: [{
      type: Input
    }],
    required: [{
      type: Input
    }],
    type: [{
      type: Input
    }],
    errorStateMatcher: [{
      type: Input
    }],
    userAriaDescribedBy: [{
      type: Input,
      args: ["aria-describedby"]
    }],
    value: [{
      type: Input
    }],
    readonly: [{
      type: Input
    }]
  });
})();
var _MatInputModule = class _MatInputModule {
};
_MatInputModule.\u0275fac = function MatInputModule_Factory(t) {
  return new (t || _MatInputModule)();
};
_MatInputModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatInputModule
});
_MatInputModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, MatFormFieldModule, MatFormFieldModule, TextFieldModule, MatCommonModule]
});
var MatInputModule = _MatInputModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatInputModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatFormFieldModule, MatInput],
      exports: [MatInput, MatFormFieldModule, TextFieldModule, MatCommonModule]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/collections.mjs
var DataSource = class {
};
function isDataSource(value) {
  return value && typeof value.connect === "function" && !(value instanceof ConnectableObservable);
}
var ArrayDataSource = class extends DataSource {
  constructor(_data) {
    super();
    this._data = _data;
  }
  connect() {
    return isObservable(this._data) ? this._data : of(this._data);
  }
  disconnect() {
  }
};
var _ViewRepeaterOperation;
(function(_ViewRepeaterOperation2) {
  _ViewRepeaterOperation2[_ViewRepeaterOperation2["REPLACED"] = 0] = "REPLACED";
  _ViewRepeaterOperation2[_ViewRepeaterOperation2["INSERTED"] = 1] = "INSERTED";
  _ViewRepeaterOperation2[_ViewRepeaterOperation2["MOVED"] = 2] = "MOVED";
  _ViewRepeaterOperation2[_ViewRepeaterOperation2["REMOVED"] = 3] = "REMOVED";
})(_ViewRepeaterOperation || (_ViewRepeaterOperation = {}));
var _VIEW_REPEATER_STRATEGY = new InjectionToken("_ViewRepeater");
var _RecycleViewRepeaterStrategy = class {
  constructor() {
    this.viewCacheSize = 20;
    this._viewCache = [];
  }
  /** Apply changes to the DOM. */
  applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {
    changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {
      let view;
      let operation;
      if (record.previousIndex == null) {
        const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);
        view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));
        operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED;
      } else if (currentIndex == null) {
        this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);
        operation = _ViewRepeaterOperation.REMOVED;
      } else {
        view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));
        operation = _ViewRepeaterOperation.MOVED;
      }
      if (itemViewChanged) {
        itemViewChanged({
          context: view?.context,
          operation,
          record
        });
      }
    });
  }
  detach() {
    for (const view of this._viewCache) {
      view.destroy();
    }
    this._viewCache = [];
  }
  /**
   * Inserts a view for a new item, either from the cache or by creating a new
   * one. Returns `undefined` if the item was inserted into a cached view.
   */
  _insertView(viewArgsFactory, currentIndex, viewContainerRef, value) {
    const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef);
    if (cachedView) {
      cachedView.context.$implicit = value;
      return void 0;
    }
    const viewArgs = viewArgsFactory();
    return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index);
  }
  /** Detaches the view at the given index and inserts into the view cache. */
  _detachAndCacheView(index, viewContainerRef) {
    const detachedView = viewContainerRef.detach(index);
    this._maybeCacheView(detachedView, viewContainerRef);
  }
  /** Moves view at the previous index to the current index. */
  _moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) {
    const view = viewContainerRef.get(adjustedPreviousIndex);
    viewContainerRef.move(view, currentIndex);
    view.context.$implicit = value;
    return view;
  }
  /**
   * Cache the given detached view. If the cache is full, the view will be
   * destroyed.
   */
  _maybeCacheView(view, viewContainerRef) {
    if (this._viewCache.length < this.viewCacheSize) {
      this._viewCache.push(view);
    } else {
      const index = viewContainerRef.indexOf(view);
      if (index === -1) {
        view.destroy();
      } else {
        viewContainerRef.remove(index);
      }
    }
  }
  /** Inserts a recycled view from the cache at the given index. */
  _insertViewFromCache(index, viewContainerRef) {
    const cachedView = this._viewCache.pop();
    if (cachedView) {
      viewContainerRef.insert(cachedView, index);
    }
    return cachedView || null;
  }
};
var _UniqueSelectionDispatcher = class _UniqueSelectionDispatcher {
  constructor() {
    this._listeners = [];
  }
  /**
   * Notify other items that selection for the given name has been set.
   * @param id ID of the item.
   * @param name Name of the item.
   */
  notify(id2, name) {
    for (let listener of this._listeners) {
      listener(id2, name);
    }
  }
  /**
   * Listen for future changes to item selection.
   * @return Function used to deregister listener
   */
  listen(listener) {
    this._listeners.push(listener);
    return () => {
      this._listeners = this._listeners.filter((registered) => {
        return listener !== registered;
      });
    };
  }
  ngOnDestroy() {
    this._listeners = [];
  }
};
_UniqueSelectionDispatcher.\u0275fac = function UniqueSelectionDispatcher_Factory(t) {
  return new (t || _UniqueSelectionDispatcher)();
};
_UniqueSelectionDispatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _UniqueSelectionDispatcher,
  factory: _UniqueSelectionDispatcher.\u0275fac,
  providedIn: "root"
});
var UniqueSelectionDispatcher = _UniqueSelectionDispatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UniqueSelectionDispatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/scrolling.mjs
var _c03 = ["contentWrapper"];
var _c13 = ["*"];
var VIRTUAL_SCROLL_STRATEGY = new InjectionToken("VIRTUAL_SCROLL_STRATEGY");
var FixedSizeVirtualScrollStrategy = class {
  /**
   * @param itemSize The size of the items in the virtually scrolling list.
   * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
   * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
   */
  constructor(itemSize, minBufferPx, maxBufferPx) {
    this._scrolledIndexChange = new Subject();
    this.scrolledIndexChange = this._scrolledIndexChange.pipe(distinctUntilChanged());
    this._viewport = null;
    this._itemSize = itemSize;
    this._minBufferPx = minBufferPx;
    this._maxBufferPx = maxBufferPx;
  }
  /**
   * Attaches this scroll strategy to a viewport.
   * @param viewport The viewport to attach this strategy to.
   */
  attach(viewport) {
    this._viewport = viewport;
    this._updateTotalContentSize();
    this._updateRenderedRange();
  }
  /** Detaches this scroll strategy from the currently attached viewport. */
  detach() {
    this._scrolledIndexChange.complete();
    this._viewport = null;
  }
  /**
   * Update the item size and buffer size.
   * @param itemSize The size of the items in the virtually scrolling list.
   * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
   * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
   */
  updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) {
    if (maxBufferPx < minBufferPx && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error("CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx");
    }
    this._itemSize = itemSize;
    this._minBufferPx = minBufferPx;
    this._maxBufferPx = maxBufferPx;
    this._updateTotalContentSize();
    this._updateRenderedRange();
  }
  /** @docs-private Implemented as part of VirtualScrollStrategy. */
  onContentScrolled() {
    this._updateRenderedRange();
  }
  /** @docs-private Implemented as part of VirtualScrollStrategy. */
  onDataLengthChanged() {
    this._updateTotalContentSize();
    this._updateRenderedRange();
  }
  /** @docs-private Implemented as part of VirtualScrollStrategy. */
  onContentRendered() {
  }
  /** @docs-private Implemented as part of VirtualScrollStrategy. */
  onRenderedOffsetChanged() {
  }
  /**
   * Scroll to the offset for the given index.
   * @param index The index of the element to scroll to.
   * @param behavior The ScrollBehavior to use when scrolling.
   */
  scrollToIndex(index, behavior) {
    if (this._viewport) {
      this._viewport.scrollToOffset(index * this._itemSize, behavior);
    }
  }
  /** Update the viewport's total content size. */
  _updateTotalContentSize() {
    if (!this._viewport) {
      return;
    }
    this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);
  }
  /** Update the viewport's rendered range. */
  _updateRenderedRange() {
    if (!this._viewport) {
      return;
    }
    const renderedRange = this._viewport.getRenderedRange();
    const newRange = {
      start: renderedRange.start,
      end: renderedRange.end
    };
    const viewportSize = this._viewport.getViewportSize();
    const dataLength = this._viewport.getDataLength();
    let scrollOffset = this._viewport.measureScrollOffset();
    let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0;
    if (newRange.end > dataLength) {
      const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);
      const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));
      if (firstVisibleIndex != newVisibleIndex) {
        firstVisibleIndex = newVisibleIndex;
        scrollOffset = newVisibleIndex * this._itemSize;
        newRange.start = Math.floor(firstVisibleIndex);
      }
      newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));
    }
    const startBuffer = scrollOffset - newRange.start * this._itemSize;
    if (startBuffer < this._minBufferPx && newRange.start != 0) {
      const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);
      newRange.start = Math.max(0, newRange.start - expandStart);
      newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));
    } else {
      const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);
      if (endBuffer < this._minBufferPx && newRange.end != dataLength) {
        const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);
        if (expandEnd > 0) {
          newRange.end = Math.min(dataLength, newRange.end + expandEnd);
          newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));
        }
      }
    }
    this._viewport.setRenderedRange(newRange);
    this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);
    this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));
  }
};
function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) {
  return fixedSizeDir._scrollStrategy;
}
var _CdkFixedSizeVirtualScroll = class _CdkFixedSizeVirtualScroll {
  constructor() {
    this._itemSize = 20;
    this._minBufferPx = 100;
    this._maxBufferPx = 200;
    this._scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);
  }
  /** The size of the items in the list (in pixels). */
  get itemSize() {
    return this._itemSize;
  }
  set itemSize(value) {
    this._itemSize = coerceNumberProperty(value);
  }
  /**
   * The minimum amount of buffer rendered beyond the viewport (in pixels).
   * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.
   */
  get minBufferPx() {
    return this._minBufferPx;
  }
  set minBufferPx(value) {
    this._minBufferPx = coerceNumberProperty(value);
  }
  /**
   * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.
   */
  get maxBufferPx() {
    return this._maxBufferPx;
  }
  set maxBufferPx(value) {
    this._maxBufferPx = coerceNumberProperty(value);
  }
  ngOnChanges() {
    this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);
  }
};
_CdkFixedSizeVirtualScroll.\u0275fac = function CdkFixedSizeVirtualScroll_Factory(t) {
  return new (t || _CdkFixedSizeVirtualScroll)();
};
_CdkFixedSizeVirtualScroll.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkFixedSizeVirtualScroll,
  selectors: [["cdk-virtual-scroll-viewport", "itemSize", ""]],
  inputs: {
    itemSize: "itemSize",
    minBufferPx: "minBufferPx",
    maxBufferPx: "maxBufferPx"
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: VIRTUAL_SCROLL_STRATEGY,
    useFactory: _fixedSizeVirtualScrollStrategyFactory,
    deps: [forwardRef(() => _CdkFixedSizeVirtualScroll)]
  }]), \u0275\u0275NgOnChangesFeature]
});
var CdkFixedSizeVirtualScroll = _CdkFixedSizeVirtualScroll;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkFixedSizeVirtualScroll, [{
    type: Directive,
    args: [{
      selector: "cdk-virtual-scroll-viewport[itemSize]",
      standalone: true,
      providers: [{
        provide: VIRTUAL_SCROLL_STRATEGY,
        useFactory: _fixedSizeVirtualScrollStrategyFactory,
        deps: [forwardRef(() => CdkFixedSizeVirtualScroll)]
      }]
    }]
  }], null, {
    itemSize: [{
      type: Input
    }],
    minBufferPx: [{
      type: Input
    }],
    maxBufferPx: [{
      type: Input
    }]
  });
})();
var DEFAULT_SCROLL_TIME = 20;
var _ScrollDispatcher = class _ScrollDispatcher {
  constructor(_ngZone, _platform, document2) {
    this._ngZone = _ngZone;
    this._platform = _platform;
    this._scrolled = new Subject();
    this._globalSubscription = null;
    this._scrolledCount = 0;
    this.scrollContainers = /* @__PURE__ */ new Map();
    this._document = document2;
  }
  /**
   * Registers a scrollable instance with the service and listens for its scrolled events. When the
   * scrollable is scrolled, the service emits the event to its scrolled observable.
   * @param scrollable Scrollable instance to be registered.
   */
  register(scrollable) {
    if (!this.scrollContainers.has(scrollable)) {
      this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable)));
    }
  }
  /**
   * De-registers a Scrollable reference and unsubscribes from its scroll event observable.
   * @param scrollable Scrollable instance to be deregistered.
   */
  deregister(scrollable) {
    const scrollableReference = this.scrollContainers.get(scrollable);
    if (scrollableReference) {
      scrollableReference.unsubscribe();
      this.scrollContainers.delete(scrollable);
    }
  }
  /**
   * Returns an observable that emits an event whenever any of the registered Scrollable
   * references (or window, document, or body) fire a scrolled event. Can provide a time in ms
   * to override the default "throttle" time.
   *
   * **Note:** in order to avoid hitting change detection for every scroll event,
   * all of the events emitted from this stream will be run outside the Angular zone.
   * If you need to update any data bindings as a result of a scroll event, you have
   * to run the callback using `NgZone.run`.
   */
  scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) {
    if (!this._platform.isBrowser) {
      return of();
    }
    return new Observable((observer) => {
      if (!this._globalSubscription) {
        this._addGlobalListener();
      }
      const subscription = auditTimeInMs > 0 ? this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer);
      this._scrolledCount++;
      return () => {
        subscription.unsubscribe();
        this._scrolledCount--;
        if (!this._scrolledCount) {
          this._removeGlobalListener();
        }
      };
    });
  }
  ngOnDestroy() {
    this._removeGlobalListener();
    this.scrollContainers.forEach((_, container) => this.deregister(container));
    this._scrolled.complete();
  }
  /**
   * Returns an observable that emits whenever any of the
   * scrollable ancestors of an element are scrolled.
   * @param elementOrElementRef Element whose ancestors to listen for.
   * @param auditTimeInMs Time to throttle the scroll events.
   */
  ancestorScrolled(elementOrElementRef, auditTimeInMs) {
    const ancestors = this.getAncestorScrollContainers(elementOrElementRef);
    return this.scrolled(auditTimeInMs).pipe(filter((target) => {
      return !target || ancestors.indexOf(target) > -1;
    }));
  }
  /** Returns all registered Scrollables that contain the provided element. */
  getAncestorScrollContainers(elementOrElementRef) {
    const scrollingContainers = [];
    this.scrollContainers.forEach((_subscription, scrollable) => {
      if (this._scrollableContainsElement(scrollable, elementOrElementRef)) {
        scrollingContainers.push(scrollable);
      }
    });
    return scrollingContainers;
  }
  /** Use defaultView of injected document if available or fallback to global window reference */
  _getWindow() {
    return this._document.defaultView || window;
  }
  /** Returns true if the element is contained within the provided Scrollable. */
  _scrollableContainsElement(scrollable, elementOrElementRef) {
    let element = coerceElement(elementOrElementRef);
    let scrollableElement = scrollable.getElementRef().nativeElement;
    do {
      if (element == scrollableElement) {
        return true;
      }
    } while (element = element.parentElement);
    return false;
  }
  /** Sets up the global scroll listeners. */
  _addGlobalListener() {
    this._globalSubscription = this._ngZone.runOutsideAngular(() => {
      const window2 = this._getWindow();
      return fromEvent(window2.document, "scroll").subscribe(() => this._scrolled.next());
    });
  }
  /** Cleans up the global scroll listener. */
  _removeGlobalListener() {
    if (this._globalSubscription) {
      this._globalSubscription.unsubscribe();
      this._globalSubscription = null;
    }
  }
};
_ScrollDispatcher.\u0275fac = function ScrollDispatcher_Factory(t) {
  return new (t || _ScrollDispatcher)(\u0275\u0275inject(NgZone), \u0275\u0275inject(Platform), \u0275\u0275inject(DOCUMENT2, 8));
};
_ScrollDispatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ScrollDispatcher,
  factory: _ScrollDispatcher.\u0275fac,
  providedIn: "root"
});
var ScrollDispatcher = _ScrollDispatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollDispatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: NgZone
  }, {
    type: Platform
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var _CdkScrollable = class _CdkScrollable {
  constructor(elementRef, scrollDispatcher, ngZone, dir) {
    this.elementRef = elementRef;
    this.scrollDispatcher = scrollDispatcher;
    this.ngZone = ngZone;
    this.dir = dir;
    this._destroyed = new Subject();
    this._elementScrolled = new Observable((observer) => this.ngZone.runOutsideAngular(() => fromEvent(this.elementRef.nativeElement, "scroll").pipe(takeUntil(this._destroyed)).subscribe(observer)));
  }
  ngOnInit() {
    this.scrollDispatcher.register(this);
  }
  ngOnDestroy() {
    this.scrollDispatcher.deregister(this);
    this._destroyed.next();
    this._destroyed.complete();
  }
  /** Returns observable that emits when a scroll event is fired on the host element. */
  elementScrolled() {
    return this._elementScrolled;
  }
  /** Gets the ElementRef for the viewport. */
  getElementRef() {
    return this.elementRef;
  }
  /**
   * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo
   * method, since browsers are not consistent about what scrollLeft means in RTL. For this method
   * left and right always refer to the left and right side of the scrolling container irrespective
   * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
   * in an RTL context.
   * @param options specified the offsets to scroll to.
   */
  scrollTo(options) {
    const el = this.elementRef.nativeElement;
    const isRtl = this.dir && this.dir.value == "rtl";
    if (options.left == null) {
      options.left = isRtl ? options.end : options.start;
    }
    if (options.right == null) {
      options.right = isRtl ? options.start : options.end;
    }
    if (options.bottom != null) {
      options.top = el.scrollHeight - el.clientHeight - options.bottom;
    }
    if (isRtl && getRtlScrollAxisType() != RtlScrollAxisType.NORMAL) {
      if (options.left != null) {
        options.right = el.scrollWidth - el.clientWidth - options.left;
      }
      if (getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {
        options.left = options.right;
      } else if (getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {
        options.left = options.right ? -options.right : options.right;
      }
    } else {
      if (options.right != null) {
        options.left = el.scrollWidth - el.clientWidth - options.right;
      }
    }
    this._applyScrollToOptions(options);
  }
  _applyScrollToOptions(options) {
    const el = this.elementRef.nativeElement;
    if (supportsScrollBehavior()) {
      el.scrollTo(options);
    } else {
      if (options.top != null) {
        el.scrollTop = options.top;
      }
      if (options.left != null) {
        el.scrollLeft = options.left;
      }
    }
  }
  /**
   * Measures the scroll offset relative to the specified edge of the viewport. This method can be
   * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent
   * about what scrollLeft means in RTL. The values returned by this method are normalized such that
   * left and right always refer to the left and right side of the scrolling container irrespective
   * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
   * in an RTL context.
   * @param from The edge to measure from.
   */
  measureScrollOffset(from2) {
    const LEFT = "left";
    const RIGHT = "right";
    const el = this.elementRef.nativeElement;
    if (from2 == "top") {
      return el.scrollTop;
    }
    if (from2 == "bottom") {
      return el.scrollHeight - el.clientHeight - el.scrollTop;
    }
    const isRtl = this.dir && this.dir.value == "rtl";
    if (from2 == "start") {
      from2 = isRtl ? RIGHT : LEFT;
    } else if (from2 == "end") {
      from2 = isRtl ? LEFT : RIGHT;
    }
    if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {
      if (from2 == LEFT) {
        return el.scrollWidth - el.clientWidth - el.scrollLeft;
      } else {
        return el.scrollLeft;
      }
    } else if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {
      if (from2 == LEFT) {
        return el.scrollLeft + el.scrollWidth - el.clientWidth;
      } else {
        return -el.scrollLeft;
      }
    } else {
      if (from2 == LEFT) {
        return el.scrollLeft;
      } else {
        return el.scrollWidth - el.clientWidth - el.scrollLeft;
      }
    }
  }
};
_CdkScrollable.\u0275fac = function CdkScrollable_Factory(t) {
  return new (t || _CdkScrollable)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Directionality, 8));
};
_CdkScrollable.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkScrollable,
  selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]],
  standalone: true
});
var CdkScrollable = _CdkScrollable;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkScrollable, [{
    type: Directive,
    args: [{
      selector: "[cdk-scrollable], [cdkScrollable]",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: ScrollDispatcher
  }, {
    type: NgZone
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
var DEFAULT_RESIZE_TIME = 20;
var _ViewportRuler = class _ViewportRuler {
  constructor(_platform, ngZone, document2) {
    this._platform = _platform;
    this._change = new Subject();
    this._changeListener = (event) => {
      this._change.next(event);
    };
    this._document = document2;
    ngZone.runOutsideAngular(() => {
      if (_platform.isBrowser) {
        const window2 = this._getWindow();
        window2.addEventListener("resize", this._changeListener);
        window2.addEventListener("orientationchange", this._changeListener);
      }
      this.change().subscribe(() => this._viewportSize = null);
    });
  }
  ngOnDestroy() {
    if (this._platform.isBrowser) {
      const window2 = this._getWindow();
      window2.removeEventListener("resize", this._changeListener);
      window2.removeEventListener("orientationchange", this._changeListener);
    }
    this._change.complete();
  }
  /** Returns the viewport's width and height. */
  getViewportSize() {
    if (!this._viewportSize) {
      this._updateViewportSize();
    }
    const output = {
      width: this._viewportSize.width,
      height: this._viewportSize.height
    };
    if (!this._platform.isBrowser) {
      this._viewportSize = null;
    }
    return output;
  }
  /** Gets a DOMRect for the viewport's bounds. */
  getViewportRect() {
    const scrollPosition = this.getViewportScrollPosition();
    const {
      width,
      height
    } = this.getViewportSize();
    return {
      top: scrollPosition.top,
      left: scrollPosition.left,
      bottom: scrollPosition.top + height,
      right: scrollPosition.left + width,
      height,
      width
    };
  }
  /** Gets the (top, left) scroll position of the viewport. */
  getViewportScrollPosition() {
    if (!this._platform.isBrowser) {
      return {
        top: 0,
        left: 0
      };
    }
    const document2 = this._document;
    const window2 = this._getWindow();
    const documentElement2 = document2.documentElement;
    const documentRect = documentElement2.getBoundingClientRect();
    const top = -documentRect.top || document2.body.scrollTop || window2.scrollY || documentElement2.scrollTop || 0;
    const left = -documentRect.left || document2.body.scrollLeft || window2.scrollX || documentElement2.scrollLeft || 0;
    return {
      top,
      left
    };
  }
  /**
   * Returns a stream that emits whenever the size of the viewport changes.
   * This stream emits outside of the Angular zone.
   * @param throttleTime Time in milliseconds to throttle the stream.
   */
  change(throttleTime = DEFAULT_RESIZE_TIME) {
    return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;
  }
  /** Use defaultView of injected document if available or fallback to global window reference */
  _getWindow() {
    return this._document.defaultView || window;
  }
  /** Updates the cached viewport size. */
  _updateViewportSize() {
    const window2 = this._getWindow();
    this._viewportSize = this._platform.isBrowser ? {
      width: window2.innerWidth,
      height: window2.innerHeight
    } : {
      width: 0,
      height: 0
    };
  }
};
_ViewportRuler.\u0275fac = function ViewportRuler_Factory(t) {
  return new (t || _ViewportRuler)(\u0275\u0275inject(Platform), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2, 8));
};
_ViewportRuler.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ViewportRuler,
  factory: _ViewportRuler.\u0275fac,
  providedIn: "root"
});
var ViewportRuler = _ViewportRuler;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ViewportRuler, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var VIRTUAL_SCROLLABLE = new InjectionToken("VIRTUAL_SCROLLABLE");
var _CdkVirtualScrollable = class _CdkVirtualScrollable extends CdkScrollable {
  constructor(elementRef, scrollDispatcher, ngZone, dir) {
    super(elementRef, scrollDispatcher, ngZone, dir);
  }
  /**
   * Measure the viewport size for the provided orientation.
   *
   * @param orientation The orientation to measure the size from.
   */
  measureViewportSize(orientation) {
    const viewportEl = this.elementRef.nativeElement;
    return orientation === "horizontal" ? viewportEl.clientWidth : viewportEl.clientHeight;
  }
};
_CdkVirtualScrollable.\u0275fac = function CdkVirtualScrollable_Factory(t) {
  return new (t || _CdkVirtualScrollable)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Directionality, 8));
};
_CdkVirtualScrollable.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkVirtualScrollable,
  features: [\u0275\u0275InheritDefinitionFeature]
});
var CdkVirtualScrollable = _CdkVirtualScrollable;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollable, [{
    type: Directive
  }], () => [{
    type: ElementRef
  }, {
    type: ScrollDispatcher
  }, {
    type: NgZone
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
function rangesEqual(r1, r2) {
  return r1.start == r2.start && r1.end == r2.end;
}
var SCROLL_SCHEDULER = typeof requestAnimationFrame !== "undefined" ? animationFrameScheduler : asapScheduler;
var _CdkVirtualScrollViewport = class _CdkVirtualScrollViewport extends CdkVirtualScrollable {
  /** The direction the viewport scrolls. */
  get orientation() {
    return this._orientation;
  }
  set orientation(orientation) {
    if (this._orientation !== orientation) {
      this._orientation = orientation;
      this._calculateSpacerSize();
    }
  }
  constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) {
    super(elementRef, scrollDispatcher, ngZone, dir);
    this.elementRef = elementRef;
    this._changeDetectorRef = _changeDetectorRef;
    this._scrollStrategy = _scrollStrategy;
    this.scrollable = scrollable;
    this._platform = inject(Platform);
    this._detachedSubject = new Subject();
    this._renderedRangeSubject = new Subject();
    this._orientation = "vertical";
    this.appendOnly = false;
    this.scrolledIndexChange = new Observable((observer) => this._scrollStrategy.scrolledIndexChange.subscribe((index) => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));
    this.renderedRangeStream = this._renderedRangeSubject;
    this._totalContentSize = 0;
    this._totalContentWidth = "";
    this._totalContentHeight = "";
    this._renderedRange = {
      start: 0,
      end: 0
    };
    this._dataLength = 0;
    this._viewportSize = 0;
    this._renderedContentOffset = 0;
    this._renderedContentOffsetNeedsRewrite = false;
    this._isChangeDetectionPending = false;
    this._runAfterChangeDetection = [];
    this._viewportChanges = Subscription.EMPTY;
    this._injector = inject(Injector);
    this._isDestroyed = false;
    if (!_scrollStrategy && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.');
    }
    this._viewportChanges = viewportRuler.change().subscribe(() => {
      this.checkViewportSize();
    });
    if (!this.scrollable) {
      this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable");
      this.scrollable = this;
    }
  }
  ngOnInit() {
    if (!this._platform.isBrowser) {
      return;
    }
    if (this.scrollable === this) {
      super.ngOnInit();
    }
    this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
      this._measureViewportSize();
      this._scrollStrategy.attach(this);
      this.scrollable.elementScrolled().pipe(
        // Start off with a fake scroll event so we properly detect our initial position.
        startWith(null),
        // Collect multiple events into one until the next animation frame. This way if
        // there are multiple scroll events in the same frame we only need to recheck
        // our layout once.
        auditTime(0, SCROLL_SCHEDULER),
        // Usually `elementScrolled` is completed when the scrollable is destroyed, but
        // that may not be the case if a `CdkVirtualScrollableElement` is used so we have
        // to unsubscribe here just in case.
        takeUntil(this._destroyed)
      ).subscribe(() => this._scrollStrategy.onContentScrolled());
      this._markChangeDetectionNeeded();
    }));
  }
  ngOnDestroy() {
    this.detach();
    this._scrollStrategy.detach();
    this._renderedRangeSubject.complete();
    this._detachedSubject.complete();
    this._viewportChanges.unsubscribe();
    this._isDestroyed = true;
    super.ngOnDestroy();
  }
  /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */
  attach(forOf) {
    if (this._forOf && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error("CdkVirtualScrollViewport is already attached.");
    }
    this.ngZone.runOutsideAngular(() => {
      this._forOf = forOf;
      this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe((data) => {
        const newLength = data.length;
        if (newLength !== this._dataLength) {
          this._dataLength = newLength;
          this._scrollStrategy.onDataLengthChanged();
        }
        this._doChangeDetection();
      });
    });
  }
  /** Detaches the current `CdkVirtualForOf`. */
  detach() {
    this._forOf = null;
    this._detachedSubject.next();
  }
  /** Gets the length of the data bound to this viewport (in number of items). */
  getDataLength() {
    return this._dataLength;
  }
  /** Gets the size of the viewport (in pixels). */
  getViewportSize() {
    return this._viewportSize;
  }
  // TODO(mmalerba): This is technically out of sync with what's really rendered until a render
  // cycle happens. I'm being careful to only call it after the render cycle is complete and before
  // setting it to something else, but its error prone and should probably be split into
  // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
  /** Get the current rendered range of items. */
  getRenderedRange() {
    return this._renderedRange;
  }
  measureBoundingClientRectWithScrollOffset(from2) {
    return this.getElementRef().nativeElement.getBoundingClientRect()[from2];
  }
  /**
   * Sets the total size of all content (in pixels), including content that is not currently
   * rendered.
   */
  setTotalContentSize(size) {
    if (this._totalContentSize !== size) {
      this._totalContentSize = size;
      this._calculateSpacerSize();
      this._markChangeDetectionNeeded();
    }
  }
  /** Sets the currently rendered range of indices. */
  setRenderedRange(range2) {
    if (!rangesEqual(this._renderedRange, range2)) {
      if (this.appendOnly) {
        range2 = {
          start: 0,
          end: Math.max(this._renderedRange.end, range2.end)
        };
      }
      this._renderedRangeSubject.next(this._renderedRange = range2);
      this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());
    }
  }
  /**
   * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
   */
  getOffsetToRenderedContentStart() {
    return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;
  }
  /**
   * Sets the offset from the start of the viewport to either the start or end of the rendered data
   * (in pixels).
   */
  setRenderedContentOffset(offset2, to = "to-start") {
    offset2 = this.appendOnly && to === "to-start" ? 0 : offset2;
    const isRtl = this.dir && this.dir.value == "rtl";
    const isHorizontal = this.orientation == "horizontal";
    const axis = isHorizontal ? "X" : "Y";
    const axisDirection = isHorizontal && isRtl ? -1 : 1;
    let transform3 = `translate${axis}(${Number(axisDirection * offset2)}px)`;
    this._renderedContentOffset = offset2;
    if (to === "to-end") {
      transform3 += ` translate${axis}(-100%)`;
      this._renderedContentOffsetNeedsRewrite = true;
    }
    if (this._renderedContentTransform != transform3) {
      this._renderedContentTransform = transform3;
      this._markChangeDetectionNeeded(() => {
        if (this._renderedContentOffsetNeedsRewrite) {
          this._renderedContentOffset -= this.measureRenderedContentSize();
          this._renderedContentOffsetNeedsRewrite = false;
          this.setRenderedContentOffset(this._renderedContentOffset);
        } else {
          this._scrollStrategy.onRenderedOffsetChanged();
        }
      });
    }
  }
  /**
   * Scrolls to the given offset from the start of the viewport. Please note that this is not always
   * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left
   * direction, this would be the equivalent of setting a fictional `scrollRight` property.
   * @param offset The offset to scroll to.
   * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
   */
  scrollToOffset(offset2, behavior = "auto") {
    const options = {
      behavior
    };
    if (this.orientation === "horizontal") {
      options.start = offset2;
    } else {
      options.top = offset2;
    }
    this.scrollable.scrollTo(options);
  }
  /**
   * Scrolls to the offset for the given index.
   * @param index The index of the element to scroll to.
   * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
   */
  scrollToIndex(index, behavior = "auto") {
    this._scrollStrategy.scrollToIndex(index, behavior);
  }
  /**
   * Gets the current scroll offset from the start of the scrollable (in pixels).
   * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
   *     in horizontal mode.
   */
  measureScrollOffset(from2) {
    let measureScrollOffset;
    if (this.scrollable == this) {
      measureScrollOffset = (_from) => super.measureScrollOffset(_from);
    } else {
      measureScrollOffset = (_from) => this.scrollable.measureScrollOffset(_from);
    }
    return Math.max(0, measureScrollOffset(from2 ?? (this.orientation === "horizontal" ? "start" : "top")) - this.measureViewportOffset());
  }
  /**
   * Measures the offset of the viewport from the scrolling container
   * @param from The edge to measure from.
   */
  measureViewportOffset(from2) {
    let fromRect;
    const LEFT = "left";
    const RIGHT = "right";
    const isRtl = this.dir?.value == "rtl";
    if (from2 == "start") {
      fromRect = isRtl ? RIGHT : LEFT;
    } else if (from2 == "end") {
      fromRect = isRtl ? LEFT : RIGHT;
    } else if (from2) {
      fromRect = from2;
    } else {
      fromRect = this.orientation === "horizontal" ? "left" : "top";
    }
    const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);
    const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];
    return viewportClientRect - scrollerClientRect;
  }
  /** Measure the combined size of all of the rendered items. */
  measureRenderedContentSize() {
    const contentEl = this._contentWrapper.nativeElement;
    return this.orientation === "horizontal" ? contentEl.offsetWidth : contentEl.offsetHeight;
  }
  /**
   * Measure the total combined size of the given range. Throws if the range includes items that are
   * not rendered.
   */
  measureRangeSize(range2) {
    if (!this._forOf) {
      return 0;
    }
    return this._forOf.measureRangeSize(range2, this.orientation);
  }
  /** Update the viewport dimensions and re-render. */
  checkViewportSize() {
    this._measureViewportSize();
    this._scrollStrategy.onDataLengthChanged();
  }
  /** Measure the viewport size. */
  _measureViewportSize() {
    this._viewportSize = this.scrollable.measureViewportSize(this.orientation);
  }
  /** Queue up change detection to run. */
  _markChangeDetectionNeeded(runAfter) {
    if (runAfter) {
      this._runAfterChangeDetection.push(runAfter);
    }
    if (!this._isChangeDetectionPending) {
      this._isChangeDetectionPending = true;
      this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
        this._doChangeDetection();
      }));
    }
  }
  /** Run change detection. */
  _doChangeDetection() {
    if (this._isDestroyed) {
      return;
    }
    this.ngZone.run(() => {
      this._changeDetectorRef.markForCheck();
      this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;
      afterNextRender(() => {
        this._isChangeDetectionPending = false;
        const runAfterChangeDetection = this._runAfterChangeDetection;
        this._runAfterChangeDetection = [];
        for (const fn of runAfterChangeDetection) {
          fn();
        }
      }, {
        injector: this._injector
      });
    });
  }
  /** Calculates the `style.width` and `style.height` for the spacer element. */
  _calculateSpacerSize() {
    this._totalContentHeight = this.orientation === "horizontal" ? "" : `${this._totalContentSize}px`;
    this._totalContentWidth = this.orientation === "horizontal" ? `${this._totalContentSize}px` : "";
  }
};
_CdkVirtualScrollViewport.\u0275fac = function CdkVirtualScrollViewport_Factory(t) {
  return new (t || _CdkVirtualScrollViewport)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(VIRTUAL_SCROLL_STRATEGY, 8), \u0275\u0275directiveInject(Directionality, 8), \u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(ViewportRuler), \u0275\u0275directiveInject(VIRTUAL_SCROLLABLE, 8));
};
_CdkVirtualScrollViewport.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _CdkVirtualScrollViewport,
  selectors: [["cdk-virtual-scroll-viewport"]],
  viewQuery: function CdkVirtualScrollViewport_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c03, 7);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._contentWrapper = _t.first);
    }
  },
  hostAttrs: [1, "cdk-virtual-scroll-viewport"],
  hostVars: 4,
  hostBindings: function CdkVirtualScrollViewport_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("cdk-virtual-scroll-orientation-horizontal", ctx.orientation === "horizontal")("cdk-virtual-scroll-orientation-vertical", ctx.orientation !== "horizontal");
    }
  },
  inputs: {
    orientation: "orientation",
    appendOnly: [2, "appendOnly", "appendOnly", booleanAttribute]
  },
  outputs: {
    scrolledIndexChange: "scrolledIndexChange"
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: CdkScrollable,
    useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
    deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], _CdkVirtualScrollViewport]
  }]), \u0275\u0275InputTransformsFeature, \u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c13,
  decls: 4,
  vars: 4,
  consts: [["contentWrapper", ""], [1, "cdk-virtual-scroll-content-wrapper"], [1, "cdk-virtual-scroll-spacer"]],
  template: function CdkVirtualScrollViewport_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275elementStart(0, "div", 1, 0);
      \u0275\u0275projection(2);
      \u0275\u0275elementEnd();
      \u0275\u0275element(3, "div", 2);
    }
    if (rf & 2) {
      \u0275\u0275advance(3);
      \u0275\u0275styleProp("width", ctx._totalContentWidth)("height", ctx._totalContentHeight);
    }
  },
  styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"],
  encapsulation: 2,
  changeDetection: 0
});
var CdkVirtualScrollViewport = _CdkVirtualScrollViewport;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollViewport, [{
    type: Component,
    args: [{
      selector: "cdk-virtual-scroll-viewport",
      host: {
        "class": "cdk-virtual-scroll-viewport",
        "[class.cdk-virtual-scroll-orientation-horizontal]": 'orientation === "horizontal"',
        "[class.cdk-virtual-scroll-orientation-vertical]": 'orientation !== "horizontal"'
      },
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      providers: [{
        provide: CdkScrollable,
        useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
        deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport]
      }],
      template: '<!--\n  Wrap the rendered content in an element that will be used to offset it based on the scroll\n  position.\n-->\n<div #contentWrapper class="cdk-virtual-scroll-content-wrapper">\n  <ng-content></ng-content>\n</div>\n<!--\n  Spacer used to force the scrolling container to the correct size for the *total* number of items\n  so that the scrollbar captures the size of the entire data set.\n-->\n<div class="cdk-virtual-scroll-spacer"\n     [style.width]="_totalContentWidth" [style.height]="_totalContentHeight"></div>\n',
      styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: ChangeDetectorRef
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [VIRTUAL_SCROLL_STRATEGY]
    }]
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }, {
    type: ScrollDispatcher
  }, {
    type: ViewportRuler
  }, {
    type: CdkVirtualScrollable,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [VIRTUAL_SCROLLABLE]
    }]
  }], {
    orientation: [{
      type: Input
    }],
    appendOnly: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    scrolledIndexChange: [{
      type: Output
    }],
    _contentWrapper: [{
      type: ViewChild,
      args: ["contentWrapper", {
        static: true
      }]
    }]
  });
})();
function getOffset(orientation, direction, node) {
  const el = node;
  if (!el.getBoundingClientRect) {
    return 0;
  }
  const rect = el.getBoundingClientRect();
  if (orientation === "horizontal") {
    return direction === "start" ? rect.left : rect.right;
  }
  return direction === "start" ? rect.top : rect.bottom;
}
var _CdkVirtualForOf = class _CdkVirtualForOf {
  /** The DataSource to display. */
  get cdkVirtualForOf() {
    return this._cdkVirtualForOf;
  }
  set cdkVirtualForOf(value) {
    this._cdkVirtualForOf = value;
    if (isDataSource(value)) {
      this._dataSourceChanges.next(value);
    } else {
      this._dataSourceChanges.next(new ArrayDataSource(isObservable(value) ? value : Array.from(value || [])));
    }
  }
  /**
   * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and
   * the item and produces a value to be used as the item's identity when tracking changes.
   */
  get cdkVirtualForTrackBy() {
    return this._cdkVirtualForTrackBy;
  }
  set cdkVirtualForTrackBy(fn) {
    this._needsUpdate = true;
    this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : void 0;
  }
  /** The template used to stamp out new elements. */
  set cdkVirtualForTemplate(value) {
    if (value) {
      this._needsUpdate = true;
      this._template = value;
    }
  }
  /**
   * The size of the cache used to store templates that are not being used for re-use later.
   * Setting the cache size to `0` will disable caching. Defaults to 20 templates.
   */
  get cdkVirtualForTemplateCacheSize() {
    return this._viewRepeater.viewCacheSize;
  }
  set cdkVirtualForTemplateCacheSize(size) {
    this._viewRepeater.viewCacheSize = coerceNumberProperty(size);
  }
  constructor(_viewContainerRef, _template, _differs, _viewRepeater, _viewport, ngZone) {
    this._viewContainerRef = _viewContainerRef;
    this._template = _template;
    this._differs = _differs;
    this._viewRepeater = _viewRepeater;
    this._viewport = _viewport;
    this.viewChange = new Subject();
    this._dataSourceChanges = new Subject();
    this.dataStream = this._dataSourceChanges.pipe(
      // Start off with null `DataSource`.
      startWith(null),
      // Bundle up the previous and current data sources so we can work with both.
      pairwise(),
      // Use `_changeDataSource` to disconnect from the previous data source and connect to the
      // new one, passing back a stream of data changes which we run through `switchMap` to give
      // us a data stream that emits the latest data from whatever the current `DataSource` is.
      switchMap(([prev, cur]) => this._changeDataSource(prev, cur)),
      // Replay the last emitted data when someone subscribes.
      shareReplay(1)
    );
    this._differ = null;
    this._needsUpdate = false;
    this._destroyed = new Subject();
    this.dataStream.subscribe((data) => {
      this._data = data;
      this._onRenderedDataChange();
    });
    this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe((range2) => {
      this._renderedRange = range2;
      if (this.viewChange.observers.length) {
        ngZone.run(() => this.viewChange.next(this._renderedRange));
      }
      this._onRenderedDataChange();
    });
    this._viewport.attach(this);
  }
  /**
   * Measures the combined size (width for horizontal orientation, height for vertical) of all items
   * in the specified range. Throws an error if the range includes items that are not currently
   * rendered.
   */
  measureRangeSize(range2, orientation) {
    if (range2.start >= range2.end) {
      return 0;
    }
    if ((range2.start < this._renderedRange.start || range2.end > this._renderedRange.end) && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error(`Error: attempted to measure an item that isn't rendered.`);
    }
    const renderedStartIndex = range2.start - this._renderedRange.start;
    const rangeLen = range2.end - range2.start;
    let firstNode;
    let lastNode;
    for (let i2 = 0; i2 < rangeLen; i2++) {
      const view = this._viewContainerRef.get(i2 + renderedStartIndex);
      if (view && view.rootNodes.length) {
        firstNode = lastNode = view.rootNodes[0];
        break;
      }
    }
    for (let i2 = rangeLen - 1; i2 > -1; i2--) {
      const view = this._viewContainerRef.get(i2 + renderedStartIndex);
      if (view && view.rootNodes.length) {
        lastNode = view.rootNodes[view.rootNodes.length - 1];
        break;
      }
    }
    return firstNode && lastNode ? getOffset(orientation, "end", lastNode) - getOffset(orientation, "start", firstNode) : 0;
  }
  ngDoCheck() {
    if (this._differ && this._needsUpdate) {
      const changes = this._differ.diff(this._renderedItems);
      if (!changes) {
        this._updateContext();
      } else {
        this._applyChanges(changes);
      }
      this._needsUpdate = false;
    }
  }
  ngOnDestroy() {
    this._viewport.detach();
    this._dataSourceChanges.next(void 0);
    this._dataSourceChanges.complete();
    this.viewChange.complete();
    this._destroyed.next();
    this._destroyed.complete();
    this._viewRepeater.detach();
  }
  /** React to scroll state changes in the viewport. */
  _onRenderedDataChange() {
    if (!this._renderedRange) {
      return;
    }
    this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);
    if (!this._differ) {
      this._differ = this._differs.find(this._renderedItems).create((index, item) => {
        return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item;
      });
    }
    this._needsUpdate = true;
  }
  /** Swap out one `DataSource` for another. */
  _changeDataSource(oldDs, newDs) {
    if (oldDs) {
      oldDs.disconnect(this);
    }
    this._needsUpdate = true;
    return newDs ? newDs.connect(this) : of();
  }
  /** Update the `CdkVirtualForOfContext` for all views. */
  _updateContext() {
    const count = this._data.length;
    let i2 = this._viewContainerRef.length;
    while (i2--) {
      const view = this._viewContainerRef.get(i2);
      view.context.index = this._renderedRange.start + i2;
      view.context.count = count;
      this._updateComputedContextProperties(view.context);
      view.detectChanges();
    }
  }
  /** Apply changes to the DOM. */
  _applyChanges(changes) {
    this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), (record) => record.item);
    changes.forEachIdentityChange((record) => {
      const view = this._viewContainerRef.get(record.currentIndex);
      view.context.$implicit = record.item;
    });
    const count = this._data.length;
    let i2 = this._viewContainerRef.length;
    while (i2--) {
      const view = this._viewContainerRef.get(i2);
      view.context.index = this._renderedRange.start + i2;
      view.context.count = count;
      this._updateComputedContextProperties(view.context);
    }
  }
  /** Update the computed properties on the `CdkVirtualForOfContext`. */
  _updateComputedContextProperties(context2) {
    context2.first = context2.index === 0;
    context2.last = context2.index === context2.count - 1;
    context2.even = context2.index % 2 === 0;
    context2.odd = !context2.even;
  }
  _getEmbeddedViewArgs(record, index) {
    return {
      templateRef: this._template,
      context: {
        $implicit: record.item,
        // It's guaranteed that the iterable is not "undefined" or "null" because we only
        // generate views for elements if the "cdkVirtualForOf" iterable has elements.
        cdkVirtualForOf: this._cdkVirtualForOf,
        index: -1,
        count: -1,
        first: false,
        last: false,
        odd: false,
        even: false
      },
      index
    };
  }
};
_CdkVirtualForOf.\u0275fac = function CdkVirtualForOf_Factory(t) {
  return new (t || _CdkVirtualForOf)(\u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(IterableDiffers), \u0275\u0275directiveInject(_VIEW_REPEATER_STRATEGY), \u0275\u0275directiveInject(CdkVirtualScrollViewport, 4), \u0275\u0275directiveInject(NgZone));
};
_CdkVirtualForOf.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkVirtualForOf,
  selectors: [["", "cdkVirtualFor", "", "cdkVirtualForOf", ""]],
  inputs: {
    cdkVirtualForOf: "cdkVirtualForOf",
    cdkVirtualForTrackBy: "cdkVirtualForTrackBy",
    cdkVirtualForTemplate: "cdkVirtualForTemplate",
    cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize"
  },
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: _VIEW_REPEATER_STRATEGY,
    useClass: _RecycleViewRepeaterStrategy
  }])]
});
var CdkVirtualForOf = _CdkVirtualForOf;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualForOf, [{
    type: Directive,
    args: [{
      selector: "[cdkVirtualFor][cdkVirtualForOf]",
      providers: [{
        provide: _VIEW_REPEATER_STRATEGY,
        useClass: _RecycleViewRepeaterStrategy
      }],
      standalone: true
    }]
  }], () => [{
    type: ViewContainerRef
  }, {
    type: TemplateRef
  }, {
    type: IterableDiffers
  }, {
    type: _RecycleViewRepeaterStrategy,
    decorators: [{
      type: Inject,
      args: [_VIEW_REPEATER_STRATEGY]
    }]
  }, {
    type: CdkVirtualScrollViewport,
    decorators: [{
      type: SkipSelf
    }]
  }, {
    type: NgZone
  }], {
    cdkVirtualForOf: [{
      type: Input
    }],
    cdkVirtualForTrackBy: [{
      type: Input
    }],
    cdkVirtualForTemplate: [{
      type: Input
    }],
    cdkVirtualForTemplateCacheSize: [{
      type: Input
    }]
  });
})();
var _CdkVirtualScrollableElement = class _CdkVirtualScrollableElement extends CdkVirtualScrollable {
  constructor(elementRef, scrollDispatcher, ngZone, dir) {
    super(elementRef, scrollDispatcher, ngZone, dir);
  }
  measureBoundingClientRectWithScrollOffset(from2) {
    return this.getElementRef().nativeElement.getBoundingClientRect()[from2] - this.measureScrollOffset(from2);
  }
};
_CdkVirtualScrollableElement.\u0275fac = function CdkVirtualScrollableElement_Factory(t) {
  return new (t || _CdkVirtualScrollableElement)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Directionality, 8));
};
_CdkVirtualScrollableElement.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkVirtualScrollableElement,
  selectors: [["", "cdkVirtualScrollingElement", ""]],
  hostAttrs: [1, "cdk-virtual-scrollable"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: VIRTUAL_SCROLLABLE,
    useExisting: _CdkVirtualScrollableElement
  }]), \u0275\u0275InheritDefinitionFeature]
});
var CdkVirtualScrollableElement = _CdkVirtualScrollableElement;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollableElement, [{
    type: Directive,
    args: [{
      selector: "[cdkVirtualScrollingElement]",
      providers: [{
        provide: VIRTUAL_SCROLLABLE,
        useExisting: CdkVirtualScrollableElement
      }],
      standalone: true,
      host: {
        "class": "cdk-virtual-scrollable"
      }
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: ScrollDispatcher
  }, {
    type: NgZone
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
var _CdkVirtualScrollableWindow = class _CdkVirtualScrollableWindow extends CdkVirtualScrollable {
  constructor(scrollDispatcher, ngZone, dir) {
    super(new ElementRef(document.documentElement), scrollDispatcher, ngZone, dir);
    this._elementScrolled = new Observable((observer) => this.ngZone.runOutsideAngular(() => fromEvent(document, "scroll").pipe(takeUntil(this._destroyed)).subscribe(observer)));
  }
  measureBoundingClientRectWithScrollOffset(from2) {
    return this.getElementRef().nativeElement.getBoundingClientRect()[from2];
  }
};
_CdkVirtualScrollableWindow.\u0275fac = function CdkVirtualScrollableWindow_Factory(t) {
  return new (t || _CdkVirtualScrollableWindow)(\u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Directionality, 8));
};
_CdkVirtualScrollableWindow.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkVirtualScrollableWindow,
  selectors: [["cdk-virtual-scroll-viewport", "scrollWindow", ""]],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: VIRTUAL_SCROLLABLE,
    useExisting: _CdkVirtualScrollableWindow
  }]), \u0275\u0275InheritDefinitionFeature]
});
var CdkVirtualScrollableWindow = _CdkVirtualScrollableWindow;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkVirtualScrollableWindow, [{
    type: Directive,
    args: [{
      selector: "cdk-virtual-scroll-viewport[scrollWindow]",
      providers: [{
        provide: VIRTUAL_SCROLLABLE,
        useExisting: CdkVirtualScrollableWindow
      }],
      standalone: true
    }]
  }], () => [{
    type: ScrollDispatcher
  }, {
    type: NgZone
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
var _CdkScrollableModule = class _CdkScrollableModule {
};
_CdkScrollableModule.\u0275fac = function CdkScrollableModule_Factory(t) {
  return new (t || _CdkScrollableModule)();
};
_CdkScrollableModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _CdkScrollableModule
});
_CdkScrollableModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var CdkScrollableModule = _CdkScrollableModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkScrollableModule, [{
    type: NgModule,
    args: [{
      exports: [CdkScrollable],
      imports: [CdkScrollable]
    }]
  }], null, null);
})();
var _ScrollingModule = class _ScrollingModule {
};
_ScrollingModule.\u0275fac = function ScrollingModule_Factory(t) {
  return new (t || _ScrollingModule)();
};
_ScrollingModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _ScrollingModule
});
_ScrollingModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [BidiModule, CdkScrollableModule, BidiModule, CdkScrollableModule]
});
var ScrollingModule = _ScrollingModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollingModule, [{
    type: NgModule,
    args: [{
      imports: [BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollableWindow, CdkVirtualScrollableElement],
      exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollableWindow, CdkVirtualScrollableElement]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/portal.mjs
function throwNullPortalError() {
  throw Error("Must provide a portal to attach");
}
function throwPortalAlreadyAttachedError() {
  throw Error("Host already has a portal attached");
}
function throwPortalOutletAlreadyDisposedError() {
  throw Error("This PortalOutlet has already been disposed");
}
function throwUnknownPortalTypeError() {
  throw Error("Attempting to attach an unknown Portal type. BasePortalOutlet accepts either a ComponentPortal or a TemplatePortal.");
}
function throwNullPortalOutletError() {
  throw Error("Attempting to attach a portal to a null PortalOutlet");
}
function throwNoPortalAttachedError() {
  throw Error("Attempting to detach a portal that is not attached to a host");
}
var Portal = class {
  /** Attach this portal to a host. */
  attach(host) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (host == null) {
        throwNullPortalOutletError();
      }
      if (host.hasAttached()) {
        throwPortalAlreadyAttachedError();
      }
    }
    this._attachedHost = host;
    return host.attach(this);
  }
  /** Detach this portal from its host */
  detach() {
    let host = this._attachedHost;
    if (host != null) {
      this._attachedHost = null;
      host.detach();
    } else if (typeof ngDevMode === "undefined" || ngDevMode) {
      throwNoPortalAttachedError();
    }
  }
  /** Whether this portal is attached to a host. */
  get isAttached() {
    return this._attachedHost != null;
  }
  /**
   * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
   * the PortalOutlet when it is performing an `attach()` or `detach()`.
   */
  setAttachedHost(host) {
    this._attachedHost = host;
  }
};
var ComponentPortal = class extends Portal {
  constructor(component, viewContainerRef, injector, componentFactoryResolver, projectableNodes) {
    super();
    this.component = component;
    this.viewContainerRef = viewContainerRef;
    this.injector = injector;
    this.componentFactoryResolver = componentFactoryResolver;
    this.projectableNodes = projectableNodes;
  }
};
var TemplatePortal = class extends Portal {
  constructor(templateRef, viewContainerRef, context2, injector) {
    super();
    this.templateRef = templateRef;
    this.viewContainerRef = viewContainerRef;
    this.context = context2;
    this.injector = injector;
  }
  get origin() {
    return this.templateRef.elementRef;
  }
  /**
   * Attach the portal to the provided `PortalOutlet`.
   * When a context is provided it will override the `context` property of the `TemplatePortal`
   * instance.
   */
  attach(host, context2 = this.context) {
    this.context = context2;
    return super.attach(host);
  }
  detach() {
    this.context = void 0;
    return super.detach();
  }
};
var DomPortal = class extends Portal {
  constructor(element) {
    super();
    this.element = element instanceof ElementRef ? element.nativeElement : element;
  }
};
var BasePortalOutlet = class {
  constructor() {
    this._isDisposed = false;
    this.attachDomPortal = null;
  }
  /** Whether this host has an attached portal. */
  hasAttached() {
    return !!this._attachedPortal;
  }
  /** Attaches a portal. */
  attach(portal) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (!portal) {
        throwNullPortalError();
      }
      if (this.hasAttached()) {
        throwPortalAlreadyAttachedError();
      }
      if (this._isDisposed) {
        throwPortalOutletAlreadyDisposedError();
      }
    }
    if (portal instanceof ComponentPortal) {
      this._attachedPortal = portal;
      return this.attachComponentPortal(portal);
    } else if (portal instanceof TemplatePortal) {
      this._attachedPortal = portal;
      return this.attachTemplatePortal(portal);
    } else if (this.attachDomPortal && portal instanceof DomPortal) {
      this._attachedPortal = portal;
      return this.attachDomPortal(portal);
    }
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      throwUnknownPortalTypeError();
    }
  }
  /** Detaches a previously attached portal. */
  detach() {
    if (this._attachedPortal) {
      this._attachedPortal.setAttachedHost(null);
      this._attachedPortal = null;
    }
    this._invokeDisposeFn();
  }
  /** Permanently dispose of this portal host. */
  dispose() {
    if (this.hasAttached()) {
      this.detach();
    }
    this._invokeDisposeFn();
    this._isDisposed = true;
  }
  /** @docs-private */
  setDisposeFn(fn) {
    this._disposeFn = fn;
  }
  _invokeDisposeFn() {
    if (this._disposeFn) {
      this._disposeFn();
      this._disposeFn = null;
    }
  }
};
var DomPortalOutlet = class extends BasePortalOutlet {
  /**
   * @param outletElement Element into which the content is projected.
   * @param _componentFactoryResolver Used to resolve the component factory.
   *   Only required when attaching component portals.
   * @param _appRef Reference to the application. Only used in component portals when there
   *   is no `ViewContainerRef` available.
   * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
   *   have one. Only used for component portals.
   * @param _document Reference to the document. Used when attaching a DOM portal. Will eventually
   *   become a required parameter.
   */
  constructor(outletElement, _componentFactoryResolver, _appRef, _defaultInjector, _document2) {
    super();
    this.outletElement = outletElement;
    this._componentFactoryResolver = _componentFactoryResolver;
    this._appRef = _appRef;
    this._defaultInjector = _defaultInjector;
    this.attachDomPortal = (portal) => {
      if (!this._document && (typeof ngDevMode === "undefined" || ngDevMode)) {
        throw Error("Cannot attach DOM portal without _document constructor parameter");
      }
      const element = portal.element;
      if (!element.parentNode && (typeof ngDevMode === "undefined" || ngDevMode)) {
        throw Error("DOM portal content must be attached to a parent node.");
      }
      const anchorNode = this._document.createComment("dom-portal");
      element.parentNode.insertBefore(anchorNode, element);
      this.outletElement.appendChild(element);
      this._attachedPortal = portal;
      super.setDisposeFn(() => {
        if (anchorNode.parentNode) {
          anchorNode.parentNode.replaceChild(element, anchorNode);
        }
      });
    };
    this._document = _document2;
  }
  /**
   * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.
   * @param portal Portal to be attached
   * @returns Reference to the created component.
   */
  attachComponentPortal(portal) {
    const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;
    if ((typeof ngDevMode === "undefined" || ngDevMode) && !resolver) {
      throw Error("Cannot attach component portal to outlet without a ComponentFactoryResolver.");
    }
    const componentFactory = resolver.resolveComponentFactory(portal.component);
    let componentRef;
    if (portal.viewContainerRef) {
      componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector, portal.projectableNodes || void 0);
      this.setDisposeFn(() => componentRef.destroy());
    } else {
      if ((typeof ngDevMode === "undefined" || ngDevMode) && !this._appRef) {
        throw Error("Cannot attach component portal to outlet without an ApplicationRef.");
      }
      componentRef = componentFactory.create(portal.injector || this._defaultInjector || Injector.NULL);
      this._appRef.attachView(componentRef.hostView);
      this.setDisposeFn(() => {
        if (this._appRef.viewCount > 0) {
          this._appRef.detachView(componentRef.hostView);
        }
        componentRef.destroy();
      });
    }
    this.outletElement.appendChild(this._getComponentRootNode(componentRef));
    this._attachedPortal = portal;
    return componentRef;
  }
  /**
   * Attaches a template portal to the DOM as an embedded view.
   * @param portal Portal to be attached.
   * @returns Reference to the created embedded view.
   */
  attachTemplatePortal(portal) {
    let viewContainer = portal.viewContainerRef;
    let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
      injector: portal.injector
    });
    viewRef.rootNodes.forEach((rootNode) => this.outletElement.appendChild(rootNode));
    viewRef.detectChanges();
    this.setDisposeFn(() => {
      let index = viewContainer.indexOf(viewRef);
      if (index !== -1) {
        viewContainer.remove(index);
      }
    });
    this._attachedPortal = portal;
    return viewRef;
  }
  /**
   * Clears out a portal from the DOM.
   */
  dispose() {
    super.dispose();
    this.outletElement.remove();
  }
  /** Gets the root HTMLElement for an instantiated component. */
  _getComponentRootNode(componentRef) {
    return componentRef.hostView.rootNodes[0];
  }
};
var _CdkPortal = class _CdkPortal extends TemplatePortal {
  constructor(templateRef, viewContainerRef) {
    super(templateRef, viewContainerRef);
  }
};
_CdkPortal.\u0275fac = function CdkPortal_Factory(t) {
  return new (t || _CdkPortal)(\u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(ViewContainerRef));
};
_CdkPortal.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkPortal,
  selectors: [["", "cdkPortal", ""]],
  exportAs: ["cdkPortal"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature]
});
var CdkPortal = _CdkPortal;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkPortal, [{
    type: Directive,
    args: [{
      selector: "[cdkPortal]",
      exportAs: "cdkPortal",
      standalone: true
    }]
  }], () => [{
    type: TemplateRef
  }, {
    type: ViewContainerRef
  }], null);
})();
var _TemplatePortalDirective = class _TemplatePortalDirective extends CdkPortal {
};
_TemplatePortalDirective.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275TemplatePortalDirective_BaseFactory;
  return function TemplatePortalDirective_Factory(t) {
    return (\u0275TemplatePortalDirective_BaseFactory || (\u0275TemplatePortalDirective_BaseFactory = \u0275\u0275getInheritedFactory(_TemplatePortalDirective)))(t || _TemplatePortalDirective);
  };
})();
_TemplatePortalDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _TemplatePortalDirective,
  selectors: [["", "cdk-portal", ""], ["", "portal", ""]],
  exportAs: ["cdkPortal"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: CdkPortal,
    useExisting: _TemplatePortalDirective
  }]), \u0275\u0275InheritDefinitionFeature]
});
var TemplatePortalDirective = _TemplatePortalDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TemplatePortalDirective, [{
    type: Directive,
    args: [{
      selector: "[cdk-portal], [portal]",
      exportAs: "cdkPortal",
      providers: [{
        provide: CdkPortal,
        useExisting: TemplatePortalDirective
      }],
      standalone: true
    }]
  }], null, null);
})();
var _CdkPortalOutlet = class _CdkPortalOutlet extends BasePortalOutlet {
  constructor(_componentFactoryResolver, _viewContainerRef, _document2) {
    super();
    this._componentFactoryResolver = _componentFactoryResolver;
    this._viewContainerRef = _viewContainerRef;
    this._isInitialized = false;
    this.attached = new EventEmitter();
    this.attachDomPortal = (portal) => {
      if (!this._document && (typeof ngDevMode === "undefined" || ngDevMode)) {
        throw Error("Cannot attach DOM portal without _document constructor parameter");
      }
      const element = portal.element;
      if (!element.parentNode && (typeof ngDevMode === "undefined" || ngDevMode)) {
        throw Error("DOM portal content must be attached to a parent node.");
      }
      const anchorNode = this._document.createComment("dom-portal");
      portal.setAttachedHost(this);
      element.parentNode.insertBefore(anchorNode, element);
      this._getRootNode().appendChild(element);
      this._attachedPortal = portal;
      super.setDisposeFn(() => {
        if (anchorNode.parentNode) {
          anchorNode.parentNode.replaceChild(element, anchorNode);
        }
      });
    };
    this._document = _document2;
  }
  /** Portal associated with the Portal outlet. */
  get portal() {
    return this._attachedPortal;
  }
  set portal(portal) {
    if (this.hasAttached() && !portal && !this._isInitialized) {
      return;
    }
    if (this.hasAttached()) {
      super.detach();
    }
    if (portal) {
      super.attach(portal);
    }
    this._attachedPortal = portal || null;
  }
  /** Component or view reference that is attached to the portal. */
  get attachedRef() {
    return this._attachedRef;
  }
  ngOnInit() {
    this._isInitialized = true;
  }
  ngOnDestroy() {
    super.dispose();
    this._attachedRef = this._attachedPortal = null;
  }
  /**
   * Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
   *
   * @param portal Portal to be attached to the portal outlet.
   * @returns Reference to the created component.
   */
  attachComponentPortal(portal) {
    portal.setAttachedHost(this);
    const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
    const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;
    const componentFactory = resolver.resolveComponentFactory(portal.component);
    const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector, portal.projectableNodes || void 0);
    if (viewContainerRef !== this._viewContainerRef) {
      this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
    }
    super.setDisposeFn(() => ref.destroy());
    this._attachedPortal = portal;
    this._attachedRef = ref;
    this.attached.emit(ref);
    return ref;
  }
  /**
   * Attach the given TemplatePortal to this PortalHost as an embedded View.
   * @param portal Portal to be attached.
   * @returns Reference to the created embedded view.
   */
  attachTemplatePortal(portal) {
    portal.setAttachedHost(this);
    const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
      injector: portal.injector
    });
    super.setDisposeFn(() => this._viewContainerRef.clear());
    this._attachedPortal = portal;
    this._attachedRef = viewRef;
    this.attached.emit(viewRef);
    return viewRef;
  }
  /** Gets the root node of the portal outlet. */
  _getRootNode() {
    const nativeElement = this._viewContainerRef.element.nativeElement;
    return nativeElement.nodeType === nativeElement.ELEMENT_NODE ? nativeElement : nativeElement.parentNode;
  }
};
_CdkPortalOutlet.\u0275fac = function CdkPortalOutlet_Factory(t) {
  return new (t || _CdkPortalOutlet)(\u0275\u0275directiveInject(ComponentFactoryResolver$1), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(DOCUMENT2));
};
_CdkPortalOutlet.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkPortalOutlet,
  selectors: [["", "cdkPortalOutlet", ""]],
  inputs: {
    portal: [0, "cdkPortalOutlet", "portal"]
  },
  outputs: {
    attached: "attached"
  },
  exportAs: ["cdkPortalOutlet"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature]
});
var CdkPortalOutlet = _CdkPortalOutlet;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkPortalOutlet, [{
    type: Directive,
    args: [{
      selector: "[cdkPortalOutlet]",
      exportAs: "cdkPortalOutlet",
      standalone: true
    }]
  }], () => [{
    type: ComponentFactoryResolver$1
  }, {
    type: ViewContainerRef
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    portal: [{
      type: Input,
      args: ["cdkPortalOutlet"]
    }],
    attached: [{
      type: Output
    }]
  });
})();
var _PortalHostDirective = class _PortalHostDirective extends CdkPortalOutlet {
};
_PortalHostDirective.\u0275fac = /* @__PURE__ */ (() => {
  let \u0275PortalHostDirective_BaseFactory;
  return function PortalHostDirective_Factory(t) {
    return (\u0275PortalHostDirective_BaseFactory || (\u0275PortalHostDirective_BaseFactory = \u0275\u0275getInheritedFactory(_PortalHostDirective)))(t || _PortalHostDirective);
  };
})();
_PortalHostDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _PortalHostDirective,
  selectors: [["", "cdkPortalHost", ""], ["", "portalHost", ""]],
  inputs: {
    portal: [0, "cdkPortalHost", "portal"]
  },
  exportAs: ["cdkPortalHost"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: CdkPortalOutlet,
    useExisting: _PortalHostDirective
  }]), \u0275\u0275InheritDefinitionFeature]
});
var PortalHostDirective = _PortalHostDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PortalHostDirective, [{
    type: Directive,
    args: [{
      selector: "[cdkPortalHost], [portalHost]",
      exportAs: "cdkPortalHost",
      inputs: [{
        name: "portal",
        alias: "cdkPortalHost"
      }],
      providers: [{
        provide: CdkPortalOutlet,
        useExisting: PortalHostDirective
      }],
      standalone: true
    }]
  }], null, null);
})();
var _PortalModule = class _PortalModule {
};
_PortalModule.\u0275fac = function PortalModule_Factory(t) {
  return new (t || _PortalModule)();
};
_PortalModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _PortalModule
});
_PortalModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var PortalModule = _PortalModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PortalModule, [{
    type: NgModule,
    args: [{
      imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
      exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective]
    }]
  }], null, null);
})();

// node_modules/@angular/cdk/fesm2022/overlay.mjs
var scrollBehaviorSupported2 = supportsScrollBehavior();
var BlockScrollStrategy = class {
  constructor(_viewportRuler, document2) {
    this._viewportRuler = _viewportRuler;
    this._previousHTMLStyles = {
      top: "",
      left: ""
    };
    this._isEnabled = false;
    this._document = document2;
  }
  /** Attaches this scroll strategy to an overlay. */
  attach() {
  }
  /** Blocks page-level scroll while the attached overlay is open. */
  enable() {
    if (this._canBeEnabled()) {
      const root = this._document.documentElement;
      this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
      this._previousHTMLStyles.left = root.style.left || "";
      this._previousHTMLStyles.top = root.style.top || "";
      root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);
      root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);
      root.classList.add("cdk-global-scrollblock");
      this._isEnabled = true;
    }
  }
  /** Unblocks page-level scroll while the attached overlay is open. */
  disable() {
    if (this._isEnabled) {
      const html = this._document.documentElement;
      const body = this._document.body;
      const htmlStyle = html.style;
      const bodyStyle = body.style;
      const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || "";
      const previousBodyScrollBehavior = bodyStyle.scrollBehavior || "";
      this._isEnabled = false;
      htmlStyle.left = this._previousHTMLStyles.left;
      htmlStyle.top = this._previousHTMLStyles.top;
      html.classList.remove("cdk-global-scrollblock");
      if (scrollBehaviorSupported2) {
        htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = "auto";
      }
      window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
      if (scrollBehaviorSupported2) {
        htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
        bodyStyle.scrollBehavior = previousBodyScrollBehavior;
      }
    }
  }
  _canBeEnabled() {
    const html = this._document.documentElement;
    if (html.classList.contains("cdk-global-scrollblock") || this._isEnabled) {
      return false;
    }
    const body = this._document.body;
    const viewport = this._viewportRuler.getViewportSize();
    return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;
  }
};
function getMatScrollStrategyAlreadyAttachedError() {
  return Error(`Scroll strategy has already been attached.`);
}
var CloseScrollStrategy = class {
  constructor(_scrollDispatcher, _ngZone, _viewportRuler, _config) {
    this._scrollDispatcher = _scrollDispatcher;
    this._ngZone = _ngZone;
    this._viewportRuler = _viewportRuler;
    this._config = _config;
    this._scrollSubscription = null;
    this._detach = () => {
      this.disable();
      if (this._overlayRef.hasAttached()) {
        this._ngZone.run(() => this._overlayRef.detach());
      }
    };
  }
  /** Attaches this scroll strategy to an overlay. */
  attach(overlayRef) {
    if (this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw getMatScrollStrategyAlreadyAttachedError();
    }
    this._overlayRef = overlayRef;
  }
  /** Enables the closing of the attached overlay on scroll. */
  enable() {
    if (this._scrollSubscription) {
      return;
    }
    const stream = this._scrollDispatcher.scrolled(0).pipe(filter((scrollable) => {
      return !scrollable || !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement);
    }));
    if (this._config && this._config.threshold && this._config.threshold > 1) {
      this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;
      this._scrollSubscription = stream.subscribe(() => {
        const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;
        if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {
          this._detach();
        } else {
          this._overlayRef.updatePosition();
        }
      });
    } else {
      this._scrollSubscription = stream.subscribe(this._detach);
    }
  }
  /** Disables the closing the attached overlay on scroll. */
  disable() {
    if (this._scrollSubscription) {
      this._scrollSubscription.unsubscribe();
      this._scrollSubscription = null;
    }
  }
  detach() {
    this.disable();
    this._overlayRef = null;
  }
};
var NoopScrollStrategy = class {
  /** Does nothing, as this scroll strategy is a no-op. */
  enable() {
  }
  /** Does nothing, as this scroll strategy is a no-op. */
  disable() {
  }
  /** Does nothing, as this scroll strategy is a no-op. */
  attach() {
  }
};
function isElementScrolledOutsideView(element, scrollContainers) {
  return scrollContainers.some((containerBounds) => {
    const outsideAbove = element.bottom < containerBounds.top;
    const outsideBelow = element.top > containerBounds.bottom;
    const outsideLeft = element.right < containerBounds.left;
    const outsideRight = element.left > containerBounds.right;
    return outsideAbove || outsideBelow || outsideLeft || outsideRight;
  });
}
function isElementClippedByScrolling(element, scrollContainers) {
  return scrollContainers.some((scrollContainerRect) => {
    const clippedAbove = element.top < scrollContainerRect.top;
    const clippedBelow = element.bottom > scrollContainerRect.bottom;
    const clippedLeft = element.left < scrollContainerRect.left;
    const clippedRight = element.right > scrollContainerRect.right;
    return clippedAbove || clippedBelow || clippedLeft || clippedRight;
  });
}
var RepositionScrollStrategy = class {
  constructor(_scrollDispatcher, _viewportRuler, _ngZone, _config) {
    this._scrollDispatcher = _scrollDispatcher;
    this._viewportRuler = _viewportRuler;
    this._ngZone = _ngZone;
    this._config = _config;
    this._scrollSubscription = null;
  }
  /** Attaches this scroll strategy to an overlay. */
  attach(overlayRef) {
    if (this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw getMatScrollStrategyAlreadyAttachedError();
    }
    this._overlayRef = overlayRef;
  }
  /** Enables repositioning of the attached overlay on scroll. */
  enable() {
    if (!this._scrollSubscription) {
      const throttle = this._config ? this._config.scrollThrottle : 0;
      this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {
        this._overlayRef.updatePosition();
        if (this._config && this._config.autoClose) {
          const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();
          const {
            width,
            height
          } = this._viewportRuler.getViewportSize();
          const parentRects = [{
            width,
            height,
            bottom: height,
            right: width,
            top: 0,
            left: 0
          }];
          if (isElementScrolledOutsideView(overlayRect, parentRects)) {
            this.disable();
            this._ngZone.run(() => this._overlayRef.detach());
          }
        }
      });
    }
  }
  /** Disables repositioning of the attached overlay on scroll. */
  disable() {
    if (this._scrollSubscription) {
      this._scrollSubscription.unsubscribe();
      this._scrollSubscription = null;
    }
  }
  detach() {
    this.disable();
    this._overlayRef = null;
  }
};
var _ScrollStrategyOptions = class _ScrollStrategyOptions {
  constructor(_scrollDispatcher, _viewportRuler, _ngZone, document2) {
    this._scrollDispatcher = _scrollDispatcher;
    this._viewportRuler = _viewportRuler;
    this._ngZone = _ngZone;
    this.noop = () => new NoopScrollStrategy();
    this.close = (config2) => new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config2);
    this.block = () => new BlockScrollStrategy(this._viewportRuler, this._document);
    this.reposition = (config2) => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config2);
    this._document = document2;
  }
};
_ScrollStrategyOptions.\u0275fac = function ScrollStrategyOptions_Factory(t) {
  return new (t || _ScrollStrategyOptions)(\u0275\u0275inject(ScrollDispatcher), \u0275\u0275inject(ViewportRuler), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2));
};
_ScrollStrategyOptions.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ScrollStrategyOptions,
  factory: _ScrollStrategyOptions.\u0275fac,
  providedIn: "root"
});
var ScrollStrategyOptions = _ScrollStrategyOptions;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ScrollStrategyOptions, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: ScrollDispatcher
  }, {
    type: ViewportRuler
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var OverlayConfig = class {
  constructor(config2) {
    this.scrollStrategy = new NoopScrollStrategy();
    this.panelClass = "";
    this.hasBackdrop = false;
    this.backdropClass = "cdk-overlay-dark-backdrop";
    this.disposeOnNavigation = false;
    if (config2) {
      const configKeys = Object.keys(config2);
      for (const key of configKeys) {
        if (config2[key] !== void 0) {
          this[key] = config2[key];
        }
      }
    }
  }
};
var ConnectedOverlayPositionChange = class {
  constructor(connectionPair, scrollableViewProperties) {
    this.connectionPair = connectionPair;
    this.scrollableViewProperties = scrollableViewProperties;
  }
};
function validateVerticalPosition(property, value) {
  if (value !== "top" && value !== "bottom" && value !== "center") {
    throw Error(`ConnectedPosition: Invalid ${property} "${value}". Expected "top", "bottom" or "center".`);
  }
}
function validateHorizontalPosition(property, value) {
  if (value !== "start" && value !== "end" && value !== "center") {
    throw Error(`ConnectedPosition: Invalid ${property} "${value}". Expected "start", "end" or "center".`);
  }
}
var _BaseOverlayDispatcher = class _BaseOverlayDispatcher {
  constructor(document2) {
    this._attachedOverlays = [];
    this._document = document2;
  }
  ngOnDestroy() {
    this.detach();
  }
  /** Add a new overlay to the list of attached overlay refs. */
  add(overlayRef) {
    this.remove(overlayRef);
    this._attachedOverlays.push(overlayRef);
  }
  /** Remove an overlay from the list of attached overlay refs. */
  remove(overlayRef) {
    const index = this._attachedOverlays.indexOf(overlayRef);
    if (index > -1) {
      this._attachedOverlays.splice(index, 1);
    }
    if (this._attachedOverlays.length === 0) {
      this.detach();
    }
  }
};
_BaseOverlayDispatcher.\u0275fac = function BaseOverlayDispatcher_Factory(t) {
  return new (t || _BaseOverlayDispatcher)(\u0275\u0275inject(DOCUMENT2));
};
_BaseOverlayDispatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _BaseOverlayDispatcher,
  factory: _BaseOverlayDispatcher.\u0275fac,
  providedIn: "root"
});
var BaseOverlayDispatcher = _BaseOverlayDispatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BaseOverlayDispatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], null);
})();
var _OverlayKeyboardDispatcher = class _OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
  constructor(document2, _ngZone) {
    super(document2);
    this._ngZone = _ngZone;
    this._keydownListener = (event) => {
      const overlays = this._attachedOverlays;
      for (let i2 = overlays.length - 1; i2 > -1; i2--) {
        if (overlays[i2]._keydownEvents.observers.length > 0) {
          const keydownEvents = overlays[i2]._keydownEvents;
          if (this._ngZone) {
            this._ngZone.run(() => keydownEvents.next(event));
          } else {
            keydownEvents.next(event);
          }
          break;
        }
      }
    };
  }
  /** Add a new overlay to the list of attached overlay refs. */
  add(overlayRef) {
    super.add(overlayRef);
    if (!this._isAttached) {
      if (this._ngZone) {
        this._ngZone.runOutsideAngular(() => this._document.body.addEventListener("keydown", this._keydownListener));
      } else {
        this._document.body.addEventListener("keydown", this._keydownListener);
      }
      this._isAttached = true;
    }
  }
  /** Detaches the global keyboard event listener. */
  detach() {
    if (this._isAttached) {
      this._document.body.removeEventListener("keydown", this._keydownListener);
      this._isAttached = false;
    }
  }
};
_OverlayKeyboardDispatcher.\u0275fac = function OverlayKeyboardDispatcher_Factory(t) {
  return new (t || _OverlayKeyboardDispatcher)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(NgZone, 8));
};
_OverlayKeyboardDispatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _OverlayKeyboardDispatcher,
  factory: _OverlayKeyboardDispatcher.\u0275fac,
  providedIn: "root"
});
var OverlayKeyboardDispatcher = _OverlayKeyboardDispatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayKeyboardDispatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: NgZone,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
var _OverlayOutsideClickDispatcher = class _OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
  constructor(document2, _platform, _ngZone) {
    super(document2);
    this._platform = _platform;
    this._ngZone = _ngZone;
    this._cursorStyleIsSet = false;
    this._pointerDownListener = (event) => {
      this._pointerDownEventTarget = _getEventTarget(event);
    };
    this._clickListener = (event) => {
      const target = _getEventTarget(event);
      const origin = event.type === "click" && this._pointerDownEventTarget ? this._pointerDownEventTarget : target;
      this._pointerDownEventTarget = null;
      const overlays = this._attachedOverlays.slice();
      for (let i2 = overlays.length - 1; i2 > -1; i2--) {
        const overlayRef = overlays[i2];
        if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {
          continue;
        }
        if (overlayRef.overlayElement.contains(target) || overlayRef.overlayElement.contains(origin)) {
          break;
        }
        const outsidePointerEvents = overlayRef._outsidePointerEvents;
        if (this._ngZone) {
          this._ngZone.run(() => outsidePointerEvents.next(event));
        } else {
          outsidePointerEvents.next(event);
        }
      }
    };
  }
  /** Add a new overlay to the list of attached overlay refs. */
  add(overlayRef) {
    super.add(overlayRef);
    if (!this._isAttached) {
      const body = this._document.body;
      if (this._ngZone) {
        this._ngZone.runOutsideAngular(() => this._addEventListeners(body));
      } else {
        this._addEventListeners(body);
      }
      if (this._platform.IOS && !this._cursorStyleIsSet) {
        this._cursorOriginalValue = body.style.cursor;
        body.style.cursor = "pointer";
        this._cursorStyleIsSet = true;
      }
      this._isAttached = true;
    }
  }
  /** Detaches the global keyboard event listener. */
  detach() {
    if (this._isAttached) {
      const body = this._document.body;
      body.removeEventListener("pointerdown", this._pointerDownListener, true);
      body.removeEventListener("click", this._clickListener, true);
      body.removeEventListener("auxclick", this._clickListener, true);
      body.removeEventListener("contextmenu", this._clickListener, true);
      if (this._platform.IOS && this._cursorStyleIsSet) {
        body.style.cursor = this._cursorOriginalValue;
        this._cursorStyleIsSet = false;
      }
      this._isAttached = false;
    }
  }
  _addEventListeners(body) {
    body.addEventListener("pointerdown", this._pointerDownListener, true);
    body.addEventListener("click", this._clickListener, true);
    body.addEventListener("auxclick", this._clickListener, true);
    body.addEventListener("contextmenu", this._clickListener, true);
  }
};
_OverlayOutsideClickDispatcher.\u0275fac = function OverlayOutsideClickDispatcher_Factory(t) {
  return new (t || _OverlayOutsideClickDispatcher)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Platform), \u0275\u0275inject(NgZone, 8));
};
_OverlayOutsideClickDispatcher.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _OverlayOutsideClickDispatcher,
  factory: _OverlayOutsideClickDispatcher.\u0275fac,
  providedIn: "root"
});
var OverlayOutsideClickDispatcher = _OverlayOutsideClickDispatcher;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayOutsideClickDispatcher, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Platform
  }, {
    type: NgZone,
    decorators: [{
      type: Optional
    }]
  }], null);
})();
var _OverlayContainer = class _OverlayContainer {
  constructor(document2, _platform) {
    this._platform = _platform;
    this._document = document2;
  }
  ngOnDestroy() {
    this._containerElement?.remove();
  }
  /**
   * This method returns the overlay container element. It will lazily
   * create the element the first time it is called to facilitate using
   * the container in non-browser environments.
   * @returns the container element
   */
  getContainerElement() {
    if (!this._containerElement) {
      this._createContainer();
    }
    return this._containerElement;
  }
  /**
   * Create the overlay container element, which is simply a div
   * with the 'cdk-overlay-container' class on the document body.
   */
  _createContainer() {
    const containerClass = "cdk-overlay-container";
    if (this._platform.isBrowser || _isTestEnvironment()) {
      const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform="server"], .${containerClass}[platform="test"]`);
      for (let i2 = 0; i2 < oppositePlatformContainers.length; i2++) {
        oppositePlatformContainers[i2].remove();
      }
    }
    const container = this._document.createElement("div");
    container.classList.add(containerClass);
    if (_isTestEnvironment()) {
      container.setAttribute("platform", "test");
    } else if (!this._platform.isBrowser) {
      container.setAttribute("platform", "server");
    }
    this._document.body.appendChild(container);
    this._containerElement = container;
  }
};
_OverlayContainer.\u0275fac = function OverlayContainer_Factory(t) {
  return new (t || _OverlayContainer)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Platform));
};
_OverlayContainer.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _OverlayContainer,
  factory: _OverlayContainer.\u0275fac,
  providedIn: "root"
});
var OverlayContainer = _OverlayContainer;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayContainer, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Platform
  }], null);
})();
var OverlayRef = class {
  constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document2, _location, _outsideClickDispatcher, _animationsDisabled = false, _injector) {
    this._portalOutlet = _portalOutlet;
    this._host = _host;
    this._pane = _pane;
    this._config = _config;
    this._ngZone = _ngZone;
    this._keyboardDispatcher = _keyboardDispatcher;
    this._document = _document2;
    this._location = _location;
    this._outsideClickDispatcher = _outsideClickDispatcher;
    this._animationsDisabled = _animationsDisabled;
    this._injector = _injector;
    this._backdropElement = null;
    this._backdropClick = new Subject();
    this._attachments = new Subject();
    this._detachments = new Subject();
    this._locationChanges = Subscription.EMPTY;
    this._backdropClickHandler = (event) => this._backdropClick.next(event);
    this._backdropTransitionendHandler = (event) => {
      this._disposeBackdrop(event.target);
    };
    this._keydownEvents = new Subject();
    this._outsidePointerEvents = new Subject();
    this._renders = new Subject();
    if (_config.scrollStrategy) {
      this._scrollStrategy = _config.scrollStrategy;
      this._scrollStrategy.attach(this);
    }
    this._positionStrategy = _config.positionStrategy;
    this._afterRenderRef = untracked(() => afterRender(() => {
      this._renders.next();
    }, {
      injector: this._injector
    }));
  }
  /** The overlay's HTML element */
  get overlayElement() {
    return this._pane;
  }
  /** The overlay's backdrop HTML element. */
  get backdropElement() {
    return this._backdropElement;
  }
  /**
   * Wrapper around the panel element. Can be used for advanced
   * positioning where a wrapper with specific styling is
   * required around the overlay pane.
   */
  get hostElement() {
    return this._host;
  }
  /**
   * Attaches content, given via a Portal, to the overlay.
   * If the overlay is configured to have a backdrop, it will be created.
   *
   * @param portal Portal instance to which to attach the overlay.
   * @returns The portal attachment result.
   */
  attach(portal) {
    if (!this._host.parentElement && this._previousHostParent) {
      this._previousHostParent.appendChild(this._host);
    }
    const attachResult = this._portalOutlet.attach(portal);
    if (this._positionStrategy) {
      this._positionStrategy.attach(this);
    }
    this._updateStackingOrder();
    this._updateElementSize();
    this._updateElementDirection();
    if (this._scrollStrategy) {
      this._scrollStrategy.enable();
    }
    afterNextRender(() => {
      if (this.hasAttached()) {
        this.updatePosition();
      }
    }, {
      injector: this._injector
    });
    this._togglePointerEvents(true);
    if (this._config.hasBackdrop) {
      this._attachBackdrop();
    }
    if (this._config.panelClass) {
      this._toggleClasses(this._pane, this._config.panelClass, true);
    }
    this._attachments.next();
    this._keyboardDispatcher.add(this);
    if (this._config.disposeOnNavigation) {
      this._locationChanges = this._location.subscribe(() => this.dispose());
    }
    this._outsideClickDispatcher.add(this);
    if (typeof attachResult?.onDestroy === "function") {
      attachResult.onDestroy(() => {
        if (this.hasAttached()) {
          this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));
        }
      });
    }
    return attachResult;
  }
  /**
   * Detaches an overlay from a portal.
   * @returns The portal detachment result.
   */
  detach() {
    if (!this.hasAttached()) {
      return;
    }
    this.detachBackdrop();
    this._togglePointerEvents(false);
    if (this._positionStrategy && this._positionStrategy.detach) {
      this._positionStrategy.detach();
    }
    if (this._scrollStrategy) {
      this._scrollStrategy.disable();
    }
    const detachmentResult = this._portalOutlet.detach();
    this._detachments.next();
    this._keyboardDispatcher.remove(this);
    this._detachContentWhenEmpty();
    this._locationChanges.unsubscribe();
    this._outsideClickDispatcher.remove(this);
    return detachmentResult;
  }
  /** Cleans up the overlay from the DOM. */
  dispose() {
    const isAttached = this.hasAttached();
    if (this._positionStrategy) {
      this._positionStrategy.dispose();
    }
    this._disposeScrollStrategy();
    this._disposeBackdrop(this._backdropElement);
    this._locationChanges.unsubscribe();
    this._keyboardDispatcher.remove(this);
    this._portalOutlet.dispose();
    this._attachments.complete();
    this._backdropClick.complete();
    this._keydownEvents.complete();
    this._outsidePointerEvents.complete();
    this._outsideClickDispatcher.remove(this);
    this._host?.remove();
    this._previousHostParent = this._pane = this._host = null;
    if (isAttached) {
      this._detachments.next();
    }
    this._detachments.complete();
    this._afterRenderRef.destroy();
    this._renders.complete();
  }
  /** Whether the overlay has attached content. */
  hasAttached() {
    return this._portalOutlet.hasAttached();
  }
  /** Gets an observable that emits when the backdrop has been clicked. */
  backdropClick() {
    return this._backdropClick;
  }
  /** Gets an observable that emits when the overlay has been attached. */
  attachments() {
    return this._attachments;
  }
  /** Gets an observable that emits when the overlay has been detached. */
  detachments() {
    return this._detachments;
  }
  /** Gets an observable of keydown events targeted to this overlay. */
  keydownEvents() {
    return this._keydownEvents;
  }
  /** Gets an observable of pointer events targeted outside this overlay. */
  outsidePointerEvents() {
    return this._outsidePointerEvents;
  }
  /** Gets the current overlay configuration, which is immutable. */
  getConfig() {
    return this._config;
  }
  /** Updates the position of the overlay based on the position strategy. */
  updatePosition() {
    if (this._positionStrategy) {
      this._positionStrategy.apply();
    }
  }
  /** Switches to a new position strategy and updates the overlay position. */
  updatePositionStrategy(strategy) {
    if (strategy === this._positionStrategy) {
      return;
    }
    if (this._positionStrategy) {
      this._positionStrategy.dispose();
    }
    this._positionStrategy = strategy;
    if (this.hasAttached()) {
      strategy.attach(this);
      this.updatePosition();
    }
  }
  /** Update the size properties of the overlay. */
  updateSize(sizeConfig) {
    this._config = __spreadValues(__spreadValues({}, this._config), sizeConfig);
    this._updateElementSize();
  }
  /** Sets the LTR/RTL direction for the overlay. */
  setDirection(dir) {
    this._config = __spreadProps(__spreadValues({}, this._config), {
      direction: dir
    });
    this._updateElementDirection();
  }
  /** Add a CSS class or an array of classes to the overlay pane. */
  addPanelClass(classes) {
    if (this._pane) {
      this._toggleClasses(this._pane, classes, true);
    }
  }
  /** Remove a CSS class or an array of classes from the overlay pane. */
  removePanelClass(classes) {
    if (this._pane) {
      this._toggleClasses(this._pane, classes, false);
    }
  }
  /**
   * Returns the layout direction of the overlay panel.
   */
  getDirection() {
    const direction = this._config.direction;
    if (!direction) {
      return "ltr";
    }
    return typeof direction === "string" ? direction : direction.value;
  }
  /** Switches to a new scroll strategy. */
  updateScrollStrategy(strategy) {
    if (strategy === this._scrollStrategy) {
      return;
    }
    this._disposeScrollStrategy();
    this._scrollStrategy = strategy;
    if (this.hasAttached()) {
      strategy.attach(this);
      strategy.enable();
    }
  }
  /** Updates the text direction of the overlay panel. */
  _updateElementDirection() {
    this._host.setAttribute("dir", this.getDirection());
  }
  /** Updates the size of the overlay element based on the overlay config. */
  _updateElementSize() {
    if (!this._pane) {
      return;
    }
    const style2 = this._pane.style;
    style2.width = coerceCssPixelValue(this._config.width);
    style2.height = coerceCssPixelValue(this._config.height);
    style2.minWidth = coerceCssPixelValue(this._config.minWidth);
    style2.minHeight = coerceCssPixelValue(this._config.minHeight);
    style2.maxWidth = coerceCssPixelValue(this._config.maxWidth);
    style2.maxHeight = coerceCssPixelValue(this._config.maxHeight);
  }
  /** Toggles the pointer events for the overlay pane element. */
  _togglePointerEvents(enablePointer) {
    this._pane.style.pointerEvents = enablePointer ? "" : "none";
  }
  /** Attaches a backdrop for this overlay. */
  _attachBackdrop() {
    const showingClass = "cdk-overlay-backdrop-showing";
    this._backdropElement = this._document.createElement("div");
    this._backdropElement.classList.add("cdk-overlay-backdrop");
    if (this._animationsDisabled) {
      this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation");
    }
    if (this._config.backdropClass) {
      this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
    }
    this._host.parentElement.insertBefore(this._backdropElement, this._host);
    this._backdropElement.addEventListener("click", this._backdropClickHandler);
    if (!this._animationsDisabled && typeof requestAnimationFrame !== "undefined") {
      this._ngZone.runOutsideAngular(() => {
        requestAnimationFrame(() => {
          if (this._backdropElement) {
            this._backdropElement.classList.add(showingClass);
          }
        });
      });
    } else {
      this._backdropElement.classList.add(showingClass);
    }
  }
  /**
   * Updates the stacking order of the element, moving it to the top if necessary.
   * This is required in cases where one overlay was detached, while another one,
   * that should be behind it, was destroyed. The next time both of them are opened,
   * the stacking will be wrong, because the detached element's pane will still be
   * in its original DOM position.
   */
  _updateStackingOrder() {
    if (this._host.nextSibling) {
      this._host.parentNode.appendChild(this._host);
    }
  }
  /** Detaches the backdrop (if any) associated with the overlay. */
  detachBackdrop() {
    const backdropToDetach = this._backdropElement;
    if (!backdropToDetach) {
      return;
    }
    if (this._animationsDisabled) {
      this._disposeBackdrop(backdropToDetach);
      return;
    }
    backdropToDetach.classList.remove("cdk-overlay-backdrop-showing");
    this._ngZone.runOutsideAngular(() => {
      backdropToDetach.addEventListener("transitionend", this._backdropTransitionendHandler);
    });
    backdropToDetach.style.pointerEvents = "none";
    this._backdropTimeout = this._ngZone.runOutsideAngular(() => setTimeout(() => {
      this._disposeBackdrop(backdropToDetach);
    }, 500));
  }
  /** Toggles a single CSS class or an array of classes on an element. */
  _toggleClasses(element, cssClasses, isAdd) {
    const classes = coerceArray(cssClasses || []).filter((c) => !!c);
    if (classes.length) {
      isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);
    }
  }
  /** Detaches the overlay content next time the zone stabilizes. */
  _detachContentWhenEmpty() {
    this._ngZone.runOutsideAngular(() => {
      const subscription = this._renders.pipe(takeUntil(merge(this._attachments, this._detachments))).subscribe(() => {
        if (!this._pane || !this._host || this._pane.children.length === 0) {
          if (this._pane && this._config.panelClass) {
            this._toggleClasses(this._pane, this._config.panelClass, false);
          }
          if (this._host && this._host.parentElement) {
            this._previousHostParent = this._host.parentElement;
            this._host.remove();
          }
          subscription.unsubscribe();
        }
      });
    });
  }
  /** Disposes of a scroll strategy. */
  _disposeScrollStrategy() {
    const scrollStrategy = this._scrollStrategy;
    if (scrollStrategy) {
      scrollStrategy.disable();
      if (scrollStrategy.detach) {
        scrollStrategy.detach();
      }
    }
  }
  /** Removes a backdrop element from the DOM. */
  _disposeBackdrop(backdrop) {
    if (backdrop) {
      backdrop.removeEventListener("click", this._backdropClickHandler);
      backdrop.removeEventListener("transitionend", this._backdropTransitionendHandler);
      backdrop.remove();
      if (this._backdropElement === backdrop) {
        this._backdropElement = null;
      }
    }
    if (this._backdropTimeout) {
      clearTimeout(this._backdropTimeout);
      this._backdropTimeout = void 0;
    }
  }
};
var boundingBoxClass = "cdk-overlay-connected-position-bounding-box";
var cssUnitPattern = /([A-Za-z%]+)$/;
var FlexibleConnectedPositionStrategy = class {
  /** Ordered list of preferred positions, from most to least desirable. */
  get positions() {
    return this._preferredPositions;
  }
  constructor(connectedTo, _viewportRuler, _document2, _platform, _overlayContainer) {
    this._viewportRuler = _viewportRuler;
    this._document = _document2;
    this._platform = _platform;
    this._overlayContainer = _overlayContainer;
    this._lastBoundingBoxSize = {
      width: 0,
      height: 0
    };
    this._isPushed = false;
    this._canPush = true;
    this._growAfterOpen = false;
    this._hasFlexibleDimensions = true;
    this._positionLocked = false;
    this._viewportMargin = 0;
    this._scrollables = [];
    this._preferredPositions = [];
    this._positionChanges = new Subject();
    this._resizeSubscription = Subscription.EMPTY;
    this._offsetX = 0;
    this._offsetY = 0;
    this._appliedPanelClasses = [];
    this.positionChanges = this._positionChanges;
    this.setOrigin(connectedTo);
  }
  /** Attaches this position strategy to an overlay. */
  attach(overlayRef) {
    if (this._overlayRef && overlayRef !== this._overlayRef && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw Error("This position strategy is already attached to an overlay");
    }
    this._validatePositions();
    overlayRef.hostElement.classList.add(boundingBoxClass);
    this._overlayRef = overlayRef;
    this._boundingBox = overlayRef.hostElement;
    this._pane = overlayRef.overlayElement;
    this._isDisposed = false;
    this._isInitialRender = true;
    this._lastPosition = null;
    this._resizeSubscription.unsubscribe();
    this._resizeSubscription = this._viewportRuler.change().subscribe(() => {
      this._isInitialRender = true;
      this.apply();
    });
  }
  /**
   * Updates the position of the overlay element, using whichever preferred position relative
   * to the origin best fits on-screen.
   *
   * The selection of a position goes as follows:
   *  - If any positions fit completely within the viewport as-is,
   *      choose the first position that does so.
   *  - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,
   *      choose the position with the greatest available size modified by the positions' weight.
   *  - If pushing is enabled, take the position that went off-screen the least and push it
   *      on-screen.
   *  - If none of the previous criteria were met, use the position that goes off-screen the least.
   * @docs-private
   */
  apply() {
    if (this._isDisposed || !this._platform.isBrowser) {
      return;
    }
    if (!this._isInitialRender && this._positionLocked && this._lastPosition) {
      this.reapplyLastPosition();
      return;
    }
    this._clearPanelClasses();
    this._resetOverlayElementStyles();
    this._resetBoundingBoxStyles();
    this._viewportRect = this._getNarrowedViewportRect();
    this._originRect = this._getOriginRect();
    this._overlayRect = this._pane.getBoundingClientRect();
    this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
    const originRect = this._originRect;
    const overlayRect = this._overlayRect;
    const viewportRect = this._viewportRect;
    const containerRect = this._containerRect;
    const flexibleFits = [];
    let fallback;
    for (let pos of this._preferredPositions) {
      let originPoint = this._getOriginPoint(originRect, containerRect, pos);
      let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
      let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
      if (overlayFit.isCompletelyWithinViewport) {
        this._isPushed = false;
        this._applyPosition(pos, originPoint);
        return;
      }
      if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {
        flexibleFits.push({
          position: pos,
          origin: originPoint,
          overlayRect,
          boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos)
        });
        continue;
      }
      if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {
        fallback = {
          overlayFit,
          overlayPoint,
          originPoint,
          position: pos,
          overlayRect
        };
      }
    }
    if (flexibleFits.length) {
      let bestFit = null;
      let bestScore = -1;
      for (const fit of flexibleFits) {
        const score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);
        if (score > bestScore) {
          bestScore = score;
          bestFit = fit;
        }
      }
      this._isPushed = false;
      this._applyPosition(bestFit.position, bestFit.origin);
      return;
    }
    if (this._canPush) {
      this._isPushed = true;
      this._applyPosition(fallback.position, fallback.originPoint);
      return;
    }
    this._applyPosition(fallback.position, fallback.originPoint);
  }
  detach() {
    this._clearPanelClasses();
    this._lastPosition = null;
    this._previousPushAmount = null;
    this._resizeSubscription.unsubscribe();
  }
  /** Cleanup after the element gets destroyed. */
  dispose() {
    if (this._isDisposed) {
      return;
    }
    if (this._boundingBox) {
      extendStyles(this._boundingBox.style, {
        top: "",
        left: "",
        right: "",
        bottom: "",
        height: "",
        width: "",
        alignItems: "",
        justifyContent: ""
      });
    }
    if (this._pane) {
      this._resetOverlayElementStyles();
    }
    if (this._overlayRef) {
      this._overlayRef.hostElement.classList.remove(boundingBoxClass);
    }
    this.detach();
    this._positionChanges.complete();
    this._overlayRef = this._boundingBox = null;
    this._isDisposed = true;
  }
  /**
   * This re-aligns the overlay element with the trigger in its last calculated position,
   * even if a position higher in the "preferred positions" list would now fit. This
   * allows one to re-align the panel without changing the orientation of the panel.
   */
  reapplyLastPosition() {
    if (this._isDisposed || !this._platform.isBrowser) {
      return;
    }
    const lastPosition = this._lastPosition;
    if (lastPosition) {
      this._originRect = this._getOriginRect();
      this._overlayRect = this._pane.getBoundingClientRect();
      this._viewportRect = this._getNarrowedViewportRect();
      this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
      const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
      this._applyPosition(lastPosition, originPoint);
    } else {
      this.apply();
    }
  }
  /**
   * Sets the list of Scrollable containers that host the origin element so that
   * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
   * Scrollable must be an ancestor element of the strategy's origin element.
   */
  withScrollableContainers(scrollables) {
    this._scrollables = scrollables;
    return this;
  }
  /**
   * Adds new preferred positions.
   * @param positions List of positions options for this overlay.
   */
  withPositions(positions) {
    this._preferredPositions = positions;
    if (positions.indexOf(this._lastPosition) === -1) {
      this._lastPosition = null;
    }
    this._validatePositions();
    return this;
  }
  /**
   * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
   * @param margin Required margin between the overlay and the viewport edge in pixels.
   */
  withViewportMargin(margin) {
    this._viewportMargin = margin;
    return this;
  }
  /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
  withFlexibleDimensions(flexibleDimensions = true) {
    this._hasFlexibleDimensions = flexibleDimensions;
    return this;
  }
  /** Sets whether the overlay can grow after the initial open via flexible width/height. */
  withGrowAfterOpen(growAfterOpen = true) {
    this._growAfterOpen = growAfterOpen;
    return this;
  }
  /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
  withPush(canPush = true) {
    this._canPush = canPush;
    return this;
  }
  /**
   * Sets whether the overlay's position should be locked in after it is positioned
   * initially. When an overlay is locked in, it won't attempt to reposition itself
   * when the position is re-applied (e.g. when the user scrolls away).
   * @param isLocked Whether the overlay should locked in.
   */
  withLockedPosition(isLocked = true) {
    this._positionLocked = isLocked;
    return this;
  }
  /**
   * Sets the origin, relative to which to position the overlay.
   * Using an element origin is useful for building components that need to be positioned
   * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
   * used for cases like contextual menus which open relative to the user's pointer.
   * @param origin Reference to the new origin.
   */
  setOrigin(origin) {
    this._origin = origin;
    return this;
  }
  /**
   * Sets the default offset for the overlay's connection point on the x-axis.
   * @param offset New offset in the X axis.
   */
  withDefaultOffsetX(offset2) {
    this._offsetX = offset2;
    return this;
  }
  /**
   * Sets the default offset for the overlay's connection point on the y-axis.
   * @param offset New offset in the Y axis.
   */
  withDefaultOffsetY(offset2) {
    this._offsetY = offset2;
    return this;
  }
  /**
   * Configures that the position strategy should set a `transform-origin` on some elements
   * inside the overlay, depending on the current position that is being applied. This is
   * useful for the cases where the origin of an animation can change depending on the
   * alignment of the overlay.
   * @param selector CSS selector that will be used to find the target
   *    elements onto which to set the transform origin.
   */
  withTransformOriginOn(selector) {
    this._transformOriginSelector = selector;
    return this;
  }
  /**
   * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
   */
  _getOriginPoint(originRect, containerRect, pos) {
    let x;
    if (pos.originX == "center") {
      x = originRect.left + originRect.width / 2;
    } else {
      const startX = this._isRtl() ? originRect.right : originRect.left;
      const endX = this._isRtl() ? originRect.left : originRect.right;
      x = pos.originX == "start" ? startX : endX;
    }
    if (containerRect.left < 0) {
      x -= containerRect.left;
    }
    let y;
    if (pos.originY == "center") {
      y = originRect.top + originRect.height / 2;
    } else {
      y = pos.originY == "top" ? originRect.top : originRect.bottom;
    }
    if (containerRect.top < 0) {
      y -= containerRect.top;
    }
    return {
      x,
      y
    };
  }
  /**
   * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
   * origin point to which the overlay should be connected.
   */
  _getOverlayPoint(originPoint, overlayRect, pos) {
    let overlayStartX;
    if (pos.overlayX == "center") {
      overlayStartX = -overlayRect.width / 2;
    } else if (pos.overlayX === "start") {
      overlayStartX = this._isRtl() ? -overlayRect.width : 0;
    } else {
      overlayStartX = this._isRtl() ? 0 : -overlayRect.width;
    }
    let overlayStartY;
    if (pos.overlayY == "center") {
      overlayStartY = -overlayRect.height / 2;
    } else {
      overlayStartY = pos.overlayY == "top" ? 0 : -overlayRect.height;
    }
    return {
      x: originPoint.x + overlayStartX,
      y: originPoint.y + overlayStartY
    };
  }
  /** Gets how well an overlay at the given point will fit within the viewport. */
  _getOverlayFit(point, rawOverlayRect, viewport, position) {
    const overlay = getRoundedBoundingClientRect(rawOverlayRect);
    let {
      x,
      y
    } = point;
    let offsetX = this._getOffset(position, "x");
    let offsetY = this._getOffset(position, "y");
    if (offsetX) {
      x += offsetX;
    }
    if (offsetY) {
      y += offsetY;
    }
    let leftOverflow = 0 - x;
    let rightOverflow = x + overlay.width - viewport.width;
    let topOverflow = 0 - y;
    let bottomOverflow = y + overlay.height - viewport.height;
    let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
    let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);
    let visibleArea = visibleWidth * visibleHeight;
    return {
      visibleArea,
      isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,
      fitsInViewportVertically: visibleHeight === overlay.height,
      fitsInViewportHorizontally: visibleWidth == overlay.width
    };
  }
  /**
   * Whether the overlay can fit within the viewport when it may resize either its width or height.
   * @param fit How well the overlay fits in the viewport at some position.
   * @param point The (x, y) coordinates of the overlay at some position.
   * @param viewport The geometry of the viewport.
   */
  _canFitWithFlexibleDimensions(fit, point, viewport) {
    if (this._hasFlexibleDimensions) {
      const availableHeight = viewport.bottom - point.y;
      const availableWidth = viewport.right - point.x;
      const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);
      const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);
      const verticalFit = fit.fitsInViewportVertically || minHeight != null && minHeight <= availableHeight;
      const horizontalFit = fit.fitsInViewportHorizontally || minWidth != null && minWidth <= availableWidth;
      return verticalFit && horizontalFit;
    }
    return false;
  }
  /**
   * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
   * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the
   * right and bottom).
   *
   * @param start Starting point from which the overlay is pushed.
   * @param rawOverlayRect Dimensions of the overlay.
   * @param scrollPosition Current viewport scroll position.
   * @returns The point at which to position the overlay after pushing. This is effectively a new
   *     originPoint.
   */
  _pushOverlayOnScreen(start2, rawOverlayRect, scrollPosition) {
    if (this._previousPushAmount && this._positionLocked) {
      return {
        x: start2.x + this._previousPushAmount.x,
        y: start2.y + this._previousPushAmount.y
      };
    }
    const overlay = getRoundedBoundingClientRect(rawOverlayRect);
    const viewport = this._viewportRect;
    const overflowRight = Math.max(start2.x + overlay.width - viewport.width, 0);
    const overflowBottom = Math.max(start2.y + overlay.height - viewport.height, 0);
    const overflowTop = Math.max(viewport.top - scrollPosition.top - start2.y, 0);
    const overflowLeft = Math.max(viewport.left - scrollPosition.left - start2.x, 0);
    let pushX = 0;
    let pushY = 0;
    if (overlay.width <= viewport.width) {
      pushX = overflowLeft || -overflowRight;
    } else {
      pushX = start2.x < this._viewportMargin ? viewport.left - scrollPosition.left - start2.x : 0;
    }
    if (overlay.height <= viewport.height) {
      pushY = overflowTop || -overflowBottom;
    } else {
      pushY = start2.y < this._viewportMargin ? viewport.top - scrollPosition.top - start2.y : 0;
    }
    this._previousPushAmount = {
      x: pushX,
      y: pushY
    };
    return {
      x: start2.x + pushX,
      y: start2.y + pushY
    };
  }
  /**
   * Applies a computed position to the overlay and emits a position change.
   * @param position The position preference
   * @param originPoint The point on the origin element where the overlay is connected.
   */
  _applyPosition(position, originPoint) {
    this._setTransformOrigin(position);
    this._setOverlayElementStyles(originPoint, position);
    this._setBoundingBoxStyles(originPoint, position);
    if (position.panelClass) {
      this._addPanelClasses(position.panelClass);
    }
    if (this._positionChanges.observers.length) {
      const scrollVisibility = this._getScrollVisibility();
      if (position !== this._lastPosition || !this._lastScrollVisibility || !compareScrollVisibility(this._lastScrollVisibility, scrollVisibility)) {
        const changeEvent = new ConnectedOverlayPositionChange(position, scrollVisibility);
        this._positionChanges.next(changeEvent);
      }
      this._lastScrollVisibility = scrollVisibility;
    }
    this._lastPosition = position;
    this._isInitialRender = false;
  }
  /** Sets the transform origin based on the configured selector and the passed-in position.  */
  _setTransformOrigin(position) {
    if (!this._transformOriginSelector) {
      return;
    }
    const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);
    let xOrigin;
    let yOrigin = position.overlayY;
    if (position.overlayX === "center") {
      xOrigin = "center";
    } else if (this._isRtl()) {
      xOrigin = position.overlayX === "start" ? "right" : "left";
    } else {
      xOrigin = position.overlayX === "start" ? "left" : "right";
    }
    for (let i2 = 0; i2 < elements.length; i2++) {
      elements[i2].style.transformOrigin = `${xOrigin} ${yOrigin}`;
    }
  }
  /**
   * Gets the position and size of the overlay's sizing container.
   *
   * This method does no measuring and applies no styles so that we can cheaply compute the
   * bounds for all positions and choose the best fit based on these results.
   */
  _calculateBoundingBoxRect(origin, position) {
    const viewport = this._viewportRect;
    const isRtl = this._isRtl();
    let height, top, bottom;
    if (position.overlayY === "top") {
      top = origin.y;
      height = viewport.height - top + this._viewportMargin;
    } else if (position.overlayY === "bottom") {
      bottom = viewport.height - origin.y + this._viewportMargin * 2;
      height = viewport.height - bottom + this._viewportMargin;
    } else {
      const smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
      const previousHeight = this._lastBoundingBoxSize.height;
      height = smallestDistanceToViewportEdge * 2;
      top = origin.y - smallestDistanceToViewportEdge;
      if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {
        top = origin.y - previousHeight / 2;
      }
    }
    const isBoundedByRightViewportEdge = position.overlayX === "start" && !isRtl || position.overlayX === "end" && isRtl;
    const isBoundedByLeftViewportEdge = position.overlayX === "end" && !isRtl || position.overlayX === "start" && isRtl;
    let width, left, right;
    if (isBoundedByLeftViewportEdge) {
      right = viewport.width - origin.x + this._viewportMargin * 2;
      width = origin.x - this._viewportMargin;
    } else if (isBoundedByRightViewportEdge) {
      left = origin.x;
      width = viewport.right - origin.x;
    } else {
      const smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
      const previousWidth = this._lastBoundingBoxSize.width;
      width = smallestDistanceToViewportEdge * 2;
      left = origin.x - smallestDistanceToViewportEdge;
      if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {
        left = origin.x - previousWidth / 2;
      }
    }
    return {
      top,
      left,
      bottom,
      right,
      width,
      height
    };
  }
  /**
   * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
   * origin's connection point and stretches to the bounds of the viewport.
   *
   * @param origin The point on the origin element where the overlay is connected.
   * @param position The position preference
   */
  _setBoundingBoxStyles(origin, position) {
    const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);
    if (!this._isInitialRender && !this._growAfterOpen) {
      boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);
      boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
    }
    const styles = {};
    if (this._hasExactPosition()) {
      styles.top = styles.left = "0";
      styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = "";
      styles.width = styles.height = "100%";
    } else {
      const maxHeight = this._overlayRef.getConfig().maxHeight;
      const maxWidth = this._overlayRef.getConfig().maxWidth;
      styles.height = coerceCssPixelValue(boundingBoxRect.height);
      styles.top = coerceCssPixelValue(boundingBoxRect.top);
      styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);
      styles.width = coerceCssPixelValue(boundingBoxRect.width);
      styles.left = coerceCssPixelValue(boundingBoxRect.left);
      styles.right = coerceCssPixelValue(boundingBoxRect.right);
      if (position.overlayX === "center") {
        styles.alignItems = "center";
      } else {
        styles.alignItems = position.overlayX === "end" ? "flex-end" : "flex-start";
      }
      if (position.overlayY === "center") {
        styles.justifyContent = "center";
      } else {
        styles.justifyContent = position.overlayY === "bottom" ? "flex-end" : "flex-start";
      }
      if (maxHeight) {
        styles.maxHeight = coerceCssPixelValue(maxHeight);
      }
      if (maxWidth) {
        styles.maxWidth = coerceCssPixelValue(maxWidth);
      }
    }
    this._lastBoundingBoxSize = boundingBoxRect;
    extendStyles(this._boundingBox.style, styles);
  }
  /** Resets the styles for the bounding box so that a new positioning can be computed. */
  _resetBoundingBoxStyles() {
    extendStyles(this._boundingBox.style, {
      top: "0",
      left: "0",
      right: "0",
      bottom: "0",
      height: "",
      width: "",
      alignItems: "",
      justifyContent: ""
    });
  }
  /** Resets the styles for the overlay pane so that a new positioning can be computed. */
  _resetOverlayElementStyles() {
    extendStyles(this._pane.style, {
      top: "",
      left: "",
      bottom: "",
      right: "",
      position: "",
      transform: ""
    });
  }
  /** Sets positioning styles to the overlay element. */
  _setOverlayElementStyles(originPoint, position) {
    const styles = {};
    const hasExactPosition = this._hasExactPosition();
    const hasFlexibleDimensions = this._hasFlexibleDimensions;
    const config2 = this._overlayRef.getConfig();
    if (hasExactPosition) {
      const scrollPosition = this._viewportRuler.getViewportScrollPosition();
      extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));
      extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));
    } else {
      styles.position = "static";
    }
    let transformString = "";
    let offsetX = this._getOffset(position, "x");
    let offsetY = this._getOffset(position, "y");
    if (offsetX) {
      transformString += `translateX(${offsetX}px) `;
    }
    if (offsetY) {
      transformString += `translateY(${offsetY}px)`;
    }
    styles.transform = transformString.trim();
    if (config2.maxHeight) {
      if (hasExactPosition) {
        styles.maxHeight = coerceCssPixelValue(config2.maxHeight);
      } else if (hasFlexibleDimensions) {
        styles.maxHeight = "";
      }
    }
    if (config2.maxWidth) {
      if (hasExactPosition) {
        styles.maxWidth = coerceCssPixelValue(config2.maxWidth);
      } else if (hasFlexibleDimensions) {
        styles.maxWidth = "";
      }
    }
    extendStyles(this._pane.style, styles);
  }
  /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
  _getExactOverlayY(position, originPoint, scrollPosition) {
    let styles = {
      top: "",
      bottom: ""
    };
    let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
    if (this._isPushed) {
      overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
    }
    if (position.overlayY === "bottom") {
      const documentHeight = this._document.documentElement.clientHeight;
      styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;
    } else {
      styles.top = coerceCssPixelValue(overlayPoint.y);
    }
    return styles;
  }
  /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
  _getExactOverlayX(position, originPoint, scrollPosition) {
    let styles = {
      left: "",
      right: ""
    };
    let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
    if (this._isPushed) {
      overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
    }
    let horizontalStyleProperty;
    if (this._isRtl()) {
      horizontalStyleProperty = position.overlayX === "end" ? "left" : "right";
    } else {
      horizontalStyleProperty = position.overlayX === "end" ? "right" : "left";
    }
    if (horizontalStyleProperty === "right") {
      const documentWidth = this._document.documentElement.clientWidth;
      styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;
    } else {
      styles.left = coerceCssPixelValue(overlayPoint.x);
    }
    return styles;
  }
  /**
   * Gets the view properties of the trigger and overlay, including whether they are clipped
   * or completely outside the view of any of the strategy's scrollables.
   */
  _getScrollVisibility() {
    const originBounds = this._getOriginRect();
    const overlayBounds = this._pane.getBoundingClientRect();
    const scrollContainerBounds = this._scrollables.map((scrollable) => {
      return scrollable.getElementRef().nativeElement.getBoundingClientRect();
    });
    return {
      isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),
      isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),
      isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),
      isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds)
    };
  }
  /** Subtracts the amount that an element is overflowing on an axis from its length. */
  _subtractOverflows(length, ...overflows) {
    return overflows.reduce((currentValue, currentOverflow) => {
      return currentValue - Math.max(currentOverflow, 0);
    }, length);
  }
  /** Narrows the given viewport rect by the current _viewportMargin. */
  _getNarrowedViewportRect() {
    const width = this._document.documentElement.clientWidth;
    const height = this._document.documentElement.clientHeight;
    const scrollPosition = this._viewportRuler.getViewportScrollPosition();
    return {
      top: scrollPosition.top + this._viewportMargin,
      left: scrollPosition.left + this._viewportMargin,
      right: scrollPosition.left + width - this._viewportMargin,
      bottom: scrollPosition.top + height - this._viewportMargin,
      width: width - 2 * this._viewportMargin,
      height: height - 2 * this._viewportMargin
    };
  }
  /** Whether the we're dealing with an RTL context */
  _isRtl() {
    return this._overlayRef.getDirection() === "rtl";
  }
  /** Determines whether the overlay uses exact or flexible positioning. */
  _hasExactPosition() {
    return !this._hasFlexibleDimensions || this._isPushed;
  }
  /** Retrieves the offset of a position along the x or y axis. */
  _getOffset(position, axis) {
    if (axis === "x") {
      return position.offsetX == null ? this._offsetX : position.offsetX;
    }
    return position.offsetY == null ? this._offsetY : position.offsetY;
  }
  /** Validates that the current position match the expected values. */
  _validatePositions() {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (!this._preferredPositions.length) {
        throw Error("FlexibleConnectedPositionStrategy: At least one position is required.");
      }
      this._preferredPositions.forEach((pair) => {
        validateHorizontalPosition("originX", pair.originX);
        validateVerticalPosition("originY", pair.originY);
        validateHorizontalPosition("overlayX", pair.overlayX);
        validateVerticalPosition("overlayY", pair.overlayY);
      });
    }
  }
  /** Adds a single CSS class or an array of classes on the overlay panel. */
  _addPanelClasses(cssClasses) {
    if (this._pane) {
      coerceArray(cssClasses).forEach((cssClass) => {
        if (cssClass !== "" && this._appliedPanelClasses.indexOf(cssClass) === -1) {
          this._appliedPanelClasses.push(cssClass);
          this._pane.classList.add(cssClass);
        }
      });
    }
  }
  /** Clears the classes that the position strategy has applied from the overlay panel. */
  _clearPanelClasses() {
    if (this._pane) {
      this._appliedPanelClasses.forEach((cssClass) => {
        this._pane.classList.remove(cssClass);
      });
      this._appliedPanelClasses = [];
    }
  }
  /** Returns the DOMRect of the current origin. */
  _getOriginRect() {
    const origin = this._origin;
    if (origin instanceof ElementRef) {
      return origin.nativeElement.getBoundingClientRect();
    }
    if (origin instanceof Element) {
      return origin.getBoundingClientRect();
    }
    const width = origin.width || 0;
    const height = origin.height || 0;
    return {
      top: origin.y,
      bottom: origin.y + height,
      left: origin.x,
      right: origin.x + width,
      height,
      width
    };
  }
};
function extendStyles(destination, source) {
  for (let key in source) {
    if (source.hasOwnProperty(key)) {
      destination[key] = source[key];
    }
  }
  return destination;
}
function getPixelValue(input2) {
  if (typeof input2 !== "number" && input2 != null) {
    const [value, units] = input2.split(cssUnitPattern);
    return !units || units === "px" ? parseFloat(value) : null;
  }
  return input2 || null;
}
function getRoundedBoundingClientRect(clientRect) {
  return {
    top: Math.floor(clientRect.top),
    right: Math.floor(clientRect.right),
    bottom: Math.floor(clientRect.bottom),
    left: Math.floor(clientRect.left),
    width: Math.floor(clientRect.width),
    height: Math.floor(clientRect.height)
  };
}
function compareScrollVisibility(a, b) {
  if (a === b) {
    return true;
  }
  return a.isOriginClipped === b.isOriginClipped && a.isOriginOutsideView === b.isOriginOutsideView && a.isOverlayClipped === b.isOverlayClipped && a.isOverlayOutsideView === b.isOverlayOutsideView;
}
var wrapperClass = "cdk-global-overlay-wrapper";
var GlobalPositionStrategy = class {
  constructor() {
    this._cssPosition = "static";
    this._topOffset = "";
    this._bottomOffset = "";
    this._alignItems = "";
    this._xPosition = "";
    this._xOffset = "";
    this._width = "";
    this._height = "";
    this._isDisposed = false;
  }
  attach(overlayRef) {
    const config2 = overlayRef.getConfig();
    this._overlayRef = overlayRef;
    if (this._width && !config2.width) {
      overlayRef.updateSize({
        width: this._width
      });
    }
    if (this._height && !config2.height) {
      overlayRef.updateSize({
        height: this._height
      });
    }
    overlayRef.hostElement.classList.add(wrapperClass);
    this._isDisposed = false;
  }
  /**
   * Sets the top position of the overlay. Clears any previously set vertical position.
   * @param value New top offset.
   */
  top(value = "") {
    this._bottomOffset = "";
    this._topOffset = value;
    this._alignItems = "flex-start";
    return this;
  }
  /**
   * Sets the left position of the overlay. Clears any previously set horizontal position.
   * @param value New left offset.
   */
  left(value = "") {
    this._xOffset = value;
    this._xPosition = "left";
    return this;
  }
  /**
   * Sets the bottom position of the overlay. Clears any previously set vertical position.
   * @param value New bottom offset.
   */
  bottom(value = "") {
    this._topOffset = "";
    this._bottomOffset = value;
    this._alignItems = "flex-end";
    return this;
  }
  /**
   * Sets the right position of the overlay. Clears any previously set horizontal position.
   * @param value New right offset.
   */
  right(value = "") {
    this._xOffset = value;
    this._xPosition = "right";
    return this;
  }
  /**
   * Sets the overlay to the start of the viewport, depending on the overlay direction.
   * This will be to the left in LTR layouts and to the right in RTL.
   * @param offset Offset from the edge of the screen.
   */
  start(value = "") {
    this._xOffset = value;
    this._xPosition = "start";
    return this;
  }
  /**
   * Sets the overlay to the end of the viewport, depending on the overlay direction.
   * This will be to the right in LTR layouts and to the left in RTL.
   * @param offset Offset from the edge of the screen.
   */
  end(value = "") {
    this._xOffset = value;
    this._xPosition = "end";
    return this;
  }
  /**
   * Sets the overlay width and clears any previously set width.
   * @param value New width for the overlay
   * @deprecated Pass the `width` through the `OverlayConfig`.
   * @breaking-change 8.0.0
   */
  width(value = "") {
    if (this._overlayRef) {
      this._overlayRef.updateSize({
        width: value
      });
    } else {
      this._width = value;
    }
    return this;
  }
  /**
   * Sets the overlay height and clears any previously set height.
   * @param value New height for the overlay
   * @deprecated Pass the `height` through the `OverlayConfig`.
   * @breaking-change 8.0.0
   */
  height(value = "") {
    if (this._overlayRef) {
      this._overlayRef.updateSize({
        height: value
      });
    } else {
      this._height = value;
    }
    return this;
  }
  /**
   * Centers the overlay horizontally with an optional offset.
   * Clears any previously set horizontal position.
   *
   * @param offset Overlay offset from the horizontal center.
   */
  centerHorizontally(offset2 = "") {
    this.left(offset2);
    this._xPosition = "center";
    return this;
  }
  /**
   * Centers the overlay vertically with an optional offset.
   * Clears any previously set vertical position.
   *
   * @param offset Overlay offset from the vertical center.
   */
  centerVertically(offset2 = "") {
    this.top(offset2);
    this._alignItems = "center";
    return this;
  }
  /**
   * Apply the position to the element.
   * @docs-private
   */
  apply() {
    if (!this._overlayRef || !this._overlayRef.hasAttached()) {
      return;
    }
    const styles = this._overlayRef.overlayElement.style;
    const parentStyles = this._overlayRef.hostElement.style;
    const config2 = this._overlayRef.getConfig();
    const {
      width,
      height,
      maxWidth,
      maxHeight
    } = config2;
    const shouldBeFlushHorizontally = (width === "100%" || width === "100vw") && (!maxWidth || maxWidth === "100%" || maxWidth === "100vw");
    const shouldBeFlushVertically = (height === "100%" || height === "100vh") && (!maxHeight || maxHeight === "100%" || maxHeight === "100vh");
    const xPosition = this._xPosition;
    const xOffset = this._xOffset;
    const isRtl = this._overlayRef.getConfig().direction === "rtl";
    let marginLeft = "";
    let marginRight = "";
    let justifyContent = "";
    if (shouldBeFlushHorizontally) {
      justifyContent = "flex-start";
    } else if (xPosition === "center") {
      justifyContent = "center";
      if (isRtl) {
        marginRight = xOffset;
      } else {
        marginLeft = xOffset;
      }
    } else if (isRtl) {
      if (xPosition === "left" || xPosition === "end") {
        justifyContent = "flex-end";
        marginLeft = xOffset;
      } else if (xPosition === "right" || xPosition === "start") {
        justifyContent = "flex-start";
        marginRight = xOffset;
      }
    } else if (xPosition === "left" || xPosition === "start") {
      justifyContent = "flex-start";
      marginLeft = xOffset;
    } else if (xPosition === "right" || xPosition === "end") {
      justifyContent = "flex-end";
      marginRight = xOffset;
    }
    styles.position = this._cssPosition;
    styles.marginLeft = shouldBeFlushHorizontally ? "0" : marginLeft;
    styles.marginTop = shouldBeFlushVertically ? "0" : this._topOffset;
    styles.marginBottom = this._bottomOffset;
    styles.marginRight = shouldBeFlushHorizontally ? "0" : marginRight;
    parentStyles.justifyContent = justifyContent;
    parentStyles.alignItems = shouldBeFlushVertically ? "flex-start" : this._alignItems;
  }
  /**
   * Cleans up the DOM changes from the position strategy.
   * @docs-private
   */
  dispose() {
    if (this._isDisposed || !this._overlayRef) {
      return;
    }
    const styles = this._overlayRef.overlayElement.style;
    const parent = this._overlayRef.hostElement;
    const parentStyles = parent.style;
    parent.classList.remove(wrapperClass);
    parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop = styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = "";
    this._overlayRef = null;
    this._isDisposed = true;
  }
};
var _OverlayPositionBuilder = class _OverlayPositionBuilder {
  constructor(_viewportRuler, _document2, _platform, _overlayContainer) {
    this._viewportRuler = _viewportRuler;
    this._document = _document2;
    this._platform = _platform;
    this._overlayContainer = _overlayContainer;
  }
  /**
   * Creates a global position strategy.
   */
  global() {
    return new GlobalPositionStrategy();
  }
  /**
   * Creates a flexible position strategy.
   * @param origin Origin relative to which to position the overlay.
   */
  flexibleConnectedTo(origin) {
    return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
  }
};
_OverlayPositionBuilder.\u0275fac = function OverlayPositionBuilder_Factory(t) {
  return new (t || _OverlayPositionBuilder)(\u0275\u0275inject(ViewportRuler), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Platform), \u0275\u0275inject(OverlayContainer));
};
_OverlayPositionBuilder.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _OverlayPositionBuilder,
  factory: _OverlayPositionBuilder.\u0275fac,
  providedIn: "root"
});
var OverlayPositionBuilder = _OverlayPositionBuilder;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayPositionBuilder, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: ViewportRuler
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Platform
  }, {
    type: OverlayContainer
  }], null);
})();
var nextUniqueId3 = 0;
var _Overlay = class _Overlay {
  constructor(scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document2, _directionality, _location, _outsideClickDispatcher, _animationsModuleType) {
    this.scrollStrategies = scrollStrategies;
    this._overlayContainer = _overlayContainer;
    this._componentFactoryResolver = _componentFactoryResolver;
    this._positionBuilder = _positionBuilder;
    this._keyboardDispatcher = _keyboardDispatcher;
    this._injector = _injector;
    this._ngZone = _ngZone;
    this._document = _document2;
    this._directionality = _directionality;
    this._location = _location;
    this._outsideClickDispatcher = _outsideClickDispatcher;
    this._animationsModuleType = _animationsModuleType;
  }
  /**
   * Creates an overlay.
   * @param config Configuration applied to the overlay.
   * @returns Reference to the created overlay.
   */
  create(config2) {
    const host = this._createHostElement();
    const pane = this._createPaneElement(host);
    const portalOutlet = this._createPortalOutlet(pane);
    const overlayConfig = new OverlayConfig(config2);
    overlayConfig.direction = overlayConfig.direction || this._directionality.value;
    return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === "NoopAnimations", this._injector.get(EnvironmentInjector));
  }
  /**
   * Gets a position builder that can be used, via fluent API,
   * to construct and configure a position strategy.
   * @returns An overlay position builder.
   */
  position() {
    return this._positionBuilder;
  }
  /**
   * Creates the DOM element for an overlay and appends it to the overlay container.
   * @returns Newly-created pane element
   */
  _createPaneElement(host) {
    const pane = this._document.createElement("div");
    pane.id = `cdk-overlay-${nextUniqueId3++}`;
    pane.classList.add("cdk-overlay-pane");
    host.appendChild(pane);
    return pane;
  }
  /**
   * Creates the host element that wraps around an overlay
   * and can be used for advanced positioning.
   * @returns Newly-create host element.
   */
  _createHostElement() {
    const host = this._document.createElement("div");
    this._overlayContainer.getContainerElement().appendChild(host);
    return host;
  }
  /**
   * Create a DomPortalOutlet into which the overlay content can be loaded.
   * @param pane The DOM element to turn into a portal outlet.
   * @returns A portal outlet for the given DOM element.
   */
  _createPortalOutlet(pane) {
    if (!this._appRef) {
      this._appRef = this._injector.get(ApplicationRef);
    }
    return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
  }
};
_Overlay.\u0275fac = function Overlay_Factory(t) {
  return new (t || _Overlay)(\u0275\u0275inject(ScrollStrategyOptions), \u0275\u0275inject(OverlayContainer), \u0275\u0275inject(ComponentFactoryResolver$1), \u0275\u0275inject(OverlayPositionBuilder), \u0275\u0275inject(OverlayKeyboardDispatcher), \u0275\u0275inject(Injector), \u0275\u0275inject(NgZone), \u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Directionality), \u0275\u0275inject(Location), \u0275\u0275inject(OverlayOutsideClickDispatcher), \u0275\u0275inject(ANIMATION_MODULE_TYPE, 8));
};
_Overlay.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _Overlay,
  factory: _Overlay.\u0275fac,
  providedIn: "root"
});
var Overlay = _Overlay;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Overlay, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: ScrollStrategyOptions
  }, {
    type: OverlayContainer
  }, {
    type: ComponentFactoryResolver$1
  }, {
    type: OverlayPositionBuilder
  }, {
    type: OverlayKeyboardDispatcher
  }, {
    type: Injector
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Directionality
  }, {
    type: Location
  }, {
    type: OverlayOutsideClickDispatcher
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }, {
      type: Optional
    }]
  }], null);
})();
var defaultPositionList = [{
  originX: "start",
  originY: "bottom",
  overlayX: "start",
  overlayY: "top"
}, {
  originX: "start",
  originY: "top",
  overlayX: "start",
  overlayY: "bottom"
}, {
  originX: "end",
  originY: "top",
  overlayX: "end",
  overlayY: "bottom"
}, {
  originX: "end",
  originY: "bottom",
  overlayX: "end",
  overlayY: "top"
}];
var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken("cdk-connected-overlay-scroll-strategy", {
  providedIn: "root",
  factory: () => {
    const overlay = inject(Overlay);
    return () => overlay.scrollStrategies.reposition();
  }
});
var _CdkOverlayOrigin = class _CdkOverlayOrigin {
  constructor(elementRef) {
    this.elementRef = elementRef;
  }
};
_CdkOverlayOrigin.\u0275fac = function CdkOverlayOrigin_Factory(t) {
  return new (t || _CdkOverlayOrigin)(\u0275\u0275directiveInject(ElementRef));
};
_CdkOverlayOrigin.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkOverlayOrigin,
  selectors: [["", "cdk-overlay-origin", ""], ["", "overlay-origin", ""], ["", "cdkOverlayOrigin", ""]],
  exportAs: ["cdkOverlayOrigin"],
  standalone: true
});
var CdkOverlayOrigin = _CdkOverlayOrigin;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkOverlayOrigin, [{
    type: Directive,
    args: [{
      selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]",
      exportAs: "cdkOverlayOrigin",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }], null);
})();
var _CdkConnectedOverlay = class _CdkConnectedOverlay {
  /** The offset in pixels for the overlay connection point on the x-axis */
  get offsetX() {
    return this._offsetX;
  }
  set offsetX(offsetX) {
    this._offsetX = offsetX;
    if (this._position) {
      this._updatePositionStrategy(this._position);
    }
  }
  /** The offset in pixels for the overlay connection point on the y-axis */
  get offsetY() {
    return this._offsetY;
  }
  set offsetY(offsetY) {
    this._offsetY = offsetY;
    if (this._position) {
      this._updatePositionStrategy(this._position);
    }
  }
  /** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */
  get disposeOnNavigation() {
    return this._disposeOnNavigation;
  }
  set disposeOnNavigation(value) {
    this._disposeOnNavigation = value;
  }
  // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
  constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {
    this._overlay = _overlay;
    this._dir = _dir;
    this._backdropSubscription = Subscription.EMPTY;
    this._attachSubscription = Subscription.EMPTY;
    this._detachSubscription = Subscription.EMPTY;
    this._positionSubscription = Subscription.EMPTY;
    this._disposeOnNavigation = false;
    this._ngZone = inject(NgZone);
    this.viewportMargin = 0;
    this.open = false;
    this.disableClose = false;
    this.hasBackdrop = false;
    this.lockPosition = false;
    this.flexibleDimensions = false;
    this.growAfterOpen = false;
    this.push = false;
    this.backdropClick = new EventEmitter();
    this.positionChange = new EventEmitter();
    this.attach = new EventEmitter();
    this.detach = new EventEmitter();
    this.overlayKeydown = new EventEmitter();
    this.overlayOutsideClick = new EventEmitter();
    this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);
    this._scrollStrategyFactory = scrollStrategyFactory;
    this.scrollStrategy = this._scrollStrategyFactory();
  }
  /** The associated overlay reference. */
  get overlayRef() {
    return this._overlayRef;
  }
  /** The element's layout direction. */
  get dir() {
    return this._dir ? this._dir.value : "ltr";
  }
  ngOnDestroy() {
    this._attachSubscription.unsubscribe();
    this._detachSubscription.unsubscribe();
    this._backdropSubscription.unsubscribe();
    this._positionSubscription.unsubscribe();
    if (this._overlayRef) {
      this._overlayRef.dispose();
    }
  }
  ngOnChanges(changes) {
    if (this._position) {
      this._updatePositionStrategy(this._position);
      this._overlayRef.updateSize({
        width: this.width,
        minWidth: this.minWidth,
        height: this.height,
        minHeight: this.minHeight
      });
      if (changes["origin"] && this.open) {
        this._position.apply();
      }
    }
    if (changes["open"]) {
      this.open ? this._attachOverlay() : this._detachOverlay();
    }
  }
  /** Creates an overlay */
  _createOverlay() {
    if (!this.positions || !this.positions.length) {
      this.positions = defaultPositionList;
    }
    const overlayRef = this._overlayRef = this._overlay.create(this._buildConfig());
    this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());
    this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());
    overlayRef.keydownEvents().subscribe((event) => {
      this.overlayKeydown.next(event);
      if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {
        event.preventDefault();
        this._detachOverlay();
      }
    });
    this._overlayRef.outsidePointerEvents().subscribe((event) => {
      this.overlayOutsideClick.next(event);
    });
  }
  /** Builds the overlay config based on the directive's inputs */
  _buildConfig() {
    const positionStrategy = this._position = this.positionStrategy || this._createPositionStrategy();
    const overlayConfig = new OverlayConfig({
      direction: this._dir,
      positionStrategy,
      scrollStrategy: this.scrollStrategy,
      hasBackdrop: this.hasBackdrop,
      disposeOnNavigation: this.disposeOnNavigation
    });
    if (this.width || this.width === 0) {
      overlayConfig.width = this.width;
    }
    if (this.height || this.height === 0) {
      overlayConfig.height = this.height;
    }
    if (this.minWidth || this.minWidth === 0) {
      overlayConfig.minWidth = this.minWidth;
    }
    if (this.minHeight || this.minHeight === 0) {
      overlayConfig.minHeight = this.minHeight;
    }
    if (this.backdropClass) {
      overlayConfig.backdropClass = this.backdropClass;
    }
    if (this.panelClass) {
      overlayConfig.panelClass = this.panelClass;
    }
    return overlayConfig;
  }
  /** Updates the state of a position strategy, based on the values of the directive inputs. */
  _updatePositionStrategy(positionStrategy) {
    const positions = this.positions.map((currentPosition) => ({
      originX: currentPosition.originX,
      originY: currentPosition.originY,
      overlayX: currentPosition.overlayX,
      overlayY: currentPosition.overlayY,
      offsetX: currentPosition.offsetX || this.offsetX,
      offsetY: currentPosition.offsetY || this.offsetY,
      panelClass: currentPosition.panelClass || void 0
    }));
    return positionStrategy.setOrigin(this._getFlexibleConnectedPositionStrategyOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector);
  }
  /** Returns the position strategy of the overlay to be set on the overlay config */
  _createPositionStrategy() {
    const strategy = this._overlay.position().flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());
    this._updatePositionStrategy(strategy);
    return strategy;
  }
  _getFlexibleConnectedPositionStrategyOrigin() {
    if (this.origin instanceof CdkOverlayOrigin) {
      return this.origin.elementRef;
    } else {
      return this.origin;
    }
  }
  /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
  _attachOverlay() {
    if (!this._overlayRef) {
      this._createOverlay();
    } else {
      this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
    }
    if (!this._overlayRef.hasAttached()) {
      this._overlayRef.attach(this._templatePortal);
    }
    if (this.hasBackdrop) {
      this._backdropSubscription = this._overlayRef.backdropClick().subscribe((event) => {
        this.backdropClick.emit(event);
      });
    } else {
      this._backdropSubscription.unsubscribe();
    }
    this._positionSubscription.unsubscribe();
    if (this.positionChange.observers.length > 0) {
      this._positionSubscription = this._position.positionChanges.pipe(takeWhile(() => this.positionChange.observers.length > 0)).subscribe((position) => {
        this._ngZone.run(() => this.positionChange.emit(position));
        if (this.positionChange.observers.length === 0) {
          this._positionSubscription.unsubscribe();
        }
      });
    }
  }
  /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
  _detachOverlay() {
    if (this._overlayRef) {
      this._overlayRef.detach();
    }
    this._backdropSubscription.unsubscribe();
    this._positionSubscription.unsubscribe();
  }
};
_CdkConnectedOverlay.\u0275fac = function CdkConnectedOverlay_Factory(t) {
  return new (t || _CdkConnectedOverlay)(\u0275\u0275directiveInject(Overlay), \u0275\u0275directiveInject(TemplateRef), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY), \u0275\u0275directiveInject(Directionality, 8));
};
_CdkConnectedOverlay.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _CdkConnectedOverlay,
  selectors: [["", "cdk-connected-overlay", ""], ["", "connected-overlay", ""], ["", "cdkConnectedOverlay", ""]],
  inputs: {
    origin: [0, "cdkConnectedOverlayOrigin", "origin"],
    positions: [0, "cdkConnectedOverlayPositions", "positions"],
    positionStrategy: [0, "cdkConnectedOverlayPositionStrategy", "positionStrategy"],
    offsetX: [0, "cdkConnectedOverlayOffsetX", "offsetX"],
    offsetY: [0, "cdkConnectedOverlayOffsetY", "offsetY"],
    width: [0, "cdkConnectedOverlayWidth", "width"],
    height: [0, "cdkConnectedOverlayHeight", "height"],
    minWidth: [0, "cdkConnectedOverlayMinWidth", "minWidth"],
    minHeight: [0, "cdkConnectedOverlayMinHeight", "minHeight"],
    backdropClass: [0, "cdkConnectedOverlayBackdropClass", "backdropClass"],
    panelClass: [0, "cdkConnectedOverlayPanelClass", "panelClass"],
    viewportMargin: [0, "cdkConnectedOverlayViewportMargin", "viewportMargin"],
    scrollStrategy: [0, "cdkConnectedOverlayScrollStrategy", "scrollStrategy"],
    open: [0, "cdkConnectedOverlayOpen", "open"],
    disableClose: [0, "cdkConnectedOverlayDisableClose", "disableClose"],
    transformOriginSelector: [0, "cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"],
    hasBackdrop: [2, "cdkConnectedOverlayHasBackdrop", "hasBackdrop", booleanAttribute],
    lockPosition: [2, "cdkConnectedOverlayLockPosition", "lockPosition", booleanAttribute],
    flexibleDimensions: [2, "cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions", booleanAttribute],
    growAfterOpen: [2, "cdkConnectedOverlayGrowAfterOpen", "growAfterOpen", booleanAttribute],
    push: [2, "cdkConnectedOverlayPush", "push", booleanAttribute],
    disposeOnNavigation: [2, "cdkConnectedOverlayDisposeOnNavigation", "disposeOnNavigation", booleanAttribute]
  },
  outputs: {
    backdropClick: "backdropClick",
    positionChange: "positionChange",
    attach: "attach",
    detach: "detach",
    overlayKeydown: "overlayKeydown",
    overlayOutsideClick: "overlayOutsideClick"
  },
  exportAs: ["cdkConnectedOverlay"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275NgOnChangesFeature]
});
var CdkConnectedOverlay = _CdkConnectedOverlay;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CdkConnectedOverlay, [{
    type: Directive,
    args: [{
      selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]",
      exportAs: "cdkConnectedOverlay",
      standalone: true
    }]
  }], () => [{
    type: Overlay
  }, {
    type: TemplateRef
  }, {
    type: ViewContainerRef
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY]
    }]
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }], {
    origin: [{
      type: Input,
      args: ["cdkConnectedOverlayOrigin"]
    }],
    positions: [{
      type: Input,
      args: ["cdkConnectedOverlayPositions"]
    }],
    positionStrategy: [{
      type: Input,
      args: ["cdkConnectedOverlayPositionStrategy"]
    }],
    offsetX: [{
      type: Input,
      args: ["cdkConnectedOverlayOffsetX"]
    }],
    offsetY: [{
      type: Input,
      args: ["cdkConnectedOverlayOffsetY"]
    }],
    width: [{
      type: Input,
      args: ["cdkConnectedOverlayWidth"]
    }],
    height: [{
      type: Input,
      args: ["cdkConnectedOverlayHeight"]
    }],
    minWidth: [{
      type: Input,
      args: ["cdkConnectedOverlayMinWidth"]
    }],
    minHeight: [{
      type: Input,
      args: ["cdkConnectedOverlayMinHeight"]
    }],
    backdropClass: [{
      type: Input,
      args: ["cdkConnectedOverlayBackdropClass"]
    }],
    panelClass: [{
      type: Input,
      args: ["cdkConnectedOverlayPanelClass"]
    }],
    viewportMargin: [{
      type: Input,
      args: ["cdkConnectedOverlayViewportMargin"]
    }],
    scrollStrategy: [{
      type: Input,
      args: ["cdkConnectedOverlayScrollStrategy"]
    }],
    open: [{
      type: Input,
      args: ["cdkConnectedOverlayOpen"]
    }],
    disableClose: [{
      type: Input,
      args: ["cdkConnectedOverlayDisableClose"]
    }],
    transformOriginSelector: [{
      type: Input,
      args: ["cdkConnectedOverlayTransformOriginOn"]
    }],
    hasBackdrop: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayHasBackdrop",
        transform: booleanAttribute
      }]
    }],
    lockPosition: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayLockPosition",
        transform: booleanAttribute
      }]
    }],
    flexibleDimensions: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayFlexibleDimensions",
        transform: booleanAttribute
      }]
    }],
    growAfterOpen: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayGrowAfterOpen",
        transform: booleanAttribute
      }]
    }],
    push: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayPush",
        transform: booleanAttribute
      }]
    }],
    disposeOnNavigation: [{
      type: Input,
      args: [{
        alias: "cdkConnectedOverlayDisposeOnNavigation",
        transform: booleanAttribute
      }]
    }],
    backdropClick: [{
      type: Output
    }],
    positionChange: [{
      type: Output
    }],
    attach: [{
      type: Output
    }],
    detach: [{
      type: Output
    }],
    overlayKeydown: [{
      type: Output
    }],
    overlayOutsideClick: [{
      type: Output
    }]
  });
})();
function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
  return () => overlay.scrollStrategies.reposition();
}
var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
  provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY
};
var _OverlayModule = class _OverlayModule {
};
_OverlayModule.\u0275fac = function OverlayModule_Factory(t) {
  return new (t || _OverlayModule)();
};
_OverlayModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _OverlayModule
});
_OverlayModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER],
  imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule]
});
var OverlayModule = _OverlayModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OverlayModule, [{
    type: NgModule,
    args: [{
      imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],
      exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],
      providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER]
    }]
  }], null, null);
})();
var _FullscreenOverlayContainer = class _FullscreenOverlayContainer extends OverlayContainer {
  constructor(_document2, platform) {
    super(_document2, platform);
  }
  ngOnDestroy() {
    super.ngOnDestroy();
    if (this._fullScreenEventName && this._fullScreenListener) {
      this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);
    }
  }
  _createContainer() {
    super._createContainer();
    this._adjustParentForFullscreenChange();
    this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());
  }
  _adjustParentForFullscreenChange() {
    if (!this._containerElement) {
      return;
    }
    const fullscreenElement = this.getFullscreenElement();
    const parent = fullscreenElement || this._document.body;
    parent.appendChild(this._containerElement);
  }
  _addFullscreenChangeListener(fn) {
    const eventName = this._getEventName();
    if (eventName) {
      if (this._fullScreenListener) {
        this._document.removeEventListener(eventName, this._fullScreenListener);
      }
      this._document.addEventListener(eventName, fn);
      this._fullScreenListener = fn;
    }
  }
  _getEventName() {
    if (!this._fullScreenEventName) {
      const _document2 = this._document;
      if (_document2.fullscreenEnabled) {
        this._fullScreenEventName = "fullscreenchange";
      } else if (_document2.webkitFullscreenEnabled) {
        this._fullScreenEventName = "webkitfullscreenchange";
      } else if (_document2.mozFullScreenEnabled) {
        this._fullScreenEventName = "mozfullscreenchange";
      } else if (_document2.msFullscreenEnabled) {
        this._fullScreenEventName = "MSFullscreenChange";
      }
    }
    return this._fullScreenEventName;
  }
  /**
   * When the page is put into fullscreen mode, a specific element is specified.
   * Only that element and its children are visible when in fullscreen mode.
   */
  getFullscreenElement() {
    const _document2 = this._document;
    return _document2.fullscreenElement || _document2.webkitFullscreenElement || _document2.mozFullScreenElement || _document2.msFullscreenElement || null;
  }
};
_FullscreenOverlayContainer.\u0275fac = function FullscreenOverlayContainer_Factory(t) {
  return new (t || _FullscreenOverlayContainer)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(Platform));
};
_FullscreenOverlayContainer.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _FullscreenOverlayContainer,
  factory: _FullscreenOverlayContainer.\u0275fac,
  providedIn: "root"
});
var FullscreenOverlayContainer = _FullscreenOverlayContainer;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FullscreenOverlayContainer, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: Platform
  }], null);
})();

// node_modules/@angular/material/fesm2022/autocomplete.mjs
var _c04 = ["panel"];
var _c14 = ["*"];
function MatAutocomplete_ng_template_0_Template(rf, ctx) {
  if (rf & 1) {
    const _r1 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 1, 0);
    \u0275\u0275listener("@panelAnimation.done", function MatAutocomplete_ng_template_0_Template_div_animation_panelAnimation_done_0_listener($event) {
      \u0275\u0275restoreView(_r1);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1._animationDone.next($event));
    });
    \u0275\u0275projection(2);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const formFieldId_r3 = ctx.id;
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275classMap(ctx_r1._classList);
    \u0275\u0275classProp("mat-mdc-autocomplete-visible", ctx_r1.showPanel)("mat-mdc-autocomplete-hidden", !ctx_r1.showPanel)("mat-primary", ctx_r1._color === "primary")("mat-accent", ctx_r1._color === "accent")("mat-warn", ctx_r1._color === "warn");
    \u0275\u0275property("id", ctx_r1.id)("@panelAnimation", ctx_r1.isOpen ? "visible" : "hidden");
    \u0275\u0275attribute("aria-label", ctx_r1.ariaLabel || null)("aria-labelledby", ctx_r1._getPanelAriaLabelledby(formFieldId_r3));
  }
}
var panelAnimation = trigger("panelAnimation", [state("void, hidden", style({
  opacity: 0,
  transform: "scaleY(0.8)"
})), transition(":enter, hidden => visible", [group([animate("0.03s linear", style({
  opacity: 1
})), animate("0.12s cubic-bezier(0, 0, 0.2, 1)", style({
  transform: "scaleY(1)"
}))])]), transition(":leave, visible => hidden", [animate("0.075s linear", style({
  opacity: 0
}))])]);
var _uniqueAutocompleteIdCounter = 0;
var MatAutocompleteSelectedEvent = class {
  constructor(source, option) {
    this.source = source;
    this.option = option;
  }
};
var MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken("mat-autocomplete-default-options", {
  providedIn: "root",
  factory: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY
});
function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
  return {
    autoActiveFirstOption: false,
    autoSelectActiveOption: false,
    hideSingleSelectionIndicator: false,
    requireSelection: false
  };
}
var _MatAutocomplete = class _MatAutocomplete {
  /** Whether the autocomplete panel is open. */
  get isOpen() {
    return this._isOpen && this.showPanel;
  }
  /** @docs-private Sets the theme color of the panel. */
  _setColor(value) {
    this._color = value;
    this._changeDetectorRef.markForCheck();
  }
  /**
   * Takes classes set on the host mat-autocomplete element and applies them to the panel
   * inside the overlay container to allow for easy styling.
   */
  set classList(value) {
    this._classList = value;
    this._elementRef.nativeElement.className = "";
  }
  /** Whether checkmark indicator for single-selection options is hidden. */
  get hideSingleSelectionIndicator() {
    return this._hideSingleSelectionIndicator;
  }
  set hideSingleSelectionIndicator(value) {
    this._hideSingleSelectionIndicator = value;
    this._syncParentProperties();
  }
  /** Syncs the parent state with the individual options. */
  _syncParentProperties() {
    if (this.options) {
      for (const option of this.options) {
        option._changeDetectorRef.markForCheck();
      }
    }
  }
  constructor(_changeDetectorRef, _elementRef, _defaults, platform) {
    this._changeDetectorRef = _changeDetectorRef;
    this._elementRef = _elementRef;
    this._defaults = _defaults;
    this._activeOptionChanges = Subscription.EMPTY;
    this._animationDone = new EventEmitter();
    this.showPanel = false;
    this._isOpen = false;
    this.displayWith = null;
    this.optionSelected = new EventEmitter();
    this.opened = new EventEmitter();
    this.closed = new EventEmitter();
    this.optionActivated = new EventEmitter();
    this.id = `mat-autocomplete-${_uniqueAutocompleteIdCounter++}`;
    this.inertGroups = platform?.SAFARI || false;
    this.autoActiveFirstOption = !!_defaults.autoActiveFirstOption;
    this.autoSelectActiveOption = !!_defaults.autoSelectActiveOption;
    this.requireSelection = !!_defaults.requireSelection;
    this._hideSingleSelectionIndicator = this._defaults.hideSingleSelectionIndicator ?? false;
  }
  ngAfterContentInit() {
    this._keyManager = new ActiveDescendantKeyManager(this.options).withWrap().skipPredicate(this._skipPredicate);
    this._activeOptionChanges = this._keyManager.change.subscribe((index) => {
      if (this.isOpen) {
        this.optionActivated.emit({
          source: this,
          option: this.options.toArray()[index] || null
        });
      }
    });
    this._setVisibility();
  }
  ngOnDestroy() {
    this._keyManager?.destroy();
    this._activeOptionChanges.unsubscribe();
    this._animationDone.complete();
  }
  /**
   * Sets the panel scrollTop. This allows us to manually scroll to display options
   * above or below the fold, as they are not actually being focused when active.
   */
  _setScrollTop(scrollTop) {
    if (this.panel) {
      this.panel.nativeElement.scrollTop = scrollTop;
    }
  }
  /** Returns the panel's scrollTop. */
  _getScrollTop() {
    return this.panel ? this.panel.nativeElement.scrollTop : 0;
  }
  /** Panel should hide itself when the option list is empty. */
  _setVisibility() {
    this.showPanel = !!this.options.length;
    this._changeDetectorRef.markForCheck();
  }
  /** Emits the `select` event. */
  _emitSelectEvent(option) {
    const event = new MatAutocompleteSelectedEvent(this, option);
    this.optionSelected.emit(event);
  }
  /** Gets the aria-labelledby for the autocomplete panel. */
  _getPanelAriaLabelledby(labelId) {
    if (this.ariaLabel) {
      return null;
    }
    const labelExpression = labelId ? labelId + " " : "";
    return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;
  }
  // `skipPredicate` determines if key manager should avoid putting a given option in the tab
  // order. Allow disabled list items to receive focus via keyboard to align with WAI ARIA
  // recommendation.
  //
  // Normally WAI ARIA's instructions are to exclude disabled items from the tab order, but it
  // makes a few exceptions for compound widgets.
  //
  // From [Developing a Keyboard Interface](
  // https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/):
  //   "For the following composite widget elements, keep them focusable when disabled: Options in a
  //   Listbox..."
  //
  // The user can focus disabled options using the keyboard, but the user cannot click disabled
  // options.
  _skipPredicate() {
    return false;
  }
};
_MatAutocomplete.\u0275fac = function MatAutocomplete_Factory(t) {
  return new (t || _MatAutocomplete)(\u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS), \u0275\u0275directiveInject(Platform));
};
_MatAutocomplete.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatAutocomplete,
  selectors: [["mat-autocomplete"]],
  contentQueries: function MatAutocomplete_ContentQueries(rf, ctx, dirIndex) {
    if (rf & 1) {
      \u0275\u0275contentQuery(dirIndex, MatOption, 5);
      \u0275\u0275contentQuery(dirIndex, MAT_OPTGROUP, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.options = _t);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.optionGroups = _t);
    }
  },
  viewQuery: function MatAutocomplete_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(TemplateRef, 7);
      \u0275\u0275viewQuery(_c04, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.template = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.panel = _t.first);
    }
  },
  hostAttrs: [1, "mat-mdc-autocomplete"],
  inputs: {
    ariaLabel: [0, "aria-label", "ariaLabel"],
    ariaLabelledby: [0, "aria-labelledby", "ariaLabelledby"],
    displayWith: "displayWith",
    autoActiveFirstOption: [2, "autoActiveFirstOption", "autoActiveFirstOption", booleanAttribute],
    autoSelectActiveOption: [2, "autoSelectActiveOption", "autoSelectActiveOption", booleanAttribute],
    requireSelection: [2, "requireSelection", "requireSelection", booleanAttribute],
    panelWidth: "panelWidth",
    disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute],
    classList: [0, "class", "classList"],
    hideSingleSelectionIndicator: [2, "hideSingleSelectionIndicator", "hideSingleSelectionIndicator", booleanAttribute]
  },
  outputs: {
    optionSelected: "optionSelected",
    opened: "opened",
    closed: "closed",
    optionActivated: "optionActivated"
  },
  exportAs: ["matAutocomplete"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([{
    provide: MAT_OPTION_PARENT_COMPONENT,
    useExisting: _MatAutocomplete
  }]), \u0275\u0275InputTransformsFeature, \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c14,
  decls: 1,
  vars: 0,
  consts: [["panel", ""], ["role", "listbox", 1, "mat-mdc-autocomplete-panel", "mdc-menu-surface", "mdc-menu-surface--open", 3, "id"]],
  template: function MatAutocomplete_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275template(0, MatAutocomplete_ng_template_0_Template, 3, 16, "ng-template");
    }
  },
  styles: ["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],
  encapsulation: 2,
  data: {
    animation: [panelAnimation]
  },
  changeDetection: 0
});
var MatAutocomplete = _MatAutocomplete;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAutocomplete, [{
    type: Component,
    args: [{
      selector: "mat-autocomplete",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      exportAs: "matAutocomplete",
      host: {
        "class": "mat-mdc-autocomplete"
      },
      providers: [{
        provide: MAT_OPTION_PARENT_COMPONENT,
        useExisting: MatAutocomplete
      }],
      animations: [panelAnimation],
      standalone: true,
      template: `<ng-template let-formFieldId="id">
  <div
    class="mat-mdc-autocomplete-panel mdc-menu-surface mdc-menu-surface--open"
    role="listbox"
    [id]="id"
    [class]="_classList"
    [class.mat-mdc-autocomplete-visible]="showPanel"
    [class.mat-mdc-autocomplete-hidden]="!showPanel"
    [class.mat-primary]="_color === 'primary'"
    [class.mat-accent]="_color === 'accent'"
    [class.mat-warn]="_color === 'warn'"
    [attr.aria-label]="ariaLabel || null"
    [attr.aria-labelledby]="_getPanelAriaLabelledby(formFieldId)"
    [@panelAnimation]="isOpen ? 'visible' : 'hidden'"
    (@panelAnimation.done)="_animationDone.next($event)"
    #panel>
    <ng-content></ng-content>
  </div>
</ng-template>
`,
      styles: ["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"]
    }]
  }], () => [{
    type: ChangeDetectorRef
  }, {
    type: ElementRef
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [MAT_AUTOCOMPLETE_DEFAULT_OPTIONS]
    }]
  }, {
    type: Platform
  }], {
    template: [{
      type: ViewChild,
      args: [TemplateRef, {
        static: true
      }]
    }],
    panel: [{
      type: ViewChild,
      args: ["panel"]
    }],
    options: [{
      type: ContentChildren,
      args: [MatOption, {
        descendants: true
      }]
    }],
    optionGroups: [{
      type: ContentChildren,
      args: [MAT_OPTGROUP, {
        descendants: true
      }]
    }],
    ariaLabel: [{
      type: Input,
      args: ["aria-label"]
    }],
    ariaLabelledby: [{
      type: Input,
      args: ["aria-labelledby"]
    }],
    displayWith: [{
      type: Input
    }],
    autoActiveFirstOption: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    autoSelectActiveOption: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    requireSelection: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    panelWidth: [{
      type: Input
    }],
    disableRipple: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    optionSelected: [{
      type: Output
    }],
    opened: [{
      type: Output
    }],
    closed: [{
      type: Output
    }],
    optionActivated: [{
      type: Output
    }],
    classList: [{
      type: Input,
      args: ["class"]
    }],
    hideSingleSelectionIndicator: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }]
  });
})();
var _MatAutocompleteOrigin = class _MatAutocompleteOrigin {
  constructor(elementRef) {
    this.elementRef = elementRef;
  }
};
_MatAutocompleteOrigin.\u0275fac = function MatAutocompleteOrigin_Factory(t) {
  return new (t || _MatAutocompleteOrigin)(\u0275\u0275directiveInject(ElementRef));
};
_MatAutocompleteOrigin.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatAutocompleteOrigin,
  selectors: [["", "matAutocompleteOrigin", ""]],
  exportAs: ["matAutocompleteOrigin"],
  standalone: true
});
var MatAutocompleteOrigin = _MatAutocompleteOrigin;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAutocompleteOrigin, [{
    type: Directive,
    args: [{
      selector: "[matAutocompleteOrigin]",
      exportAs: "matAutocompleteOrigin",
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }], null);
})();
var MAT_AUTOCOMPLETE_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => MatAutocompleteTrigger),
  multi: true
};
function getMatAutocompleteMissingPanelError() {
  return Error("Attempting to open an undefined instance of `mat-autocomplete`. Make sure that the id passed to the `matAutocomplete` is correct and that you're attempting to open it after the ngAfterContentInit hook.");
}
var MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken("mat-autocomplete-scroll-strategy", {
  providedIn: "root",
  factory: () => {
    const overlay = inject(Overlay);
    return () => overlay.scrollStrategies.reposition();
  }
});
function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay) {
  return () => overlay.scrollStrategies.reposition();
}
var MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {
  provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY
};
var _MatAutocompleteTrigger = class _MatAutocompleteTrigger {
  constructor(_element, _overlay, _viewContainerRef, _zone, _changeDetectorRef, scrollStrategy, _dir, _formField, _document2, _viewportRuler, _defaults) {
    this._element = _element;
    this._overlay = _overlay;
    this._viewContainerRef = _viewContainerRef;
    this._zone = _zone;
    this._changeDetectorRef = _changeDetectorRef;
    this._dir = _dir;
    this._formField = _formField;
    this._document = _document2;
    this._viewportRuler = _viewportRuler;
    this._defaults = _defaults;
    this._componentDestroyed = false;
    this._manuallyFloatingLabel = false;
    this._viewportSubscription = Subscription.EMPTY;
    this._canOpenOnNextFocus = true;
    this._closeKeyEventStream = new Subject();
    this._windowBlurHandler = () => {
      this._canOpenOnNextFocus = this._document.activeElement !== this._element.nativeElement || this.panelOpen;
    };
    this._onChange = () => {
    };
    this._onTouched = () => {
    };
    this.position = "auto";
    this.autocompleteAttribute = "off";
    this._initialized = new Subject();
    this._injector = inject(Injector);
    this._aboveClass = "mat-mdc-autocomplete-panel-above";
    this._overlayAttached = false;
    this.optionSelections = defer(() => {
      const options = this.autocomplete ? this.autocomplete.options : null;
      if (options) {
        return options.changes.pipe(startWith(options), switchMap(() => merge(...options.map((option) => option.onSelectionChange))));
      }
      return this._initialized.pipe(switchMap(() => this.optionSelections));
    });
    this._handlePanelKeydown = (event) => {
      if (event.keyCode === ESCAPE && !hasModifierKey(event) || event.keyCode === UP_ARROW && hasModifierKey(event, "altKey")) {
        if (this._pendingAutoselectedOption) {
          this._updateNativeInputValue(this._valueBeforeAutoSelection ?? "");
          this._pendingAutoselectedOption = null;
        }
        this._closeKeyEventStream.next();
        this._resetActiveItem();
        event.stopPropagation();
        event.preventDefault();
      }
    };
    this._trackedModal = null;
    this._scrollStrategy = scrollStrategy;
  }
  ngAfterViewInit() {
    this._initialized.next();
    this._initialized.complete();
    const window2 = this._getWindow();
    if (typeof window2 !== "undefined") {
      this._zone.runOutsideAngular(() => window2.addEventListener("blur", this._windowBlurHandler));
    }
  }
  ngOnChanges(changes) {
    if (changes["position"] && this._positionStrategy) {
      this._setStrategyPositions(this._positionStrategy);
      if (this.panelOpen) {
        this._overlayRef.updatePosition();
      }
    }
  }
  ngOnDestroy() {
    const window2 = this._getWindow();
    if (typeof window2 !== "undefined") {
      window2.removeEventListener("blur", this._windowBlurHandler);
    }
    this._viewportSubscription.unsubscribe();
    this._componentDestroyed = true;
    this._destroyPanel();
    this._closeKeyEventStream.complete();
    this._clearFromModal();
  }
  /** Whether or not the autocomplete panel is open. */
  get panelOpen() {
    return this._overlayAttached && this.autocomplete.showPanel;
  }
  /** Opens the autocomplete suggestion panel. */
  openPanel() {
    this._openPanelInternal();
  }
  /** Closes the autocomplete suggestion panel. */
  closePanel() {
    this._resetLabel();
    if (!this._overlayAttached) {
      return;
    }
    if (this.panelOpen) {
      this._zone.run(() => {
        this.autocomplete.closed.emit();
      });
    }
    if (this.autocomplete._latestOpeningTrigger === this) {
      this.autocomplete._isOpen = false;
      this.autocomplete._latestOpeningTrigger = null;
    }
    this._overlayAttached = false;
    this._pendingAutoselectedOption = null;
    if (this._overlayRef && this._overlayRef.hasAttached()) {
      this._overlayRef.detach();
      this._closingActionsSubscription.unsubscribe();
    }
    this._updatePanelState();
    if (!this._componentDestroyed) {
      this._changeDetectorRef.detectChanges();
    }
    if (this._trackedModal) {
      removeAriaReferencedId(this._trackedModal, "aria-owns", this.autocomplete.id);
    }
  }
  /**
   * Updates the position of the autocomplete suggestion panel to ensure that it fits all options
   * within the viewport.
   */
  updatePosition() {
    if (this._overlayAttached) {
      this._overlayRef.updatePosition();
    }
  }
  /**
   * A stream of actions that should close the autocomplete panel, including
   * when an option is selected, on blur, and when TAB is pressed.
   */
  get panelClosingActions() {
    return merge(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)), this._closeKeyEventStream, this._getOutsideClickStream(), this._overlayRef ? this._overlayRef.detachments().pipe(filter(() => this._overlayAttached)) : of()).pipe(
      // Normalize the output so we return a consistent type.
      map((event) => event instanceof MatOptionSelectionChange ? event : null)
    );
  }
  /** The currently active option, coerced to MatOption type. */
  get activeOption() {
    if (this.autocomplete && this.autocomplete._keyManager) {
      return this.autocomplete._keyManager.activeItem;
    }
    return null;
  }
  /** Stream of clicks outside of the autocomplete panel. */
  _getOutsideClickStream() {
    return merge(fromEvent(this._document, "click"), fromEvent(this._document, "auxclick"), fromEvent(this._document, "touchend")).pipe(filter((event) => {
      const clickTarget = _getEventTarget(event);
      const formField = this._formField ? this._formField.getConnectedOverlayOrigin().nativeElement : null;
      const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;
      return this._overlayAttached && clickTarget !== this._element.nativeElement && // Normally focus moves inside `mousedown` so this condition will almost always be
      // true. Its main purpose is to handle the case where the input is focused from an
      // outside click which propagates up to the `body` listener within the same sequence
      // and causes the panel to close immediately (see #3106).
      this._document.activeElement !== this._element.nativeElement && (!formField || !formField.contains(clickTarget)) && (!customOrigin || !customOrigin.contains(clickTarget)) && !!this._overlayRef && !this._overlayRef.overlayElement.contains(clickTarget);
    }));
  }
  // Implemented as part of ControlValueAccessor.
  writeValue(value) {
    Promise.resolve(null).then(() => this._assignOptionValue(value));
  }
  // Implemented as part of ControlValueAccessor.
  registerOnChange(fn) {
    this._onChange = fn;
  }
  // Implemented as part of ControlValueAccessor.
  registerOnTouched(fn) {
    this._onTouched = fn;
  }
  // Implemented as part of ControlValueAccessor.
  setDisabledState(isDisabled) {
    this._element.nativeElement.disabled = isDisabled;
  }
  _handleKeydown(event) {
    const keyCode = event.keyCode;
    const hasModifier = hasModifierKey(event);
    if (keyCode === ESCAPE && !hasModifier) {
      event.preventDefault();
    }
    this._valueOnLastKeydown = this._element.nativeElement.value;
    if (this.activeOption && keyCode === ENTER && this.panelOpen && !hasModifier) {
      this.activeOption._selectViaInteraction();
      this._resetActiveItem();
      event.preventDefault();
    } else if (this.autocomplete) {
      const prevActiveItem = this.autocomplete._keyManager.activeItem;
      const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
      if (keyCode === TAB || isArrowKey && !hasModifier && this.panelOpen) {
        this.autocomplete._keyManager.onKeydown(event);
      } else if (isArrowKey && this._canOpen()) {
        this._openPanelInternal(this._valueOnLastKeydown);
      }
      if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {
        this._scrollToOption(this.autocomplete._keyManager.activeItemIndex || 0);
        if (this.autocomplete.autoSelectActiveOption && this.activeOption) {
          if (!this._pendingAutoselectedOption) {
            this._valueBeforeAutoSelection = this._valueOnLastKeydown;
          }
          this._pendingAutoselectedOption = this.activeOption;
          this._assignOptionValue(this.activeOption.value);
        }
      }
    }
  }
  _handleInput(event) {
    let target = event.target;
    let value = target.value;
    if (target.type === "number") {
      value = value == "" ? null : parseFloat(value);
    }
    if (this._previousValue !== value) {
      this._previousValue = value;
      this._pendingAutoselectedOption = null;
      if (!this.autocomplete || !this.autocomplete.requireSelection) {
        this._onChange(value);
      }
      if (!value) {
        this._clearPreviousSelectedOption(null, false);
      } else if (this.panelOpen && !this.autocomplete.requireSelection) {
        const selectedOption = this.autocomplete.options?.find((option) => option.selected);
        if (selectedOption) {
          const display = this._getDisplayValue(selectedOption.value);
          if (value !== display) {
            selectedOption.deselect(false);
          }
        }
      }
      if (this._canOpen() && this._document.activeElement === event.target) {
        const valueOnAttach = this._valueOnLastKeydown ?? this._element.nativeElement.value;
        this._valueOnLastKeydown = null;
        this._openPanelInternal(valueOnAttach);
      }
    }
  }
  _handleFocus() {
    if (!this._canOpenOnNextFocus) {
      this._canOpenOnNextFocus = true;
    } else if (this._canOpen()) {
      this._previousValue = this._element.nativeElement.value;
      this._attachOverlay(this._previousValue);
      this._floatLabel(true);
    }
  }
  _handleClick() {
    if (this._canOpen() && !this.panelOpen) {
      this._openPanelInternal();
    }
  }
  /**
   * In "auto" mode, the label will animate down as soon as focus is lost.
   * This causes the value to jump when selecting an option with the mouse.
   * This method manually floats the label until the panel can be closed.
   * @param shouldAnimate Whether the label should be animated when it is floated.
   */
  _floatLabel(shouldAnimate = false) {
    if (this._formField && this._formField.floatLabel === "auto") {
      if (shouldAnimate) {
        this._formField._animateAndLockLabel();
      } else {
        this._formField.floatLabel = "always";
      }
      this._manuallyFloatingLabel = true;
    }
  }
  /** If the label has been manually elevated, return it to its normal state. */
  _resetLabel() {
    if (this._manuallyFloatingLabel) {
      if (this._formField) {
        this._formField.floatLabel = "auto";
      }
      this._manuallyFloatingLabel = false;
    }
  }
  /**
   * This method listens to a stream of panel closing actions and resets the
   * stream every time the option list changes.
   */
  _subscribeToClosingActions() {
    const initialRender = new Observable((subscriber) => {
      afterNextRender(() => {
        subscriber.next();
      }, {
        injector: this._injector
      });
    });
    const optionChanges = this.autocomplete.options.changes.pipe(
      tap(() => this._positionStrategy.reapplyLastPosition()),
      // Defer emitting to the stream until the next tick, because changing
      // bindings in here will cause "changed after checked" errors.
      delay(0)
    );
    return merge(initialRender, optionChanges).pipe(
      // create a new stream of panelClosingActions, replacing any previous streams
      // that were created, and flatten it so our stream only emits closing events...
      switchMap(() => this._zone.run(() => {
        const wasOpen = this.panelOpen;
        this._resetActiveItem();
        this._updatePanelState();
        this._changeDetectorRef.detectChanges();
        if (this.panelOpen) {
          this._overlayRef.updatePosition();
        }
        if (wasOpen !== this.panelOpen) {
          if (this.panelOpen) {
            this._emitOpened();
          } else {
            this.autocomplete.closed.emit();
          }
        }
        return this.panelClosingActions;
      })),
      // when the first closing event occurs...
      take(1)
    ).subscribe((event) => this._setValueAndClose(event));
  }
  /**
   * Emits the opened event once it's known that the panel will be shown and stores
   * the state of the trigger right before the opening sequence was finished.
   */
  _emitOpened() {
    this.autocomplete.opened.emit();
  }
  /** Destroys the autocomplete suggestion panel. */
  _destroyPanel() {
    if (this._overlayRef) {
      this.closePanel();
      this._overlayRef.dispose();
      this._overlayRef = null;
    }
  }
  /** Given a value, returns the string that should be shown within the input. */
  _getDisplayValue(value) {
    const autocomplete = this.autocomplete;
    return autocomplete && autocomplete.displayWith ? autocomplete.displayWith(value) : value;
  }
  _assignOptionValue(value) {
    const toDisplay = this._getDisplayValue(value);
    if (value == null) {
      this._clearPreviousSelectedOption(null, false);
    }
    this._updateNativeInputValue(toDisplay != null ? toDisplay : "");
  }
  _updateNativeInputValue(value) {
    if (this._formField) {
      this._formField._control.value = value;
    } else {
      this._element.nativeElement.value = value;
    }
    this._previousValue = value;
  }
  /**
   * This method closes the panel, and if a value is specified, also sets the associated
   * control to that value. It will also mark the control as dirty if this interaction
   * stemmed from the user.
   */
  _setValueAndClose(event) {
    const panel = this.autocomplete;
    const toSelect = event ? event.source : this._pendingAutoselectedOption;
    if (toSelect) {
      this._clearPreviousSelectedOption(toSelect);
      this._assignOptionValue(toSelect.value);
      this._onChange(toSelect.value);
      panel._emitSelectEvent(toSelect);
      this._element.nativeElement.focus();
    } else if (panel.requireSelection && this._element.nativeElement.value !== this._valueOnAttach) {
      this._clearPreviousSelectedOption(null);
      this._assignOptionValue(null);
      if (panel._animationDone) {
        panel._animationDone.pipe(take(1)).subscribe(() => this._onChange(null));
      } else {
        this._onChange(null);
      }
    }
    this.closePanel();
  }
  /**
   * Clear any previous selected option and emit a selection change event for this option
   */
  _clearPreviousSelectedOption(skip2, emitEvent) {
    this.autocomplete?.options?.forEach((option) => {
      if (option !== skip2 && option.selected) {
        option.deselect(emitEvent);
      }
    });
  }
  _openPanelInternal(valueOnAttach = this._element.nativeElement.value) {
    this._attachOverlay(valueOnAttach);
    this._floatLabel();
    if (this._trackedModal) {
      const panelId = this.autocomplete.id;
      addAriaReferencedId(this._trackedModal, "aria-owns", panelId);
    }
  }
  _attachOverlay(valueOnAttach) {
    if (!this.autocomplete && (typeof ngDevMode === "undefined" || ngDevMode)) {
      throw getMatAutocompleteMissingPanelError();
    }
    let overlayRef = this._overlayRef;
    if (!overlayRef) {
      this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef, {
        id: this._formField?.getLabelId()
      });
      overlayRef = this._overlay.create(this._getOverlayConfig());
      this._overlayRef = overlayRef;
      this._viewportSubscription = this._viewportRuler.change().subscribe(() => {
        if (this.panelOpen && overlayRef) {
          overlayRef.updateSize({
            width: this._getPanelWidth()
          });
        }
      });
    } else {
      this._positionStrategy.setOrigin(this._getConnectedElement());
      overlayRef.updateSize({
        width: this._getPanelWidth()
      });
    }
    if (overlayRef && !overlayRef.hasAttached()) {
      overlayRef.attach(this._portal);
      this._valueOnAttach = valueOnAttach;
      this._valueOnLastKeydown = null;
      this._closingActionsSubscription = this._subscribeToClosingActions();
    }
    const wasOpen = this.panelOpen;
    this.autocomplete._isOpen = this._overlayAttached = true;
    this.autocomplete._latestOpeningTrigger = this;
    this.autocomplete._setColor(this._formField?.color);
    this._updatePanelState();
    this._applyModalPanelOwnership();
    if (this.panelOpen && wasOpen !== this.panelOpen) {
      this._emitOpened();
    }
  }
  /** Updates the panel's visibility state and any trigger state tied to id. */
  _updatePanelState() {
    this.autocomplete._setVisibility();
    if (this.panelOpen) {
      const overlayRef = this._overlayRef;
      if (!this._keydownSubscription) {
        this._keydownSubscription = overlayRef.keydownEvents().subscribe(this._handlePanelKeydown);
      }
      if (!this._outsideClickSubscription) {
        this._outsideClickSubscription = overlayRef.outsidePointerEvents().subscribe();
      }
    } else {
      this._keydownSubscription?.unsubscribe();
      this._outsideClickSubscription?.unsubscribe();
      this._keydownSubscription = this._outsideClickSubscription = null;
    }
  }
  _getOverlayConfig() {
    return new OverlayConfig({
      positionStrategy: this._getOverlayPosition(),
      scrollStrategy: this._scrollStrategy(),
      width: this._getPanelWidth(),
      direction: this._dir ?? void 0,
      panelClass: this._defaults?.overlayPanelClass
    });
  }
  _getOverlayPosition() {
    const strategy = this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(false).withPush(false);
    this._setStrategyPositions(strategy);
    this._positionStrategy = strategy;
    return strategy;
  }
  /** Sets the positions on a position strategy based on the directive's input state. */
  _setStrategyPositions(positionStrategy) {
    const belowPositions = [{
      originX: "start",
      originY: "bottom",
      overlayX: "start",
      overlayY: "top"
    }, {
      originX: "end",
      originY: "bottom",
      overlayX: "end",
      overlayY: "top"
    }];
    const panelClass = this._aboveClass;
    const abovePositions = [{
      originX: "start",
      originY: "top",
      overlayX: "start",
      overlayY: "bottom",
      panelClass
    }, {
      originX: "end",
      originY: "top",
      overlayX: "end",
      overlayY: "bottom",
      panelClass
    }];
    let positions;
    if (this.position === "above") {
      positions = abovePositions;
    } else if (this.position === "below") {
      positions = belowPositions;
    } else {
      positions = [...belowPositions, ...abovePositions];
    }
    positionStrategy.withPositions(positions);
  }
  _getConnectedElement() {
    if (this.connectedTo) {
      return this.connectedTo.elementRef;
    }
    return this._formField ? this._formField.getConnectedOverlayOrigin() : this._element;
  }
  _getPanelWidth() {
    return this.autocomplete.panelWidth || this._getHostWidth();
  }
  /** Returns the width of the input element, so the panel width can match it. */
  _getHostWidth() {
    return this._getConnectedElement().nativeElement.getBoundingClientRect().width;
  }
  /**
   * Reset the active item to -1. This is so that pressing arrow keys will activate the correct
   * option.
   *
   * If the consumer opted-in to automatically activatating the first option, activate the first
   * *enabled* option.
   */
  _resetActiveItem() {
    const autocomplete = this.autocomplete;
    if (autocomplete.autoActiveFirstOption) {
      let firstEnabledOptionIndex = -1;
      for (let index = 0; index < autocomplete.options.length; index++) {
        const option = autocomplete.options.get(index);
        if (!option.disabled) {
          firstEnabledOptionIndex = index;
          break;
        }
      }
      autocomplete._keyManager.setActiveItem(firstEnabledOptionIndex);
    } else {
      autocomplete._keyManager.setActiveItem(-1);
    }
  }
  /** Determines whether the panel can be opened. */
  _canOpen() {
    const element = this._element.nativeElement;
    return !element.readOnly && !element.disabled && !this.autocompleteDisabled;
  }
  /** Use defaultView of injected document if available or fallback to global window reference */
  _getWindow() {
    return this._document?.defaultView || window;
  }
  /** Scrolls to a particular option in the list. */
  _scrollToOption(index) {
    const autocomplete = this.autocomplete;
    const labelCount = _countGroupLabelsBeforeOption(index, autocomplete.options, autocomplete.optionGroups);
    if (index === 0 && labelCount === 1) {
      autocomplete._setScrollTop(0);
    } else if (autocomplete.panel) {
      const option = autocomplete.options.toArray()[index];
      if (option) {
        const element = option._getHostElement();
        const newScrollPosition = _getOptionScrollPosition(element.offsetTop, element.offsetHeight, autocomplete._getScrollTop(), autocomplete.panel.nativeElement.offsetHeight);
        autocomplete._setScrollTop(newScrollPosition);
      }
    }
  }
  /**
   * If the autocomplete trigger is inside of an `aria-modal` element, connect
   * that modal to the options panel with `aria-owns`.
   *
   * For some browser + screen reader combinations, when navigation is inside
   * of an `aria-modal` element, the screen reader treats everything outside
   * of that modal as hidden or invisible.
   *
   * This causes a problem when the combobox trigger is _inside_ of a modal, because the
   * options panel is rendered _outside_ of that modal, preventing screen reader navigation
   * from reaching the panel.
   *
   * We can work around this issue by applying `aria-owns` to the modal with the `id` of
   * the options panel. This effectively communicates to assistive technology that the
   * options panel is part of the same interaction as the modal.
   *
   * At time of this writing, this issue is present in VoiceOver.
   * See https://github.com/angular/components/issues/20694
   */
  _applyModalPanelOwnership() {
    const modal = this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');
    if (!modal) {
      return;
    }
    const panelId = this.autocomplete.id;
    if (this._trackedModal) {
      removeAriaReferencedId(this._trackedModal, "aria-owns", panelId);
    }
    addAriaReferencedId(modal, "aria-owns", panelId);
    this._trackedModal = modal;
  }
  /** Clears the references to the listbox overlay element from the modal it was added to. */
  _clearFromModal() {
    if (this._trackedModal) {
      const panelId = this.autocomplete.id;
      removeAriaReferencedId(this._trackedModal, "aria-owns", panelId);
      this._trackedModal = null;
    }
  }
};
_MatAutocompleteTrigger.\u0275fac = function MatAutocompleteTrigger_Factory(t) {
  return new (t || _MatAutocompleteTrigger)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Overlay), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY), \u0275\u0275directiveInject(Directionality, 8), \u0275\u0275directiveInject(MAT_FORM_FIELD, 9), \u0275\u0275directiveInject(DOCUMENT2, 8), \u0275\u0275directiveInject(ViewportRuler), \u0275\u0275directiveInject(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, 8));
};
_MatAutocompleteTrigger.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatAutocompleteTrigger,
  selectors: [["input", "matAutocomplete", ""], ["textarea", "matAutocomplete", ""]],
  hostAttrs: [1, "mat-mdc-autocomplete-trigger"],
  hostVars: 7,
  hostBindings: function MatAutocompleteTrigger_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("focusin", function MatAutocompleteTrigger_focusin_HostBindingHandler() {
        return ctx._handleFocus();
      })("blur", function MatAutocompleteTrigger_blur_HostBindingHandler() {
        return ctx._onTouched();
      })("input", function MatAutocompleteTrigger_input_HostBindingHandler($event) {
        return ctx._handleInput($event);
      })("keydown", function MatAutocompleteTrigger_keydown_HostBindingHandler($event) {
        return ctx._handleKeydown($event);
      })("click", function MatAutocompleteTrigger_click_HostBindingHandler() {
        return ctx._handleClick();
      });
    }
    if (rf & 2) {
      \u0275\u0275attribute("autocomplete", ctx.autocompleteAttribute)("role", ctx.autocompleteDisabled ? null : "combobox")("aria-autocomplete", ctx.autocompleteDisabled ? null : "list")("aria-activedescendant", ctx.panelOpen && ctx.activeOption ? ctx.activeOption.id : null)("aria-expanded", ctx.autocompleteDisabled ? null : ctx.panelOpen.toString())("aria-controls", ctx.autocompleteDisabled || !ctx.panelOpen ? null : ctx.autocomplete == null ? null : ctx.autocomplete.id)("aria-haspopup", ctx.autocompleteDisabled ? null : "listbox");
    }
  },
  inputs: {
    autocomplete: [0, "matAutocomplete", "autocomplete"],
    position: [0, "matAutocompletePosition", "position"],
    connectedTo: [0, "matAutocompleteConnectedTo", "connectedTo"],
    autocompleteAttribute: [0, "autocomplete", "autocompleteAttribute"],
    autocompleteDisabled: [2, "matAutocompleteDisabled", "autocompleteDisabled", booleanAttribute]
  },
  exportAs: ["matAutocompleteTrigger"],
  standalone: true,
  features: [\u0275\u0275ProvidersFeature([MAT_AUTOCOMPLETE_VALUE_ACCESSOR]), \u0275\u0275InputTransformsFeature, \u0275\u0275NgOnChangesFeature]
});
var MatAutocompleteTrigger = _MatAutocompleteTrigger;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAutocompleteTrigger, [{
    type: Directive,
    args: [{
      selector: `input[matAutocomplete], textarea[matAutocomplete]`,
      host: {
        "class": "mat-mdc-autocomplete-trigger",
        "[attr.autocomplete]": "autocompleteAttribute",
        "[attr.role]": 'autocompleteDisabled ? null : "combobox"',
        "[attr.aria-autocomplete]": 'autocompleteDisabled ? null : "list"',
        "[attr.aria-activedescendant]": "(panelOpen && activeOption) ? activeOption.id : null",
        "[attr.aria-expanded]": "autocompleteDisabled ? null : panelOpen.toString()",
        "[attr.aria-controls]": "(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id",
        "[attr.aria-haspopup]": 'autocompleteDisabled ? null : "listbox"',
        // Note: we use `focusin`, as opposed to `focus`, in order to open the panel
        // a little earlier. This avoids issues where IE delays the focusing of the input.
        "(focusin)": "_handleFocus()",
        "(blur)": "_onTouched()",
        "(input)": "_handleInput($event)",
        "(keydown)": "_handleKeydown($event)",
        "(click)": "_handleClick()"
      },
      exportAs: "matAutocompleteTrigger",
      providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR],
      standalone: true
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Overlay
  }, {
    type: ViewContainerRef
  }, {
    type: NgZone
  }, {
    type: ChangeDetectorRef
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY]
    }]
  }, {
    type: Directionality,
    decorators: [{
      type: Optional
    }]
  }, {
    type: MatFormField,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FORM_FIELD]
    }, {
      type: Host
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: ViewportRuler
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_AUTOCOMPLETE_DEFAULT_OPTIONS]
    }]
  }], {
    autocomplete: [{
      type: Input,
      args: ["matAutocomplete"]
    }],
    position: [{
      type: Input,
      args: ["matAutocompletePosition"]
    }],
    connectedTo: [{
      type: Input,
      args: ["matAutocompleteConnectedTo"]
    }],
    autocompleteAttribute: [{
      type: Input,
      args: ["autocomplete"]
    }],
    autocompleteDisabled: [{
      type: Input,
      args: [{
        alias: "matAutocompleteDisabled",
        transform: booleanAttribute
      }]
    }]
  });
})();
var _MatAutocompleteModule = class _MatAutocompleteModule {
};
_MatAutocompleteModule.\u0275fac = function MatAutocompleteModule_Factory(t) {
  return new (t || _MatAutocompleteModule)();
};
_MatAutocompleteModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatAutocompleteModule
});
_MatAutocompleteModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER],
  imports: [OverlayModule, MatOptionModule, MatCommonModule, CommonModule, CdkScrollableModule, MatOptionModule, MatCommonModule]
});
var MatAutocompleteModule = _MatAutocompleteModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAutocompleteModule, [{
    type: NgModule,
    args: [{
      imports: [OverlayModule, MatOptionModule, MatCommonModule, CommonModule, MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteOrigin],
      exports: [CdkScrollableModule, MatAutocomplete, MatOptionModule, MatCommonModule, MatAutocompleteTrigger, MatAutocompleteOrigin],
      providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER]
    }]
  }], null, null);
})();

// node_modules/@angular/material/fesm2022/button.mjs
var _c05 = ["mat-button", ""];
var _c15 = [[["", 8, "material-icons", 3, "iconPositionEnd", ""], ["mat-icon", 3, "iconPositionEnd", ""], ["", "matButtonIcon", "", 3, "iconPositionEnd", ""]], "*", [["", "iconPositionEnd", "", 8, "material-icons"], ["mat-icon", "iconPositionEnd", ""], ["", "matButtonIcon", "", "iconPositionEnd", ""]]];
var _c23 = [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"];
var _c33 = '.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0)}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__progress-indicator{font-size:0;position:absolute;transform:translate(-50%, -50%);top:50%;left:50%;line-height:initial}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px);display:none}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring{border-color:CanvasText}}.mdc-button .mdc-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring::after{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{display:block}}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button{font-family:var(--mdc-text-button-label-text-font);font-size:var(--mdc-text-button-label-text-size);letter-spacing:var(--mdc-text-button-label-text-tracking);font-weight:var(--mdc-text-button-label-text-weight);text-transform:var(--mdc-text-button-label-text-transform);height:var(--mdc-text-button-container-height);border-radius:var(--mdc-text-button-container-shape);padding:0 var(--mat-text-button-horizontal-padding, 8px)}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color)}.mat-mdc-button:disabled{color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape)}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 8px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color)}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color)}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color)}.mat-mdc-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity)}.mat-mdc-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity)}.mat-mdc-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity)}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display)}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-unelevated-button{font-family:var(--mdc-filled-button-label-text-font);font-size:var(--mdc-filled-button-label-text-size);letter-spacing:var(--mdc-filled-button-label-text-tracking);font-weight:var(--mdc-filled-button-label-text-weight);text-transform:var(--mdc-filled-button-label-text-transform);height:var(--mdc-filled-button-container-height);border-radius:var(--mdc-filled-button-container-shape);padding:0 var(--mat-filled-button-horizontal-padding, 16px)}.mat-mdc-unelevated-button:not(:disabled){background-color:var(--mdc-filled-button-container-color)}.mat-mdc-unelevated-button:disabled{background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color)}.mat-mdc-unelevated-button:disabled{color:var(--mdc-filled-button-disabled-label-text-color)}.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color)}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color)}.mat-mdc-unelevated-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity)}.mat-mdc-unelevated-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity)}.mat-mdc-unelevated-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity)}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display)}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color);background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{font-family:var(--mdc-protected-button-label-text-font);font-size:var(--mdc-protected-button-label-text-size);letter-spacing:var(--mdc-protected-button-label-text-tracking);font-weight:var(--mdc-protected-button-label-text-weight);text-transform:var(--mdc-protected-button-label-text-transform);height:var(--mdc-protected-button-container-height);border-radius:var(--mdc-protected-button-container-shape);padding:0 var(--mat-protected-button-horizontal-padding, 16px);box-shadow:var(--mdc-protected-button-container-elevation-shadow)}.mat-mdc-raised-button:not(:disabled){background-color:var(--mdc-protected-button-container-color)}.mat-mdc-raised-button:disabled{background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color)}.mat-mdc-raised-button:disabled{color:var(--mdc-protected-button-disabled-label-text-color)}.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color)}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color)}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color)}.mat-mdc-raised-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity)}.mat-mdc-raised-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity)}.mat-mdc-raised-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity)}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display)}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow)}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow)}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow)}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color);background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow)}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{font-family:var(--mdc-outlined-button-label-text-font);font-size:var(--mdc-outlined-button-label-text-size);letter-spacing:var(--mdc-outlined-button-label-text-tracking);font-weight:var(--mdc-outlined-button-label-text-weight);text-transform:var(--mdc-outlined-button-label-text-transform);height:var(--mdc-outlined-button-container-height);border-radius:var(--mdc-outlined-button-container-shape);padding:0 15px 0 15px;border-width:var(--mdc-outlined-button-outline-width);padding:0 var(--mat-outlined-button-horizontal-padding, 15px)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color)}.mat-mdc-outlined-button:disabled{color:var(--mdc-outlined-button-disabled-label-text-color)}.mat-mdc-outlined-button .mdc-button__ripple{border-radius:var(--mdc-outlined-button-container-shape)}.mat-mdc-outlined-button:not(:disabled){border-color:var(--mdc-outlined-button-outline-color)}.mat-mdc-outlined-button:disabled{border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mdc-button--icon-trailing{padding:0 11px 0 15px}.mat-mdc-outlined-button.mdc-button--icon-leading{padding:0 15px 0 11px}.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:var(--mdc-outlined-button-outline-width)}.mat-mdc-outlined-button .mdc-button__touch{left:calc(-1 * var(--mdc-outlined-button-outline-width));width:calc(100% + 2 * var(--mdc-outlined-button-outline-width))}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color)}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color)}.mat-mdc-outlined-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity)}.mat-mdc-outlined-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity)}.mat-mdc-outlined-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity)}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display)}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color);border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button-base{text-decoration:none}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-outlined-button .mdc-button__label{z-index:1}.mat-mdc-button .mat-mdc-focus-indicator,.mat-mdc-unelevated-button .mat-mdc-focus-indicator,.mat-mdc-raised-button .mat-mdc-focus-indicator,.mat-mdc-outlined-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-unelevated-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-raised-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-outlined-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:-1px}.mat-mdc-unelevated-button .mat-mdc-focus-indicator::before,.mat-mdc-raised-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 3px)*-1)}';
var _c43 = ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}";
var _c53 = ["mat-fab", ""];
var _c63 = ["mat-mini-fab", ""];
var _c72 = '.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}';
var _c8 = ["mat-icon-button", ""];
var _c9 = ["*"];
var _c10 = '.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block}}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button[hidden]{display:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%;display:none}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring{border-color:CanvasText}}.mdc-icon-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mat-mdc-icon-button{color:var(--mdc-icon-button-icon-color)}.mat-mdc-icon-button .mdc-button__icon{font-size:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button svg,.mat-mdc-icon-button img{width:var(--mdc-icon-button-icon-size);height:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button:disabled{color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button{border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 48px);height:var(--mdc-icon-button-state-layer-size, 48px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 48px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size);-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button svg{vertical-align:baseline}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label{z-index:1}.mat-mdc-icon-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color)}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color)}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color)}.mat-mdc-icon-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}.mat-mdc-icon-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity)}.mat-mdc-icon-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}';
var MAT_BUTTON_CONFIG = new InjectionToken("MAT_BUTTON_CONFIG");
var MAT_BUTTON_HOST = {
  "[attr.disabled]": "_getDisabledAttribute()",
  "[attr.aria-disabled]": "_getAriaDisabled()",
  "[class.mat-mdc-button-disabled]": "disabled",
  "[class.mat-mdc-button-disabled-interactive]": "disabledInteractive",
  "[class._mat-animation-noopable]": '_animationMode === "NoopAnimations"',
  // MDC automatically applies the primary theme color to the button, but we want to support
  // an unthemed version. If color is undefined, apply a CSS class that makes it easy to
  // select and style this "theme".
  "[class.mat-unthemed]": "!color",
  // Add a class that applies to all buttons. This makes it easier to target if somebody
  // wants to target all Material buttons.
  "[class.mat-mdc-button-base]": "true",
  "[class]": 'color ? "mat-" + color : ""'
};
var HOST_SELECTOR_MDC_CLASS_PAIR = [{
  attribute: "mat-button",
  mdcClasses: ["mdc-button", "mat-mdc-button"]
}, {
  attribute: "mat-flat-button",
  mdcClasses: ["mdc-button", "mdc-button--unelevated", "mat-mdc-unelevated-button"]
}, {
  attribute: "mat-raised-button",
  mdcClasses: ["mdc-button", "mdc-button--raised", "mat-mdc-raised-button"]
}, {
  attribute: "mat-stroked-button",
  mdcClasses: ["mdc-button", "mdc-button--outlined", "mat-mdc-outlined-button"]
}, {
  attribute: "mat-fab",
  mdcClasses: ["mdc-fab", "mat-mdc-fab"]
}, {
  attribute: "mat-mini-fab",
  mdcClasses: ["mdc-fab", "mdc-fab--mini", "mat-mdc-mini-fab"]
}, {
  attribute: "mat-icon-button",
  mdcClasses: ["mdc-icon-button", "mat-mdc-icon-button"]
}];
var _MatButtonBase = class _MatButtonBase {
  /**
   * Reference to the MatRipple instance of the button.
   * @deprecated Considered an implementation detail. To be removed.
   * @breaking-change 17.0.0
   */
  get ripple() {
    return this._rippleLoader?.getRipple(this._elementRef.nativeElement);
  }
  set ripple(v) {
    this._rippleLoader?.attachRipple(this._elementRef.nativeElement, v);
  }
  /** Whether the ripple effect is disabled or not. */
  get disableRipple() {
    return this._disableRipple;
  }
  set disableRipple(value) {
    this._disableRipple = value;
    this._updateRippleDisabled();
  }
  /** Whether the button is disabled. */
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    this._disabled = value;
    this._updateRippleDisabled();
  }
  constructor(_elementRef, _platform, _ngZone, _animationMode) {
    this._elementRef = _elementRef;
    this._platform = _platform;
    this._ngZone = _ngZone;
    this._animationMode = _animationMode;
    this._focusMonitor = inject(FocusMonitor);
    this._rippleLoader = inject(MatRippleLoader);
    this._isFab = false;
    this._disableRipple = false;
    this._disabled = false;
    const config2 = inject(MAT_BUTTON_CONFIG, {
      optional: true
    });
    const element = _elementRef.nativeElement;
    const classList = element.classList;
    this.disabledInteractive = config2?.disabledInteractive ?? false;
    this._rippleLoader?.configureRipple(element, {
      className: "mat-mdc-button-ripple"
    });
    for (const {
      attribute,
      mdcClasses
    } of HOST_SELECTOR_MDC_CLASS_PAIR) {
      if (element.hasAttribute(attribute)) {
        classList.add(...mdcClasses);
      }
    }
  }
  ngAfterViewInit() {
    this._focusMonitor.monitor(this._elementRef, true);
  }
  ngOnDestroy() {
    this._focusMonitor.stopMonitoring(this._elementRef);
    this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);
  }
  /** Focuses the button. */
  focus(origin = "program", options) {
    if (origin) {
      this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);
    } else {
      this._elementRef.nativeElement.focus(options);
    }
  }
  _getAriaDisabled() {
    if (this.ariaDisabled != null) {
      return this.ariaDisabled;
    }
    return this.disabled && this.disabledInteractive ? true : null;
  }
  _getDisabledAttribute() {
    return this.disabledInteractive || !this.disabled ? null : true;
  }
  _updateRippleDisabled() {
    this._rippleLoader?.setDisabled(this._elementRef.nativeElement, this.disableRipple || this.disabled);
  }
};
_MatButtonBase.\u0275fac = function MatButtonBase_Factory(t) {
  \u0275\u0275invalidFactory();
};
_MatButtonBase.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatButtonBase,
  inputs: {
    color: "color",
    disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute],
    disabled: [2, "disabled", "disabled", booleanAttribute],
    ariaDisabled: [2, "aria-disabled", "ariaDisabled", booleanAttribute],
    disabledInteractive: [2, "disabledInteractive", "disabledInteractive", booleanAttribute]
  },
  features: [\u0275\u0275InputTransformsFeature]
});
var MatButtonBase = _MatButtonBase;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButtonBase, [{
    type: Directive
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0
  }], {
    color: [{
      type: Input
    }],
    disableRipple: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    disabled: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    ariaDisabled: [{
      type: Input,
      args: [{
        transform: booleanAttribute,
        alias: "aria-disabled"
      }]
    }],
    disabledInteractive: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }]
  });
})();
var MAT_ANCHOR_HOST = {
  "[attr.disabled]": "_getDisabledAttribute()",
  "[class.mat-mdc-button-disabled]": "disabled",
  "[class.mat-mdc-button-disabled-interactive]": "disabledInteractive",
  "[class._mat-animation-noopable]": '_animationMode === "NoopAnimations"',
  // Note that we ignore the user-specified tabindex when it's disabled for
  // consistency with the `mat-button` applied on native buttons where even
  // though they have an index, they're not tabbable.
  "[attr.tabindex]": "disabled && !disabledInteractive ? -1 : tabIndex",
  "[attr.aria-disabled]": "_getDisabledAttribute()",
  // MDC automatically applies the primary theme color to the button, but we want to support
  // an unthemed version. If color is undefined, apply a CSS class that makes it easy to
  // select and style this "theme".
  "[class.mat-unthemed]": "!color",
  // Add a class that applies to all buttons. This makes it easier to target if somebody
  // wants to target all Material buttons.
  "[class.mat-mdc-button-base]": "true",
  "[class]": 'color ? "mat-" + color : ""'
};
var _MatAnchorBase = class _MatAnchorBase extends MatButtonBase {
  constructor(elementRef, platform, ngZone, animationMode) {
    super(elementRef, platform, ngZone, animationMode);
    this._haltDisabledEvents = (event) => {
      if (this.disabled) {
        event.preventDefault();
        event.stopImmediatePropagation();
      }
    };
  }
  ngOnInit() {
    this._ngZone.runOutsideAngular(() => {
      this._elementRef.nativeElement.addEventListener("click", this._haltDisabledEvents);
    });
  }
  ngOnDestroy() {
    super.ngOnDestroy();
    this._elementRef.nativeElement.removeEventListener("click", this._haltDisabledEvents);
  }
  _getAriaDisabled() {
    return this.ariaDisabled == null ? this.disabled : this.ariaDisabled;
  }
};
_MatAnchorBase.\u0275fac = function MatAnchorBase_Factory(t) {
  \u0275\u0275invalidFactory();
};
_MatAnchorBase.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatAnchorBase,
  inputs: {
    tabIndex: [2, "tabIndex", "tabIndex", (value) => {
      return value == null ? void 0 : numberAttribute(value);
    }]
  },
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275InheritDefinitionFeature]
});
var MatAnchorBase = _MatAnchorBase;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAnchorBase, [{
    type: Directive
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0
  }], {
    tabIndex: [{
      type: Input,
      args: [{
        transform: (value) => {
          return value == null ? void 0 : numberAttribute(value);
        }
      }]
    }]
  });
})();
var _MatButton = class _MatButton extends MatButtonBase {
  constructor(elementRef, platform, ngZone, animationMode) {
    super(elementRef, platform, ngZone, animationMode);
  }
};
_MatButton.\u0275fac = function MatButton_Factory(t) {
  return new (t || _MatButton)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatButton.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatButton,
  selectors: [["button", "mat-button", ""], ["button", "mat-raised-button", ""], ["button", "mat-flat-button", ""], ["button", "mat-stroked-button", ""]],
  hostVars: 14,
  hostBindings: function MatButton_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("aria-disabled", ctx._getAriaDisabled());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c05,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatButton_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0)}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__progress-indicator{font-size:0;position:absolute;transform:translate(-50%, -50%);top:50%;left:50%;line-height:initial}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px);display:none}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring{border-color:CanvasText}}.mdc-button .mdc-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring::after{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{display:block}}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button{font-family:var(--mdc-text-button-label-text-font);font-size:var(--mdc-text-button-label-text-size);letter-spacing:var(--mdc-text-button-label-text-tracking);font-weight:var(--mdc-text-button-label-text-weight);text-transform:var(--mdc-text-button-label-text-transform);height:var(--mdc-text-button-container-height);border-radius:var(--mdc-text-button-container-shape);padding:0 var(--mat-text-button-horizontal-padding, 8px)}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color)}.mat-mdc-button:disabled{color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape)}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 8px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color)}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color)}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color)}.mat-mdc-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity)}.mat-mdc-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity)}.mat-mdc-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity)}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display)}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-unelevated-button{font-family:var(--mdc-filled-button-label-text-font);font-size:var(--mdc-filled-button-label-text-size);letter-spacing:var(--mdc-filled-button-label-text-tracking);font-weight:var(--mdc-filled-button-label-text-weight);text-transform:var(--mdc-filled-button-label-text-transform);height:var(--mdc-filled-button-container-height);border-radius:var(--mdc-filled-button-container-shape);padding:0 var(--mat-filled-button-horizontal-padding, 16px)}.mat-mdc-unelevated-button:not(:disabled){background-color:var(--mdc-filled-button-container-color)}.mat-mdc-unelevated-button:disabled{background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color)}.mat-mdc-unelevated-button:disabled{color:var(--mdc-filled-button-disabled-label-text-color)}.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color)}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color)}.mat-mdc-unelevated-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity)}.mat-mdc-unelevated-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity)}.mat-mdc-unelevated-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity)}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display)}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color);background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{font-family:var(--mdc-protected-button-label-text-font);font-size:var(--mdc-protected-button-label-text-size);letter-spacing:var(--mdc-protected-button-label-text-tracking);font-weight:var(--mdc-protected-button-label-text-weight);text-transform:var(--mdc-protected-button-label-text-transform);height:var(--mdc-protected-button-container-height);border-radius:var(--mdc-protected-button-container-shape);padding:0 var(--mat-protected-button-horizontal-padding, 16px);box-shadow:var(--mdc-protected-button-container-elevation-shadow)}.mat-mdc-raised-button:not(:disabled){background-color:var(--mdc-protected-button-container-color)}.mat-mdc-raised-button:disabled{background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color)}.mat-mdc-raised-button:disabled{color:var(--mdc-protected-button-disabled-label-text-color)}.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color)}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color)}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color)}.mat-mdc-raised-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity)}.mat-mdc-raised-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity)}.mat-mdc-raised-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity)}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display)}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow)}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow)}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow)}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color);background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow)}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{font-family:var(--mdc-outlined-button-label-text-font);font-size:var(--mdc-outlined-button-label-text-size);letter-spacing:var(--mdc-outlined-button-label-text-tracking);font-weight:var(--mdc-outlined-button-label-text-weight);text-transform:var(--mdc-outlined-button-label-text-transform);height:var(--mdc-outlined-button-container-height);border-radius:var(--mdc-outlined-button-container-shape);padding:0 15px 0 15px;border-width:var(--mdc-outlined-button-outline-width);padding:0 var(--mat-outlined-button-horizontal-padding, 15px)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color)}.mat-mdc-outlined-button:disabled{color:var(--mdc-outlined-button-disabled-label-text-color)}.mat-mdc-outlined-button .mdc-button__ripple{border-radius:var(--mdc-outlined-button-container-shape)}.mat-mdc-outlined-button:not(:disabled){border-color:var(--mdc-outlined-button-outline-color)}.mat-mdc-outlined-button:disabled{border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mdc-button--icon-trailing{padding:0 11px 0 15px}.mat-mdc-outlined-button.mdc-button--icon-leading{padding:0 15px 0 11px}.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:var(--mdc-outlined-button-outline-width)}.mat-mdc-outlined-button .mdc-button__touch{left:calc(-1 * var(--mdc-outlined-button-outline-width));width:calc(100% + 2 * var(--mdc-outlined-button-outline-width))}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color)}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color)}.mat-mdc-outlined-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity)}.mat-mdc-outlined-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity)}.mat-mdc-outlined-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity)}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display)}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color);border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button-base{text-decoration:none}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-outlined-button .mdc-button__label{z-index:1}.mat-mdc-button .mat-mdc-focus-indicator,.mat-mdc-unelevated-button .mat-mdc-focus-indicator,.mat-mdc-raised-button .mat-mdc-focus-indicator,.mat-mdc-outlined-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-unelevated-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-raised-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-outlined-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:-1px}.mat-mdc-unelevated-button .mat-mdc-focus-indicator::before,.mat-mdc-raised-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 3px)*-1)}', ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}"],
  encapsulation: 2,
  changeDetection: 0
});
var MatButton = _MatButton;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButton, [{
    type: Component,
    args: [{
      selector: `
    button[mat-button], button[mat-raised-button], button[mat-flat-button],
    button[mat-stroked-button]
  `,
      host: MAT_BUTTON_HOST,
      exportAs: "matButton",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0)}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__progress-indicator{font-size:0;position:absolute;transform:translate(-50%, -50%);top:50%;left:50%;line-height:initial}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px);display:none}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring{border-color:CanvasText}}.mdc-button .mdc-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring::after{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{display:block}}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button{font-family:var(--mdc-text-button-label-text-font);font-size:var(--mdc-text-button-label-text-size);letter-spacing:var(--mdc-text-button-label-text-tracking);font-weight:var(--mdc-text-button-label-text-weight);text-transform:var(--mdc-text-button-label-text-transform);height:var(--mdc-text-button-container-height);border-radius:var(--mdc-text-button-container-shape);padding:0 var(--mat-text-button-horizontal-padding, 8px)}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color)}.mat-mdc-button:disabled{color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape)}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 8px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color)}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color)}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color)}.mat-mdc-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity)}.mat-mdc-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity)}.mat-mdc-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity)}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display)}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-unelevated-button{font-family:var(--mdc-filled-button-label-text-font);font-size:var(--mdc-filled-button-label-text-size);letter-spacing:var(--mdc-filled-button-label-text-tracking);font-weight:var(--mdc-filled-button-label-text-weight);text-transform:var(--mdc-filled-button-label-text-transform);height:var(--mdc-filled-button-container-height);border-radius:var(--mdc-filled-button-container-shape);padding:0 var(--mat-filled-button-horizontal-padding, 16px)}.mat-mdc-unelevated-button:not(:disabled){background-color:var(--mdc-filled-button-container-color)}.mat-mdc-unelevated-button:disabled{background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color)}.mat-mdc-unelevated-button:disabled{color:var(--mdc-filled-button-disabled-label-text-color)}.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color)}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color)}.mat-mdc-unelevated-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity)}.mat-mdc-unelevated-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity)}.mat-mdc-unelevated-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity)}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display)}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color);background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{font-family:var(--mdc-protected-button-label-text-font);font-size:var(--mdc-protected-button-label-text-size);letter-spacing:var(--mdc-protected-button-label-text-tracking);font-weight:var(--mdc-protected-button-label-text-weight);text-transform:var(--mdc-protected-button-label-text-transform);height:var(--mdc-protected-button-container-height);border-radius:var(--mdc-protected-button-container-shape);padding:0 var(--mat-protected-button-horizontal-padding, 16px);box-shadow:var(--mdc-protected-button-container-elevation-shadow)}.mat-mdc-raised-button:not(:disabled){background-color:var(--mdc-protected-button-container-color)}.mat-mdc-raised-button:disabled{background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color)}.mat-mdc-raised-button:disabled{color:var(--mdc-protected-button-disabled-label-text-color)}.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color)}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color)}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color)}.mat-mdc-raised-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity)}.mat-mdc-raised-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity)}.mat-mdc-raised-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity)}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display)}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow)}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow)}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow)}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color);background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow)}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{font-family:var(--mdc-outlined-button-label-text-font);font-size:var(--mdc-outlined-button-label-text-size);letter-spacing:var(--mdc-outlined-button-label-text-tracking);font-weight:var(--mdc-outlined-button-label-text-weight);text-transform:var(--mdc-outlined-button-label-text-transform);height:var(--mdc-outlined-button-container-height);border-radius:var(--mdc-outlined-button-container-shape);padding:0 15px 0 15px;border-width:var(--mdc-outlined-button-outline-width);padding:0 var(--mat-outlined-button-horizontal-padding, 15px)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color)}.mat-mdc-outlined-button:disabled{color:var(--mdc-outlined-button-disabled-label-text-color)}.mat-mdc-outlined-button .mdc-button__ripple{border-radius:var(--mdc-outlined-button-container-shape)}.mat-mdc-outlined-button:not(:disabled){border-color:var(--mdc-outlined-button-outline-color)}.mat-mdc-outlined-button:disabled{border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mdc-button--icon-trailing{padding:0 11px 0 15px}.mat-mdc-outlined-button.mdc-button--icon-leading{padding:0 15px 0 11px}.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:var(--mdc-outlined-button-outline-width)}.mat-mdc-outlined-button .mdc-button__touch{left:calc(-1 * var(--mdc-outlined-button-outline-width));width:calc(100% + 2 * var(--mdc-outlined-button-outline-width))}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color)}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color)}.mat-mdc-outlined-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity)}.mat-mdc-outlined-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity)}.mat-mdc-outlined-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity)}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display)}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color);border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button-base{text-decoration:none}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-outlined-button .mdc-button__label{z-index:1}.mat-mdc-button .mat-mdc-focus-indicator,.mat-mdc-unelevated-button .mat-mdc-focus-indicator,.mat-mdc-raised-button .mat-mdc-focus-indicator,.mat-mdc-outlined-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-unelevated-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-raised-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-outlined-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:-1px}.mat-mdc-unelevated-button .mat-mdc-focus-indicator::before,.mat-mdc-raised-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 3px)*-1)}', ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], null);
})();
var _MatAnchor = class _MatAnchor extends MatAnchorBase {
  constructor(elementRef, platform, ngZone, animationMode) {
    super(elementRef, platform, ngZone, animationMode);
  }
};
_MatAnchor.\u0275fac = function MatAnchor_Factory(t) {
  return new (t || _MatAnchor)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatAnchor.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatAnchor,
  selectors: [["a", "mat-button", ""], ["a", "mat-raised-button", ""], ["a", "mat-flat-button", ""], ["a", "mat-stroked-button", ""]],
  hostVars: 15,
  hostBindings: function MatAnchor_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("tabindex", ctx.disabled && !ctx.disabledInteractive ? -1 : ctx.tabIndex)("aria-disabled", ctx._getDisabledAttribute());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton", "matAnchor"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c05,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatAnchor_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: [_c33, _c43],
  encapsulation: 2,
  changeDetection: 0
});
var MatAnchor = _MatAnchor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatAnchor, [{
    type: Component,
    args: [{
      selector: `a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]`,
      exportAs: "matButton, matAnchor",
      host: MAT_ANCHOR_HOST,
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0)}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__progress-indicator{font-size:0;position:absolute;transform:translate(-50%, -50%);top:50%;left:50%;line-height:initial}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px);display:none}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring{border-color:CanvasText}}.mdc-button .mdc-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-button .mdc-button__focus-ring::after{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{display:block}}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button{font-family:var(--mdc-text-button-label-text-font);font-size:var(--mdc-text-button-label-text-size);letter-spacing:var(--mdc-text-button-label-text-tracking);font-weight:var(--mdc-text-button-label-text-weight);text-transform:var(--mdc-text-button-label-text-transform);height:var(--mdc-text-button-container-height);border-radius:var(--mdc-text-button-container-shape);padding:0 var(--mat-text-button-horizontal-padding, 8px)}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color)}.mat-mdc-button:disabled{color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape)}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 8px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, 0);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, 0)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color)}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color)}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color)}.mat-mdc-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity)}.mat-mdc-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity)}.mat-mdc-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity)}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display)}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color)}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-unelevated-button{font-family:var(--mdc-filled-button-label-text-font);font-size:var(--mdc-filled-button-label-text-size);letter-spacing:var(--mdc-filled-button-label-text-tracking);font-weight:var(--mdc-filled-button-label-text-weight);text-transform:var(--mdc-filled-button-label-text-transform);height:var(--mdc-filled-button-container-height);border-radius:var(--mdc-filled-button-container-shape);padding:0 var(--mat-filled-button-horizontal-padding, 16px)}.mat-mdc-unelevated-button:not(:disabled){background-color:var(--mdc-filled-button-container-color)}.mat-mdc-unelevated-button:disabled{background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color)}.mat-mdc-unelevated-button:disabled{color:var(--mdc-filled-button-disabled-label-text-color)}.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -4px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -4px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color)}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color)}.mat-mdc-unelevated-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity)}.mat-mdc-unelevated-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity)}.mat-mdc-unelevated-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity)}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display)}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color);background-color:var(--mdc-filled-button-disabled-container-color)}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{font-family:var(--mdc-protected-button-label-text-font);font-size:var(--mdc-protected-button-label-text-size);letter-spacing:var(--mdc-protected-button-label-text-tracking);font-weight:var(--mdc-protected-button-label-text-weight);text-transform:var(--mdc-protected-button-label-text-transform);height:var(--mdc-protected-button-container-height);border-radius:var(--mdc-protected-button-container-shape);padding:0 var(--mat-protected-button-horizontal-padding, 16px);box-shadow:var(--mdc-protected-button-container-elevation-shadow)}.mat-mdc-raised-button:not(:disabled){background-color:var(--mdc-protected-button-container-color)}.mat-mdc-raised-button:disabled{background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color)}.mat-mdc-raised-button:disabled{color:var(--mdc-protected-button-disabled-label-text-color)}.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -4px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -4px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color)}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color)}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color)}.mat-mdc-raised-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity)}.mat-mdc-raised-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity)}.mat-mdc-raised-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity)}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display)}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow)}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow)}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow)}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color);background-color:var(--mdc-protected-button-disabled-container-color)}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow)}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{font-family:var(--mdc-outlined-button-label-text-font);font-size:var(--mdc-outlined-button-label-text-size);letter-spacing:var(--mdc-outlined-button-label-text-tracking);font-weight:var(--mdc-outlined-button-label-text-weight);text-transform:var(--mdc-outlined-button-label-text-transform);height:var(--mdc-outlined-button-container-height);border-radius:var(--mdc-outlined-button-container-shape);padding:0 15px 0 15px;border-width:var(--mdc-outlined-button-outline-width);padding:0 var(--mat-outlined-button-horizontal-padding, 15px)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color)}.mat-mdc-outlined-button:disabled{color:var(--mdc-outlined-button-disabled-label-text-color)}.mat-mdc-outlined-button .mdc-button__ripple{border-radius:var(--mdc-outlined-button-container-shape)}.mat-mdc-outlined-button:not(:disabled){border-color:var(--mdc-outlined-button-outline-color)}.mat-mdc-outlined-button:disabled{border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mdc-button--icon-trailing{padding:0 11px 0 15px}.mat-mdc-outlined-button.mdc-button--icon-leading{padding:0 15px 0 11px}.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:var(--mdc-outlined-button-outline-width)}.mat-mdc-outlined-button .mdc-button__touch{left:calc(-1 * var(--mdc-outlined-button-outline-width));width:calc(100% + 2 * var(--mdc-outlined-button-outline-width))}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -4px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -4px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color)}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color)}.mat-mdc-outlined-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity)}.mat-mdc-outlined-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity)}.mat-mdc-outlined-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity)}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display)}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color);border-color:var(--mdc-outlined-button-disabled-outline-color)}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button-base{text-decoration:none}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-outlined-button .mdc-button__label{z-index:1}.mat-mdc-button .mat-mdc-focus-indicator,.mat-mdc-unelevated-button .mat-mdc-focus-indicator,.mat-mdc-raised-button .mat-mdc-focus-indicator,.mat-mdc-outlined-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-unelevated-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-raised-button:focus .mat-mdc-focus-indicator::before,.mat-mdc-outlined-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:-1px}.mat-mdc-unelevated-button .mat-mdc-focus-indicator::before,.mat-mdc-raised-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 3px)*-1)}', ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], null);
})();
var MAT_FAB_DEFAULT_OPTIONS = new InjectionToken("mat-mdc-fab-default-options", {
  providedIn: "root",
  factory: MAT_FAB_DEFAULT_OPTIONS_FACTORY
});
function MAT_FAB_DEFAULT_OPTIONS_FACTORY() {
  return {
    // The FAB by default has its color set to accent.
    color: "accent"
  };
}
var defaults = MAT_FAB_DEFAULT_OPTIONS_FACTORY();
var _MatFabButton = class _MatFabButton extends MatButtonBase {
  constructor(elementRef, platform, ngZone, animationMode, _options) {
    super(elementRef, platform, ngZone, animationMode);
    this._options = _options;
    this._isFab = true;
    this._options = this._options || defaults;
    this.color = this._options.color || defaults.color;
  }
};
_MatFabButton.\u0275fac = function MatFabButton_Factory(t) {
  return new (t || _MatFabButton)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8), \u0275\u0275directiveInject(MAT_FAB_DEFAULT_OPTIONS, 8));
};
_MatFabButton.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatFabButton,
  selectors: [["button", "mat-fab", ""]],
  hostVars: 18,
  hostBindings: function MatFabButton_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("aria-disabled", ctx._getAriaDisabled());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true)("mdc-fab--extended", ctx.extended)("mat-mdc-extended-fab", ctx.extended);
    }
  },
  inputs: {
    extended: [2, "extended", "extended", booleanAttribute]
  },
  exportAs: ["matButton"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c53,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatFabButton_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}'],
  encapsulation: 2,
  changeDetection: 0
});
var MatFabButton = _MatFabButton;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFabButton, [{
    type: Component,
    args: [{
      selector: `button[mat-fab]`,
      host: __spreadProps(__spreadValues({}, MAT_BUTTON_HOST), {
        "[class.mdc-fab--extended]": "extended",
        "[class.mat-mdc-extended-fab]": "extended"
      }),
      exportAs: "matButton",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FAB_DEFAULT_OPTIONS]
    }]
  }], {
    extended: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }]
  });
})();
var _MatMiniFabButton = class _MatMiniFabButton extends MatButtonBase {
  constructor(elementRef, platform, ngZone, animationMode, _options) {
    super(elementRef, platform, ngZone, animationMode);
    this._options = _options;
    this._isFab = true;
    this._options = this._options || defaults;
    this.color = this._options.color || defaults.color;
  }
};
_MatMiniFabButton.\u0275fac = function MatMiniFabButton_Factory(t) {
  return new (t || _MatMiniFabButton)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8), \u0275\u0275directiveInject(MAT_FAB_DEFAULT_OPTIONS, 8));
};
_MatMiniFabButton.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatMiniFabButton,
  selectors: [["button", "mat-mini-fab", ""]],
  hostVars: 14,
  hostBindings: function MatMiniFabButton_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("aria-disabled", ctx._getAriaDisabled());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c63,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatMiniFabButton_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: [_c72],
  encapsulation: 2,
  changeDetection: 0
});
var MatMiniFabButton = _MatMiniFabButton;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMiniFabButton, [{
    type: Component,
    args: [{
      selector: `button[mat-mini-fab]`,
      host: MAT_BUTTON_HOST,
      exportAs: "matButton",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FAB_DEFAULT_OPTIONS]
    }]
  }], null);
})();
var _MatFabAnchor = class _MatFabAnchor extends MatAnchor {
  constructor(elementRef, platform, ngZone, animationMode, _options) {
    super(elementRef, platform, ngZone, animationMode);
    this._options = _options;
    this._isFab = true;
    this._options = this._options || defaults;
    this.color = this._options.color || defaults.color;
  }
};
_MatFabAnchor.\u0275fac = function MatFabAnchor_Factory(t) {
  return new (t || _MatFabAnchor)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8), \u0275\u0275directiveInject(MAT_FAB_DEFAULT_OPTIONS, 8));
};
_MatFabAnchor.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatFabAnchor,
  selectors: [["a", "mat-fab", ""]],
  hostVars: 19,
  hostBindings: function MatFabAnchor_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("tabindex", ctx.disabled && !ctx.disabledInteractive ? -1 : ctx.tabIndex)("aria-disabled", ctx._getDisabledAttribute());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true)("mdc-fab--extended", ctx.extended)("mat-mdc-extended-fab", ctx.extended);
    }
  },
  inputs: {
    extended: [2, "extended", "extended", booleanAttribute]
  },
  exportAs: ["matButton", "matAnchor"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c53,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatFabAnchor_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: [_c72],
  encapsulation: 2,
  changeDetection: 0
});
var MatFabAnchor = _MatFabAnchor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatFabAnchor, [{
    type: Component,
    args: [{
      selector: `a[mat-fab]`,
      host: __spreadProps(__spreadValues({}, MAT_ANCHOR_HOST), {
        "[class.mdc-fab--extended]": "extended",
        "[class.mat-mdc-extended-fab]": "extended"
      }),
      exportAs: "matButton, matAnchor",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FAB_DEFAULT_OPTIONS]
    }]
  }], {
    extended: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }]
  });
})();
var _MatMiniFabAnchor = class _MatMiniFabAnchor extends MatAnchor {
  constructor(elementRef, platform, ngZone, animationMode, _options) {
    super(elementRef, platform, ngZone, animationMode);
    this._options = _options;
    this._isFab = true;
    this._options = this._options || defaults;
    this.color = this._options.color || defaults.color;
  }
};
_MatMiniFabAnchor.\u0275fac = function MatMiniFabAnchor_Factory(t) {
  return new (t || _MatMiniFabAnchor)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8), \u0275\u0275directiveInject(MAT_FAB_DEFAULT_OPTIONS, 8));
};
_MatMiniFabAnchor.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatMiniFabAnchor,
  selectors: [["a", "mat-mini-fab", ""]],
  hostVars: 15,
  hostBindings: function MatMiniFabAnchor_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("tabindex", ctx.disabled && !ctx.disabledInteractive ? -1 : ctx.tabIndex)("aria-disabled", ctx._getDisabledAttribute());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton", "matAnchor"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c63,
  ngContentSelectors: _c23,
  decls: 7,
  vars: 4,
  consts: [[1, "mat-mdc-button-persistent-ripple"], [1, "mdc-button__label"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatMiniFabAnchor_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef(_c15);
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275elementStart(2, "span", 1);
      \u0275\u0275projection(3, 1);
      \u0275\u0275elementEnd();
      \u0275\u0275projection(4, 2);
      \u0275\u0275element(5, "span", 2)(6, "span", 3);
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-button__ripple", !ctx._isFab)("mdc-fab__ripple", ctx._isFab);
    }
  },
  styles: [_c72],
  encapsulation: 2,
  changeDetection: 0
});
var MatMiniFabAnchor = _MatMiniFabAnchor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMiniFabAnchor, [{
    type: Component,
    args: [{
      selector: `a[mat-mini-fab]`,
      host: MAT_ANCHOR_HOST,
      exportAs: "matButton, matAnchor",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span
    class="mat-mdc-button-persistent-ripple"
    [class.mdc-button__ripple]="!_isFab"
    [class.mdc-fab__ripple]="_isFab"></span>

<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])">
</ng-content>

<span class="mdc-button__label"><ng-content></ng-content></span>

<ng-content select=".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]">
</ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:var(--mdc-elevation-overlay-opacity);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-fab{position:relative;display:inline-flex;position:relative;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;user-select:none;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-fab .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-fab[hidden]{display:none}.mdc-fab::-moz-focus-inner{padding:0;border:0}.mdc-fab .mdc-fab__focus-ring{position:absolute}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring{border-color:CanvasText}}.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-fab.mdc-ripple-upgraded--background-focused .mdc-fab__focus-ring::after,.mdc-fab:not(.mdc-ripple-upgraded):focus .mdc-fab__focus-ring::after{border-color:CanvasText}}.mdc-fab:active,.mdc-fab:focus{outline:none}.mdc-fab:hover{cursor:pointer}.mdc-fab>svg{width:100%}.mdc-fab--mini{width:40px;height:40px}.mdc-fab--extended{border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;height:48px;line-height:normal}.mdc-fab--extended .mdc-fab__ripple{border-radius:24px}.mdc-fab--extended .mdc-fab__icon{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mdc-fab--extended .mdc-fab__icon,.mdc-fab--extended .mdc-fab__icon[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mdc-fab--extended .mdc-fab__label+.mdc-fab__icon,.mdc-fab--extended .mdc-fab__label+.mdc-fab__icon[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}.mdc-fab--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-fab--touch .mdc-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-fab::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-fab::before{border-color:CanvasText}}.mdc-fab__label{justify-content:flex-start;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:visible}.mdc-fab__icon{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mdc-fab .mdc-fab__icon{display:inline-flex;align-items:center;justify-content:center}.mdc-fab--exited{transform:scale(0);opacity:0;transition:opacity 15ms linear 150ms,transform 180ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-fab--exited .mdc-fab__icon{transform:scale(0);transition:transform 135ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mat-mdc-fab{background-color:var(--mdc-fab-container-color)}.mat-mdc-fab .mdc-fab__icon{width:var(--mdc-fab-icon-size);height:var(--mdc-fab-icon-size);font-size:var(--mdc-fab-icon-size)}.mat-mdc-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-container-shape)}.mat-mdc-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-container-shape)}.mat-mdc-mini-fab{background-color:var(--mdc-fab-small-container-color)}.mat-mdc-mini-fab .mdc-fab__icon{width:var(--mdc-fab-small-icon-size);height:var(--mdc-fab-small-icon-size);font-size:var(--mdc-fab-small-icon-size)}.mat-mdc-mini-fab:not(.mdc-fab--extended){border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-mini-fab:not(.mdc-fab--extended) .mdc-fab__ripple{border-radius:var(--mdc-fab-small-container-shape)}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mdc-extended-fab-container-height);border-radius:var(--mdc-extended-fab-container-shape);font-family:var(--mdc-extended-fab-label-text-font);font-size:var(--mdc-extended-fab-label-text-size);font-weight:var(--mdc-extended-fab-label-text-weight);letter-spacing:var(--mdc-extended-fab-label-text-tracking)}.mat-mdc-extended-fab .mdc-fab__ripple{border-radius:var(--mdc-extended-fab-container-shape)}.mat-mdc-fab,.mat-mdc-mini-fab{-webkit-tap-highlight-color:rgba(0,0,0,0);flex-shrink:0}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple,.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab .mat-mdc-button-ripple,.mat-mdc-mini-fab .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab .mdc-button__label,.mat-mdc-mini-fab .mdc-button__label{z-index:1}.mat-mdc-fab .mat-mdc-focus-indicator,.mat-mdc-mini-fab .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab:focus .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-fab._mat-animation-noopable,.mat-mdc-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-mini-fab:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}.mat-mdc-fab .mat-icon,.mat-mdc-fab .material-icons,.mat-mdc-mini-fab .mat-icon,.mat-mdc-mini-fab .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab .mat-mdc-focus-indicator::before,.mat-mdc-mini-fab .mat-mdc-focus-indicator::before{margin:calc(calc(var(--mat-mdc-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab[disabled],.mat-mdc-fab[disabled]:focus,.mat-mdc-fab.mat-mdc-button-disabled,.mat-mdc-fab.mat-mdc-button-disabled:focus,.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab[disabled]:focus,.mat-mdc-mini-fab.mat-mdc-button-disabled,.mat-mdc-mini-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab.mat-mdc-button-disabled-interactive,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{color:var(--mat-fab-foreground-color, inherit);box-shadow:var(--mdc-fab-container-elevation-shadow)}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color)}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color)}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity)}.mat-mdc-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity)}.mat-mdc-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity)}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow)}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow)}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow)}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color);background-color:var(--mat-fab-disabled-state-container-color)}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab{color:var(--mat-fab-small-foreground-color, inherit);box-shadow:var(--mdc-fab-small-container-elevation-shadow)}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color)}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity)}.mat-mdc-mini-fab.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity)}.mat-mdc-mini-fab:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity)}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow)}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow)}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow)}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color);background-color:var(--mat-fab-small-disabled-state-container-color)}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab{box-shadow:var(--mdc-extended-fab-container-elevation-shadow)}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow)}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow)}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow)}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:calc(12px - 20px);margin-right:12px}[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons,.mat-mdc-extended-fab>.mat-icon[dir=rtl],.mat-mdc-extended-fab>.material-icons[dir=rtl]{margin-left:12px;margin-right:calc(12px - 20px)}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons{margin-left:12px;margin-right:calc(12px - 20px)}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab .mdc-button__label+.mat-icon[dir=rtl],.mat-mdc-extended-fab .mdc-button__label+.material-icons[dir=rtl]{margin-left:calc(12px - 20px);margin-right:12px}']
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_FAB_DEFAULT_OPTIONS]
    }]
  }], null);
})();
var _MatIconButton = class _MatIconButton extends MatButtonBase {
  constructor(elementRef, platform, ngZone, animationMode) {
    super(elementRef, platform, ngZone, animationMode);
    this._rippleLoader.configureRipple(this._elementRef.nativeElement, {
      centered: true
    });
  }
};
_MatIconButton.\u0275fac = function MatIconButton_Factory(t) {
  return new (t || _MatIconButton)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatIconButton.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatIconButton,
  selectors: [["button", "mat-icon-button", ""]],
  hostVars: 14,
  hostBindings: function MatIconButton_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("aria-disabled", ctx._getAriaDisabled());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c8,
  ngContentSelectors: _c9,
  decls: 4,
  vars: 0,
  consts: [[1, "mat-mdc-button-persistent-ripple", "mdc-icon-button__ripple"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatIconButton_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275element(2, "span", 1)(3, "span", 2);
    }
  },
  styles: ['.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block}}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button[hidden]{display:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%;display:none}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring{border-color:CanvasText}}.mdc-icon-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mat-mdc-icon-button{color:var(--mdc-icon-button-icon-color)}.mat-mdc-icon-button .mdc-button__icon{font-size:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button svg,.mat-mdc-icon-button img{width:var(--mdc-icon-button-icon-size);height:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button:disabled{color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button{border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 48px);height:var(--mdc-icon-button-state-layer-size, 48px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 48px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size);-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button svg{vertical-align:baseline}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label{z-index:1}.mat-mdc-icon-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color)}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color)}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color)}.mat-mdc-icon-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}.mat-mdc-icon-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity)}.mat-mdc-icon-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}', _c43],
  encapsulation: 2,
  changeDetection: 0
});
var MatIconButton = _MatIconButton;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconButton, [{
    type: Component,
    args: [{
      selector: `button[mat-icon-button]`,
      host: MAT_BUTTON_HOST,
      exportAs: "matButton",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span class="mat-mdc-button-persistent-ripple mdc-icon-button__ripple"></span>

<ng-content></ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block}}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button[hidden]{display:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%;display:none}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring{border-color:CanvasText}}.mdc-icon-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mat-mdc-icon-button{color:var(--mdc-icon-button-icon-color)}.mat-mdc-icon-button .mdc-button__icon{font-size:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button svg,.mat-mdc-icon-button img{width:var(--mdc-icon-button-icon-size);height:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button:disabled{color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button{border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 48px);height:var(--mdc-icon-button-state-layer-size, 48px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 48px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size);-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button svg{vertical-align:baseline}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label{z-index:1}.mat-mdc-icon-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color)}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color)}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color)}.mat-mdc-icon-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}.mat-mdc-icon-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity)}.mat-mdc-icon-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}', ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], null);
})();
var _MatIconAnchor = class _MatIconAnchor extends MatAnchorBase {
  constructor(elementRef, platform, ngZone, animationMode) {
    super(elementRef, platform, ngZone, animationMode);
  }
};
_MatIconAnchor.\u0275fac = function MatIconAnchor_Factory(t) {
  return new (t || _MatIconAnchor)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_MatIconAnchor.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatIconAnchor,
  selectors: [["a", "mat-icon-button", ""]],
  hostVars: 15,
  hostBindings: function MatIconAnchor_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("disabled", ctx._getDisabledAttribute())("tabindex", ctx.disabled && !ctx.disabledInteractive ? -1 : ctx.tabIndex)("aria-disabled", ctx._getDisabledAttribute());
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-mdc-button-disabled", ctx.disabled)("mat-mdc-button-disabled-interactive", ctx.disabledInteractive)("_mat-animation-noopable", ctx._animationMode === "NoopAnimations")("mat-unthemed", !ctx.color)("mat-mdc-button-base", true);
    }
  },
  exportAs: ["matButton", "matAnchor"],
  standalone: true,
  features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275StandaloneFeature],
  attrs: _c8,
  ngContentSelectors: _c9,
  decls: 4,
  vars: 0,
  consts: [[1, "mat-mdc-button-persistent-ripple", "mdc-icon-button__ripple"], [1, "mat-mdc-focus-indicator"], [1, "mat-mdc-button-touch-target"]],
  template: function MatIconAnchor_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275element(0, "span", 0);
      \u0275\u0275projection(1);
      \u0275\u0275element(2, "span", 1)(3, "span", 2);
    }
  },
  styles: [_c10, _c43],
  encapsulation: 2,
  changeDetection: 0
});
var MatIconAnchor = _MatIconAnchor;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconAnchor, [{
    type: Component,
    args: [{
      selector: `a[mat-icon-button]`,
      host: MAT_ANCHOR_HOST,
      exportAs: "matButton, matAnchor",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      template: `<span class="mat-mdc-button-persistent-ripple mdc-icon-button__ripple"></span>

<ng-content></ng-content>

<!--
  The indicator can't be directly on the button, because MDC uses ::before for high contrast
  indication and it can't be on the ripple, because it has a border radius and overflow: hidden.
-->
<span class="mat-mdc-focus-indicator"></span>

<span class="mat-mdc-button-touch-target"></span>
`,
      styles: ['.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block}}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button[hidden]{display:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%;display:none}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring{border-color:CanvasText}}.mdc-icon-button__focus-ring::after{content:"";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mat-mdc-icon-button{color:var(--mdc-icon-button-icon-color)}.mat-mdc-icon-button .mdc-button__icon{font-size:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button svg,.mat-mdc-icon-button img{width:var(--mdc-icon-button-icon-size);height:var(--mdc-icon-button-icon-size)}.mat-mdc-icon-button:disabled{color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button{border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 48px);height:var(--mdc-icon-button-state-layer-size, 48px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 48px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size);-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button svg{vertical-align:baseline}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color)}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label{z-index:1}.mat-mdc-icon-button .mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus .mat-mdc-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color)}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color)}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color)}.mat-mdc-icon-button:hover .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity)}.mat-mdc-icon-button.cdk-program-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused .mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity)}.mat-mdc-icon-button:active .mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity)}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}', ".cdk-high-contrast-active .mat-mdc-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-unelevated-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-raised-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-outlined-button:not(.mdc-button--outlined),.cdk-high-contrast-active .mat-mdc-icon-button{outline:solid 1px}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: Platform
  }, {
    type: NgZone
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], null);
})();
var _MatButtonModule = class _MatButtonModule {
};
_MatButtonModule.\u0275fac = function MatButtonModule_Factory(t) {
  return new (t || _MatButtonModule)();
};
_MatButtonModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatButtonModule
});
_MatButtonModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, MatRippleModule, MatCommonModule]
});
var MatButtonModule = _MatButtonModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatButtonModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatRippleModule, MatAnchor, MatButton, MatIconAnchor, MatMiniFabAnchor, MatMiniFabButton, MatIconButton, MatFabAnchor, MatFabButton],
      exports: [MatAnchor, MatButton, MatIconAnchor, MatIconButton, MatMiniFabAnchor, MatMiniFabButton, MatFabAnchor, MatFabButton, MatCommonModule]
    }]
  }], null, null);
})();

// node_modules/@angular/material/fesm2022/tooltip.mjs
var _c06 = ["tooltip"];
var SCROLL_THROTTLE_MS = 20;
function getMatTooltipInvalidPositionError(position) {
  return Error(`Tooltip position "${position}" is invalid.`);
}
var MAT_TOOLTIP_SCROLL_STRATEGY = new InjectionToken("mat-tooltip-scroll-strategy", {
  providedIn: "root",
  factory: () => {
    const overlay = inject(Overlay);
    return () => overlay.scrollStrategies.reposition({
      scrollThrottle: SCROLL_THROTTLE_MS
    });
  }
});
function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(overlay) {
  return () => overlay.scrollStrategies.reposition({
    scrollThrottle: SCROLL_THROTTLE_MS
  });
}
var MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER = {
  provide: MAT_TOOLTIP_SCROLL_STRATEGY,
  deps: [Overlay],
  useFactory: MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY
};
function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY() {
  return {
    showDelay: 0,
    hideDelay: 0,
    touchendHideDelay: 1500
  };
}
var MAT_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken("mat-tooltip-default-options", {
  providedIn: "root",
  factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY
});
var PANEL_CLASS = "tooltip-panel";
var passiveListenerOptions = normalizePassiveListenerOptions({
  passive: true
});
var MIN_VIEWPORT_TOOLTIP_THRESHOLD = 8;
var UNBOUNDED_ANCHOR_GAP = 8;
var MIN_HEIGHT = 24;
var MAX_WIDTH = 200;
var _MatTooltip = class _MatTooltip {
  /** Allows the user to define the position of the tooltip relative to the parent element */
  get position() {
    return this._position;
  }
  set position(value) {
    if (value !== this._position) {
      this._position = value;
      if (this._overlayRef) {
        this._updatePosition(this._overlayRef);
        this._tooltipInstance?.show(0);
        this._overlayRef.updatePosition();
      }
    }
  }
  /**
   * Whether tooltip should be relative to the click or touch origin
   * instead of outside the element bounding box.
   */
  get positionAtOrigin() {
    return this._positionAtOrigin;
  }
  set positionAtOrigin(value) {
    this._positionAtOrigin = coerceBooleanProperty(value);
    this._detach();
    this._overlayRef = null;
  }
  /** Disables the display of the tooltip. */
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    this._disabled = coerceBooleanProperty(value);
    if (this._disabled) {
      this.hide(0);
    } else {
      this._setupPointerEnterEventsIfNeeded();
    }
  }
  /** The default delay in ms before showing the tooltip after show is called */
  get showDelay() {
    return this._showDelay;
  }
  set showDelay(value) {
    this._showDelay = coerceNumberProperty(value);
  }
  /** The default delay in ms before hiding the tooltip after hide is called */
  get hideDelay() {
    return this._hideDelay;
  }
  set hideDelay(value) {
    this._hideDelay = coerceNumberProperty(value);
    if (this._tooltipInstance) {
      this._tooltipInstance._mouseLeaveHideDelay = this._hideDelay;
    }
  }
  /** The message to be displayed in the tooltip */
  get message() {
    return this._message;
  }
  set message(value) {
    this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message, "tooltip");
    this._message = value != null ? String(value).trim() : "";
    if (!this._message && this._isTooltipVisible()) {
      this.hide(0);
    } else {
      this._setupPointerEnterEventsIfNeeded();
      this._updateTooltipMessage();
      this._ngZone.runOutsideAngular(() => {
        Promise.resolve().then(() => {
          this._ariaDescriber.describe(this._elementRef.nativeElement, this.message, "tooltip");
        });
      });
    }
  }
  /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
  get tooltipClass() {
    return this._tooltipClass;
  }
  set tooltipClass(value) {
    this._tooltipClass = value;
    if (this._tooltipInstance) {
      this._setTooltipClass(this._tooltipClass);
    }
  }
  constructor(_overlay, _elementRef, _scrollDispatcher, _viewContainerRef, _ngZone, _platform, _ariaDescriber, _focusMonitor, scrollStrategy, _dir, _defaultOptions, _document2) {
    this._overlay = _overlay;
    this._elementRef = _elementRef;
    this._scrollDispatcher = _scrollDispatcher;
    this._viewContainerRef = _viewContainerRef;
    this._ngZone = _ngZone;
    this._platform = _platform;
    this._ariaDescriber = _ariaDescriber;
    this._focusMonitor = _focusMonitor;
    this._dir = _dir;
    this._defaultOptions = _defaultOptions;
    this._position = "below";
    this._positionAtOrigin = false;
    this._disabled = false;
    this._viewInitialized = false;
    this._pointerExitEventsInitialized = false;
    this._tooltipComponent = TooltipComponent;
    this._viewportMargin = 8;
    this._cssClassPrefix = "mat-mdc";
    this.touchGestures = "auto";
    this._message = "";
    this._passiveListeners = [];
    this._destroyed = new Subject();
    this._injector = inject(Injector);
    this._scrollStrategy = scrollStrategy;
    this._document = _document2;
    if (_defaultOptions) {
      this._showDelay = _defaultOptions.showDelay;
      this._hideDelay = _defaultOptions.hideDelay;
      if (_defaultOptions.position) {
        this.position = _defaultOptions.position;
      }
      if (_defaultOptions.positionAtOrigin) {
        this.positionAtOrigin = _defaultOptions.positionAtOrigin;
      }
      if (_defaultOptions.touchGestures) {
        this.touchGestures = _defaultOptions.touchGestures;
      }
    }
    _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
      if (this._overlayRef) {
        this._updatePosition(this._overlayRef);
      }
    });
    this._viewportMargin = MIN_VIEWPORT_TOOLTIP_THRESHOLD;
  }
  ngAfterViewInit() {
    this._viewInitialized = true;
    this._setupPointerEnterEventsIfNeeded();
    this._focusMonitor.monitor(this._elementRef).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
      if (!origin) {
        this._ngZone.run(() => this.hide(0));
      } else if (origin === "keyboard") {
        this._ngZone.run(() => this.show());
      }
    });
  }
  /**
   * Dispose the tooltip when destroyed.
   */
  ngOnDestroy() {
    const nativeElement = this._elementRef.nativeElement;
    clearTimeout(this._touchstartTimeout);
    if (this._overlayRef) {
      this._overlayRef.dispose();
      this._tooltipInstance = null;
    }
    this._passiveListeners.forEach(([event, listener]) => {
      nativeElement.removeEventListener(event, listener, passiveListenerOptions);
    });
    this._passiveListeners.length = 0;
    this._destroyed.next();
    this._destroyed.complete();
    this._ariaDescriber.removeDescription(nativeElement, this.message, "tooltip");
    this._focusMonitor.stopMonitoring(nativeElement);
  }
  /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
  show(delay2 = this.showDelay, origin) {
    if (this.disabled || !this.message || this._isTooltipVisible()) {
      this._tooltipInstance?._cancelPendingAnimations();
      return;
    }
    const overlayRef = this._createOverlay(origin);
    this._detach();
    this._portal = this._portal || new ComponentPortal(this._tooltipComponent, this._viewContainerRef);
    const instance = this._tooltipInstance = overlayRef.attach(this._portal).instance;
    instance._triggerElement = this._elementRef.nativeElement;
    instance._mouseLeaveHideDelay = this._hideDelay;
    instance.afterHidden().pipe(takeUntil(this._destroyed)).subscribe(() => this._detach());
    this._setTooltipClass(this._tooltipClass);
    this._updateTooltipMessage();
    instance.show(delay2);
  }
  /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
  hide(delay2 = this.hideDelay) {
    const instance = this._tooltipInstance;
    if (instance) {
      if (instance.isVisible()) {
        instance.hide(delay2);
      } else {
        instance._cancelPendingAnimations();
        this._detach();
      }
    }
  }
  /** Shows/hides the tooltip */
  toggle(origin) {
    this._isTooltipVisible() ? this.hide() : this.show(void 0, origin);
  }
  /** Returns true if the tooltip is currently visible to the user */
  _isTooltipVisible() {
    return !!this._tooltipInstance && this._tooltipInstance.isVisible();
  }
  /** Create the overlay config and position strategy */
  _createOverlay(origin) {
    if (this._overlayRef) {
      const existingStrategy = this._overlayRef.getConfig().positionStrategy;
      if ((!this.positionAtOrigin || !origin) && existingStrategy._origin instanceof ElementRef) {
        return this._overlayRef;
      }
      this._detach();
    }
    const scrollableAncestors = this._scrollDispatcher.getAncestorScrollContainers(this._elementRef);
    const strategy = this._overlay.position().flexibleConnectedTo(this.positionAtOrigin ? origin || this._elementRef : this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(scrollableAncestors);
    strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe((change) => {
      this._updateCurrentPositionClass(change.connectionPair);
      if (this._tooltipInstance) {
        if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {
          this._ngZone.run(() => this.hide(0));
        }
      }
    });
    this._overlayRef = this._overlay.create({
      direction: this._dir,
      positionStrategy: strategy,
      panelClass: `${this._cssClassPrefix}-${PANEL_CLASS}`,
      scrollStrategy: this._scrollStrategy()
    });
    this._updatePosition(this._overlayRef);
    this._overlayRef.detachments().pipe(takeUntil(this._destroyed)).subscribe(() => this._detach());
    this._overlayRef.outsidePointerEvents().pipe(takeUntil(this._destroyed)).subscribe(() => this._tooltipInstance?._handleBodyInteraction());
    this._overlayRef.keydownEvents().pipe(takeUntil(this._destroyed)).subscribe((event) => {
      if (this._isTooltipVisible() && event.keyCode === ESCAPE && !hasModifierKey(event)) {
        event.preventDefault();
        event.stopPropagation();
        this._ngZone.run(() => this.hide(0));
      }
    });
    if (this._defaultOptions?.disableTooltipInteractivity) {
      this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`);
    }
    return this._overlayRef;
  }
  /** Detaches the currently-attached tooltip. */
  _detach() {
    if (this._overlayRef && this._overlayRef.hasAttached()) {
      this._overlayRef.detach();
    }
    this._tooltipInstance = null;
  }
  /** Updates the position of the current tooltip. */
  _updatePosition(overlayRef) {
    const position = overlayRef.getConfig().positionStrategy;
    const origin = this._getOrigin();
    const overlay = this._getOverlayPosition();
    position.withPositions([this._addOffset(__spreadValues(__spreadValues({}, origin.main), overlay.main)), this._addOffset(__spreadValues(__spreadValues({}, origin.fallback), overlay.fallback))]);
  }
  /** Adds the configured offset to a position. Used as a hook for child classes. */
  _addOffset(position) {
    const offset2 = UNBOUNDED_ANCHOR_GAP;
    const isLtr = !this._dir || this._dir.value == "ltr";
    if (position.originY === "top") {
      position.offsetY = -offset2;
    } else if (position.originY === "bottom") {
      position.offsetY = offset2;
    } else if (position.originX === "start") {
      position.offsetX = isLtr ? -offset2 : offset2;
    } else if (position.originX === "end") {
      position.offsetX = isLtr ? offset2 : -offset2;
    }
    return position;
  }
  /**
   * Returns the origin position and a fallback position based on the user's position preference.
   * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
   */
  _getOrigin() {
    const isLtr = !this._dir || this._dir.value == "ltr";
    const position = this.position;
    let originPosition;
    if (position == "above" || position == "below") {
      originPosition = {
        originX: "center",
        originY: position == "above" ? "top" : "bottom"
      };
    } else if (position == "before" || position == "left" && isLtr || position == "right" && !isLtr) {
      originPosition = {
        originX: "start",
        originY: "center"
      };
    } else if (position == "after" || position == "right" && isLtr || position == "left" && !isLtr) {
      originPosition = {
        originX: "end",
        originY: "center"
      };
    } else if (typeof ngDevMode === "undefined" || ngDevMode) {
      throw getMatTooltipInvalidPositionError(position);
    }
    const {
      x,
      y
    } = this._invertPosition(originPosition.originX, originPosition.originY);
    return {
      main: originPosition,
      fallback: {
        originX: x,
        originY: y
      }
    };
  }
  /** Returns the overlay position and a fallback position based on the user's preference */
  _getOverlayPosition() {
    const isLtr = !this._dir || this._dir.value == "ltr";
    const position = this.position;
    let overlayPosition;
    if (position == "above") {
      overlayPosition = {
        overlayX: "center",
        overlayY: "bottom"
      };
    } else if (position == "below") {
      overlayPosition = {
        overlayX: "center",
        overlayY: "top"
      };
    } else if (position == "before" || position == "left" && isLtr || position == "right" && !isLtr) {
      overlayPosition = {
        overlayX: "end",
        overlayY: "center"
      };
    } else if (position == "after" || position == "right" && isLtr || position == "left" && !isLtr) {
      overlayPosition = {
        overlayX: "start",
        overlayY: "center"
      };
    } else if (typeof ngDevMode === "undefined" || ngDevMode) {
      throw getMatTooltipInvalidPositionError(position);
    }
    const {
      x,
      y
    } = this._invertPosition(overlayPosition.overlayX, overlayPosition.overlayY);
    return {
      main: overlayPosition,
      fallback: {
        overlayX: x,
        overlayY: y
      }
    };
  }
  /** Updates the tooltip message and repositions the overlay according to the new message length */
  _updateTooltipMessage() {
    if (this._tooltipInstance) {
      this._tooltipInstance.message = this.message;
      this._tooltipInstance._markForCheck();
      afterNextRender(() => {
        if (this._tooltipInstance) {
          this._overlayRef.updatePosition();
        }
      }, {
        injector: this._injector
      });
    }
  }
  /** Updates the tooltip class */
  _setTooltipClass(tooltipClass) {
    if (this._tooltipInstance) {
      this._tooltipInstance.tooltipClass = tooltipClass;
      this._tooltipInstance._markForCheck();
    }
  }
  /** Inverts an overlay position. */
  _invertPosition(x, y) {
    if (this.position === "above" || this.position === "below") {
      if (y === "top") {
        y = "bottom";
      } else if (y === "bottom") {
        y = "top";
      }
    } else {
      if (x === "end") {
        x = "start";
      } else if (x === "start") {
        x = "end";
      }
    }
    return {
      x,
      y
    };
  }
  /** Updates the class on the overlay panel based on the current position of the tooltip. */
  _updateCurrentPositionClass(connectionPair) {
    const {
      overlayY,
      originX,
      originY
    } = connectionPair;
    let newPosition;
    if (overlayY === "center") {
      if (this._dir && this._dir.value === "rtl") {
        newPosition = originX === "end" ? "left" : "right";
      } else {
        newPosition = originX === "start" ? "left" : "right";
      }
    } else {
      newPosition = overlayY === "bottom" && originY === "top" ? "above" : "below";
    }
    if (newPosition !== this._currentPosition) {
      const overlayRef = this._overlayRef;
      if (overlayRef) {
        const classPrefix = `${this._cssClassPrefix}-${PANEL_CLASS}-`;
        overlayRef.removePanelClass(classPrefix + this._currentPosition);
        overlayRef.addPanelClass(classPrefix + newPosition);
      }
      this._currentPosition = newPosition;
    }
  }
  /** Binds the pointer events to the tooltip trigger. */
  _setupPointerEnterEventsIfNeeded() {
    if (this._disabled || !this.message || !this._viewInitialized || this._passiveListeners.length) {
      return;
    }
    if (this._platformSupportsMouseEvents()) {
      this._passiveListeners.push(["mouseenter", (event) => {
        this._setupPointerExitEventsIfNeeded();
        let point = void 0;
        if (event.x !== void 0 && event.y !== void 0) {
          point = event;
        }
        this.show(void 0, point);
      }]);
    } else if (this.touchGestures !== "off") {
      this._disableNativeGesturesIfNecessary();
      this._passiveListeners.push(["touchstart", (event) => {
        const touch = event.targetTouches?.[0];
        const origin = touch ? {
          x: touch.clientX,
          y: touch.clientY
        } : void 0;
        this._setupPointerExitEventsIfNeeded();
        clearTimeout(this._touchstartTimeout);
        const DEFAULT_LONGPRESS_DELAY = 500;
        this._touchstartTimeout = setTimeout(() => this.show(void 0, origin), this._defaultOptions.touchLongPressShowDelay ?? DEFAULT_LONGPRESS_DELAY);
      }]);
    }
    this._addListeners(this._passiveListeners);
  }
  _setupPointerExitEventsIfNeeded() {
    if (this._pointerExitEventsInitialized) {
      return;
    }
    this._pointerExitEventsInitialized = true;
    const exitListeners = [];
    if (this._platformSupportsMouseEvents()) {
      exitListeners.push(["mouseleave", (event) => {
        const newTarget = event.relatedTarget;
        if (!newTarget || !this._overlayRef?.overlayElement.contains(newTarget)) {
          this.hide();
        }
      }], ["wheel", (event) => this._wheelListener(event)]);
    } else if (this.touchGestures !== "off") {
      this._disableNativeGesturesIfNecessary();
      const touchendListener = () => {
        clearTimeout(this._touchstartTimeout);
        this.hide(this._defaultOptions.touchendHideDelay);
      };
      exitListeners.push(["touchend", touchendListener], ["touchcancel", touchendListener]);
    }
    this._addListeners(exitListeners);
    this._passiveListeners.push(...exitListeners);
  }
  _addListeners(listeners) {
    listeners.forEach(([event, listener]) => {
      this._elementRef.nativeElement.addEventListener(event, listener, passiveListenerOptions);
    });
  }
  _platformSupportsMouseEvents() {
    return !this._platform.IOS && !this._platform.ANDROID;
  }
  /** Listener for the `wheel` event on the element. */
  _wheelListener(event) {
    if (this._isTooltipVisible()) {
      const elementUnderPointer = this._document.elementFromPoint(event.clientX, event.clientY);
      const element = this._elementRef.nativeElement;
      if (elementUnderPointer !== element && !element.contains(elementUnderPointer)) {
        this.hide();
      }
    }
  }
  /** Disables the native browser gestures, based on how the tooltip has been configured. */
  _disableNativeGesturesIfNecessary() {
    const gestures = this.touchGestures;
    if (gestures !== "off") {
      const element = this._elementRef.nativeElement;
      const style2 = element.style;
      if (gestures === "on" || element.nodeName !== "INPUT" && element.nodeName !== "TEXTAREA") {
        style2.userSelect = style2.msUserSelect = style2.webkitUserSelect = style2.MozUserSelect = "none";
      }
      if (gestures === "on" || !element.draggable) {
        style2.webkitUserDrag = "none";
      }
      style2.touchAction = "none";
      style2.webkitTapHighlightColor = "transparent";
    }
  }
};
_MatTooltip.\u0275fac = function MatTooltip_Factory(t) {
  return new (t || _MatTooltip)(\u0275\u0275directiveInject(Overlay), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ScrollDispatcher), \u0275\u0275directiveInject(ViewContainerRef), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(Platform), \u0275\u0275directiveInject(AriaDescriber), \u0275\u0275directiveInject(FocusMonitor), \u0275\u0275directiveInject(MAT_TOOLTIP_SCROLL_STRATEGY), \u0275\u0275directiveInject(Directionality), \u0275\u0275directiveInject(MAT_TOOLTIP_DEFAULT_OPTIONS, 8), \u0275\u0275directiveInject(DOCUMENT2));
};
_MatTooltip.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _MatTooltip,
  selectors: [["", "matTooltip", ""]],
  hostAttrs: [1, "mat-mdc-tooltip-trigger"],
  hostVars: 2,
  hostBindings: function MatTooltip_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275classProp("mat-mdc-tooltip-disabled", ctx.disabled);
    }
  },
  inputs: {
    position: [0, "matTooltipPosition", "position"],
    positionAtOrigin: [0, "matTooltipPositionAtOrigin", "positionAtOrigin"],
    disabled: [0, "matTooltipDisabled", "disabled"],
    showDelay: [0, "matTooltipShowDelay", "showDelay"],
    hideDelay: [0, "matTooltipHideDelay", "hideDelay"],
    touchGestures: [0, "matTooltipTouchGestures", "touchGestures"],
    message: [0, "matTooltip", "message"],
    tooltipClass: [0, "matTooltipClass", "tooltipClass"]
  },
  exportAs: ["matTooltip"],
  standalone: true
});
var MatTooltip = _MatTooltip;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatTooltip, [{
    type: Directive,
    args: [{
      selector: "[matTooltip]",
      exportAs: "matTooltip",
      host: {
        "class": "mat-mdc-tooltip-trigger",
        "[class.mat-mdc-tooltip-disabled]": "disabled"
      },
      standalone: true
    }]
  }], () => [{
    type: Overlay
  }, {
    type: ElementRef
  }, {
    type: ScrollDispatcher
  }, {
    type: ViewContainerRef
  }, {
    type: NgZone
  }, {
    type: Platform
  }, {
    type: AriaDescriber
  }, {
    type: FocusMonitor
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [MAT_TOOLTIP_SCROLL_STRATEGY]
    }]
  }, {
    type: Directionality
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_TOOLTIP_DEFAULT_OPTIONS]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    position: [{
      type: Input,
      args: ["matTooltipPosition"]
    }],
    positionAtOrigin: [{
      type: Input,
      args: ["matTooltipPositionAtOrigin"]
    }],
    disabled: [{
      type: Input,
      args: ["matTooltipDisabled"]
    }],
    showDelay: [{
      type: Input,
      args: ["matTooltipShowDelay"]
    }],
    hideDelay: [{
      type: Input,
      args: ["matTooltipHideDelay"]
    }],
    touchGestures: [{
      type: Input,
      args: ["matTooltipTouchGestures"]
    }],
    message: [{
      type: Input,
      args: ["matTooltip"]
    }],
    tooltipClass: [{
      type: Input,
      args: ["matTooltipClass"]
    }]
  });
})();
var _TooltipComponent = class _TooltipComponent {
  constructor(_changeDetectorRef, _elementRef, animationMode) {
    this._changeDetectorRef = _changeDetectorRef;
    this._elementRef = _elementRef;
    this._isMultiline = false;
    this._closeOnInteraction = false;
    this._isVisible = false;
    this._onHide = new Subject();
    this._showAnimation = "mat-mdc-tooltip-show";
    this._hideAnimation = "mat-mdc-tooltip-hide";
    this._animationsDisabled = animationMode === "NoopAnimations";
  }
  /**
   * Shows the tooltip with an animation originating from the provided origin
   * @param delay Amount of milliseconds to the delay showing the tooltip.
   */
  show(delay2) {
    if (this._hideTimeoutId != null) {
      clearTimeout(this._hideTimeoutId);
    }
    this._showTimeoutId = setTimeout(() => {
      this._toggleVisibility(true);
      this._showTimeoutId = void 0;
    }, delay2);
  }
  /**
   * Begins the animation to hide the tooltip after the provided delay in ms.
   * @param delay Amount of milliseconds to delay showing the tooltip.
   */
  hide(delay2) {
    if (this._showTimeoutId != null) {
      clearTimeout(this._showTimeoutId);
    }
    this._hideTimeoutId = setTimeout(() => {
      this._toggleVisibility(false);
      this._hideTimeoutId = void 0;
    }, delay2);
  }
  /** Returns an observable that notifies when the tooltip has been hidden from view. */
  afterHidden() {
    return this._onHide;
  }
  /** Whether the tooltip is being displayed. */
  isVisible() {
    return this._isVisible;
  }
  ngOnDestroy() {
    this._cancelPendingAnimations();
    this._onHide.complete();
    this._triggerElement = null;
  }
  /**
   * Interactions on the HTML body should close the tooltip immediately as defined in the
   * material design spec.
   * https://material.io/design/components/tooltips.html#behavior
   */
  _handleBodyInteraction() {
    if (this._closeOnInteraction) {
      this.hide(0);
    }
  }
  /**
   * Marks that the tooltip needs to be checked in the next change detection run.
   * Mainly used for rendering the initial text before positioning a tooltip, which
   * can be problematic in components with OnPush change detection.
   */
  _markForCheck() {
    this._changeDetectorRef.markForCheck();
  }
  _handleMouseLeave({
    relatedTarget
  }) {
    if (!relatedTarget || !this._triggerElement.contains(relatedTarget)) {
      if (this.isVisible()) {
        this.hide(this._mouseLeaveHideDelay);
      } else {
        this._finalizeAnimation(false);
      }
    }
  }
  /**
   * Callback for when the timeout in this.show() gets completed.
   * This method is only needed by the mdc-tooltip, and so it is only implemented
   * in the mdc-tooltip, not here.
   */
  _onShow() {
    this._isMultiline = this._isTooltipMultiline();
    this._markForCheck();
  }
  /** Whether the tooltip text has overflown to the next line */
  _isTooltipMultiline() {
    const rect = this._elementRef.nativeElement.getBoundingClientRect();
    return rect.height > MIN_HEIGHT && rect.width >= MAX_WIDTH;
  }
  /** Event listener dispatched when an animation on the tooltip finishes. */
  _handleAnimationEnd({
    animationName
  }) {
    if (animationName === this._showAnimation || animationName === this._hideAnimation) {
      this._finalizeAnimation(animationName === this._showAnimation);
    }
  }
  /** Cancels any pending animation sequences. */
  _cancelPendingAnimations() {
    if (this._showTimeoutId != null) {
      clearTimeout(this._showTimeoutId);
    }
    if (this._hideTimeoutId != null) {
      clearTimeout(this._hideTimeoutId);
    }
    this._showTimeoutId = this._hideTimeoutId = void 0;
  }
  /** Handles the cleanup after an animation has finished. */
  _finalizeAnimation(toVisible) {
    if (toVisible) {
      this._closeOnInteraction = true;
    } else if (!this.isVisible()) {
      this._onHide.next();
    }
  }
  /** Toggles the visibility of the tooltip element. */
  _toggleVisibility(isVisible) {
    const tooltip = this._tooltip.nativeElement;
    const showClass = this._showAnimation;
    const hideClass = this._hideAnimation;
    tooltip.classList.remove(isVisible ? hideClass : showClass);
    tooltip.classList.add(isVisible ? showClass : hideClass);
    if (this._isVisible !== isVisible) {
      this._isVisible = isVisible;
      this._changeDetectorRef.markForCheck();
    }
    if (isVisible && !this._animationsDisabled && typeof getComputedStyle === "function") {
      const styles = getComputedStyle(tooltip);
      if (styles.getPropertyValue("animation-duration") === "0s" || styles.getPropertyValue("animation-name") === "none") {
        this._animationsDisabled = true;
      }
    }
    if (isVisible) {
      this._onShow();
    }
    if (this._animationsDisabled) {
      tooltip.classList.add("_mat-animation-noopable");
      this._finalizeAnimation(isVisible);
    }
  }
};
_TooltipComponent.\u0275fac = function TooltipComponent_Factory(t) {
  return new (t || _TooltipComponent)(\u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ANIMATION_MODULE_TYPE, 8));
};
_TooltipComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _TooltipComponent,
  selectors: [["mat-tooltip-component"]],
  viewQuery: function TooltipComponent_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c06, 7);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._tooltip = _t.first);
    }
  },
  hostAttrs: ["aria-hidden", "true"],
  hostVars: 2,
  hostBindings: function TooltipComponent_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("mouseleave", function TooltipComponent_mouseleave_HostBindingHandler($event) {
        return ctx._handleMouseLeave($event);
      });
    }
    if (rf & 2) {
      \u0275\u0275styleProp("zoom", ctx.isVisible() ? 1 : null);
    }
  },
  standalone: true,
  features: [\u0275\u0275StandaloneFeature],
  decls: 4,
  vars: 4,
  consts: [["tooltip", ""], [1, "mdc-tooltip", "mdc-tooltip--shown", "mat-mdc-tooltip", 3, "animationend", "ngClass"], [1, "mdc-tooltip__surface", "mdc-tooltip__surface-animation"]],
  template: function TooltipComponent_Template(rf, ctx) {
    if (rf & 1) {
      const _r1 = \u0275\u0275getCurrentView();
      \u0275\u0275elementStart(0, "div", 1, 0);
      \u0275\u0275listener("animationend", function TooltipComponent_Template_div_animationend_0_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx._handleAnimationEnd($event));
      });
      \u0275\u0275elementStart(2, "div", 2);
      \u0275\u0275text(3);
      \u0275\u0275elementEnd()();
    }
    if (rf & 2) {
      \u0275\u0275classProp("mdc-tooltip--multiline", ctx._isMultiline);
      \u0275\u0275property("ngClass", ctx.tooltipClass);
      \u0275\u0275advance(3);
      \u0275\u0275textInterpolate(ctx.message);
    }
  },
  dependencies: [NgClass],
  styles: ['.mdc-tooltip__surface{word-break:break-all;word-break:var(--mdc-tooltip-word-break, normal);overflow-wrap:anywhere}.mdc-tooltip--showing-transition .mdc-tooltip__surface-animation{transition:opacity 150ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 150ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-tooltip--hide-transition .mdc-tooltip__surface-animation{transition:opacity 75ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-tooltip{position:fixed;display:none;z-index:9}.mdc-tooltip-wrapper--rich{position:relative}.mdc-tooltip--shown,.mdc-tooltip--showing,.mdc-tooltip--hide{display:inline-flex}.mdc-tooltip--shown.mdc-tooltip--rich,.mdc-tooltip--showing.mdc-tooltip--rich,.mdc-tooltip--hide.mdc-tooltip--rich{display:inline-block;left:-320px;position:absolute}.mdc-tooltip__surface{line-height:16px;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center}.mdc-tooltip__surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-tooltip__surface::before{border-color:CanvasText}}.mdc-tooltip--rich .mdc-tooltip__surface{align-items:flex-start;display:flex;flex-direction:column;min-height:24px;min-width:40px;max-width:320px;position:relative}.mdc-tooltip--multiline .mdc-tooltip__surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mdc-tooltip__surface,.mdc-tooltip--multiline .mdc-tooltip__surface[dir=rtl]{text-align:right}.mdc-tooltip__surface .mdc-tooltip__title{margin:0 8px}.mdc-tooltip__surface .mdc-tooltip__content{max-width:calc(200px - 2*8px);margin:8px;text-align:left}[dir=rtl] .mdc-tooltip__surface .mdc-tooltip__content,.mdc-tooltip__surface .mdc-tooltip__content[dir=rtl]{text-align:right}.mdc-tooltip--rich .mdc-tooltip__surface .mdc-tooltip__content{max-width:calc(320px - 2*8px);align-self:stretch}.mdc-tooltip__surface .mdc-tooltip__content-link{text-decoration:none}.mdc-tooltip--rich-actions,.mdc-tooltip__content,.mdc-tooltip__title{z-index:1}.mdc-tooltip__surface-animation{opacity:0;transform:scale(0.8);will-change:transform,opacity}.mdc-tooltip--shown .mdc-tooltip__surface-animation{transform:scale(1);opacity:1}.mdc-tooltip--hide .mdc-tooltip__surface-animation{transform:scale(1)}.mdc-tooltip__caret-surface-top,.mdc-tooltip__caret-surface-bottom{position:absolute;height:24px;width:24px;transform:rotate(35deg) skewY(20deg) scaleX(0.9396926208)}.mdc-tooltip__caret-surface-top .mdc-elevation-overlay,.mdc-tooltip__caret-surface-bottom .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-tooltip__caret-surface-bottom{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);outline:1px solid rgba(0,0,0,0);z-index:-1}@media screen and (forced-colors: active){.mdc-tooltip__caret-surface-bottom{outline-color:CanvasText}}.mat-mdc-tooltip .mdc-tooltip__surface{background-color:var(--mdc-plain-tooltip-container-color)}.mat-mdc-tooltip .mdc-tooltip__surface{border-radius:var(--mdc-plain-tooltip-container-shape)}.mat-mdc-tooltip .mdc-tooltip__caret-surface-top,.mat-mdc-tooltip .mdc-tooltip__caret-surface-bottom{border-radius:var(--mdc-plain-tooltip-container-shape)}.mat-mdc-tooltip .mdc-tooltip__surface{color:var(--mdc-plain-tooltip-supporting-text-color)}.mat-mdc-tooltip .mdc-tooltip__surface{font-family:var(--mdc-plain-tooltip-supporting-text-font);line-height:var(--mdc-plain-tooltip-supporting-text-line-height);font-size:var(--mdc-plain-tooltip-supporting-text-size);font-weight:var(--mdc-plain-tooltip-supporting-text-weight);letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking)}.mat-mdc-tooltip{position:relative;transform:scale(0)}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}'],
  encapsulation: 2,
  changeDetection: 0
});
var TooltipComponent = _TooltipComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TooltipComponent, [{
    type: Component,
    args: [{
      selector: "mat-tooltip-component",
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      host: {
        // Forces the element to have a layout in IE and Edge. This fixes issues where the element
        // won't be rendered if the animations are disabled or there is no web animations polyfill.
        "[style.zoom]": "isVisible() ? 1 : null",
        "(mouseleave)": "_handleMouseLeave($event)",
        "aria-hidden": "true"
      },
      standalone: true,
      imports: [NgClass],
      template: '<div\n  #tooltip\n  class="mdc-tooltip mdc-tooltip--shown mat-mdc-tooltip"\n  [ngClass]="tooltipClass"\n  (animationend)="_handleAnimationEnd($event)"\n  [class.mdc-tooltip--multiline]="_isMultiline">\n  <div class="mdc-tooltip__surface mdc-tooltip__surface-animation">{{message}}</div>\n</div>\n',
      styles: ['.mdc-tooltip__surface{word-break:break-all;word-break:var(--mdc-tooltip-word-break, normal);overflow-wrap:anywhere}.mdc-tooltip--showing-transition .mdc-tooltip__surface-animation{transition:opacity 150ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 150ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-tooltip--hide-transition .mdc-tooltip__surface-animation{transition:opacity 75ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-tooltip{position:fixed;display:none;z-index:9}.mdc-tooltip-wrapper--rich{position:relative}.mdc-tooltip--shown,.mdc-tooltip--showing,.mdc-tooltip--hide{display:inline-flex}.mdc-tooltip--shown.mdc-tooltip--rich,.mdc-tooltip--showing.mdc-tooltip--rich,.mdc-tooltip--hide.mdc-tooltip--rich{display:inline-block;left:-320px;position:absolute}.mdc-tooltip__surface{line-height:16px;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center}.mdc-tooltip__surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-tooltip__surface::before{border-color:CanvasText}}.mdc-tooltip--rich .mdc-tooltip__surface{align-items:flex-start;display:flex;flex-direction:column;min-height:24px;min-width:40px;max-width:320px;position:relative}.mdc-tooltip--multiline .mdc-tooltip__surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mdc-tooltip__surface,.mdc-tooltip--multiline .mdc-tooltip__surface[dir=rtl]{text-align:right}.mdc-tooltip__surface .mdc-tooltip__title{margin:0 8px}.mdc-tooltip__surface .mdc-tooltip__content{max-width:calc(200px - 2*8px);margin:8px;text-align:left}[dir=rtl] .mdc-tooltip__surface .mdc-tooltip__content,.mdc-tooltip__surface .mdc-tooltip__content[dir=rtl]{text-align:right}.mdc-tooltip--rich .mdc-tooltip__surface .mdc-tooltip__content{max-width:calc(320px - 2*8px);align-self:stretch}.mdc-tooltip__surface .mdc-tooltip__content-link{text-decoration:none}.mdc-tooltip--rich-actions,.mdc-tooltip__content,.mdc-tooltip__title{z-index:1}.mdc-tooltip__surface-animation{opacity:0;transform:scale(0.8);will-change:transform,opacity}.mdc-tooltip--shown .mdc-tooltip__surface-animation{transform:scale(1);opacity:1}.mdc-tooltip--hide .mdc-tooltip__surface-animation{transform:scale(1)}.mdc-tooltip__caret-surface-top,.mdc-tooltip__caret-surface-bottom{position:absolute;height:24px;width:24px;transform:rotate(35deg) skewY(20deg) scaleX(0.9396926208)}.mdc-tooltip__caret-surface-top .mdc-elevation-overlay,.mdc-tooltip__caret-surface-bottom .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-tooltip__caret-surface-bottom{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);outline:1px solid rgba(0,0,0,0);z-index:-1}@media screen and (forced-colors: active){.mdc-tooltip__caret-surface-bottom{outline-color:CanvasText}}.mat-mdc-tooltip .mdc-tooltip__surface{background-color:var(--mdc-plain-tooltip-container-color)}.mat-mdc-tooltip .mdc-tooltip__surface{border-radius:var(--mdc-plain-tooltip-container-shape)}.mat-mdc-tooltip .mdc-tooltip__caret-surface-top,.mat-mdc-tooltip .mdc-tooltip__caret-surface-bottom{border-radius:var(--mdc-plain-tooltip-container-shape)}.mat-mdc-tooltip .mdc-tooltip__surface{color:var(--mdc-plain-tooltip-supporting-text-color)}.mat-mdc-tooltip .mdc-tooltip__surface{font-family:var(--mdc-plain-tooltip-supporting-text-font);line-height:var(--mdc-plain-tooltip-supporting-text-line-height);font-size:var(--mdc-plain-tooltip-supporting-text-size);font-weight:var(--mdc-plain-tooltip-supporting-text-weight);letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking)}.mat-mdc-tooltip{position:relative;transform:scale(0)}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}']
    }]
  }], () => [{
    type: ChangeDetectorRef
  }, {
    type: ElementRef
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [ANIMATION_MODULE_TYPE]
    }]
  }], {
    _tooltip: [{
      type: ViewChild,
      args: ["tooltip", {
        // Use a static query here since we interact directly with
        // the DOM which can happen before `ngAfterViewInit`.
        static: true
      }]
    }]
  });
})();
var matTooltipAnimations = {
  /** Animation that transitions a tooltip in and out. */
  tooltipState: trigger("state", [
    // TODO(crisbeto): these values are based on MDC's CSS.
    // We should be able to use their styles directly once we land #19432.
    state("initial, void, hidden", style({
      opacity: 0,
      transform: "scale(0.8)"
    })),
    state("visible", style({
      transform: "scale(1)"
    })),
    transition("* => visible", animate("150ms cubic-bezier(0, 0, 0.2, 1)")),
    transition("* => hidden", animate("75ms cubic-bezier(0.4, 0, 1, 1)"))
  ])
};
var _MatTooltipModule = class _MatTooltipModule {
};
_MatTooltipModule.\u0275fac = function MatTooltipModule_Factory(t) {
  return new (t || _MatTooltipModule)();
};
_MatTooltipModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatTooltipModule
});
_MatTooltipModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER],
  imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule, MatCommonModule, CdkScrollableModule]
});
var MatTooltipModule = _MatTooltipModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatTooltipModule, [{
    type: NgModule,
    args: [{
      imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule, MatTooltip, TooltipComponent],
      exports: [MatTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule],
      providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER]
    }]
  }], null, null);
})();

// projects/sc-street-address/src/app/street-address/street-address.component.ts
var $3 = __toESM(require_jquery());

// projects/formbird-mapping/src/lib/scl-map-constant.service.ts
var _SclMapConstantService = class _SclMapConstantService {
  // 15754
};
_SclMapConstantService.MAP_PRIMARY_ASSET = "https://fileshare.formbird.com/fb/sc-component/map-icons/primary.png";
_SclMapConstantService.MAP_SECONDARY_ASSET = "https://fileshare.formbird.com/fb/sc-component/map-icons/secondary.png";
_SclMapConstantService.MAP_MARKER = "https://fileshare.formbird.com/fb/sc-component/map-icons/marker.png";
_SclMapConstantService.ASSET_PRIMARY_TYPE = "primaryAsset";
_SclMapConstantService.ASSET_SECONDARY_TYPE = "secondaryAsset";
_SclMapConstantService.AVL_SPEED_BEGINNING = "https://fileshare.formbird.com/fb/sc-component/map-icons/pin30";
_SclMapConstantService.HEADING_THRESHOLD_H0 = 22.5;
_SclMapConstantService.HEADING_THRESHOLD_H1 = 67.5;
_SclMapConstantService.HEADING_THRESHOLD_H2 = 112.5;
_SclMapConstantService.HEADING_THRESHOLD_H3 = 157.5;
_SclMapConstantService.HEADING_THRESHOLD_H4 = 202.5;
_SclMapConstantService.HEADING_THRESHOLD_H5 = 247.5;
_SclMapConstantService.HEADING_THRESHOLD_H6 = 292.5;
_SclMapConstantService.HEADING_THRESHOLD_H7 = 337.5;
_SclMapConstantService.DEFAULT_SEARCH_DELAY = 500;
_SclMapConstantService.DEFAULT_SEARCH_LENGTH = 3;
_SclMapConstantService.AVL_SPEED_H0 = "_h0";
_SclMapConstantService.AVL_SPEED_H1 = "_h1";
_SclMapConstantService.AVL_SPEED_H2 = "_h2";
_SclMapConstantService.AVL_SPEED_H3 = "_h3";
_SclMapConstantService.AVL_SPEED_H4 = "_h4";
_SclMapConstantService.AVL_SPEED_H5 = "_h5";
_SclMapConstantService.AVL_SPEED_H6 = "_h6";
_SclMapConstantService.AVL_SPEED_H7 = "_h7";
_SclMapConstantService.EPSG_3857 = "EPSG:3857";
_SclMapConstantService.EPSG_4326 = "EPSG:4326";
_SclMapConstantService.MAP_MARKER_ARROW = "https://fileshare.formbird.com/fb/sc-component/map-icons/arrow.png";
_SclMapConstantService.MAP_MARKER_CROSS_GREEN = "https://fileshare.formbird.com/fb/sc-component/map-icons/CrosshairGreen.gif";
_SclMapConstantService.COMP_TYPE_BOUNDARY = 0;
_SclMapConstantService.COMP_TYPE_ADDRESS_MAP = 1;
_SclMapConstantService.COMP_TYPE_STREET_ADDRESS = 2;
_SclMapConstantService.COMP_TYPE_SELECTED_ASSET = 3;
_SclMapConstantService.DRAWING_MODE_ALL = 0;
_SclMapConstantService.DRAWING_MODE_SINGLE = 1;
_SclMapConstantService.DRAWING_MODE_MULTI = 2;
_SclMapConstantService.DRAWING_MULTI_POINT = "mp";
_SclMapConstantService.DRAWING_MULTI_RECTANGLE = "mr";
_SclMapConstantService.DRAWING_MULTI_POLYGON = "mo";
_SclMapConstantService.DRAWING_MULTI_LINE_STRING = "ml";
_SclMapConstantService.DRAWING_MULTI_CIRCLE = "mc";
_SclMapConstantService.DRAWING_MULTI_SQUARE = "ms";
_SclMapConstantService.DRAWING_STYLING_COLOR = "dsc";
_SclMapConstantService.DRAWING_STYLING_LINE_WIDTH = "dslw";
_SclMapConstantService.DRAWING_STYLING_LINE_DASH = "dsld";
_SclMapConstantService.DRAWING_STYLING_ICON = "dsi";
_SclMapConstantService.DRAWING_STYLING_FONT = "dsf";
_SclMapConstantService.DRAWING_STYLING_FONT_SIZE = "dsfs";
_SclMapConstantService.DRAWING_ARROW_HEAD_AT_LAST_POINT = "atLastPoint";
_SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT = "atFirstPoint";
_SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX = "text";
_SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT = "atFirstPoint";
_SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_LAST_POINT = "atLastPoint";
_SclMapConstantService.DRAWING_SPECIAL_ICON = "icon";
_SclMapConstantService.DRAWING_SPECIAL_DIMENSION = "dimension";
_SclMapConstantService.DRAWING_ACTION_SELECT = "select";
_SclMapConstantService.DRAWING_ACTION_MENU = "menu";
_SclMapConstantService.DRAWING_ACTION_DELETE = "delete";
_SclMapConstantService.DRAWING_ACTION_LOCATION = "location";
_SclMapConstantService.DRAWING_ACTION_EDIT = "edit";
_SclMapConstantService.DRAWING_ACTION_MODE = "mode";
_SclMapConstantService.DRAWING_ACTION_NA = "";
_SclMapConstantService.ASSET_SELECTION_MODE_POINT = "point";
_SclMapConstantService.ASSET_SELECTION_MODE_ASSET = "asset";
_SclMapConstantService.STREET = {
  type: "Feature",
  properties: {
    type: "street",
    unitNo: "",
    streetNo: "",
    street: "",
    suburb: "",
    postcode: "",
    locationDescription: "",
    country: "",
    iconImage: "",
    iconSize: "",
    state: ""
  },
  geometry: {
    type: "Point",
    coordinates: []
  }
};
_SclMapConstantService.DEFAULT_MAP_PARAMETERS = {
  mapViews: [
    {
      serverType: "tile",
      url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
      crossOrigin: null
    }
  ]
};
var SclMapConstantService = _SclMapConstantService;

// node_modules/ol/events/Event.js
var BaseEvent = (
  /** @class */
  function() {
    function BaseEvent2(type) {
      this.propagationStopped;
      this.defaultPrevented;
      this.type = type;
      this.target = null;
    }
    BaseEvent2.prototype.preventDefault = function() {
      this.defaultPrevented = true;
    };
    BaseEvent2.prototype.stopPropagation = function() {
      this.propagationStopped = true;
    };
    return BaseEvent2;
  }()
);
var Event_default = BaseEvent;

// node_modules/ol/ObjectEventType.js
var ObjectEventType_default = {
  /**
   * Triggered when a property is changed.
   * @event module:ol/Object.ObjectEvent#propertychange
   * @api
   */
  PROPERTYCHANGE: "propertychange"
};

// node_modules/ol/Disposable.js
var Disposable = (
  /** @class */
  function() {
    function Disposable2() {
      this.disposed = false;
    }
    Disposable2.prototype.dispose = function() {
      if (!this.disposed) {
        this.disposed = true;
        this.disposeInternal();
      }
    };
    Disposable2.prototype.disposeInternal = function() {
    };
    return Disposable2;
  }()
);
var Disposable_default = Disposable;

// node_modules/ol/array.js
function binarySearch(haystack, needle, opt_comparator) {
  var mid, cmp;
  var comparator = opt_comparator || numberSafeCompareFunction;
  var low = 0;
  var high = haystack.length;
  var found = false;
  while (low < high) {
    mid = low + (high - low >> 1);
    cmp = +comparator(haystack[mid], needle);
    if (cmp < 0) {
      low = mid + 1;
    } else {
      high = mid;
      found = !cmp;
    }
  }
  return found ? low : ~low;
}
function numberSafeCompareFunction(a, b) {
  return a > b ? 1 : a < b ? -1 : 0;
}
function includes(arr, obj) {
  return arr.indexOf(obj) >= 0;
}
function linearFindNearest(arr, target, direction) {
  var n = arr.length;
  if (arr[0] <= target) {
    return 0;
  } else if (target <= arr[n - 1]) {
    return n - 1;
  } else {
    var i2 = void 0;
    if (direction > 0) {
      for (i2 = 1; i2 < n; ++i2) {
        if (arr[i2] < target) {
          return i2 - 1;
        }
      }
    } else if (direction < 0) {
      for (i2 = 1; i2 < n; ++i2) {
        if (arr[i2] <= target) {
          return i2;
        }
      }
    } else {
      for (i2 = 1; i2 < n; ++i2) {
        if (arr[i2] == target) {
          return i2;
        } else if (arr[i2] < target) {
          if (typeof direction === "function") {
            if (direction(target, arr[i2 - 1], arr[i2]) > 0) {
              return i2 - 1;
            } else {
              return i2;
            }
          } else if (arr[i2 - 1] - target < target - arr[i2]) {
            return i2 - 1;
          } else {
            return i2;
          }
        }
      }
    }
    return n - 1;
  }
}
function reverseSubArray(arr, begin, end) {
  while (begin < end) {
    var tmp = arr[begin];
    arr[begin] = arr[end];
    arr[end] = tmp;
    ++begin;
    --end;
  }
}
function extend(arr, data) {
  var extension = Array.isArray(data) ? data : [data];
  var length = extension.length;
  for (var i2 = 0; i2 < length; i2++) {
    arr[arr.length] = extension[i2];
  }
}
function equals(arr1, arr2) {
  var len1 = arr1.length;
  if (len1 !== arr2.length) {
    return false;
  }
  for (var i2 = 0; i2 < len1; i2++) {
    if (arr1[i2] !== arr2[i2]) {
      return false;
    }
  }
  return true;
}
function isSorted(arr, opt_func, opt_strict) {
  var compare3 = opt_func || numberSafeCompareFunction;
  return arr.every(function(currentVal, index) {
    if (index === 0) {
      return true;
    }
    var res = compare3(arr[index - 1], currentVal);
    return !(res > 0 || opt_strict && res === 0);
  });
}

// node_modules/ol/functions.js
function TRUE() {
  return true;
}
function FALSE() {
  return false;
}
function VOID() {
}
function memoizeOne(fn) {
  var called = false;
  var lastResult;
  var lastArgs;
  var lastThis;
  return function() {
    var nextArgs = Array.prototype.slice.call(arguments);
    if (!called || this !== lastThis || !equals(nextArgs, lastArgs)) {
      called = true;
      lastThis = this;
      lastArgs = nextArgs;
      lastResult = fn.apply(this, arguments);
    }
    return lastResult;
  };
}

// node_modules/ol/obj.js
var assign = typeof Object.assign === "function" ? Object.assign : function(target, var_sources) {
  if (target === void 0 || target === null) {
    throw new TypeError("Cannot convert undefined or null to object");
  }
  var output = Object(target);
  for (var i2 = 1, ii = arguments.length; i2 < ii; ++i2) {
    var source = arguments[i2];
    if (source !== void 0 && source !== null) {
      for (var key in source) {
        if (source.hasOwnProperty(key)) {
          output[key] = source[key];
        }
      }
    }
  }
  return output;
};
function clear(object) {
  for (var property in object) {
    delete object[property];
  }
}
var getValues = typeof Object.values === "function" ? Object.values : function(object) {
  var values = [];
  for (var property in object) {
    values.push(object[property]);
  }
  return values;
};
function isEmpty(object) {
  var property;
  for (property in object) {
    return false;
  }
  return !property;
}

// node_modules/ol/events/Target.js
var __extends = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Target = (
  /** @class */
  function(_super) {
    __extends(Target2, _super);
    function Target2(opt_target) {
      var _this = _super.call(this) || this;
      _this.eventTarget_ = opt_target;
      _this.pendingRemovals_ = null;
      _this.dispatching_ = null;
      _this.listeners_ = null;
      return _this;
    }
    Target2.prototype.addEventListener = function(type, listener) {
      if (!type || !listener) {
        return;
      }
      var listeners = this.listeners_ || (this.listeners_ = {});
      var listenersForType = listeners[type] || (listeners[type] = []);
      if (listenersForType.indexOf(listener) === -1) {
        listenersForType.push(listener);
      }
    };
    Target2.prototype.dispatchEvent = function(event) {
      var isString2 = typeof event === "string";
      var type = isString2 ? event : event.type;
      var listeners = this.listeners_ && this.listeners_[type];
      if (!listeners) {
        return;
      }
      var evt = isString2 ? new Event_default(event) : (
        /** @type {Event} */
        event
      );
      if (!evt.target) {
        evt.target = this.eventTarget_ || this;
      }
      var dispatching = this.dispatching_ || (this.dispatching_ = {});
      var pendingRemovals = this.pendingRemovals_ || (this.pendingRemovals_ = {});
      if (!(type in dispatching)) {
        dispatching[type] = 0;
        pendingRemovals[type] = 0;
      }
      ++dispatching[type];
      var propagate;
      for (var i2 = 0, ii = listeners.length; i2 < ii; ++i2) {
        if ("handleEvent" in listeners[i2]) {
          propagate = /** @type {import("../events.js").ListenerObject} */
          listeners[i2].handleEvent(evt);
        } else {
          propagate = /** @type {import("../events.js").ListenerFunction} */
          listeners[i2].call(this, evt);
        }
        if (propagate === false || evt.propagationStopped) {
          propagate = false;
          break;
        }
      }
      if (--dispatching[type] === 0) {
        var pr = pendingRemovals[type];
        delete pendingRemovals[type];
        while (pr--) {
          this.removeEventListener(type, VOID);
        }
        delete dispatching[type];
      }
      return propagate;
    };
    Target2.prototype.disposeInternal = function() {
      this.listeners_ && clear(this.listeners_);
    };
    Target2.prototype.getListeners = function(type) {
      return this.listeners_ && this.listeners_[type] || void 0;
    };
    Target2.prototype.hasListener = function(opt_type) {
      if (!this.listeners_) {
        return false;
      }
      return opt_type ? opt_type in this.listeners_ : Object.keys(this.listeners_).length > 0;
    };
    Target2.prototype.removeEventListener = function(type, listener) {
      var listeners = this.listeners_ && this.listeners_[type];
      if (listeners) {
        var index = listeners.indexOf(listener);
        if (index !== -1) {
          if (this.pendingRemovals_ && type in this.pendingRemovals_) {
            listeners[index] = VOID;
            ++this.pendingRemovals_[type];
          } else {
            listeners.splice(index, 1);
            if (listeners.length === 0) {
              delete this.listeners_[type];
            }
          }
        }
      }
    };
    return Target2;
  }(Disposable_default)
);
var Target_default = Target;

// node_modules/ol/events/EventType.js
var EventType_default = {
  /**
   * Generic change event. Triggered when the revision counter is increased.
   * @event module:ol/events/Event~BaseEvent#change
   * @api
   */
  CHANGE: "change",
  /**
   * Generic error event. Triggered when an error occurs.
   * @event module:ol/events/Event~BaseEvent#error
   * @api
   */
  ERROR: "error",
  BLUR: "blur",
  CLEAR: "clear",
  CONTEXTMENU: "contextmenu",
  CLICK: "click",
  DBLCLICK: "dblclick",
  DRAGENTER: "dragenter",
  DRAGOVER: "dragover",
  DROP: "drop",
  FOCUS: "focus",
  KEYDOWN: "keydown",
  KEYPRESS: "keypress",
  LOAD: "load",
  RESIZE: "resize",
  TOUCHMOVE: "touchmove",
  WHEEL: "wheel"
};

// node_modules/ol/events.js
function listen(target, type, listener, opt_this, opt_once) {
  if (opt_this && opt_this !== target) {
    listener = listener.bind(opt_this);
  }
  if (opt_once) {
    var originalListener_1 = listener;
    listener = function() {
      target.removeEventListener(type, listener);
      originalListener_1.apply(this, arguments);
    };
  }
  var eventsKey = {
    target,
    type,
    listener
  };
  target.addEventListener(type, listener);
  return eventsKey;
}
function listenOnce(target, type, listener, opt_this) {
  return listen(target, type, listener, opt_this, true);
}
function unlistenByKey(key) {
  if (key && key.target) {
    key.target.removeEventListener(key.type, key.listener);
    clear(key);
  }
}

// node_modules/ol/Observable.js
var __extends2 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Observable2 = (
  /** @class */
  function(_super) {
    __extends2(Observable3, _super);
    function Observable3() {
      var _this = _super.call(this) || this;
      _this.on = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
      _this.onInternal;
      _this.once = /** @type {ObservableOnSignature<import("./events").EventsKey>} */
      _this.onceInternal;
      _this.un = /** @type {ObservableOnSignature<void>} */
      _this.unInternal;
      _this.revision_ = 0;
      return _this;
    }
    Observable3.prototype.changed = function() {
      ++this.revision_;
      this.dispatchEvent(EventType_default.CHANGE);
    };
    Observable3.prototype.getRevision = function() {
      return this.revision_;
    };
    Observable3.prototype.onInternal = function(type, listener) {
      if (Array.isArray(type)) {
        var len = type.length;
        var keys = new Array(len);
        for (var i2 = 0; i2 < len; ++i2) {
          keys[i2] = listen(this, type[i2], listener);
        }
        return keys;
      } else {
        return listen(
          this,
          /** @type {string} */
          type,
          listener
        );
      }
    };
    Observable3.prototype.onceInternal = function(type, listener) {
      var key;
      if (Array.isArray(type)) {
        var len = type.length;
        key = new Array(len);
        for (var i2 = 0; i2 < len; ++i2) {
          key[i2] = listenOnce(this, type[i2], listener);
        }
      } else {
        key = listenOnce(
          this,
          /** @type {string} */
          type,
          listener
        );
      }
      listener.ol_key = key;
      return key;
    };
    Observable3.prototype.unInternal = function(type, listener) {
      var key = (
        /** @type {Object} */
        listener.ol_key
      );
      if (key) {
        unByKey(key);
      } else if (Array.isArray(type)) {
        for (var i2 = 0, ii = type.length; i2 < ii; ++i2) {
          this.removeEventListener(type[i2], listener);
        }
      } else {
        this.removeEventListener(type, listener);
      }
    };
    return Observable3;
  }(Target_default)
);
Observable2.prototype.on;
Observable2.prototype.once;
Observable2.prototype.un;
function unByKey(key) {
  if (Array.isArray(key)) {
    for (var i2 = 0, ii = key.length; i2 < ii; ++i2) {
      unlistenByKey(key[i2]);
    }
  } else {
    unlistenByKey(
      /** @type {import("./events.js").EventsKey} */
      key
    );
  }
}
var Observable_default = Observable2;

// node_modules/ol/util.js
function abstract() {
  return (
    /** @type {?} */
    function() {
      throw new Error("Unimplemented abstract method.");
    }()
  );
}
var uidCounter_ = 0;
function getUid(obj) {
  return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));
}
var VERSION7 = "6.15.1";

// node_modules/ol/Object.js
var __extends3 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ObjectEvent = (
  /** @class */
  function(_super) {
    __extends3(ObjectEvent2, _super);
    function ObjectEvent2(type, key, oldValue) {
      var _this = _super.call(this, type) || this;
      _this.key = key;
      _this.oldValue = oldValue;
      return _this;
    }
    return ObjectEvent2;
  }(Event_default)
);
var BaseObject = (
  /** @class */
  function(_super) {
    __extends3(BaseObject2, _super);
    function BaseObject2(opt_values) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      getUid(_this);
      _this.values_ = null;
      if (opt_values !== void 0) {
        _this.setProperties(opt_values);
      }
      return _this;
    }
    BaseObject2.prototype.get = function(key) {
      var value;
      if (this.values_ && this.values_.hasOwnProperty(key)) {
        value = this.values_[key];
      }
      return value;
    };
    BaseObject2.prototype.getKeys = function() {
      return this.values_ && Object.keys(this.values_) || [];
    };
    BaseObject2.prototype.getProperties = function() {
      return this.values_ && assign({}, this.values_) || {};
    };
    BaseObject2.prototype.hasProperties = function() {
      return !!this.values_;
    };
    BaseObject2.prototype.notify = function(key, oldValue) {
      var eventType;
      eventType = "change:".concat(key);
      if (this.hasListener(eventType)) {
        this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
      }
      eventType = ObjectEventType_default.PROPERTYCHANGE;
      if (this.hasListener(eventType)) {
        this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
      }
    };
    BaseObject2.prototype.addChangeListener = function(key, listener) {
      this.addEventListener("change:".concat(key), listener);
    };
    BaseObject2.prototype.removeChangeListener = function(key, listener) {
      this.removeEventListener("change:".concat(key), listener);
    };
    BaseObject2.prototype.set = function(key, value, opt_silent) {
      var values = this.values_ || (this.values_ = {});
      if (opt_silent) {
        values[key] = value;
      } else {
        var oldValue = values[key];
        values[key] = value;
        if (oldValue !== value) {
          this.notify(key, oldValue);
        }
      }
    };
    BaseObject2.prototype.setProperties = function(values, opt_silent) {
      for (var key in values) {
        this.set(key, values[key], opt_silent);
      }
    };
    BaseObject2.prototype.applyProperties = function(source) {
      if (!source.values_) {
        return;
      }
      assign(this.values_ || (this.values_ = {}), source.values_);
    };
    BaseObject2.prototype.unset = function(key, opt_silent) {
      if (this.values_ && key in this.values_) {
        var oldValue = this.values_[key];
        delete this.values_[key];
        if (isEmpty(this.values_)) {
          this.values_ = null;
        }
        if (!opt_silent) {
          this.notify(key, oldValue);
        }
      }
    };
    return BaseObject2;
  }(Observable_default)
);
var Object_default = BaseObject;

// node_modules/ol/layer/Property.js
var Property_default = {
  OPACITY: "opacity",
  VISIBLE: "visible",
  EXTENT: "extent",
  Z_INDEX: "zIndex",
  MAX_RESOLUTION: "maxResolution",
  MIN_RESOLUTION: "minResolution",
  MAX_ZOOM: "maxZoom",
  MIN_ZOOM: "minZoom",
  SOURCE: "source",
  MAP: "map"
};

// node_modules/ol/AssertionError.js
var __extends4 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var AssertionError = (
  /** @class */
  function(_super) {
    __extends4(AssertionError2, _super);
    function AssertionError2(code) {
      var _this = this;
      var path = VERSION7 === "latest" ? VERSION7 : "v" + VERSION7.split("-")[0];
      var message = "Assertion failed. See https://openlayers.org/en/" + path + "/doc/errors/#" + code + " for details.";
      _this = _super.call(this, message) || this;
      _this.code = code;
      _this.name = "AssertionError";
      _this.message = message;
      return _this;
    }
    return AssertionError2;
  }(Error)
);
var AssertionError_default = AssertionError;

// node_modules/ol/asserts.js
function assert(assertion, errorCode) {
  if (!assertion) {
    throw new AssertionError_default(errorCode);
  }
}

// node_modules/ol/math.js
function clamp(value, min, max) {
  return Math.min(Math.max(value, min), max);
}
var cosh = function() {
  var cosh2;
  if ("cosh" in Math) {
    cosh2 = Math.cosh;
  } else {
    cosh2 = function(x) {
      var y = (
        /** @type {Math} */
        Math.exp(x)
      );
      return (y + 1 / y) / 2;
    };
  }
  return cosh2;
}();
var log2 = function() {
  var log22;
  if ("log2" in Math) {
    log22 = Math.log2;
  } else {
    log22 = function(x) {
      return Math.log(x) * Math.LOG2E;
    };
  }
  return log22;
}();
function squaredSegmentDistance(x, y, x1, y1, x2, y2) {
  var dx = x2 - x1;
  var dy = y2 - y1;
  if (dx !== 0 || dy !== 0) {
    var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);
    if (t > 1) {
      x1 = x2;
      y1 = y2;
    } else if (t > 0) {
      x1 += dx * t;
      y1 += dy * t;
    }
  }
  return squaredDistance(x, y, x1, y1);
}
function squaredDistance(x1, y1, x2, y2) {
  var dx = x2 - x1;
  var dy = y2 - y1;
  return dx * dx + dy * dy;
}
function solveLinearSystem(mat) {
  var n = mat.length;
  for (var i2 = 0; i2 < n; i2++) {
    var maxRow = i2;
    var maxEl = Math.abs(mat[i2][i2]);
    for (var r = i2 + 1; r < n; r++) {
      var absValue = Math.abs(mat[r][i2]);
      if (absValue > maxEl) {
        maxEl = absValue;
        maxRow = r;
      }
    }
    if (maxEl === 0) {
      return null;
    }
    var tmp = mat[maxRow];
    mat[maxRow] = mat[i2];
    mat[i2] = tmp;
    for (var j = i2 + 1; j < n; j++) {
      var coef = -mat[j][i2] / mat[i2][i2];
      for (var k = i2; k < n + 1; k++) {
        if (i2 == k) {
          mat[j][k] = 0;
        } else {
          mat[j][k] += coef * mat[i2][k];
        }
      }
    }
  }
  var x = new Array(n);
  for (var l = n - 1; l >= 0; l--) {
    x[l] = mat[l][n] / mat[l][l];
    for (var m = l - 1; m >= 0; m--) {
      mat[m][n] -= mat[m][l] * x[l];
    }
  }
  return x;
}
function toDegrees(angleInRadians) {
  return angleInRadians * 180 / Math.PI;
}
function toRadians(angleInDegrees) {
  return angleInDegrees * Math.PI / 180;
}
function modulo(a, b) {
  var r = a % b;
  return r * b < 0 ? r + b : r;
}
function lerp(a, b, x) {
  return a + x * (b - a);
}
function toFixed(n, decimals) {
  var factor = Math.pow(10, decimals);
  return Math.round(n * factor) / factor;
}
function floor(n, decimals) {
  return Math.floor(toFixed(n, decimals));
}
function ceil(n, decimals) {
  return Math.ceil(toFixed(n, decimals));
}

// node_modules/ol/layer/Base.js
var __extends5 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var BaseLayer = (
  /** @class */
  function(_super) {
    __extends5(BaseLayer2, _super);
    function BaseLayer2(options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.background_ = options.background;
      var properties2 = assign({}, options);
      if (typeof options.properties === "object") {
        delete properties2.properties;
        assign(properties2, options.properties);
      }
      properties2[Property_default.OPACITY] = options.opacity !== void 0 ? options.opacity : 1;
      assert(typeof properties2[Property_default.OPACITY] === "number", 64);
      properties2[Property_default.VISIBLE] = options.visible !== void 0 ? options.visible : true;
      properties2[Property_default.Z_INDEX] = options.zIndex;
      properties2[Property_default.MAX_RESOLUTION] = options.maxResolution !== void 0 ? options.maxResolution : Infinity;
      properties2[Property_default.MIN_RESOLUTION] = options.minResolution !== void 0 ? options.minResolution : 0;
      properties2[Property_default.MIN_ZOOM] = options.minZoom !== void 0 ? options.minZoom : -Infinity;
      properties2[Property_default.MAX_ZOOM] = options.maxZoom !== void 0 ? options.maxZoom : Infinity;
      _this.className_ = properties2.className !== void 0 ? properties2.className : "ol-layer";
      delete properties2.className;
      _this.setProperties(properties2);
      _this.state_ = null;
      return _this;
    }
    BaseLayer2.prototype.getBackground = function() {
      return this.background_;
    };
    BaseLayer2.prototype.getClassName = function() {
      return this.className_;
    };
    BaseLayer2.prototype.getLayerState = function(opt_managed) {
      var state2 = this.state_ || /** @type {?} */
      {
        layer: this,
        managed: opt_managed === void 0 ? true : opt_managed
      };
      var zIndex = this.getZIndex();
      state2.opacity = clamp(Math.round(this.getOpacity() * 100) / 100, 0, 1);
      state2.visible = this.getVisible();
      state2.extent = this.getExtent();
      state2.zIndex = zIndex === void 0 && !state2.managed ? Infinity : zIndex;
      state2.maxResolution = this.getMaxResolution();
      state2.minResolution = Math.max(this.getMinResolution(), 0);
      state2.minZoom = this.getMinZoom();
      state2.maxZoom = this.getMaxZoom();
      this.state_ = state2;
      return state2;
    };
    BaseLayer2.prototype.getLayersArray = function(opt_array) {
      return abstract();
    };
    BaseLayer2.prototype.getLayerStatesArray = function(opt_states) {
      return abstract();
    };
    BaseLayer2.prototype.getExtent = function() {
      return (
        /** @type {import("../extent.js").Extent|undefined} */
        this.get(Property_default.EXTENT)
      );
    };
    BaseLayer2.prototype.getMaxResolution = function() {
      return (
        /** @type {number} */
        this.get(Property_default.MAX_RESOLUTION)
      );
    };
    BaseLayer2.prototype.getMinResolution = function() {
      return (
        /** @type {number} */
        this.get(Property_default.MIN_RESOLUTION)
      );
    };
    BaseLayer2.prototype.getMinZoom = function() {
      return (
        /** @type {number} */
        this.get(Property_default.MIN_ZOOM)
      );
    };
    BaseLayer2.prototype.getMaxZoom = function() {
      return (
        /** @type {number} */
        this.get(Property_default.MAX_ZOOM)
      );
    };
    BaseLayer2.prototype.getOpacity = function() {
      return (
        /** @type {number} */
        this.get(Property_default.OPACITY)
      );
    };
    BaseLayer2.prototype.getSourceState = function() {
      return abstract();
    };
    BaseLayer2.prototype.getVisible = function() {
      return (
        /** @type {boolean} */
        this.get(Property_default.VISIBLE)
      );
    };
    BaseLayer2.prototype.getZIndex = function() {
      return (
        /** @type {number} */
        this.get(Property_default.Z_INDEX)
      );
    };
    BaseLayer2.prototype.setBackground = function(opt_background) {
      this.background_ = opt_background;
      this.changed();
    };
    BaseLayer2.prototype.setExtent = function(extent) {
      this.set(Property_default.EXTENT, extent);
    };
    BaseLayer2.prototype.setMaxResolution = function(maxResolution) {
      this.set(Property_default.MAX_RESOLUTION, maxResolution);
    };
    BaseLayer2.prototype.setMinResolution = function(minResolution) {
      this.set(Property_default.MIN_RESOLUTION, minResolution);
    };
    BaseLayer2.prototype.setMaxZoom = function(maxZoom) {
      this.set(Property_default.MAX_ZOOM, maxZoom);
    };
    BaseLayer2.prototype.setMinZoom = function(minZoom) {
      this.set(Property_default.MIN_ZOOM, minZoom);
    };
    BaseLayer2.prototype.setOpacity = function(opacity) {
      assert(typeof opacity === "number", 64);
      this.set(Property_default.OPACITY, opacity);
    };
    BaseLayer2.prototype.setVisible = function(visible) {
      this.set(Property_default.VISIBLE, visible);
    };
    BaseLayer2.prototype.setZIndex = function(zindex) {
      this.set(Property_default.Z_INDEX, zindex);
    };
    BaseLayer2.prototype.disposeInternal = function() {
      if (this.state_) {
        this.state_.layer = null;
        this.state_ = null;
      }
      _super.prototype.disposeInternal.call(this);
    };
    return BaseLayer2;
  }(Object_default)
);
var Base_default = BaseLayer;

// node_modules/ol/render/EventType.js
var EventType_default2 = {
  /**
   * Triggered before a layer is rendered.
   * @event module:ol/render/Event~RenderEvent#prerender
   * @api
   */
  PRERENDER: "prerender",
  /**
   * Triggered after a layer is rendered.
   * @event module:ol/render/Event~RenderEvent#postrender
   * @api
   */
  POSTRENDER: "postrender",
  /**
   * Triggered before layers are composed.  When dispatched by the map, the event object will not have
   * a `context` set.  When dispatched by a layer, the event object will have a `context` set.  Only
   * WebGL layers currently dispatch this event.
   * @event module:ol/render/Event~RenderEvent#precompose
   * @api
   */
  PRECOMPOSE: "precompose",
  /**
   * Triggered after layers are composed.  When dispatched by the map, the event object will not have
   * a `context` set.  When dispatched by a layer, the event object will have a `context` set.  Only
   * WebGL layers currently dispatch this event.
   * @event module:ol/render/Event~RenderEvent#postcompose
   * @api
   */
  POSTCOMPOSE: "postcompose",
  /**
   * Triggered when rendering is complete, i.e. all sources and tiles have
   * finished loading for the current viewport, and all tiles are faded in.
   * The event object will not have a `context` set.
   * @event module:ol/render/Event~RenderEvent#rendercomplete
   * @api
   */
  RENDERCOMPLETE: "rendercomplete"
};

// node_modules/ol/layer/Layer.js
var __extends6 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Layer = (
  /** @class */
  function(_super) {
    __extends6(Layer2, _super);
    function Layer2(options) {
      var _this = this;
      var baseOptions = assign({}, options);
      delete baseOptions.source;
      _this = _super.call(this, baseOptions) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.mapPrecomposeKey_ = null;
      _this.mapRenderKey_ = null;
      _this.sourceChangeKey_ = null;
      _this.renderer_ = null;
      _this.rendered = false;
      if (options.render) {
        _this.render = options.render;
      }
      if (options.map) {
        _this.setMap(options.map);
      }
      _this.addChangeListener(Property_default.SOURCE, _this.handleSourcePropertyChange_);
      var source = options.source ? (
        /** @type {SourceType} */
        options.source
      ) : null;
      _this.setSource(source);
      return _this;
    }
    Layer2.prototype.getLayersArray = function(opt_array) {
      var array2 = opt_array ? opt_array : [];
      array2.push(this);
      return array2;
    };
    Layer2.prototype.getLayerStatesArray = function(opt_states) {
      var states = opt_states ? opt_states : [];
      states.push(this.getLayerState());
      return states;
    };
    Layer2.prototype.getSource = function() {
      return (
        /** @type {SourceType} */
        this.get(Property_default.SOURCE) || null
      );
    };
    Layer2.prototype.getRenderSource = function() {
      return this.getSource();
    };
    Layer2.prototype.getSourceState = function() {
      var source = this.getSource();
      return !source ? "undefined" : source.getState();
    };
    Layer2.prototype.handleSourceChange_ = function() {
      this.changed();
    };
    Layer2.prototype.handleSourcePropertyChange_ = function() {
      if (this.sourceChangeKey_) {
        unlistenByKey(this.sourceChangeKey_);
        this.sourceChangeKey_ = null;
      }
      var source = this.getSource();
      if (source) {
        this.sourceChangeKey_ = listen(source, EventType_default.CHANGE, this.handleSourceChange_, this);
      }
      this.changed();
    };
    Layer2.prototype.getFeatures = function(pixel) {
      if (!this.renderer_) {
        return new Promise(function(resolve) {
          return resolve([]);
        });
      }
      return this.renderer_.getFeatures(pixel);
    };
    Layer2.prototype.getData = function(pixel) {
      if (!this.renderer_ || !this.rendered) {
        return null;
      }
      return this.renderer_.getData(pixel);
    };
    Layer2.prototype.render = function(frameState, target) {
      var layerRenderer = this.getRenderer();
      if (layerRenderer.prepareFrame(frameState)) {
        this.rendered = true;
        return layerRenderer.renderFrame(frameState, target);
      }
    };
    Layer2.prototype.unrender = function() {
      this.rendered = false;
    };
    Layer2.prototype.setMapInternal = function(map2) {
      if (!map2) {
        this.unrender();
      }
      this.set(Property_default.MAP, map2);
    };
    Layer2.prototype.getMapInternal = function() {
      return this.get(Property_default.MAP);
    };
    Layer2.prototype.setMap = function(map2) {
      if (this.mapPrecomposeKey_) {
        unlistenByKey(this.mapPrecomposeKey_);
        this.mapPrecomposeKey_ = null;
      }
      if (!map2) {
        this.changed();
      }
      if (this.mapRenderKey_) {
        unlistenByKey(this.mapRenderKey_);
        this.mapRenderKey_ = null;
      }
      if (map2) {
        this.mapPrecomposeKey_ = listen(map2, EventType_default2.PRECOMPOSE, function(evt) {
          var renderEvent = (
            /** @type {import("../render/Event.js").default} */
            evt
          );
          var layerStatesArray = renderEvent.frameState.layerStatesArray;
          var layerState = this.getLayerState(false);
          assert(!layerStatesArray.some(function(arrayLayerState) {
            return arrayLayerState.layer === layerState.layer;
          }), 67);
          layerStatesArray.push(layerState);
        }, this);
        this.mapRenderKey_ = listen(this, EventType_default.CHANGE, map2.render, map2);
        this.changed();
      }
    };
    Layer2.prototype.setSource = function(source) {
      this.set(Property_default.SOURCE, source);
    };
    Layer2.prototype.getRenderer = function() {
      if (!this.renderer_) {
        this.renderer_ = this.createRenderer();
      }
      return this.renderer_;
    };
    Layer2.prototype.hasRenderer = function() {
      return !!this.renderer_;
    };
    Layer2.prototype.createRenderer = function() {
      return null;
    };
    Layer2.prototype.disposeInternal = function() {
      if (this.renderer_) {
        this.renderer_.dispose();
        delete this.renderer_;
      }
      this.setSource(null);
      _super.prototype.disposeInternal.call(this);
    };
    return Layer2;
  }(Base_default)
);
function inView(layerState, viewState) {
  if (!layerState.visible) {
    return false;
  }
  var resolution = viewState.resolution;
  if (resolution < layerState.minResolution || resolution >= layerState.maxResolution) {
    return false;
  }
  var zoom = viewState.zoom;
  return zoom > layerState.minZoom && zoom <= layerState.maxZoom;
}
var Layer_default = Layer;

// node_modules/ol/layer/BaseVector.js
var import_rbush = __toESM(require_rbush_min(), 1);

// node_modules/ol/ImageState.js
var ImageState_default = {
  IDLE: 0,
  LOADING: 1,
  LOADED: 2,
  ERROR: 3,
  EMPTY: 4
};

// node_modules/ol/size.js
function buffer(size, num, opt_size) {
  if (opt_size === void 0) {
    opt_size = [0, 0];
  }
  opt_size[0] = size[0] + 2 * num;
  opt_size[1] = size[1] + 2 * num;
  return opt_size;
}
function hasArea(size) {
  return size[0] > 0 && size[1] > 0;
}
function scale(size, ratio, opt_size) {
  if (opt_size === void 0) {
    opt_size = [0, 0];
  }
  opt_size[0] = size[0] * ratio + 0.5 | 0;
  opt_size[1] = size[1] * ratio + 0.5 | 0;
  return opt_size;
}
function toSize(size, opt_size) {
  if (Array.isArray(size)) {
    return size;
  } else {
    if (opt_size === void 0) {
      opt_size = [size, size];
    } else {
      opt_size[0] = size;
      opt_size[1] = size;
    }
    return opt_size;
  }
}

// node_modules/ol/style/Image.js
var ImageStyle = (
  /** @class */
  function() {
    function ImageStyle2(options) {
      this.opacity_ = options.opacity;
      this.rotateWithView_ = options.rotateWithView;
      this.rotation_ = options.rotation;
      this.scale_ = options.scale;
      this.scaleArray_ = toSize(options.scale);
      this.displacement_ = options.displacement;
      this.declutterMode_ = options.declutterMode;
    }
    ImageStyle2.prototype.clone = function() {
      var scale5 = this.getScale();
      return new ImageStyle2({
        opacity: this.getOpacity(),
        scale: Array.isArray(scale5) ? scale5.slice() : scale5,
        rotation: this.getRotation(),
        rotateWithView: this.getRotateWithView(),
        displacement: this.getDisplacement().slice(),
        declutterMode: this.getDeclutterMode()
      });
    };
    ImageStyle2.prototype.getOpacity = function() {
      return this.opacity_;
    };
    ImageStyle2.prototype.getRotateWithView = function() {
      return this.rotateWithView_;
    };
    ImageStyle2.prototype.getRotation = function() {
      return this.rotation_;
    };
    ImageStyle2.prototype.getScale = function() {
      return this.scale_;
    };
    ImageStyle2.prototype.getScaleArray = function() {
      return this.scaleArray_;
    };
    ImageStyle2.prototype.getDisplacement = function() {
      return this.displacement_;
    };
    ImageStyle2.prototype.getDeclutterMode = function() {
      return this.declutterMode_;
    };
    ImageStyle2.prototype.getAnchor = function() {
      return abstract();
    };
    ImageStyle2.prototype.getImage = function(pixelRatio) {
      return abstract();
    };
    ImageStyle2.prototype.getHitDetectionImage = function() {
      return abstract();
    };
    ImageStyle2.prototype.getPixelRatio = function(pixelRatio) {
      return 1;
    };
    ImageStyle2.prototype.getImageState = function() {
      return abstract();
    };
    ImageStyle2.prototype.getImageSize = function() {
      return abstract();
    };
    ImageStyle2.prototype.getOrigin = function() {
      return abstract();
    };
    ImageStyle2.prototype.getSize = function() {
      return abstract();
    };
    ImageStyle2.prototype.setDisplacement = function(displacement) {
      this.displacement_ = displacement;
    };
    ImageStyle2.prototype.setOpacity = function(opacity) {
      this.opacity_ = opacity;
    };
    ImageStyle2.prototype.setRotateWithView = function(rotateWithView) {
      this.rotateWithView_ = rotateWithView;
    };
    ImageStyle2.prototype.setRotation = function(rotation) {
      this.rotation_ = rotation;
    };
    ImageStyle2.prototype.setScale = function(scale5) {
      this.scale_ = scale5;
      this.scaleArray_ = toSize(scale5);
    };
    ImageStyle2.prototype.listenImageChange = function(listener) {
      abstract();
    };
    ImageStyle2.prototype.load = function() {
      abstract();
    };
    ImageStyle2.prototype.unlistenImageChange = function(listener) {
      abstract();
    };
    return ImageStyle2;
  }()
);
var Image_default = ImageStyle;

// node_modules/ol/color.js
var HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i;
var NAMED_COLOR_RE_ = /^([a-z]*)$|^hsla?\(.*\)$/i;
function asString(color2) {
  if (typeof color2 === "string") {
    return color2;
  } else {
    return toString(color2);
  }
}
function fromNamed(color2) {
  var el = document.createElement("div");
  el.style.color = color2;
  if (el.style.color !== "") {
    document.body.appendChild(el);
    var rgb = getComputedStyle(el).color;
    document.body.removeChild(el);
    return rgb;
  } else {
    return "";
  }
}
var fromString = /* @__PURE__ */ function() {
  var MAX_CACHE_SIZE = 1024;
  var cache2 = {};
  var cacheSize = 0;
  return (
    /**
     * @param {string} s String.
     * @return {Color} Color.
     */
    function(s) {
      var color2;
      if (cache2.hasOwnProperty(s)) {
        color2 = cache2[s];
      } else {
        if (cacheSize >= MAX_CACHE_SIZE) {
          var i2 = 0;
          for (var key in cache2) {
            if ((i2++ & 3) === 0) {
              delete cache2[key];
              --cacheSize;
            }
          }
        }
        color2 = fromStringInternal_(s);
        cache2[s] = color2;
        ++cacheSize;
      }
      return color2;
    }
  );
}();
function asArray(color2) {
  if (Array.isArray(color2)) {
    return color2;
  } else {
    return fromString(color2);
  }
}
function fromStringInternal_(s) {
  var r, g, b, a, color2;
  if (NAMED_COLOR_RE_.exec(s)) {
    s = fromNamed(s);
  }
  if (HEX_COLOR_RE_.exec(s)) {
    var n = s.length - 1;
    var d = (
      // number of digits per channel
      void 0
    );
    if (n <= 4) {
      d = 1;
    } else {
      d = 2;
    }
    var hasAlpha = n === 4 || n === 8;
    r = parseInt(s.substr(1 + 0 * d, d), 16);
    g = parseInt(s.substr(1 + 1 * d, d), 16);
    b = parseInt(s.substr(1 + 2 * d, d), 16);
    if (hasAlpha) {
      a = parseInt(s.substr(1 + 3 * d, d), 16);
    } else {
      a = 255;
    }
    if (d == 1) {
      r = (r << 4) + r;
      g = (g << 4) + g;
      b = (b << 4) + b;
      if (hasAlpha) {
        a = (a << 4) + a;
      }
    }
    color2 = [r, g, b, a / 255];
  } else if (s.indexOf("rgba(") == 0) {
    color2 = s.slice(5, -1).split(",").map(Number);
    normalize(color2);
  } else if (s.indexOf("rgb(") == 0) {
    color2 = s.slice(4, -1).split(",").map(Number);
    color2.push(1);
    normalize(color2);
  } else {
    assert(false, 14);
  }
  return color2;
}
function normalize(color2) {
  color2[0] = clamp(color2[0] + 0.5 | 0, 0, 255);
  color2[1] = clamp(color2[1] + 0.5 | 0, 0, 255);
  color2[2] = clamp(color2[2] + 0.5 | 0, 0, 255);
  color2[3] = clamp(color2[3], 0, 1);
  return color2;
}
function toString(color2) {
  var r = color2[0];
  if (r != (r | 0)) {
    r = r + 0.5 | 0;
  }
  var g = color2[1];
  if (g != (g | 0)) {
    g = g + 0.5 | 0;
  }
  var b = color2[2];
  if (b != (b | 0)) {
    b = b + 0.5 | 0;
  }
  var a = color2[3] === void 0 ? 1 : Math.round(color2[3] * 100) / 100;
  return "rgba(" + r + "," + g + "," + b + "," + a + ")";
}

// node_modules/ol/colorlike.js
function asColorLike(color2) {
  if (Array.isArray(color2)) {
    return toString(color2);
  } else {
    return color2;
  }
}

// node_modules/ol/has.js
var ua = typeof navigator !== "undefined" && typeof navigator.userAgent !== "undefined" ? navigator.userAgent.toLowerCase() : "";
var FIREFOX = ua.indexOf("firefox") !== -1;
var SAFARI = ua.indexOf("safari") !== -1 && ua.indexOf("chrom") == -1;
var SAFARI_BUG_237906 = SAFARI && !!(ua.indexOf("version/15.4") >= 0 || ua.match(/cpu (os|iphone os) 15_4 like mac os x/));
var WEBKIT = ua.indexOf("webkit") !== -1 && ua.indexOf("edge") == -1;
var MAC = ua.indexOf("macintosh") !== -1;
var DEVICE_PIXEL_RATIO = typeof devicePixelRatio !== "undefined" ? devicePixelRatio : 1;
var WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope !== "undefined" && typeof OffscreenCanvas !== "undefined" && self instanceof WorkerGlobalScope;
var IMAGE_DECODE = typeof Image !== "undefined" && Image.prototype.decode;
var PASSIVE_EVENT_LISTENERS = function() {
  var passive = false;
  try {
    var options = Object.defineProperty({}, "passive", {
      get: function() {
        passive = true;
      }
    });
    window.addEventListener("_", null, options);
    window.removeEventListener("_", null, options);
  } catch (error3) {
  }
  return passive;
}();

// node_modules/ol/dom.js
function createCanvasContext2D(opt_width, opt_height, opt_canvasPool, opt_Context2DSettings) {
  var canvas;
  if (opt_canvasPool && opt_canvasPool.length) {
    canvas = opt_canvasPool.shift();
  } else if (WORKER_OFFSCREEN_CANVAS) {
    canvas = new OffscreenCanvas(opt_width || 300, opt_height || 300);
  } else {
    canvas = document.createElement("canvas");
  }
  if (opt_width) {
    canvas.width = opt_width;
  }
  if (opt_height) {
    canvas.height = opt_height;
  }
  return (
    /** @type {CanvasRenderingContext2D} */
    canvas.getContext("2d", opt_Context2DSettings)
  );
}
function releaseCanvas(context2) {
  var canvas = context2.canvas;
  canvas.width = 1;
  canvas.height = 1;
  context2.clearRect(0, 0, 1, 1);
}
function outerWidth(element) {
  var width = element.offsetWidth;
  var style2 = getComputedStyle(element);
  width += parseInt(style2.marginLeft, 10) + parseInt(style2.marginRight, 10);
  return width;
}
function outerHeight(element) {
  var height = element.offsetHeight;
  var style2 = getComputedStyle(element);
  height += parseInt(style2.marginTop, 10) + parseInt(style2.marginBottom, 10);
  return height;
}
function replaceNode(newNode, oldNode) {
  var parent = oldNode.parentNode;
  if (parent) {
    parent.replaceChild(newNode, oldNode);
  }
}
function removeNode(node) {
  return node && node.parentNode ? node.parentNode.removeChild(node) : null;
}
function removeChildren(node) {
  while (node.lastChild) {
    node.removeChild(node.lastChild);
  }
}
function replaceChildren(node, children) {
  var oldChildren = node.childNodes;
  for (var i2 = 0; true; ++i2) {
    var oldChild = oldChildren[i2];
    var newChild = children[i2];
    if (!oldChild && !newChild) {
      break;
    }
    if (oldChild === newChild) {
      continue;
    }
    if (!oldChild) {
      node.appendChild(newChild);
      continue;
    }
    if (!newChild) {
      node.removeChild(oldChild);
      --i2;
      continue;
    }
    node.insertBefore(newChild, oldChild);
  }
}

// node_modules/ol/css.js
var CLASS_HIDDEN = "ol-hidden";
var CLASS_SELECTABLE = "ol-selectable";
var CLASS_UNSELECTABLE = "ol-unselectable";
var CLASS_UNSUPPORTED = "ol-unsupported";
var CLASS_CONTROL = "ol-control";
var CLASS_COLLAPSED = "ol-collapsed";
var fontRegEx = new RegExp([
  "^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)",
  "(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)",
  "(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)",
  "(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?",
  "(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))",
  "(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",
  `?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`
].join(""), "i");
var fontRegExMatchIndex = [
  "style",
  "variant",
  "weight",
  "size",
  "lineHeight",
  "family"
];
var getFontParameters = function(fontSpec) {
  var match2 = fontSpec.match(fontRegEx);
  if (!match2) {
    return null;
  }
  var style2 = (
    /** @type {FontParameters} */
    {
      lineHeight: "normal",
      size: "1.2em",
      style: "normal",
      weight: "normal",
      variant: "normal"
    }
  );
  for (var i2 = 0, ii = fontRegExMatchIndex.length; i2 < ii; ++i2) {
    var value = match2[i2 + 1];
    if (value !== void 0) {
      style2[fontRegExMatchIndex[i2]] = value;
    }
  }
  style2.families = style2.family.split(/,\s?/);
  return style2;
};

// node_modules/ol/render/canvas.js
var defaultFont = "10px sans-serif";
var defaultFillStyle = "#000";
var defaultLineCap = "round";
var defaultLineDash = [];
var defaultLineDashOffset = 0;
var defaultLineJoin = "round";
var defaultMiterLimit = 10;
var defaultStrokeStyle = "#000";
var defaultTextAlign = "center";
var defaultTextBaseline = "middle";
var defaultPadding = [0, 0, 0, 0];
var defaultLineWidth = 1;
var checkedFonts = new Object_default();
var labelCache = new Target_default();
labelCache.setSize = function() {
  console.warn("labelCache is deprecated.");
};
var measureContext = null;
var measureFont;
var textHeights = {};
var registerFont = function() {
  var retries = 100;
  var size = "32px ";
  var referenceFonts = ["monospace", "serif"];
  var len = referenceFonts.length;
  var text = "wmytzilWMYTZIL@#/&?$%10\uF013";
  var interval, referenceWidth;
  function isAvailable(fontStyle, fontWeight, fontFamily) {
    var available = true;
    for (var i2 = 0; i2 < len; ++i2) {
      var referenceFont = referenceFonts[i2];
      referenceWidth = measureTextWidth(fontStyle + " " + fontWeight + " " + size + referenceFont, text);
      if (fontFamily != referenceFont) {
        var width = measureTextWidth(fontStyle + " " + fontWeight + " " + size + fontFamily + "," + referenceFont, text);
        available = available && width != referenceWidth;
      }
    }
    if (available) {
      return true;
    }
    return false;
  }
  function check() {
    var done = true;
    var fonts = checkedFonts.getKeys();
    for (var i2 = 0, ii = fonts.length; i2 < ii; ++i2) {
      var font = fonts[i2];
      if (checkedFonts.get(font) < retries) {
        if (isAvailable.apply(this, font.split("\n"))) {
          clear(textHeights);
          measureContext = null;
          measureFont = void 0;
          checkedFonts.set(font, retries);
        } else {
          checkedFonts.set(font, checkedFonts.get(font) + 1, true);
          done = false;
        }
      }
    }
    if (done) {
      clearInterval(interval);
      interval = void 0;
    }
  }
  return function(fontSpec) {
    var font = getFontParameters(fontSpec);
    if (!font) {
      return;
    }
    var families = font.families;
    for (var i2 = 0, ii = families.length; i2 < ii; ++i2) {
      var family = families[i2];
      var key = font.style + "\n" + font.weight + "\n" + family;
      if (checkedFonts.get(key) === void 0) {
        checkedFonts.set(key, retries, true);
        if (!isAvailable(font.style, font.weight, family)) {
          checkedFonts.set(key, 0, true);
          if (interval === void 0) {
            interval = setInterval(check, 32);
          }
        }
      }
    }
  };
}();
var measureTextHeight = /* @__PURE__ */ function() {
  var measureElement;
  return function(fontSpec) {
    var height = textHeights[fontSpec];
    if (height == void 0) {
      if (WORKER_OFFSCREEN_CANVAS) {
        var font = getFontParameters(fontSpec);
        var metrics = measureText(fontSpec, "\u017Dg");
        var lineHeight = isNaN(Number(font.lineHeight)) ? 1.2 : Number(font.lineHeight);
        height = lineHeight * (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);
      } else {
        if (!measureElement) {
          measureElement = document.createElement("div");
          measureElement.innerHTML = "M";
          measureElement.style.minHeight = "0";
          measureElement.style.maxHeight = "none";
          measureElement.style.height = "auto";
          measureElement.style.padding = "0";
          measureElement.style.border = "none";
          measureElement.style.position = "absolute";
          measureElement.style.display = "block";
          measureElement.style.left = "-99999px";
        }
        measureElement.style.font = fontSpec;
        document.body.appendChild(measureElement);
        height = measureElement.offsetHeight;
        document.body.removeChild(measureElement);
      }
      textHeights[fontSpec] = height;
    }
    return height;
  };
}();
function measureText(font, text) {
  if (!measureContext) {
    measureContext = createCanvasContext2D(1, 1);
  }
  if (font != measureFont) {
    measureContext.font = font;
    measureFont = measureContext.font;
  }
  return measureContext.measureText(text);
}
function measureTextWidth(font, text) {
  return measureText(font, text).width;
}
function measureAndCacheTextWidth(font, text, cache2) {
  if (text in cache2) {
    return cache2[text];
  }
  var width = text.split("\n").reduce(function(prev, curr) {
    return Math.max(prev, measureTextWidth(font, curr));
  }, 0);
  cache2[text] = width;
  return width;
}
function getTextDimensions(baseStyle, chunks) {
  var widths = [];
  var heights = [];
  var lineWidths = [];
  var width = 0;
  var lineWidth = 0;
  var height = 0;
  var lineHeight = 0;
  for (var i2 = 0, ii = chunks.length; i2 <= ii; i2 += 2) {
    var text = chunks[i2];
    if (text === "\n" || i2 === ii) {
      width = Math.max(width, lineWidth);
      lineWidths.push(lineWidth);
      lineWidth = 0;
      height += lineHeight;
      continue;
    }
    var font = chunks[i2 + 1] || baseStyle.font;
    var currentWidth = measureTextWidth(font, text);
    widths.push(currentWidth);
    lineWidth += currentWidth;
    var currentHeight = measureTextHeight(font);
    heights.push(currentHeight);
    lineHeight = Math.max(lineHeight, currentHeight);
  }
  return { width, height, widths, heights, lineWidths };
}
function drawImageOrLabel(context2, transform3, opacity, labelOrImage, originX, originY, w, h, x, y, scale5) {
  context2.save();
  if (opacity !== 1) {
    context2.globalAlpha *= opacity;
  }
  if (transform3) {
    context2.setTransform.apply(context2, transform3);
  }
  if (
    /** @type {*} */
    labelOrImage.contextInstructions
  ) {
    context2.translate(x, y);
    context2.scale(scale5[0], scale5[1]);
    executeLabelInstructions(
      /** @type {Label} */
      labelOrImage,
      context2
    );
  } else if (scale5[0] < 0 || scale5[1] < 0) {
    context2.translate(x, y);
    context2.scale(scale5[0], scale5[1]);
    context2.drawImage(
      /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
      labelOrImage,
      originX,
      originY,
      w,
      h,
      0,
      0,
      w,
      h
    );
  } else {
    context2.drawImage(
      /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
      labelOrImage,
      originX,
      originY,
      w,
      h,
      x,
      y,
      w * scale5[0],
      h * scale5[1]
    );
  }
  context2.restore();
}
function executeLabelInstructions(label, context2) {
  var contextInstructions = label.contextInstructions;
  for (var i2 = 0, ii = contextInstructions.length; i2 < ii; i2 += 2) {
    if (Array.isArray(contextInstructions[i2 + 1])) {
      context2[contextInstructions[i2]].apply(context2, contextInstructions[i2 + 1]);
    } else {
      context2[contextInstructions[i2]] = contextInstructions[i2 + 1];
    }
  }
}

// node_modules/ol/style/RegularShape.js
var __extends7 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var RegularShape = (
  /** @class */
  function(_super) {
    __extends7(RegularShape2, _super);
    function RegularShape2(options) {
      var _this = this;
      var rotateWithView = options.rotateWithView !== void 0 ? options.rotateWithView : false;
      _this = _super.call(this, {
        opacity: 1,
        rotateWithView,
        rotation: options.rotation !== void 0 ? options.rotation : 0,
        scale: options.scale !== void 0 ? options.scale : 1,
        displacement: options.displacement !== void 0 ? options.displacement : [0, 0],
        declutterMode: options.declutterMode
      }) || this;
      _this.canvas_ = void 0;
      _this.hitDetectionCanvas_ = null;
      _this.fill_ = options.fill !== void 0 ? options.fill : null;
      _this.origin_ = [0, 0];
      _this.points_ = options.points;
      _this.radius_ = options.radius !== void 0 ? options.radius : options.radius1;
      _this.radius2_ = options.radius2;
      _this.angle_ = options.angle !== void 0 ? options.angle : 0;
      _this.stroke_ = options.stroke !== void 0 ? options.stroke : null;
      _this.size_ = null;
      _this.renderOptions_ = null;
      _this.render();
      return _this;
    }
    RegularShape2.prototype.clone = function() {
      var scale5 = this.getScale();
      var style2 = new RegularShape2({
        fill: this.getFill() ? this.getFill().clone() : void 0,
        points: this.getPoints(),
        radius: this.getRadius(),
        radius2: this.getRadius2(),
        angle: this.getAngle(),
        stroke: this.getStroke() ? this.getStroke().clone() : void 0,
        rotation: this.getRotation(),
        rotateWithView: this.getRotateWithView(),
        scale: Array.isArray(scale5) ? scale5.slice() : scale5,
        displacement: this.getDisplacement().slice(),
        declutterMode: this.getDeclutterMode()
      });
      style2.setOpacity(this.getOpacity());
      return style2;
    };
    RegularShape2.prototype.getAnchor = function() {
      var size = this.size_;
      if (!size) {
        return null;
      }
      var displacement = this.getDisplacement();
      return [size[0] / 2 - displacement[0], size[1] / 2 + displacement[1]];
    };
    RegularShape2.prototype.getAngle = function() {
      return this.angle_;
    };
    RegularShape2.prototype.getFill = function() {
      return this.fill_;
    };
    RegularShape2.prototype.setFill = function(fill) {
      this.fill_ = fill;
      this.render();
    };
    RegularShape2.prototype.getHitDetectionImage = function() {
      if (!this.hitDetectionCanvas_) {
        this.createHitDetectionCanvas_(this.renderOptions_);
      }
      return this.hitDetectionCanvas_;
    };
    RegularShape2.prototype.getImage = function(pixelRatio) {
      var image = this.canvas_[pixelRatio];
      if (!image) {
        var renderOptions = this.renderOptions_;
        var context2 = createCanvasContext2D(renderOptions.size * pixelRatio, renderOptions.size * pixelRatio);
        this.draw_(renderOptions, context2, pixelRatio);
        image = context2.canvas;
        this.canvas_[pixelRatio] = image;
      }
      return image;
    };
    RegularShape2.prototype.getPixelRatio = function(pixelRatio) {
      return pixelRatio;
    };
    RegularShape2.prototype.getImageSize = function() {
      return this.size_;
    };
    RegularShape2.prototype.getImageState = function() {
      return ImageState_default.LOADED;
    };
    RegularShape2.prototype.getOrigin = function() {
      return this.origin_;
    };
    RegularShape2.prototype.getPoints = function() {
      return this.points_;
    };
    RegularShape2.prototype.getRadius = function() {
      return this.radius_;
    };
    RegularShape2.prototype.getRadius2 = function() {
      return this.radius2_;
    };
    RegularShape2.prototype.getSize = function() {
      return this.size_;
    };
    RegularShape2.prototype.getStroke = function() {
      return this.stroke_;
    };
    RegularShape2.prototype.setStroke = function(stroke) {
      this.stroke_ = stroke;
      this.render();
    };
    RegularShape2.prototype.listenImageChange = function(listener) {
    };
    RegularShape2.prototype.load = function() {
    };
    RegularShape2.prototype.unlistenImageChange = function(listener) {
    };
    RegularShape2.prototype.calculateLineJoinSize_ = function(lineJoin, strokeWidth, miterLimit) {
      if (strokeWidth === 0 || this.points_ === Infinity || lineJoin !== "bevel" && lineJoin !== "miter") {
        return strokeWidth;
      }
      var r1 = this.radius_;
      var r2 = this.radius2_ === void 0 ? r1 : this.radius2_;
      if (r1 < r2) {
        var tmp = r1;
        r1 = r2;
        r2 = tmp;
      }
      var points = this.radius2_ === void 0 ? this.points_ : this.points_ * 2;
      var alpha = 2 * Math.PI / points;
      var a = r2 * Math.sin(alpha);
      var b = Math.sqrt(r2 * r2 - a * a);
      var d = r1 - b;
      var e = Math.sqrt(a * a + d * d);
      var miterRatio = e / a;
      if (lineJoin === "miter" && miterRatio <= miterLimit) {
        return miterRatio * strokeWidth;
      }
      var k = strokeWidth / 2 / miterRatio;
      var l = strokeWidth / 2 * (d / e);
      var maxr = Math.sqrt((r1 + k) * (r1 + k) + l * l);
      var bevelAdd = maxr - r1;
      if (this.radius2_ === void 0 || lineJoin === "bevel") {
        return bevelAdd * 2;
      }
      var aa = r1 * Math.sin(alpha);
      var bb = Math.sqrt(r1 * r1 - aa * aa);
      var dd = r2 - bb;
      var ee = Math.sqrt(aa * aa + dd * dd);
      var innerMiterRatio = ee / aa;
      if (innerMiterRatio <= miterLimit) {
        var innerLength = innerMiterRatio * strokeWidth / 2 - r2 - r1;
        return 2 * Math.max(bevelAdd, innerLength);
      }
      return bevelAdd * 2;
    };
    RegularShape2.prototype.createRenderOptions = function() {
      var lineJoin = defaultLineJoin;
      var miterLimit = 0;
      var lineDash = null;
      var lineDashOffset = 0;
      var strokeStyle;
      var strokeWidth = 0;
      if (this.stroke_) {
        strokeStyle = this.stroke_.getColor();
        if (strokeStyle === null) {
          strokeStyle = defaultStrokeStyle;
        }
        strokeStyle = asColorLike(strokeStyle);
        strokeWidth = this.stroke_.getWidth();
        if (strokeWidth === void 0) {
          strokeWidth = defaultLineWidth;
        }
        lineDash = this.stroke_.getLineDash();
        lineDashOffset = this.stroke_.getLineDashOffset();
        lineJoin = this.stroke_.getLineJoin();
        if (lineJoin === void 0) {
          lineJoin = defaultLineJoin;
        }
        miterLimit = this.stroke_.getMiterLimit();
        if (miterLimit === void 0) {
          miterLimit = defaultMiterLimit;
        }
      }
      var add5 = this.calculateLineJoinSize_(lineJoin, strokeWidth, miterLimit);
      var maxRadius = Math.max(this.radius_, this.radius2_ || 0);
      var size = Math.ceil(2 * maxRadius + add5);
      return {
        strokeStyle,
        strokeWidth,
        size,
        lineDash,
        lineDashOffset,
        lineJoin,
        miterLimit
      };
    };
    RegularShape2.prototype.render = function() {
      this.renderOptions_ = this.createRenderOptions();
      var size = this.renderOptions_.size;
      this.canvas_ = {};
      this.size_ = [size, size];
    };
    RegularShape2.prototype.draw_ = function(renderOptions, context2, pixelRatio) {
      context2.scale(pixelRatio, pixelRatio);
      context2.translate(renderOptions.size / 2, renderOptions.size / 2);
      this.createPath_(context2);
      if (this.fill_) {
        var color2 = this.fill_.getColor();
        if (color2 === null) {
          color2 = defaultFillStyle;
        }
        context2.fillStyle = asColorLike(color2);
        context2.fill();
      }
      if (this.stroke_) {
        context2.strokeStyle = renderOptions.strokeStyle;
        context2.lineWidth = renderOptions.strokeWidth;
        if (context2.setLineDash && renderOptions.lineDash) {
          context2.setLineDash(renderOptions.lineDash);
          context2.lineDashOffset = renderOptions.lineDashOffset;
        }
        context2.lineJoin = renderOptions.lineJoin;
        context2.miterLimit = renderOptions.miterLimit;
        context2.stroke();
      }
    };
    RegularShape2.prototype.createHitDetectionCanvas_ = function(renderOptions) {
      if (this.fill_) {
        var color2 = this.fill_.getColor();
        var opacity = 0;
        if (typeof color2 === "string") {
          color2 = asArray(color2);
        }
        if (color2 === null) {
          opacity = 1;
        } else if (Array.isArray(color2)) {
          opacity = color2.length === 4 ? color2[3] : 1;
        }
        if (opacity === 0) {
          var context2 = createCanvasContext2D(renderOptions.size, renderOptions.size);
          this.hitDetectionCanvas_ = context2.canvas;
          this.drawHitDetectionCanvas_(renderOptions, context2);
        }
      }
      if (!this.hitDetectionCanvas_) {
        this.hitDetectionCanvas_ = this.getImage(1);
      }
    };
    RegularShape2.prototype.createPath_ = function(context2) {
      var points = this.points_;
      var radius = this.radius_;
      if (points === Infinity) {
        context2.arc(0, 0, radius, 0, 2 * Math.PI);
      } else {
        var radius2 = this.radius2_ === void 0 ? radius : this.radius2_;
        if (this.radius2_ !== void 0) {
          points *= 2;
        }
        var startAngle = this.angle_ - Math.PI / 2;
        var step = 2 * Math.PI / points;
        for (var i2 = 0; i2 < points; i2++) {
          var angle0 = startAngle + i2 * step;
          var radiusC = i2 % 2 === 0 ? radius : radius2;
          context2.lineTo(radiusC * Math.cos(angle0), radiusC * Math.sin(angle0));
        }
        context2.closePath();
      }
    };
    RegularShape2.prototype.drawHitDetectionCanvas_ = function(renderOptions, context2) {
      context2.translate(renderOptions.size / 2, renderOptions.size / 2);
      this.createPath_(context2);
      context2.fillStyle = defaultFillStyle;
      context2.fill();
      if (this.stroke_) {
        context2.strokeStyle = renderOptions.strokeStyle;
        context2.lineWidth = renderOptions.strokeWidth;
        if (renderOptions.lineDash) {
          context2.setLineDash(renderOptions.lineDash);
          context2.lineDashOffset = renderOptions.lineDashOffset;
        }
        context2.lineJoin = renderOptions.lineJoin;
        context2.miterLimit = renderOptions.miterLimit;
        context2.stroke();
      }
    };
    return RegularShape2;
  }(Image_default)
);
var RegularShape_default = RegularShape;

// node_modules/ol/style/Circle.js
var __extends8 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CircleStyle = (
  /** @class */
  function(_super) {
    __extends8(CircleStyle2, _super);
    function CircleStyle2(opt_options) {
      var options = opt_options ? opt_options : {};
      return _super.call(this, {
        points: Infinity,
        fill: options.fill,
        radius: options.radius,
        stroke: options.stroke,
        scale: options.scale !== void 0 ? options.scale : 1,
        rotation: options.rotation !== void 0 ? options.rotation : 0,
        rotateWithView: options.rotateWithView !== void 0 ? options.rotateWithView : false,
        displacement: options.displacement !== void 0 ? options.displacement : [0, 0],
        declutterMode: options.declutterMode
      }) || this;
    }
    CircleStyle2.prototype.clone = function() {
      var scale5 = this.getScale();
      var style2 = new CircleStyle2({
        fill: this.getFill() ? this.getFill().clone() : void 0,
        stroke: this.getStroke() ? this.getStroke().clone() : void 0,
        radius: this.getRadius(),
        scale: Array.isArray(scale5) ? scale5.slice() : scale5,
        rotation: this.getRotation(),
        rotateWithView: this.getRotateWithView(),
        displacement: this.getDisplacement().slice(),
        declutterMode: this.getDeclutterMode()
      });
      style2.setOpacity(this.getOpacity());
      return style2;
    };
    CircleStyle2.prototype.setRadius = function(radius) {
      this.radius_ = radius;
      this.render();
    };
    return CircleStyle2;
  }(RegularShape_default)
);
var Circle_default = CircleStyle;

// node_modules/ol/style/Fill.js
var Fill = (
  /** @class */
  function() {
    function Fill2(opt_options) {
      var options = opt_options || {};
      this.color_ = options.color !== void 0 ? options.color : null;
    }
    Fill2.prototype.clone = function() {
      var color2 = this.getColor();
      return new Fill2({
        color: Array.isArray(color2) ? color2.slice() : color2 || void 0
      });
    };
    Fill2.prototype.getColor = function() {
      return this.color_;
    };
    Fill2.prototype.setColor = function(color2) {
      this.color_ = color2;
    };
    return Fill2;
  }()
);
var Fill_default = Fill;

// node_modules/ol/style/Stroke.js
var Stroke = (
  /** @class */
  function() {
    function Stroke2(opt_options) {
      var options = opt_options || {};
      this.color_ = options.color !== void 0 ? options.color : null;
      this.lineCap_ = options.lineCap;
      this.lineDash_ = options.lineDash !== void 0 ? options.lineDash : null;
      this.lineDashOffset_ = options.lineDashOffset;
      this.lineJoin_ = options.lineJoin;
      this.miterLimit_ = options.miterLimit;
      this.width_ = options.width;
    }
    Stroke2.prototype.clone = function() {
      var color2 = this.getColor();
      return new Stroke2({
        color: Array.isArray(color2) ? color2.slice() : color2 || void 0,
        lineCap: this.getLineCap(),
        lineDash: this.getLineDash() ? this.getLineDash().slice() : void 0,
        lineDashOffset: this.getLineDashOffset(),
        lineJoin: this.getLineJoin(),
        miterLimit: this.getMiterLimit(),
        width: this.getWidth()
      });
    };
    Stroke2.prototype.getColor = function() {
      return this.color_;
    };
    Stroke2.prototype.getLineCap = function() {
      return this.lineCap_;
    };
    Stroke2.prototype.getLineDash = function() {
      return this.lineDash_;
    };
    Stroke2.prototype.getLineDashOffset = function() {
      return this.lineDashOffset_;
    };
    Stroke2.prototype.getLineJoin = function() {
      return this.lineJoin_;
    };
    Stroke2.prototype.getMiterLimit = function() {
      return this.miterLimit_;
    };
    Stroke2.prototype.getWidth = function() {
      return this.width_;
    };
    Stroke2.prototype.setColor = function(color2) {
      this.color_ = color2;
    };
    Stroke2.prototype.setLineCap = function(lineCap) {
      this.lineCap_ = lineCap;
    };
    Stroke2.prototype.setLineDash = function(lineDash) {
      this.lineDash_ = lineDash;
    };
    Stroke2.prototype.setLineDashOffset = function(lineDashOffset) {
      this.lineDashOffset_ = lineDashOffset;
    };
    Stroke2.prototype.setLineJoin = function(lineJoin) {
      this.lineJoin_ = lineJoin;
    };
    Stroke2.prototype.setMiterLimit = function(miterLimit) {
      this.miterLimit_ = miterLimit;
    };
    Stroke2.prototype.setWidth = function(width) {
      this.width_ = width;
    };
    return Stroke2;
  }()
);
var Stroke_default = Stroke;

// node_modules/ol/style/Style.js
var Style = (
  /** @class */
  function() {
    function Style2(opt_options) {
      var options = opt_options || {};
      this.geometry_ = null;
      this.geometryFunction_ = defaultGeometryFunction;
      if (options.geometry !== void 0) {
        this.setGeometry(options.geometry);
      }
      this.fill_ = options.fill !== void 0 ? options.fill : null;
      this.image_ = options.image !== void 0 ? options.image : null;
      this.renderer_ = options.renderer !== void 0 ? options.renderer : null;
      this.hitDetectionRenderer_ = options.hitDetectionRenderer !== void 0 ? options.hitDetectionRenderer : null;
      this.stroke_ = options.stroke !== void 0 ? options.stroke : null;
      this.text_ = options.text !== void 0 ? options.text : null;
      this.zIndex_ = options.zIndex;
    }
    Style2.prototype.clone = function() {
      var geometry2 = this.getGeometry();
      if (geometry2 && typeof geometry2 === "object") {
        geometry2 = /** @type {import("../geom/Geometry.js").default} */
        geometry2.clone();
      }
      return new Style2({
        geometry: geometry2,
        fill: this.getFill() ? this.getFill().clone() : void 0,
        image: this.getImage() ? this.getImage().clone() : void 0,
        renderer: this.getRenderer(),
        stroke: this.getStroke() ? this.getStroke().clone() : void 0,
        text: this.getText() ? this.getText().clone() : void 0,
        zIndex: this.getZIndex()
      });
    };
    Style2.prototype.getRenderer = function() {
      return this.renderer_;
    };
    Style2.prototype.setRenderer = function(renderer) {
      this.renderer_ = renderer;
    };
    Style2.prototype.setHitDetectionRenderer = function(renderer) {
      this.hitDetectionRenderer_ = renderer;
    };
    Style2.prototype.getHitDetectionRenderer = function() {
      return this.hitDetectionRenderer_;
    };
    Style2.prototype.getGeometry = function() {
      return this.geometry_;
    };
    Style2.prototype.getGeometryFunction = function() {
      return this.geometryFunction_;
    };
    Style2.prototype.getFill = function() {
      return this.fill_;
    };
    Style2.prototype.setFill = function(fill) {
      this.fill_ = fill;
    };
    Style2.prototype.getImage = function() {
      return this.image_;
    };
    Style2.prototype.setImage = function(image) {
      this.image_ = image;
    };
    Style2.prototype.getStroke = function() {
      return this.stroke_;
    };
    Style2.prototype.setStroke = function(stroke) {
      this.stroke_ = stroke;
    };
    Style2.prototype.getText = function() {
      return this.text_;
    };
    Style2.prototype.setText = function(text) {
      this.text_ = text;
    };
    Style2.prototype.getZIndex = function() {
      return this.zIndex_;
    };
    Style2.prototype.setGeometry = function(geometry2) {
      if (typeof geometry2 === "function") {
        this.geometryFunction_ = geometry2;
      } else if (typeof geometry2 === "string") {
        this.geometryFunction_ = function(feature) {
          return (
            /** @type {import("../geom/Geometry.js").default} */
            feature.get(geometry2)
          );
        };
      } else if (!geometry2) {
        this.geometryFunction_ = defaultGeometryFunction;
      } else if (geometry2 !== void 0) {
        this.geometryFunction_ = function() {
          return (
            /** @type {import("../geom/Geometry.js").default} */
            geometry2
          );
        };
      }
      this.geometry_ = geometry2;
    };
    Style2.prototype.setZIndex = function(zIndex) {
      this.zIndex_ = zIndex;
    };
    return Style2;
  }()
);
function toFunction(obj) {
  var styleFunction;
  if (typeof obj === "function") {
    styleFunction = obj;
  } else {
    var styles_1;
    if (Array.isArray(obj)) {
      styles_1 = obj;
    } else {
      assert(typeof /** @type {?} */
      obj.getZIndex === "function", 41);
      var style2 = (
        /** @type {Style} */
        obj
      );
      styles_1 = [style2];
    }
    styleFunction = function() {
      return styles_1;
    };
  }
  return styleFunction;
}
var defaultStyles = null;
function createDefaultStyle(feature, resolution) {
  if (!defaultStyles) {
    var fill = new Fill_default({
      color: "rgba(255,255,255,0.4)"
    });
    var stroke = new Stroke_default({
      color: "#3399CC",
      width: 1.25
    });
    defaultStyles = [
      new Style({
        image: new Circle_default({
          fill,
          stroke,
          radius: 5
        }),
        fill,
        stroke
      })
    ];
  }
  return defaultStyles;
}
function createEditingStyle() {
  var styles = {};
  var white = [255, 255, 255, 1];
  var blue = [0, 153, 255, 1];
  var width = 3;
  styles["Polygon"] = [
    new Style({
      fill: new Fill_default({
        color: [255, 255, 255, 0.5]
      })
    })
  ];
  styles["MultiPolygon"] = styles["Polygon"];
  styles["LineString"] = [
    new Style({
      stroke: new Stroke_default({
        color: white,
        width: width + 2
      })
    }),
    new Style({
      stroke: new Stroke_default({
        color: blue,
        width
      })
    })
  ];
  styles["MultiLineString"] = styles["LineString"];
  styles["Circle"] = styles["Polygon"].concat(styles["LineString"]);
  styles["Point"] = [
    new Style({
      image: new Circle_default({
        radius: width * 2,
        fill: new Fill_default({
          color: blue
        }),
        stroke: new Stroke_default({
          color: white,
          width: width / 2
        })
      }),
      zIndex: Infinity
    })
  ];
  styles["MultiPoint"] = styles["Point"];
  styles["GeometryCollection"] = styles["Polygon"].concat(styles["LineString"], styles["Point"]);
  return styles;
}
function defaultGeometryFunction(feature) {
  return feature.getGeometry();
}
var Style_default = Style;

// node_modules/ol/layer/BaseVector.js
var __extends9 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Property = {
  RENDER_ORDER: "renderOrder"
};
var BaseVectorLayer = (
  /** @class */
  function(_super) {
    __extends9(BaseVectorLayer2, _super);
    function BaseVectorLayer2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var baseOptions = assign({}, options);
      delete baseOptions.style;
      delete baseOptions.renderBuffer;
      delete baseOptions.updateWhileAnimating;
      delete baseOptions.updateWhileInteracting;
      _this = _super.call(this, baseOptions) || this;
      _this.declutter_ = options.declutter !== void 0 ? options.declutter : false;
      _this.renderBuffer_ = options.renderBuffer !== void 0 ? options.renderBuffer : 100;
      _this.style_ = null;
      _this.styleFunction_ = void 0;
      _this.setStyle(options.style);
      _this.updateWhileAnimating_ = options.updateWhileAnimating !== void 0 ? options.updateWhileAnimating : false;
      _this.updateWhileInteracting_ = options.updateWhileInteracting !== void 0 ? options.updateWhileInteracting : false;
      return _this;
    }
    BaseVectorLayer2.prototype.getDeclutter = function() {
      return this.declutter_;
    };
    BaseVectorLayer2.prototype.getFeatures = function(pixel) {
      return _super.prototype.getFeatures.call(this, pixel);
    };
    BaseVectorLayer2.prototype.getRenderBuffer = function() {
      return this.renderBuffer_;
    };
    BaseVectorLayer2.prototype.getRenderOrder = function() {
      return (
        /** @type {import("../render.js").OrderFunction|null|undefined} */
        this.get(Property.RENDER_ORDER)
      );
    };
    BaseVectorLayer2.prototype.getStyle = function() {
      return this.style_;
    };
    BaseVectorLayer2.prototype.getStyleFunction = function() {
      return this.styleFunction_;
    };
    BaseVectorLayer2.prototype.getUpdateWhileAnimating = function() {
      return this.updateWhileAnimating_;
    };
    BaseVectorLayer2.prototype.getUpdateWhileInteracting = function() {
      return this.updateWhileInteracting_;
    };
    BaseVectorLayer2.prototype.renderDeclutter = function(frameState) {
      if (!frameState.declutterTree) {
        frameState.declutterTree = new import_rbush.default(9);
      }
      this.getRenderer().renderDeclutter(frameState);
    };
    BaseVectorLayer2.prototype.setRenderOrder = function(renderOrder) {
      this.set(Property.RENDER_ORDER, renderOrder);
    };
    BaseVectorLayer2.prototype.setStyle = function(opt_style) {
      this.style_ = opt_style !== void 0 ? opt_style : createDefaultStyle;
      this.styleFunction_ = opt_style === null ? void 0 : toFunction(this.style_);
      this.changed();
    };
    return BaseVectorLayer2;
  }(Layer_default)
);
var BaseVector_default = BaseVectorLayer;

// node_modules/ol/render/canvas/Instruction.js
var Instruction = {
  BEGIN_GEOMETRY: 0,
  BEGIN_PATH: 1,
  CIRCLE: 2,
  CLOSE_PATH: 3,
  CUSTOM: 4,
  DRAW_CHARS: 5,
  DRAW_IMAGE: 6,
  END_GEOMETRY: 7,
  FILL: 8,
  MOVE_TO_LINE_TO: 9,
  SET_FILL_STYLE: 10,
  SET_STROKE_STYLE: 11,
  STROKE: 12
};
var fillInstruction = [Instruction.FILL];
var strokeInstruction = [Instruction.STROKE];
var beginPathInstruction = [Instruction.BEGIN_PATH];
var closePathInstruction = [Instruction.CLOSE_PATH];
var Instruction_default = Instruction;

// node_modules/ol/extent/Relationship.js
var Relationship_default = {
  UNKNOWN: 0,
  INTERSECTING: 1,
  ABOVE: 2,
  RIGHT: 4,
  BELOW: 8,
  LEFT: 16
};

// node_modules/ol/render/VectorContext.js
var VectorContext = (
  /** @class */
  function() {
    function VectorContext2() {
    }
    VectorContext2.prototype.drawCustom = function(geometry2, feature, renderer, hitDetectionRenderer) {
    };
    VectorContext2.prototype.drawGeometry = function(geometry2) {
    };
    VectorContext2.prototype.setStyle = function(style2) {
    };
    VectorContext2.prototype.drawCircle = function(circleGeometry, feature) {
    };
    VectorContext2.prototype.drawFeature = function(feature, style2) {
    };
    VectorContext2.prototype.drawGeometryCollection = function(geometryCollectionGeometry, feature) {
    };
    VectorContext2.prototype.drawLineString = function(lineStringGeometry, feature) {
    };
    VectorContext2.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {
    };
    VectorContext2.prototype.drawMultiPoint = function(multiPointGeometry, feature) {
    };
    VectorContext2.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {
    };
    VectorContext2.prototype.drawPoint = function(pointGeometry, feature) {
    };
    VectorContext2.prototype.drawPolygon = function(polygonGeometry, feature) {
    };
    VectorContext2.prototype.drawText = function(geometry2, feature) {
    };
    VectorContext2.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
    };
    VectorContext2.prototype.setImageStyle = function(imageStyle, opt_declutterImageWithText) {
    };
    VectorContext2.prototype.setTextStyle = function(textStyle, opt_declutterImageWithText) {
    };
    return VectorContext2;
  }()
);
var VectorContext_default = VectorContext;

// node_modules/ol/extent.js
function boundingExtent(coordinates2) {
  var extent = createEmpty();
  for (var i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
    extendCoordinate(extent, coordinates2[i2]);
  }
  return extent;
}
function _boundingExtentXYs(xs, ys, opt_extent) {
  var minX = Math.min.apply(null, xs);
  var minY = Math.min.apply(null, ys);
  var maxX = Math.max.apply(null, xs);
  var maxY = Math.max.apply(null, ys);
  return createOrUpdate(minX, minY, maxX, maxY, opt_extent);
}
function buffer2(extent, value, opt_extent) {
  if (opt_extent) {
    opt_extent[0] = extent[0] - value;
    opt_extent[1] = extent[1] - value;
    opt_extent[2] = extent[2] + value;
    opt_extent[3] = extent[3] + value;
    return opt_extent;
  } else {
    return [
      extent[0] - value,
      extent[1] - value,
      extent[2] + value,
      extent[3] + value
    ];
  }
}
function clone(extent, opt_extent) {
  if (opt_extent) {
    opt_extent[0] = extent[0];
    opt_extent[1] = extent[1];
    opt_extent[2] = extent[2];
    opt_extent[3] = extent[3];
    return opt_extent;
  } else {
    return extent.slice();
  }
}
function closestSquaredDistanceXY(extent, x, y) {
  var dx, dy;
  if (x < extent[0]) {
    dx = extent[0] - x;
  } else if (extent[2] < x) {
    dx = x - extent[2];
  } else {
    dx = 0;
  }
  if (y < extent[1]) {
    dy = extent[1] - y;
  } else if (extent[3] < y) {
    dy = y - extent[3];
  } else {
    dy = 0;
  }
  return dx * dx + dy * dy;
}
function containsCoordinate(extent, coordinate) {
  return containsXY(extent, coordinate[0], coordinate[1]);
}
function containsExtent(extent1, extent2) {
  return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && extent1[1] <= extent2[1] && extent2[3] <= extent1[3];
}
function containsXY(extent, x, y) {
  return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
}
function coordinateRelationship(extent, coordinate) {
  var minX = extent[0];
  var minY = extent[1];
  var maxX = extent[2];
  var maxY = extent[3];
  var x = coordinate[0];
  var y = coordinate[1];
  var relationship = Relationship_default.UNKNOWN;
  if (x < minX) {
    relationship = relationship | Relationship_default.LEFT;
  } else if (x > maxX) {
    relationship = relationship | Relationship_default.RIGHT;
  }
  if (y < minY) {
    relationship = relationship | Relationship_default.BELOW;
  } else if (y > maxY) {
    relationship = relationship | Relationship_default.ABOVE;
  }
  if (relationship === Relationship_default.UNKNOWN) {
    relationship = Relationship_default.INTERSECTING;
  }
  return relationship;
}
function createEmpty() {
  return [Infinity, Infinity, -Infinity, -Infinity];
}
function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
  if (opt_extent) {
    opt_extent[0] = minX;
    opt_extent[1] = minY;
    opt_extent[2] = maxX;
    opt_extent[3] = maxY;
    return opt_extent;
  } else {
    return [minX, minY, maxX, maxY];
  }
}
function createOrUpdateEmpty(opt_extent) {
  return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, opt_extent);
}
function createOrUpdateFromCoordinate(coordinate, opt_extent) {
  var x = coordinate[0];
  var y = coordinate[1];
  return createOrUpdate(x, y, x, y, opt_extent);
}
function createOrUpdateFromFlatCoordinates(flatCoordinates, offset2, end, stride, opt_extent) {
  var extent = createOrUpdateEmpty(opt_extent);
  return extendFlatCoordinates(extent, flatCoordinates, offset2, end, stride);
}
function equals2(extent1, extent2) {
  return extent1[0] == extent2[0] && extent1[2] == extent2[2] && extent1[1] == extent2[1] && extent1[3] == extent2[3];
}
function extend2(extent1, extent2) {
  if (extent2[0] < extent1[0]) {
    extent1[0] = extent2[0];
  }
  if (extent2[2] > extent1[2]) {
    extent1[2] = extent2[2];
  }
  if (extent2[1] < extent1[1]) {
    extent1[1] = extent2[1];
  }
  if (extent2[3] > extent1[3]) {
    extent1[3] = extent2[3];
  }
  return extent1;
}
function extendCoordinate(extent, coordinate) {
  if (coordinate[0] < extent[0]) {
    extent[0] = coordinate[0];
  }
  if (coordinate[0] > extent[2]) {
    extent[2] = coordinate[0];
  }
  if (coordinate[1] < extent[1]) {
    extent[1] = coordinate[1];
  }
  if (coordinate[1] > extent[3]) {
    extent[3] = coordinate[1];
  }
}
function extendFlatCoordinates(extent, flatCoordinates, offset2, end, stride) {
  for (; offset2 < end; offset2 += stride) {
    extendXY(extent, flatCoordinates[offset2], flatCoordinates[offset2 + 1]);
  }
  return extent;
}
function extendXY(extent, x, y) {
  extent[0] = Math.min(extent[0], x);
  extent[1] = Math.min(extent[1], y);
  extent[2] = Math.max(extent[2], x);
  extent[3] = Math.max(extent[3], y);
}
function forEachCorner(extent, callback) {
  var val;
  val = callback(getBottomLeft(extent));
  if (val) {
    return val;
  }
  val = callback(getBottomRight(extent));
  if (val) {
    return val;
  }
  val = callback(getTopRight(extent));
  if (val) {
    return val;
  }
  val = callback(getTopLeft(extent));
  if (val) {
    return val;
  }
  return false;
}
function getArea(extent) {
  var area = 0;
  if (!isEmpty2(extent)) {
    area = getWidth(extent) * getHeight(extent);
  }
  return area;
}
function getBottomLeft(extent) {
  return [extent[0], extent[1]];
}
function getBottomRight(extent) {
  return [extent[2], extent[1]];
}
function getCenter(extent) {
  return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
}
function getCorner(extent, corner) {
  var coordinate;
  if (corner === "bottom-left") {
    coordinate = getBottomLeft(extent);
  } else if (corner === "bottom-right") {
    coordinate = getBottomRight(extent);
  } else if (corner === "top-left") {
    coordinate = getTopLeft(extent);
  } else if (corner === "top-right") {
    coordinate = getTopRight(extent);
  } else {
    assert(false, 13);
  }
  return coordinate;
}
function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
  var _a56 = getRotatedViewport(center, resolution, rotation, size), x0 = _a56[0], y0 = _a56[1], x1 = _a56[2], y1 = _a56[3], x2 = _a56[4], y2 = _a56[5], x3 = _a56[6], y3 = _a56[7];
  return createOrUpdate(Math.min(x0, x1, x2, x3), Math.min(y0, y1, y2, y3), Math.max(x0, x1, x2, x3), Math.max(y0, y1, y2, y3), opt_extent);
}
function getRotatedViewport(center, resolution, rotation, size) {
  var dx = resolution * size[0] / 2;
  var dy = resolution * size[1] / 2;
  var cosRotation = Math.cos(rotation);
  var sinRotation = Math.sin(rotation);
  var xCos = dx * cosRotation;
  var xSin = dx * sinRotation;
  var yCos = dy * cosRotation;
  var ySin = dy * sinRotation;
  var x = center[0];
  var y = center[1];
  return [
    x - xCos + ySin,
    y - xSin - yCos,
    x - xCos - ySin,
    y - xSin + yCos,
    x + xCos - ySin,
    y + xSin + yCos,
    x + xCos + ySin,
    y + xSin - yCos,
    x - xCos + ySin,
    y - xSin - yCos
  ];
}
function getHeight(extent) {
  return extent[3] - extent[1];
}
function getIntersection(extent1, extent2, opt_extent) {
  var intersection = opt_extent ? opt_extent : createEmpty();
  if (intersects(extent1, extent2)) {
    if (extent1[0] > extent2[0]) {
      intersection[0] = extent1[0];
    } else {
      intersection[0] = extent2[0];
    }
    if (extent1[1] > extent2[1]) {
      intersection[1] = extent1[1];
    } else {
      intersection[1] = extent2[1];
    }
    if (extent1[2] < extent2[2]) {
      intersection[2] = extent1[2];
    } else {
      intersection[2] = extent2[2];
    }
    if (extent1[3] < extent2[3]) {
      intersection[3] = extent1[3];
    } else {
      intersection[3] = extent2[3];
    }
  } else {
    createOrUpdateEmpty(intersection);
  }
  return intersection;
}
function getTopLeft(extent) {
  return [extent[0], extent[3]];
}
function getTopRight(extent) {
  return [extent[2], extent[3]];
}
function getWidth(extent) {
  return extent[2] - extent[0];
}
function intersects(extent1, extent2) {
  return extent1[0] <= extent2[2] && extent1[2] >= extent2[0] && extent1[1] <= extent2[3] && extent1[3] >= extent2[1];
}
function isEmpty2(extent) {
  return extent[2] < extent[0] || extent[3] < extent[1];
}
function returnOrUpdate(extent, opt_extent) {
  if (opt_extent) {
    opt_extent[0] = extent[0];
    opt_extent[1] = extent[1];
    opt_extent[2] = extent[2];
    opt_extent[3] = extent[3];
    return opt_extent;
  } else {
    return extent;
  }
}
function intersectsSegment(extent, start2, end) {
  var intersects2 = false;
  var startRel = coordinateRelationship(extent, start2);
  var endRel = coordinateRelationship(extent, end);
  if (startRel === Relationship_default.INTERSECTING || endRel === Relationship_default.INTERSECTING) {
    intersects2 = true;
  } else {
    var minX = extent[0];
    var minY = extent[1];
    var maxX = extent[2];
    var maxY = extent[3];
    var startX = start2[0];
    var startY = start2[1];
    var endX = end[0];
    var endY = end[1];
    var slope = (endY - startY) / (endX - startX);
    var x = void 0, y = void 0;
    if (!!(endRel & Relationship_default.ABOVE) && !(startRel & Relationship_default.ABOVE)) {
      x = endX - (endY - maxY) / slope;
      intersects2 = x >= minX && x <= maxX;
    }
    if (!intersects2 && !!(endRel & Relationship_default.RIGHT) && !(startRel & Relationship_default.RIGHT)) {
      y = endY - (endX - maxX) * slope;
      intersects2 = y >= minY && y <= maxY;
    }
    if (!intersects2 && !!(endRel & Relationship_default.BELOW) && !(startRel & Relationship_default.BELOW)) {
      x = endX - (endY - minY) / slope;
      intersects2 = x >= minX && x <= maxX;
    }
    if (!intersects2 && !!(endRel & Relationship_default.LEFT) && !(startRel & Relationship_default.LEFT)) {
      y = endY - (endX - minX) * slope;
      intersects2 = y >= minY && y <= maxY;
    }
  }
  return intersects2;
}
function applyTransform(extent, transformFn, opt_extent, opt_stops) {
  var coordinates2 = [];
  if (opt_stops > 1) {
    var width = extent[2] - extent[0];
    var height = extent[3] - extent[1];
    for (var i2 = 0; i2 < opt_stops; ++i2) {
      coordinates2.push(extent[0] + width * i2 / opt_stops, extent[1], extent[2], extent[1] + height * i2 / opt_stops, extent[2] - width * i2 / opt_stops, extent[3], extent[0], extent[3] - height * i2 / opt_stops);
    }
  } else {
    coordinates2 = [
      extent[0],
      extent[1],
      extent[2],
      extent[1],
      extent[2],
      extent[3],
      extent[0],
      extent[3]
    ];
  }
  transformFn(coordinates2, coordinates2, 2);
  var xs = [];
  var ys = [];
  for (var i2 = 0, l = coordinates2.length; i2 < l; i2 += 2) {
    xs.push(coordinates2[i2]);
    ys.push(coordinates2[i2 + 1]);
  }
  return _boundingExtentXYs(xs, ys, opt_extent);
}
function wrapX(extent, projection) {
  var projectionExtent = projection.getExtent();
  var center = getCenter(extent);
  if (projection.canWrapX() && (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])) {
    var worldWidth = getWidth(projectionExtent);
    var worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);
    var offset2 = worldsAway * worldWidth;
    extent[0] -= offset2;
    extent[2] -= offset2;
  }
  return extent;
}
function wrapAndSliceX(extent, projection) {
  if (projection.canWrapX()) {
    var projectionExtent = projection.getExtent();
    if (!isFinite(extent[0]) || !isFinite(extent[2])) {
      return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];
    }
    wrapX(extent, projection);
    var worldWidth = getWidth(projectionExtent);
    if (getWidth(extent) > worldWidth) {
      return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];
    } else if (extent[0] < projectionExtent[0]) {
      return [
        [extent[0] + worldWidth, extent[1], projectionExtent[2], extent[3]],
        [projectionExtent[0], extent[1], extent[2], extent[3]]
      ];
    } else if (extent[2] > projectionExtent[2]) {
      return [
        [extent[0], extent[1], projectionExtent[2], extent[3]],
        [projectionExtent[0], extent[1], extent[2] - worldWidth, extent[3]]
      ];
    }
  }
  return [extent];
}

// node_modules/ol/geom/flat/inflate.js
function inflateCoordinates(flatCoordinates, offset2, end, stride, opt_coordinates) {
  var coordinates2 = opt_coordinates !== void 0 ? opt_coordinates : [];
  var i2 = 0;
  for (var j = offset2; j < end; j += stride) {
    coordinates2[i2++] = flatCoordinates.slice(j, j + stride);
  }
  coordinates2.length = i2;
  return coordinates2;
}
function inflateCoordinatesArray(flatCoordinates, offset2, ends, stride, opt_coordinatess) {
  var coordinatess = opt_coordinatess !== void 0 ? opt_coordinatess : [];
  var i2 = 0;
  for (var j = 0, jj = ends.length; j < jj; ++j) {
    var end = ends[j];
    coordinatess[i2++] = inflateCoordinates(flatCoordinates, offset2, end, stride, coordinatess[i2]);
    offset2 = end;
  }
  coordinatess.length = i2;
  return coordinatess;
}
function inflateMultiCoordinatesArray(flatCoordinates, offset2, endss, stride, opt_coordinatesss) {
  var coordinatesss = opt_coordinatesss !== void 0 ? opt_coordinatesss : [];
  var i2 = 0;
  for (var j = 0, jj = endss.length; j < jj; ++j) {
    var ends = endss[j];
    coordinatesss[i2++] = inflateCoordinatesArray(flatCoordinates, offset2, ends, stride, coordinatesss[i2]);
    offset2 = ends[ends.length - 1];
  }
  coordinatesss.length = i2;
  return coordinatesss;
}

// node_modules/ol/render/canvas/Builder.js
var __extends10 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasBuilder = (
  /** @class */
  function(_super) {
    __extends10(CanvasBuilder2, _super);
    function CanvasBuilder2(tolerance, maxExtent, resolution, pixelRatio) {
      var _this = _super.call(this) || this;
      _this.tolerance = tolerance;
      _this.maxExtent = maxExtent;
      _this.pixelRatio = pixelRatio;
      _this.maxLineWidth = 0;
      _this.resolution = resolution;
      _this.beginGeometryInstruction1_ = null;
      _this.beginGeometryInstruction2_ = null;
      _this.bufferedMaxExtent_ = null;
      _this.instructions = [];
      _this.coordinates = [];
      _this.tmpCoordinate_ = [];
      _this.hitDetectionInstructions = [];
      _this.state = /** @type {import("../canvas.js").FillStrokeState} */
      {};
      return _this;
    }
    CanvasBuilder2.prototype.applyPixelRatio = function(dashArray) {
      var pixelRatio = this.pixelRatio;
      return pixelRatio == 1 ? dashArray : dashArray.map(function(dash) {
        return dash * pixelRatio;
      });
    };
    CanvasBuilder2.prototype.appendFlatPointCoordinates = function(flatCoordinates, stride) {
      var extent = this.getBufferedMaxExtent();
      var tmpCoord = this.tmpCoordinate_;
      var coordinates2 = this.coordinates;
      var myEnd = coordinates2.length;
      for (var i2 = 0, ii = flatCoordinates.length; i2 < ii; i2 += stride) {
        tmpCoord[0] = flatCoordinates[i2];
        tmpCoord[1] = flatCoordinates[i2 + 1];
        if (containsCoordinate(extent, tmpCoord)) {
          coordinates2[myEnd++] = tmpCoord[0];
          coordinates2[myEnd++] = tmpCoord[1];
        }
      }
      return myEnd;
    };
    CanvasBuilder2.prototype.appendFlatLineCoordinates = function(flatCoordinates, offset2, end, stride, closed, skipFirst) {
      var coordinates2 = this.coordinates;
      var myEnd = coordinates2.length;
      var extent = this.getBufferedMaxExtent();
      if (skipFirst) {
        offset2 += stride;
      }
      var lastXCoord = flatCoordinates[offset2];
      var lastYCoord = flatCoordinates[offset2 + 1];
      var nextCoord = this.tmpCoordinate_;
      var skipped = true;
      var i2, lastRel, nextRel;
      for (i2 = offset2 + stride; i2 < end; i2 += stride) {
        nextCoord[0] = flatCoordinates[i2];
        nextCoord[1] = flatCoordinates[i2 + 1];
        nextRel = coordinateRelationship(extent, nextCoord);
        if (nextRel !== lastRel) {
          if (skipped) {
            coordinates2[myEnd++] = lastXCoord;
            coordinates2[myEnd++] = lastYCoord;
            skipped = false;
          }
          coordinates2[myEnd++] = nextCoord[0];
          coordinates2[myEnd++] = nextCoord[1];
        } else if (nextRel === Relationship_default.INTERSECTING) {
          coordinates2[myEnd++] = nextCoord[0];
          coordinates2[myEnd++] = nextCoord[1];
          skipped = false;
        } else {
          skipped = true;
        }
        lastXCoord = nextCoord[0];
        lastYCoord = nextCoord[1];
        lastRel = nextRel;
      }
      if (closed && skipped || i2 === offset2 + stride) {
        coordinates2[myEnd++] = lastXCoord;
        coordinates2[myEnd++] = lastYCoord;
      }
      return myEnd;
    };
    CanvasBuilder2.prototype.drawCustomCoordinates_ = function(flatCoordinates, offset2, ends, stride, builderEnds) {
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        var end = ends[i2];
        var builderEnd = this.appendFlatLineCoordinates(flatCoordinates, offset2, end, stride, false, false);
        builderEnds.push(builderEnd);
        offset2 = end;
      }
      return offset2;
    };
    CanvasBuilder2.prototype.drawCustom = function(geometry2, feature, renderer, hitDetectionRenderer) {
      this.beginGeometry(geometry2, feature);
      var type = geometry2.getType();
      var stride = geometry2.getStride();
      var builderBegin = this.coordinates.length;
      var flatCoordinates, builderEnd, builderEnds, builderEndss;
      var offset2;
      switch (type) {
        case "MultiPolygon":
          flatCoordinates = /** @type {import("../../geom/MultiPolygon.js").default} */
          geometry2.getOrientedFlatCoordinates();
          builderEndss = [];
          var endss = (
            /** @type {import("../../geom/MultiPolygon.js").default} */
            geometry2.getEndss()
          );
          offset2 = 0;
          for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
            var myEnds = [];
            offset2 = this.drawCustomCoordinates_(flatCoordinates, offset2, endss[i2], stride, myEnds);
            builderEndss.push(myEnds);
          }
          this.instructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEndss,
            geometry2,
            renderer,
            inflateMultiCoordinatesArray
          ]);
          this.hitDetectionInstructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEndss,
            geometry2,
            hitDetectionRenderer || renderer,
            inflateMultiCoordinatesArray
          ]);
          break;
        case "Polygon":
        case "MultiLineString":
          builderEnds = [];
          flatCoordinates = type == "Polygon" ? (
            /** @type {import("../../geom/Polygon.js").default} */
            geometry2.getOrientedFlatCoordinates()
          ) : geometry2.getFlatCoordinates();
          offset2 = this.drawCustomCoordinates_(
            flatCoordinates,
            0,
            /** @type {import("../../geom/Polygon.js").default|import("../../geom/MultiLineString.js").default} */
            geometry2.getEnds(),
            stride,
            builderEnds
          );
          this.instructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnds,
            geometry2,
            renderer,
            inflateCoordinatesArray
          ]);
          this.hitDetectionInstructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnds,
            geometry2,
            hitDetectionRenderer || renderer,
            inflateCoordinatesArray
          ]);
          break;
        case "LineString":
        case "Circle":
          flatCoordinates = geometry2.getFlatCoordinates();
          builderEnd = this.appendFlatLineCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);
          this.instructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnd,
            geometry2,
            renderer,
            inflateCoordinates
          ]);
          this.hitDetectionInstructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnd,
            geometry2,
            hitDetectionRenderer || renderer,
            inflateCoordinates
          ]);
          break;
        case "MultiPoint":
          flatCoordinates = geometry2.getFlatCoordinates();
          builderEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);
          if (builderEnd > builderBegin) {
            this.instructions.push([
              Instruction_default.CUSTOM,
              builderBegin,
              builderEnd,
              geometry2,
              renderer,
              inflateCoordinates
            ]);
            this.hitDetectionInstructions.push([
              Instruction_default.CUSTOM,
              builderBegin,
              builderEnd,
              geometry2,
              hitDetectionRenderer || renderer,
              inflateCoordinates
            ]);
          }
          break;
        case "Point":
          flatCoordinates = geometry2.getFlatCoordinates();
          this.coordinates.push(flatCoordinates[0], flatCoordinates[1]);
          builderEnd = this.coordinates.length;
          this.instructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnd,
            geometry2,
            renderer
          ]);
          this.hitDetectionInstructions.push([
            Instruction_default.CUSTOM,
            builderBegin,
            builderEnd,
            geometry2,
            hitDetectionRenderer || renderer
          ]);
          break;
        default:
      }
      this.endGeometry(feature);
    };
    CanvasBuilder2.prototype.beginGeometry = function(geometry2, feature) {
      this.beginGeometryInstruction1_ = [
        Instruction_default.BEGIN_GEOMETRY,
        feature,
        0,
        geometry2
      ];
      this.instructions.push(this.beginGeometryInstruction1_);
      this.beginGeometryInstruction2_ = [
        Instruction_default.BEGIN_GEOMETRY,
        feature,
        0,
        geometry2
      ];
      this.hitDetectionInstructions.push(this.beginGeometryInstruction2_);
    };
    CanvasBuilder2.prototype.finish = function() {
      return {
        instructions: this.instructions,
        hitDetectionInstructions: this.hitDetectionInstructions,
        coordinates: this.coordinates
      };
    };
    CanvasBuilder2.prototype.reverseHitDetectionInstructions = function() {
      var hitDetectionInstructions = this.hitDetectionInstructions;
      hitDetectionInstructions.reverse();
      var i2;
      var n = hitDetectionInstructions.length;
      var instruction;
      var type;
      var begin = -1;
      for (i2 = 0; i2 < n; ++i2) {
        instruction = hitDetectionInstructions[i2];
        type = /** @type {import("./Instruction.js").default} */
        instruction[0];
        if (type == Instruction_default.END_GEOMETRY) {
          begin = i2;
        } else if (type == Instruction_default.BEGIN_GEOMETRY) {
          instruction[2] = i2;
          reverseSubArray(this.hitDetectionInstructions, begin, i2);
          begin = -1;
        }
      }
    };
    CanvasBuilder2.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
      var state2 = this.state;
      if (fillStyle) {
        var fillStyleColor = fillStyle.getColor();
        state2.fillStyle = asColorLike(fillStyleColor ? fillStyleColor : defaultFillStyle);
      } else {
        state2.fillStyle = void 0;
      }
      if (strokeStyle) {
        var strokeStyleColor = strokeStyle.getColor();
        state2.strokeStyle = asColorLike(strokeStyleColor ? strokeStyleColor : defaultStrokeStyle);
        var strokeStyleLineCap = strokeStyle.getLineCap();
        state2.lineCap = strokeStyleLineCap !== void 0 ? strokeStyleLineCap : defaultLineCap;
        var strokeStyleLineDash = strokeStyle.getLineDash();
        state2.lineDash = strokeStyleLineDash ? strokeStyleLineDash.slice() : defaultLineDash;
        var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();
        state2.lineDashOffset = strokeStyleLineDashOffset ? strokeStyleLineDashOffset : defaultLineDashOffset;
        var strokeStyleLineJoin = strokeStyle.getLineJoin();
        state2.lineJoin = strokeStyleLineJoin !== void 0 ? strokeStyleLineJoin : defaultLineJoin;
        var strokeStyleWidth = strokeStyle.getWidth();
        state2.lineWidth = strokeStyleWidth !== void 0 ? strokeStyleWidth : defaultLineWidth;
        var strokeStyleMiterLimit = strokeStyle.getMiterLimit();
        state2.miterLimit = strokeStyleMiterLimit !== void 0 ? strokeStyleMiterLimit : defaultMiterLimit;
        if (state2.lineWidth > this.maxLineWidth) {
          this.maxLineWidth = state2.lineWidth;
          this.bufferedMaxExtent_ = null;
        }
      } else {
        state2.strokeStyle = void 0;
        state2.lineCap = void 0;
        state2.lineDash = null;
        state2.lineDashOffset = void 0;
        state2.lineJoin = void 0;
        state2.lineWidth = void 0;
        state2.miterLimit = void 0;
      }
    };
    CanvasBuilder2.prototype.createFill = function(state2) {
      var fillStyle = state2.fillStyle;
      var fillInstruction2 = [Instruction_default.SET_FILL_STYLE, fillStyle];
      if (typeof fillStyle !== "string") {
        fillInstruction2.push(true);
      }
      return fillInstruction2;
    };
    CanvasBuilder2.prototype.applyStroke = function(state2) {
      this.instructions.push(this.createStroke(state2));
    };
    CanvasBuilder2.prototype.createStroke = function(state2) {
      return [
        Instruction_default.SET_STROKE_STYLE,
        state2.strokeStyle,
        state2.lineWidth * this.pixelRatio,
        state2.lineCap,
        state2.lineJoin,
        state2.miterLimit,
        this.applyPixelRatio(state2.lineDash),
        state2.lineDashOffset * this.pixelRatio
      ];
    };
    CanvasBuilder2.prototype.updateFillStyle = function(state2, createFill) {
      var fillStyle = state2.fillStyle;
      if (typeof fillStyle !== "string" || state2.currentFillStyle != fillStyle) {
        if (fillStyle !== void 0) {
          this.instructions.push(createFill.call(this, state2));
        }
        state2.currentFillStyle = fillStyle;
      }
    };
    CanvasBuilder2.prototype.updateStrokeStyle = function(state2, applyStroke) {
      var strokeStyle = state2.strokeStyle;
      var lineCap = state2.lineCap;
      var lineDash = state2.lineDash;
      var lineDashOffset = state2.lineDashOffset;
      var lineJoin = state2.lineJoin;
      var lineWidth = state2.lineWidth;
      var miterLimit = state2.miterLimit;
      if (state2.currentStrokeStyle != strokeStyle || state2.currentLineCap != lineCap || lineDash != state2.currentLineDash && !equals(state2.currentLineDash, lineDash) || state2.currentLineDashOffset != lineDashOffset || state2.currentLineJoin != lineJoin || state2.currentLineWidth != lineWidth || state2.currentMiterLimit != miterLimit) {
        if (strokeStyle !== void 0) {
          applyStroke.call(this, state2);
        }
        state2.currentStrokeStyle = strokeStyle;
        state2.currentLineCap = lineCap;
        state2.currentLineDash = lineDash;
        state2.currentLineDashOffset = lineDashOffset;
        state2.currentLineJoin = lineJoin;
        state2.currentLineWidth = lineWidth;
        state2.currentMiterLimit = miterLimit;
      }
    };
    CanvasBuilder2.prototype.endGeometry = function(feature) {
      this.beginGeometryInstruction1_[2] = this.instructions.length;
      this.beginGeometryInstruction1_ = null;
      this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;
      this.beginGeometryInstruction2_ = null;
      var endGeometryInstruction = [Instruction_default.END_GEOMETRY, feature];
      this.instructions.push(endGeometryInstruction);
      this.hitDetectionInstructions.push(endGeometryInstruction);
    };
    CanvasBuilder2.prototype.getBufferedMaxExtent = function() {
      if (!this.bufferedMaxExtent_) {
        this.bufferedMaxExtent_ = clone(this.maxExtent);
        if (this.maxLineWidth > 0) {
          var width = this.resolution * (this.maxLineWidth + 1) / 2;
          buffer2(this.bufferedMaxExtent_, width, this.bufferedMaxExtent_);
        }
      }
      return this.bufferedMaxExtent_;
    };
    return CanvasBuilder2;
  }(VectorContext_default)
);
var Builder_default = CanvasBuilder;

// node_modules/ol/render/canvas/ImageBuilder.js
var __extends11 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasImageBuilder = (
  /** @class */
  function(_super) {
    __extends11(CanvasImageBuilder2, _super);
    function CanvasImageBuilder2(tolerance, maxExtent, resolution, pixelRatio) {
      var _this = _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;
      _this.hitDetectionImage_ = null;
      _this.image_ = null;
      _this.imagePixelRatio_ = void 0;
      _this.anchorX_ = void 0;
      _this.anchorY_ = void 0;
      _this.height_ = void 0;
      _this.opacity_ = void 0;
      _this.originX_ = void 0;
      _this.originY_ = void 0;
      _this.rotateWithView_ = void 0;
      _this.rotation_ = void 0;
      _this.scale_ = void 0;
      _this.width_ = void 0;
      _this.declutterMode_ = void 0;
      _this.declutterImageWithText_ = void 0;
      return _this;
    }
    CanvasImageBuilder2.prototype.drawPoint = function(pointGeometry, feature) {
      if (!this.image_) {
        return;
      }
      this.beginGeometry(pointGeometry, feature);
      var flatCoordinates = pointGeometry.getFlatCoordinates();
      var stride = pointGeometry.getStride();
      var myBegin = this.coordinates.length;
      var myEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);
      this.instructions.push([
        Instruction_default.DRAW_IMAGE,
        myBegin,
        myEnd,
        this.image_,
        // Remaining arguments to DRAW_IMAGE are in alphabetical order
        this.anchorX_ * this.imagePixelRatio_,
        this.anchorY_ * this.imagePixelRatio_,
        Math.ceil(this.height_ * this.imagePixelRatio_),
        this.opacity_,
        this.originX_ * this.imagePixelRatio_,
        this.originY_ * this.imagePixelRatio_,
        this.rotateWithView_,
        this.rotation_,
        [
          this.scale_[0] * this.pixelRatio / this.imagePixelRatio_,
          this.scale_[1] * this.pixelRatio / this.imagePixelRatio_
        ],
        Math.ceil(this.width_ * this.imagePixelRatio_),
        this.declutterMode_,
        this.declutterImageWithText_
      ]);
      this.hitDetectionInstructions.push([
        Instruction_default.DRAW_IMAGE,
        myBegin,
        myEnd,
        this.hitDetectionImage_,
        // Remaining arguments to DRAW_IMAGE are in alphabetical order
        this.anchorX_,
        this.anchorY_,
        this.height_,
        this.opacity_,
        this.originX_,
        this.originY_,
        this.rotateWithView_,
        this.rotation_,
        this.scale_,
        this.width_,
        this.declutterMode_,
        this.declutterImageWithText_
      ]);
      this.endGeometry(feature);
    };
    CanvasImageBuilder2.prototype.drawMultiPoint = function(multiPointGeometry, feature) {
      if (!this.image_) {
        return;
      }
      this.beginGeometry(multiPointGeometry, feature);
      var flatCoordinates = multiPointGeometry.getFlatCoordinates();
      var stride = multiPointGeometry.getStride();
      var myBegin = this.coordinates.length;
      var myEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);
      this.instructions.push([
        Instruction_default.DRAW_IMAGE,
        myBegin,
        myEnd,
        this.image_,
        // Remaining arguments to DRAW_IMAGE are in alphabetical order
        this.anchorX_ * this.imagePixelRatio_,
        this.anchorY_ * this.imagePixelRatio_,
        Math.ceil(this.height_ * this.imagePixelRatio_),
        this.opacity_,
        this.originX_ * this.imagePixelRatio_,
        this.originY_ * this.imagePixelRatio_,
        this.rotateWithView_,
        this.rotation_,
        [
          this.scale_[0] * this.pixelRatio / this.imagePixelRatio_,
          this.scale_[1] * this.pixelRatio / this.imagePixelRatio_
        ],
        Math.ceil(this.width_ * this.imagePixelRatio_),
        this.declutterMode_,
        this.declutterImageWithText_
      ]);
      this.hitDetectionInstructions.push([
        Instruction_default.DRAW_IMAGE,
        myBegin,
        myEnd,
        this.hitDetectionImage_,
        // Remaining arguments to DRAW_IMAGE are in alphabetical order
        this.anchorX_,
        this.anchorY_,
        this.height_,
        this.opacity_,
        this.originX_,
        this.originY_,
        this.rotateWithView_,
        this.rotation_,
        this.scale_,
        this.width_,
        this.declutterMode_,
        this.declutterImageWithText_
      ]);
      this.endGeometry(feature);
    };
    CanvasImageBuilder2.prototype.finish = function() {
      this.reverseHitDetectionInstructions();
      this.anchorX_ = void 0;
      this.anchorY_ = void 0;
      this.hitDetectionImage_ = null;
      this.image_ = null;
      this.imagePixelRatio_ = void 0;
      this.height_ = void 0;
      this.scale_ = void 0;
      this.opacity_ = void 0;
      this.originX_ = void 0;
      this.originY_ = void 0;
      this.rotateWithView_ = void 0;
      this.rotation_ = void 0;
      this.width_ = void 0;
      return _super.prototype.finish.call(this);
    };
    CanvasImageBuilder2.prototype.setImageStyle = function(imageStyle, opt_sharedData) {
      var anchor2 = imageStyle.getAnchor();
      var size = imageStyle.getSize();
      var origin = imageStyle.getOrigin();
      this.imagePixelRatio_ = imageStyle.getPixelRatio(this.pixelRatio);
      this.anchorX_ = anchor2[0];
      this.anchorY_ = anchor2[1];
      this.hitDetectionImage_ = imageStyle.getHitDetectionImage();
      this.image_ = imageStyle.getImage(this.pixelRatio);
      this.height_ = size[1];
      this.opacity_ = imageStyle.getOpacity();
      this.originX_ = origin[0];
      this.originY_ = origin[1];
      this.rotateWithView_ = imageStyle.getRotateWithView();
      this.rotation_ = imageStyle.getRotation();
      this.scale_ = imageStyle.getScaleArray();
      this.width_ = size[0];
      this.declutterMode_ = imageStyle.getDeclutterMode();
      this.declutterImageWithText_ = opt_sharedData;
    };
    return CanvasImageBuilder2;
  }(Builder_default)
);
var ImageBuilder_default = CanvasImageBuilder;

// node_modules/ol/render/canvas/LineStringBuilder.js
var __extends12 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasLineStringBuilder = (
  /** @class */
  function(_super) {
    __extends12(CanvasLineStringBuilder2, _super);
    function CanvasLineStringBuilder2(tolerance, maxExtent, resolution, pixelRatio) {
      return _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;
    }
    CanvasLineStringBuilder2.prototype.drawFlatCoordinates_ = function(flatCoordinates, offset2, end, stride) {
      var myBegin = this.coordinates.length;
      var myEnd = this.appendFlatLineCoordinates(flatCoordinates, offset2, end, stride, false, false);
      var moveToLineToInstruction = [
        Instruction_default.MOVE_TO_LINE_TO,
        myBegin,
        myEnd
      ];
      this.instructions.push(moveToLineToInstruction);
      this.hitDetectionInstructions.push(moveToLineToInstruction);
      return end;
    };
    CanvasLineStringBuilder2.prototype.drawLineString = function(lineStringGeometry, feature) {
      var state2 = this.state;
      var strokeStyle = state2.strokeStyle;
      var lineWidth = state2.lineWidth;
      if (strokeStyle === void 0 || lineWidth === void 0) {
        return;
      }
      this.updateStrokeStyle(state2, this.applyStroke);
      this.beginGeometry(lineStringGeometry, feature);
      this.hitDetectionInstructions.push([
        Instruction_default.SET_STROKE_STYLE,
        state2.strokeStyle,
        state2.lineWidth,
        state2.lineCap,
        state2.lineJoin,
        state2.miterLimit,
        defaultLineDash,
        defaultLineDashOffset
      ], beginPathInstruction);
      var flatCoordinates = lineStringGeometry.getFlatCoordinates();
      var stride = lineStringGeometry.getStride();
      this.drawFlatCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride);
      this.hitDetectionInstructions.push(strokeInstruction);
      this.endGeometry(feature);
    };
    CanvasLineStringBuilder2.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {
      var state2 = this.state;
      var strokeStyle = state2.strokeStyle;
      var lineWidth = state2.lineWidth;
      if (strokeStyle === void 0 || lineWidth === void 0) {
        return;
      }
      this.updateStrokeStyle(state2, this.applyStroke);
      this.beginGeometry(multiLineStringGeometry, feature);
      this.hitDetectionInstructions.push([
        Instruction_default.SET_STROKE_STYLE,
        state2.strokeStyle,
        state2.lineWidth,
        state2.lineCap,
        state2.lineJoin,
        state2.miterLimit,
        state2.lineDash,
        state2.lineDashOffset
      ], beginPathInstruction);
      var ends = multiLineStringGeometry.getEnds();
      var flatCoordinates = multiLineStringGeometry.getFlatCoordinates();
      var stride = multiLineStringGeometry.getStride();
      var offset2 = 0;
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        offset2 = this.drawFlatCoordinates_(
          flatCoordinates,
          offset2,
          /** @type {number} */
          ends[i2],
          stride
        );
      }
      this.hitDetectionInstructions.push(strokeInstruction);
      this.endGeometry(feature);
    };
    CanvasLineStringBuilder2.prototype.finish = function() {
      var state2 = this.state;
      if (state2.lastStroke != void 0 && state2.lastStroke != this.coordinates.length) {
        this.instructions.push(strokeInstruction);
      }
      this.reverseHitDetectionInstructions();
      this.state = null;
      return _super.prototype.finish.call(this);
    };
    CanvasLineStringBuilder2.prototype.applyStroke = function(state2) {
      if (state2.lastStroke != void 0 && state2.lastStroke != this.coordinates.length) {
        this.instructions.push(strokeInstruction);
        state2.lastStroke = this.coordinates.length;
      }
      state2.lastStroke = 0;
      _super.prototype.applyStroke.call(this, state2);
      this.instructions.push(beginPathInstruction);
    };
    return CanvasLineStringBuilder2;
  }(Builder_default)
);
var LineStringBuilder_default = CanvasLineStringBuilder;

// node_modules/ol/geom/flat/simplify.js
function douglasPeucker(flatCoordinates, offset2, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {
  var n = (end - offset2) / stride;
  if (n < 3) {
    for (; offset2 < end; offset2 += stride) {
      simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset2];
      simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset2 + 1];
    }
    return simplifiedOffset;
  }
  var markers = new Array(n);
  markers[0] = 1;
  markers[n - 1] = 1;
  var stack = [offset2, end - stride];
  var index = 0;
  while (stack.length > 0) {
    var last2 = stack.pop();
    var first2 = stack.pop();
    var maxSquaredDistance = 0;
    var x1 = flatCoordinates[first2];
    var y1 = flatCoordinates[first2 + 1];
    var x2 = flatCoordinates[last2];
    var y2 = flatCoordinates[last2 + 1];
    for (var i2 = first2 + stride; i2 < last2; i2 += stride) {
      var x = flatCoordinates[i2];
      var y = flatCoordinates[i2 + 1];
      var squaredDistance_1 = squaredSegmentDistance(x, y, x1, y1, x2, y2);
      if (squaredDistance_1 > maxSquaredDistance) {
        index = i2;
        maxSquaredDistance = squaredDistance_1;
      }
    }
    if (maxSquaredDistance > squaredTolerance) {
      markers[(index - offset2) / stride] = 1;
      if (first2 + stride < index) {
        stack.push(first2, index);
      }
      if (index + stride < last2) {
        stack.push(index, last2);
      }
    }
  }
  for (var i2 = 0; i2 < n; ++i2) {
    if (markers[i2]) {
      simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset2 + i2 * stride];
      simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset2 + i2 * stride + 1];
    }
  }
  return simplifiedOffset;
}
function douglasPeuckerArray(flatCoordinates, offset2, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    simplifiedOffset = douglasPeucker(flatCoordinates, offset2, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset);
    simplifiedEnds.push(simplifiedOffset);
    offset2 = end;
  }
  return simplifiedOffset;
}
function snap(value, tolerance) {
  return tolerance * Math.round(value / tolerance);
}
function quantize(flatCoordinates, offset2, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset) {
  if (offset2 == end) {
    return simplifiedOffset;
  }
  var x1 = snap(flatCoordinates[offset2], tolerance);
  var y1 = snap(flatCoordinates[offset2 + 1], tolerance);
  offset2 += stride;
  simplifiedFlatCoordinates[simplifiedOffset++] = x1;
  simplifiedFlatCoordinates[simplifiedOffset++] = y1;
  var x2, y2;
  do {
    x2 = snap(flatCoordinates[offset2], tolerance);
    y2 = snap(flatCoordinates[offset2 + 1], tolerance);
    offset2 += stride;
    if (offset2 == end) {
      simplifiedFlatCoordinates[simplifiedOffset++] = x2;
      simplifiedFlatCoordinates[simplifiedOffset++] = y2;
      return simplifiedOffset;
    }
  } while (x2 == x1 && y2 == y1);
  while (offset2 < end) {
    var x3 = snap(flatCoordinates[offset2], tolerance);
    var y3 = snap(flatCoordinates[offset2 + 1], tolerance);
    offset2 += stride;
    if (x3 == x2 && y3 == y2) {
      continue;
    }
    var dx1 = x2 - x1;
    var dy1 = y2 - y1;
    var dx2 = x3 - x1;
    var dy2 = y3 - y1;
    if (dx1 * dy2 == dy1 * dx2 && (dx1 < 0 && dx2 < dx1 || dx1 == dx2 || dx1 > 0 && dx2 > dx1) && (dy1 < 0 && dy2 < dy1 || dy1 == dy2 || dy1 > 0 && dy2 > dy1)) {
      x2 = x3;
      y2 = y3;
      continue;
    }
    simplifiedFlatCoordinates[simplifiedOffset++] = x2;
    simplifiedFlatCoordinates[simplifiedOffset++] = y2;
    x1 = x2;
    y1 = y2;
    x2 = x3;
    y2 = y3;
  }
  simplifiedFlatCoordinates[simplifiedOffset++] = x2;
  simplifiedFlatCoordinates[simplifiedOffset++] = y2;
  return simplifiedOffset;
}
function quantizeArray(flatCoordinates, offset2, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    simplifiedOffset = quantize(flatCoordinates, offset2, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset);
    simplifiedEnds.push(simplifiedOffset);
    offset2 = end;
  }
  return simplifiedOffset;
}
function quantizeMultiArray(flatCoordinates, offset2, endss, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    var simplifiedEnds = [];
    simplifiedOffset = quantizeArray(flatCoordinates, offset2, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);
    simplifiedEndss.push(simplifiedEnds);
    offset2 = ends[ends.length - 1];
  }
  return simplifiedOffset;
}

// node_modules/ol/render/canvas/PolygonBuilder.js
var __extends13 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasPolygonBuilder = (
  /** @class */
  function(_super) {
    __extends13(CanvasPolygonBuilder2, _super);
    function CanvasPolygonBuilder2(tolerance, maxExtent, resolution, pixelRatio) {
      return _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;
    }
    CanvasPolygonBuilder2.prototype.drawFlatCoordinatess_ = function(flatCoordinates, offset2, ends, stride) {
      var state2 = this.state;
      var fill = state2.fillStyle !== void 0;
      var stroke = state2.strokeStyle !== void 0;
      var numEnds = ends.length;
      this.instructions.push(beginPathInstruction);
      this.hitDetectionInstructions.push(beginPathInstruction);
      for (var i2 = 0; i2 < numEnds; ++i2) {
        var end = ends[i2];
        var myBegin = this.coordinates.length;
        var myEnd = this.appendFlatLineCoordinates(flatCoordinates, offset2, end, stride, true, !stroke);
        var moveToLineToInstruction = [
          Instruction_default.MOVE_TO_LINE_TO,
          myBegin,
          myEnd
        ];
        this.instructions.push(moveToLineToInstruction);
        this.hitDetectionInstructions.push(moveToLineToInstruction);
        if (stroke) {
          this.instructions.push(closePathInstruction);
          this.hitDetectionInstructions.push(closePathInstruction);
        }
        offset2 = end;
      }
      if (fill) {
        this.instructions.push(fillInstruction);
        this.hitDetectionInstructions.push(fillInstruction);
      }
      if (stroke) {
        this.instructions.push(strokeInstruction);
        this.hitDetectionInstructions.push(strokeInstruction);
      }
      return offset2;
    };
    CanvasPolygonBuilder2.prototype.drawCircle = function(circleGeometry, feature) {
      var state2 = this.state;
      var fillStyle = state2.fillStyle;
      var strokeStyle = state2.strokeStyle;
      if (fillStyle === void 0 && strokeStyle === void 0) {
        return;
      }
      this.setFillStrokeStyles_();
      this.beginGeometry(circleGeometry, feature);
      if (state2.fillStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_FILL_STYLE,
          defaultFillStyle
        ]);
      }
      if (state2.strokeStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_STROKE_STYLE,
          state2.strokeStyle,
          state2.lineWidth,
          state2.lineCap,
          state2.lineJoin,
          state2.miterLimit,
          state2.lineDash,
          state2.lineDashOffset
        ]);
      }
      var flatCoordinates = circleGeometry.getFlatCoordinates();
      var stride = circleGeometry.getStride();
      var myBegin = this.coordinates.length;
      this.appendFlatLineCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);
      var circleInstruction = [Instruction_default.CIRCLE, myBegin];
      this.instructions.push(beginPathInstruction, circleInstruction);
      this.hitDetectionInstructions.push(beginPathInstruction, circleInstruction);
      if (state2.fillStyle !== void 0) {
        this.instructions.push(fillInstruction);
        this.hitDetectionInstructions.push(fillInstruction);
      }
      if (state2.strokeStyle !== void 0) {
        this.instructions.push(strokeInstruction);
        this.hitDetectionInstructions.push(strokeInstruction);
      }
      this.endGeometry(feature);
    };
    CanvasPolygonBuilder2.prototype.drawPolygon = function(polygonGeometry, feature) {
      var state2 = this.state;
      var fillStyle = state2.fillStyle;
      var strokeStyle = state2.strokeStyle;
      if (fillStyle === void 0 && strokeStyle === void 0) {
        return;
      }
      this.setFillStrokeStyles_();
      this.beginGeometry(polygonGeometry, feature);
      if (state2.fillStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_FILL_STYLE,
          defaultFillStyle
        ]);
      }
      if (state2.strokeStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_STROKE_STYLE,
          state2.strokeStyle,
          state2.lineWidth,
          state2.lineCap,
          state2.lineJoin,
          state2.miterLimit,
          state2.lineDash,
          state2.lineDashOffset
        ]);
      }
      var ends = polygonGeometry.getEnds();
      var flatCoordinates = polygonGeometry.getOrientedFlatCoordinates();
      var stride = polygonGeometry.getStride();
      this.drawFlatCoordinatess_(
        flatCoordinates,
        0,
        /** @type {Array<number>} */
        ends,
        stride
      );
      this.endGeometry(feature);
    };
    CanvasPolygonBuilder2.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {
      var state2 = this.state;
      var fillStyle = state2.fillStyle;
      var strokeStyle = state2.strokeStyle;
      if (fillStyle === void 0 && strokeStyle === void 0) {
        return;
      }
      this.setFillStrokeStyles_();
      this.beginGeometry(multiPolygonGeometry, feature);
      if (state2.fillStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_FILL_STYLE,
          defaultFillStyle
        ]);
      }
      if (state2.strokeStyle !== void 0) {
        this.hitDetectionInstructions.push([
          Instruction_default.SET_STROKE_STYLE,
          state2.strokeStyle,
          state2.lineWidth,
          state2.lineCap,
          state2.lineJoin,
          state2.miterLimit,
          state2.lineDash,
          state2.lineDashOffset
        ]);
      }
      var endss = multiPolygonGeometry.getEndss();
      var flatCoordinates = multiPolygonGeometry.getOrientedFlatCoordinates();
      var stride = multiPolygonGeometry.getStride();
      var offset2 = 0;
      for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
        offset2 = this.drawFlatCoordinatess_(flatCoordinates, offset2, endss[i2], stride);
      }
      this.endGeometry(feature);
    };
    CanvasPolygonBuilder2.prototype.finish = function() {
      this.reverseHitDetectionInstructions();
      this.state = null;
      var tolerance = this.tolerance;
      if (tolerance !== 0) {
        var coordinates2 = this.coordinates;
        for (var i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
          coordinates2[i2] = snap(coordinates2[i2], tolerance);
        }
      }
      return _super.prototype.finish.call(this);
    };
    CanvasPolygonBuilder2.prototype.setFillStrokeStyles_ = function() {
      var state2 = this.state;
      var fillStyle = state2.fillStyle;
      if (fillStyle !== void 0) {
        this.updateFillStyle(state2, this.createFill);
      }
      if (state2.strokeStyle !== void 0) {
        this.updateStrokeStyle(state2, this.applyStroke);
      }
    };
    return CanvasPolygonBuilder2;
  }(Builder_default)
);
var PolygonBuilder_default = CanvasPolygonBuilder;

// node_modules/ol/style/TextPlacement.js
var TextPlacement_default = {
  POINT: "point",
  LINE: "line"
};

// node_modules/ol/geom/flat/straightchunk.js
function matchingChunk(maxAngle, flatCoordinates, offset2, end, stride) {
  var chunkStart = offset2;
  var chunkEnd = offset2;
  var chunkM = 0;
  var m = 0;
  var start2 = offset2;
  var acos, i2, m12, m23, x1, y1, x12, y12, x23, y23;
  for (i2 = offset2; i2 < end; i2 += stride) {
    var x2 = flatCoordinates[i2];
    var y2 = flatCoordinates[i2 + 1];
    if (x1 !== void 0) {
      x23 = x2 - x1;
      y23 = y2 - y1;
      m23 = Math.sqrt(x23 * x23 + y23 * y23);
      if (x12 !== void 0) {
        m += m12;
        acos = Math.acos((x12 * x23 + y12 * y23) / (m12 * m23));
        if (acos > maxAngle) {
          if (m > chunkM) {
            chunkM = m;
            chunkStart = start2;
            chunkEnd = i2;
          }
          m = 0;
          start2 = i2 - stride;
        }
      }
      m12 = m23;
      x12 = x23;
      y12 = y23;
    }
    x1 = x2;
    y1 = y2;
  }
  m += m23;
  return m > chunkM ? [start2, i2] : [chunkStart, chunkEnd];
}

// node_modules/ol/render/canvas/TextBuilder.js
var __extends14 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TEXT_ALIGN = {
  "left": 0,
  "end": 0,
  "center": 0.5,
  "right": 1,
  "start": 1,
  "top": 0,
  "middle": 0.5,
  "hanging": 0.2,
  "alphabetic": 0.8,
  "ideographic": 0.8,
  "bottom": 1
};
var CanvasTextBuilder = (
  /** @class */
  function(_super) {
    __extends14(CanvasTextBuilder2, _super);
    function CanvasTextBuilder2(tolerance, maxExtent, resolution, pixelRatio) {
      var _this = _super.call(this, tolerance, maxExtent, resolution, pixelRatio) || this;
      _this.labels_ = null;
      _this.text_ = "";
      _this.textOffsetX_ = 0;
      _this.textOffsetY_ = 0;
      _this.textRotateWithView_ = void 0;
      _this.textRotation_ = 0;
      _this.textFillState_ = null;
      _this.fillStates = {};
      _this.textStrokeState_ = null;
      _this.strokeStates = {};
      _this.textState_ = /** @type {import("../canvas.js").TextState} */
      {};
      _this.textStates = {};
      _this.textKey_ = "";
      _this.fillKey_ = "";
      _this.strokeKey_ = "";
      _this.declutterImageWithText_ = void 0;
      return _this;
    }
    CanvasTextBuilder2.prototype.finish = function() {
      var instructions = _super.prototype.finish.call(this);
      instructions.textStates = this.textStates;
      instructions.fillStates = this.fillStates;
      instructions.strokeStates = this.strokeStates;
      return instructions;
    };
    CanvasTextBuilder2.prototype.drawText = function(geometry2, feature) {
      var fillState = this.textFillState_;
      var strokeState = this.textStrokeState_;
      var textState = this.textState_;
      if (this.text_ === "" || !textState || !fillState && !strokeState) {
        return;
      }
      var coordinates2 = this.coordinates;
      var begin = coordinates2.length;
      var geometryType2 = geometry2.getType();
      var flatCoordinates = null;
      var stride = geometry2.getStride();
      if (textState.placement === TextPlacement_default.LINE && (geometryType2 == "LineString" || geometryType2 == "MultiLineString" || geometryType2 == "Polygon" || geometryType2 == "MultiPolygon")) {
        if (!intersects(this.getBufferedMaxExtent(), geometry2.getExtent())) {
          return;
        }
        var ends = void 0;
        flatCoordinates = geometry2.getFlatCoordinates();
        if (geometryType2 == "LineString") {
          ends = [flatCoordinates.length];
        } else if (geometryType2 == "MultiLineString") {
          ends = /** @type {import("../../geom/MultiLineString.js").default} */
          geometry2.getEnds();
        } else if (geometryType2 == "Polygon") {
          ends = /** @type {import("../../geom/Polygon.js").default} */
          geometry2.getEnds().slice(0, 1);
        } else if (geometryType2 == "MultiPolygon") {
          var endss = (
            /** @type {import("../../geom/MultiPolygon.js").default} */
            geometry2.getEndss()
          );
          ends = [];
          for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
            ends.push(endss[i2][0]);
          }
        }
        this.beginGeometry(geometry2, feature);
        var textAlign = textState.textAlign;
        var flatOffset = 0;
        var flatEnd = void 0;
        for (var o = 0, oo = ends.length; o < oo; ++o) {
          if (textAlign == void 0) {
            var range2 = matchingChunk(textState.maxAngle, flatCoordinates, flatOffset, ends[o], stride);
            flatOffset = range2[0];
            flatEnd = range2[1];
          } else {
            flatEnd = ends[o];
          }
          for (var i2 = flatOffset; i2 < flatEnd; i2 += stride) {
            coordinates2.push(flatCoordinates[i2], flatCoordinates[i2 + 1]);
          }
          var end = coordinates2.length;
          flatOffset = ends[o];
          this.drawChars_(begin, end);
          begin = end;
        }
        this.endGeometry(feature);
      } else {
        var geometryWidths = textState.overflow ? null : [];
        switch (geometryType2) {
          case "Point":
          case "MultiPoint":
            flatCoordinates = /** @type {import("../../geom/MultiPoint.js").default} */
            geometry2.getFlatCoordinates();
            break;
          case "LineString":
            flatCoordinates = /** @type {import("../../geom/LineString.js").default} */
            geometry2.getFlatMidpoint();
            break;
          case "Circle":
            flatCoordinates = /** @type {import("../../geom/Circle.js").default} */
            geometry2.getCenter();
            break;
          case "MultiLineString":
            flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */
            geometry2.getFlatMidpoints();
            stride = 2;
            break;
          case "Polygon":
            flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */
            geometry2.getFlatInteriorPoint();
            if (!textState.overflow) {
              geometryWidths.push(flatCoordinates[2] / this.resolution);
            }
            stride = 3;
            break;
          case "MultiPolygon":
            var interiorPoints = (
              /** @type {import("../../geom/MultiPolygon.js").default} */
              geometry2.getFlatInteriorPoints()
            );
            flatCoordinates = [];
            for (var i2 = 0, ii = interiorPoints.length; i2 < ii; i2 += 3) {
              if (!textState.overflow) {
                geometryWidths.push(interiorPoints[i2 + 2] / this.resolution);
              }
              flatCoordinates.push(interiorPoints[i2], interiorPoints[i2 + 1]);
            }
            if (flatCoordinates.length === 0) {
              return;
            }
            stride = 2;
            break;
          default:
        }
        var end = this.appendFlatPointCoordinates(flatCoordinates, stride);
        if (end === begin) {
          return;
        }
        if (geometryWidths && (end - begin) / 2 !== flatCoordinates.length / stride) {
          var beg_1 = begin / 2;
          geometryWidths = geometryWidths.filter(function(w, i3) {
            var keep = coordinates2[(beg_1 + i3) * 2] === flatCoordinates[i3 * stride] && coordinates2[(beg_1 + i3) * 2 + 1] === flatCoordinates[i3 * stride + 1];
            if (!keep) {
              --beg_1;
            }
            return keep;
          });
        }
        this.saveTextStates_();
        if (textState.backgroundFill || textState.backgroundStroke) {
          this.setFillStrokeStyle(textState.backgroundFill, textState.backgroundStroke);
          if (textState.backgroundFill) {
            this.updateFillStyle(this.state, this.createFill);
            this.hitDetectionInstructions.push(this.createFill(this.state));
          }
          if (textState.backgroundStroke) {
            this.updateStrokeStyle(this.state, this.applyStroke);
            this.hitDetectionInstructions.push(this.createStroke(this.state));
          }
        }
        this.beginGeometry(geometry2, feature);
        var padding = textState.padding;
        if (padding != defaultPadding && (textState.scale[0] < 0 || textState.scale[1] < 0)) {
          var p0 = textState.padding[0];
          var p12 = textState.padding[1];
          var p22 = textState.padding[2];
          var p32 = textState.padding[3];
          if (textState.scale[0] < 0) {
            p12 = -p12;
            p32 = -p32;
          }
          if (textState.scale[1] < 0) {
            p0 = -p0;
            p22 = -p22;
          }
          padding = [p0, p12, p22, p32];
        }
        var pixelRatio_1 = this.pixelRatio;
        this.instructions.push([
          Instruction_default.DRAW_IMAGE,
          begin,
          end,
          null,
          NaN,
          NaN,
          NaN,
          1,
          0,
          0,
          this.textRotateWithView_,
          this.textRotation_,
          [1, 1],
          NaN,
          void 0,
          this.declutterImageWithText_,
          padding == defaultPadding ? defaultPadding : padding.map(function(p) {
            return p * pixelRatio_1;
          }),
          !!textState.backgroundFill,
          !!textState.backgroundStroke,
          this.text_,
          this.textKey_,
          this.strokeKey_,
          this.fillKey_,
          this.textOffsetX_,
          this.textOffsetY_,
          geometryWidths
        ]);
        var scale5 = 1 / pixelRatio_1;
        this.hitDetectionInstructions.push([
          Instruction_default.DRAW_IMAGE,
          begin,
          end,
          null,
          NaN,
          NaN,
          NaN,
          1,
          0,
          0,
          this.textRotateWithView_,
          this.textRotation_,
          [scale5, scale5],
          NaN,
          void 0,
          this.declutterImageWithText_,
          padding,
          !!textState.backgroundFill,
          !!textState.backgroundStroke,
          this.text_,
          this.textKey_,
          this.strokeKey_,
          this.fillKey_,
          this.textOffsetX_,
          this.textOffsetY_,
          geometryWidths
        ]);
        this.endGeometry(feature);
      }
    };
    CanvasTextBuilder2.prototype.saveTextStates_ = function() {
      var strokeState = this.textStrokeState_;
      var textState = this.textState_;
      var fillState = this.textFillState_;
      var strokeKey = this.strokeKey_;
      if (strokeState) {
        if (!(strokeKey in this.strokeStates)) {
          this.strokeStates[strokeKey] = {
            strokeStyle: strokeState.strokeStyle,
            lineCap: strokeState.lineCap,
            lineDashOffset: strokeState.lineDashOffset,
            lineWidth: strokeState.lineWidth,
            lineJoin: strokeState.lineJoin,
            miterLimit: strokeState.miterLimit,
            lineDash: strokeState.lineDash
          };
        }
      }
      var textKey = this.textKey_;
      if (!(textKey in this.textStates)) {
        this.textStates[textKey] = {
          font: textState.font,
          textAlign: textState.textAlign || defaultTextAlign,
          justify: textState.justify,
          textBaseline: textState.textBaseline || defaultTextBaseline,
          scale: textState.scale
        };
      }
      var fillKey = this.fillKey_;
      if (fillState) {
        if (!(fillKey in this.fillStates)) {
          this.fillStates[fillKey] = {
            fillStyle: fillState.fillStyle
          };
        }
      }
    };
    CanvasTextBuilder2.prototype.drawChars_ = function(begin, end) {
      var strokeState = this.textStrokeState_;
      var textState = this.textState_;
      var strokeKey = this.strokeKey_;
      var textKey = this.textKey_;
      var fillKey = this.fillKey_;
      this.saveTextStates_();
      var pixelRatio = this.pixelRatio;
      var baseline = TEXT_ALIGN[textState.textBaseline];
      var offsetY = this.textOffsetY_ * pixelRatio;
      var text = this.text_;
      var strokeWidth = strokeState ? strokeState.lineWidth * Math.abs(textState.scale[0]) / 2 : 0;
      this.instructions.push([
        Instruction_default.DRAW_CHARS,
        begin,
        end,
        baseline,
        textState.overflow,
        fillKey,
        textState.maxAngle,
        pixelRatio,
        offsetY,
        strokeKey,
        strokeWidth * pixelRatio,
        text,
        textKey,
        1
      ]);
      this.hitDetectionInstructions.push([
        Instruction_default.DRAW_CHARS,
        begin,
        end,
        baseline,
        textState.overflow,
        fillKey,
        textState.maxAngle,
        1,
        offsetY,
        strokeKey,
        strokeWidth,
        text,
        textKey,
        1 / pixelRatio
      ]);
    };
    CanvasTextBuilder2.prototype.setTextStyle = function(textStyle, opt_sharedData) {
      var textState, fillState, strokeState;
      if (!textStyle) {
        this.text_ = "";
      } else {
        var textFillStyle = textStyle.getFill();
        if (!textFillStyle) {
          fillState = null;
          this.textFillState_ = fillState;
        } else {
          fillState = this.textFillState_;
          if (!fillState) {
            fillState = /** @type {import("../canvas.js").FillState} */
            {};
            this.textFillState_ = fillState;
          }
          fillState.fillStyle = asColorLike(textFillStyle.getColor() || defaultFillStyle);
        }
        var textStrokeStyle = textStyle.getStroke();
        if (!textStrokeStyle) {
          strokeState = null;
          this.textStrokeState_ = strokeState;
        } else {
          strokeState = this.textStrokeState_;
          if (!strokeState) {
            strokeState = /** @type {import("../canvas.js").StrokeState} */
            {};
            this.textStrokeState_ = strokeState;
          }
          var lineDash = textStrokeStyle.getLineDash();
          var lineDashOffset = textStrokeStyle.getLineDashOffset();
          var lineWidth = textStrokeStyle.getWidth();
          var miterLimit = textStrokeStyle.getMiterLimit();
          strokeState.lineCap = textStrokeStyle.getLineCap() || defaultLineCap;
          strokeState.lineDash = lineDash ? lineDash.slice() : defaultLineDash;
          strokeState.lineDashOffset = lineDashOffset === void 0 ? defaultLineDashOffset : lineDashOffset;
          strokeState.lineJoin = textStrokeStyle.getLineJoin() || defaultLineJoin;
          strokeState.lineWidth = lineWidth === void 0 ? defaultLineWidth : lineWidth;
          strokeState.miterLimit = miterLimit === void 0 ? defaultMiterLimit : miterLimit;
          strokeState.strokeStyle = asColorLike(textStrokeStyle.getColor() || defaultStrokeStyle);
        }
        textState = this.textState_;
        var font = textStyle.getFont() || defaultFont;
        registerFont(font);
        var textScale = textStyle.getScaleArray();
        textState.overflow = textStyle.getOverflow();
        textState.font = font;
        textState.maxAngle = textStyle.getMaxAngle();
        textState.placement = textStyle.getPlacement();
        textState.textAlign = textStyle.getTextAlign();
        textState.justify = textStyle.getJustify();
        textState.textBaseline = textStyle.getTextBaseline() || defaultTextBaseline;
        textState.backgroundFill = textStyle.getBackgroundFill();
        textState.backgroundStroke = textStyle.getBackgroundStroke();
        textState.padding = textStyle.getPadding() || defaultPadding;
        textState.scale = textScale === void 0 ? [1, 1] : textScale;
        var textOffsetX = textStyle.getOffsetX();
        var textOffsetY = textStyle.getOffsetY();
        var textRotateWithView = textStyle.getRotateWithView();
        var textRotation = textStyle.getRotation();
        this.text_ = textStyle.getText() || "";
        this.textOffsetX_ = textOffsetX === void 0 ? 0 : textOffsetX;
        this.textOffsetY_ = textOffsetY === void 0 ? 0 : textOffsetY;
        this.textRotateWithView_ = textRotateWithView === void 0 ? false : textRotateWithView;
        this.textRotation_ = textRotation === void 0 ? 0 : textRotation;
        this.strokeKey_ = strokeState ? (typeof strokeState.strokeStyle == "string" ? strokeState.strokeStyle : getUid(strokeState.strokeStyle)) + strokeState.lineCap + strokeState.lineDashOffset + "|" + strokeState.lineWidth + strokeState.lineJoin + strokeState.miterLimit + "[" + strokeState.lineDash.join() + "]" : "";
        this.textKey_ = textState.font + textState.scale + (textState.textAlign || "?") + (textState.justify || "?") + (textState.textBaseline || "?");
        this.fillKey_ = fillState ? typeof fillState.fillStyle == "string" ? fillState.fillStyle : "|" + getUid(fillState.fillStyle) : "";
      }
      this.declutterImageWithText_ = opt_sharedData;
    };
    return CanvasTextBuilder2;
  }(Builder_default)
);
var TextBuilder_default = CanvasTextBuilder;

// node_modules/ol/render/canvas/BuilderGroup.js
var BATCH_CONSTRUCTORS = {
  "Circle": PolygonBuilder_default,
  "Default": Builder_default,
  "Image": ImageBuilder_default,
  "LineString": LineStringBuilder_default,
  "Polygon": PolygonBuilder_default,
  "Text": TextBuilder_default
};
var BuilderGroup = (
  /** @class */
  function() {
    function BuilderGroup2(tolerance, maxExtent, resolution, pixelRatio) {
      this.tolerance_ = tolerance;
      this.maxExtent_ = maxExtent;
      this.pixelRatio_ = pixelRatio;
      this.resolution_ = resolution;
      this.buildersByZIndex_ = {};
    }
    BuilderGroup2.prototype.finish = function() {
      var builderInstructions = {};
      for (var zKey in this.buildersByZIndex_) {
        builderInstructions[zKey] = builderInstructions[zKey] || {};
        var builders = this.buildersByZIndex_[zKey];
        for (var builderKey in builders) {
          var builderInstruction = builders[builderKey].finish();
          builderInstructions[zKey][builderKey] = builderInstruction;
        }
      }
      return builderInstructions;
    };
    BuilderGroup2.prototype.getBuilder = function(zIndex, builderType) {
      var zIndexKey = zIndex !== void 0 ? zIndex.toString() : "0";
      var replays = this.buildersByZIndex_[zIndexKey];
      if (replays === void 0) {
        replays = {};
        this.buildersByZIndex_[zIndexKey] = replays;
      }
      var replay = replays[builderType];
      if (replay === void 0) {
        var Constructor = BATCH_CONSTRUCTORS[builderType];
        replay = new Constructor(this.tolerance_, this.maxExtent_, this.resolution_, this.pixelRatio_);
        replays[builderType] = replay;
      }
      return replay;
    };
    return BuilderGroup2;
  }()
);
var BuilderGroup_default = BuilderGroup;

// node_modules/ol/transform.js
var tmp_ = new Array(6);
function create() {
  return [1, 0, 0, 1, 0, 0];
}
function reset(transform3) {
  return set(transform3, 1, 0, 0, 1, 0, 0);
}
function multiply(transform1, transform22) {
  var a1 = transform1[0];
  var b1 = transform1[1];
  var c1 = transform1[2];
  var d1 = transform1[3];
  var e1 = transform1[4];
  var f1 = transform1[5];
  var a2 = transform22[0];
  var b2 = transform22[1];
  var c2 = transform22[2];
  var d2 = transform22[3];
  var e2 = transform22[4];
  var f2 = transform22[5];
  transform1[0] = a1 * a2 + c1 * b2;
  transform1[1] = b1 * a2 + d1 * b2;
  transform1[2] = a1 * c2 + c1 * d2;
  transform1[3] = b1 * c2 + d1 * d2;
  transform1[4] = a1 * e2 + c1 * f2 + e1;
  transform1[5] = b1 * e2 + d1 * f2 + f1;
  return transform1;
}
function set(transform3, a, b, c, d, e, f) {
  transform3[0] = a;
  transform3[1] = b;
  transform3[2] = c;
  transform3[3] = d;
  transform3[4] = e;
  transform3[5] = f;
  return transform3;
}
function setFromArray(transform1, transform22) {
  transform1[0] = transform22[0];
  transform1[1] = transform22[1];
  transform1[2] = transform22[2];
  transform1[3] = transform22[3];
  transform1[4] = transform22[4];
  transform1[5] = transform22[5];
  return transform1;
}
function apply(transform3, coordinate) {
  var x = coordinate[0];
  var y = coordinate[1];
  coordinate[0] = transform3[0] * x + transform3[2] * y + transform3[4];
  coordinate[1] = transform3[1] * x + transform3[3] * y + transform3[5];
  return coordinate;
}
function rotate(transform3, angle) {
  var cos = Math.cos(angle);
  var sin = Math.sin(angle);
  return multiply(transform3, set(tmp_, cos, sin, -sin, cos, 0, 0));
}
function scale2(transform3, x, y) {
  return multiply(transform3, set(tmp_, x, 0, 0, y, 0, 0));
}
function makeScale(target, x, y) {
  return set(target, x, 0, 0, y, 0, 0);
}
function translate(transform3, dx, dy) {
  return multiply(transform3, set(tmp_, 1, 0, 0, 1, dx, dy));
}
function compose2(transform3, dx1, dy1, sx, sy, angle, dx2, dy2) {
  var sin = Math.sin(angle);
  var cos = Math.cos(angle);
  transform3[0] = sx * cos;
  transform3[1] = sy * sin;
  transform3[2] = -sx * sin;
  transform3[3] = sy * cos;
  transform3[4] = dx2 * sx * cos - dy2 * sx * sin + dx1;
  transform3[5] = dx2 * sy * sin + dy2 * sy * cos + dy1;
  return transform3;
}
function makeInverse(target, source) {
  var det = determinant(source);
  assert(det !== 0, 32);
  var a = source[0];
  var b = source[1];
  var c = source[2];
  var d = source[3];
  var e = source[4];
  var f = source[5];
  target[0] = d / det;
  target[1] = -b / det;
  target[2] = -c / det;
  target[3] = a / det;
  target[4] = (c * f - d * e) / det;
  target[5] = -(a * f - b * e) / det;
  return target;
}
function determinant(mat) {
  return mat[0] * mat[3] - mat[1] * mat[2];
}
var transformStringDiv;
function toString2(mat) {
  var transformString = "matrix(" + mat.join(", ") + ")";
  if (WORKER_OFFSCREEN_CANVAS) {
    return transformString;
  }
  var node = transformStringDiv || (transformStringDiv = document.createElement("div"));
  node.style.transform = transformString;
  return node.style.transform;
}

// node_modules/ol/geom/flat/transform.js
function transform2D(flatCoordinates, offset2, end, stride, transform3, opt_dest) {
  var dest = opt_dest ? opt_dest : [];
  var i2 = 0;
  for (var j = offset2; j < end; j += stride) {
    var x = flatCoordinates[j];
    var y = flatCoordinates[j + 1];
    dest[i2++] = transform3[0] * x + transform3[2] * y + transform3[4];
    dest[i2++] = transform3[1] * x + transform3[3] * y + transform3[5];
  }
  if (opt_dest && dest.length != i2) {
    dest.length = i2;
  }
  return dest;
}
function rotate2(flatCoordinates, offset2, end, stride, angle, anchor2, opt_dest) {
  var dest = opt_dest ? opt_dest : [];
  var cos = Math.cos(angle);
  var sin = Math.sin(angle);
  var anchorX = anchor2[0];
  var anchorY = anchor2[1];
  var i2 = 0;
  for (var j = offset2; j < end; j += stride) {
    var deltaX = flatCoordinates[j] - anchorX;
    var deltaY = flatCoordinates[j + 1] - anchorY;
    dest[i2++] = anchorX + deltaX * cos - deltaY * sin;
    dest[i2++] = anchorY + deltaX * sin + deltaY * cos;
    for (var k = j + 2; k < j + stride; ++k) {
      dest[i2++] = flatCoordinates[k];
    }
  }
  if (opt_dest && dest.length != i2) {
    dest.length = i2;
  }
  return dest;
}
function scale3(flatCoordinates, offset2, end, stride, sx, sy, anchor2, opt_dest) {
  var dest = opt_dest ? opt_dest : [];
  var anchorX = anchor2[0];
  var anchorY = anchor2[1];
  var i2 = 0;
  for (var j = offset2; j < end; j += stride) {
    var deltaX = flatCoordinates[j] - anchorX;
    var deltaY = flatCoordinates[j + 1] - anchorY;
    dest[i2++] = anchorX + sx * deltaX;
    dest[i2++] = anchorY + sy * deltaY;
    for (var k = j + 2; k < j + stride; ++k) {
      dest[i2++] = flatCoordinates[k];
    }
  }
  if (opt_dest && dest.length != i2) {
    dest.length = i2;
  }
  return dest;
}
function translate2(flatCoordinates, offset2, end, stride, deltaX, deltaY, opt_dest) {
  var dest = opt_dest ? opt_dest : [];
  var i2 = 0;
  for (var j = offset2; j < end; j += stride) {
    dest[i2++] = flatCoordinates[j] + deltaX;
    dest[i2++] = flatCoordinates[j + 1] + deltaY;
    for (var k = j + 2; k < j + stride; ++k) {
      dest[i2++] = flatCoordinates[k];
    }
  }
  if (opt_dest && dest.length != i2) {
    dest.length = i2;
  }
  return dest;
}

// node_modules/ol/geom/flat/textpath.js
function drawTextOnPath(flatCoordinates, offset2, end, stride, text, startM, maxAngle, scale5, measureAndCacheTextWidth2, font, cache2, rotation) {
  var x2 = flatCoordinates[offset2];
  var y2 = flatCoordinates[offset2 + 1];
  var x1 = 0;
  var y1 = 0;
  var segmentLength = 0;
  var segmentM = 0;
  function advance() {
    x1 = x2;
    y1 = y2;
    offset2 += stride;
    x2 = flatCoordinates[offset2];
    y2 = flatCoordinates[offset2 + 1];
    segmentM += segmentLength;
    segmentLength = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  }
  do {
    advance();
  } while (offset2 < end - stride && segmentM + segmentLength < startM);
  var interpolate2 = segmentLength === 0 ? 0 : (startM - segmentM) / segmentLength;
  var beginX = lerp(x1, x2, interpolate2);
  var beginY = lerp(y1, y2, interpolate2);
  var startOffset = offset2 - stride;
  var startLength = segmentM;
  var endM = startM + scale5 * measureAndCacheTextWidth2(font, text, cache2);
  while (offset2 < end - stride && segmentM + segmentLength < endM) {
    advance();
  }
  interpolate2 = segmentLength === 0 ? 0 : (endM - segmentM) / segmentLength;
  var endX = lerp(x1, x2, interpolate2);
  var endY = lerp(y1, y2, interpolate2);
  var reverse;
  if (rotation) {
    var flat = [beginX, beginY, endX, endY];
    rotate2(flat, 0, 4, 2, rotation, flat, flat);
    reverse = flat[0] > flat[2];
  } else {
    reverse = beginX > endX;
  }
  var PI = Math.PI;
  var result = [];
  var singleSegment = startOffset + stride === offset2;
  offset2 = startOffset;
  segmentLength = 0;
  segmentM = startLength;
  x2 = flatCoordinates[offset2];
  y2 = flatCoordinates[offset2 + 1];
  var previousAngle;
  if (singleSegment) {
    advance();
    previousAngle = Math.atan2(y2 - y1, x2 - x1);
    if (reverse) {
      previousAngle += previousAngle > 0 ? -PI : PI;
    }
    var x = (endX + beginX) / 2;
    var y = (endY + beginY) / 2;
    result[0] = [x, y, (endM - startM) / 2, previousAngle, text];
    return result;
  }
  text = text.replace(/\n/g, " ");
  for (var i2 = 0, ii = text.length; i2 < ii; ) {
    advance();
    var angle = Math.atan2(y2 - y1, x2 - x1);
    if (reverse) {
      angle += angle > 0 ? -PI : PI;
    }
    if (previousAngle !== void 0) {
      var delta = angle - previousAngle;
      delta += delta > PI ? -2 * PI : delta < -PI ? 2 * PI : 0;
      if (Math.abs(delta) > maxAngle) {
        return null;
      }
    }
    previousAngle = angle;
    var iStart = i2;
    var charLength = 0;
    for (; i2 < ii; ++i2) {
      var index = reverse ? ii - i2 - 1 : i2;
      var len = scale5 * measureAndCacheTextWidth2(font, text[index], cache2);
      if (offset2 + stride < end && segmentM + segmentLength < startM + charLength + len / 2) {
        break;
      }
      charLength += len;
    }
    if (i2 === iStart) {
      continue;
    }
    var chars = reverse ? text.substring(ii - iStart, ii - i2) : text.substring(iStart, i2);
    interpolate2 = segmentLength === 0 ? 0 : (startM + charLength / 2 - segmentM) / segmentLength;
    var x = lerp(x1, x2, interpolate2);
    var y = lerp(y1, y2, interpolate2);
    result.push([x, y, charLength / 2, angle, chars]);
    startM += charLength;
  }
  return result;
}

// node_modules/ol/geom/flat/length.js
function lineStringLength(flatCoordinates, offset2, end, stride) {
  var x1 = flatCoordinates[offset2];
  var y1 = flatCoordinates[offset2 + 1];
  var length = 0;
  for (var i2 = offset2 + stride; i2 < end; i2 += stride) {
    var x2 = flatCoordinates[i2];
    var y2 = flatCoordinates[i2 + 1];
    length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    x1 = x2;
    y1 = y2;
  }
  return length;
}

// node_modules/ol/render/canvas/Executor.js
var tmpExtent = createEmpty();
var p1 = [];
var p2 = [];
var p3 = [];
var p4 = [];
function getDeclutterBox(replayImageOrLabelArgs) {
  return replayImageOrLabelArgs[3].declutterBox;
}
var rtlRegEx = new RegExp(
  /* eslint-disable prettier/prettier */
  "[" + String.fromCharCode(1425) + "-" + String.fromCharCode(2303) + String.fromCharCode(64285) + "-" + String.fromCharCode(65023) + String.fromCharCode(65136) + "-" + String.fromCharCode(65276) + String.fromCharCode(67584) + "-" + String.fromCharCode(69631) + String.fromCharCode(124928) + "-" + String.fromCharCode(126975) + "]"
  /* eslint-enable prettier/prettier */
);
function horizontalTextAlign(text, align) {
  if ((align === "start" || align === "end") && !rtlRegEx.test(text)) {
    align = align === "start" ? "left" : "right";
  }
  return TEXT_ALIGN[align];
}
function createTextChunks(acc, line, i2) {
  if (i2 > 0) {
    acc.push("\n", "");
  }
  acc.push(line, "");
  return acc;
}
var Executor = (
  /** @class */
  function() {
    function Executor2(resolution, pixelRatio, overlaps, instructions) {
      this.overlaps = overlaps;
      this.pixelRatio = pixelRatio;
      this.resolution = resolution;
      this.alignFill_;
      this.instructions = instructions.instructions;
      this.coordinates = instructions.coordinates;
      this.coordinateCache_ = {};
      this.renderedTransform_ = create();
      this.hitDetectionInstructions = instructions.hitDetectionInstructions;
      this.pixelCoordinates_ = null;
      this.viewRotation_ = 0;
      this.fillStates = instructions.fillStates || {};
      this.strokeStates = instructions.strokeStates || {};
      this.textStates = instructions.textStates || {};
      this.widths_ = {};
      this.labels_ = {};
    }
    Executor2.prototype.createLabel = function(text, textKey, fillKey, strokeKey) {
      var key = text + textKey + fillKey + strokeKey;
      if (this.labels_[key]) {
        return this.labels_[key];
      }
      var strokeState = strokeKey ? this.strokeStates[strokeKey] : null;
      var fillState = fillKey ? this.fillStates[fillKey] : null;
      var textState = this.textStates[textKey];
      var pixelRatio = this.pixelRatio;
      var scale5 = [
        textState.scale[0] * pixelRatio,
        textState.scale[1] * pixelRatio
      ];
      var textIsArray = Array.isArray(text);
      var align = textState.justify ? TEXT_ALIGN[textState.justify] : horizontalTextAlign(Array.isArray(text) ? text[0] : text, textState.textAlign || defaultTextAlign);
      var strokeWidth = strokeKey && strokeState.lineWidth ? strokeState.lineWidth : 0;
      var chunks = textIsArray ? text : text.split("\n").reduce(createTextChunks, []);
      var _a56 = getTextDimensions(textState, chunks), width = _a56.width, height = _a56.height, widths = _a56.widths, heights = _a56.heights, lineWidths = _a56.lineWidths;
      var renderWidth = width + strokeWidth;
      var contextInstructions = [];
      var w = (renderWidth + 2) * scale5[0];
      var h = (height + strokeWidth) * scale5[1];
      var label = {
        width: w < 0 ? Math.floor(w) : Math.ceil(w),
        height: h < 0 ? Math.floor(h) : Math.ceil(h),
        contextInstructions
      };
      if (scale5[0] != 1 || scale5[1] != 1) {
        contextInstructions.push("scale", scale5);
      }
      if (strokeKey) {
        contextInstructions.push("strokeStyle", strokeState.strokeStyle);
        contextInstructions.push("lineWidth", strokeWidth);
        contextInstructions.push("lineCap", strokeState.lineCap);
        contextInstructions.push("lineJoin", strokeState.lineJoin);
        contextInstructions.push("miterLimit", strokeState.miterLimit);
        var Context = WORKER_OFFSCREEN_CANVAS ? OffscreenCanvasRenderingContext2D : CanvasRenderingContext2D;
        if (Context.prototype.setLineDash) {
          contextInstructions.push("setLineDash", [strokeState.lineDash]);
          contextInstructions.push("lineDashOffset", strokeState.lineDashOffset);
        }
      }
      if (fillKey) {
        contextInstructions.push("fillStyle", fillState.fillStyle);
      }
      contextInstructions.push("textBaseline", "middle");
      contextInstructions.push("textAlign", "center");
      var leftRight = 0.5 - align;
      var x = align * renderWidth + leftRight * strokeWidth;
      var strokeInstructions = [];
      var fillInstructions = [];
      var lineHeight = 0;
      var lineOffset = 0;
      var widthHeightIndex = 0;
      var lineWidthIndex = 0;
      var previousFont;
      for (var i2 = 0, ii = chunks.length; i2 < ii; i2 += 2) {
        var text_1 = chunks[i2];
        if (text_1 === "\n") {
          lineOffset += lineHeight;
          lineHeight = 0;
          x = align * renderWidth + leftRight * strokeWidth;
          ++lineWidthIndex;
          continue;
        }
        var font = chunks[i2 + 1] || textState.font;
        if (font !== previousFont) {
          if (strokeKey) {
            strokeInstructions.push("font", font);
          }
          if (fillKey) {
            fillInstructions.push("font", font);
          }
          previousFont = font;
        }
        lineHeight = Math.max(lineHeight, heights[widthHeightIndex]);
        var fillStrokeArgs = [
          text_1,
          x + leftRight * widths[widthHeightIndex] + align * (widths[widthHeightIndex] - lineWidths[lineWidthIndex]),
          0.5 * (strokeWidth + lineHeight) + lineOffset
        ];
        x += widths[widthHeightIndex];
        if (strokeKey) {
          strokeInstructions.push("strokeText", fillStrokeArgs);
        }
        if (fillKey) {
          fillInstructions.push("fillText", fillStrokeArgs);
        }
        ++widthHeightIndex;
      }
      Array.prototype.push.apply(contextInstructions, strokeInstructions);
      Array.prototype.push.apply(contextInstructions, fillInstructions);
      this.labels_[key] = label;
      return label;
    };
    Executor2.prototype.replayTextBackground_ = function(context2, p12, p22, p32, p42, fillInstruction2, strokeInstruction2) {
      context2.beginPath();
      context2.moveTo.apply(context2, p12);
      context2.lineTo.apply(context2, p22);
      context2.lineTo.apply(context2, p32);
      context2.lineTo.apply(context2, p42);
      context2.lineTo.apply(context2, p12);
      if (fillInstruction2) {
        this.alignFill_ = /** @type {boolean} */
        fillInstruction2[2];
        this.fill_(context2);
      }
      if (strokeInstruction2) {
        this.setStrokeStyle_(
          context2,
          /** @type {Array<*>} */
          strokeInstruction2
        );
        context2.stroke();
      }
    };
    Executor2.prototype.calculateImageOrLabelDimensions_ = function(sheetWidth, sheetHeight, centerX, centerY, width, height, anchorX, anchorY, originX, originY, rotation, scale5, snapToPixel, padding, fillStroke, feature) {
      anchorX *= scale5[0];
      anchorY *= scale5[1];
      var x = centerX - anchorX;
      var y = centerY - anchorY;
      var w = width + originX > sheetWidth ? sheetWidth - originX : width;
      var h = height + originY > sheetHeight ? sheetHeight - originY : height;
      var boxW = padding[3] + w * scale5[0] + padding[1];
      var boxH = padding[0] + h * scale5[1] + padding[2];
      var boxX = x - padding[3];
      var boxY = y - padding[0];
      if (fillStroke || rotation !== 0) {
        p1[0] = boxX;
        p4[0] = boxX;
        p1[1] = boxY;
        p2[1] = boxY;
        p2[0] = boxX + boxW;
        p3[0] = p2[0];
        p3[1] = boxY + boxH;
        p4[1] = p3[1];
      }
      var transform3;
      if (rotation !== 0) {
        transform3 = compose2(create(), centerX, centerY, 1, 1, rotation, -centerX, -centerY);
        apply(transform3, p1);
        apply(transform3, p2);
        apply(transform3, p3);
        apply(transform3, p4);
        createOrUpdate(Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1]), tmpExtent);
      } else {
        createOrUpdate(Math.min(boxX, boxX + boxW), Math.min(boxY, boxY + boxH), Math.max(boxX, boxX + boxW), Math.max(boxY, boxY + boxH), tmpExtent);
      }
      if (snapToPixel) {
        x = Math.round(x);
        y = Math.round(y);
      }
      return {
        drawImageX: x,
        drawImageY: y,
        drawImageW: w,
        drawImageH: h,
        originX,
        originY,
        declutterBox: {
          minX: tmpExtent[0],
          minY: tmpExtent[1],
          maxX: tmpExtent[2],
          maxY: tmpExtent[3],
          value: feature
        },
        canvasTransform: transform3,
        scale: scale5
      };
    };
    Executor2.prototype.replayImageOrLabel_ = function(context2, contextScale, imageOrLabel, dimensions, opacity, fillInstruction2, strokeInstruction2) {
      var fillStroke = !!(fillInstruction2 || strokeInstruction2);
      var box = dimensions.declutterBox;
      var canvas = context2.canvas;
      var strokePadding = strokeInstruction2 ? strokeInstruction2[2] * dimensions.scale[0] / 2 : 0;
      var intersects2 = box.minX - strokePadding <= canvas.width / contextScale && box.maxX + strokePadding >= 0 && box.minY - strokePadding <= canvas.height / contextScale && box.maxY + strokePadding >= 0;
      if (intersects2) {
        if (fillStroke) {
          this.replayTextBackground_(
            context2,
            p1,
            p2,
            p3,
            p4,
            /** @type {Array<*>} */
            fillInstruction2,
            /** @type {Array<*>} */
            strokeInstruction2
          );
        }
        drawImageOrLabel(context2, dimensions.canvasTransform, opacity, imageOrLabel, dimensions.originX, dimensions.originY, dimensions.drawImageW, dimensions.drawImageH, dimensions.drawImageX, dimensions.drawImageY, dimensions.scale);
      }
      return true;
    };
    Executor2.prototype.fill_ = function(context2) {
      if (this.alignFill_) {
        var origin_1 = apply(this.renderedTransform_, [0, 0]);
        var repeatSize = 512 * this.pixelRatio;
        context2.save();
        context2.translate(origin_1[0] % repeatSize, origin_1[1] % repeatSize);
        context2.rotate(this.viewRotation_);
      }
      context2.fill();
      if (this.alignFill_) {
        context2.restore();
      }
    };
    Executor2.prototype.setStrokeStyle_ = function(context2, instruction) {
      context2["strokeStyle"] = /** @type {import("../../colorlike.js").ColorLike} */
      instruction[1];
      context2.lineWidth = /** @type {number} */
      instruction[2];
      context2.lineCap = /** @type {CanvasLineCap} */
      instruction[3];
      context2.lineJoin = /** @type {CanvasLineJoin} */
      instruction[4];
      context2.miterLimit = /** @type {number} */
      instruction[5];
      if (context2.setLineDash) {
        context2.lineDashOffset = /** @type {number} */
        instruction[7];
        context2.setLineDash(
          /** @type {Array<number>} */
          instruction[6]
        );
      }
    };
    Executor2.prototype.drawLabelWithPointPlacement_ = function(text, textKey, strokeKey, fillKey) {
      var textState = this.textStates[textKey];
      var label = this.createLabel(text, textKey, fillKey, strokeKey);
      var strokeState = this.strokeStates[strokeKey];
      var pixelRatio = this.pixelRatio;
      var align = horizontalTextAlign(Array.isArray(text) ? text[0] : text, textState.textAlign || defaultTextAlign);
      var baseline = TEXT_ALIGN[textState.textBaseline || defaultTextBaseline];
      var strokeWidth = strokeState && strokeState.lineWidth ? strokeState.lineWidth : 0;
      var width = label.width / pixelRatio - 2 * textState.scale[0];
      var anchorX = align * width + 2 * (0.5 - align) * strokeWidth;
      var anchorY = baseline * label.height / pixelRatio + 2 * (0.5 - baseline) * strokeWidth;
      return {
        label,
        anchorX,
        anchorY
      };
    };
    Executor2.prototype.execute_ = function(context2, contextScale, transform3, instructions, snapToPixel, opt_featureCallback, opt_hitExtent, opt_declutterTree) {
      var pixelCoordinates;
      if (this.pixelCoordinates_ && equals(transform3, this.renderedTransform_)) {
        pixelCoordinates = this.pixelCoordinates_;
      } else {
        if (!this.pixelCoordinates_) {
          this.pixelCoordinates_ = [];
        }
        pixelCoordinates = transform2D(this.coordinates, 0, this.coordinates.length, 2, transform3, this.pixelCoordinates_);
        setFromArray(this.renderedTransform_, transform3);
      }
      var i2 = 0;
      var ii = instructions.length;
      var d = 0;
      var dd;
      var anchorX, anchorY, prevX, prevY, roundX, roundY, image, text, textKey, strokeKey, fillKey;
      var pendingFill = 0;
      var pendingStroke = 0;
      var lastFillInstruction = null;
      var lastStrokeInstruction = null;
      var coordinateCache = this.coordinateCache_;
      var viewRotation = this.viewRotation_;
      var viewRotationFromTransform = Math.round(Math.atan2(-transform3[1], transform3[0]) * 1e12) / 1e12;
      var state2 = (
        /** @type {import("../../render.js").State} */
        {
          context: context2,
          pixelRatio: this.pixelRatio,
          resolution: this.resolution,
          rotation: viewRotation
        }
      );
      var batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;
      var feature;
      var x, y, currentGeometry;
      while (i2 < ii) {
        var instruction = instructions[i2];
        var type = (
          /** @type {import("./Instruction.js").default} */
          instruction[0]
        );
        switch (type) {
          case Instruction_default.BEGIN_GEOMETRY:
            feature = /** @type {import("../../Feature.js").FeatureLike} */
            instruction[1];
            currentGeometry = instruction[3];
            if (!feature.getGeometry()) {
              i2 = /** @type {number} */
              instruction[2];
            } else if (opt_hitExtent !== void 0 && !intersects(opt_hitExtent, currentGeometry.getExtent())) {
              i2 = /** @type {number} */
              instruction[2] + 1;
            } else {
              ++i2;
            }
            break;
          case Instruction_default.BEGIN_PATH:
            if (pendingFill > batchSize) {
              this.fill_(context2);
              pendingFill = 0;
            }
            if (pendingStroke > batchSize) {
              context2.stroke();
              pendingStroke = 0;
            }
            if (!pendingFill && !pendingStroke) {
              context2.beginPath();
              prevX = NaN;
              prevY = NaN;
            }
            ++i2;
            break;
          case Instruction_default.CIRCLE:
            d = /** @type {number} */
            instruction[1];
            var x1 = pixelCoordinates[d];
            var y1 = pixelCoordinates[d + 1];
            var x2 = pixelCoordinates[d + 2];
            var y2 = pixelCoordinates[d + 3];
            var dx = x2 - x1;
            var dy = y2 - y1;
            var r = Math.sqrt(dx * dx + dy * dy);
            context2.moveTo(x1 + r, y1);
            context2.arc(x1, y1, r, 0, 2 * Math.PI, true);
            ++i2;
            break;
          case Instruction_default.CLOSE_PATH:
            context2.closePath();
            ++i2;
            break;
          case Instruction_default.CUSTOM:
            d = /** @type {number} */
            instruction[1];
            dd = instruction[2];
            var geometry2 = (
              /** @type {import("../../geom/SimpleGeometry.js").default} */
              instruction[3]
            );
            var renderer = instruction[4];
            var fn = instruction.length == 6 ? instruction[5] : void 0;
            state2.geometry = geometry2;
            state2.feature = feature;
            if (!(i2 in coordinateCache)) {
              coordinateCache[i2] = [];
            }
            var coords = coordinateCache[i2];
            if (fn) {
              fn(pixelCoordinates, d, dd, 2, coords);
            } else {
              coords[0] = pixelCoordinates[d];
              coords[1] = pixelCoordinates[d + 1];
              coords.length = 2;
            }
            renderer(coords, state2);
            ++i2;
            break;
          case Instruction_default.DRAW_IMAGE:
            d = /** @type {number} */
            instruction[1];
            dd = /** @type {number} */
            instruction[2];
            image = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */
            instruction[3];
            anchorX = /** @type {number} */
            instruction[4];
            anchorY = /** @type {number} */
            instruction[5];
            var height = (
              /** @type {number} */
              instruction[6]
            );
            var opacity = (
              /** @type {number} */
              instruction[7]
            );
            var originX = (
              /** @type {number} */
              instruction[8]
            );
            var originY = (
              /** @type {number} */
              instruction[9]
            );
            var rotateWithView = (
              /** @type {boolean} */
              instruction[10]
            );
            var rotation = (
              /** @type {number} */
              instruction[11]
            );
            var scale5 = (
              /** @type {import("../../size.js").Size} */
              instruction[12]
            );
            var width = (
              /** @type {number} */
              instruction[13]
            );
            var declutterMode = (
              /** @type {"declutter"|"obstacle"|"none"|undefined} */
              instruction[14]
            );
            var declutterImageWithText = (
              /** @type {import("../canvas.js").DeclutterImageWithText} */
              instruction[15]
            );
            if (!image && instruction.length >= 20) {
              text = /** @type {string} */
              instruction[19];
              textKey = /** @type {string} */
              instruction[20];
              strokeKey = /** @type {string} */
              instruction[21];
              fillKey = /** @type {string} */
              instruction[22];
              var labelWithAnchor = this.drawLabelWithPointPlacement_(text, textKey, strokeKey, fillKey);
              image = labelWithAnchor.label;
              instruction[3] = image;
              var textOffsetX = (
                /** @type {number} */
                instruction[23]
              );
              anchorX = (labelWithAnchor.anchorX - textOffsetX) * this.pixelRatio;
              instruction[4] = anchorX;
              var textOffsetY = (
                /** @type {number} */
                instruction[24]
              );
              anchorY = (labelWithAnchor.anchorY - textOffsetY) * this.pixelRatio;
              instruction[5] = anchorY;
              height = image.height;
              instruction[6] = height;
              width = image.width;
              instruction[13] = width;
            }
            var geometryWidths = void 0;
            if (instruction.length > 25) {
              geometryWidths = /** @type {number} */
              instruction[25];
            }
            var padding = void 0, backgroundFill = void 0, backgroundStroke = void 0;
            if (instruction.length > 17) {
              padding = /** @type {Array<number>} */
              instruction[16];
              backgroundFill = /** @type {boolean} */
              instruction[17];
              backgroundStroke = /** @type {boolean} */
              instruction[18];
            } else {
              padding = defaultPadding;
              backgroundFill = false;
              backgroundStroke = false;
            }
            if (rotateWithView && viewRotationFromTransform) {
              rotation += viewRotation;
            } else if (!rotateWithView && !viewRotationFromTransform) {
              rotation -= viewRotation;
            }
            var widthIndex = 0;
            for (; d < dd; d += 2) {
              if (geometryWidths && geometryWidths[widthIndex++] < width / this.pixelRatio) {
                continue;
              }
              var dimensions = this.calculateImageOrLabelDimensions_(image.width, image.height, pixelCoordinates[d], pixelCoordinates[d + 1], width, height, anchorX, anchorY, originX, originY, rotation, scale5, snapToPixel, padding, backgroundFill || backgroundStroke, feature);
              var args = [
                context2,
                contextScale,
                image,
                dimensions,
                opacity,
                backgroundFill ? (
                  /** @type {Array<*>} */
                  lastFillInstruction
                ) : null,
                backgroundStroke ? (
                  /** @type {Array<*>} */
                  lastStrokeInstruction
                ) : null
              ];
              if (opt_declutterTree) {
                if (declutterMode === "none") {
                  continue;
                } else if (declutterMode === "obstacle") {
                  opt_declutterTree.insert(dimensions.declutterBox);
                  continue;
                } else {
                  var imageArgs = void 0;
                  var imageDeclutterBox = void 0;
                  if (declutterImageWithText) {
                    var index = dd - d;
                    if (!declutterImageWithText[index]) {
                      declutterImageWithText[index] = args;
                      continue;
                    }
                    imageArgs = declutterImageWithText[index];
                    delete declutterImageWithText[index];
                    imageDeclutterBox = getDeclutterBox(imageArgs);
                    if (opt_declutterTree.collides(imageDeclutterBox)) {
                      continue;
                    }
                  }
                  if (opt_declutterTree.collides(dimensions.declutterBox)) {
                    continue;
                  }
                  if (imageArgs) {
                    opt_declutterTree.insert(imageDeclutterBox);
                    this.replayImageOrLabel_.apply(this, imageArgs);
                  }
                  opt_declutterTree.insert(dimensions.declutterBox);
                }
              }
              this.replayImageOrLabel_.apply(this, args);
            }
            ++i2;
            break;
          case Instruction_default.DRAW_CHARS:
            var begin = (
              /** @type {number} */
              instruction[1]
            );
            var end = (
              /** @type {number} */
              instruction[2]
            );
            var baseline = (
              /** @type {number} */
              instruction[3]
            );
            var overflow = (
              /** @type {number} */
              instruction[4]
            );
            fillKey = /** @type {string} */
            instruction[5];
            var maxAngle = (
              /** @type {number} */
              instruction[6]
            );
            var measurePixelRatio = (
              /** @type {number} */
              instruction[7]
            );
            var offsetY = (
              /** @type {number} */
              instruction[8]
            );
            strokeKey = /** @type {string} */
            instruction[9];
            var strokeWidth = (
              /** @type {number} */
              instruction[10]
            );
            text = /** @type {string} */
            instruction[11];
            textKey = /** @type {string} */
            instruction[12];
            var pixelRatioScale = [
              /** @type {number} */
              instruction[13],
              /** @type {number} */
              instruction[13]
            ];
            var textState = this.textStates[textKey];
            var font = textState.font;
            var textScale = [
              textState.scale[0] * measurePixelRatio,
              textState.scale[1] * measurePixelRatio
            ];
            var cachedWidths = void 0;
            if (font in this.widths_) {
              cachedWidths = this.widths_[font];
            } else {
              cachedWidths = {};
              this.widths_[font] = cachedWidths;
            }
            var pathLength = lineStringLength(pixelCoordinates, begin, end, 2);
            var textLength = Math.abs(textScale[0]) * measureAndCacheTextWidth(font, text, cachedWidths);
            if (overflow || textLength <= pathLength) {
              var textAlign = this.textStates[textKey].textAlign;
              var startM = (pathLength - textLength) * TEXT_ALIGN[textAlign];
              var parts = drawTextOnPath(pixelCoordinates, begin, end, 2, text, startM, maxAngle, Math.abs(textScale[0]), measureAndCacheTextWidth, font, cachedWidths, viewRotationFromTransform ? 0 : this.viewRotation_);
              drawChars: if (parts) {
                var replayImageOrLabelArgs = [];
                var c = void 0, cc = void 0, chars = void 0, label = void 0, part = void 0;
                if (strokeKey) {
                  for (c = 0, cc = parts.length; c < cc; ++c) {
                    part = parts[c];
                    chars = /** @type {string} */
                    part[4];
                    label = this.createLabel(chars, textKey, "", strokeKey);
                    anchorX = /** @type {number} */
                    part[2] + (textScale[0] < 0 ? -strokeWidth : strokeWidth);
                    anchorY = baseline * label.height + (0.5 - baseline) * 2 * strokeWidth * textScale[1] / textScale[0] - offsetY;
                    var dimensions = this.calculateImageOrLabelDimensions_(label.width, label.height, part[0], part[1], label.width, label.height, anchorX, anchorY, 0, 0, part[3], pixelRatioScale, false, defaultPadding, false, feature);
                    if (opt_declutterTree && opt_declutterTree.collides(dimensions.declutterBox)) {
                      break drawChars;
                    }
                    replayImageOrLabelArgs.push([
                      context2,
                      contextScale,
                      label,
                      dimensions,
                      1,
                      null,
                      null
                    ]);
                  }
                }
                if (fillKey) {
                  for (c = 0, cc = parts.length; c < cc; ++c) {
                    part = parts[c];
                    chars = /** @type {string} */
                    part[4];
                    label = this.createLabel(chars, textKey, fillKey, "");
                    anchorX = /** @type {number} */
                    part[2];
                    anchorY = baseline * label.height - offsetY;
                    var dimensions = this.calculateImageOrLabelDimensions_(label.width, label.height, part[0], part[1], label.width, label.height, anchorX, anchorY, 0, 0, part[3], pixelRatioScale, false, defaultPadding, false, feature);
                    if (opt_declutterTree && opt_declutterTree.collides(dimensions.declutterBox)) {
                      break drawChars;
                    }
                    replayImageOrLabelArgs.push([
                      context2,
                      contextScale,
                      label,
                      dimensions,
                      1,
                      null,
                      null
                    ]);
                  }
                }
                if (opt_declutterTree) {
                  opt_declutterTree.load(replayImageOrLabelArgs.map(getDeclutterBox));
                }
                for (var i_1 = 0, ii_1 = replayImageOrLabelArgs.length; i_1 < ii_1; ++i_1) {
                  this.replayImageOrLabel_.apply(this, replayImageOrLabelArgs[i_1]);
                }
              }
            }
            ++i2;
            break;
          case Instruction_default.END_GEOMETRY:
            if (opt_featureCallback !== void 0) {
              feature = /** @type {import("../../Feature.js").FeatureLike} */
              instruction[1];
              var result = opt_featureCallback(feature, currentGeometry);
              if (result) {
                return result;
              }
            }
            ++i2;
            break;
          case Instruction_default.FILL:
            if (batchSize) {
              pendingFill++;
            } else {
              this.fill_(context2);
            }
            ++i2;
            break;
          case Instruction_default.MOVE_TO_LINE_TO:
            d = /** @type {number} */
            instruction[1];
            dd = /** @type {number} */
            instruction[2];
            x = pixelCoordinates[d];
            y = pixelCoordinates[d + 1];
            roundX = x + 0.5 | 0;
            roundY = y + 0.5 | 0;
            if (roundX !== prevX || roundY !== prevY) {
              context2.moveTo(x, y);
              prevX = roundX;
              prevY = roundY;
            }
            for (d += 2; d < dd; d += 2) {
              x = pixelCoordinates[d];
              y = pixelCoordinates[d + 1];
              roundX = x + 0.5 | 0;
              roundY = y + 0.5 | 0;
              if (d == dd - 2 || roundX !== prevX || roundY !== prevY) {
                context2.lineTo(x, y);
                prevX = roundX;
                prevY = roundY;
              }
            }
            ++i2;
            break;
          case Instruction_default.SET_FILL_STYLE:
            lastFillInstruction = instruction;
            this.alignFill_ = instruction[2];
            if (pendingFill) {
              this.fill_(context2);
              pendingFill = 0;
              if (pendingStroke) {
                context2.stroke();
                pendingStroke = 0;
              }
            }
            context2.fillStyle = /** @type {import("../../colorlike.js").ColorLike} */
            instruction[1];
            ++i2;
            break;
          case Instruction_default.SET_STROKE_STYLE:
            lastStrokeInstruction = instruction;
            if (pendingStroke) {
              context2.stroke();
              pendingStroke = 0;
            }
            this.setStrokeStyle_(
              context2,
              /** @type {Array<*>} */
              instruction
            );
            ++i2;
            break;
          case Instruction_default.STROKE:
            if (batchSize) {
              pendingStroke++;
            } else {
              context2.stroke();
            }
            ++i2;
            break;
          default:
            ++i2;
            break;
        }
      }
      if (pendingFill) {
        this.fill_(context2);
      }
      if (pendingStroke) {
        context2.stroke();
      }
      return void 0;
    };
    Executor2.prototype.execute = function(context2, contextScale, transform3, viewRotation, snapToPixel, opt_declutterTree) {
      this.viewRotation_ = viewRotation;
      this.execute_(context2, contextScale, transform3, this.instructions, snapToPixel, void 0, void 0, opt_declutterTree);
    };
    Executor2.prototype.executeHitDetection = function(context2, transform3, viewRotation, opt_featureCallback, opt_hitExtent) {
      this.viewRotation_ = viewRotation;
      return this.execute_(context2, 1, transform3, this.hitDetectionInstructions, true, opt_featureCallback, opt_hitExtent);
    };
    return Executor2;
  }()
);
var Executor_default = Executor;

// node_modules/ol/render/canvas/ExecutorGroup.js
var ORDER = ["Polygon", "Circle", "LineString", "Image", "Text", "Default"];
var ExecutorGroup = (
  /** @class */
  function() {
    function ExecutorGroup2(maxExtent, resolution, pixelRatio, overlaps, allInstructions, opt_renderBuffer) {
      this.maxExtent_ = maxExtent;
      this.overlaps_ = overlaps;
      this.pixelRatio_ = pixelRatio;
      this.resolution_ = resolution;
      this.renderBuffer_ = opt_renderBuffer;
      this.executorsByZIndex_ = {};
      this.hitDetectionContext_ = null;
      this.hitDetectionTransform_ = create();
      this.createExecutors_(allInstructions);
    }
    ExecutorGroup2.prototype.clip = function(context2, transform3) {
      var flatClipCoords = this.getClipCoords(transform3);
      context2.beginPath();
      context2.moveTo(flatClipCoords[0], flatClipCoords[1]);
      context2.lineTo(flatClipCoords[2], flatClipCoords[3]);
      context2.lineTo(flatClipCoords[4], flatClipCoords[5]);
      context2.lineTo(flatClipCoords[6], flatClipCoords[7]);
      context2.clip();
    };
    ExecutorGroup2.prototype.createExecutors_ = function(allInstructions) {
      for (var zIndex in allInstructions) {
        var executors = this.executorsByZIndex_[zIndex];
        if (executors === void 0) {
          executors = {};
          this.executorsByZIndex_[zIndex] = executors;
        }
        var instructionByZindex = allInstructions[zIndex];
        for (var builderType in instructionByZindex) {
          var instructions = instructionByZindex[builderType];
          executors[builderType] = new Executor_default(this.resolution_, this.pixelRatio_, this.overlaps_, instructions);
        }
      }
    };
    ExecutorGroup2.prototype.hasExecutors = function(executors) {
      for (var zIndex in this.executorsByZIndex_) {
        var candidates = this.executorsByZIndex_[zIndex];
        for (var i2 = 0, ii = executors.length; i2 < ii; ++i2) {
          if (executors[i2] in candidates) {
            return true;
          }
        }
      }
      return false;
    };
    ExecutorGroup2.prototype.forEachFeatureAtCoordinate = function(coordinate, resolution, rotation, hitTolerance, callback, declutteredFeatures) {
      hitTolerance = Math.round(hitTolerance);
      var contextSize = hitTolerance * 2 + 1;
      var transform3 = compose2(this.hitDetectionTransform_, hitTolerance + 0.5, hitTolerance + 0.5, 1 / resolution, -1 / resolution, -rotation, -coordinate[0], -coordinate[1]);
      var newContext = !this.hitDetectionContext_;
      if (newContext) {
        this.hitDetectionContext_ = createCanvasContext2D(contextSize, contextSize);
      }
      var context2 = this.hitDetectionContext_;
      if (context2.canvas.width !== contextSize || context2.canvas.height !== contextSize) {
        context2.canvas.width = contextSize;
        context2.canvas.height = contextSize;
      } else if (!newContext) {
        context2.clearRect(0, 0, contextSize, contextSize);
      }
      var hitExtent;
      if (this.renderBuffer_ !== void 0) {
        hitExtent = createEmpty();
        extendCoordinate(hitExtent, coordinate);
        buffer2(hitExtent, resolution * (this.renderBuffer_ + hitTolerance), hitExtent);
      }
      var indexes = getPixelIndexArray(hitTolerance);
      var builderType;
      function featureCallback(feature, geometry2) {
        var imageData = context2.getImageData(0, 0, contextSize, contextSize).data;
        for (var i_1 = 0, ii = indexes.length; i_1 < ii; i_1++) {
          if (imageData[indexes[i_1]] > 0) {
            if (!declutteredFeatures || builderType !== "Image" && builderType !== "Text" || declutteredFeatures.indexOf(feature) !== -1) {
              var idx = (indexes[i_1] - 3) / 4;
              var x = hitTolerance - idx % contextSize;
              var y = hitTolerance - (idx / contextSize | 0);
              var result_1 = callback(feature, geometry2, x * x + y * y);
              if (result_1) {
                return result_1;
              }
            }
            context2.clearRect(0, 0, contextSize, contextSize);
            break;
          }
        }
        return void 0;
      }
      var zs = Object.keys(this.executorsByZIndex_).map(Number);
      zs.sort(numberSafeCompareFunction);
      var i2, j, executors, executor, result;
      for (i2 = zs.length - 1; i2 >= 0; --i2) {
        var zIndexKey = zs[i2].toString();
        executors = this.executorsByZIndex_[zIndexKey];
        for (j = ORDER.length - 1; j >= 0; --j) {
          builderType = ORDER[j];
          executor = executors[builderType];
          if (executor !== void 0) {
            result = executor.executeHitDetection(context2, transform3, rotation, featureCallback, hitExtent);
            if (result) {
              return result;
            }
          }
        }
      }
      return void 0;
    };
    ExecutorGroup2.prototype.getClipCoords = function(transform3) {
      var maxExtent = this.maxExtent_;
      if (!maxExtent) {
        return null;
      }
      var minX = maxExtent[0];
      var minY = maxExtent[1];
      var maxX = maxExtent[2];
      var maxY = maxExtent[3];
      var flatClipCoords = [minX, minY, minX, maxY, maxX, maxY, maxX, minY];
      transform2D(flatClipCoords, 0, 8, 2, transform3, flatClipCoords);
      return flatClipCoords;
    };
    ExecutorGroup2.prototype.isEmpty = function() {
      return isEmpty(this.executorsByZIndex_);
    };
    ExecutorGroup2.prototype.execute = function(context2, contextScale, transform3, viewRotation, snapToPixel, opt_builderTypes, opt_declutterTree) {
      var zs = Object.keys(this.executorsByZIndex_).map(Number);
      zs.sort(numberSafeCompareFunction);
      if (this.maxExtent_) {
        context2.save();
        this.clip(context2, transform3);
      }
      var builderTypes = opt_builderTypes ? opt_builderTypes : ORDER;
      var i2, ii, j, jj, replays, replay;
      if (opt_declutterTree) {
        zs.reverse();
      }
      for (i2 = 0, ii = zs.length; i2 < ii; ++i2) {
        var zIndexKey = zs[i2].toString();
        replays = this.executorsByZIndex_[zIndexKey];
        for (j = 0, jj = builderTypes.length; j < jj; ++j) {
          var builderType = builderTypes[j];
          replay = replays[builderType];
          if (replay !== void 0) {
            replay.execute(context2, contextScale, transform3, viewRotation, snapToPixel, opt_declutterTree);
          }
        }
      }
      if (this.maxExtent_) {
        context2.restore();
      }
    };
    return ExecutorGroup2;
  }()
);
var circlePixelIndexArrayCache = {};
function getPixelIndexArray(radius) {
  if (circlePixelIndexArrayCache[radius] !== void 0) {
    return circlePixelIndexArrayCache[radius];
  }
  var size = radius * 2 + 1;
  var maxDistanceSq = radius * radius;
  var distances = new Array(maxDistanceSq + 1);
  for (var i2 = 0; i2 <= radius; ++i2) {
    for (var j = 0; j <= radius; ++j) {
      var distanceSq = i2 * i2 + j * j;
      if (distanceSq > maxDistanceSq) {
        break;
      }
      var distance2 = distances[distanceSq];
      if (!distance2) {
        distance2 = [];
        distances[distanceSq] = distance2;
      }
      distance2.push(((radius + i2) * size + (radius + j)) * 4 + 3);
      if (i2 > 0) {
        distance2.push(((radius - i2) * size + (radius + j)) * 4 + 3);
      }
      if (j > 0) {
        distance2.push(((radius + i2) * size + (radius - j)) * 4 + 3);
        if (i2 > 0) {
          distance2.push(((radius - i2) * size + (radius - j)) * 4 + 3);
        }
      }
    }
  }
  var pixelIndex = [];
  for (var i2 = 0, ii = distances.length; i2 < ii; ++i2) {
    if (distances[i2]) {
      pixelIndex.push.apply(pixelIndex, distances[i2]);
    }
  }
  circlePixelIndexArrayCache[radius] = pixelIndex;
  return pixelIndex;
}
var ExecutorGroup_default = ExecutorGroup;

// node_modules/ol/renderer/Layer.js
var __extends15 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var LayerRenderer = (
  /** @class */
  function(_super) {
    __extends15(LayerRenderer2, _super);
    function LayerRenderer2(layer) {
      var _this = _super.call(this) || this;
      _this.ready = true;
      _this.boundHandleImageChange_ = _this.handleImageChange_.bind(_this);
      _this.layer_ = layer;
      _this.declutterExecutorGroup = null;
      return _this;
    }
    LayerRenderer2.prototype.getFeatures = function(pixel) {
      return abstract();
    };
    LayerRenderer2.prototype.getData = function(pixel) {
      return null;
    };
    LayerRenderer2.prototype.prepareFrame = function(frameState) {
      return abstract();
    };
    LayerRenderer2.prototype.renderFrame = function(frameState, target) {
      return abstract();
    };
    LayerRenderer2.prototype.loadedTileCallback = function(tiles, zoom, tile) {
      if (!tiles[zoom]) {
        tiles[zoom] = {};
      }
      tiles[zoom][tile.tileCoord.toString()] = tile;
      return void 0;
    };
    LayerRenderer2.prototype.createLoadedTileFinder = function(source, projection, tiles) {
      return (
        /**
         * @param {number} zoom Zoom level.
         * @param {import("../TileRange.js").default} tileRange Tile range.
         * @return {boolean} The tile range is fully loaded.
         * @this {LayerRenderer}
         */
        (function(zoom, tileRange) {
          var callback = this.loadedTileCallback.bind(this, tiles, zoom);
          return source.forEachLoadedTile(projection, zoom, tileRange, callback);
        }).bind(this)
      );
    };
    LayerRenderer2.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, matches) {
      return void 0;
    };
    LayerRenderer2.prototype.getDataAtPixel = function(pixel, frameState, hitTolerance) {
      return null;
    };
    LayerRenderer2.prototype.getLayer = function() {
      return this.layer_;
    };
    LayerRenderer2.prototype.handleFontsChanged = function() {
    };
    LayerRenderer2.prototype.handleImageChange_ = function(event) {
      var image = (
        /** @type {import("../Image.js").default} */
        event.target
      );
      if (image.getState() === ImageState_default.LOADED) {
        this.renderIfReadyAndVisible();
      }
    };
    LayerRenderer2.prototype.loadImage = function(image) {
      var imageState = image.getState();
      if (imageState != ImageState_default.LOADED && imageState != ImageState_default.ERROR) {
        image.addEventListener(EventType_default.CHANGE, this.boundHandleImageChange_);
      }
      if (imageState == ImageState_default.IDLE) {
        image.load();
        imageState = image.getState();
      }
      return imageState == ImageState_default.LOADED;
    };
    LayerRenderer2.prototype.renderIfReadyAndVisible = function() {
      var layer = this.getLayer();
      if (layer && layer.getVisible() && layer.getSourceState() === "ready") {
        layer.changed();
      }
    };
    LayerRenderer2.prototype.disposeInternal = function() {
      delete this.layer_;
      _super.prototype.disposeInternal.call(this);
    };
    return LayerRenderer2;
  }(Observable_default)
);
var Layer_default2 = LayerRenderer;

// node_modules/ol/render/Event.js
var __extends16 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var RenderEvent = (
  /** @class */
  function(_super) {
    __extends16(RenderEvent2, _super);
    function RenderEvent2(type, opt_inversePixelTransform, opt_frameState, opt_context) {
      var _this = _super.call(this, type) || this;
      _this.inversePixelTransform = opt_inversePixelTransform;
      _this.frameState = opt_frameState;
      _this.context = opt_context;
      return _this;
    }
    return RenderEvent2;
  }(Event_default)
);
var Event_default2 = RenderEvent;

// node_modules/ol/renderer/canvas/Layer.js
var __extends17 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var canvasPool = [];
var pixelContext = null;
function createPixelContext() {
  var canvas = document.createElement("canvas");
  canvas.width = 1;
  canvas.height = 1;
  pixelContext = canvas.getContext("2d");
}
var CanvasLayerRenderer = (
  /** @class */
  function(_super) {
    __extends17(CanvasLayerRenderer2, _super);
    function CanvasLayerRenderer2(layer) {
      var _this = _super.call(this, layer) || this;
      _this.container = null;
      _this.renderedResolution;
      _this.tempTransform = create();
      _this.pixelTransform = create();
      _this.inversePixelTransform = create();
      _this.context = null;
      _this.containerReused = false;
      _this.pixelContext_ = null;
      _this.frameState = null;
      return _this;
    }
    CanvasLayerRenderer2.prototype.getImageData = function(image, col, row) {
      if (!pixelContext) {
        createPixelContext();
      }
      pixelContext.clearRect(0, 0, 1, 1);
      var data;
      try {
        pixelContext.drawImage(image, col, row, 1, 1, 0, 0, 1, 1);
        data = pixelContext.getImageData(0, 0, 1, 1).data;
      } catch (err) {
        pixelContext = null;
        return null;
      }
      return data;
    };
    CanvasLayerRenderer2.prototype.getBackground = function(frameState) {
      var layer = this.getLayer();
      var background = layer.getBackground();
      if (typeof background === "function") {
        background = background(frameState.viewState.resolution);
      }
      return background || void 0;
    };
    CanvasLayerRenderer2.prototype.useContainer = function(target, transform3, opt_backgroundColor) {
      var layerClassName = this.getLayer().getClassName();
      var container, context2;
      if (target && target.className === layerClassName && (!opt_backgroundColor || target && target.style.backgroundColor && equals(asArray(target.style.backgroundColor), asArray(opt_backgroundColor)))) {
        var canvas = target.firstElementChild;
        if (canvas instanceof HTMLCanvasElement) {
          context2 = canvas.getContext("2d");
        }
      }
      if (context2 && context2.canvas.style.transform === transform3) {
        this.container = target;
        this.context = context2;
        this.containerReused = true;
      } else if (this.containerReused) {
        this.container = null;
        this.context = null;
        this.containerReused = false;
      }
      if (!this.container) {
        container = document.createElement("div");
        container.className = layerClassName;
        var style2 = container.style;
        style2.position = "absolute";
        style2.width = "100%";
        style2.height = "100%";
        context2 = createCanvasContext2D();
        var canvas = context2.canvas;
        container.appendChild(canvas);
        style2 = canvas.style;
        style2.position = "absolute";
        style2.left = "0";
        style2.transformOrigin = "top left";
        this.container = container;
        this.context = context2;
      }
      if (!this.containerReused && opt_backgroundColor && !this.container.style.backgroundColor) {
        this.container.style.backgroundColor = opt_backgroundColor;
      }
    };
    CanvasLayerRenderer2.prototype.clipUnrotated = function(context2, frameState, extent) {
      var topLeft = getTopLeft(extent);
      var topRight = getTopRight(extent);
      var bottomRight = getBottomRight(extent);
      var bottomLeft = getBottomLeft(extent);
      apply(frameState.coordinateToPixelTransform, topLeft);
      apply(frameState.coordinateToPixelTransform, topRight);
      apply(frameState.coordinateToPixelTransform, bottomRight);
      apply(frameState.coordinateToPixelTransform, bottomLeft);
      var inverted = this.inversePixelTransform;
      apply(inverted, topLeft);
      apply(inverted, topRight);
      apply(inverted, bottomRight);
      apply(inverted, bottomLeft);
      context2.save();
      context2.beginPath();
      context2.moveTo(Math.round(topLeft[0]), Math.round(topLeft[1]));
      context2.lineTo(Math.round(topRight[0]), Math.round(topRight[1]));
      context2.lineTo(Math.round(bottomRight[0]), Math.round(bottomRight[1]));
      context2.lineTo(Math.round(bottomLeft[0]), Math.round(bottomLeft[1]));
      context2.clip();
    };
    CanvasLayerRenderer2.prototype.dispatchRenderEvent_ = function(type, context2, frameState) {
      var layer = this.getLayer();
      if (layer.hasListener(type)) {
        var event_1 = new Event_default2(type, this.inversePixelTransform, frameState, context2);
        layer.dispatchEvent(event_1);
      }
    };
    CanvasLayerRenderer2.prototype.preRender = function(context2, frameState) {
      this.frameState = frameState;
      this.dispatchRenderEvent_(EventType_default2.PRERENDER, context2, frameState);
    };
    CanvasLayerRenderer2.prototype.postRender = function(context2, frameState) {
      this.dispatchRenderEvent_(EventType_default2.POSTRENDER, context2, frameState);
    };
    CanvasLayerRenderer2.prototype.getRenderTransform = function(center, resolution, rotation, pixelRatio, width, height, offsetX) {
      var dx1 = width / 2;
      var dy1 = height / 2;
      var sx = pixelRatio / resolution;
      var sy = -sx;
      var dx2 = -center[0] + offsetX;
      var dy2 = -center[1];
      return compose2(this.tempTransform, dx1, dy1, sx, sy, -rotation, dx2, dy2);
    };
    CanvasLayerRenderer2.prototype.getDataAtPixel = function(pixel, frameState, hitTolerance) {
      var renderPixel = apply(this.inversePixelTransform, pixel.slice());
      var context2 = this.context;
      var layer = this.getLayer();
      var layerExtent = layer.getExtent();
      if (layerExtent) {
        var renderCoordinate = apply(frameState.pixelToCoordinateTransform, pixel.slice());
        if (!containsCoordinate(layerExtent, renderCoordinate)) {
          return null;
        }
      }
      var x = Math.round(renderPixel[0]);
      var y = Math.round(renderPixel[1]);
      var pixelContext2 = this.pixelContext_;
      if (!pixelContext2) {
        var pixelCanvas = document.createElement("canvas");
        pixelCanvas.width = 1;
        pixelCanvas.height = 1;
        pixelContext2 = pixelCanvas.getContext("2d");
        this.pixelContext_ = pixelContext2;
      }
      pixelContext2.clearRect(0, 0, 1, 1);
      var data;
      try {
        pixelContext2.drawImage(context2.canvas, x, y, 1, 1, 0, 0, 1, 1);
        data = pixelContext2.getImageData(0, 0, 1, 1).data;
      } catch (err) {
        if (err.name === "SecurityError") {
          this.pixelContext_ = null;
          return new Uint8Array();
        }
        return data;
      }
      if (data[3] === 0) {
        return null;
      }
      return data;
    };
    CanvasLayerRenderer2.prototype.disposeInternal = function() {
      delete this.frameState;
      _super.prototype.disposeInternal.call(this);
    };
    return CanvasLayerRenderer2;
  }(Layer_default2)
);
var Layer_default3 = CanvasLayerRenderer;

// node_modules/ol/TileState.js
var TileState_default = {
  IDLE: 0,
  LOADING: 1,
  LOADED: 2,
  /**
   * Indicates that tile loading failed
   * @type {number}
   */
  ERROR: 3,
  EMPTY: 4
};

// node_modules/ol/easing.js
function easeIn(t) {
  return Math.pow(t, 3);
}
function easeOut(t) {
  return 1 - easeIn(1 - t);
}
function inAndOut(t) {
  return 3 * t * t - 2 * t * t * t;
}
function linear(t) {
  return t;
}

// node_modules/ol/Tile.js
var __extends18 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Tile = (
  /** @class */
  function(_super) {
    __extends18(Tile2, _super);
    function Tile2(tileCoord, state2, opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options ? opt_options : {};
      _this.tileCoord = tileCoord;
      _this.state = state2;
      _this.interimTile = null;
      _this.key = "";
      _this.transition_ = options.transition === void 0 ? 250 : options.transition;
      _this.transitionStarts_ = {};
      _this.interpolate = !!options.interpolate;
      return _this;
    }
    Tile2.prototype.changed = function() {
      this.dispatchEvent(EventType_default.CHANGE);
    };
    Tile2.prototype.release = function() {
    };
    Tile2.prototype.getKey = function() {
      return this.key + "/" + this.tileCoord;
    };
    Tile2.prototype.getInterimTile = function() {
      if (!this.interimTile) {
        return this;
      }
      var tile = this.interimTile;
      do {
        if (tile.getState() == TileState_default.LOADED) {
          this.transition_ = 0;
          return tile;
        }
        tile = tile.interimTile;
      } while (tile);
      return this;
    };
    Tile2.prototype.refreshInterimChain = function() {
      if (!this.interimTile) {
        return;
      }
      var tile = this.interimTile;
      var prev = this;
      do {
        if (tile.getState() == TileState_default.LOADED) {
          tile.interimTile = null;
          break;
        } else if (tile.getState() == TileState_default.LOADING) {
          prev = tile;
        } else if (tile.getState() == TileState_default.IDLE) {
          prev.interimTile = tile.interimTile;
        } else {
          prev = tile;
        }
        tile = prev.interimTile;
      } while (tile);
    };
    Tile2.prototype.getTileCoord = function() {
      return this.tileCoord;
    };
    Tile2.prototype.getState = function() {
      return this.state;
    };
    Tile2.prototype.setState = function(state2) {
      if (this.state !== TileState_default.ERROR && this.state > state2) {
        throw new Error("Tile load sequence violation");
      }
      this.state = state2;
      this.changed();
    };
    Tile2.prototype.load = function() {
      abstract();
    };
    Tile2.prototype.getAlpha = function(id2, time) {
      if (!this.transition_) {
        return 1;
      }
      var start2 = this.transitionStarts_[id2];
      if (!start2) {
        start2 = time;
        this.transitionStarts_[id2] = start2;
      } else if (start2 === -1) {
        return 1;
      }
      var delta = time - start2 + 1e3 / 60;
      if (delta >= this.transition_) {
        return 1;
      }
      return easeIn(delta / this.transition_);
    };
    Tile2.prototype.inTransition = function(id2) {
      if (!this.transition_) {
        return false;
      }
      return this.transitionStarts_[id2] !== -1;
    };
    Tile2.prototype.endTransition = function(id2) {
      if (this.transition_) {
        this.transitionStarts_[id2] = -1;
      }
    };
    return Tile2;
  }(Target_default)
);
var Tile_default = Tile;

// node_modules/ol/ImageBase.js
var __extends19 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ImageBase = (
  /** @class */
  function(_super) {
    __extends19(ImageBase2, _super);
    function ImageBase2(extent, resolution, pixelRatio, state2) {
      var _this = _super.call(this) || this;
      _this.extent = extent;
      _this.pixelRatio_ = pixelRatio;
      _this.resolution = resolution;
      _this.state = state2;
      return _this;
    }
    ImageBase2.prototype.changed = function() {
      this.dispatchEvent(EventType_default.CHANGE);
    };
    ImageBase2.prototype.getExtent = function() {
      return this.extent;
    };
    ImageBase2.prototype.getImage = function() {
      return abstract();
    };
    ImageBase2.prototype.getPixelRatio = function() {
      return this.pixelRatio_;
    };
    ImageBase2.prototype.getResolution = function() {
      return (
        /** @type {number} */
        this.resolution
      );
    };
    ImageBase2.prototype.getState = function() {
      return this.state;
    };
    ImageBase2.prototype.load = function() {
      abstract();
    };
    return ImageBase2;
  }(Target_default)
);
var ImageBase_default = ImageBase;

// node_modules/ol/Image.js
var __extends20 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ImageWrapper = (
  /** @class */
  function(_super) {
    __extends20(ImageWrapper2, _super);
    function ImageWrapper2(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
      var _this = _super.call(this, extent, resolution, pixelRatio, ImageState_default.IDLE) || this;
      _this.src_ = src;
      _this.image_ = new Image();
      if (crossOrigin !== null) {
        _this.image_.crossOrigin = crossOrigin;
      }
      _this.unlisten_ = null;
      _this.state = ImageState_default.IDLE;
      _this.imageLoadFunction_ = imageLoadFunction;
      return _this;
    }
    ImageWrapper2.prototype.getImage = function() {
      return this.image_;
    };
    ImageWrapper2.prototype.handleImageError_ = function() {
      this.state = ImageState_default.ERROR;
      this.unlistenImage_();
      this.changed();
    };
    ImageWrapper2.prototype.handleImageLoad_ = function() {
      if (this.resolution === void 0) {
        this.resolution = getHeight(this.extent) / this.image_.height;
      }
      this.state = ImageState_default.LOADED;
      this.unlistenImage_();
      this.changed();
    };
    ImageWrapper2.prototype.load = function() {
      if (this.state == ImageState_default.IDLE || this.state == ImageState_default.ERROR) {
        this.state = ImageState_default.LOADING;
        this.changed();
        this.imageLoadFunction_(this, this.src_);
        this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));
      }
    };
    ImageWrapper2.prototype.setImage = function(image) {
      this.image_ = image;
      this.resolution = getHeight(this.extent) / this.image_.height;
    };
    ImageWrapper2.prototype.unlistenImage_ = function() {
      if (this.unlisten_) {
        this.unlisten_();
        this.unlisten_ = null;
      }
    };
    return ImageWrapper2;
  }(ImageBase_default)
);
function listenImage(image, loadHandler, errorHandler2) {
  var img = (
    /** @type {HTMLImageElement} */
    image
  );
  var listening = true;
  var decoding = false;
  var loaded = false;
  var listenerKeys = [
    listenOnce(img, EventType_default.LOAD, function() {
      loaded = true;
      if (!decoding) {
        loadHandler();
      }
    })
  ];
  if (img.src && IMAGE_DECODE) {
    decoding = true;
    img.decode().then(function() {
      if (listening) {
        loadHandler();
      }
    }).catch(function(error3) {
      if (listening) {
        if (loaded) {
          loadHandler();
        } else {
          errorHandler2();
        }
      }
    });
  } else {
    listenerKeys.push(listenOnce(img, EventType_default.ERROR, errorHandler2));
  }
  return function unlisten() {
    listening = false;
    listenerKeys.forEach(unlistenByKey);
  };
}

// node_modules/ol/ImageTile.js
var __extends21 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ImageTile = (
  /** @class */
  function(_super) {
    __extends21(ImageTile2, _super);
    function ImageTile2(tileCoord, state2, src, crossOrigin, tileLoadFunction, opt_options) {
      var _this = _super.call(this, tileCoord, state2, opt_options) || this;
      _this.crossOrigin_ = crossOrigin;
      _this.src_ = src;
      _this.key = src;
      _this.image_ = new Image();
      if (crossOrigin !== null) {
        _this.image_.crossOrigin = crossOrigin;
      }
      _this.unlisten_ = null;
      _this.tileLoadFunction_ = tileLoadFunction;
      return _this;
    }
    ImageTile2.prototype.getImage = function() {
      return this.image_;
    };
    ImageTile2.prototype.setImage = function(element) {
      this.image_ = element;
      this.state = TileState_default.LOADED;
      this.unlistenImage_();
      this.changed();
    };
    ImageTile2.prototype.handleImageError_ = function() {
      this.state = TileState_default.ERROR;
      this.unlistenImage_();
      this.image_ = getBlankImage();
      this.changed();
    };
    ImageTile2.prototype.handleImageLoad_ = function() {
      var image = (
        /** @type {HTMLImageElement} */
        this.image_
      );
      if (image.naturalWidth && image.naturalHeight) {
        this.state = TileState_default.LOADED;
      } else {
        this.state = TileState_default.EMPTY;
      }
      this.unlistenImage_();
      this.changed();
    };
    ImageTile2.prototype.load = function() {
      if (this.state == TileState_default.ERROR) {
        this.state = TileState_default.IDLE;
        this.image_ = new Image();
        if (this.crossOrigin_ !== null) {
          this.image_.crossOrigin = this.crossOrigin_;
        }
      }
      if (this.state == TileState_default.IDLE) {
        this.state = TileState_default.LOADING;
        this.changed();
        this.tileLoadFunction_(this, this.src_);
        this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));
      }
    };
    ImageTile2.prototype.unlistenImage_ = function() {
      if (this.unlisten_) {
        this.unlisten_();
        this.unlisten_ = null;
      }
    };
    return ImageTile2;
  }(Tile_default)
);
function getBlankImage() {
  var ctx = createCanvasContext2D(1, 1);
  ctx.fillStyle = "rgba(0,0,0,0)";
  ctx.fillRect(0, 0, 1, 1);
  return ctx.canvas;
}
var ImageTile_default = ImageTile;

// node_modules/ol/reproj/common.js
var ERROR_THRESHOLD = 0.5;
var ENABLE_RASTER_REPROJECTION = true;

// node_modules/ol/proj/Units.js
var Units = {
  /**
   * Radians
   * @api
   */
  RADIANS: "radians",
  /**
   * Degrees
   * @api
   */
  DEGREES: "degrees",
  /**
   * Feet
   * @api
   */
  FEET: "ft",
  /**
   * Meters
   * @api
   */
  METERS: "m",
  /**
   * Pixels
   * @api
   */
  PIXELS: "pixels",
  /**
   * Tile Pixels
   * @api
   */
  TILE_PIXELS: "tile-pixels",
  /**
   * US Feet
   * @api
   */
  USFEET: "us-ft"
};
var unitByCode = {
  "9001": Units.METERS,
  "9002": Units.FEET,
  "9003": Units.USFEET,
  "9101": Units.RADIANS,
  "9102": Units.DEGREES
};
var METERS_PER_UNIT = {};
METERS_PER_UNIT[Units.RADIANS] = 6370997 / (2 * Math.PI);
METERS_PER_UNIT[Units.DEGREES] = 2 * Math.PI * 6370997 / 360;
METERS_PER_UNIT[Units.FEET] = 0.3048;
METERS_PER_UNIT[Units.METERS] = 1;
METERS_PER_UNIT[Units.USFEET] = 1200 / 3937;
var Units_default = Units;

// node_modules/ol/proj/Projection.js
var Projection = (
  /** @class */
  function() {
    function Projection3(options) {
      this.code_ = options.code;
      this.units_ = /** @type {import("./Units.js").default} */
      options.units;
      this.extent_ = options.extent !== void 0 ? options.extent : null;
      this.worldExtent_ = options.worldExtent !== void 0 ? options.worldExtent : null;
      this.axisOrientation_ = options.axisOrientation !== void 0 ? options.axisOrientation : "enu";
      this.global_ = options.global !== void 0 ? options.global : false;
      this.canWrapX_ = !!(this.global_ && this.extent_);
      this.getPointResolutionFunc_ = options.getPointResolution;
      this.defaultTileGrid_ = null;
      this.metersPerUnit_ = options.metersPerUnit;
    }
    Projection3.prototype.canWrapX = function() {
      return this.canWrapX_;
    };
    Projection3.prototype.getCode = function() {
      return this.code_;
    };
    Projection3.prototype.getExtent = function() {
      return this.extent_;
    };
    Projection3.prototype.getUnits = function() {
      return this.units_;
    };
    Projection3.prototype.getMetersPerUnit = function() {
      return this.metersPerUnit_ || METERS_PER_UNIT[this.units_];
    };
    Projection3.prototype.getWorldExtent = function() {
      return this.worldExtent_;
    };
    Projection3.prototype.getAxisOrientation = function() {
      return this.axisOrientation_;
    };
    Projection3.prototype.isGlobal = function() {
      return this.global_;
    };
    Projection3.prototype.setGlobal = function(global2) {
      this.global_ = global2;
      this.canWrapX_ = !!(global2 && this.extent_);
    };
    Projection3.prototype.getDefaultTileGrid = function() {
      return this.defaultTileGrid_;
    };
    Projection3.prototype.setDefaultTileGrid = function(tileGrid) {
      this.defaultTileGrid_ = tileGrid;
    };
    Projection3.prototype.setExtent = function(extent) {
      this.extent_ = extent;
      this.canWrapX_ = !!(this.global_ && extent);
    };
    Projection3.prototype.setWorldExtent = function(worldExtent) {
      this.worldExtent_ = worldExtent;
    };
    Projection3.prototype.setGetPointResolution = function(func) {
      this.getPointResolutionFunc_ = func;
    };
    Projection3.prototype.getPointResolutionFunc = function() {
      return this.getPointResolutionFunc_;
    };
    return Projection3;
  }()
);
var Projection_default = Projection;

// node_modules/ol/proj/epsg3857.js
var __extends22 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var RADIUS = 6378137;
var HALF_SIZE = Math.PI * RADIUS;
var EXTENT = [-HALF_SIZE, -HALF_SIZE, HALF_SIZE, HALF_SIZE];
var WORLD_EXTENT = [-180, -85, 180, 85];
var MAX_SAFE_Y = RADIUS * Math.log(Math.tan(Math.PI / 2));
var EPSG3857Projection = (
  /** @class */
  function(_super) {
    __extends22(EPSG3857Projection2, _super);
    function EPSG3857Projection2(code) {
      return _super.call(this, {
        code,
        units: Units_default.METERS,
        extent: EXTENT,
        global: true,
        worldExtent: WORLD_EXTENT,
        getPointResolution: function(resolution, point) {
          return resolution / cosh(point[1] / RADIUS);
        }
      }) || this;
    }
    return EPSG3857Projection2;
  }(Projection_default)
);
var PROJECTIONS = [
  new EPSG3857Projection("EPSG:3857"),
  new EPSG3857Projection("EPSG:102100"),
  new EPSG3857Projection("EPSG:102113"),
  new EPSG3857Projection("EPSG:900913"),
  new EPSG3857Projection("http://www.opengis.net/def/crs/EPSG/0/3857"),
  new EPSG3857Projection("http://www.opengis.net/gml/srs/epsg.xml#3857")
];
function fromEPSG4326(input2, opt_output, opt_dimension) {
  var length = input2.length;
  var dimension = opt_dimension > 1 ? opt_dimension : 2;
  var output = opt_output;
  if (output === void 0) {
    if (dimension > 2) {
      output = input2.slice();
    } else {
      output = new Array(length);
    }
  }
  for (var i2 = 0; i2 < length; i2 += dimension) {
    output[i2] = HALF_SIZE * input2[i2] / 180;
    var y = RADIUS * Math.log(Math.tan(Math.PI * (+input2[i2 + 1] + 90) / 360));
    if (y > MAX_SAFE_Y) {
      y = MAX_SAFE_Y;
    } else if (y < -MAX_SAFE_Y) {
      y = -MAX_SAFE_Y;
    }
    output[i2 + 1] = y;
  }
  return output;
}
function toEPSG4326(input2, opt_output, opt_dimension) {
  var length = input2.length;
  var dimension = opt_dimension > 1 ? opt_dimension : 2;
  var output = opt_output;
  if (output === void 0) {
    if (dimension > 2) {
      output = input2.slice();
    } else {
      output = new Array(length);
    }
  }
  for (var i2 = 0; i2 < length; i2 += dimension) {
    output[i2] = 180 * input2[i2] / HALF_SIZE;
    output[i2 + 1] = 360 * Math.atan(Math.exp(input2[i2 + 1] / RADIUS)) / Math.PI - 90;
  }
  return output;
}

// node_modules/ol/proj/epsg4326.js
var __extends23 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var RADIUS2 = 6378137;
var EXTENT2 = [-180, -90, 180, 90];
var METERS_PER_UNIT2 = Math.PI * RADIUS2 / 180;
var EPSG4326Projection = (
  /** @class */
  function(_super) {
    __extends23(EPSG4326Projection2, _super);
    function EPSG4326Projection2(code, opt_axisOrientation) {
      return _super.call(this, {
        code,
        units: Units_default.DEGREES,
        extent: EXTENT2,
        axisOrientation: opt_axisOrientation,
        global: true,
        metersPerUnit: METERS_PER_UNIT2,
        worldExtent: EXTENT2
      }) || this;
    }
    return EPSG4326Projection2;
  }(Projection_default)
);
var PROJECTIONS2 = [
  new EPSG4326Projection("CRS:84"),
  new EPSG4326Projection("EPSG:4326", "neu"),
  new EPSG4326Projection("urn:ogc:def:crs:OGC:1.3:CRS84"),
  new EPSG4326Projection("urn:ogc:def:crs:OGC:2:84"),
  new EPSG4326Projection("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),
  new EPSG4326Projection("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu"),
  new EPSG4326Projection("http://www.opengis.net/def/crs/EPSG/0/4326", "neu")
];

// node_modules/ol/proj/projections.js
var cache = {};
function get(code) {
  return cache[code] || cache[code.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null;
}
function add(code, projection) {
  cache[code] = projection;
}

// node_modules/ol/proj/transforms.js
var transforms = {};
function add2(source, destination, transformFn) {
  var sourceCode = source.getCode();
  var destinationCode = destination.getCode();
  if (!(sourceCode in transforms)) {
    transforms[sourceCode] = {};
  }
  transforms[sourceCode][destinationCode] = transformFn;
}
function get2(sourceCode, destinationCode) {
  var transform3;
  if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {
    transform3 = transforms[sourceCode][destinationCode];
  }
  return transform3;
}

// node_modules/ol/string.js
function compareVersions(v14, v2) {
  var s1 = ("" + v14).split(".");
  var s2 = ("" + v2).split(".");
  for (var i2 = 0; i2 < Math.max(s1.length, s2.length); i2++) {
    var n1 = parseInt(s1[i2] || "0", 10);
    var n2 = parseInt(s2[i2] || "0", 10);
    if (n1 > n2) {
      return 1;
    }
    if (n2 > n1) {
      return -1;
    }
  }
  return 0;
}

// node_modules/ol/coordinate.js
function add3(coordinate, delta) {
  coordinate[0] += +delta[0];
  coordinate[1] += +delta[1];
  return coordinate;
}
function closestOnCircle(coordinate, circle) {
  var r = circle.getRadius();
  var center = circle.getCenter();
  var x0 = center[0];
  var y0 = center[1];
  var x1 = coordinate[0];
  var y1 = coordinate[1];
  var dx = x1 - x0;
  var dy = y1 - y0;
  if (dx === 0 && dy === 0) {
    dx = 1;
  }
  var d = Math.sqrt(dx * dx + dy * dy);
  var x = x0 + r * dx / d;
  var y = y0 + r * dy / d;
  return [x, y];
}
function closestOnSegment(coordinate, segment) {
  var x0 = coordinate[0];
  var y0 = coordinate[1];
  var start2 = segment[0];
  var end = segment[1];
  var x1 = start2[0];
  var y1 = start2[1];
  var x2 = end[0];
  var y2 = end[1];
  var dx = x2 - x1;
  var dy = y2 - y1;
  var along = dx === 0 && dy === 0 ? 0 : (dx * (x0 - x1) + dy * (y0 - y1)) / (dx * dx + dy * dy || 0);
  var x, y;
  if (along <= 0) {
    x = x1;
    y = y1;
  } else if (along >= 1) {
    x = x2;
    y = y2;
  } else {
    x = x1 + along * dx;
    y = y1 + along * dy;
  }
  return [x, y];
}
function equals3(coordinate1, coordinate2) {
  var equals4 = true;
  for (var i2 = coordinate1.length - 1; i2 >= 0; --i2) {
    if (coordinate1[i2] != coordinate2[i2]) {
      equals4 = false;
      break;
    }
  }
  return equals4;
}
function rotate3(coordinate, angle) {
  var cosAngle = Math.cos(angle);
  var sinAngle = Math.sin(angle);
  var x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;
  var y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;
  coordinate[0] = x;
  coordinate[1] = y;
  return coordinate;
}
function scale4(coordinate, scale5) {
  coordinate[0] *= scale5;
  coordinate[1] *= scale5;
  return coordinate;
}
function squaredDistance2(coord1, coord2) {
  var dx = coord1[0] - coord2[0];
  var dy = coord1[1] - coord2[1];
  return dx * dx + dy * dy;
}
function distance(coord1, coord2) {
  return Math.sqrt(squaredDistance2(coord1, coord2));
}
function squaredDistanceToSegment(coordinate, segment) {
  return squaredDistance2(coordinate, closestOnSegment(coordinate, segment));
}
function wrapX2(coordinate, projection) {
  if (projection.canWrapX()) {
    var worldWidth = getWidth(projection.getExtent());
    var worldsAway = getWorldsAway(coordinate, projection, worldWidth);
    if (worldsAway) {
      coordinate[0] -= worldsAway * worldWidth;
    }
  }
  return coordinate;
}
function getWorldsAway(coordinate, projection, opt_sourceExtentWidth) {
  var projectionExtent = projection.getExtent();
  var worldsAway = 0;
  if (projection.canWrapX() && (coordinate[0] < projectionExtent[0] || coordinate[0] > projectionExtent[2])) {
    var sourceExtentWidth = opt_sourceExtentWidth || getWidth(projectionExtent);
    worldsAway = Math.floor((coordinate[0] - projectionExtent[0]) / sourceExtentWidth);
  }
  return worldsAway;
}

// node_modules/ol/sphere.js
var DEFAULT_RADIUS = 63710088e-1;
function getDistance(c1, c2, opt_radius) {
  var radius = opt_radius || DEFAULT_RADIUS;
  var lat1 = toRadians(c1[1]);
  var lat2 = toRadians(c2[1]);
  var deltaLatBy2 = (lat2 - lat1) / 2;
  var deltaLonBy2 = toRadians(c2[0] - c1[0]) / 2;
  var a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) + Math.sin(deltaLonBy2) * Math.sin(deltaLonBy2) * Math.cos(lat1) * Math.cos(lat2);
  return 2 * radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
}
function getLengthInternal(coordinates2, radius) {
  var length = 0;
  for (var i2 = 0, ii = coordinates2.length; i2 < ii - 1; ++i2) {
    length += getDistance(coordinates2[i2], coordinates2[i2 + 1], radius);
  }
  return length;
}
function getLength(geometry2, opt_options) {
  var options = opt_options || {};
  var radius = options.radius || DEFAULT_RADIUS;
  var projection = options.projection || "EPSG:3857";
  var type = geometry2.getType();
  if (type !== "GeometryCollection") {
    geometry2 = geometry2.clone().transform(projection, "EPSG:4326");
  }
  var length = 0;
  var coordinates2, coords, i2, ii, j, jj;
  switch (type) {
    case "Point":
    case "MultiPoint": {
      break;
    }
    case "LineString":
    case "LinearRing": {
      coordinates2 = /** @type {import("./geom/SimpleGeometry.js").default} */
      geometry2.getCoordinates();
      length = getLengthInternal(coordinates2, radius);
      break;
    }
    case "MultiLineString":
    case "Polygon": {
      coordinates2 = /** @type {import("./geom/SimpleGeometry.js").default} */
      geometry2.getCoordinates();
      for (i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
        length += getLengthInternal(coordinates2[i2], radius);
      }
      break;
    }
    case "MultiPolygon": {
      coordinates2 = /** @type {import("./geom/SimpleGeometry.js").default} */
      geometry2.getCoordinates();
      for (i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
        coords = coordinates2[i2];
        for (j = 0, jj = coords.length; j < jj; ++j) {
          length += getLengthInternal(coords[j], radius);
        }
      }
      break;
    }
    case "GeometryCollection": {
      var geometries = (
        /** @type {import("./geom/GeometryCollection.js").default} */
        geometry2.getGeometries()
      );
      for (i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        length += getLength(geometries[i2], opt_options);
      }
      break;
    }
    default: {
      throw new Error("Unsupported geometry type: " + type);
    }
  }
  return length;
}
function offset(c1, distance2, bearing, opt_radius) {
  var radius = opt_radius || DEFAULT_RADIUS;
  var lat1 = toRadians(c1[1]);
  var lon1 = toRadians(c1[0]);
  var dByR = distance2 / radius;
  var lat = Math.asin(Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing));
  var lon = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat));
  return [toDegrees(lon), toDegrees(lat)];
}

// node_modules/ol/proj.js
var showCoordinateWarning = true;
function disableCoordinateWarning(opt_disable) {
  var hide = opt_disable === void 0 ? true : opt_disable;
  showCoordinateWarning = !hide;
}
function cloneTransform(input2, opt_output, opt_dimension) {
  var output;
  if (opt_output !== void 0) {
    for (var i2 = 0, ii = input2.length; i2 < ii; ++i2) {
      opt_output[i2] = input2[i2];
    }
    output = opt_output;
  } else {
    output = input2.slice();
  }
  return output;
}
function identityTransform(input2, opt_output, opt_dimension) {
  if (opt_output !== void 0 && input2 !== opt_output) {
    for (var i2 = 0, ii = input2.length; i2 < ii; ++i2) {
      opt_output[i2] = input2[i2];
    }
    input2 = opt_output;
  }
  return input2;
}
function addProjection(projection) {
  add(projection.getCode(), projection);
  add2(projection, projection, cloneTransform);
}
function addProjections(projections) {
  projections.forEach(addProjection);
}
function get3(projectionLike) {
  return typeof projectionLike === "string" ? get(
    /** @type {string} */
    projectionLike
  ) : (
    /** @type {Projection} */
    projectionLike || null
  );
}
function getPointResolution(projection, resolution, point, opt_units) {
  projection = get3(projection);
  var pointResolution;
  var getter = projection.getPointResolutionFunc();
  if (getter) {
    pointResolution = getter(resolution, point);
    if (opt_units && opt_units !== projection.getUnits()) {
      var metersPerUnit = projection.getMetersPerUnit();
      if (metersPerUnit) {
        pointResolution = pointResolution * metersPerUnit / METERS_PER_UNIT[opt_units];
      }
    }
  } else {
    var units = projection.getUnits();
    if (units == Units_default.DEGREES && !opt_units || opt_units == Units_default.DEGREES) {
      pointResolution = resolution;
    } else {
      var toEPSG4326_1 = getTransformFromProjections(projection, get3("EPSG:4326"));
      if (toEPSG4326_1 === identityTransform && units !== Units_default.DEGREES) {
        pointResolution = resolution * projection.getMetersPerUnit();
      } else {
        var vertices = [
          point[0] - resolution / 2,
          point[1],
          point[0] + resolution / 2,
          point[1],
          point[0],
          point[1] - resolution / 2,
          point[0],
          point[1] + resolution / 2
        ];
        vertices = toEPSG4326_1(vertices, vertices, 2);
        var width = getDistance(vertices.slice(0, 2), vertices.slice(2, 4));
        var height = getDistance(vertices.slice(4, 6), vertices.slice(6, 8));
        pointResolution = (width + height) / 2;
      }
      var metersPerUnit = opt_units ? METERS_PER_UNIT[opt_units] : projection.getMetersPerUnit();
      if (metersPerUnit !== void 0) {
        pointResolution /= metersPerUnit;
      }
    }
  }
  return pointResolution;
}
function addEquivalentProjections(projections) {
  addProjections(projections);
  projections.forEach(function(source) {
    projections.forEach(function(destination) {
      if (source !== destination) {
        add2(source, destination, cloneTransform);
      }
    });
  });
}
function addEquivalentTransforms(projections1, projections2, forwardTransform, inverseTransform) {
  projections1.forEach(function(projection1) {
    projections2.forEach(function(projection2) {
      add2(projection1, projection2, forwardTransform);
      add2(projection2, projection1, inverseTransform);
    });
  });
}
function createProjection(projection, defaultCode) {
  if (!projection) {
    return get3(defaultCode);
  } else if (typeof projection === "string") {
    return get3(projection);
  } else {
    return (
      /** @type {Projection} */
      projection
    );
  }
}
function createTransformFromCoordinateTransform(coordTransform) {
  return (
    /**
     * @param {Array<number>} input Input.
     * @param {Array<number>} [opt_output] Output.
     * @param {number} [opt_dimension] Dimension.
     * @return {Array<number>} Output.
     */
    function(input2, opt_output, opt_dimension) {
      var length = input2.length;
      var dimension = opt_dimension !== void 0 ? opt_dimension : 2;
      var output = opt_output !== void 0 ? opt_output : new Array(length);
      for (var i2 = 0; i2 < length; i2 += dimension) {
        var point = coordTransform(input2.slice(i2, i2 + dimension));
        var pointLength = point.length;
        for (var j = 0, jj = dimension; j < jj; ++j) {
          output[i2 + j] = j >= pointLength ? input2[i2 + j] : point[j];
        }
      }
      return output;
    }
  );
}
function addCoordinateTransforms(source, destination, forward30, inverse30) {
  var sourceProj = get3(source);
  var destProj = get3(destination);
  add2(sourceProj, destProj, createTransformFromCoordinateTransform(forward30));
  add2(destProj, sourceProj, createTransformFromCoordinateTransform(inverse30));
}
function equivalent(projection1, projection2) {
  if (projection1 === projection2) {
    return true;
  }
  var equalUnits = projection1.getUnits() === projection2.getUnits();
  if (projection1.getCode() === projection2.getCode()) {
    return equalUnits;
  } else {
    var transformFunc = getTransformFromProjections(projection1, projection2);
    return transformFunc === cloneTransform && equalUnits;
  }
}
function getTransformFromProjections(sourceProjection, destinationProjection) {
  var sourceCode = sourceProjection.getCode();
  var destinationCode = destinationProjection.getCode();
  var transformFunc = get2(sourceCode, destinationCode);
  if (!transformFunc) {
    transformFunc = identityTransform;
  }
  return transformFunc;
}
function getTransform(source, destination) {
  var sourceProjection = get3(source);
  var destinationProjection = get3(destination);
  return getTransformFromProjections(sourceProjection, destinationProjection);
}
function transform(coordinate, source, destination) {
  var transformFunc = getTransform(source, destination);
  return transformFunc(coordinate, void 0, coordinate.length);
}
function transformExtent(extent, source, destination, opt_stops) {
  var transformFunc = getTransform(source, destination);
  return applyTransform(extent, transformFunc, void 0, opt_stops);
}
var userProjection = null;
function getUserProjection() {
  return userProjection;
}
function toUserCoordinate(coordinate, sourceProjection) {
  if (!userProjection) {
    return coordinate;
  }
  return transform(coordinate, sourceProjection, userProjection);
}
function fromUserCoordinate(coordinate, destProjection) {
  if (!userProjection) {
    if (showCoordinateWarning && !equals3(coordinate, [0, 0]) && coordinate[0] >= -180 && coordinate[0] <= 180 && coordinate[1] >= -90 && coordinate[1] <= 90) {
      showCoordinateWarning = false;
      console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.");
    }
    return coordinate;
  }
  return transform(coordinate, userProjection, destProjection);
}
function toUserExtent(extent, sourceProjection) {
  if (!userProjection) {
    return extent;
  }
  return transformExtent(extent, sourceProjection, userProjection);
}
function fromUserExtent(extent, destProjection) {
  if (!userProjection) {
    return extent;
  }
  return transformExtent(extent, userProjection, destProjection);
}
function toUserResolution(resolution, sourceProjection) {
  if (!userProjection) {
    return resolution;
  }
  var sourceUnits = get3(sourceProjection).getUnits();
  var userUnits = userProjection.getUnits();
  return sourceUnits && userUnits ? resolution * METERS_PER_UNIT[sourceUnits] / METERS_PER_UNIT[userUnits] : resolution;
}
function createSafeCoordinateTransform(sourceProj, destProj, transform3) {
  return function(coord) {
    var transformed, worldsAway;
    if (sourceProj.canWrapX()) {
      var sourceExtent = sourceProj.getExtent();
      var sourceExtentWidth = getWidth(sourceExtent);
      coord = coord.slice(0);
      worldsAway = getWorldsAway(coord, sourceProj, sourceExtentWidth);
      if (worldsAway) {
        coord[0] = coord[0] - worldsAway * sourceExtentWidth;
      }
      coord[0] = clamp(coord[0], sourceExtent[0], sourceExtent[2]);
      coord[1] = clamp(coord[1], sourceExtent[1], sourceExtent[3]);
      transformed = transform3(coord);
    } else {
      transformed = transform3(coord);
    }
    if (worldsAway && destProj.canWrapX()) {
      transformed[0] += worldsAway * getWidth(destProj.getExtent());
    }
    return transformed;
  };
}
function addCommon() {
  addEquivalentProjections(PROJECTIONS);
  addEquivalentProjections(PROJECTIONS2);
  addEquivalentTransforms(PROJECTIONS2, PROJECTIONS, fromEPSG4326, toEPSG4326);
}
addCommon();

// node_modules/ol/reproj/Triangulation.js
var MAX_SUBDIVISION = 10;
var MAX_TRIANGLE_WIDTH = 0.25;
var Triangulation = (
  /** @class */
  function() {
    function Triangulation2(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold, opt_destinationResolution) {
      this.sourceProj_ = sourceProj;
      this.targetProj_ = targetProj;
      var transformInvCache = {};
      var transformInv = getTransform(this.targetProj_, this.sourceProj_);
      this.transformInv_ = function(c) {
        var key = c[0] + "/" + c[1];
        if (!transformInvCache[key]) {
          transformInvCache[key] = transformInv(c);
        }
        return transformInvCache[key];
      };
      this.maxSourceExtent_ = maxSourceExtent;
      this.errorThresholdSquared_ = errorThreshold * errorThreshold;
      this.triangles_ = [];
      this.wrapsXInSource_ = false;
      this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!maxSourceExtent && !!this.sourceProj_.getExtent() && getWidth(maxSourceExtent) == getWidth(this.sourceProj_.getExtent());
      this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? getWidth(this.sourceProj_.getExtent()) : null;
      this.targetWorldWidth_ = this.targetProj_.getExtent() ? getWidth(this.targetProj_.getExtent()) : null;
      var destinationTopLeft = getTopLeft(targetExtent);
      var destinationTopRight = getTopRight(targetExtent);
      var destinationBottomRight = getBottomRight(targetExtent);
      var destinationBottomLeft = getBottomLeft(targetExtent);
      var sourceTopLeft = this.transformInv_(destinationTopLeft);
      var sourceTopRight = this.transformInv_(destinationTopRight);
      var sourceBottomRight = this.transformInv_(destinationBottomRight);
      var sourceBottomLeft = this.transformInv_(destinationBottomLeft);
      var maxSubdivision = MAX_SUBDIVISION + (opt_destinationResolution ? Math.max(0, Math.ceil(log2(getArea(targetExtent) / (opt_destinationResolution * opt_destinationResolution * 256 * 256)))) : 0);
      this.addQuad_(destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, maxSubdivision);
      if (this.wrapsXInSource_) {
        var leftBound_1 = Infinity;
        this.triangles_.forEach(function(triangle, i2, arr) {
          leftBound_1 = Math.min(leftBound_1, triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]);
        });
        this.triangles_.forEach((function(triangle) {
          if (Math.max(triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]) - leftBound_1 > this.sourceWorldWidth_ / 2) {
            var newTriangle = [
              [triangle.source[0][0], triangle.source[0][1]],
              [triangle.source[1][0], triangle.source[1][1]],
              [triangle.source[2][0], triangle.source[2][1]]
            ];
            if (newTriangle[0][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
              newTriangle[0][0] -= this.sourceWorldWidth_;
            }
            if (newTriangle[1][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
              newTriangle[1][0] -= this.sourceWorldWidth_;
            }
            if (newTriangle[2][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
              newTriangle[2][0] -= this.sourceWorldWidth_;
            }
            var minX = Math.min(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);
            var maxX = Math.max(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);
            if (maxX - minX < this.sourceWorldWidth_ / 2) {
              triangle.source = newTriangle;
            }
          }
        }).bind(this));
      }
      transformInvCache = {};
    }
    Triangulation2.prototype.addTriangle_ = function(a, b, c, aSrc, bSrc, cSrc) {
      this.triangles_.push({
        source: [aSrc, bSrc, cSrc],
        target: [a, b, c]
      });
    };
    Triangulation2.prototype.addQuad_ = function(a, b, c, d, aSrc, bSrc, cSrc, dSrc, maxSubdivision) {
      var sourceQuadExtent = boundingExtent([aSrc, bSrc, cSrc, dSrc]);
      var sourceCoverageX = this.sourceWorldWidth_ ? getWidth(sourceQuadExtent) / this.sourceWorldWidth_ : null;
      var sourceWorldWidth = (
        /** @type {number} */
        this.sourceWorldWidth_
      );
      var wrapsX = this.sourceProj_.canWrapX() && sourceCoverageX > 0.5 && sourceCoverageX < 1;
      var needsSubdivision = false;
      if (maxSubdivision > 0) {
        if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
          var targetQuadExtent = boundingExtent([a, b, c, d]);
          var targetCoverageX = getWidth(targetQuadExtent) / this.targetWorldWidth_;
          needsSubdivision = targetCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;
        }
        if (!wrapsX && this.sourceProj_.isGlobal() && sourceCoverageX) {
          needsSubdivision = sourceCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;
        }
      }
      if (!needsSubdivision && this.maxSourceExtent_) {
        if (isFinite(sourceQuadExtent[0]) && isFinite(sourceQuadExtent[1]) && isFinite(sourceQuadExtent[2]) && isFinite(sourceQuadExtent[3])) {
          if (!intersects(sourceQuadExtent, this.maxSourceExtent_)) {
            return;
          }
        }
      }
      var isNotFinite = 0;
      if (!needsSubdivision) {
        if (!isFinite(aSrc[0]) || !isFinite(aSrc[1]) || !isFinite(bSrc[0]) || !isFinite(bSrc[1]) || !isFinite(cSrc[0]) || !isFinite(cSrc[1]) || !isFinite(dSrc[0]) || !isFinite(dSrc[1])) {
          if (maxSubdivision > 0) {
            needsSubdivision = true;
          } else {
            isNotFinite = (!isFinite(aSrc[0]) || !isFinite(aSrc[1]) ? 8 : 0) + (!isFinite(bSrc[0]) || !isFinite(bSrc[1]) ? 4 : 0) + (!isFinite(cSrc[0]) || !isFinite(cSrc[1]) ? 2 : 0) + (!isFinite(dSrc[0]) || !isFinite(dSrc[1]) ? 1 : 0);
            if (isNotFinite != 1 && isNotFinite != 2 && isNotFinite != 4 && isNotFinite != 8) {
              return;
            }
          }
        }
      }
      if (maxSubdivision > 0) {
        if (!needsSubdivision) {
          var center = [(a[0] + c[0]) / 2, (a[1] + c[1]) / 2];
          var centerSrc = this.transformInv_(center);
          var dx = void 0;
          if (wrapsX) {
            var centerSrcEstimX = (modulo(aSrc[0], sourceWorldWidth) + modulo(cSrc[0], sourceWorldWidth)) / 2;
            dx = centerSrcEstimX - modulo(centerSrc[0], sourceWorldWidth);
          } else {
            dx = (aSrc[0] + cSrc[0]) / 2 - centerSrc[0];
          }
          var dy = (aSrc[1] + cSrc[1]) / 2 - centerSrc[1];
          var centerSrcErrorSquared = dx * dx + dy * dy;
          needsSubdivision = centerSrcErrorSquared > this.errorThresholdSquared_;
        }
        if (needsSubdivision) {
          if (Math.abs(a[0] - c[0]) <= Math.abs(a[1] - c[1])) {
            var bc = [(b[0] + c[0]) / 2, (b[1] + c[1]) / 2];
            var bcSrc = this.transformInv_(bc);
            var da = [(d[0] + a[0]) / 2, (d[1] + a[1]) / 2];
            var daSrc = this.transformInv_(da);
            this.addQuad_(a, b, bc, da, aSrc, bSrc, bcSrc, daSrc, maxSubdivision - 1);
            this.addQuad_(da, bc, c, d, daSrc, bcSrc, cSrc, dSrc, maxSubdivision - 1);
          } else {
            var ab = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
            var abSrc = this.transformInv_(ab);
            var cd = [(c[0] + d[0]) / 2, (c[1] + d[1]) / 2];
            var cdSrc = this.transformInv_(cd);
            this.addQuad_(a, ab, cd, d, aSrc, abSrc, cdSrc, dSrc, maxSubdivision - 1);
            this.addQuad_(ab, b, c, cd, abSrc, bSrc, cSrc, cdSrc, maxSubdivision - 1);
          }
          return;
        }
      }
      if (wrapsX) {
        if (!this.canWrapXInSource_) {
          return;
        }
        this.wrapsXInSource_ = true;
      }
      if ((isNotFinite & 11) == 0) {
        this.addTriangle_(a, c, d, aSrc, cSrc, dSrc);
      }
      if ((isNotFinite & 14) == 0) {
        this.addTriangle_(a, c, b, aSrc, cSrc, bSrc);
      }
      if (isNotFinite) {
        if ((isNotFinite & 13) == 0) {
          this.addTriangle_(b, d, a, bSrc, dSrc, aSrc);
        }
        if ((isNotFinite & 7) == 0) {
          this.addTriangle_(b, d, c, bSrc, dSrc, cSrc);
        }
      }
    };
    Triangulation2.prototype.calculateSourceExtent = function() {
      var extent = createEmpty();
      this.triangles_.forEach(function(triangle, i2, arr) {
        var src = triangle.source;
        extendCoordinate(extent, src[0]);
        extendCoordinate(extent, src[1]);
        extendCoordinate(extent, src[2]);
      });
      return extent;
    };
    Triangulation2.prototype.getTriangles = function() {
      return this.triangles_;
    };
    return Triangulation2;
  }()
);
var Triangulation_default = Triangulation;

// node_modules/ol/renderer/canvas/common.js
var IMAGE_SMOOTHING_DISABLED = {
  imageSmoothingEnabled: false,
  msImageSmoothingEnabled: false
};
var IMAGE_SMOOTHING_ENABLED = {
  imageSmoothingEnabled: true,
  msImageSmoothingEnabled: true
};

// node_modules/ol/reproj.js
var brokenDiagonalRendering_;
var canvasPool2 = [];
function drawTestTriangle(ctx, u1, v14, u2, v2) {
  ctx.beginPath();
  ctx.moveTo(0, 0);
  ctx.lineTo(u1, v14);
  ctx.lineTo(u2, v2);
  ctx.closePath();
  ctx.save();
  ctx.clip();
  ctx.fillRect(0, 0, Math.max(u1, u2) + 1, Math.max(v14, v2));
  ctx.restore();
}
function verifyBrokenDiagonalRendering(data, offset2) {
  return Math.abs(data[offset2 * 4] - 210) > 2 || Math.abs(data[offset2 * 4 + 3] - 0.75 * 255) > 2;
}
function isBrokenDiagonalRendering() {
  if (brokenDiagonalRendering_ === void 0) {
    var ctx = document.createElement("canvas").getContext("2d");
    ctx.globalCompositeOperation = "lighter";
    ctx.fillStyle = "rgba(210, 0, 0, 0.75)";
    drawTestTriangle(ctx, 4, 5, 4, 0);
    drawTestTriangle(ctx, 4, 5, 0, 5);
    var data = ctx.getImageData(0, 0, 3, 3).data;
    brokenDiagonalRendering_ = verifyBrokenDiagonalRendering(data, 0) || verifyBrokenDiagonalRendering(data, 4) || verifyBrokenDiagonalRendering(data, 8);
  }
  return brokenDiagonalRendering_;
}
function calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution) {
  var sourceCenter = transform(targetCenter, targetProj, sourceProj);
  var sourceResolution = getPointResolution(targetProj, targetResolution, targetCenter);
  var targetMetersPerUnit = targetProj.getMetersPerUnit();
  if (targetMetersPerUnit !== void 0) {
    sourceResolution *= targetMetersPerUnit;
  }
  var sourceMetersPerUnit = sourceProj.getMetersPerUnit();
  if (sourceMetersPerUnit !== void 0) {
    sourceResolution /= sourceMetersPerUnit;
  }
  var sourceExtent = sourceProj.getExtent();
  if (!sourceExtent || containsCoordinate(sourceExtent, sourceCenter)) {
    var compensationFactor = getPointResolution(sourceProj, sourceResolution, sourceCenter) / sourceResolution;
    if (isFinite(compensationFactor) && compensationFactor > 0) {
      sourceResolution /= compensationFactor;
    }
  }
  return sourceResolution;
}
function calculateSourceExtentResolution(sourceProj, targetProj, targetExtent, targetResolution) {
  var targetCenter = getCenter(targetExtent);
  var sourceResolution = calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution);
  if (!isFinite(sourceResolution) || sourceResolution <= 0) {
    forEachCorner(targetExtent, function(corner) {
      sourceResolution = calculateSourceResolution(sourceProj, targetProj, corner, targetResolution);
      return isFinite(sourceResolution) && sourceResolution > 0;
    });
  }
  return sourceResolution;
}
function render(width, height, pixelRatio, sourceResolution, sourceExtent, targetResolution, targetExtent, triangulation, sources, gutter, opt_renderEdges, opt_interpolate) {
  var context2 = createCanvasContext2D(Math.round(pixelRatio * width), Math.round(pixelRatio * height), canvasPool2);
  if (!opt_interpolate) {
    assign(context2, IMAGE_SMOOTHING_DISABLED);
  }
  if (sources.length === 0) {
    return context2.canvas;
  }
  context2.scale(pixelRatio, pixelRatio);
  function pixelRound(value) {
    return Math.round(value * pixelRatio) / pixelRatio;
  }
  context2.globalCompositeOperation = "lighter";
  var sourceDataExtent = createEmpty();
  sources.forEach(function(src, i2, arr) {
    extend2(sourceDataExtent, src.extent);
  });
  var canvasWidthInUnits = getWidth(sourceDataExtent);
  var canvasHeightInUnits = getHeight(sourceDataExtent);
  var stitchContext = createCanvasContext2D(Math.round(pixelRatio * canvasWidthInUnits / sourceResolution), Math.round(pixelRatio * canvasHeightInUnits / sourceResolution));
  if (!opt_interpolate) {
    assign(stitchContext, IMAGE_SMOOTHING_DISABLED);
  }
  var stitchScale = pixelRatio / sourceResolution;
  sources.forEach(function(src, i2, arr) {
    var xPos = src.extent[0] - sourceDataExtent[0];
    var yPos = -(src.extent[3] - sourceDataExtent[3]);
    var srcWidth = getWidth(src.extent);
    var srcHeight = getHeight(src.extent);
    if (src.image.width > 0 && src.image.height > 0) {
      stitchContext.drawImage(src.image, gutter, gutter, src.image.width - 2 * gutter, src.image.height - 2 * gutter, xPos * stitchScale, yPos * stitchScale, srcWidth * stitchScale, srcHeight * stitchScale);
    }
  });
  var targetTopLeft = getTopLeft(targetExtent);
  triangulation.getTriangles().forEach(function(triangle, i2, arr) {
    var source = triangle.source;
    var target = triangle.target;
    var x0 = source[0][0], y0 = source[0][1];
    var x1 = source[1][0], y1 = source[1][1];
    var x2 = source[2][0], y2 = source[2][1];
    var u0 = pixelRound((target[0][0] - targetTopLeft[0]) / targetResolution);
    var v0 = pixelRound(-(target[0][1] - targetTopLeft[1]) / targetResolution);
    var u1 = pixelRound((target[1][0] - targetTopLeft[0]) / targetResolution);
    var v14 = pixelRound(-(target[1][1] - targetTopLeft[1]) / targetResolution);
    var u2 = pixelRound((target[2][0] - targetTopLeft[0]) / targetResolution);
    var v2 = pixelRound(-(target[2][1] - targetTopLeft[1]) / targetResolution);
    var sourceNumericalShiftX = x0;
    var sourceNumericalShiftY = y0;
    x0 = 0;
    y0 = 0;
    x1 -= sourceNumericalShiftX;
    y1 -= sourceNumericalShiftY;
    x2 -= sourceNumericalShiftX;
    y2 -= sourceNumericalShiftY;
    var augmentedMatrix = [
      [x1, y1, 0, 0, u1 - u0],
      [x2, y2, 0, 0, u2 - u0],
      [0, 0, x1, y1, v14 - v0],
      [0, 0, x2, y2, v2 - v0]
    ];
    var affineCoefs = solveLinearSystem(augmentedMatrix);
    if (!affineCoefs) {
      return;
    }
    context2.save();
    context2.beginPath();
    if (isBrokenDiagonalRendering() || !opt_interpolate) {
      context2.moveTo(u1, v14);
      var steps = 4;
      var ud = u0 - u1;
      var vd = v0 - v14;
      for (var step = 0; step < steps; step++) {
        context2.lineTo(u1 + pixelRound((step + 1) * ud / steps), v14 + pixelRound(step * vd / (steps - 1)));
        if (step != steps - 1) {
          context2.lineTo(u1 + pixelRound((step + 1) * ud / steps), v14 + pixelRound((step + 1) * vd / (steps - 1)));
        }
      }
      context2.lineTo(u2, v2);
    } else {
      context2.moveTo(u1, v14);
      context2.lineTo(u0, v0);
      context2.lineTo(u2, v2);
    }
    context2.clip();
    context2.transform(affineCoefs[0], affineCoefs[2], affineCoefs[1], affineCoefs[3], u0, v0);
    context2.translate(sourceDataExtent[0] - sourceNumericalShiftX, sourceDataExtent[3] - sourceNumericalShiftY);
    context2.scale(sourceResolution / pixelRatio, -sourceResolution / pixelRatio);
    context2.drawImage(stitchContext.canvas, 0, 0);
    context2.restore();
  });
  if (opt_renderEdges) {
    context2.save();
    context2.globalCompositeOperation = "source-over";
    context2.strokeStyle = "black";
    context2.lineWidth = 1;
    triangulation.getTriangles().forEach(function(triangle, i2, arr) {
      var target = triangle.target;
      var u0 = (target[0][0] - targetTopLeft[0]) / targetResolution;
      var v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution;
      var u1 = (target[1][0] - targetTopLeft[0]) / targetResolution;
      var v14 = -(target[1][1] - targetTopLeft[1]) / targetResolution;
      var u2 = (target[2][0] - targetTopLeft[0]) / targetResolution;
      var v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution;
      context2.beginPath();
      context2.moveTo(u1, v14);
      context2.lineTo(u0, v0);
      context2.lineTo(u2, v2);
      context2.closePath();
      context2.stroke();
    });
    context2.restore();
  }
  return context2.canvas;
}

// node_modules/ol/reproj/Tile.js
var __extends24 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ReprojTile = (
  /** @class */
  function(_super) {
    __extends24(ReprojTile2, _super);
    function ReprojTile2(sourceProj, sourceTileGrid, targetProj, targetTileGrid, tileCoord, wrappedTileCoord, pixelRatio, gutter, getTileFunction, opt_errorThreshold, opt_renderEdges, opt_interpolate) {
      var _this = _super.call(this, tileCoord, TileState_default.IDLE, { interpolate: !!opt_interpolate }) || this;
      _this.renderEdges_ = opt_renderEdges !== void 0 ? opt_renderEdges : false;
      _this.pixelRatio_ = pixelRatio;
      _this.gutter_ = gutter;
      _this.canvas_ = null;
      _this.sourceTileGrid_ = sourceTileGrid;
      _this.targetTileGrid_ = targetTileGrid;
      _this.wrappedTileCoord_ = wrappedTileCoord ? wrappedTileCoord : tileCoord;
      _this.sourceTiles_ = [];
      _this.sourcesListenerKeys_ = null;
      _this.sourceZ_ = 0;
      var targetExtent = targetTileGrid.getTileCoordExtent(_this.wrappedTileCoord_);
      var maxTargetExtent = _this.targetTileGrid_.getExtent();
      var maxSourceExtent = _this.sourceTileGrid_.getExtent();
      var limitedTargetExtent = maxTargetExtent ? getIntersection(targetExtent, maxTargetExtent) : targetExtent;
      if (getArea(limitedTargetExtent) === 0) {
        _this.state = TileState_default.EMPTY;
        return _this;
      }
      var sourceProjExtent = sourceProj.getExtent();
      if (sourceProjExtent) {
        if (!maxSourceExtent) {
          maxSourceExtent = sourceProjExtent;
        } else {
          maxSourceExtent = getIntersection(maxSourceExtent, sourceProjExtent);
        }
      }
      var targetResolution = targetTileGrid.getResolution(_this.wrappedTileCoord_[0]);
      var sourceResolution = calculateSourceExtentResolution(sourceProj, targetProj, limitedTargetExtent, targetResolution);
      if (!isFinite(sourceResolution) || sourceResolution <= 0) {
        _this.state = TileState_default.EMPTY;
        return _this;
      }
      var errorThresholdInPixels = opt_errorThreshold !== void 0 ? opt_errorThreshold : ERROR_THRESHOLD;
      _this.triangulation_ = new Triangulation_default(sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels, targetResolution);
      if (_this.triangulation_.getTriangles().length === 0) {
        _this.state = TileState_default.EMPTY;
        return _this;
      }
      _this.sourceZ_ = sourceTileGrid.getZForResolution(sourceResolution);
      var sourceExtent = _this.triangulation_.calculateSourceExtent();
      if (maxSourceExtent) {
        if (sourceProj.canWrapX()) {
          sourceExtent[1] = clamp(sourceExtent[1], maxSourceExtent[1], maxSourceExtent[3]);
          sourceExtent[3] = clamp(sourceExtent[3], maxSourceExtent[1], maxSourceExtent[3]);
        } else {
          sourceExtent = getIntersection(sourceExtent, maxSourceExtent);
        }
      }
      if (!getArea(sourceExtent)) {
        _this.state = TileState_default.EMPTY;
      } else {
        var sourceRange = sourceTileGrid.getTileRangeForExtentAndZ(sourceExtent, _this.sourceZ_);
        for (var srcX = sourceRange.minX; srcX <= sourceRange.maxX; srcX++) {
          for (var srcY = sourceRange.minY; srcY <= sourceRange.maxY; srcY++) {
            var tile = getTileFunction(_this.sourceZ_, srcX, srcY, pixelRatio);
            if (tile) {
              _this.sourceTiles_.push(tile);
            }
          }
        }
        if (_this.sourceTiles_.length === 0) {
          _this.state = TileState_default.EMPTY;
        }
      }
      return _this;
    }
    ReprojTile2.prototype.getImage = function() {
      return this.canvas_;
    };
    ReprojTile2.prototype.reproject_ = function() {
      var sources = [];
      this.sourceTiles_.forEach((function(tile, i2, arr) {
        if (tile && tile.getState() == TileState_default.LOADED) {
          sources.push({
            extent: this.sourceTileGrid_.getTileCoordExtent(tile.tileCoord),
            image: tile.getImage()
          });
        }
      }).bind(this));
      this.sourceTiles_.length = 0;
      if (sources.length === 0) {
        this.state = TileState_default.ERROR;
      } else {
        var z = this.wrappedTileCoord_[0];
        var size = this.targetTileGrid_.getTileSize(z);
        var width = typeof size === "number" ? size : size[0];
        var height = typeof size === "number" ? size : size[1];
        var targetResolution = this.targetTileGrid_.getResolution(z);
        var sourceResolution = this.sourceTileGrid_.getResolution(this.sourceZ_);
        var targetExtent = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);
        this.canvas_ = render(width, height, this.pixelRatio_, sourceResolution, this.sourceTileGrid_.getExtent(), targetResolution, targetExtent, this.triangulation_, sources, this.gutter_, this.renderEdges_, this.interpolate);
        this.state = TileState_default.LOADED;
      }
      this.changed();
    };
    ReprojTile2.prototype.load = function() {
      if (this.state == TileState_default.IDLE) {
        this.state = TileState_default.LOADING;
        this.changed();
        var leftToLoad_1 = 0;
        this.sourcesListenerKeys_ = [];
        this.sourceTiles_.forEach((function(tile, i2, arr) {
          var state2 = tile.getState();
          if (state2 == TileState_default.IDLE || state2 == TileState_default.LOADING) {
            leftToLoad_1++;
            var sourceListenKey_1 = listen(tile, EventType_default.CHANGE, function(e) {
              var state3 = tile.getState();
              if (state3 == TileState_default.LOADED || state3 == TileState_default.ERROR || state3 == TileState_default.EMPTY) {
                unlistenByKey(sourceListenKey_1);
                leftToLoad_1--;
                if (leftToLoad_1 === 0) {
                  this.unlistenSources_();
                  this.reproject_();
                }
              }
            }, this);
            this.sourcesListenerKeys_.push(sourceListenKey_1);
          }
        }).bind(this));
        if (leftToLoad_1 === 0) {
          setTimeout(this.reproject_.bind(this), 0);
        } else {
          this.sourceTiles_.forEach(function(tile, i2, arr) {
            var state2 = tile.getState();
            if (state2 == TileState_default.IDLE) {
              tile.load();
            }
          });
        }
      }
    };
    ReprojTile2.prototype.unlistenSources_ = function() {
      this.sourcesListenerKeys_.forEach(unlistenByKey);
      this.sourcesListenerKeys_ = null;
    };
    ReprojTile2.prototype.release = function() {
      if (this.canvas_) {
        releaseCanvas(this.canvas_.getContext("2d"));
        canvasPool2.push(this.canvas_);
        this.canvas_ = null;
      }
      _super.prototype.release.call(this);
    };
    return ReprojTile2;
  }(Tile_default)
);
var Tile_default2 = ReprojTile;

// node_modules/ol/TileRange.js
var TileRange = (
  /** @class */
  function() {
    function TileRange2(minX, maxX, minY, maxY) {
      this.minX = minX;
      this.maxX = maxX;
      this.minY = minY;
      this.maxY = maxY;
    }
    TileRange2.prototype.contains = function(tileCoord) {
      return this.containsXY(tileCoord[1], tileCoord[2]);
    };
    TileRange2.prototype.containsTileRange = function(tileRange) {
      return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX && this.minY <= tileRange.minY && tileRange.maxY <= this.maxY;
    };
    TileRange2.prototype.containsXY = function(x, y) {
      return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY;
    };
    TileRange2.prototype.equals = function(tileRange) {
      return this.minX == tileRange.minX && this.minY == tileRange.minY && this.maxX == tileRange.maxX && this.maxY == tileRange.maxY;
    };
    TileRange2.prototype.extend = function(tileRange) {
      if (tileRange.minX < this.minX) {
        this.minX = tileRange.minX;
      }
      if (tileRange.maxX > this.maxX) {
        this.maxX = tileRange.maxX;
      }
      if (tileRange.minY < this.minY) {
        this.minY = tileRange.minY;
      }
      if (tileRange.maxY > this.maxY) {
        this.maxY = tileRange.maxY;
      }
    };
    TileRange2.prototype.getHeight = function() {
      return this.maxY - this.minY + 1;
    };
    TileRange2.prototype.getSize = function() {
      return [this.getWidth(), this.getHeight()];
    };
    TileRange2.prototype.getWidth = function() {
      return this.maxX - this.minX + 1;
    };
    TileRange2.prototype.intersects = function(tileRange) {
      return this.minX <= tileRange.maxX && this.maxX >= tileRange.minX && this.minY <= tileRange.maxY && this.maxY >= tileRange.minY;
    };
    return TileRange2;
  }()
);
function createOrUpdate2(minX, maxX, minY, maxY, tileRange) {
  if (tileRange !== void 0) {
    tileRange.minX = minX;
    tileRange.maxX = maxX;
    tileRange.minY = minY;
    tileRange.maxY = maxY;
    return tileRange;
  } else {
    return new TileRange(minX, maxX, minY, maxY);
  }
}
var TileRange_default = TileRange;

// node_modules/ol/renderer/canvas/TileLayer.js
var __extends25 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasTileLayerRenderer = (
  /** @class */
  function(_super) {
    __extends25(CanvasTileLayerRenderer2, _super);
    function CanvasTileLayerRenderer2(tileLayer) {
      var _this = _super.call(this, tileLayer) || this;
      _this.extentChanged = true;
      _this.renderedExtent_ = null;
      _this.renderedPixelRatio;
      _this.renderedProjection = null;
      _this.renderedRevision;
      _this.renderedTiles = [];
      _this.newTiles_ = false;
      _this.tmpExtent = createEmpty();
      _this.tmpTileRange_ = new TileRange_default(0, 0, 0, 0);
      return _this;
    }
    CanvasTileLayerRenderer2.prototype.isDrawableTile = function(tile) {
      var tileLayer = this.getLayer();
      var tileState = tile.getState();
      var useInterimTilesOnError = tileLayer.getUseInterimTilesOnError();
      return tileState == TileState_default.LOADED || tileState == TileState_default.EMPTY || tileState == TileState_default.ERROR && !useInterimTilesOnError;
    };
    CanvasTileLayerRenderer2.prototype.getTile = function(z, x, y, frameState) {
      var pixelRatio = frameState.pixelRatio;
      var projection = frameState.viewState.projection;
      var tileLayer = this.getLayer();
      var tileSource = tileLayer.getSource();
      var tile = tileSource.getTile(z, x, y, pixelRatio, projection);
      if (tile.getState() == TileState_default.ERROR) {
        if (!tileLayer.getUseInterimTilesOnError()) {
          tile.setState(TileState_default.LOADED);
        } else if (tileLayer.getPreload() > 0) {
          this.newTiles_ = true;
        }
      }
      if (!this.isDrawableTile(tile)) {
        tile = tile.getInterimTile();
      }
      return tile;
    };
    CanvasTileLayerRenderer2.prototype.getData = function(pixel) {
      var frameState = this.frameState;
      if (!frameState) {
        return null;
      }
      var layer = this.getLayer();
      var coordinate = apply(frameState.pixelToCoordinateTransform, pixel.slice());
      var layerExtent = layer.getExtent();
      if (layerExtent) {
        if (!containsCoordinate(layerExtent, coordinate)) {
          return null;
        }
      }
      var pixelRatio = frameState.pixelRatio;
      var projection = frameState.viewState.projection;
      var viewState = frameState.viewState;
      var source = layer.getRenderSource();
      var tileGrid = source.getTileGridForProjection(viewState.projection);
      var tilePixelRatio = source.getTilePixelRatio(frameState.pixelRatio);
      for (var z = tileGrid.getZForResolution(viewState.resolution); z >= tileGrid.getMinZoom(); --z) {
        var tileCoord = tileGrid.getTileCoordForCoordAndZ(coordinate, z);
        var tile = source.getTile(z, tileCoord[1], tileCoord[2], pixelRatio, projection);
        if (!(tile instanceof ImageTile_default || tile instanceof Tile_default2)) {
          return null;
        }
        if (tile.getState() !== TileState_default.LOADED) {
          continue;
        }
        var tileOrigin = tileGrid.getOrigin(z);
        var tileSize = toSize(tileGrid.getTileSize(z));
        var tileResolution = tileGrid.getResolution(z);
        var col = Math.floor(tilePixelRatio * ((coordinate[0] - tileOrigin[0]) / tileResolution - tileCoord[1] * tileSize[0]));
        var row = Math.floor(tilePixelRatio * ((tileOrigin[1] - coordinate[1]) / tileResolution - tileCoord[2] * tileSize[1]));
        var gutter = Math.round(tilePixelRatio * source.getGutterForProjection(viewState.projection));
        return this.getImageData(tile.getImage(), col + gutter, row + gutter);
      }
      return null;
    };
    CanvasTileLayerRenderer2.prototype.loadedTileCallback = function(tiles, zoom, tile) {
      if (this.isDrawableTile(tile)) {
        return _super.prototype.loadedTileCallback.call(this, tiles, zoom, tile);
      }
      return false;
    };
    CanvasTileLayerRenderer2.prototype.prepareFrame = function(frameState) {
      return !!this.getLayer().getSource();
    };
    CanvasTileLayerRenderer2.prototype.renderFrame = function(frameState, target) {
      var layerState = frameState.layerStatesArray[frameState.layerIndex];
      var viewState = frameState.viewState;
      var projection = viewState.projection;
      var viewResolution = viewState.resolution;
      var viewCenter = viewState.center;
      var rotation = viewState.rotation;
      var pixelRatio = frameState.pixelRatio;
      var tileLayer = this.getLayer();
      var tileSource = tileLayer.getSource();
      var sourceRevision = tileSource.getRevision();
      var tileGrid = tileSource.getTileGridForProjection(projection);
      var z = tileGrid.getZForResolution(viewResolution, tileSource.zDirection);
      var tileResolution = tileGrid.getResolution(z);
      var extent = frameState.extent;
      var resolution = frameState.viewState.resolution;
      var tilePixelRatio = tileSource.getTilePixelRatio(pixelRatio);
      var width = Math.round(getWidth(extent) / resolution * pixelRatio);
      var height = Math.round(getHeight(extent) / resolution * pixelRatio);
      var layerExtent = layerState.extent && fromUserExtent(layerState.extent, projection);
      if (layerExtent) {
        extent = getIntersection(extent, fromUserExtent(layerState.extent, projection));
      }
      var dx = tileResolution * width / 2 / tilePixelRatio;
      var dy = tileResolution * height / 2 / tilePixelRatio;
      var canvasExtent = [
        viewCenter[0] - dx,
        viewCenter[1] - dy,
        viewCenter[0] + dx,
        viewCenter[1] + dy
      ];
      var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
      var tilesToDrawByZ = {};
      tilesToDrawByZ[z] = {};
      var findLoadedTiles = this.createLoadedTileFinder(tileSource, projection, tilesToDrawByZ);
      var tmpExtent2 = this.tmpExtent;
      var tmpTileRange = this.tmpTileRange_;
      this.newTiles_ = false;
      var viewport = rotation ? getRotatedViewport(viewState.center, resolution, rotation, frameState.size) : void 0;
      for (var x = tileRange.minX; x <= tileRange.maxX; ++x) {
        for (var y = tileRange.minY; y <= tileRange.maxY; ++y) {
          if (rotation && !tileGrid.tileCoordIntersectsViewport([z, x, y], viewport)) {
            continue;
          }
          var tile = this.getTile(z, x, y, frameState);
          if (this.isDrawableTile(tile)) {
            var uid = getUid(this);
            if (tile.getState() == TileState_default.LOADED) {
              tilesToDrawByZ[z][tile.tileCoord.toString()] = tile;
              var inTransition = tile.inTransition(uid);
              if (inTransition && layerState.opacity !== 1) {
                tile.endTransition(uid);
                inTransition = false;
              }
              if (!this.newTiles_ && (inTransition || this.renderedTiles.indexOf(tile) === -1)) {
                this.newTiles_ = true;
              }
            }
            if (tile.getAlpha(uid, frameState.time) === 1) {
              continue;
            }
          }
          var childTileRange = tileGrid.getTileCoordChildTileRange(tile.tileCoord, tmpTileRange, tmpExtent2);
          var covered = false;
          if (childTileRange) {
            covered = findLoadedTiles(z + 1, childTileRange);
          }
          if (!covered) {
            tileGrid.forEachTileCoordParentTileRange(tile.tileCoord, findLoadedTiles, tmpTileRange, tmpExtent2);
          }
        }
      }
      var canvasScale = tileResolution / viewResolution * pixelRatio / tilePixelRatio;
      compose2(this.pixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / pixelRatio, 1 / pixelRatio, rotation, -width / 2, -height / 2);
      var canvasTransform = toString2(this.pixelTransform);
      this.useContainer(target, canvasTransform, this.getBackground(frameState));
      var context2 = this.context;
      var canvas = context2.canvas;
      makeInverse(this.inversePixelTransform, this.pixelTransform);
      compose2(this.tempTransform, width / 2, height / 2, canvasScale, canvasScale, 0, -width / 2, -height / 2);
      if (canvas.width != width || canvas.height != height) {
        canvas.width = width;
        canvas.height = height;
      } else if (!this.containerReused) {
        context2.clearRect(0, 0, width, height);
      }
      if (layerExtent) {
        this.clipUnrotated(context2, frameState, layerExtent);
      }
      if (!tileSource.getInterpolate()) {
        assign(context2, IMAGE_SMOOTHING_DISABLED);
      }
      this.preRender(context2, frameState);
      this.renderedTiles.length = 0;
      var zs = Object.keys(tilesToDrawByZ).map(Number);
      zs.sort(numberSafeCompareFunction);
      var clips, clipZs, currentClip;
      if (layerState.opacity === 1 && (!this.containerReused || tileSource.getOpaque(frameState.viewState.projection))) {
        zs = zs.reverse();
      } else {
        clips = [];
        clipZs = [];
      }
      for (var i2 = zs.length - 1; i2 >= 0; --i2) {
        var currentZ = zs[i2];
        var currentTilePixelSize = tileSource.getTilePixelSize(currentZ, pixelRatio, projection);
        var currentResolution = tileGrid.getResolution(currentZ);
        var currentScale = currentResolution / tileResolution;
        var dx_1 = currentTilePixelSize[0] * currentScale * canvasScale;
        var dy_1 = currentTilePixelSize[1] * currentScale * canvasScale;
        var originTileCoord = tileGrid.getTileCoordForCoordAndZ(getTopLeft(canvasExtent), currentZ);
        var originTileExtent = tileGrid.getTileCoordExtent(originTileCoord);
        var origin_1 = apply(this.tempTransform, [
          tilePixelRatio * (originTileExtent[0] - canvasExtent[0]) / tileResolution,
          tilePixelRatio * (canvasExtent[3] - originTileExtent[3]) / tileResolution
        ]);
        var tileGutter = tilePixelRatio * tileSource.getGutterForProjection(projection);
        var tilesToDraw = tilesToDrawByZ[currentZ];
        for (var tileCoordKey in tilesToDraw) {
          var tile = (
            /** @type {import("../../ImageTile.js").default} */
            tilesToDraw[tileCoordKey]
          );
          var tileCoord = tile.tileCoord;
          var xIndex = originTileCoord[1] - tileCoord[1];
          var nextX = Math.round(origin_1[0] - (xIndex - 1) * dx_1);
          var yIndex = originTileCoord[2] - tileCoord[2];
          var nextY = Math.round(origin_1[1] - (yIndex - 1) * dy_1);
          var x = Math.round(origin_1[0] - xIndex * dx_1);
          var y = Math.round(origin_1[1] - yIndex * dy_1);
          var w = nextX - x;
          var h = nextY - y;
          var transition2 = z === currentZ;
          var inTransition = transition2 && tile.getAlpha(getUid(this), frameState.time) !== 1;
          var contextSaved = false;
          if (!inTransition) {
            if (clips) {
              currentClip = [x, y, x + w, y, x + w, y + h, x, y + h];
              for (var i_1 = 0, ii = clips.length; i_1 < ii; ++i_1) {
                if (z !== currentZ && currentZ < clipZs[i_1]) {
                  var clip = clips[i_1];
                  if (intersects([x, y, x + w, y + h], [clip[0], clip[3], clip[4], clip[7]])) {
                    if (!contextSaved) {
                      context2.save();
                      contextSaved = true;
                    }
                    context2.beginPath();
                    context2.moveTo(currentClip[0], currentClip[1]);
                    context2.lineTo(currentClip[2], currentClip[3]);
                    context2.lineTo(currentClip[4], currentClip[5]);
                    context2.lineTo(currentClip[6], currentClip[7]);
                    context2.moveTo(clip[6], clip[7]);
                    context2.lineTo(clip[4], clip[5]);
                    context2.lineTo(clip[2], clip[3]);
                    context2.lineTo(clip[0], clip[1]);
                    context2.clip();
                  }
                }
              }
              clips.push(currentClip);
              clipZs.push(currentZ);
            } else {
              context2.clearRect(x, y, w, h);
            }
          }
          this.drawTileImage(tile, frameState, x, y, w, h, tileGutter, transition2);
          if (clips && !inTransition) {
            if (contextSaved) {
              context2.restore();
            }
            this.renderedTiles.unshift(tile);
          } else {
            this.renderedTiles.push(tile);
          }
          this.updateUsedTiles(frameState.usedTiles, tileSource, tile);
        }
      }
      this.renderedRevision = sourceRevision;
      this.renderedResolution = tileResolution;
      this.extentChanged = !this.renderedExtent_ || !equals2(this.renderedExtent_, canvasExtent);
      this.renderedExtent_ = canvasExtent;
      this.renderedPixelRatio = pixelRatio;
      this.renderedProjection = projection;
      this.manageTilePyramid(frameState, tileSource, tileGrid, pixelRatio, projection, extent, z, tileLayer.getPreload());
      this.scheduleExpireCache(frameState, tileSource);
      this.postRender(context2, frameState);
      if (layerState.extent) {
        context2.restore();
      }
      assign(context2, IMAGE_SMOOTHING_ENABLED);
      if (canvasTransform !== canvas.style.transform) {
        canvas.style.transform = canvasTransform;
      }
      return this.container;
    };
    CanvasTileLayerRenderer2.prototype.drawTileImage = function(tile, frameState, x, y, w, h, gutter, transition2) {
      var image = this.getTileImage(tile);
      if (!image) {
        return;
      }
      var uid = getUid(this);
      var layerState = frameState.layerStatesArray[frameState.layerIndex];
      var alpha = layerState.opacity * (transition2 ? tile.getAlpha(uid, frameState.time) : 1);
      var alphaChanged = alpha !== this.context.globalAlpha;
      if (alphaChanged) {
        this.context.save();
        this.context.globalAlpha = alpha;
      }
      this.context.drawImage(image, gutter, gutter, image.width - 2 * gutter, image.height - 2 * gutter, x, y, w, h);
      if (alphaChanged) {
        this.context.restore();
      }
      if (alpha !== layerState.opacity) {
        frameState.animate = true;
      } else if (transition2) {
        tile.endTransition(uid);
      }
    };
    CanvasTileLayerRenderer2.prototype.getImage = function() {
      var context2 = this.context;
      return context2 ? context2.canvas : null;
    };
    CanvasTileLayerRenderer2.prototype.getTileImage = function(tile) {
      return tile.getImage();
    };
    CanvasTileLayerRenderer2.prototype.scheduleExpireCache = function(frameState, tileSource) {
      if (tileSource.canExpireCache()) {
        var postRenderFunction = (function(tileSource2, map2, frameState2) {
          var tileSourceKey = getUid(tileSource2);
          if (tileSourceKey in frameState2.usedTiles) {
            tileSource2.expireCache(frameState2.viewState.projection, frameState2.usedTiles[tileSourceKey]);
          }
        }).bind(null, tileSource);
        frameState.postRenderFunctions.push(
          /** @type {import("../../PluggableMap.js").PostRenderFunction} */
          postRenderFunction
        );
      }
    };
    CanvasTileLayerRenderer2.prototype.updateUsedTiles = function(usedTiles, tileSource, tile) {
      var tileSourceKey = getUid(tileSource);
      if (!(tileSourceKey in usedTiles)) {
        usedTiles[tileSourceKey] = {};
      }
      usedTiles[tileSourceKey][tile.getKey()] = true;
    };
    CanvasTileLayerRenderer2.prototype.manageTilePyramid = function(frameState, tileSource, tileGrid, pixelRatio, projection, extent, currentZ, preload, opt_tileCallback) {
      var tileSourceKey = getUid(tileSource);
      if (!(tileSourceKey in frameState.wantedTiles)) {
        frameState.wantedTiles[tileSourceKey] = {};
      }
      var wantedTiles = frameState.wantedTiles[tileSourceKey];
      var tileQueue = frameState.tileQueue;
      var minZoom = tileGrid.getMinZoom();
      var rotation = frameState.viewState.rotation;
      var viewport = rotation ? getRotatedViewport(frameState.viewState.center, frameState.viewState.resolution, rotation, frameState.size) : void 0;
      var tileCount = 0;
      var tile, tileRange, tileResolution, x, y, z;
      for (z = minZoom; z <= currentZ; ++z) {
        tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z, tileRange);
        tileResolution = tileGrid.getResolution(z);
        for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
          for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
            if (rotation && !tileGrid.tileCoordIntersectsViewport([z, x, y], viewport)) {
              continue;
            }
            if (currentZ - z <= preload) {
              ++tileCount;
              tile = tileSource.getTile(z, x, y, pixelRatio, projection);
              if (tile.getState() == TileState_default.IDLE) {
                wantedTiles[tile.getKey()] = true;
                if (!tileQueue.isKeyQueued(tile.getKey())) {
                  tileQueue.enqueue([
                    tile,
                    tileSourceKey,
                    tileGrid.getTileCoordCenter(tile.tileCoord),
                    tileResolution
                  ]);
                }
              }
              if (opt_tileCallback !== void 0) {
                opt_tileCallback(tile);
              }
            } else {
              tileSource.useTile(z, x, y, projection);
            }
          }
        }
      }
      tileSource.updateCacheSize(tileCount, projection);
    };
    return CanvasTileLayerRenderer2;
  }(Layer_default3)
);
var TileLayer_default = CanvasTileLayerRenderer;

// node_modules/ol/layer/VectorTileRenderType.js
var VectorTileRenderType_default = {
  /**
   * Vector tiles are rendered as images. Great performance, but
   * point symbols and texts are always rotated with the view and pixels are
   * scaled during zoom animations
   * @api
   * @deprecated
   */
  IMAGE: "image",
  /**
   * Polygon and line elements are rendered as images, so pixels
   * are scaled during zoom animations. Point symbols and texts are accurately
   * rendered as vectors and can stay upright on rotated views.
   * @api
   */
  HYBRID: "hybrid",
  /**
   * Everything is rendered as vectors. Use this mode for improved
   * performance on vector tile layers with only a few rendered features (e.g.
   * for highlighting a subset of features of another layer with the same
   * source).
   * @api
   */
  VECTOR: "vector"
};

// node_modules/ol/ViewHint.js
var ViewHint_default = {
  ANIMATING: 0,
  INTERACTING: 1
};

// node_modules/ol/geom/Geometry.js
var __extends26 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var tmpTransform = create();
var Geometry = (
  /** @class */
  function(_super) {
    __extends26(Geometry2, _super);
    function Geometry2() {
      var _this = _super.call(this) || this;
      _this.extent_ = createEmpty();
      _this.extentRevision_ = -1;
      _this.simplifiedGeometryMaxMinSquaredTolerance = 0;
      _this.simplifiedGeometryRevision = 0;
      _this.simplifyTransformedInternal = memoizeOne(function(revision, squaredTolerance, opt_transform) {
        if (!opt_transform) {
          return this.getSimplifiedGeometry(squaredTolerance);
        }
        var clone2 = this.clone();
        clone2.applyTransform(opt_transform);
        return clone2.getSimplifiedGeometry(squaredTolerance);
      });
      return _this;
    }
    Geometry2.prototype.simplifyTransformed = function(squaredTolerance, opt_transform) {
      return this.simplifyTransformedInternal(this.getRevision(), squaredTolerance, opt_transform);
    };
    Geometry2.prototype.clone = function() {
      return abstract();
    };
    Geometry2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      return abstract();
    };
    Geometry2.prototype.containsXY = function(x, y) {
      var coord = this.getClosestPoint([x, y]);
      return coord[0] === x && coord[1] === y;
    };
    Geometry2.prototype.getClosestPoint = function(point, opt_closestPoint) {
      var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];
      this.closestPointXY(point[0], point[1], closestPoint, Infinity);
      return closestPoint;
    };
    Geometry2.prototype.intersectsCoordinate = function(coordinate) {
      return this.containsXY(coordinate[0], coordinate[1]);
    };
    Geometry2.prototype.computeExtent = function(extent) {
      return abstract();
    };
    Geometry2.prototype.getExtent = function(opt_extent) {
      if (this.extentRevision_ != this.getRevision()) {
        var extent = this.computeExtent(this.extent_);
        if (isNaN(extent[0]) || isNaN(extent[1])) {
          createOrUpdateEmpty(extent);
        }
        this.extentRevision_ = this.getRevision();
      }
      return returnOrUpdate(this.extent_, opt_extent);
    };
    Geometry2.prototype.rotate = function(angle, anchor2) {
      abstract();
    };
    Geometry2.prototype.scale = function(sx, opt_sy, opt_anchor) {
      abstract();
    };
    Geometry2.prototype.simplify = function(tolerance) {
      return this.getSimplifiedGeometry(tolerance * tolerance);
    };
    Geometry2.prototype.getSimplifiedGeometry = function(squaredTolerance) {
      return abstract();
    };
    Geometry2.prototype.getType = function() {
      return abstract();
    };
    Geometry2.prototype.applyTransform = function(transformFn) {
      abstract();
    };
    Geometry2.prototype.intersectsExtent = function(extent) {
      return abstract();
    };
    Geometry2.prototype.translate = function(deltaX, deltaY) {
      abstract();
    };
    Geometry2.prototype.transform = function(source, destination) {
      var sourceProj = get3(source);
      var transformFn = sourceProj.getUnits() == Units_default.TILE_PIXELS ? function(inCoordinates, outCoordinates, stride) {
        var pixelExtent = sourceProj.getExtent();
        var projectedExtent = sourceProj.getWorldExtent();
        var scale5 = getHeight(projectedExtent) / getHeight(pixelExtent);
        compose2(tmpTransform, projectedExtent[0], projectedExtent[3], scale5, -scale5, 0, 0, 0);
        transform2D(inCoordinates, 0, inCoordinates.length, stride, tmpTransform, outCoordinates);
        return getTransform(sourceProj, destination)(inCoordinates, outCoordinates, stride);
      } : getTransform(sourceProj, destination);
      this.applyTransform(transformFn);
      return this;
    };
    return Geometry2;
  }(Object_default)
);
var Geometry_default = Geometry;

// node_modules/ol/geom/GeometryLayout.js
var GeometryLayout_default = {
  XY: "XY",
  XYZ: "XYZ",
  XYM: "XYM",
  XYZM: "XYZM"
};

// node_modules/ol/geom/SimpleGeometry.js
var __extends27 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var SimpleGeometry = (
  /** @class */
  function(_super) {
    __extends27(SimpleGeometry2, _super);
    function SimpleGeometry2() {
      var _this = _super.call(this) || this;
      _this.layout = GeometryLayout_default.XY;
      _this.stride = 2;
      _this.flatCoordinates = null;
      return _this;
    }
    SimpleGeometry2.prototype.computeExtent = function(extent) {
      return createOrUpdateFromFlatCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);
    };
    SimpleGeometry2.prototype.getCoordinates = function() {
      return abstract();
    };
    SimpleGeometry2.prototype.getFirstCoordinate = function() {
      return this.flatCoordinates.slice(0, this.stride);
    };
    SimpleGeometry2.prototype.getFlatCoordinates = function() {
      return this.flatCoordinates;
    };
    SimpleGeometry2.prototype.getLastCoordinate = function() {
      return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);
    };
    SimpleGeometry2.prototype.getLayout = function() {
      return this.layout;
    };
    SimpleGeometry2.prototype.getSimplifiedGeometry = function(squaredTolerance) {
      if (this.simplifiedGeometryRevision !== this.getRevision()) {
        this.simplifiedGeometryMaxMinSquaredTolerance = 0;
        this.simplifiedGeometryRevision = this.getRevision();
      }
      if (squaredTolerance < 0 || this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance) {
        return this;
      }
      var simplifiedGeometry = this.getSimplifiedGeometryInternal(squaredTolerance);
      var simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();
      if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {
        return simplifiedGeometry;
      } else {
        this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;
        return this;
      }
    };
    SimpleGeometry2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      return this;
    };
    SimpleGeometry2.prototype.getStride = function() {
      return this.stride;
    };
    SimpleGeometry2.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
      this.stride = getStrideForLayout(layout);
      this.layout = layout;
      this.flatCoordinates = flatCoordinates;
    };
    SimpleGeometry2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      abstract();
    };
    SimpleGeometry2.prototype.setLayout = function(layout, coordinates2, nesting) {
      var stride;
      if (layout) {
        stride = getStrideForLayout(layout);
      } else {
        for (var i2 = 0; i2 < nesting; ++i2) {
          if (coordinates2.length === 0) {
            this.layout = GeometryLayout_default.XY;
            this.stride = 2;
            return;
          } else {
            coordinates2 = /** @type {Array} */
            coordinates2[0];
          }
        }
        stride = coordinates2.length;
        layout = getLayoutForStride(stride);
      }
      this.layout = layout;
      this.stride = stride;
    };
    SimpleGeometry2.prototype.applyTransform = function(transformFn) {
      if (this.flatCoordinates) {
        transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);
        this.changed();
      }
    };
    SimpleGeometry2.prototype.rotate = function(angle, anchor2) {
      var flatCoordinates = this.getFlatCoordinates();
      if (flatCoordinates) {
        var stride = this.getStride();
        rotate2(flatCoordinates, 0, flatCoordinates.length, stride, angle, anchor2, flatCoordinates);
        this.changed();
      }
    };
    SimpleGeometry2.prototype.scale = function(sx, opt_sy, opt_anchor) {
      var sy = opt_sy;
      if (sy === void 0) {
        sy = sx;
      }
      var anchor2 = opt_anchor;
      if (!anchor2) {
        anchor2 = getCenter(this.getExtent());
      }
      var flatCoordinates = this.getFlatCoordinates();
      if (flatCoordinates) {
        var stride = this.getStride();
        scale3(flatCoordinates, 0, flatCoordinates.length, stride, sx, sy, anchor2, flatCoordinates);
        this.changed();
      }
    };
    SimpleGeometry2.prototype.translate = function(deltaX, deltaY) {
      var flatCoordinates = this.getFlatCoordinates();
      if (flatCoordinates) {
        var stride = this.getStride();
        translate2(flatCoordinates, 0, flatCoordinates.length, stride, deltaX, deltaY, flatCoordinates);
        this.changed();
      }
    };
    return SimpleGeometry2;
  }(Geometry_default)
);
function getLayoutForStride(stride) {
  var layout;
  if (stride == 2) {
    layout = GeometryLayout_default.XY;
  } else if (stride == 3) {
    layout = GeometryLayout_default.XYZ;
  } else if (stride == 4) {
    layout = GeometryLayout_default.XYZM;
  }
  return (
    /** @type {import("./GeometryLayout.js").default} */
    layout
  );
}
function getStrideForLayout(layout) {
  var stride;
  if (layout == GeometryLayout_default.XY) {
    stride = 2;
  } else if (layout == GeometryLayout_default.XYZ || layout == GeometryLayout_default.XYM) {
    stride = 3;
  } else if (layout == GeometryLayout_default.XYZM) {
    stride = 4;
  }
  return (
    /** @type {number} */
    stride
  );
}
function transformGeom2D(simpleGeometry, transform3, opt_dest) {
  var flatCoordinates = simpleGeometry.getFlatCoordinates();
  if (!flatCoordinates) {
    return null;
  } else {
    var stride = simpleGeometry.getStride();
    return transform2D(flatCoordinates, 0, flatCoordinates.length, stride, transform3, opt_dest);
  }
}
var SimpleGeometry_default = SimpleGeometry;

// node_modules/ol/render/canvas/Immediate.js
var __extends28 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasImmediateRenderer = (
  /** @class */
  function(_super) {
    __extends28(CanvasImmediateRenderer2, _super);
    function CanvasImmediateRenderer2(context2, pixelRatio, extent, transform3, viewRotation, opt_squaredTolerance, opt_userTransform) {
      var _this = _super.call(this) || this;
      _this.context_ = context2;
      _this.pixelRatio_ = pixelRatio;
      _this.extent_ = extent;
      _this.transform_ = transform3;
      _this.viewRotation_ = viewRotation;
      _this.squaredTolerance_ = opt_squaredTolerance;
      _this.userTransform_ = opt_userTransform;
      _this.contextFillState_ = null;
      _this.contextStrokeState_ = null;
      _this.contextTextState_ = null;
      _this.fillState_ = null;
      _this.strokeState_ = null;
      _this.image_ = null;
      _this.imageAnchorX_ = 0;
      _this.imageAnchorY_ = 0;
      _this.imageHeight_ = 0;
      _this.imageOpacity_ = 0;
      _this.imageOriginX_ = 0;
      _this.imageOriginY_ = 0;
      _this.imageRotateWithView_ = false;
      _this.imageRotation_ = 0;
      _this.imageScale_ = [0, 0];
      _this.imageWidth_ = 0;
      _this.text_ = "";
      _this.textOffsetX_ = 0;
      _this.textOffsetY_ = 0;
      _this.textRotateWithView_ = false;
      _this.textRotation_ = 0;
      _this.textScale_ = [0, 0];
      _this.textFillState_ = null;
      _this.textStrokeState_ = null;
      _this.textState_ = null;
      _this.pixelCoordinates_ = [];
      _this.tmpLocalTransform_ = create();
      return _this;
    }
    CanvasImmediateRenderer2.prototype.drawImages_ = function(flatCoordinates, offset2, end, stride) {
      if (!this.image_) {
        return;
      }
      var pixelCoordinates = transform2D(flatCoordinates, offset2, end, stride, this.transform_, this.pixelCoordinates_);
      var context2 = this.context_;
      var localTransform = this.tmpLocalTransform_;
      var alpha = context2.globalAlpha;
      if (this.imageOpacity_ != 1) {
        context2.globalAlpha = alpha * this.imageOpacity_;
      }
      var rotation = this.imageRotation_;
      if (this.imageRotateWithView_) {
        rotation += this.viewRotation_;
      }
      for (var i2 = 0, ii = pixelCoordinates.length; i2 < ii; i2 += 2) {
        var x = pixelCoordinates[i2] - this.imageAnchorX_;
        var y = pixelCoordinates[i2 + 1] - this.imageAnchorY_;
        if (rotation !== 0 || this.imageScale_[0] != 1 || this.imageScale_[1] != 1) {
          var centerX = x + this.imageAnchorX_;
          var centerY = y + this.imageAnchorY_;
          compose2(localTransform, centerX, centerY, 1, 1, rotation, -centerX, -centerY);
          context2.setTransform.apply(context2, localTransform);
          context2.translate(centerX, centerY);
          context2.scale(this.imageScale_[0], this.imageScale_[1]);
          context2.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, -this.imageAnchorX_, -this.imageAnchorY_, this.imageWidth_, this.imageHeight_);
          context2.setTransform(1, 0, 0, 1, 0, 0);
        } else {
          context2.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, x, y, this.imageWidth_, this.imageHeight_);
        }
      }
      if (this.imageOpacity_ != 1) {
        context2.globalAlpha = alpha;
      }
    };
    CanvasImmediateRenderer2.prototype.drawText_ = function(flatCoordinates, offset2, end, stride) {
      if (!this.textState_ || this.text_ === "") {
        return;
      }
      if (this.textFillState_) {
        this.setContextFillState_(this.textFillState_);
      }
      if (this.textStrokeState_) {
        this.setContextStrokeState_(this.textStrokeState_);
      }
      this.setContextTextState_(this.textState_);
      var pixelCoordinates = transform2D(flatCoordinates, offset2, end, stride, this.transform_, this.pixelCoordinates_);
      var context2 = this.context_;
      var rotation = this.textRotation_;
      if (this.textRotateWithView_) {
        rotation += this.viewRotation_;
      }
      for (; offset2 < end; offset2 += stride) {
        var x = pixelCoordinates[offset2] + this.textOffsetX_;
        var y = pixelCoordinates[offset2 + 1] + this.textOffsetY_;
        if (rotation !== 0 || this.textScale_[0] != 1 || this.textScale_[1] != 1) {
          var localTransform = compose2(this.tmpLocalTransform_, x, y, 1, 1, rotation, -x, -y);
          context2.setTransform.apply(context2, localTransform);
          context2.translate(x, y);
          context2.scale(this.textScale_[0], this.textScale_[1]);
          if (this.textStrokeState_) {
            context2.strokeText(this.text_, 0, 0);
          }
          if (this.textFillState_) {
            context2.fillText(this.text_, 0, 0);
          }
          context2.setTransform(1, 0, 0, 1, 0, 0);
        } else {
          if (this.textStrokeState_) {
            context2.strokeText(this.text_, x, y);
          }
          if (this.textFillState_) {
            context2.fillText(this.text_, x, y);
          }
        }
      }
    };
    CanvasImmediateRenderer2.prototype.moveToLineTo_ = function(flatCoordinates, offset2, end, stride, close) {
      var context2 = this.context_;
      var pixelCoordinates = transform2D(flatCoordinates, offset2, end, stride, this.transform_, this.pixelCoordinates_);
      context2.moveTo(pixelCoordinates[0], pixelCoordinates[1]);
      var length = pixelCoordinates.length;
      if (close) {
        length -= 2;
      }
      for (var i2 = 2; i2 < length; i2 += 2) {
        context2.lineTo(pixelCoordinates[i2], pixelCoordinates[i2 + 1]);
      }
      if (close) {
        context2.closePath();
      }
      return end;
    };
    CanvasImmediateRenderer2.prototype.drawRings_ = function(flatCoordinates, offset2, ends, stride) {
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        offset2 = this.moveToLineTo_(flatCoordinates, offset2, ends[i2], stride, true);
      }
      return offset2;
    };
    CanvasImmediateRenderer2.prototype.drawCircle = function(geometry2) {
      if (!intersects(this.extent_, geometry2.getExtent())) {
        return;
      }
      if (this.fillState_ || this.strokeState_) {
        if (this.fillState_) {
          this.setContextFillState_(this.fillState_);
        }
        if (this.strokeState_) {
          this.setContextStrokeState_(this.strokeState_);
        }
        var pixelCoordinates = transformGeom2D(geometry2, this.transform_, this.pixelCoordinates_);
        var dx = pixelCoordinates[2] - pixelCoordinates[0];
        var dy = pixelCoordinates[3] - pixelCoordinates[1];
        var radius = Math.sqrt(dx * dx + dy * dy);
        var context2 = this.context_;
        context2.beginPath();
        context2.arc(pixelCoordinates[0], pixelCoordinates[1], radius, 0, 2 * Math.PI);
        if (this.fillState_) {
          context2.fill();
        }
        if (this.strokeState_) {
          context2.stroke();
        }
      }
      if (this.text_ !== "") {
        this.drawText_(geometry2.getCenter(), 0, 2, 2);
      }
    };
    CanvasImmediateRenderer2.prototype.setStyle = function(style2) {
      this.setFillStrokeStyle(style2.getFill(), style2.getStroke());
      this.setImageStyle(style2.getImage());
      this.setTextStyle(style2.getText());
    };
    CanvasImmediateRenderer2.prototype.setTransform = function(transform3) {
      this.transform_ = transform3;
    };
    CanvasImmediateRenderer2.prototype.drawGeometry = function(geometry2) {
      var type = geometry2.getType();
      switch (type) {
        case "Point":
          this.drawPoint(
            /** @type {import("../../geom/Point.js").default} */
            geometry2
          );
          break;
        case "LineString":
          this.drawLineString(
            /** @type {import("../../geom/LineString.js").default} */
            geometry2
          );
          break;
        case "Polygon":
          this.drawPolygon(
            /** @type {import("../../geom/Polygon.js").default} */
            geometry2
          );
          break;
        case "MultiPoint":
          this.drawMultiPoint(
            /** @type {import("../../geom/MultiPoint.js").default} */
            geometry2
          );
          break;
        case "MultiLineString":
          this.drawMultiLineString(
            /** @type {import("../../geom/MultiLineString.js").default} */
            geometry2
          );
          break;
        case "MultiPolygon":
          this.drawMultiPolygon(
            /** @type {import("../../geom/MultiPolygon.js").default} */
            geometry2
          );
          break;
        case "GeometryCollection":
          this.drawGeometryCollection(
            /** @type {import("../../geom/GeometryCollection.js").default} */
            geometry2
          );
          break;
        case "Circle":
          this.drawCircle(
            /** @type {import("../../geom/Circle.js").default} */
            geometry2
          );
          break;
        default:
      }
    };
    CanvasImmediateRenderer2.prototype.drawFeature = function(feature, style2) {
      var geometry2 = style2.getGeometryFunction()(feature);
      if (!geometry2 || !intersects(this.extent_, geometry2.getExtent())) {
        return;
      }
      this.setStyle(style2);
      this.drawGeometry(geometry2);
    };
    CanvasImmediateRenderer2.prototype.drawGeometryCollection = function(geometry2) {
      var geometries = geometry2.getGeometriesArray();
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        this.drawGeometry(geometries[i2]);
      }
    };
    CanvasImmediateRenderer2.prototype.drawPoint = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/Point.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      var flatCoordinates = geometry2.getFlatCoordinates();
      var stride = geometry2.getStride();
      if (this.image_) {
        this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);
      }
      if (this.text_ !== "") {
        this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);
      }
    };
    CanvasImmediateRenderer2.prototype.drawMultiPoint = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/MultiPoint.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      var flatCoordinates = geometry2.getFlatCoordinates();
      var stride = geometry2.getStride();
      if (this.image_) {
        this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);
      }
      if (this.text_ !== "") {
        this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);
      }
    };
    CanvasImmediateRenderer2.prototype.drawLineString = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/LineString.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      if (!intersects(this.extent_, geometry2.getExtent())) {
        return;
      }
      if (this.strokeState_) {
        this.setContextStrokeState_(this.strokeState_);
        var context2 = this.context_;
        var flatCoordinates = geometry2.getFlatCoordinates();
        context2.beginPath();
        this.moveToLineTo_(flatCoordinates, 0, flatCoordinates.length, geometry2.getStride(), false);
        context2.stroke();
      }
      if (this.text_ !== "") {
        var flatMidpoint = geometry2.getFlatMidpoint();
        this.drawText_(flatMidpoint, 0, 2, 2);
      }
    };
    CanvasImmediateRenderer2.prototype.drawMultiLineString = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/MultiLineString.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      var geometryExtent = geometry2.getExtent();
      if (!intersects(this.extent_, geometryExtent)) {
        return;
      }
      if (this.strokeState_) {
        this.setContextStrokeState_(this.strokeState_);
        var context2 = this.context_;
        var flatCoordinates = geometry2.getFlatCoordinates();
        var offset2 = 0;
        var ends = (
          /** @type {Array<number>} */
          geometry2.getEnds()
        );
        var stride = geometry2.getStride();
        context2.beginPath();
        for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
          offset2 = this.moveToLineTo_(flatCoordinates, offset2, ends[i2], stride, false);
        }
        context2.stroke();
      }
      if (this.text_ !== "") {
        var flatMidpoints = geometry2.getFlatMidpoints();
        this.drawText_(flatMidpoints, 0, flatMidpoints.length, 2);
      }
    };
    CanvasImmediateRenderer2.prototype.drawPolygon = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/Polygon.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      if (!intersects(this.extent_, geometry2.getExtent())) {
        return;
      }
      if (this.strokeState_ || this.fillState_) {
        if (this.fillState_) {
          this.setContextFillState_(this.fillState_);
        }
        if (this.strokeState_) {
          this.setContextStrokeState_(this.strokeState_);
        }
        var context2 = this.context_;
        context2.beginPath();
        this.drawRings_(
          geometry2.getOrientedFlatCoordinates(),
          0,
          /** @type {Array<number>} */
          geometry2.getEnds(),
          geometry2.getStride()
        );
        if (this.fillState_) {
          context2.fill();
        }
        if (this.strokeState_) {
          context2.stroke();
        }
      }
      if (this.text_ !== "") {
        var flatInteriorPoint = geometry2.getFlatInteriorPoint();
        this.drawText_(flatInteriorPoint, 0, 2, 2);
      }
    };
    CanvasImmediateRenderer2.prototype.drawMultiPolygon = function(geometry2) {
      if (this.squaredTolerance_) {
        geometry2 = /** @type {import("../../geom/MultiPolygon.js").default} */
        geometry2.simplifyTransformed(this.squaredTolerance_, this.userTransform_);
      }
      if (!intersects(this.extent_, geometry2.getExtent())) {
        return;
      }
      if (this.strokeState_ || this.fillState_) {
        if (this.fillState_) {
          this.setContextFillState_(this.fillState_);
        }
        if (this.strokeState_) {
          this.setContextStrokeState_(this.strokeState_);
        }
        var context2 = this.context_;
        var flatCoordinates = geometry2.getOrientedFlatCoordinates();
        var offset2 = 0;
        var endss = geometry2.getEndss();
        var stride = geometry2.getStride();
        context2.beginPath();
        for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
          var ends = endss[i2];
          offset2 = this.drawRings_(flatCoordinates, offset2, ends, stride);
        }
        if (this.fillState_) {
          context2.fill();
        }
        if (this.strokeState_) {
          context2.stroke();
        }
      }
      if (this.text_ !== "") {
        var flatInteriorPoints = geometry2.getFlatInteriorPoints();
        this.drawText_(flatInteriorPoints, 0, flatInteriorPoints.length, 2);
      }
    };
    CanvasImmediateRenderer2.prototype.setContextFillState_ = function(fillState) {
      var context2 = this.context_;
      var contextFillState = this.contextFillState_;
      if (!contextFillState) {
        context2.fillStyle = fillState.fillStyle;
        this.contextFillState_ = {
          fillStyle: fillState.fillStyle
        };
      } else {
        if (contextFillState.fillStyle != fillState.fillStyle) {
          contextFillState.fillStyle = fillState.fillStyle;
          context2.fillStyle = fillState.fillStyle;
        }
      }
    };
    CanvasImmediateRenderer2.prototype.setContextStrokeState_ = function(strokeState) {
      var context2 = this.context_;
      var contextStrokeState = this.contextStrokeState_;
      if (!contextStrokeState) {
        context2.lineCap = strokeState.lineCap;
        if (context2.setLineDash) {
          context2.setLineDash(strokeState.lineDash);
          context2.lineDashOffset = strokeState.lineDashOffset;
        }
        context2.lineJoin = strokeState.lineJoin;
        context2.lineWidth = strokeState.lineWidth;
        context2.miterLimit = strokeState.miterLimit;
        context2.strokeStyle = strokeState.strokeStyle;
        this.contextStrokeState_ = {
          lineCap: strokeState.lineCap,
          lineDash: strokeState.lineDash,
          lineDashOffset: strokeState.lineDashOffset,
          lineJoin: strokeState.lineJoin,
          lineWidth: strokeState.lineWidth,
          miterLimit: strokeState.miterLimit,
          strokeStyle: strokeState.strokeStyle
        };
      } else {
        if (contextStrokeState.lineCap != strokeState.lineCap) {
          contextStrokeState.lineCap = strokeState.lineCap;
          context2.lineCap = strokeState.lineCap;
        }
        if (context2.setLineDash) {
          if (!equals(contextStrokeState.lineDash, strokeState.lineDash)) {
            context2.setLineDash(contextStrokeState.lineDash = strokeState.lineDash);
          }
          if (contextStrokeState.lineDashOffset != strokeState.lineDashOffset) {
            contextStrokeState.lineDashOffset = strokeState.lineDashOffset;
            context2.lineDashOffset = strokeState.lineDashOffset;
          }
        }
        if (contextStrokeState.lineJoin != strokeState.lineJoin) {
          contextStrokeState.lineJoin = strokeState.lineJoin;
          context2.lineJoin = strokeState.lineJoin;
        }
        if (contextStrokeState.lineWidth != strokeState.lineWidth) {
          contextStrokeState.lineWidth = strokeState.lineWidth;
          context2.lineWidth = strokeState.lineWidth;
        }
        if (contextStrokeState.miterLimit != strokeState.miterLimit) {
          contextStrokeState.miterLimit = strokeState.miterLimit;
          context2.miterLimit = strokeState.miterLimit;
        }
        if (contextStrokeState.strokeStyle != strokeState.strokeStyle) {
          contextStrokeState.strokeStyle = strokeState.strokeStyle;
          context2.strokeStyle = strokeState.strokeStyle;
        }
      }
    };
    CanvasImmediateRenderer2.prototype.setContextTextState_ = function(textState) {
      var context2 = this.context_;
      var contextTextState = this.contextTextState_;
      var textAlign = textState.textAlign ? textState.textAlign : defaultTextAlign;
      if (!contextTextState) {
        context2.font = textState.font;
        context2.textAlign = /** @type {CanvasTextAlign} */
        textAlign;
        context2.textBaseline = /** @type {CanvasTextBaseline} */
        textState.textBaseline;
        this.contextTextState_ = {
          font: textState.font,
          textAlign,
          textBaseline: textState.textBaseline
        };
      } else {
        if (contextTextState.font != textState.font) {
          contextTextState.font = textState.font;
          context2.font = textState.font;
        }
        if (contextTextState.textAlign != textAlign) {
          contextTextState.textAlign = /** @type {CanvasTextAlign} */
          textAlign;
          context2.textAlign = /** @type {CanvasTextAlign} */
          textAlign;
        }
        if (contextTextState.textBaseline != textState.textBaseline) {
          contextTextState.textBaseline = /** @type {CanvasTextBaseline} */
          textState.textBaseline;
          context2.textBaseline = /** @type {CanvasTextBaseline} */
          textState.textBaseline;
        }
      }
    };
    CanvasImmediateRenderer2.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
      var _this = this;
      if (!fillStyle) {
        this.fillState_ = null;
      } else {
        var fillStyleColor = fillStyle.getColor();
        this.fillState_ = {
          fillStyle: asColorLike(fillStyleColor ? fillStyleColor : defaultFillStyle)
        };
      }
      if (!strokeStyle) {
        this.strokeState_ = null;
      } else {
        var strokeStyleColor = strokeStyle.getColor();
        var strokeStyleLineCap = strokeStyle.getLineCap();
        var strokeStyleLineDash = strokeStyle.getLineDash();
        var strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();
        var strokeStyleLineJoin = strokeStyle.getLineJoin();
        var strokeStyleWidth = strokeStyle.getWidth();
        var strokeStyleMiterLimit = strokeStyle.getMiterLimit();
        var lineDash = strokeStyleLineDash ? strokeStyleLineDash : defaultLineDash;
        this.strokeState_ = {
          lineCap: strokeStyleLineCap !== void 0 ? strokeStyleLineCap : defaultLineCap,
          lineDash: this.pixelRatio_ === 1 ? lineDash : lineDash.map(function(n) {
            return n * _this.pixelRatio_;
          }),
          lineDashOffset: (strokeStyleLineDashOffset ? strokeStyleLineDashOffset : defaultLineDashOffset) * this.pixelRatio_,
          lineJoin: strokeStyleLineJoin !== void 0 ? strokeStyleLineJoin : defaultLineJoin,
          lineWidth: (strokeStyleWidth !== void 0 ? strokeStyleWidth : defaultLineWidth) * this.pixelRatio_,
          miterLimit: strokeStyleMiterLimit !== void 0 ? strokeStyleMiterLimit : defaultMiterLimit,
          strokeStyle: asColorLike(strokeStyleColor ? strokeStyleColor : defaultStrokeStyle)
        };
      }
    };
    CanvasImmediateRenderer2.prototype.setImageStyle = function(imageStyle) {
      var imageSize;
      if (!imageStyle || !(imageSize = imageStyle.getSize())) {
        this.image_ = null;
        return;
      }
      var imageAnchor = imageStyle.getAnchor();
      var imageOrigin = imageStyle.getOrigin();
      this.image_ = imageStyle.getImage(this.pixelRatio_);
      this.imageAnchorX_ = imageAnchor[0] * this.pixelRatio_;
      this.imageAnchorY_ = imageAnchor[1] * this.pixelRatio_;
      this.imageHeight_ = imageSize[1] * this.pixelRatio_;
      this.imageOpacity_ = imageStyle.getOpacity();
      this.imageOriginX_ = imageOrigin[0];
      this.imageOriginY_ = imageOrigin[1];
      this.imageRotateWithView_ = imageStyle.getRotateWithView();
      this.imageRotation_ = imageStyle.getRotation();
      this.imageScale_ = imageStyle.getScaleArray();
      this.imageWidth_ = imageSize[0] * this.pixelRatio_;
    };
    CanvasImmediateRenderer2.prototype.setTextStyle = function(textStyle) {
      if (!textStyle) {
        this.text_ = "";
      } else {
        var textFillStyle = textStyle.getFill();
        if (!textFillStyle) {
          this.textFillState_ = null;
        } else {
          var textFillStyleColor = textFillStyle.getColor();
          this.textFillState_ = {
            fillStyle: asColorLike(textFillStyleColor ? textFillStyleColor : defaultFillStyle)
          };
        }
        var textStrokeStyle = textStyle.getStroke();
        if (!textStrokeStyle) {
          this.textStrokeState_ = null;
        } else {
          var textStrokeStyleColor = textStrokeStyle.getColor();
          var textStrokeStyleLineCap = textStrokeStyle.getLineCap();
          var textStrokeStyleLineDash = textStrokeStyle.getLineDash();
          var textStrokeStyleLineDashOffset = textStrokeStyle.getLineDashOffset();
          var textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();
          var textStrokeStyleWidth = textStrokeStyle.getWidth();
          var textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();
          this.textStrokeState_ = {
            lineCap: textStrokeStyleLineCap !== void 0 ? textStrokeStyleLineCap : defaultLineCap,
            lineDash: textStrokeStyleLineDash ? textStrokeStyleLineDash : defaultLineDash,
            lineDashOffset: textStrokeStyleLineDashOffset ? textStrokeStyleLineDashOffset : defaultLineDashOffset,
            lineJoin: textStrokeStyleLineJoin !== void 0 ? textStrokeStyleLineJoin : defaultLineJoin,
            lineWidth: textStrokeStyleWidth !== void 0 ? textStrokeStyleWidth : defaultLineWidth,
            miterLimit: textStrokeStyleMiterLimit !== void 0 ? textStrokeStyleMiterLimit : defaultMiterLimit,
            strokeStyle: asColorLike(textStrokeStyleColor ? textStrokeStyleColor : defaultStrokeStyle)
          };
        }
        var textFont = textStyle.getFont();
        var textOffsetX = textStyle.getOffsetX();
        var textOffsetY = textStyle.getOffsetY();
        var textRotateWithView = textStyle.getRotateWithView();
        var textRotation = textStyle.getRotation();
        var textScale = textStyle.getScaleArray();
        var textText = textStyle.getText();
        var textTextAlign = textStyle.getTextAlign();
        var textTextBaseline = textStyle.getTextBaseline();
        this.textState_ = {
          font: textFont !== void 0 ? textFont : defaultFont,
          textAlign: textTextAlign !== void 0 ? textTextAlign : defaultTextAlign,
          textBaseline: textTextBaseline !== void 0 ? textTextBaseline : defaultTextBaseline
        };
        this.text_ = textText !== void 0 ? Array.isArray(textText) ? textText.reduce(function(acc, t, i2) {
          return acc += i2 % 2 ? " " : t;
        }, "") : textText : "";
        this.textOffsetX_ = textOffsetX !== void 0 ? this.pixelRatio_ * textOffsetX : 0;
        this.textOffsetY_ = textOffsetY !== void 0 ? this.pixelRatio_ * textOffsetY : 0;
        this.textRotateWithView_ = textRotateWithView !== void 0 ? textRotateWithView : false;
        this.textRotation_ = textRotation !== void 0 ? textRotation : 0;
        this.textScale_ = [
          this.pixelRatio_ * textScale[0],
          this.pixelRatio_ * textScale[1]
        ];
      }
    };
    return CanvasImmediateRenderer2;
  }(VectorContext_default)
);
var Immediate_default = CanvasImmediateRenderer;

// node_modules/ol/style/IconAnchorUnits.js
var IconAnchorUnits_default = {
  /**
   * Anchor is a fraction
   * @api
   */
  FRACTION: "fraction",
  /**
   * Anchor is in pixels
   * @api
   */
  PIXELS: "pixels"
};

// node_modules/ol/style/IconOrigin.js
var IconOrigin_default = {
  /**
   * Origin is at bottom left
   * @api
   */
  BOTTOM_LEFT: "bottom-left",
  /**
   * Origin is at bottom right
   * @api
   */
  BOTTOM_RIGHT: "bottom-right",
  /**
   * Origin is at top left
   * @api
   */
  TOP_LEFT: "top-left",
  /**
   * Origin is at top right
   * @api
   */
  TOP_RIGHT: "top-right"
};

// node_modules/ol/style/IconImageCache.js
var IconImageCache = (
  /** @class */
  function() {
    function IconImageCache2() {
      this.cache_ = {};
      this.cacheSize_ = 0;
      this.maxCacheSize_ = 32;
    }
    IconImageCache2.prototype.clear = function() {
      this.cache_ = {};
      this.cacheSize_ = 0;
    };
    IconImageCache2.prototype.canExpireCache = function() {
      return this.cacheSize_ > this.maxCacheSize_;
    };
    IconImageCache2.prototype.expire = function() {
      if (this.canExpireCache()) {
        var i2 = 0;
        for (var key in this.cache_) {
          var iconImage = this.cache_[key];
          if ((i2++ & 3) === 0 && !iconImage.hasListener()) {
            delete this.cache_[key];
            --this.cacheSize_;
          }
        }
      }
    };
    IconImageCache2.prototype.get = function(src, crossOrigin, color2) {
      var key = getKey2(src, crossOrigin, color2);
      return key in this.cache_ ? this.cache_[key] : null;
    };
    IconImageCache2.prototype.set = function(src, crossOrigin, color2, iconImage) {
      var key = getKey2(src, crossOrigin, color2);
      this.cache_[key] = iconImage;
      ++this.cacheSize_;
    };
    IconImageCache2.prototype.setSize = function(maxCacheSize) {
      this.maxCacheSize_ = maxCacheSize;
      this.expire();
    };
    return IconImageCache2;
  }()
);
function getKey2(src, crossOrigin, color2) {
  var colorString = color2 ? asString(color2) : "null";
  return crossOrigin + ":" + src + ":" + colorString;
}
var shared = new IconImageCache();

// node_modules/ol/style/IconImage.js
var __extends29 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var taintedTestContext = null;
var IconImage = (
  /** @class */
  function(_super) {
    __extends29(IconImage2, _super);
    function IconImage2(image, src, size, crossOrigin, imageState, color2) {
      var _this = _super.call(this) || this;
      _this.hitDetectionImage_ = null;
      _this.image_ = !image ? new Image() : image;
      if (crossOrigin !== null) {
        _this.image_.crossOrigin = crossOrigin;
      }
      _this.canvas_ = {};
      _this.color_ = color2;
      _this.unlisten_ = null;
      _this.imageState_ = imageState;
      _this.size_ = size;
      _this.src_ = src;
      _this.tainted_;
      return _this;
    }
    IconImage2.prototype.isTainted_ = function() {
      if (this.tainted_ === void 0 && this.imageState_ === ImageState_default.LOADED) {
        if (!taintedTestContext) {
          taintedTestContext = createCanvasContext2D(1, 1);
        }
        taintedTestContext.drawImage(this.image_, 0, 0);
        try {
          taintedTestContext.getImageData(0, 0, 1, 1);
          this.tainted_ = false;
        } catch (e) {
          taintedTestContext = null;
          this.tainted_ = true;
        }
      }
      return this.tainted_ === true;
    };
    IconImage2.prototype.dispatchChangeEvent_ = function() {
      this.dispatchEvent(EventType_default.CHANGE);
    };
    IconImage2.prototype.handleImageError_ = function() {
      this.imageState_ = ImageState_default.ERROR;
      this.unlistenImage_();
      this.dispatchChangeEvent_();
    };
    IconImage2.prototype.handleImageLoad_ = function() {
      this.imageState_ = ImageState_default.LOADED;
      if (this.size_) {
        this.image_.width = this.size_[0];
        this.image_.height = this.size_[1];
      } else {
        this.size_ = [this.image_.width, this.image_.height];
      }
      this.unlistenImage_();
      this.dispatchChangeEvent_();
    };
    IconImage2.prototype.getImage = function(pixelRatio) {
      this.replaceColor_(pixelRatio);
      return this.canvas_[pixelRatio] ? this.canvas_[pixelRatio] : this.image_;
    };
    IconImage2.prototype.getPixelRatio = function(pixelRatio) {
      this.replaceColor_(pixelRatio);
      return this.canvas_[pixelRatio] ? pixelRatio : 1;
    };
    IconImage2.prototype.getImageState = function() {
      return this.imageState_;
    };
    IconImage2.prototype.getHitDetectionImage = function() {
      if (!this.hitDetectionImage_) {
        if (this.isTainted_()) {
          var width = this.size_[0];
          var height = this.size_[1];
          var context2 = createCanvasContext2D(width, height);
          context2.fillRect(0, 0, width, height);
          this.hitDetectionImage_ = context2.canvas;
        } else {
          this.hitDetectionImage_ = this.image_;
        }
      }
      return this.hitDetectionImage_;
    };
    IconImage2.prototype.getSize = function() {
      return this.size_;
    };
    IconImage2.prototype.getSrc = function() {
      return this.src_;
    };
    IconImage2.prototype.load = function() {
      if (this.imageState_ == ImageState_default.IDLE) {
        this.imageState_ = ImageState_default.LOADING;
        try {
          this.image_.src = this.src_;
        } catch (e) {
          this.handleImageError_();
        }
        this.unlisten_ = listenImage(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this));
      }
    };
    IconImage2.prototype.replaceColor_ = function(pixelRatio) {
      if (!this.color_ || this.canvas_[pixelRatio] || this.imageState_ !== ImageState_default.LOADED) {
        return;
      }
      var canvas = document.createElement("canvas");
      this.canvas_[pixelRatio] = canvas;
      canvas.width = Math.ceil(this.image_.width * pixelRatio);
      canvas.height = Math.ceil(this.image_.height * pixelRatio);
      var ctx = canvas.getContext("2d");
      ctx.scale(pixelRatio, pixelRatio);
      ctx.drawImage(this.image_, 0, 0);
      ctx.globalCompositeOperation = "multiply";
      if (ctx.globalCompositeOperation === "multiply" || this.isTainted_()) {
        ctx.fillStyle = asString(this.color_);
        ctx.fillRect(0, 0, canvas.width / pixelRatio, canvas.height / pixelRatio);
        ctx.globalCompositeOperation = "destination-in";
        ctx.drawImage(this.image_, 0, 0);
      } else {
        var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
        var data = imgData.data;
        var r = this.color_[0] / 255;
        var g = this.color_[1] / 255;
        var b = this.color_[2] / 255;
        var a = this.color_[3];
        for (var i2 = 0, ii = data.length; i2 < ii; i2 += 4) {
          data[i2] *= r;
          data[i2 + 1] *= g;
          data[i2 + 2] *= b;
          data[i2 + 3] *= a;
        }
        ctx.putImageData(imgData, 0, 0);
      }
    };
    IconImage2.prototype.unlistenImage_ = function() {
      if (this.unlisten_) {
        this.unlisten_();
        this.unlisten_ = null;
      }
    };
    return IconImage2;
  }(Target_default)
);
function get4(image, src, size, crossOrigin, imageState, color2) {
  var iconImage = shared.get(src, crossOrigin, color2);
  if (!iconImage) {
    iconImage = new IconImage(image, src, size, crossOrigin, imageState, color2);
    shared.set(src, crossOrigin, color2, iconImage);
  }
  return iconImage;
}

// node_modules/ol/style/Icon.js
var __extends30 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Icon = (
  /** @class */
  function(_super) {
    __extends30(Icon2, _super);
    function Icon2(opt_options) {
      var _this = this;
      var options = opt_options || {};
      var opacity = options.opacity !== void 0 ? options.opacity : 1;
      var rotation = options.rotation !== void 0 ? options.rotation : 0;
      var scale5 = options.scale !== void 0 ? options.scale : 1;
      var rotateWithView = options.rotateWithView !== void 0 ? options.rotateWithView : false;
      _this = _super.call(this, {
        opacity,
        rotation,
        scale: scale5,
        displacement: options.displacement !== void 0 ? options.displacement : [0, 0],
        rotateWithView,
        declutterMode: options.declutterMode
      }) || this;
      _this.anchor_ = options.anchor !== void 0 ? options.anchor : [0.5, 0.5];
      _this.normalizedAnchor_ = null;
      _this.anchorOrigin_ = options.anchorOrigin !== void 0 ? options.anchorOrigin : IconOrigin_default.TOP_LEFT;
      _this.anchorXUnits_ = options.anchorXUnits !== void 0 ? options.anchorXUnits : IconAnchorUnits_default.FRACTION;
      _this.anchorYUnits_ = options.anchorYUnits !== void 0 ? options.anchorYUnits : IconAnchorUnits_default.FRACTION;
      _this.crossOrigin_ = options.crossOrigin !== void 0 ? options.crossOrigin : null;
      var image = options.img !== void 0 ? options.img : null;
      _this.imgSize_ = options.imgSize;
      var src = options.src;
      assert(!(src !== void 0 && image), 4);
      assert(!image || image && _this.imgSize_, 5);
      if ((src === void 0 || src.length === 0) && image) {
        src = /** @type {HTMLImageElement} */
        image.src || getUid(image);
      }
      assert(src !== void 0 && src.length > 0, 6);
      var imageState = options.src !== void 0 ? ImageState_default.IDLE : ImageState_default.LOADED;
      _this.color_ = options.color !== void 0 ? asArray(options.color) : null;
      _this.iconImage_ = get4(
        image,
        /** @type {string} */
        src,
        _this.imgSize_ !== void 0 ? _this.imgSize_ : null,
        _this.crossOrigin_,
        imageState,
        _this.color_
      );
      _this.offset_ = options.offset !== void 0 ? options.offset : [0, 0];
      _this.offsetOrigin_ = options.offsetOrigin !== void 0 ? options.offsetOrigin : IconOrigin_default.TOP_LEFT;
      _this.origin_ = null;
      _this.size_ = options.size !== void 0 ? options.size : null;
      return _this;
    }
    Icon2.prototype.clone = function() {
      var scale5 = this.getScale();
      return new Icon2({
        anchor: this.anchor_.slice(),
        anchorOrigin: this.anchorOrigin_,
        anchorXUnits: this.anchorXUnits_,
        anchorYUnits: this.anchorYUnits_,
        color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || void 0,
        crossOrigin: this.crossOrigin_,
        imgSize: this.imgSize_,
        offset: this.offset_.slice(),
        offsetOrigin: this.offsetOrigin_,
        opacity: this.getOpacity(),
        rotateWithView: this.getRotateWithView(),
        rotation: this.getRotation(),
        scale: Array.isArray(scale5) ? scale5.slice() : scale5,
        size: this.size_ !== null ? this.size_.slice() : void 0,
        src: this.getSrc(),
        displacement: this.getDisplacement().slice(),
        declutterMode: this.getDeclutterMode()
      });
    };
    Icon2.prototype.getAnchor = function() {
      var anchor2 = this.normalizedAnchor_;
      if (!anchor2) {
        anchor2 = this.anchor_;
        var size = this.getSize();
        if (this.anchorXUnits_ == IconAnchorUnits_default.FRACTION || this.anchorYUnits_ == IconAnchorUnits_default.FRACTION) {
          if (!size) {
            return null;
          }
          anchor2 = this.anchor_.slice();
          if (this.anchorXUnits_ == IconAnchorUnits_default.FRACTION) {
            anchor2[0] *= size[0];
          }
          if (this.anchorYUnits_ == IconAnchorUnits_default.FRACTION) {
            anchor2[1] *= size[1];
          }
        }
        if (this.anchorOrigin_ != IconOrigin_default.TOP_LEFT) {
          if (!size) {
            return null;
          }
          if (anchor2 === this.anchor_) {
            anchor2 = this.anchor_.slice();
          }
          if (this.anchorOrigin_ == IconOrigin_default.TOP_RIGHT || this.anchorOrigin_ == IconOrigin_default.BOTTOM_RIGHT) {
            anchor2[0] = -anchor2[0] + size[0];
          }
          if (this.anchorOrigin_ == IconOrigin_default.BOTTOM_LEFT || this.anchorOrigin_ == IconOrigin_default.BOTTOM_RIGHT) {
            anchor2[1] = -anchor2[1] + size[1];
          }
        }
        this.normalizedAnchor_ = anchor2;
      }
      var displacement = this.getDisplacement();
      return [anchor2[0] - displacement[0], anchor2[1] + displacement[1]];
    };
    Icon2.prototype.setAnchor = function(anchor2) {
      this.anchor_ = anchor2;
      this.normalizedAnchor_ = null;
    };
    Icon2.prototype.getColor = function() {
      return this.color_;
    };
    Icon2.prototype.getImage = function(pixelRatio) {
      return this.iconImage_.getImage(pixelRatio);
    };
    Icon2.prototype.getPixelRatio = function(pixelRatio) {
      return this.iconImage_.getPixelRatio(pixelRatio);
    };
    Icon2.prototype.getImageSize = function() {
      return this.iconImage_.getSize();
    };
    Icon2.prototype.getImageState = function() {
      return this.iconImage_.getImageState();
    };
    Icon2.prototype.getHitDetectionImage = function() {
      return this.iconImage_.getHitDetectionImage();
    };
    Icon2.prototype.getOrigin = function() {
      if (this.origin_) {
        return this.origin_;
      }
      var offset2 = this.offset_;
      if (this.offsetOrigin_ != IconOrigin_default.TOP_LEFT) {
        var size = this.getSize();
        var iconImageSize = this.iconImage_.getSize();
        if (!size || !iconImageSize) {
          return null;
        }
        offset2 = offset2.slice();
        if (this.offsetOrigin_ == IconOrigin_default.TOP_RIGHT || this.offsetOrigin_ == IconOrigin_default.BOTTOM_RIGHT) {
          offset2[0] = iconImageSize[0] - size[0] - offset2[0];
        }
        if (this.offsetOrigin_ == IconOrigin_default.BOTTOM_LEFT || this.offsetOrigin_ == IconOrigin_default.BOTTOM_RIGHT) {
          offset2[1] = iconImageSize[1] - size[1] - offset2[1];
        }
      }
      this.origin_ = offset2;
      return this.origin_;
    };
    Icon2.prototype.getSrc = function() {
      return this.iconImage_.getSrc();
    };
    Icon2.prototype.getSize = function() {
      return !this.size_ ? this.iconImage_.getSize() : this.size_;
    };
    Icon2.prototype.listenImageChange = function(listener) {
      this.iconImage_.addEventListener(EventType_default.CHANGE, listener);
    };
    Icon2.prototype.load = function() {
      this.iconImage_.load();
    };
    Icon2.prototype.unlistenImageChange = function(listener) {
      this.iconImage_.removeEventListener(EventType_default.CHANGE, listener);
    };
    return Icon2;
  }(Image_default)
);
var Icon_default = Icon;

// node_modules/ol/style/Text.js
var DEFAULT_FILL_COLOR = "#333";
var Text2 = (
  /** @class */
  function() {
    function Text3(opt_options) {
      var options = opt_options || {};
      this.font_ = options.font;
      this.rotation_ = options.rotation;
      this.rotateWithView_ = options.rotateWithView;
      this.scale_ = options.scale;
      this.scaleArray_ = toSize(options.scale !== void 0 ? options.scale : 1);
      this.text_ = options.text;
      this.textAlign_ = options.textAlign;
      this.justify_ = options.justify;
      this.textBaseline_ = options.textBaseline;
      this.fill_ = options.fill !== void 0 ? options.fill : new Fill_default({ color: DEFAULT_FILL_COLOR });
      this.maxAngle_ = options.maxAngle !== void 0 ? options.maxAngle : Math.PI / 4;
      this.placement_ = options.placement !== void 0 ? options.placement : TextPlacement_default.POINT;
      this.overflow_ = !!options.overflow;
      this.stroke_ = options.stroke !== void 0 ? options.stroke : null;
      this.offsetX_ = options.offsetX !== void 0 ? options.offsetX : 0;
      this.offsetY_ = options.offsetY !== void 0 ? options.offsetY : 0;
      this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null;
      this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null;
      this.padding_ = options.padding === void 0 ? null : options.padding;
    }
    Text3.prototype.clone = function() {
      var scale5 = this.getScale();
      return new Text3({
        font: this.getFont(),
        placement: this.getPlacement(),
        maxAngle: this.getMaxAngle(),
        overflow: this.getOverflow(),
        rotation: this.getRotation(),
        rotateWithView: this.getRotateWithView(),
        scale: Array.isArray(scale5) ? scale5.slice() : scale5,
        text: this.getText(),
        textAlign: this.getTextAlign(),
        justify: this.getJustify(),
        textBaseline: this.getTextBaseline(),
        fill: this.getFill() ? this.getFill().clone() : void 0,
        stroke: this.getStroke() ? this.getStroke().clone() : void 0,
        offsetX: this.getOffsetX(),
        offsetY: this.getOffsetY(),
        backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : void 0,
        backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : void 0,
        padding: this.getPadding() || void 0
      });
    };
    Text3.prototype.getOverflow = function() {
      return this.overflow_;
    };
    Text3.prototype.getFont = function() {
      return this.font_;
    };
    Text3.prototype.getMaxAngle = function() {
      return this.maxAngle_;
    };
    Text3.prototype.getPlacement = function() {
      return this.placement_;
    };
    Text3.prototype.getOffsetX = function() {
      return this.offsetX_;
    };
    Text3.prototype.getOffsetY = function() {
      return this.offsetY_;
    };
    Text3.prototype.getFill = function() {
      return this.fill_;
    };
    Text3.prototype.getRotateWithView = function() {
      return this.rotateWithView_;
    };
    Text3.prototype.getRotation = function() {
      return this.rotation_;
    };
    Text3.prototype.getScale = function() {
      return this.scale_;
    };
    Text3.prototype.getScaleArray = function() {
      return this.scaleArray_;
    };
    Text3.prototype.getStroke = function() {
      return this.stroke_;
    };
    Text3.prototype.getText = function() {
      return this.text_;
    };
    Text3.prototype.getTextAlign = function() {
      return this.textAlign_;
    };
    Text3.prototype.getJustify = function() {
      return this.justify_;
    };
    Text3.prototype.getTextBaseline = function() {
      return this.textBaseline_;
    };
    Text3.prototype.getBackgroundFill = function() {
      return this.backgroundFill_;
    };
    Text3.prototype.getBackgroundStroke = function() {
      return this.backgroundStroke_;
    };
    Text3.prototype.getPadding = function() {
      return this.padding_;
    };
    Text3.prototype.setOverflow = function(overflow) {
      this.overflow_ = overflow;
    };
    Text3.prototype.setFont = function(font) {
      this.font_ = font;
    };
    Text3.prototype.setMaxAngle = function(maxAngle) {
      this.maxAngle_ = maxAngle;
    };
    Text3.prototype.setOffsetX = function(offsetX) {
      this.offsetX_ = offsetX;
    };
    Text3.prototype.setOffsetY = function(offsetY) {
      this.offsetY_ = offsetY;
    };
    Text3.prototype.setPlacement = function(placement) {
      this.placement_ = placement;
    };
    Text3.prototype.setRotateWithView = function(rotateWithView) {
      this.rotateWithView_ = rotateWithView;
    };
    Text3.prototype.setFill = function(fill) {
      this.fill_ = fill;
    };
    Text3.prototype.setRotation = function(rotation) {
      this.rotation_ = rotation;
    };
    Text3.prototype.setScale = function(scale5) {
      this.scale_ = scale5;
      this.scaleArray_ = toSize(scale5 !== void 0 ? scale5 : 1);
    };
    Text3.prototype.setStroke = function(stroke) {
      this.stroke_ = stroke;
    };
    Text3.prototype.setText = function(text) {
      this.text_ = text;
    };
    Text3.prototype.setTextAlign = function(textAlign) {
      this.textAlign_ = textAlign;
    };
    Text3.prototype.setJustify = function(justify) {
      this.justify_ = justify;
    };
    Text3.prototype.setTextBaseline = function(textBaseline) {
      this.textBaseline_ = textBaseline;
    };
    Text3.prototype.setBackgroundFill = function(fill) {
      this.backgroundFill_ = fill;
    };
    Text3.prototype.setBackgroundStroke = function(stroke) {
      this.backgroundStroke_ = stroke;
    };
    Text3.prototype.setPadding = function(padding) {
      this.padding_ = padding;
    };
    return Text3;
  }()
);
var Text_default = Text2;

// node_modules/ol/render/canvas/hitdetect.js
var HIT_DETECT_RESOLUTION = 0.5;
function createHitDetectionImageData(size, transforms2, features, styleFunction, extent, resolution, rotation) {
  var width = size[0] * HIT_DETECT_RESOLUTION;
  var height = size[1] * HIT_DETECT_RESOLUTION;
  var context2 = createCanvasContext2D(width, height);
  context2.imageSmoothingEnabled = false;
  var canvas = context2.canvas;
  var renderer = new Immediate_default(context2, HIT_DETECT_RESOLUTION, extent, null, rotation);
  var featureCount = features.length;
  var indexFactor = Math.floor((256 * 256 * 256 - 1) / featureCount);
  var featuresByZIndex = {};
  for (var i2 = 1; i2 <= featureCount; ++i2) {
    var feature = features[i2 - 1];
    var featureStyleFunction = feature.getStyleFunction() || styleFunction;
    if (!styleFunction) {
      continue;
    }
    var styles = featureStyleFunction(feature, resolution);
    if (!styles) {
      continue;
    }
    if (!Array.isArray(styles)) {
      styles = [styles];
    }
    var index = i2 * indexFactor;
    var color2 = "#" + ("000000" + index.toString(16)).slice(-6);
    for (var j = 0, jj = styles.length; j < jj; ++j) {
      var originalStyle = styles[j];
      var geometry2 = originalStyle.getGeometryFunction()(feature);
      if (!geometry2 || !intersects(extent, geometry2.getExtent())) {
        continue;
      }
      var style2 = originalStyle.clone();
      var fill = style2.getFill();
      if (fill) {
        fill.setColor(color2);
      }
      var stroke = style2.getStroke();
      if (stroke) {
        stroke.setColor(color2);
        stroke.setLineDash(null);
      }
      style2.setText(void 0);
      var image = originalStyle.getImage();
      if (image && image.getOpacity() !== 0) {
        var imgSize = image.getImageSize();
        if (!imgSize) {
          continue;
        }
        var imgContext = createCanvasContext2D(imgSize[0], imgSize[1], void 0, { alpha: false });
        var img = imgContext.canvas;
        imgContext.fillStyle = color2;
        imgContext.fillRect(0, 0, img.width, img.height);
        style2.setImage(new Icon_default({
          img,
          imgSize,
          anchor: image.getAnchor(),
          anchorXUnits: IconAnchorUnits_default.PIXELS,
          anchorYUnits: IconAnchorUnits_default.PIXELS,
          offset: image.getOrigin(),
          opacity: 1,
          size: image.getSize(),
          scale: image.getScale(),
          rotation: image.getRotation(),
          rotateWithView: image.getRotateWithView()
        }));
      }
      var zIndex = style2.getZIndex() || 0;
      var byGeometryType = featuresByZIndex[zIndex];
      if (!byGeometryType) {
        byGeometryType = {};
        featuresByZIndex[zIndex] = byGeometryType;
        byGeometryType["Polygon"] = [];
        byGeometryType["Circle"] = [];
        byGeometryType["LineString"] = [];
        byGeometryType["Point"] = [];
      }
      byGeometryType[geometry2.getType().replace("Multi", "")].push(geometry2, style2);
    }
  }
  var zIndexKeys = Object.keys(featuresByZIndex).map(Number).sort(numberSafeCompareFunction);
  for (var i2 = 0, ii = zIndexKeys.length; i2 < ii; ++i2) {
    var byGeometryType = featuresByZIndex[zIndexKeys[i2]];
    for (var type in byGeometryType) {
      var geomAndStyle = byGeometryType[type];
      for (var j = 0, jj = geomAndStyle.length; j < jj; j += 2) {
        renderer.setStyle(geomAndStyle[j + 1]);
        for (var k = 0, kk = transforms2.length; k < kk; ++k) {
          renderer.setTransform(transforms2[k]);
          renderer.drawGeometry(geomAndStyle[j]);
        }
      }
    }
  }
  return context2.getImageData(0, 0, canvas.width, canvas.height);
}
function hitDetect(pixel, features, imageData) {
  var resultFeatures = [];
  if (imageData) {
    var x = Math.floor(Math.round(pixel[0]) * HIT_DETECT_RESOLUTION);
    var y = Math.floor(Math.round(pixel[1]) * HIT_DETECT_RESOLUTION);
    var index = (clamp(x, 0, imageData.width - 1) + clamp(y, 0, imageData.height - 1) * imageData.width) * 4;
    var r = imageData.data[index];
    var g = imageData.data[index + 1];
    var b = imageData.data[index + 2];
    var i2 = b + 256 * (g + 256 * r);
    var indexFactor = Math.floor((256 * 256 * 256 - 1) / features.length);
    if (i2 && i2 % indexFactor === 0) {
      resultFeatures.push(features[i2 / indexFactor - 1]);
    }
  }
  return resultFeatures;
}

// node_modules/ol/renderer/vector.js
var SIMPLIFY_TOLERANCE = 0.5;
var GEOMETRY_RENDERERS = {
  "Point": renderPointGeometry,
  "LineString": renderLineStringGeometry,
  "Polygon": renderPolygonGeometry,
  "MultiPoint": renderMultiPointGeometry,
  "MultiLineString": renderMultiLineStringGeometry,
  "MultiPolygon": renderMultiPolygonGeometry,
  "GeometryCollection": renderGeometryCollectionGeometry,
  "Circle": renderCircleGeometry
};
function defaultOrder(feature1, feature2) {
  return parseInt(getUid(feature1), 10) - parseInt(getUid(feature2), 10);
}
function getSquaredTolerance(resolution, pixelRatio) {
  var tolerance = getTolerance(resolution, pixelRatio);
  return tolerance * tolerance;
}
function getTolerance(resolution, pixelRatio) {
  return SIMPLIFY_TOLERANCE * resolution / pixelRatio;
}
function renderCircleGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var fillStyle = style2.getFill();
  var strokeStyle = style2.getStroke();
  if (fillStyle || strokeStyle) {
    var circleReplay = builderGroup.getBuilder(style2.getZIndex(), "Circle");
    circleReplay.setFillStrokeStyle(fillStyle, strokeStyle);
    circleReplay.drawCircle(geometry2, feature);
  }
  var textStyle = style2.getText();
  if (textStyle && textStyle.getText()) {
    var textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle);
    textReplay.drawText(geometry2, feature);
  }
}
function renderFeature(replayGroup, feature, style2, squaredTolerance, listener, opt_transform, opt_declutterBuilderGroup) {
  var loading = false;
  var imageStyle = style2.getImage();
  if (imageStyle) {
    var imageState = imageStyle.getImageState();
    if (imageState == ImageState_default.LOADED || imageState == ImageState_default.ERROR) {
      imageStyle.unlistenImageChange(listener);
    } else {
      if (imageState == ImageState_default.IDLE) {
        imageStyle.load();
      }
      imageStyle.listenImageChange(listener);
      loading = true;
    }
  }
  renderFeatureInternal(replayGroup, feature, style2, squaredTolerance, opt_transform, opt_declutterBuilderGroup);
  return loading;
}
function renderFeatureInternal(replayGroup, feature, style2, squaredTolerance, opt_transform, opt_declutterBuilderGroup) {
  var geometry2 = style2.getGeometryFunction()(feature);
  if (!geometry2) {
    return;
  }
  var simplifiedGeometry = geometry2.simplifyTransformed(squaredTolerance, opt_transform);
  var renderer = style2.getRenderer();
  if (renderer) {
    renderGeometry(replayGroup, simplifiedGeometry, style2, feature);
  } else {
    var geometryRenderer = GEOMETRY_RENDERERS[simplifiedGeometry.getType()];
    geometryRenderer(replayGroup, simplifiedGeometry, style2, feature, opt_declutterBuilderGroup);
  }
}
function renderGeometry(replayGroup, geometry2, style2, feature) {
  if (geometry2.getType() == "GeometryCollection") {
    var geometries = (
      /** @type {import("../geom/GeometryCollection.js").default} */
      geometry2.getGeometries()
    );
    for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
      renderGeometry(replayGroup, geometries[i2], style2, feature);
    }
    return;
  }
  var replay = replayGroup.getBuilder(style2.getZIndex(), "Default");
  replay.drawCustom(
    /** @type {import("../geom/SimpleGeometry.js").default} */
    geometry2,
    feature,
    style2.getRenderer(),
    style2.getHitDetectionRenderer()
  );
}
function renderGeometryCollectionGeometry(replayGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var geometries = geometry2.getGeometriesArray();
  var i2, ii;
  for (i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
    var geometryRenderer = GEOMETRY_RENDERERS[geometries[i2].getType()];
    geometryRenderer(replayGroup, geometries[i2], style2, feature, opt_declutterBuilderGroup);
  }
}
function renderLineStringGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var strokeStyle = style2.getStroke();
  if (strokeStyle) {
    var lineStringReplay = builderGroup.getBuilder(style2.getZIndex(), "LineString");
    lineStringReplay.setFillStrokeStyle(null, strokeStyle);
    lineStringReplay.drawLineString(geometry2, feature);
  }
  var textStyle = style2.getText();
  if (textStyle && textStyle.getText()) {
    var textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle);
    textReplay.drawText(geometry2, feature);
  }
}
function renderMultiLineStringGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var strokeStyle = style2.getStroke();
  if (strokeStyle) {
    var lineStringReplay = builderGroup.getBuilder(style2.getZIndex(), "LineString");
    lineStringReplay.setFillStrokeStyle(null, strokeStyle);
    lineStringReplay.drawMultiLineString(geometry2, feature);
  }
  var textStyle = style2.getText();
  if (textStyle && textStyle.getText()) {
    var textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle);
    textReplay.drawText(geometry2, feature);
  }
}
function renderMultiPolygonGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var fillStyle = style2.getFill();
  var strokeStyle = style2.getStroke();
  if (strokeStyle || fillStyle) {
    var polygonReplay = builderGroup.getBuilder(style2.getZIndex(), "Polygon");
    polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);
    polygonReplay.drawMultiPolygon(geometry2, feature);
  }
  var textStyle = style2.getText();
  if (textStyle && textStyle.getText()) {
    var textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle);
    textReplay.drawText(geometry2, feature);
  }
}
function renderPointGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var imageStyle = style2.getImage();
  var textStyle = style2.getText();
  var declutterImageWithText;
  if (imageStyle) {
    if (imageStyle.getImageState() != ImageState_default.LOADED) {
      return;
    }
    var imageBuilderGroup = builderGroup;
    if (opt_declutterBuilderGroup) {
      var declutterMode = imageStyle.getDeclutterMode();
      if (declutterMode !== "none") {
        imageBuilderGroup = opt_declutterBuilderGroup;
        if (declutterMode === "obstacle") {
          var imageReplay_1 = builderGroup.getBuilder(style2.getZIndex(), "Image");
          imageReplay_1.setImageStyle(imageStyle, declutterImageWithText);
          imageReplay_1.drawPoint(geometry2, feature);
        } else if (textStyle && textStyle.getText()) {
          declutterImageWithText = {};
        }
      }
    }
    var imageReplay = imageBuilderGroup.getBuilder(style2.getZIndex(), "Image");
    imageReplay.setImageStyle(imageStyle, declutterImageWithText);
    imageReplay.drawPoint(geometry2, feature);
  }
  if (textStyle && textStyle.getText()) {
    var textBuilderGroup = builderGroup;
    if (opt_declutterBuilderGroup) {
      textBuilderGroup = opt_declutterBuilderGroup;
    }
    var textReplay = textBuilderGroup.getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle, declutterImageWithText);
    textReplay.drawText(geometry2, feature);
  }
}
function renderMultiPointGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var imageStyle = style2.getImage();
  var textStyle = style2.getText();
  var declutterImageWithText;
  if (imageStyle) {
    if (imageStyle.getImageState() != ImageState_default.LOADED) {
      return;
    }
    var imageBuilderGroup = builderGroup;
    if (opt_declutterBuilderGroup) {
      var declutterMode = imageStyle.getDeclutterMode();
      if (declutterMode !== "none") {
        imageBuilderGroup = opt_declutterBuilderGroup;
        if (declutterMode === "obstacle") {
          var imageReplay_2 = builderGroup.getBuilder(style2.getZIndex(), "Image");
          imageReplay_2.setImageStyle(imageStyle, declutterImageWithText);
          imageReplay_2.drawMultiPoint(geometry2, feature);
        } else if (textStyle && textStyle.getText()) {
          declutterImageWithText = {};
        }
      }
    }
    var imageReplay = imageBuilderGroup.getBuilder(style2.getZIndex(), "Image");
    imageReplay.setImageStyle(imageStyle, declutterImageWithText);
    imageReplay.drawMultiPoint(geometry2, feature);
  }
  if (textStyle && textStyle.getText()) {
    var textBuilderGroup = builderGroup;
    if (opt_declutterBuilderGroup) {
      textBuilderGroup = opt_declutterBuilderGroup;
    }
    var textReplay = textBuilderGroup.getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle, declutterImageWithText);
    textReplay.drawText(geometry2, feature);
  }
}
function renderPolygonGeometry(builderGroup, geometry2, style2, feature, opt_declutterBuilderGroup) {
  var fillStyle = style2.getFill();
  var strokeStyle = style2.getStroke();
  if (fillStyle || strokeStyle) {
    var polygonReplay = builderGroup.getBuilder(style2.getZIndex(), "Polygon");
    polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);
    polygonReplay.drawPolygon(geometry2, feature);
  }
  var textStyle = style2.getText();
  if (textStyle && textStyle.getText()) {
    var textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(style2.getZIndex(), "Text");
    textReplay.setTextStyle(textStyle);
    textReplay.drawText(geometry2, feature);
  }
}

// node_modules/ol/renderer/canvas/VectorTileLayer.js
var __extends31 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var IMAGE_REPLAYS = {
  "image": ["Polygon", "Circle", "LineString", "Image", "Text"],
  "hybrid": ["Polygon", "LineString"],
  "vector": []
};
var VECTOR_REPLAYS = {
  "hybrid": ["Image", "Text", "Default"],
  "vector": ["Polygon", "Circle", "LineString", "Image", "Text", "Default"]
};
var CanvasVectorTileLayerRenderer = (
  /** @class */
  function(_super) {
    __extends31(CanvasVectorTileLayerRenderer2, _super);
    function CanvasVectorTileLayerRenderer2(layer) {
      var _this = _super.call(this, layer) || this;
      _this.boundHandleStyleImageChange_ = _this.handleStyleImageChange_.bind(_this);
      _this.renderedLayerRevision_;
      _this.renderedPixelToCoordinateTransform_ = null;
      _this.renderedRotation_;
      _this.tmpTransform_ = create();
      return _this;
    }
    CanvasVectorTileLayerRenderer2.prototype.prepareTile = function(tile, pixelRatio, projection) {
      var render2;
      var state2 = tile.getState();
      if (state2 === TileState_default.LOADED || state2 === TileState_default.ERROR) {
        this.updateExecutorGroup_(tile, pixelRatio, projection);
        if (this.tileImageNeedsRender_(tile)) {
          render2 = true;
        }
      }
      return render2;
    };
    CanvasVectorTileLayerRenderer2.prototype.getTile = function(z, x, y, frameState) {
      var pixelRatio = frameState.pixelRatio;
      var viewState = frameState.viewState;
      var resolution = viewState.resolution;
      var projection = viewState.projection;
      var layer = this.getLayer();
      var tile = layer.getSource().getTile(z, x, y, pixelRatio, projection);
      var viewHints = frameState.viewHints;
      var hifi = !(viewHints[ViewHint_default.ANIMATING] || viewHints[ViewHint_default.INTERACTING]);
      if (hifi || !tile.wantedResolution) {
        tile.wantedResolution = resolution;
      }
      var render2 = this.prepareTile(tile, pixelRatio, projection);
      if (render2 && (hifi || Date.now() - frameState.time < 8) && layer.getRenderMode() !== VectorTileRenderType_default.VECTOR) {
        this.renderTileImage_(tile, frameState);
      }
      return _super.prototype.getTile.call(this, z, x, y, frameState);
    };
    CanvasVectorTileLayerRenderer2.prototype.isDrawableTile = function(tile) {
      var layer = this.getLayer();
      return _super.prototype.isDrawableTile.call(this, tile) && (layer.getRenderMode() === VectorTileRenderType_default.VECTOR ? getUid(layer) in tile.executorGroups : tile.hasContext(layer));
    };
    CanvasVectorTileLayerRenderer2.prototype.getTileImage = function(tile) {
      return tile.getImage(this.getLayer());
    };
    CanvasVectorTileLayerRenderer2.prototype.prepareFrame = function(frameState) {
      var layerRevision = this.getLayer().getRevision();
      if (this.renderedLayerRevision_ !== layerRevision) {
        this.renderedLayerRevision_ = layerRevision;
        this.renderedTiles.length = 0;
      }
      return _super.prototype.prepareFrame.call(this, frameState);
    };
    CanvasVectorTileLayerRenderer2.prototype.updateExecutorGroup_ = function(tile, pixelRatio, projection) {
      var layer = (
        /** @type {import("../../layer/VectorTile.js").default} */
        this.getLayer()
      );
      var revision = layer.getRevision();
      var renderOrder = layer.getRenderOrder() || null;
      var resolution = tile.wantedResolution;
      var builderState = tile.getReplayState(layer);
      if (!builderState.dirty && builderState.renderedResolution === resolution && builderState.renderedRevision == revision && builderState.renderedRenderOrder == renderOrder) {
        return;
      }
      var source = layer.getSource();
      var declutter = layer.getDeclutter();
      var sourceTileGrid = source.getTileGrid();
      var tileGrid = source.getTileGridForProjection(projection);
      var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
      var sourceTiles = source.getSourceTiles(pixelRatio, projection, tile);
      var layerUid = getUid(layer);
      delete tile.hitDetectionImageData[layerUid];
      tile.executorGroups[layerUid] = [];
      if (declutter) {
        tile.declutterExecutorGroups[layerUid] = [];
      }
      builderState.dirty = false;
      var _loop_1 = function(t4, tt2) {
        var sourceTile = sourceTiles[t4];
        if (sourceTile.getState() != TileState_default.LOADED) {
          return "continue";
        }
        var sourceTileCoord = sourceTile.tileCoord;
        var sourceTileExtent = sourceTileGrid.getTileCoordExtent(sourceTileCoord);
        var sharedExtent = getIntersection(tileExtent, sourceTileExtent);
        var builderExtent = buffer2(sharedExtent, layer.getRenderBuffer() * resolution, this_1.tmpExtent);
        var bufferedExtent = equals2(sourceTileExtent, sharedExtent) ? null : builderExtent;
        var builderGroup = new BuilderGroup_default(0, builderExtent, resolution, pixelRatio);
        var declutterBuilderGroup = declutter ? new BuilderGroup_default(0, sharedExtent, resolution, pixelRatio) : void 0;
        var squaredTolerance = getSquaredTolerance(resolution, pixelRatio);
        var render2 = function(feature2) {
          var styles;
          var styleFunction = feature2.getStyleFunction() || layer.getStyleFunction();
          if (styleFunction) {
            styles = styleFunction(feature2, resolution);
          }
          if (styles) {
            var dirty = this.renderFeature(feature2, squaredTolerance, styles, builderGroup, declutterBuilderGroup);
            builderState.dirty = builderState.dirty || dirty;
          }
        };
        var features = sourceTile.getFeatures();
        if (renderOrder && renderOrder !== builderState.renderedRenderOrder) {
          features.sort(renderOrder);
        }
        for (var i2 = 0, ii = features.length; i2 < ii; ++i2) {
          var feature = features[i2];
          if (!bufferedExtent || intersects(bufferedExtent, feature.getGeometry().getExtent())) {
            render2.call(this_1, feature);
          }
        }
        var executorGroupInstructions = builderGroup.finish();
        var replayExtent = layer.getRenderMode() !== VectorTileRenderType_default.VECTOR && declutter && sourceTiles.length === 1 ? null : sharedExtent;
        var renderingReplayGroup = new ExecutorGroup_default(replayExtent, resolution, pixelRatio, source.getOverlaps(), executorGroupInstructions, layer.getRenderBuffer());
        tile.executorGroups[layerUid].push(renderingReplayGroup);
        if (declutterBuilderGroup) {
          var declutterExecutorGroup = new ExecutorGroup_default(null, resolution, pixelRatio, source.getOverlaps(), declutterBuilderGroup.finish(), layer.getRenderBuffer());
          tile.declutterExecutorGroups[layerUid].push(declutterExecutorGroup);
        }
      };
      var this_1 = this;
      for (var t = 0, tt = sourceTiles.length; t < tt; ++t) {
        _loop_1(t, tt);
      }
      builderState.renderedRevision = revision;
      builderState.renderedRenderOrder = renderOrder;
      builderState.renderedResolution = resolution;
    };
    CanvasVectorTileLayerRenderer2.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, matches) {
      var resolution = frameState.viewState.resolution;
      var rotation = frameState.viewState.rotation;
      hitTolerance = hitTolerance == void 0 ? 0 : hitTolerance;
      var layer = this.getLayer();
      var source = layer.getSource();
      var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
      var hitExtent = boundingExtent([coordinate]);
      buffer2(hitExtent, resolution * hitTolerance, hitExtent);
      var features = {};
      var featureCallback = function(feature, geometry2, distanceSq) {
        var key = feature.getId();
        if (key === void 0) {
          key = getUid(feature);
        }
        var match2 = features[key];
        if (!match2) {
          if (distanceSq === 0) {
            features[key] = true;
            return callback(feature, layer, geometry2);
          }
          matches.push(features[key] = {
            feature,
            layer,
            geometry: geometry2,
            distanceSq,
            callback
          });
        } else if (match2 !== true && distanceSq < match2.distanceSq) {
          if (distanceSq === 0) {
            features[key] = true;
            matches.splice(matches.lastIndexOf(match2), 1);
            return callback(feature, layer, geometry2);
          }
          match2.geometry = geometry2;
          match2.distanceSq = distanceSq;
        }
        return void 0;
      };
      var renderedTiles = (
        /** @type {Array<import("../../VectorRenderTile.js").default>} */
        this.renderedTiles
      );
      var found;
      var _loop_2 = function(i3, ii2) {
        var tile = renderedTiles[i3];
        var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
        if (!intersects(tileExtent, hitExtent)) {
          return "continue";
        }
        var layerUid = getUid(layer);
        var executorGroups = [tile.executorGroups[layerUid]];
        var declutterExecutorGroups = tile.declutterExecutorGroups[layerUid];
        if (declutterExecutorGroups) {
          executorGroups.push(declutterExecutorGroups);
        }
        executorGroups.some(function(executorGroups2) {
          var declutteredFeatures = executorGroups2 === declutterExecutorGroups ? frameState.declutterTree.all().map(function(item) {
            return item.value;
          }) : null;
          for (var t = 0, tt = executorGroups2.length; t < tt; ++t) {
            var executorGroup = executorGroups2[t];
            found = executorGroup.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, featureCallback, declutteredFeatures);
            if (found) {
              return true;
            }
          }
        });
      };
      for (var i2 = 0, ii = renderedTiles.length; !found && i2 < ii; ++i2) {
        _loop_2(i2, ii);
      }
      return found;
    };
    CanvasVectorTileLayerRenderer2.prototype.getFeatures = function(pixel) {
      return new Promise((function(resolve, reject) {
        var layer = (
          /** @type {import("../../layer/VectorTile.js").default} */
          this.getLayer()
        );
        var layerUid = getUid(layer);
        var source = layer.getSource();
        var projection = this.renderedProjection;
        var projectionExtent = projection.getExtent();
        var resolution = this.renderedResolution;
        var tileGrid = source.getTileGridForProjection(projection);
        var coordinate = apply(this.renderedPixelToCoordinateTransform_, pixel.slice());
        var tileCoord = tileGrid.getTileCoordForCoordAndResolution(coordinate, resolution);
        var tile;
        for (var i2 = 0, ii = this.renderedTiles.length; i2 < ii; ++i2) {
          if (tileCoord.toString() === this.renderedTiles[i2].tileCoord.toString()) {
            tile = this.renderedTiles[i2];
            if (tile.getState() === TileState_default.LOADED) {
              var extent_1 = tileGrid.getTileCoordExtent(tile.tileCoord);
              if (source.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, extent_1)) {
                wrapX2(coordinate, projection);
              }
              break;
            }
            tile = void 0;
          }
        }
        if (!tile || tile.loadingSourceTiles > 0) {
          resolve([]);
          return;
        }
        var extent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
        var corner = getTopLeft(extent);
        var tilePixel = [
          (coordinate[0] - corner[0]) / resolution,
          (corner[1] - coordinate[1]) / resolution
        ];
        var features = tile.getSourceTiles().reduce(function(accumulator, sourceTile) {
          return accumulator.concat(sourceTile.getFeatures());
        }, []);
        var hitDetectionImageData = tile.hitDetectionImageData[layerUid];
        if (!hitDetectionImageData && !this.animatingOrInteracting_) {
          var tileSize = toSize(tileGrid.getTileSize(tileGrid.getZForResolution(resolution, source.zDirection)));
          var rotation = this.renderedRotation_;
          var transforms2 = [
            this.getRenderTransform(tileGrid.getTileCoordCenter(tile.wrappedTileCoord), resolution, 0, HIT_DETECT_RESOLUTION, tileSize[0] * HIT_DETECT_RESOLUTION, tileSize[1] * HIT_DETECT_RESOLUTION, 0)
          ];
          hitDetectionImageData = createHitDetectionImageData(tileSize, transforms2, features, layer.getStyleFunction(), tileGrid.getTileCoordExtent(tile.wrappedTileCoord), tile.getReplayState(layer).renderedResolution, rotation);
          tile.hitDetectionImageData[layerUid] = hitDetectionImageData;
        }
        resolve(hitDetect(tilePixel, features, hitDetectionImageData));
      }).bind(this));
    };
    CanvasVectorTileLayerRenderer2.prototype.handleFontsChanged = function() {
      var layer = this.getLayer();
      if (layer.getVisible() && this.renderedLayerRevision_ !== void 0) {
        layer.changed();
      }
    };
    CanvasVectorTileLayerRenderer2.prototype.handleStyleImageChange_ = function(event) {
      this.renderIfReadyAndVisible();
    };
    CanvasVectorTileLayerRenderer2.prototype.renderDeclutter = function(frameState) {
      var context2 = this.context;
      var alpha = context2.globalAlpha;
      context2.globalAlpha = this.getLayer().getOpacity();
      var viewHints = frameState.viewHints;
      var hifi = !(viewHints[ViewHint_default.ANIMATING] || viewHints[ViewHint_default.INTERACTING]);
      var tiles = (
        /** @type {Array<import("../../VectorRenderTile.js").default>} */
        this.renderedTiles
      );
      for (var i2 = 0, ii = tiles.length; i2 < ii; ++i2) {
        var tile = tiles[i2];
        var declutterExecutorGroups = tile.declutterExecutorGroups[getUid(this.getLayer())];
        if (declutterExecutorGroups) {
          for (var j = declutterExecutorGroups.length - 1; j >= 0; --j) {
            declutterExecutorGroups[j].execute(this.context, 1, this.getTileRenderTransform(tile, frameState), frameState.viewState.rotation, hifi, void 0, frameState.declutterTree);
          }
        }
      }
      context2.globalAlpha = alpha;
    };
    CanvasVectorTileLayerRenderer2.prototype.getTileRenderTransform = function(tile, frameState) {
      var pixelRatio = frameState.pixelRatio;
      var viewState = frameState.viewState;
      var center = viewState.center;
      var resolution = viewState.resolution;
      var rotation = viewState.rotation;
      var size = frameState.size;
      var width = Math.round(size[0] * pixelRatio);
      var height = Math.round(size[1] * pixelRatio);
      var source = this.getLayer().getSource();
      var tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
      var tileCoord = tile.tileCoord;
      var tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
      var worldOffset = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent)[0] - tileExtent[0];
      var transform3 = multiply(scale2(this.inversePixelTransform.slice(), 1 / pixelRatio, 1 / pixelRatio), this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, worldOffset));
      return transform3;
    };
    CanvasVectorTileLayerRenderer2.prototype.renderFrame = function(frameState, target) {
      var viewHints = frameState.viewHints;
      var hifi = !(viewHints[ViewHint_default.ANIMATING] || viewHints[ViewHint_default.INTERACTING]);
      _super.prototype.renderFrame.call(this, frameState, target);
      this.renderedPixelToCoordinateTransform_ = frameState.pixelToCoordinateTransform.slice();
      this.renderedRotation_ = frameState.viewState.rotation;
      var layer = (
        /** @type {import("../../layer/VectorTile.js").default} */
        this.getLayer()
      );
      var renderMode = layer.getRenderMode();
      var context2 = this.context;
      var alpha = context2.globalAlpha;
      context2.globalAlpha = layer.getOpacity();
      var replayTypes = VECTOR_REPLAYS[renderMode];
      var viewState = frameState.viewState;
      var rotation = viewState.rotation;
      var tileSource = layer.getSource();
      var tileGrid = tileSource.getTileGridForProjection(viewState.projection);
      var z = tileGrid.getZForResolution(viewState.resolution, tileSource.zDirection);
      var tiles = this.renderedTiles;
      var clips = [];
      var clipZs = [];
      var ready = true;
      for (var i2 = tiles.length - 1; i2 >= 0; --i2) {
        var tile = (
          /** @type {import("../../VectorRenderTile.js").default} */
          tiles[i2]
        );
        ready = ready && !tile.getReplayState(layer).dirty;
        var executorGroups = tile.executorGroups[getUid(layer)].filter(function(group2) {
          return group2.hasExecutors(replayTypes);
        });
        if (executorGroups.length === 0) {
          continue;
        }
        var transform3 = this.getTileRenderTransform(tile, frameState);
        var currentZ = tile.tileCoord[0];
        var contextSaved = false;
        var currentClip = executorGroups[0].getClipCoords(transform3);
        if (currentClip) {
          for (var j = 0, jj = clips.length; j < jj; ++j) {
            if (z !== currentZ && currentZ < clipZs[j]) {
              var clip = clips[j];
              if (intersects([
                currentClip[0],
                currentClip[3],
                currentClip[4],
                currentClip[7]
              ], [clip[0], clip[3], clip[4], clip[7]])) {
                if (!contextSaved) {
                  context2.save();
                  contextSaved = true;
                }
                context2.beginPath();
                context2.moveTo(currentClip[0], currentClip[1]);
                context2.lineTo(currentClip[2], currentClip[3]);
                context2.lineTo(currentClip[4], currentClip[5]);
                context2.lineTo(currentClip[6], currentClip[7]);
                context2.moveTo(clip[6], clip[7]);
                context2.lineTo(clip[4], clip[5]);
                context2.lineTo(clip[2], clip[3]);
                context2.lineTo(clip[0], clip[1]);
                context2.clip();
              }
            }
          }
          clips.push(currentClip);
          clipZs.push(currentZ);
        }
        for (var t = 0, tt = executorGroups.length; t < tt; ++t) {
          var executorGroup = executorGroups[t];
          executorGroup.execute(context2, 1, transform3, rotation, hifi, replayTypes);
        }
        if (contextSaved) {
          context2.restore();
        }
      }
      context2.globalAlpha = alpha;
      this.ready = ready;
      return this.container;
    };
    CanvasVectorTileLayerRenderer2.prototype.renderFeature = function(feature, squaredTolerance, styles, builderGroup, opt_declutterBuilderGroup) {
      if (!styles) {
        return false;
      }
      var loading = false;
      if (Array.isArray(styles)) {
        for (var i2 = 0, ii = styles.length; i2 < ii; ++i2) {
          loading = renderFeature(builderGroup, feature, styles[i2], squaredTolerance, this.boundHandleStyleImageChange_, void 0, opt_declutterBuilderGroup) || loading;
        }
      } else {
        loading = renderFeature(builderGroup, feature, styles, squaredTolerance, this.boundHandleStyleImageChange_, void 0, opt_declutterBuilderGroup);
      }
      return loading;
    };
    CanvasVectorTileLayerRenderer2.prototype.tileImageNeedsRender_ = function(tile) {
      var layer = (
        /** @type {import("../../layer/VectorTile.js").default} */
        this.getLayer()
      );
      if (layer.getRenderMode() === VectorTileRenderType_default.VECTOR) {
        return false;
      }
      var replayState = tile.getReplayState(layer);
      var revision = layer.getRevision();
      var resolution = tile.wantedResolution;
      return replayState.renderedTileResolution !== resolution || replayState.renderedTileRevision !== revision;
    };
    CanvasVectorTileLayerRenderer2.prototype.renderTileImage_ = function(tile, frameState) {
      var layer = (
        /** @type {import("../../layer/VectorTile.js").default} */
        this.getLayer()
      );
      var replayState = tile.getReplayState(layer);
      var revision = layer.getRevision();
      var executorGroups = tile.executorGroups[getUid(layer)];
      replayState.renderedTileRevision = revision;
      var tileCoord = tile.wrappedTileCoord;
      var z = tileCoord[0];
      var source = layer.getSource();
      var pixelRatio = frameState.pixelRatio;
      var viewState = frameState.viewState;
      var projection = viewState.projection;
      var tileGrid = source.getTileGridForProjection(projection);
      var tileResolution = tileGrid.getResolution(tile.tileCoord[0]);
      var renderPixelRatio = frameState.pixelRatio / tile.wantedResolution * tileResolution;
      var resolution = tileGrid.getResolution(z);
      var context2 = tile.getContext(layer);
      pixelRatio = Math.round(Math.max(pixelRatio, renderPixelRatio / pixelRatio));
      var size = source.getTilePixelSize(z, pixelRatio, projection);
      context2.canvas.width = size[0];
      context2.canvas.height = size[1];
      var renderScale = pixelRatio / renderPixelRatio;
      if (renderScale !== 1) {
        var canvasTransform = reset(this.tmpTransform_);
        scale2(canvasTransform, renderScale, renderScale);
        context2.setTransform.apply(context2, canvasTransform);
      }
      var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent);
      var pixelScale = renderPixelRatio / resolution;
      var transform3 = reset(this.tmpTransform_);
      scale2(transform3, pixelScale, -pixelScale);
      translate(transform3, -tileExtent[0], -tileExtent[3]);
      for (var i2 = 0, ii = executorGroups.length; i2 < ii; ++i2) {
        var executorGroup = executorGroups[i2];
        executorGroup.execute(context2, renderScale, transform3, 0, true, IMAGE_REPLAYS[layer.getRenderMode()]);
      }
      replayState.renderedTileResolution = tile.wantedResolution;
    };
    return CanvasVectorTileLayerRenderer2;
  }(TileLayer_default)
);
var VectorTileLayer_default = CanvasVectorTileLayerRenderer;

// node_modules/ol/layer/TileProperty.js
var TileProperty_default = {
  PRELOAD: "preload",
  USE_INTERIM_TILES_ON_ERROR: "useInterimTilesOnError"
};

// node_modules/ol/layer/VectorTile.js
var __extends32 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var VectorTileLayer = (
  /** @class */
  function(_super) {
    __extends32(VectorTileLayer2, _super);
    function VectorTileLayer2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var baseOptions = (
        /** @type {Object} */
        assign({}, options)
      );
      delete baseOptions.preload;
      delete baseOptions.useInterimTilesOnError;
      _this = _super.call(
        this,
        /** @type {import("./BaseVector.js").Options<import("../source/VectorTile.js").default>} */
        baseOptions
      ) || this;
      _this.on;
      _this.once;
      _this.un;
      if (options.renderMode === VectorTileRenderType_default.IMAGE) {
        console.warn('renderMode: "image" is deprecated. Option ignored.');
        options.renderMode = void 0;
      }
      var renderMode = options.renderMode || VectorTileRenderType_default.HYBRID;
      assert(renderMode == VectorTileRenderType_default.HYBRID || renderMode == VectorTileRenderType_default.VECTOR, 28);
      _this.renderMode_ = renderMode;
      _this.setPreload(options.preload ? options.preload : 0);
      _this.setUseInterimTilesOnError(options.useInterimTilesOnError !== void 0 ? options.useInterimTilesOnError : true);
      _this.getBackground;
      _this.setBackground;
      return _this;
    }
    VectorTileLayer2.prototype.createRenderer = function() {
      return new VectorTileLayer_default(this);
    };
    VectorTileLayer2.prototype.getFeatures = function(pixel) {
      return _super.prototype.getFeatures.call(this, pixel);
    };
    VectorTileLayer2.prototype.getRenderMode = function() {
      return this.renderMode_;
    };
    VectorTileLayer2.prototype.getPreload = function() {
      return (
        /** @type {number} */
        this.get(TileProperty_default.PRELOAD)
      );
    };
    VectorTileLayer2.prototype.getUseInterimTilesOnError = function() {
      return (
        /** @type {boolean} */
        this.get(TileProperty_default.USE_INTERIM_TILES_ON_ERROR)
      );
    };
    VectorTileLayer2.prototype.setPreload = function(preload) {
      this.set(TileProperty_default.PRELOAD, preload);
    };
    VectorTileLayer2.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) {
      this.set(TileProperty_default.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
    };
    return VectorTileLayer2;
  }(BaseVector_default)
);
var VectorTile_default = VectorTileLayer;

// node_modules/ol/VectorTile.js
var __extends33 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var VectorTile = (
  /** @class */
  function(_super) {
    __extends33(VectorTile3, _super);
    function VectorTile3(tileCoord, state2, src, format, tileLoadFunction, opt_options) {
      var _this = _super.call(this, tileCoord, state2, opt_options) || this;
      _this.extent = null;
      _this.format_ = format;
      _this.features_ = null;
      _this.loader_;
      _this.projection = null;
      _this.resolution;
      _this.tileLoadFunction_ = tileLoadFunction;
      _this.url_ = src;
      _this.key = src;
      return _this;
    }
    VectorTile3.prototype.getFormat = function() {
      return this.format_;
    };
    VectorTile3.prototype.getFeatures = function() {
      return this.features_;
    };
    VectorTile3.prototype.load = function() {
      if (this.state == TileState_default.IDLE) {
        this.setState(TileState_default.LOADING);
        this.tileLoadFunction_(this, this.url_);
        if (this.loader_) {
          this.loader_(this.extent, this.resolution, this.projection);
        }
      }
    };
    VectorTile3.prototype.onLoad = function(features, dataProjection) {
      this.setFeatures(features);
    };
    VectorTile3.prototype.onError = function() {
      this.setState(TileState_default.ERROR);
    };
    VectorTile3.prototype.setFeatures = function(features) {
      this.features_ = features;
      this.setState(TileState_default.LOADED);
    };
    VectorTile3.prototype.setLoader = function(loader) {
      this.loader_ = loader;
    };
    return VectorTile3;
  }(Tile_default)
);
var VectorTile_default2 = VectorTile;

// node_modules/ol/structs/LRUCache.js
var LRUCache = (
  /** @class */
  function() {
    function LRUCache2(opt_highWaterMark) {
      this.highWaterMark = opt_highWaterMark !== void 0 ? opt_highWaterMark : 2048;
      this.count_ = 0;
      this.entries_ = {};
      this.oldest_ = null;
      this.newest_ = null;
    }
    LRUCache2.prototype.canExpireCache = function() {
      return this.highWaterMark > 0 && this.getCount() > this.highWaterMark;
    };
    LRUCache2.prototype.expireCache = function(keep) {
      while (this.canExpireCache()) {
        this.pop();
      }
    };
    LRUCache2.prototype.clear = function() {
      this.count_ = 0;
      this.entries_ = {};
      this.oldest_ = null;
      this.newest_ = null;
    };
    LRUCache2.prototype.containsKey = function(key) {
      return this.entries_.hasOwnProperty(key);
    };
    LRUCache2.prototype.forEach = function(f) {
      var entry = this.oldest_;
      while (entry) {
        f(entry.value_, entry.key_, this);
        entry = entry.newer;
      }
    };
    LRUCache2.prototype.get = function(key, opt_options) {
      var entry = this.entries_[key];
      assert(entry !== void 0, 15);
      if (entry === this.newest_) {
        return entry.value_;
      } else if (entry === this.oldest_) {
        this.oldest_ = /** @type {Entry} */
        this.oldest_.newer;
        this.oldest_.older = null;
      } else {
        entry.newer.older = entry.older;
        entry.older.newer = entry.newer;
      }
      entry.newer = null;
      entry.older = this.newest_;
      this.newest_.newer = entry;
      this.newest_ = entry;
      return entry.value_;
    };
    LRUCache2.prototype.remove = function(key) {
      var entry = this.entries_[key];
      assert(entry !== void 0, 15);
      if (entry === this.newest_) {
        this.newest_ = /** @type {Entry} */
        entry.older;
        if (this.newest_) {
          this.newest_.newer = null;
        }
      } else if (entry === this.oldest_) {
        this.oldest_ = /** @type {Entry} */
        entry.newer;
        if (this.oldest_) {
          this.oldest_.older = null;
        }
      } else {
        entry.newer.older = entry.older;
        entry.older.newer = entry.newer;
      }
      delete this.entries_[key];
      --this.count_;
      return entry.value_;
    };
    LRUCache2.prototype.getCount = function() {
      return this.count_;
    };
    LRUCache2.prototype.getKeys = function() {
      var keys = new Array(this.count_);
      var i2 = 0;
      var entry;
      for (entry = this.newest_; entry; entry = entry.older) {
        keys[i2++] = entry.key_;
      }
      return keys;
    };
    LRUCache2.prototype.getValues = function() {
      var values = new Array(this.count_);
      var i2 = 0;
      var entry;
      for (entry = this.newest_; entry; entry = entry.older) {
        values[i2++] = entry.value_;
      }
      return values;
    };
    LRUCache2.prototype.peekLast = function() {
      return this.oldest_.value_;
    };
    LRUCache2.prototype.peekLastKey = function() {
      return this.oldest_.key_;
    };
    LRUCache2.prototype.peekFirstKey = function() {
      return this.newest_.key_;
    };
    LRUCache2.prototype.peek = function(key) {
      if (!this.containsKey(key)) {
        return void 0;
      }
      return this.entries_[key].value_;
    };
    LRUCache2.prototype.pop = function() {
      var entry = this.oldest_;
      delete this.entries_[entry.key_];
      if (entry.newer) {
        entry.newer.older = null;
      }
      this.oldest_ = /** @type {Entry} */
      entry.newer;
      if (!this.oldest_) {
        this.newest_ = null;
      }
      --this.count_;
      return entry.value_;
    };
    LRUCache2.prototype.replace = function(key, value) {
      this.get(key);
      this.entries_[key].value_ = value;
    };
    LRUCache2.prototype.set = function(key, value) {
      assert(!(key in this.entries_), 16);
      var entry = {
        key_: key,
        newer: null,
        older: this.newest_,
        value_: value
      };
      if (!this.newest_) {
        this.oldest_ = entry;
      } else {
        this.newest_.newer = entry;
      }
      this.newest_ = entry;
      this.entries_[key] = entry;
      ++this.count_;
    };
    LRUCache2.prototype.setSize = function(size) {
      this.highWaterMark = size;
    };
    return LRUCache2;
  }()
);
var LRUCache_default = LRUCache;

// node_modules/ol/tilecoord.js
function createOrUpdate3(z, x, y, opt_tileCoord) {
  if (opt_tileCoord !== void 0) {
    opt_tileCoord[0] = z;
    opt_tileCoord[1] = x;
    opt_tileCoord[2] = y;
    return opt_tileCoord;
  } else {
    return [z, x, y];
  }
}
function getKeyZXY(z, x, y) {
  return z + "/" + x + "/" + y;
}
function getKey3(tileCoord) {
  return getKeyZXY(tileCoord[0], tileCoord[1], tileCoord[2]);
}
function getCacheKeyForTileKey(tileKey) {
  var _a56 = tileKey.substring(tileKey.lastIndexOf("/") + 1, tileKey.length).split(",").map(Number), z = _a56[0], x = _a56[1], y = _a56[2];
  return getKeyZXY(z, x, y);
}
function fromKey(key) {
  return key.split("/").map(Number);
}
function hash(tileCoord) {
  return (tileCoord[1] << tileCoord[0]) + tileCoord[2];
}
function withinExtentAndZ(tileCoord, tileGrid) {
  var z = tileCoord[0];
  var x = tileCoord[1];
  var y = tileCoord[2];
  if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) {
    return false;
  }
  var tileRange = tileGrid.getFullTileRange(z);
  if (!tileRange) {
    return true;
  } else {
    return tileRange.containsXY(x, y);
  }
}

// node_modules/ol/TileCache.js
var __extends34 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileCache = (
  /** @class */
  function(_super) {
    __extends34(TileCache2, _super);
    function TileCache2() {
      return _super !== null && _super.apply(this, arguments) || this;
    }
    TileCache2.prototype.expireCache = function(usedTiles) {
      while (this.canExpireCache()) {
        var tile = this.peekLast();
        if (tile.getKey() in usedTiles) {
          break;
        } else {
          this.pop().release();
        }
      }
    };
    TileCache2.prototype.pruneExceptNewestZ = function() {
      if (this.getCount() === 0) {
        return;
      }
      var key = this.peekFirstKey();
      var tileCoord = fromKey(key);
      var z = tileCoord[0];
      this.forEach((function(tile) {
        if (tile.tileCoord[0] !== z) {
          this.remove(getKey3(tile.tileCoord));
          tile.release();
        }
      }).bind(this));
    };
    return TileCache2;
  }(LRUCache_default)
);
var TileCache_default = TileCache;

// node_modules/ol/tilegrid/common.js
var DEFAULT_MAX_ZOOM = 42;
var DEFAULT_TILE_SIZE = 256;

// node_modules/ol/geom/flat/segments.js
function forEach(flatCoordinates, offset2, end, stride, callback) {
  var ret;
  offset2 += stride;
  for (; offset2 < end; offset2 += stride) {
    ret = callback(flatCoordinates.slice(offset2 - stride, offset2), flatCoordinates.slice(offset2, offset2 + stride));
    if (ret) {
      return ret;
    }
  }
  return false;
}

// node_modules/ol/geom/flat/contains.js
function linearRingContainsExtent(flatCoordinates, offset2, end, stride, extent) {
  var outside = forEachCorner(
    extent,
    /**
     * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
     * @return {boolean} Contains (x, y).
     */
    function(coordinate) {
      return !linearRingContainsXY(flatCoordinates, offset2, end, stride, coordinate[0], coordinate[1]);
    }
  );
  return !outside;
}
function linearRingContainsXY(flatCoordinates, offset2, end, stride, x, y) {
  var wn = 0;
  var x1 = flatCoordinates[end - stride];
  var y1 = flatCoordinates[end - stride + 1];
  for (; offset2 < end; offset2 += stride) {
    var x2 = flatCoordinates[offset2];
    var y2 = flatCoordinates[offset2 + 1];
    if (y1 <= y) {
      if (y2 > y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) > 0) {
        wn++;
      }
    } else if (y2 <= y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) < 0) {
      wn--;
    }
    x1 = x2;
    y1 = y2;
  }
  return wn !== 0;
}
function linearRingsContainsXY(flatCoordinates, offset2, ends, stride, x, y) {
  if (ends.length === 0) {
    return false;
  }
  if (!linearRingContainsXY(flatCoordinates, offset2, ends[0], stride, x, y)) {
    return false;
  }
  for (var i2 = 1, ii = ends.length; i2 < ii; ++i2) {
    if (linearRingContainsXY(flatCoordinates, ends[i2 - 1], ends[i2], stride, x, y)) {
      return false;
    }
  }
  return true;
}
function linearRingssContainsXY(flatCoordinates, offset2, endss, stride, x, y) {
  if (endss.length === 0) {
    return false;
  }
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    if (linearRingsContainsXY(flatCoordinates, offset2, ends, stride, x, y)) {
      return true;
    }
    offset2 = ends[ends.length - 1];
  }
  return false;
}

// node_modules/ol/geom/flat/intersectsextent.js
function intersectsLineString(flatCoordinates, offset2, end, stride, extent) {
  var coordinatesExtent = extendFlatCoordinates(createEmpty(), flatCoordinates, offset2, end, stride);
  if (!intersects(extent, coordinatesExtent)) {
    return false;
  }
  if (containsExtent(extent, coordinatesExtent)) {
    return true;
  }
  if (coordinatesExtent[0] >= extent[0] && coordinatesExtent[2] <= extent[2]) {
    return true;
  }
  if (coordinatesExtent[1] >= extent[1] && coordinatesExtent[3] <= extent[3]) {
    return true;
  }
  return forEach(
    flatCoordinates,
    offset2,
    end,
    stride,
    /**
     * @param {import("../../coordinate.js").Coordinate} point1 Start point.
     * @param {import("../../coordinate.js").Coordinate} point2 End point.
     * @return {boolean} `true` if the segment and the extent intersect,
     *     `false` otherwise.
     */
    function(point1, point2) {
      return intersectsSegment(extent, point1, point2);
    }
  );
}
function intersectsLineStringArray(flatCoordinates, offset2, ends, stride, extent) {
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    if (intersectsLineString(flatCoordinates, offset2, ends[i2], stride, extent)) {
      return true;
    }
    offset2 = ends[i2];
  }
  return false;
}
function intersectsLinearRing(flatCoordinates, offset2, end, stride, extent) {
  if (intersectsLineString(flatCoordinates, offset2, end, stride, extent)) {
    return true;
  }
  if (linearRingContainsXY(flatCoordinates, offset2, end, stride, extent[0], extent[1])) {
    return true;
  }
  if (linearRingContainsXY(flatCoordinates, offset2, end, stride, extent[0], extent[3])) {
    return true;
  }
  if (linearRingContainsXY(flatCoordinates, offset2, end, stride, extent[2], extent[1])) {
    return true;
  }
  if (linearRingContainsXY(flatCoordinates, offset2, end, stride, extent[2], extent[3])) {
    return true;
  }
  return false;
}
function intersectsLinearRingArray(flatCoordinates, offset2, ends, stride, extent) {
  if (!intersectsLinearRing(flatCoordinates, offset2, ends[0], stride, extent)) {
    return false;
  }
  if (ends.length === 1) {
    return true;
  }
  for (var i2 = 1, ii = ends.length; i2 < ii; ++i2) {
    if (linearRingContainsExtent(flatCoordinates, ends[i2 - 1], ends[i2], stride, extent)) {
      if (!intersectsLineString(flatCoordinates, ends[i2 - 1], ends[i2], stride, extent)) {
        return false;
      }
    }
  }
  return true;
}
function intersectsLinearRingMultiArray(flatCoordinates, offset2, endss, stride, extent) {
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    if (intersectsLinearRingArray(flatCoordinates, offset2, ends, stride, extent)) {
      return true;
    }
    offset2 = ends[ends.length - 1];
  }
  return false;
}

// node_modules/ol/tilegrid/TileGrid.js
var tmpTileCoord = [0, 0, 0];
var DECIMALS = 5;
var TileGrid = (
  /** @class */
  function() {
    function TileGrid2(options) {
      this.minZoom = options.minZoom !== void 0 ? options.minZoom : 0;
      this.resolutions_ = options.resolutions;
      assert(isSorted(this.resolutions_, function(a, b) {
        return b - a;
      }, true), 17);
      var zoomFactor;
      if (!options.origins) {
        for (var i2 = 0, ii = this.resolutions_.length - 1; i2 < ii; ++i2) {
          if (!zoomFactor) {
            zoomFactor = this.resolutions_[i2] / this.resolutions_[i2 + 1];
          } else {
            if (this.resolutions_[i2] / this.resolutions_[i2 + 1] !== zoomFactor) {
              zoomFactor = void 0;
              break;
            }
          }
        }
      }
      this.zoomFactor_ = zoomFactor;
      this.maxZoom = this.resolutions_.length - 1;
      this.origin_ = options.origin !== void 0 ? options.origin : null;
      this.origins_ = null;
      if (options.origins !== void 0) {
        this.origins_ = options.origins;
        assert(this.origins_.length == this.resolutions_.length, 20);
      }
      var extent = options.extent;
      if (extent !== void 0 && !this.origin_ && !this.origins_) {
        this.origin_ = getTopLeft(extent);
      }
      assert(!this.origin_ && this.origins_ || this.origin_ && !this.origins_, 18);
      this.tileSizes_ = null;
      if (options.tileSizes !== void 0) {
        this.tileSizes_ = options.tileSizes;
        assert(this.tileSizes_.length == this.resolutions_.length, 19);
      }
      this.tileSize_ = options.tileSize !== void 0 ? options.tileSize : !this.tileSizes_ ? DEFAULT_TILE_SIZE : null;
      assert(!this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_, 22);
      this.extent_ = extent !== void 0 ? extent : null;
      this.fullTileRanges_ = null;
      this.tmpSize_ = [0, 0];
      this.tmpExtent_ = [0, 0, 0, 0];
      if (options.sizes !== void 0) {
        this.fullTileRanges_ = options.sizes.map(function(size, z) {
          var tileRange = new TileRange_default(Math.min(0, size[0]), Math.max(size[0] - 1, -1), Math.min(0, size[1]), Math.max(size[1] - 1, -1));
          if (extent) {
            var restrictedTileRange = this.getTileRangeForExtentAndZ(extent, z);
            tileRange.minX = Math.max(restrictedTileRange.minX, tileRange.minX);
            tileRange.maxX = Math.min(restrictedTileRange.maxX, tileRange.maxX);
            tileRange.minY = Math.max(restrictedTileRange.minY, tileRange.minY);
            tileRange.maxY = Math.min(restrictedTileRange.maxY, tileRange.maxY);
          }
          return tileRange;
        }, this);
      } else if (extent) {
        this.calculateTileRanges_(extent);
      }
    }
    TileGrid2.prototype.forEachTileCoord = function(extent, zoom, callback) {
      var tileRange = this.getTileRangeForExtentAndZ(extent, zoom);
      for (var i2 = tileRange.minX, ii = tileRange.maxX; i2 <= ii; ++i2) {
        for (var j = tileRange.minY, jj = tileRange.maxY; j <= jj; ++j) {
          callback([zoom, i2, j]);
        }
      }
    };
    TileGrid2.prototype.forEachTileCoordParentTileRange = function(tileCoord, callback, opt_tileRange, opt_extent) {
      var tileRange, x, y;
      var tileCoordExtent = null;
      var z = tileCoord[0] - 1;
      if (this.zoomFactor_ === 2) {
        x = tileCoord[1];
        y = tileCoord[2];
      } else {
        tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent);
      }
      while (z >= this.minZoom) {
        if (this.zoomFactor_ === 2) {
          x = Math.floor(x / 2);
          y = Math.floor(y / 2);
          tileRange = createOrUpdate2(x, x, y, y, opt_tileRange);
        } else {
          tileRange = this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange);
        }
        if (callback(z, tileRange)) {
          return true;
        }
        --z;
      }
      return false;
    };
    TileGrid2.prototype.getExtent = function() {
      return this.extent_;
    };
    TileGrid2.prototype.getMaxZoom = function() {
      return this.maxZoom;
    };
    TileGrid2.prototype.getMinZoom = function() {
      return this.minZoom;
    };
    TileGrid2.prototype.getOrigin = function(z) {
      if (this.origin_) {
        return this.origin_;
      } else {
        return this.origins_[z];
      }
    };
    TileGrid2.prototype.getResolution = function(z) {
      return this.resolutions_[z];
    };
    TileGrid2.prototype.getResolutions = function() {
      return this.resolutions_;
    };
    TileGrid2.prototype.getTileCoordChildTileRange = function(tileCoord, opt_tileRange, opt_extent) {
      if (tileCoord[0] < this.maxZoom) {
        if (this.zoomFactor_ === 2) {
          var minX = tileCoord[1] * 2;
          var minY = tileCoord[2] * 2;
          return createOrUpdate2(minX, minX + 1, minY, minY + 1, opt_tileRange);
        }
        var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent || this.tmpExtent_);
        return this.getTileRangeForExtentAndZ(tileCoordExtent, tileCoord[0] + 1, opt_tileRange);
      }
      return null;
    };
    TileGrid2.prototype.getTileRangeForTileCoordAndZ = function(tileCoord, z, opt_tileRange) {
      if (z > this.maxZoom || z < this.minZoom) {
        return null;
      }
      var tileCoordZ = tileCoord[0];
      var tileCoordX = tileCoord[1];
      var tileCoordY = tileCoord[2];
      if (z === tileCoordZ) {
        return createOrUpdate2(tileCoordX, tileCoordY, tileCoordX, tileCoordY, opt_tileRange);
      }
      if (this.zoomFactor_) {
        var factor = Math.pow(this.zoomFactor_, z - tileCoordZ);
        var minX = Math.floor(tileCoordX * factor);
        var minY = Math.floor(tileCoordY * factor);
        if (z < tileCoordZ) {
          return createOrUpdate2(minX, minX, minY, minY, opt_tileRange);
        }
        var maxX = Math.floor(factor * (tileCoordX + 1)) - 1;
        var maxY = Math.floor(factor * (tileCoordY + 1)) - 1;
        return createOrUpdate2(minX, maxX, minY, maxY, opt_tileRange);
      }
      var tileCoordExtent = this.getTileCoordExtent(tileCoord, this.tmpExtent_);
      return this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange);
    };
    TileGrid2.prototype.getTileRangeExtent = function(z, tileRange, opt_extent) {
      var origin = this.getOrigin(z);
      var resolution = this.getResolution(z);
      var tileSize = toSize(this.getTileSize(z), this.tmpSize_);
      var minX = origin[0] + tileRange.minX * tileSize[0] * resolution;
      var maxX = origin[0] + (tileRange.maxX + 1) * tileSize[0] * resolution;
      var minY = origin[1] + tileRange.minY * tileSize[1] * resolution;
      var maxY = origin[1] + (tileRange.maxY + 1) * tileSize[1] * resolution;
      return createOrUpdate(minX, minY, maxX, maxY, opt_extent);
    };
    TileGrid2.prototype.getTileRangeForExtentAndZ = function(extent, z, opt_tileRange) {
      var tileCoord = tmpTileCoord;
      this.getTileCoordForXYAndZ_(extent[0], extent[3], z, false, tileCoord);
      var minX = tileCoord[1];
      var minY = tileCoord[2];
      this.getTileCoordForXYAndZ_(extent[2], extent[1], z, true, tileCoord);
      return createOrUpdate2(minX, tileCoord[1], minY, tileCoord[2], opt_tileRange);
    };
    TileGrid2.prototype.getTileCoordCenter = function(tileCoord) {
      var origin = this.getOrigin(tileCoord[0]);
      var resolution = this.getResolution(tileCoord[0]);
      var tileSize = toSize(this.getTileSize(tileCoord[0]), this.tmpSize_);
      return [
        origin[0] + (tileCoord[1] + 0.5) * tileSize[0] * resolution,
        origin[1] - (tileCoord[2] + 0.5) * tileSize[1] * resolution
      ];
    };
    TileGrid2.prototype.getTileCoordExtent = function(tileCoord, opt_extent) {
      var origin = this.getOrigin(tileCoord[0]);
      var resolution = this.getResolution(tileCoord[0]);
      var tileSize = toSize(this.getTileSize(tileCoord[0]), this.tmpSize_);
      var minX = origin[0] + tileCoord[1] * tileSize[0] * resolution;
      var minY = origin[1] - (tileCoord[2] + 1) * tileSize[1] * resolution;
      var maxX = minX + tileSize[0] * resolution;
      var maxY = minY + tileSize[1] * resolution;
      return createOrUpdate(minX, minY, maxX, maxY, opt_extent);
    };
    TileGrid2.prototype.getTileCoordForCoordAndResolution = function(coordinate, resolution, opt_tileCoord) {
      return this.getTileCoordForXYAndResolution_(coordinate[0], coordinate[1], resolution, false, opt_tileCoord);
    };
    TileGrid2.prototype.getTileCoordForXYAndResolution_ = function(x, y, resolution, reverseIntersectionPolicy, opt_tileCoord) {
      var z = this.getZForResolution(resolution);
      var scale5 = resolution / this.getResolution(z);
      var origin = this.getOrigin(z);
      var tileSize = toSize(this.getTileSize(z), this.tmpSize_);
      var tileCoordX = scale5 * (x - origin[0]) / resolution / tileSize[0];
      var tileCoordY = scale5 * (origin[1] - y) / resolution / tileSize[1];
      if (reverseIntersectionPolicy) {
        tileCoordX = ceil(tileCoordX, DECIMALS) - 1;
        tileCoordY = ceil(tileCoordY, DECIMALS) - 1;
      } else {
        tileCoordX = floor(tileCoordX, DECIMALS);
        tileCoordY = floor(tileCoordY, DECIMALS);
      }
      return createOrUpdate3(z, tileCoordX, tileCoordY, opt_tileCoord);
    };
    TileGrid2.prototype.getTileCoordForXYAndZ_ = function(x, y, z, reverseIntersectionPolicy, opt_tileCoord) {
      var origin = this.getOrigin(z);
      var resolution = this.getResolution(z);
      var tileSize = toSize(this.getTileSize(z), this.tmpSize_);
      var tileCoordX = (x - origin[0]) / resolution / tileSize[0];
      var tileCoordY = (origin[1] - y) / resolution / tileSize[1];
      if (reverseIntersectionPolicy) {
        tileCoordX = ceil(tileCoordX, DECIMALS) - 1;
        tileCoordY = ceil(tileCoordY, DECIMALS) - 1;
      } else {
        tileCoordX = floor(tileCoordX, DECIMALS);
        tileCoordY = floor(tileCoordY, DECIMALS);
      }
      return createOrUpdate3(z, tileCoordX, tileCoordY, opt_tileCoord);
    };
    TileGrid2.prototype.getTileCoordForCoordAndZ = function(coordinate, z, opt_tileCoord) {
      return this.getTileCoordForXYAndZ_(coordinate[0], coordinate[1], z, false, opt_tileCoord);
    };
    TileGrid2.prototype.getTileCoordResolution = function(tileCoord) {
      return this.resolutions_[tileCoord[0]];
    };
    TileGrid2.prototype.getTileSize = function(z) {
      if (this.tileSize_) {
        return this.tileSize_;
      } else {
        return this.tileSizes_[z];
      }
    };
    TileGrid2.prototype.getFullTileRange = function(z) {
      if (!this.fullTileRanges_) {
        return this.extent_ ? this.getTileRangeForExtentAndZ(this.extent_, z) : null;
      } else {
        return this.fullTileRanges_[z];
      }
    };
    TileGrid2.prototype.getZForResolution = function(resolution, opt_direction) {
      var z = linearFindNearest(this.resolutions_, resolution, opt_direction || 0);
      return clamp(z, this.minZoom, this.maxZoom);
    };
    TileGrid2.prototype.tileCoordIntersectsViewport = function(tileCoord, viewport) {
      return intersectsLinearRing(viewport, 0, viewport.length, 2, this.getTileCoordExtent(tileCoord));
    };
    TileGrid2.prototype.calculateTileRanges_ = function(extent) {
      var length = this.resolutions_.length;
      var fullTileRanges = new Array(length);
      for (var z = this.minZoom; z < length; ++z) {
        fullTileRanges[z] = this.getTileRangeForExtentAndZ(extent, z);
      }
      this.fullTileRanges_ = fullTileRanges;
    };
    return TileGrid2;
  }()
);
var TileGrid_default = TileGrid;

// node_modules/ol/source/TileEventType.js
var TileEventType_default = {
  /**
   * Triggered when a tile starts loading.
   * @event module:ol/source/Tile.TileSourceEvent#tileloadstart
   * @api
   */
  TILELOADSTART: "tileloadstart",
  /**
   * Triggered when a tile finishes loading, either when its data is loaded,
   * or when loading was aborted because the tile is no longer needed.
   * @event module:ol/source/Tile.TileSourceEvent#tileloadend
   * @api
   */
  TILELOADEND: "tileloadend",
  /**
   * Triggered if tile loading results in an error.
   * @event module:ol/source/Tile.TileSourceEvent#tileloaderror
   * @api
   */
  TILELOADERROR: "tileloaderror"
};

// node_modules/ol/source/Source.js
var __extends35 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Source = (
  /** @class */
  function(_super) {
    __extends35(Source2, _super);
    function Source2(options) {
      var _this = _super.call(this) || this;
      _this.projection = get3(options.projection);
      _this.attributions_ = adaptAttributions(options.attributions);
      _this.attributionsCollapsible_ = options.attributionsCollapsible !== void 0 ? options.attributionsCollapsible : true;
      _this.loading = false;
      _this.state_ = options.state !== void 0 ? options.state : "ready";
      _this.wrapX_ = options.wrapX !== void 0 ? options.wrapX : false;
      _this.interpolate_ = !!options.interpolate;
      _this.viewResolver = null;
      _this.viewRejector = null;
      var self2 = _this;
      _this.viewPromise_ = new Promise(function(resolve, reject) {
        self2.viewResolver = resolve;
        self2.viewRejector = reject;
      });
      return _this;
    }
    Source2.prototype.getAttributions = function() {
      return this.attributions_;
    };
    Source2.prototype.getAttributionsCollapsible = function() {
      return this.attributionsCollapsible_;
    };
    Source2.prototype.getProjection = function() {
      return this.projection;
    };
    Source2.prototype.getResolutions = function() {
      return abstract();
    };
    Source2.prototype.getView = function() {
      return this.viewPromise_;
    };
    Source2.prototype.getState = function() {
      return this.state_;
    };
    Source2.prototype.getWrapX = function() {
      return this.wrapX_;
    };
    Source2.prototype.getInterpolate = function() {
      return this.interpolate_;
    };
    Source2.prototype.refresh = function() {
      this.changed();
    };
    Source2.prototype.setAttributions = function(attributions) {
      this.attributions_ = adaptAttributions(attributions);
      this.changed();
    };
    Source2.prototype.setState = function(state2) {
      this.state_ = state2;
      this.changed();
    };
    return Source2;
  }(Object_default)
);
function adaptAttributions(attributionLike) {
  if (!attributionLike) {
    return null;
  }
  if (Array.isArray(attributionLike)) {
    return function(frameState) {
      return attributionLike;
    };
  }
  if (typeof attributionLike === "function") {
    return attributionLike;
  }
  return function(frameState) {
    return [attributionLike];
  };
}
var Source_default = Source;

// node_modules/ol/tilegrid.js
function getForProjection(projection) {
  var tileGrid = projection.getDefaultTileGrid();
  if (!tileGrid) {
    tileGrid = createForProjection(projection);
    projection.setDefaultTileGrid(tileGrid);
  }
  return tileGrid;
}
function wrapX3(tileGrid, tileCoord, projection) {
  var z = tileCoord[0];
  var center = tileGrid.getTileCoordCenter(tileCoord);
  var projectionExtent = extentFromProjection(projection);
  if (!containsCoordinate(projectionExtent, center)) {
    var worldWidth = getWidth(projectionExtent);
    var worldsAway = Math.ceil((projectionExtent[0] - center[0]) / worldWidth);
    center[0] += worldWidth * worldsAway;
    return tileGrid.getTileCoordForCoordAndZ(center, z);
  } else {
    return tileCoord;
  }
}
function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
  var corner = opt_corner !== void 0 ? opt_corner : "top-left";
  var resolutions = resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize);
  return new TileGrid_default({
    extent,
    origin: getCorner(extent, corner),
    resolutions,
    tileSize: opt_tileSize
  });
}
function createXYZ(opt_options) {
  var xyzOptions = opt_options || {};
  var extent = xyzOptions.extent || get3("EPSG:3857").getExtent();
  var gridOptions = {
    extent,
    minZoom: xyzOptions.minZoom,
    tileSize: xyzOptions.tileSize,
    resolutions: resolutionsFromExtent(extent, xyzOptions.maxZoom, xyzOptions.tileSize, xyzOptions.maxResolution)
  };
  return new TileGrid_default(gridOptions);
}
function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize, opt_maxResolution) {
  var maxZoom = opt_maxZoom !== void 0 ? opt_maxZoom : DEFAULT_MAX_ZOOM;
  var height = getHeight(extent);
  var width = getWidth(extent);
  var tileSize = toSize(opt_tileSize !== void 0 ? opt_tileSize : DEFAULT_TILE_SIZE);
  var maxResolution = opt_maxResolution > 0 ? opt_maxResolution : Math.max(width / tileSize[0], height / tileSize[1]);
  var length = maxZoom + 1;
  var resolutions = new Array(length);
  for (var z = 0; z < length; ++z) {
    resolutions[z] = maxResolution / Math.pow(2, z);
  }
  return resolutions;
}
function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) {
  var extent = extentFromProjection(projection);
  return createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner);
}
function extentFromProjection(projection) {
  projection = get3(projection);
  var extent = projection.getExtent();
  if (!extent) {
    var half = 180 * METERS_PER_UNIT[Units_default.DEGREES] / projection.getMetersPerUnit();
    extent = createOrUpdate(-half, -half, half, half);
  }
  return extent;
}

// node_modules/ol/source/Tile.js
var __extends36 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileSource = (
  /** @class */
  function(_super) {
    __extends36(TileSource2, _super);
    function TileSource2(options) {
      var _this = _super.call(this, {
        attributions: options.attributions,
        attributionsCollapsible: options.attributionsCollapsible,
        projection: options.projection,
        state: options.state,
        wrapX: options.wrapX,
        interpolate: options.interpolate
      }) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.opaque_ = options.opaque !== void 0 ? options.opaque : false;
      _this.tilePixelRatio_ = options.tilePixelRatio !== void 0 ? options.tilePixelRatio : 1;
      _this.tileGrid = options.tileGrid !== void 0 ? options.tileGrid : null;
      var tileSize = [256, 256];
      if (_this.tileGrid) {
        toSize(_this.tileGrid.getTileSize(_this.tileGrid.getMinZoom()), tileSize);
      }
      _this.tileCache = new TileCache_default(options.cacheSize || 0);
      _this.tmpSize = [0, 0];
      _this.key_ = options.key || "";
      _this.tileOptions = {
        transition: options.transition,
        interpolate: options.interpolate
      };
      _this.zDirection = options.zDirection ? options.zDirection : 0;
      return _this;
    }
    TileSource2.prototype.canExpireCache = function() {
      return this.tileCache.canExpireCache();
    };
    TileSource2.prototype.expireCache = function(projection, usedTiles) {
      var tileCache = this.getTileCacheForProjection(projection);
      if (tileCache) {
        tileCache.expireCache(usedTiles);
      }
    };
    TileSource2.prototype.forEachLoadedTile = function(projection, z, tileRange, callback) {
      var tileCache = this.getTileCacheForProjection(projection);
      if (!tileCache) {
        return false;
      }
      var covered = true;
      var tile, tileCoordKey, loaded;
      for (var x = tileRange.minX; x <= tileRange.maxX; ++x) {
        for (var y = tileRange.minY; y <= tileRange.maxY; ++y) {
          tileCoordKey = getKeyZXY(z, x, y);
          loaded = false;
          if (tileCache.containsKey(tileCoordKey)) {
            tile = /** @type {!import("../Tile.js").default} */
            tileCache.get(tileCoordKey);
            loaded = tile.getState() === TileState_default.LOADED;
            if (loaded) {
              loaded = callback(tile) !== false;
            }
          }
          if (!loaded) {
            covered = false;
          }
        }
      }
      return covered;
    };
    TileSource2.prototype.getGutterForProjection = function(projection) {
      return 0;
    };
    TileSource2.prototype.getKey = function() {
      return this.key_;
    };
    TileSource2.prototype.setKey = function(key) {
      if (this.key_ !== key) {
        this.key_ = key;
        this.changed();
      }
    };
    TileSource2.prototype.getOpaque = function(projection) {
      return this.opaque_;
    };
    TileSource2.prototype.getResolutions = function() {
      if (!this.tileGrid) {
        return null;
      }
      return this.tileGrid.getResolutions();
    };
    TileSource2.prototype.getTile = function(z, x, y, pixelRatio, projection) {
      return abstract();
    };
    TileSource2.prototype.getTileGrid = function() {
      return this.tileGrid;
    };
    TileSource2.prototype.getTileGridForProjection = function(projection) {
      if (!this.tileGrid) {
        return getForProjection(projection);
      } else {
        return this.tileGrid;
      }
    };
    TileSource2.prototype.getTileCacheForProjection = function(projection) {
      var sourceProjection = this.getProjection();
      assert(
        sourceProjection === null || equivalent(sourceProjection, projection),
        68
        // A VectorTile source can only be rendered if it has a projection compatible with the view projection.
      );
      return this.tileCache;
    };
    TileSource2.prototype.getTilePixelRatio = function(pixelRatio) {
      return this.tilePixelRatio_;
    };
    TileSource2.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
      var tileGrid = this.getTileGridForProjection(projection);
      var tilePixelRatio = this.getTilePixelRatio(pixelRatio);
      var tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize);
      if (tilePixelRatio == 1) {
        return tileSize;
      } else {
        return scale(tileSize, tilePixelRatio, this.tmpSize);
      }
    };
    TileSource2.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_projection) {
      var projection = opt_projection !== void 0 ? opt_projection : this.getProjection();
      var tileGrid = this.getTileGridForProjection(projection);
      if (this.getWrapX() && projection.isGlobal()) {
        tileCoord = wrapX3(tileGrid, tileCoord, projection);
      }
      return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
    };
    TileSource2.prototype.clear = function() {
      this.tileCache.clear();
    };
    TileSource2.prototype.refresh = function() {
      this.clear();
      _super.prototype.refresh.call(this);
    };
    TileSource2.prototype.updateCacheSize = function(tileCount, projection) {
      var tileCache = this.getTileCacheForProjection(projection);
      if (tileCount > tileCache.highWaterMark) {
        tileCache.highWaterMark = tileCount;
      }
    };
    TileSource2.prototype.useTile = function(z, x, y, projection) {
    };
    return TileSource2;
  }(Source_default)
);
var TileSourceEvent = (
  /** @class */
  function(_super) {
    __extends36(TileSourceEvent2, _super);
    function TileSourceEvent2(type, tile) {
      var _this = _super.call(this, type) || this;
      _this.tile = tile;
      return _this;
    }
    return TileSourceEvent2;
  }(Event_default)
);
var Tile_default3 = TileSource;

// node_modules/ol/tileurlfunction.js
function createFromTemplate(template, tileGrid) {
  var zRegEx = /\{z\}/g;
  var xRegEx = /\{x\}/g;
  var yRegEx = /\{y\}/g;
  var dashYRegEx = /\{-y\}/g;
  return (
    /**
     * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
     * @param {number} pixelRatio Pixel ratio.
     * @param {import("./proj/Projection.js").default} projection Projection.
     * @return {string|undefined} Tile URL.
     */
    function(tileCoord, pixelRatio, projection) {
      if (!tileCoord) {
        return void 0;
      } else {
        return template.replace(zRegEx, tileCoord[0].toString()).replace(xRegEx, tileCoord[1].toString()).replace(yRegEx, tileCoord[2].toString()).replace(dashYRegEx, function() {
          var z = tileCoord[0];
          var range2 = tileGrid.getFullTileRange(z);
          assert(range2, 55);
          var y = range2.getHeight() - tileCoord[2] - 1;
          return y.toString();
        });
      }
    }
  );
}
function createFromTemplates(templates, tileGrid) {
  var len = templates.length;
  var tileUrlFunctions = new Array(len);
  for (var i2 = 0; i2 < len; ++i2) {
    tileUrlFunctions[i2] = createFromTemplate(templates[i2], tileGrid);
  }
  return createFromTileUrlFunctions(tileUrlFunctions);
}
function createFromTileUrlFunctions(tileUrlFunctions) {
  if (tileUrlFunctions.length === 1) {
    return tileUrlFunctions[0];
  }
  return (
    /**
     * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
     * @param {number} pixelRatio Pixel ratio.
     * @param {import("./proj/Projection.js").default} projection Projection.
     * @return {string|undefined} Tile URL.
     */
    function(tileCoord, pixelRatio, projection) {
      if (!tileCoord) {
        return void 0;
      } else {
        var h = hash(tileCoord);
        var index = modulo(h, tileUrlFunctions.length);
        return tileUrlFunctions[index](tileCoord, pixelRatio, projection);
      }
    }
  );
}
function expandUrl(url) {
  var urls = [];
  var match2 = /\{([a-z])-([a-z])\}/.exec(url);
  if (match2) {
    var startCharCode = match2[1].charCodeAt(0);
    var stopCharCode = match2[2].charCodeAt(0);
    var charCode = void 0;
    for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) {
      urls.push(url.replace(match2[0], String.fromCharCode(charCode)));
    }
    return urls;
  }
  match2 = /\{(\d+)-(\d+)\}/.exec(url);
  if (match2) {
    var stop_1 = parseInt(match2[2], 10);
    for (var i2 = parseInt(match2[1], 10); i2 <= stop_1; i2++) {
      urls.push(url.replace(match2[0], i2.toString()));
    }
    return urls;
  }
  urls.push(url);
  return urls;
}

// node_modules/ol/source/UrlTile.js
var __extends37 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var UrlTile = (
  /** @class */
  function(_super) {
    __extends37(UrlTile2, _super);
    function UrlTile2(options) {
      var _this = _super.call(this, {
        attributions: options.attributions,
        cacheSize: options.cacheSize,
        opaque: options.opaque,
        projection: options.projection,
        state: options.state,
        tileGrid: options.tileGrid,
        tilePixelRatio: options.tilePixelRatio,
        wrapX: options.wrapX,
        transition: options.transition,
        interpolate: options.interpolate,
        key: options.key,
        attributionsCollapsible: options.attributionsCollapsible,
        zDirection: options.zDirection
      }) || this;
      _this.generateTileUrlFunction_ = _this.tileUrlFunction === UrlTile2.prototype.tileUrlFunction;
      _this.tileLoadFunction = options.tileLoadFunction;
      if (options.tileUrlFunction) {
        _this.tileUrlFunction = options.tileUrlFunction;
      }
      _this.urls = null;
      if (options.urls) {
        _this.setUrls(options.urls);
      } else if (options.url) {
        _this.setUrl(options.url);
      }
      _this.tileLoadingKeys_ = {};
      return _this;
    }
    UrlTile2.prototype.getTileLoadFunction = function() {
      return this.tileLoadFunction;
    };
    UrlTile2.prototype.getTileUrlFunction = function() {
      return Object.getPrototypeOf(this).tileUrlFunction === this.tileUrlFunction ? this.tileUrlFunction.bind(this) : this.tileUrlFunction;
    };
    UrlTile2.prototype.getUrls = function() {
      return this.urls;
    };
    UrlTile2.prototype.handleTileChange = function(event) {
      var tile = (
        /** @type {import("../Tile.js").default} */
        event.target
      );
      var uid = getUid(tile);
      var tileState = tile.getState();
      var type;
      if (tileState == TileState_default.LOADING) {
        this.tileLoadingKeys_[uid] = true;
        type = TileEventType_default.TILELOADSTART;
      } else if (uid in this.tileLoadingKeys_) {
        delete this.tileLoadingKeys_[uid];
        type = tileState == TileState_default.ERROR ? TileEventType_default.TILELOADERROR : tileState == TileState_default.LOADED ? TileEventType_default.TILELOADEND : void 0;
      }
      if (type != void 0) {
        this.dispatchEvent(new TileSourceEvent(type, tile));
      }
    };
    UrlTile2.prototype.setTileLoadFunction = function(tileLoadFunction) {
      this.tileCache.clear();
      this.tileLoadFunction = tileLoadFunction;
      this.changed();
    };
    UrlTile2.prototype.setTileUrlFunction = function(tileUrlFunction, key) {
      this.tileUrlFunction = tileUrlFunction;
      this.tileCache.pruneExceptNewestZ();
      if (typeof key !== "undefined") {
        this.setKey(key);
      } else {
        this.changed();
      }
    };
    UrlTile2.prototype.setUrl = function(url) {
      var urls = expandUrl(url);
      this.urls = urls;
      this.setUrls(urls);
    };
    UrlTile2.prototype.setUrls = function(urls) {
      this.urls = urls;
      var key = urls.join("\n");
      if (this.generateTileUrlFunction_) {
        this.setTileUrlFunction(createFromTemplates(urls, this.tileGrid), key);
      } else {
        this.setKey(key);
      }
    };
    UrlTile2.prototype.tileUrlFunction = function(tileCoord, pixelRatio, projection) {
      return void 0;
    };
    UrlTile2.prototype.useTile = function(z, x, y) {
      var tileCoordKey = getKeyZXY(z, x, y);
      if (this.tileCache.containsKey(tileCoordKey)) {
        this.tileCache.get(tileCoordKey);
      }
    };
    return UrlTile2;
  }(Tile_default3)
);
var UrlTile_default = UrlTile;

// node_modules/ol/VectorRenderTile.js
var __extends38 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var canvasPool3 = [];
var VectorRenderTile = (
  /** @class */
  function(_super) {
    __extends38(VectorRenderTile2, _super);
    function VectorRenderTile2(tileCoord, state2, urlTileCoord, getSourceTiles) {
      var _this = _super.call(this, tileCoord, state2, { transition: 0 }) || this;
      _this.context_ = {};
      _this.executorGroups = {};
      _this.declutterExecutorGroups = {};
      _this.loadingSourceTiles = 0;
      _this.hitDetectionImageData = {};
      _this.replayState_ = {};
      _this.sourceTiles = [];
      _this.errorTileKeys = {};
      _this.wantedResolution;
      _this.getSourceTiles = getSourceTiles.bind(void 0, _this);
      _this.wrappedTileCoord = urlTileCoord;
      return _this;
    }
    VectorRenderTile2.prototype.getContext = function(layer) {
      var key = getUid(layer);
      if (!(key in this.context_)) {
        this.context_[key] = createCanvasContext2D(1, 1, canvasPool3);
      }
      return this.context_[key];
    };
    VectorRenderTile2.prototype.hasContext = function(layer) {
      return getUid(layer) in this.context_;
    };
    VectorRenderTile2.prototype.getImage = function(layer) {
      return this.hasContext(layer) ? this.getContext(layer).canvas : null;
    };
    VectorRenderTile2.prototype.getReplayState = function(layer) {
      var key = getUid(layer);
      if (!(key in this.replayState_)) {
        this.replayState_[key] = {
          dirty: false,
          renderedRenderOrder: null,
          renderedResolution: NaN,
          renderedRevision: -1,
          renderedTileResolution: NaN,
          renderedTileRevision: -1,
          renderedTileZ: -1
        };
      }
      return this.replayState_[key];
    };
    VectorRenderTile2.prototype.load = function() {
      this.getSourceTiles();
    };
    VectorRenderTile2.prototype.release = function() {
      for (var key in this.context_) {
        var context2 = this.context_[key];
        releaseCanvas(context2);
        canvasPool3.push(context2.canvas);
        delete this.context_[key];
      }
      _super.prototype.release.call(this);
    };
    return VectorRenderTile2;
  }(Tile_default)
);
var VectorRenderTile_default = VectorRenderTile;

// node_modules/ol/featureloader.js
var withCredentials = false;
function loadFeaturesXhr(url, format, extent, resolution, projection, success2, failure) {
  var xhr2 = new XMLHttpRequest();
  xhr2.open("GET", typeof url === "function" ? url(extent, resolution, projection) : url, true);
  if (format.getType() == "arraybuffer") {
    xhr2.responseType = "arraybuffer";
  }
  xhr2.withCredentials = withCredentials;
  xhr2.onload = function(event) {
    if (!xhr2.status || xhr2.status >= 200 && xhr2.status < 300) {
      var type = format.getType();
      var source = void 0;
      if (type == "json" || type == "text") {
        source = xhr2.responseText;
      } else if (type == "xml") {
        source = xhr2.responseXML;
        if (!source) {
          source = new DOMParser().parseFromString(xhr2.responseText, "application/xml");
        }
      } else if (type == "arraybuffer") {
        source = /** @type {ArrayBuffer} */
        xhr2.response;
      }
      if (source) {
        success2(
          /** @type {Array<import("./Feature.js").default>} */
          format.readFeatures(source, {
            extent,
            featureProjection: projection
          }),
          format.readProjection(source)
        );
      } else {
        failure();
      }
    } else {
      failure();
    }
  };
  xhr2.onerror = failure;
  xhr2.send();
}
function xhr(url, format) {
  return function(extent, resolution, projection, success2, failure) {
    var source = (
      /** @type {import("./source/Vector").default} */
      this
    );
    loadFeaturesXhr(
      url,
      format,
      extent,
      resolution,
      projection,
      /**
       * @param {Array<import("./Feature.js").default>} features The loaded features.
       * @param {import("./proj/Projection.js").default} dataProjection Data
       * projection.
       */
      function(features, dataProjection) {
        source.addFeatures(features);
        if (success2 !== void 0) {
          success2(features);
        }
      },
      /* FIXME handle error */
      failure ? failure : VOID
    );
  };
}

// node_modules/ol/source/VectorTile.js
var __extends39 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var VectorTile2 = (
  /** @class */
  function(_super) {
    __extends39(VectorTile3, _super);
    function VectorTile3(options) {
      var _this = this;
      var projection = options.projection || "EPSG:3857";
      var extent = options.extent || extentFromProjection(projection);
      var tileGrid = options.tileGrid || createXYZ({
        extent,
        maxResolution: options.maxResolution,
        maxZoom: options.maxZoom !== void 0 ? options.maxZoom : 22,
        minZoom: options.minZoom,
        tileSize: options.tileSize || 512
      });
      _this = _super.call(this, {
        attributions: options.attributions,
        attributionsCollapsible: options.attributionsCollapsible,
        cacheSize: options.cacheSize,
        interpolate: true,
        opaque: false,
        projection,
        state: options.state,
        tileGrid,
        tileLoadFunction: options.tileLoadFunction ? options.tileLoadFunction : defaultLoadFunction,
        tileUrlFunction: options.tileUrlFunction,
        url: options.url,
        urls: options.urls,
        wrapX: options.wrapX === void 0 ? true : options.wrapX,
        transition: options.transition,
        zDirection: options.zDirection === void 0 ? 1 : options.zDirection
      }) || this;
      _this.format_ = options.format ? options.format : null;
      _this.sourceTileCache = new TileCache_default(_this.tileCache.highWaterMark);
      _this.overlaps_ = options.overlaps == void 0 ? true : options.overlaps;
      _this.tileClass = options.tileClass ? options.tileClass : VectorTile_default2;
      _this.tileGrids_ = {};
      return _this;
    }
    VectorTile3.prototype.getFeaturesInExtent = function(extent) {
      var features = [];
      var tileCache = this.tileCache;
      if (tileCache.getCount() === 0) {
        return features;
      }
      var z = fromKey(tileCache.peekFirstKey())[0];
      var tileGrid = this.tileGrid;
      tileCache.forEach(function(tile) {
        if (tile.tileCoord[0] !== z || tile.getState() !== TileState_default.LOADED) {
          return;
        }
        var sourceTiles = tile.getSourceTiles();
        for (var i2 = 0, ii = sourceTiles.length; i2 < ii; ++i2) {
          var sourceTile = sourceTiles[i2];
          var tileCoord = sourceTile.tileCoord;
          if (intersects(extent, tileGrid.getTileCoordExtent(tileCoord))) {
            var tileFeatures = sourceTile.getFeatures();
            if (tileFeatures) {
              for (var j = 0, jj = tileFeatures.length; j < jj; ++j) {
                var candidate = tileFeatures[j];
                var geometry2 = candidate.getGeometry();
                if (intersects(extent, geometry2.getExtent())) {
                  features.push(candidate);
                }
              }
            }
          }
        }
      });
      return features;
    };
    VectorTile3.prototype.getOverlaps = function() {
      return this.overlaps_;
    };
    VectorTile3.prototype.clear = function() {
      this.tileCache.clear();
      this.sourceTileCache.clear();
    };
    VectorTile3.prototype.expireCache = function(projection, usedTiles) {
      var tileCache = this.getTileCacheForProjection(projection);
      var usedSourceTiles = Object.keys(usedTiles).reduce(function(acc, key) {
        var cacheKey = getCacheKeyForTileKey(key);
        var tile = tileCache.peek(cacheKey);
        if (tile) {
          var sourceTiles = tile.sourceTiles;
          for (var i2 = 0, ii = sourceTiles.length; i2 < ii; ++i2) {
            acc[sourceTiles[i2].getKey()] = true;
          }
        }
        return acc;
      }, {});
      _super.prototype.expireCache.call(this, projection, usedTiles);
      this.sourceTileCache.expireCache(usedSourceTiles);
    };
    VectorTile3.prototype.getSourceTiles = function(pixelRatio, projection, tile) {
      var _this = this;
      if (tile.getState() === TileState_default.IDLE) {
        tile.setState(TileState_default.LOADING);
        var urlTileCoord = tile.wrappedTileCoord;
        var tileGrid = this.getTileGridForProjection(projection);
        var extent = tileGrid.getTileCoordExtent(urlTileCoord);
        var z = urlTileCoord[0];
        var resolution = tileGrid.getResolution(z);
        buffer2(extent, -resolution, extent);
        var sourceTileGrid_1 = this.tileGrid;
        var sourceExtent = sourceTileGrid_1.getExtent();
        if (sourceExtent) {
          getIntersection(extent, sourceExtent, extent);
        }
        var sourceZ = sourceTileGrid_1.getZForResolution(resolution, this.zDirection);
        sourceTileGrid_1.forEachTileCoord(extent, sourceZ, function(sourceTileCoord) {
          var tileUrl = _this.tileUrlFunction(sourceTileCoord, pixelRatio, projection);
          var sourceTile = _this.sourceTileCache.containsKey(tileUrl) ? _this.sourceTileCache.get(tileUrl) : new _this.tileClass(sourceTileCoord, tileUrl ? TileState_default.IDLE : TileState_default.EMPTY, tileUrl, _this.format_, _this.tileLoadFunction);
          tile.sourceTiles.push(sourceTile);
          var sourceTileState = sourceTile.getState();
          if (sourceTileState < TileState_default.LOADED) {
            var listenChange_1 = function(event) {
              _this.handleTileChange(event);
              var state2 = sourceTile.getState();
              if (state2 === TileState_default.LOADED || state2 === TileState_default.ERROR) {
                var sourceTileKey = sourceTile.getKey();
                if (sourceTileKey in tile.errorTileKeys) {
                  if (sourceTile.getState() === TileState_default.LOADED) {
                    delete tile.errorTileKeys[sourceTileKey];
                  }
                } else {
                  tile.loadingSourceTiles--;
                }
                if (state2 === TileState_default.ERROR) {
                  tile.errorTileKeys[sourceTileKey] = true;
                } else {
                  sourceTile.removeEventListener(EventType_default.CHANGE, listenChange_1);
                }
                if (tile.loadingSourceTiles === 0) {
                  tile.setState(isEmpty(tile.errorTileKeys) ? TileState_default.LOADED : TileState_default.ERROR);
                }
              }
            };
            sourceTile.addEventListener(EventType_default.CHANGE, listenChange_1);
            tile.loadingSourceTiles++;
          }
          if (sourceTileState === TileState_default.IDLE) {
            sourceTile.extent = sourceTileGrid_1.getTileCoordExtent(sourceTileCoord);
            sourceTile.projection = projection;
            sourceTile.resolution = sourceTileGrid_1.getResolution(sourceTileCoord[0]);
            _this.sourceTileCache.set(tileUrl, sourceTile);
            sourceTile.load();
          }
        });
        if (!tile.loadingSourceTiles) {
          tile.setState(tile.sourceTiles.some(function(sourceTile) {
            return sourceTile.getState() === TileState_default.ERROR;
          }) ? TileState_default.ERROR : TileState_default.LOADED);
        }
      }
      return tile.sourceTiles;
    };
    VectorTile3.prototype.getTile = function(z, x, y, pixelRatio, projection) {
      var coordKey = getKeyZXY(z, x, y);
      var key = this.getKey();
      var tile;
      if (this.tileCache.containsKey(coordKey)) {
        tile = this.tileCache.get(coordKey);
        if (tile.key === key) {
          return tile;
        }
      }
      var tileCoord = [z, x, y];
      var urlTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);
      var sourceExtent = this.getTileGrid().getExtent();
      var tileGrid = this.getTileGridForProjection(projection);
      if (urlTileCoord && sourceExtent) {
        var tileExtent = tileGrid.getTileCoordExtent(urlTileCoord);
        buffer2(tileExtent, -tileGrid.getResolution(z), tileExtent);
        if (!intersects(sourceExtent, tileExtent)) {
          urlTileCoord = null;
        }
      }
      var empty = true;
      if (urlTileCoord !== null) {
        var sourceTileGrid = this.tileGrid;
        var resolution = tileGrid.getResolution(z);
        var sourceZ = sourceTileGrid.getZForResolution(resolution, 1);
        var extent = tileGrid.getTileCoordExtent(urlTileCoord);
        buffer2(extent, -resolution, extent);
        sourceTileGrid.forEachTileCoord(extent, sourceZ, (function(sourceTileCoord) {
          empty = empty && !this.tileUrlFunction(sourceTileCoord, pixelRatio, projection);
        }).bind(this));
      }
      var newTile = new VectorRenderTile_default(tileCoord, empty ? TileState_default.EMPTY : TileState_default.IDLE, urlTileCoord, this.getSourceTiles.bind(this, pixelRatio, projection));
      newTile.key = key;
      if (tile) {
        newTile.interimTile = tile;
        newTile.refreshInterimChain();
        this.tileCache.replace(coordKey, newTile);
      } else {
        this.tileCache.set(coordKey, newTile);
      }
      return newTile;
    };
    VectorTile3.prototype.getTileGridForProjection = function(projection) {
      var code = projection.getCode();
      var tileGrid = this.tileGrids_[code];
      if (!tileGrid) {
        var sourceTileGrid_2 = this.tileGrid;
        var resolutions = sourceTileGrid_2.getResolutions().slice();
        var origins = resolutions.map(function(resolution, z2) {
          return sourceTileGrid_2.getOrigin(z2);
        });
        var tileSizes = resolutions.map(function(resolution, z2) {
          return sourceTileGrid_2.getTileSize(z2);
        });
        var length_1 = DEFAULT_MAX_ZOOM + 1;
        for (var z = resolutions.length; z < length_1; ++z) {
          resolutions.push(resolutions[z - 1] / 2);
          origins.push(origins[z - 1]);
          tileSizes.push(tileSizes[z - 1]);
        }
        tileGrid = new TileGrid_default({
          extent: sourceTileGrid_2.getExtent(),
          origins,
          resolutions,
          tileSizes
        });
        this.tileGrids_[code] = tileGrid;
      }
      return tileGrid;
    };
    VectorTile3.prototype.getTilePixelRatio = function(pixelRatio) {
      return pixelRatio;
    };
    VectorTile3.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
      var tileGrid = this.getTileGridForProjection(projection);
      var tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize);
      return [
        Math.round(tileSize[0] * pixelRatio),
        Math.round(tileSize[1] * pixelRatio)
      ];
    };
    VectorTile3.prototype.updateCacheSize = function(tileCount, projection) {
      _super.prototype.updateCacheSize.call(this, tileCount * 2, projection);
      this.sourceTileCache.highWaterMark = this.getTileCacheForProjection(projection).highWaterMark;
    };
    return VectorTile3;
  }(UrlTile_default)
);
var VectorTile_default3 = VectorTile2;
function defaultLoadFunction(tile, url) {
  tile.setLoader(
    /**
     * @param {import("../extent.js").Extent} extent Extent.
     * @param {number} resolution Resolution.
     * @param {import("../proj/Projection.js").default} projection Projection.
     */
    function(extent, resolution, projection) {
      loadFeaturesXhr(url, tile.getFormat(), extent, resolution, projection, tile.onLoad.bind(tile), tile.onError.bind(tile));
    }
  );
}

// node_modules/ol/format/Feature.js
var FeatureFormat = (
  /** @class */
  function() {
    function FeatureFormat2() {
      this.dataProjection = void 0;
      this.defaultFeatureProjection = void 0;
      this.supportedMediaTypes = null;
    }
    FeatureFormat2.prototype.getReadOptions = function(source, opt_options) {
      var options;
      if (opt_options) {
        var dataProjection = opt_options.dataProjection ? get3(opt_options.dataProjection) : this.readProjection(source);
        if (opt_options.extent && dataProjection && dataProjection.getUnits() === Units_default.TILE_PIXELS) {
          dataProjection = get3(dataProjection);
          dataProjection.setWorldExtent(opt_options.extent);
        }
        options = {
          dataProjection,
          featureProjection: opt_options.featureProjection
        };
      }
      return this.adaptOptions(options);
    };
    FeatureFormat2.prototype.adaptOptions = function(options) {
      return assign({
        dataProjection: this.dataProjection,
        featureProjection: this.defaultFeatureProjection
      }, options);
    };
    FeatureFormat2.prototype.getType = function() {
      return abstract();
    };
    FeatureFormat2.prototype.readFeature = function(source, opt_options) {
      return abstract();
    };
    FeatureFormat2.prototype.readFeatures = function(source, opt_options) {
      return abstract();
    };
    FeatureFormat2.prototype.readGeometry = function(source, opt_options) {
      return abstract();
    };
    FeatureFormat2.prototype.readProjection = function(source) {
      return abstract();
    };
    FeatureFormat2.prototype.writeFeature = function(feature, opt_options) {
      return abstract();
    };
    FeatureFormat2.prototype.writeFeatures = function(features, opt_options) {
      return abstract();
    };
    FeatureFormat2.prototype.writeGeometry = function(geometry2, opt_options) {
      return abstract();
    };
    return FeatureFormat2;
  }()
);
var Feature_default = FeatureFormat;
function transformGeometryWithOptions(geometry2, write, opt_options) {
  var featureProjection = opt_options ? get3(opt_options.featureProjection) : null;
  var dataProjection = opt_options ? get3(opt_options.dataProjection) : null;
  var transformed;
  if (featureProjection && dataProjection && !equivalent(featureProjection, dataProjection)) {
    transformed = (write ? geometry2.clone() : geometry2).transform(write ? featureProjection : dataProjection, write ? dataProjection : featureProjection);
  } else {
    transformed = geometry2;
  }
  if (write && opt_options && /** @type {WriteOptions} */
  opt_options.decimals !== void 0) {
    var power_1 = Math.pow(
      10,
      /** @type {WriteOptions} */
      opt_options.decimals
    );
    var transform3 = function(coordinates2) {
      for (var i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
        coordinates2[i2] = Math.round(coordinates2[i2] * power_1) / power_1;
      }
      return coordinates2;
    };
    if (transformed === geometry2) {
      transformed = geometry2.clone();
    }
    transformed.applyTransform(transform3);
  }
  return transformed;
}

// node_modules/ol/geom/flat/closest.js
function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
  var x1 = flatCoordinates[offset1];
  var y1 = flatCoordinates[offset1 + 1];
  var dx = flatCoordinates[offset2] - x1;
  var dy = flatCoordinates[offset2 + 1] - y1;
  var offset3;
  if (dx === 0 && dy === 0) {
    offset3 = offset1;
  } else {
    var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);
    if (t > 1) {
      offset3 = offset2;
    } else if (t > 0) {
      for (var i2 = 0; i2 < stride; ++i2) {
        closestPoint[i2] = lerp(flatCoordinates[offset1 + i2], flatCoordinates[offset2 + i2], t);
      }
      closestPoint.length = stride;
      return;
    } else {
      offset3 = offset1;
    }
  }
  for (var i2 = 0; i2 < stride; ++i2) {
    closestPoint[i2] = flatCoordinates[offset3 + i2];
  }
  closestPoint.length = stride;
}
function maxSquaredDelta(flatCoordinates, offset2, end, stride, max) {
  var x1 = flatCoordinates[offset2];
  var y1 = flatCoordinates[offset2 + 1];
  for (offset2 += stride; offset2 < end; offset2 += stride) {
    var x2 = flatCoordinates[offset2];
    var y2 = flatCoordinates[offset2 + 1];
    var squaredDelta = squaredDistance(x1, y1, x2, y2);
    if (squaredDelta > max) {
      max = squaredDelta;
    }
    x1 = x2;
    y1 = y2;
  }
  return max;
}
function arrayMaxSquaredDelta(flatCoordinates, offset2, ends, stride, max) {
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    max = maxSquaredDelta(flatCoordinates, offset2, end, stride, max);
    offset2 = end;
  }
  return max;
}
function multiArrayMaxSquaredDelta(flatCoordinates, offset2, endss, stride, max) {
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    max = arrayMaxSquaredDelta(flatCoordinates, offset2, ends, stride, max);
    offset2 = ends[ends.length - 1];
  }
  return max;
}
function assignClosestPoint(flatCoordinates, offset2, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {
  if (offset2 == end) {
    return minSquaredDistance;
  }
  var i2, squaredDistance3;
  if (maxDelta === 0) {
    squaredDistance3 = squaredDistance(x, y, flatCoordinates[offset2], flatCoordinates[offset2 + 1]);
    if (squaredDistance3 < minSquaredDistance) {
      for (i2 = 0; i2 < stride; ++i2) {
        closestPoint[i2] = flatCoordinates[offset2 + i2];
      }
      closestPoint.length = stride;
      return squaredDistance3;
    } else {
      return minSquaredDistance;
    }
  }
  var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];
  var index = offset2 + stride;
  while (index < end) {
    assignClosest(flatCoordinates, index - stride, index, stride, x, y, tmpPoint);
    squaredDistance3 = squaredDistance(x, y, tmpPoint[0], tmpPoint[1]);
    if (squaredDistance3 < minSquaredDistance) {
      minSquaredDistance = squaredDistance3;
      for (i2 = 0; i2 < stride; ++i2) {
        closestPoint[i2] = tmpPoint[i2];
      }
      closestPoint.length = stride;
      index += stride;
    } else {
      index += stride * Math.max((Math.sqrt(squaredDistance3) - Math.sqrt(minSquaredDistance)) / maxDelta | 0, 1);
    }
  }
  if (isRing) {
    assignClosest(flatCoordinates, end - stride, offset2, stride, x, y, tmpPoint);
    squaredDistance3 = squaredDistance(x, y, tmpPoint[0], tmpPoint[1]);
    if (squaredDistance3 < minSquaredDistance) {
      minSquaredDistance = squaredDistance3;
      for (i2 = 0; i2 < stride; ++i2) {
        closestPoint[i2] = tmpPoint[i2];
      }
      closestPoint.length = stride;
    }
  }
  return minSquaredDistance;
}
function assignClosestArrayPoint(flatCoordinates, offset2, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {
  var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    minSquaredDistance = assignClosestPoint(flatCoordinates, offset2, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);
    offset2 = end;
  }
  return minSquaredDistance;
}
function assignClosestMultiArrayPoint(flatCoordinates, offset2, endss, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, opt_tmpPoint) {
  var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN];
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    minSquaredDistance = assignClosestArrayPoint(flatCoordinates, offset2, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);
    offset2 = ends[ends.length - 1];
  }
  return minSquaredDistance;
}

// node_modules/ol/geom/flat/deflate.js
function deflateCoordinate(flatCoordinates, offset2, coordinate, stride) {
  for (var i2 = 0, ii = coordinate.length; i2 < ii; ++i2) {
    flatCoordinates[offset2++] = coordinate[i2];
  }
  return offset2;
}
function deflateCoordinates(flatCoordinates, offset2, coordinates2, stride) {
  for (var i2 = 0, ii = coordinates2.length; i2 < ii; ++i2) {
    var coordinate = coordinates2[i2];
    for (var j = 0; j < stride; ++j) {
      flatCoordinates[offset2++] = coordinate[j];
    }
  }
  return offset2;
}
function deflateCoordinatesArray(flatCoordinates, offset2, coordinatess, stride, opt_ends) {
  var ends = opt_ends ? opt_ends : [];
  var i2 = 0;
  for (var j = 0, jj = coordinatess.length; j < jj; ++j) {
    var end = deflateCoordinates(flatCoordinates, offset2, coordinatess[j], stride);
    ends[i2++] = end;
    offset2 = end;
  }
  ends.length = i2;
  return ends;
}
function deflateMultiCoordinatesArray(flatCoordinates, offset2, coordinatesss, stride, opt_endss) {
  var endss = opt_endss ? opt_endss : [];
  var i2 = 0;
  for (var j = 0, jj = coordinatesss.length; j < jj; ++j) {
    var ends = deflateCoordinatesArray(flatCoordinates, offset2, coordinatesss[j], stride, endss[i2]);
    endss[i2++] = ends;
    offset2 = ends[ends.length - 1];
  }
  endss.length = i2;
  return endss;
}

// node_modules/ol/geom/flat/interpolate.js
function interpolatePoint(flatCoordinates, offset2, end, stride, fraction, opt_dest, opt_dimension) {
  var o, t;
  var n = (end - offset2) / stride;
  if (n === 1) {
    o = offset2;
  } else if (n === 2) {
    o = offset2;
    t = fraction;
  } else if (n !== 0) {
    var x1 = flatCoordinates[offset2];
    var y1 = flatCoordinates[offset2 + 1];
    var length_1 = 0;
    var cumulativeLengths = [0];
    for (var i2 = offset2 + stride; i2 < end; i2 += stride) {
      var x2 = flatCoordinates[i2];
      var y2 = flatCoordinates[i2 + 1];
      length_1 += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
      cumulativeLengths.push(length_1);
      x1 = x2;
      y1 = y2;
    }
    var target = fraction * length_1;
    var index = binarySearch(cumulativeLengths, target);
    if (index < 0) {
      t = (target - cumulativeLengths[-index - 2]) / (cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);
      o = offset2 + (-index - 2) * stride;
    } else {
      o = offset2 + index * stride;
    }
  }
  var dimension = opt_dimension > 1 ? opt_dimension : 2;
  var dest = opt_dest ? opt_dest : new Array(dimension);
  for (var i2 = 0; i2 < dimension; ++i2) {
    dest[i2] = o === void 0 ? NaN : t === void 0 ? flatCoordinates[o + i2] : lerp(flatCoordinates[o + i2], flatCoordinates[o + stride + i2], t);
  }
  return dest;
}
function lineStringCoordinateAtM(flatCoordinates, offset2, end, stride, m, extrapolate) {
  if (end == offset2) {
    return null;
  }
  var coordinate;
  if (m < flatCoordinates[offset2 + stride - 1]) {
    if (extrapolate) {
      coordinate = flatCoordinates.slice(offset2, offset2 + stride);
      coordinate[stride - 1] = m;
      return coordinate;
    } else {
      return null;
    }
  } else if (flatCoordinates[end - 1] < m) {
    if (extrapolate) {
      coordinate = flatCoordinates.slice(end - stride, end);
      coordinate[stride - 1] = m;
      return coordinate;
    } else {
      return null;
    }
  }
  if (m == flatCoordinates[offset2 + stride - 1]) {
    return flatCoordinates.slice(offset2, offset2 + stride);
  }
  var lo = offset2 / stride;
  var hi = end / stride;
  while (lo < hi) {
    var mid = lo + hi >> 1;
    if (m < flatCoordinates[(mid + 1) * stride - 1]) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
  }
  var m0 = flatCoordinates[lo * stride - 1];
  if (m == m0) {
    return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);
  }
  var m1 = flatCoordinates[(lo + 1) * stride - 1];
  var t = (m - m0) / (m1 - m0);
  coordinate = [];
  for (var i2 = 0; i2 < stride - 1; ++i2) {
    coordinate.push(lerp(flatCoordinates[(lo - 1) * stride + i2], flatCoordinates[lo * stride + i2], t));
  }
  coordinate.push(m);
  return coordinate;
}
function lineStringsCoordinateAtM(flatCoordinates, offset2, ends, stride, m, extrapolate, interpolate2) {
  if (interpolate2) {
    return lineStringCoordinateAtM(flatCoordinates, offset2, ends[ends.length - 1], stride, m, extrapolate);
  }
  var coordinate;
  if (m < flatCoordinates[stride - 1]) {
    if (extrapolate) {
      coordinate = flatCoordinates.slice(0, stride);
      coordinate[stride - 1] = m;
      return coordinate;
    } else {
      return null;
    }
  }
  if (flatCoordinates[flatCoordinates.length - 1] < m) {
    if (extrapolate) {
      coordinate = flatCoordinates.slice(flatCoordinates.length - stride);
      coordinate[stride - 1] = m;
      return coordinate;
    } else {
      return null;
    }
  }
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    if (offset2 == end) {
      continue;
    }
    if (m < flatCoordinates[offset2 + stride - 1]) {
      return null;
    } else if (m <= flatCoordinates[end - 1]) {
      return lineStringCoordinateAtM(flatCoordinates, offset2, end, stride, m, false);
    }
    offset2 = end;
  }
  return null;
}

// node_modules/ol/geom/LineString.js
var __extends40 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var LineString = (
  /** @class */
  function(_super) {
    __extends40(LineString2, _super);
    function LineString2(coordinates2, opt_layout) {
      var _this = _super.call(this) || this;
      _this.flatMidpoint_ = null;
      _this.flatMidpointRevision_ = -1;
      _this.maxDelta_ = -1;
      _this.maxDeltaRevision_ = -1;
      if (opt_layout !== void 0 && !Array.isArray(coordinates2[0])) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
      } else {
        _this.setCoordinates(
          /** @type {Array<import("../coordinate.js").Coordinate>} */
          coordinates2,
          opt_layout
        );
      }
      return _this;
    }
    LineString2.prototype.appendCoordinate = function(coordinate) {
      if (!this.flatCoordinates) {
        this.flatCoordinates = coordinate.slice();
      } else {
        extend(this.flatCoordinates, coordinate);
      }
      this.changed();
    };
    LineString2.prototype.clone = function() {
      var lineString = new LineString2(this.flatCoordinates.slice(), this.layout);
      lineString.applyProperties(this);
      return lineString;
    };
    LineString2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      if (this.maxDeltaRevision_ != this.getRevision()) {
        this.maxDelta_ = Math.sqrt(maxSquaredDelta(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));
        this.maxDeltaRevision_ = this.getRevision();
      }
      return assignClosestPoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);
    };
    LineString2.prototype.forEachSegment = function(callback) {
      return forEach(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, callback);
    };
    LineString2.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
      if (this.layout != GeometryLayout_default.XYM && this.layout != GeometryLayout_default.XYZM) {
        return null;
      }
      var extrapolate = opt_extrapolate !== void 0 ? opt_extrapolate : false;
      return lineStringCoordinateAtM(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, m, extrapolate);
    };
    LineString2.prototype.getCoordinates = function() {
      return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
    };
    LineString2.prototype.getCoordinateAt = function(fraction, opt_dest) {
      return interpolatePoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, fraction, opt_dest, this.stride);
    };
    LineString2.prototype.getLength = function() {
      return lineStringLength(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
    };
    LineString2.prototype.getFlatMidpoint = function() {
      if (this.flatMidpointRevision_ != this.getRevision()) {
        this.flatMidpoint_ = this.getCoordinateAt(0.5, this.flatMidpoint_);
        this.flatMidpointRevision_ = this.getRevision();
      }
      return this.flatMidpoint_;
    };
    LineString2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      var simplifiedFlatCoordinates = [];
      simplifiedFlatCoordinates.length = douglasPeucker(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);
      return new LineString2(simplifiedFlatCoordinates, GeometryLayout_default.XY);
    };
    LineString2.prototype.getType = function() {
      return "LineString";
    };
    LineString2.prototype.intersectsExtent = function(extent) {
      return intersectsLineString(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);
    };
    LineString2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 1);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates2, this.stride);
      this.changed();
    };
    return LineString2;
  }(SimpleGeometry_default)
);
var LineString_default = LineString;

// node_modules/ol/geom/MultiLineString.js
var __extends41 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MultiLineString = (
  /** @class */
  function(_super) {
    __extends41(MultiLineString2, _super);
    function MultiLineString2(coordinates2, opt_layout, opt_ends) {
      var _this = _super.call(this) || this;
      _this.ends_ = [];
      _this.maxDelta_ = -1;
      _this.maxDeltaRevision_ = -1;
      if (Array.isArray(coordinates2[0])) {
        _this.setCoordinates(
          /** @type {Array<Array<import("../coordinate.js").Coordinate>>} */
          coordinates2,
          opt_layout
        );
      } else if (opt_layout !== void 0 && opt_ends) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
        _this.ends_ = opt_ends;
      } else {
        var layout = _this.getLayout();
        var lineStrings = (
          /** @type {Array<LineString>} */
          coordinates2
        );
        var flatCoordinates = [];
        var ends = [];
        for (var i2 = 0, ii = lineStrings.length; i2 < ii; ++i2) {
          var lineString = lineStrings[i2];
          if (i2 === 0) {
            layout = lineString.getLayout();
          }
          extend(flatCoordinates, lineString.getFlatCoordinates());
          ends.push(flatCoordinates.length);
        }
        _this.setFlatCoordinates(layout, flatCoordinates);
        _this.ends_ = ends;
      }
      return _this;
    }
    MultiLineString2.prototype.appendLineString = function(lineString) {
      if (!this.flatCoordinates) {
        this.flatCoordinates = lineString.getFlatCoordinates().slice();
      } else {
        extend(this.flatCoordinates, lineString.getFlatCoordinates().slice());
      }
      this.ends_.push(this.flatCoordinates.length);
      this.changed();
    };
    MultiLineString2.prototype.clone = function() {
      var multiLineString = new MultiLineString2(this.flatCoordinates.slice(), this.layout, this.ends_.slice());
      multiLineString.applyProperties(this);
      return multiLineString;
    };
    MultiLineString2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      if (this.maxDeltaRevision_ != this.getRevision()) {
        this.maxDelta_ = Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates, 0, this.ends_, this.stride, 0));
        this.maxDeltaRevision_ = this.getRevision();
      }
      return assignClosestArrayPoint(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);
    };
    MultiLineString2.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
      if (this.layout != GeometryLayout_default.XYM && this.layout != GeometryLayout_default.XYZM || this.flatCoordinates.length === 0) {
        return null;
      }
      var extrapolate = opt_extrapolate !== void 0 ? opt_extrapolate : false;
      var interpolate2 = opt_interpolate !== void 0 ? opt_interpolate : false;
      return lineStringsCoordinateAtM(this.flatCoordinates, 0, this.ends_, this.stride, m, extrapolate, interpolate2);
    };
    MultiLineString2.prototype.getCoordinates = function() {
      return inflateCoordinatesArray(this.flatCoordinates, 0, this.ends_, this.stride);
    };
    MultiLineString2.prototype.getEnds = function() {
      return this.ends_;
    };
    MultiLineString2.prototype.getLineString = function(index) {
      if (index < 0 || this.ends_.length <= index) {
        return null;
      }
      return new LineString_default(this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);
    };
    MultiLineString2.prototype.getLineStrings = function() {
      var flatCoordinates = this.flatCoordinates;
      var ends = this.ends_;
      var layout = this.layout;
      var lineStrings = [];
      var offset2 = 0;
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        var end = ends[i2];
        var lineString = new LineString_default(flatCoordinates.slice(offset2, end), layout);
        lineStrings.push(lineString);
        offset2 = end;
      }
      return lineStrings;
    };
    MultiLineString2.prototype.getFlatMidpoints = function() {
      var midpoints = [];
      var flatCoordinates = this.flatCoordinates;
      var offset2 = 0;
      var ends = this.ends_;
      var stride = this.stride;
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        var end = ends[i2];
        var midpoint = interpolatePoint(flatCoordinates, offset2, end, stride, 0.5);
        extend(midpoints, midpoint);
        offset2 = end;
      }
      return midpoints;
    };
    MultiLineString2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      var simplifiedFlatCoordinates = [];
      var simplifiedEnds = [];
      simplifiedFlatCoordinates.length = douglasPeuckerArray(this.flatCoordinates, 0, this.ends_, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0, simplifiedEnds);
      return new MultiLineString2(simplifiedFlatCoordinates, GeometryLayout_default.XY, simplifiedEnds);
    };
    MultiLineString2.prototype.getType = function() {
      return "MultiLineString";
    };
    MultiLineString2.prototype.intersectsExtent = function(extent) {
      return intersectsLineStringArray(this.flatCoordinates, 0, this.ends_, this.stride, extent);
    };
    MultiLineString2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 2);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      var ends = deflateCoordinatesArray(this.flatCoordinates, 0, coordinates2, this.stride, this.ends_);
      this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
      this.changed();
    };
    return MultiLineString2;
  }(SimpleGeometry_default)
);
var MultiLineString_default = MultiLineString;

// node_modules/ol/geom/Point.js
var __extends42 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Point = (
  /** @class */
  function(_super) {
    __extends42(Point3, _super);
    function Point3(coordinates2, opt_layout) {
      var _this = _super.call(this) || this;
      _this.setCoordinates(coordinates2, opt_layout);
      return _this;
    }
    Point3.prototype.clone = function() {
      var point = new Point3(this.flatCoordinates.slice(), this.layout);
      point.applyProperties(this);
      return point;
    };
    Point3.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      var flatCoordinates = this.flatCoordinates;
      var squaredDistance3 = squaredDistance(x, y, flatCoordinates[0], flatCoordinates[1]);
      if (squaredDistance3 < minSquaredDistance) {
        var stride = this.stride;
        for (var i2 = 0; i2 < stride; ++i2) {
          closestPoint[i2] = flatCoordinates[i2];
        }
        closestPoint.length = stride;
        return squaredDistance3;
      } else {
        return minSquaredDistance;
      }
    };
    Point3.prototype.getCoordinates = function() {
      return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
    };
    Point3.prototype.computeExtent = function(extent) {
      return createOrUpdateFromCoordinate(this.flatCoordinates, extent);
    };
    Point3.prototype.getType = function() {
      return "Point";
    };
    Point3.prototype.intersectsExtent = function(extent) {
      return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);
    };
    Point3.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 0);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      this.flatCoordinates.length = deflateCoordinate(this.flatCoordinates, 0, coordinates2, this.stride);
      this.changed();
    };
    return Point3;
  }(SimpleGeometry_default)
);
var Point_default = Point;

// node_modules/ol/geom/MultiPoint.js
var __extends43 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MultiPoint = (
  /** @class */
  function(_super) {
    __extends43(MultiPoint2, _super);
    function MultiPoint2(coordinates2, opt_layout) {
      var _this = _super.call(this) || this;
      if (opt_layout && !Array.isArray(coordinates2[0])) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
      } else {
        _this.setCoordinates(
          /** @type {Array<import("../coordinate.js").Coordinate>} */
          coordinates2,
          opt_layout
        );
      }
      return _this;
    }
    MultiPoint2.prototype.appendPoint = function(point) {
      if (!this.flatCoordinates) {
        this.flatCoordinates = point.getFlatCoordinates().slice();
      } else {
        extend(this.flatCoordinates, point.getFlatCoordinates());
      }
      this.changed();
    };
    MultiPoint2.prototype.clone = function() {
      var multiPoint = new MultiPoint2(this.flatCoordinates.slice(), this.layout);
      multiPoint.applyProperties(this);
      return multiPoint;
    };
    MultiPoint2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      var flatCoordinates = this.flatCoordinates;
      var stride = this.stride;
      for (var i2 = 0, ii = flatCoordinates.length; i2 < ii; i2 += stride) {
        var squaredDistance3 = squaredDistance(x, y, flatCoordinates[i2], flatCoordinates[i2 + 1]);
        if (squaredDistance3 < minSquaredDistance) {
          minSquaredDistance = squaredDistance3;
          for (var j = 0; j < stride; ++j) {
            closestPoint[j] = flatCoordinates[i2 + j];
          }
          closestPoint.length = stride;
        }
      }
      return minSquaredDistance;
    };
    MultiPoint2.prototype.getCoordinates = function() {
      return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
    };
    MultiPoint2.prototype.getPoint = function(index) {
      var n = !this.flatCoordinates ? 0 : this.flatCoordinates.length / this.stride;
      if (index < 0 || n <= index) {
        return null;
      }
      return new Point_default(this.flatCoordinates.slice(index * this.stride, (index + 1) * this.stride), this.layout);
    };
    MultiPoint2.prototype.getPoints = function() {
      var flatCoordinates = this.flatCoordinates;
      var layout = this.layout;
      var stride = this.stride;
      var points = [];
      for (var i2 = 0, ii = flatCoordinates.length; i2 < ii; i2 += stride) {
        var point = new Point_default(flatCoordinates.slice(i2, i2 + stride), layout);
        points.push(point);
      }
      return points;
    };
    MultiPoint2.prototype.getType = function() {
      return "MultiPoint";
    };
    MultiPoint2.prototype.intersectsExtent = function(extent) {
      var flatCoordinates = this.flatCoordinates;
      var stride = this.stride;
      for (var i2 = 0, ii = flatCoordinates.length; i2 < ii; i2 += stride) {
        var x = flatCoordinates[i2];
        var y = flatCoordinates[i2 + 1];
        if (containsXY(extent, x, y)) {
          return true;
        }
      }
      return false;
    };
    MultiPoint2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 1);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates2, this.stride);
      this.changed();
    };
    return MultiPoint2;
  }(SimpleGeometry_default)
);
var MultiPoint_default = MultiPoint;

// node_modules/ol/geom/flat/area.js
function linearRing(flatCoordinates, offset2, end, stride) {
  var twiceArea = 0;
  var x1 = flatCoordinates[end - stride];
  var y1 = flatCoordinates[end - stride + 1];
  for (; offset2 < end; offset2 += stride) {
    var x2 = flatCoordinates[offset2];
    var y2 = flatCoordinates[offset2 + 1];
    twiceArea += y1 * x2 - x1 * y2;
    x1 = x2;
    y1 = y2;
  }
  return twiceArea / 2;
}
function linearRings(flatCoordinates, offset2, ends, stride) {
  var area = 0;
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    area += linearRing(flatCoordinates, offset2, end, stride);
    offset2 = end;
  }
  return area;
}
function linearRingss(flatCoordinates, offset2, endss, stride) {
  var area = 0;
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    area += linearRings(flatCoordinates, offset2, ends, stride);
    offset2 = ends[ends.length - 1];
  }
  return area;
}

// node_modules/ol/geom/LinearRing.js
var __extends44 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var LinearRing = (
  /** @class */
  function(_super) {
    __extends44(LinearRing2, _super);
    function LinearRing2(coordinates2, opt_layout) {
      var _this = _super.call(this) || this;
      _this.maxDelta_ = -1;
      _this.maxDeltaRevision_ = -1;
      if (opt_layout !== void 0 && !Array.isArray(coordinates2[0])) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
      } else {
        _this.setCoordinates(
          /** @type {Array<import("../coordinate.js").Coordinate>} */
          coordinates2,
          opt_layout
        );
      }
      return _this;
    }
    LinearRing2.prototype.clone = function() {
      return new LinearRing2(this.flatCoordinates.slice(), this.layout);
    };
    LinearRing2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      if (this.maxDeltaRevision_ != this.getRevision()) {
        this.maxDelta_ = Math.sqrt(maxSquaredDelta(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));
        this.maxDeltaRevision_ = this.getRevision();
      }
      return assignClosestPoint(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);
    };
    LinearRing2.prototype.getArea = function() {
      return linearRing(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
    };
    LinearRing2.prototype.getCoordinates = function() {
      return inflateCoordinates(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);
    };
    LinearRing2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      var simplifiedFlatCoordinates = [];
      simplifiedFlatCoordinates.length = douglasPeucker(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);
      return new LinearRing2(simplifiedFlatCoordinates, GeometryLayout_default.XY);
    };
    LinearRing2.prototype.getType = function() {
      return "LinearRing";
    };
    LinearRing2.prototype.intersectsExtent = function(extent) {
      return false;
    };
    LinearRing2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 1);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      this.flatCoordinates.length = deflateCoordinates(this.flatCoordinates, 0, coordinates2, this.stride);
      this.changed();
    };
    return LinearRing2;
  }(SimpleGeometry_default)
);
var LinearRing_default = LinearRing;

// node_modules/ol/geom/flat/interiorpoint.js
function getInteriorPointOfArray(flatCoordinates, offset2, ends, stride, flatCenters, flatCentersOffset, opt_dest) {
  var i2, ii, x, x1, x2, y1, y2;
  var y = flatCenters[flatCentersOffset + 1];
  var intersections = [];
  for (var r = 0, rr = ends.length; r < rr; ++r) {
    var end = ends[r];
    x1 = flatCoordinates[end - stride];
    y1 = flatCoordinates[end - stride + 1];
    for (i2 = offset2; i2 < end; i2 += stride) {
      x2 = flatCoordinates[i2];
      y2 = flatCoordinates[i2 + 1];
      if (y <= y1 && y2 <= y || y1 <= y && y <= y2) {
        x = (y - y1) / (y2 - y1) * (x2 - x1) + x1;
        intersections.push(x);
      }
      x1 = x2;
      y1 = y2;
    }
  }
  var pointX = NaN;
  var maxSegmentLength = -Infinity;
  intersections.sort(numberSafeCompareFunction);
  x1 = intersections[0];
  for (i2 = 1, ii = intersections.length; i2 < ii; ++i2) {
    x2 = intersections[i2];
    var segmentLength = Math.abs(x2 - x1);
    if (segmentLength > maxSegmentLength) {
      x = (x1 + x2) / 2;
      if (linearRingsContainsXY(flatCoordinates, offset2, ends, stride, x, y)) {
        pointX = x;
        maxSegmentLength = segmentLength;
      }
    }
    x1 = x2;
  }
  if (isNaN(pointX)) {
    pointX = flatCenters[flatCentersOffset];
  }
  if (opt_dest) {
    opt_dest.push(pointX, y, maxSegmentLength);
    return opt_dest;
  } else {
    return [pointX, y, maxSegmentLength];
  }
}
function getInteriorPointsOfMultiArray(flatCoordinates, offset2, endss, stride, flatCenters) {
  var interiorPoints = [];
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    interiorPoints = getInteriorPointOfArray(flatCoordinates, offset2, ends, stride, flatCenters, 2 * i2, interiorPoints);
    offset2 = ends[ends.length - 1];
  }
  return interiorPoints;
}

// node_modules/ol/geom/flat/reverse.js
function coordinates(flatCoordinates, offset2, end, stride) {
  while (offset2 < end - stride) {
    for (var i2 = 0; i2 < stride; ++i2) {
      var tmp = flatCoordinates[offset2 + i2];
      flatCoordinates[offset2 + i2] = flatCoordinates[end - stride + i2];
      flatCoordinates[end - stride + i2] = tmp;
    }
    offset2 += stride;
    end -= stride;
  }
}

// node_modules/ol/geom/flat/orient.js
function linearRingIsClockwise(flatCoordinates, offset2, end, stride) {
  var edge = 0;
  var x1 = flatCoordinates[end - stride];
  var y1 = flatCoordinates[end - stride + 1];
  for (; offset2 < end; offset2 += stride) {
    var x2 = flatCoordinates[offset2];
    var y2 = flatCoordinates[offset2 + 1];
    edge += (x2 - x1) * (y2 + y1);
    x1 = x2;
    y1 = y2;
  }
  return edge === 0 ? void 0 : edge > 0;
}
function linearRingsAreOriented(flatCoordinates, offset2, ends, stride, opt_right) {
  var right = opt_right !== void 0 ? opt_right : false;
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    var isClockwise = linearRingIsClockwise(flatCoordinates, offset2, end, stride);
    if (i2 === 0) {
      if (right && isClockwise || !right && !isClockwise) {
        return false;
      }
    } else {
      if (right && !isClockwise || !right && isClockwise) {
        return false;
      }
    }
    offset2 = end;
  }
  return true;
}
function linearRingssAreOriented(flatCoordinates, offset2, endss, stride, opt_right) {
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    if (!linearRingsAreOriented(flatCoordinates, offset2, ends, stride, opt_right)) {
      return false;
    }
    if (ends.length) {
      offset2 = ends[ends.length - 1];
    }
  }
  return true;
}
function orientLinearRings(flatCoordinates, offset2, ends, stride, opt_right) {
  var right = opt_right !== void 0 ? opt_right : false;
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    var isClockwise = linearRingIsClockwise(flatCoordinates, offset2, end, stride);
    var reverse = i2 === 0 ? right && isClockwise || !right && !isClockwise : right && !isClockwise || !right && isClockwise;
    if (reverse) {
      coordinates(flatCoordinates, offset2, end, stride);
    }
    offset2 = end;
  }
  return offset2;
}
function orientLinearRingsArray(flatCoordinates, offset2, endss, stride, opt_right) {
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    offset2 = orientLinearRings(flatCoordinates, offset2, endss[i2], stride, opt_right);
  }
  return offset2;
}
function inflateEnds(flatCoordinates, ends) {
  var endss = [];
  var offset2 = 0;
  var prevEndIndex = 0;
  for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
    var end = ends[i2];
    if (!linearRingIsClockwise(flatCoordinates, offset2, end, 2)) {
      endss.push(ends.slice(prevEndIndex, i2 + 1));
    } else {
      if (endss.length === 0) {
        continue;
      }
      endss[endss.length - 1].push(ends[prevEndIndex]);
    }
    prevEndIndex = i2 + 1;
    offset2 = end;
  }
  return endss;
}

// node_modules/ol/geom/Polygon.js
var __extends45 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Polygon = (
  /** @class */
  function(_super) {
    __extends45(Polygon2, _super);
    function Polygon2(coordinates2, opt_layout, opt_ends) {
      var _this = _super.call(this) || this;
      _this.ends_ = [];
      _this.flatInteriorPointRevision_ = -1;
      _this.flatInteriorPoint_ = null;
      _this.maxDelta_ = -1;
      _this.maxDeltaRevision_ = -1;
      _this.orientedRevision_ = -1;
      _this.orientedFlatCoordinates_ = null;
      if (opt_layout !== void 0 && opt_ends) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
        _this.ends_ = opt_ends;
      } else {
        _this.setCoordinates(
          /** @type {Array<Array<import("../coordinate.js").Coordinate>>} */
          coordinates2,
          opt_layout
        );
      }
      return _this;
    }
    Polygon2.prototype.appendLinearRing = function(linearRing2) {
      if (!this.flatCoordinates) {
        this.flatCoordinates = linearRing2.getFlatCoordinates().slice();
      } else {
        extend(this.flatCoordinates, linearRing2.getFlatCoordinates());
      }
      this.ends_.push(this.flatCoordinates.length);
      this.changed();
    };
    Polygon2.prototype.clone = function() {
      var polygon = new Polygon2(this.flatCoordinates.slice(), this.layout, this.ends_.slice());
      polygon.applyProperties(this);
      return polygon;
    };
    Polygon2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      if (this.maxDeltaRevision_ != this.getRevision()) {
        this.maxDelta_ = Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates, 0, this.ends_, this.stride, 0));
        this.maxDeltaRevision_ = this.getRevision();
      }
      return assignClosestArrayPoint(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);
    };
    Polygon2.prototype.containsXY = function(x, y) {
      return linearRingsContainsXY(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);
    };
    Polygon2.prototype.getArea = function() {
      return linearRings(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);
    };
    Polygon2.prototype.getCoordinates = function(opt_right) {
      var flatCoordinates;
      if (opt_right !== void 0) {
        flatCoordinates = this.getOrientedFlatCoordinates().slice();
        orientLinearRings(flatCoordinates, 0, this.ends_, this.stride, opt_right);
      } else {
        flatCoordinates = this.flatCoordinates;
      }
      return inflateCoordinatesArray(flatCoordinates, 0, this.ends_, this.stride);
    };
    Polygon2.prototype.getEnds = function() {
      return this.ends_;
    };
    Polygon2.prototype.getFlatInteriorPoint = function() {
      if (this.flatInteriorPointRevision_ != this.getRevision()) {
        var flatCenter = getCenter(this.getExtent());
        this.flatInteriorPoint_ = getInteriorPointOfArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, flatCenter, 0);
        this.flatInteriorPointRevision_ = this.getRevision();
      }
      return this.flatInteriorPoint_;
    };
    Polygon2.prototype.getInteriorPoint = function() {
      return new Point_default(this.getFlatInteriorPoint(), GeometryLayout_default.XYM);
    };
    Polygon2.prototype.getLinearRingCount = function() {
      return this.ends_.length;
    };
    Polygon2.prototype.getLinearRing = function(index) {
      if (index < 0 || this.ends_.length <= index) {
        return null;
      }
      return new LinearRing_default(this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);
    };
    Polygon2.prototype.getLinearRings = function() {
      var layout = this.layout;
      var flatCoordinates = this.flatCoordinates;
      var ends = this.ends_;
      var linearRings2 = [];
      var offset2 = 0;
      for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
        var end = ends[i2];
        var linearRing2 = new LinearRing_default(flatCoordinates.slice(offset2, end), layout);
        linearRings2.push(linearRing2);
        offset2 = end;
      }
      return linearRings2;
    };
    Polygon2.prototype.getOrientedFlatCoordinates = function() {
      if (this.orientedRevision_ != this.getRevision()) {
        var flatCoordinates = this.flatCoordinates;
        if (linearRingsAreOriented(flatCoordinates, 0, this.ends_, this.stride)) {
          this.orientedFlatCoordinates_ = flatCoordinates;
        } else {
          this.orientedFlatCoordinates_ = flatCoordinates.slice();
          this.orientedFlatCoordinates_.length = orientLinearRings(this.orientedFlatCoordinates_, 0, this.ends_, this.stride);
        }
        this.orientedRevision_ = this.getRevision();
      }
      return this.orientedFlatCoordinates_;
    };
    Polygon2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      var simplifiedFlatCoordinates = [];
      var simplifiedEnds = [];
      simplifiedFlatCoordinates.length = quantizeArray(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds);
      return new Polygon2(simplifiedFlatCoordinates, GeometryLayout_default.XY, simplifiedEnds);
    };
    Polygon2.prototype.getType = function() {
      return "Polygon";
    };
    Polygon2.prototype.intersectsExtent = function(extent) {
      return intersectsLinearRingArray(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent);
    };
    Polygon2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 2);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      var ends = deflateCoordinatesArray(this.flatCoordinates, 0, coordinates2, this.stride, this.ends_);
      this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
      this.changed();
    };
    return Polygon2;
  }(SimpleGeometry_default)
);
var Polygon_default = Polygon;
function circular(center, radius, opt_n, opt_sphereRadius) {
  var n = opt_n ? opt_n : 32;
  var flatCoordinates = [];
  for (var i2 = 0; i2 < n; ++i2) {
    extend(flatCoordinates, offset(center, radius, 2 * Math.PI * i2 / n, opt_sphereRadius));
  }
  flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);
  return new Polygon(flatCoordinates, GeometryLayout_default.XY, [
    flatCoordinates.length
  ]);
}
function fromExtent(extent) {
  var minX = extent[0];
  var minY = extent[1];
  var maxX = extent[2];
  var maxY = extent[3];
  var flatCoordinates = [
    minX,
    minY,
    minX,
    maxY,
    maxX,
    maxY,
    maxX,
    minY,
    minX,
    minY
  ];
  return new Polygon(flatCoordinates, GeometryLayout_default.XY, [
    flatCoordinates.length
  ]);
}
function fromCircle(circle, opt_sides, opt_angle) {
  var sides = opt_sides ? opt_sides : 32;
  var stride = circle.getStride();
  var layout = circle.getLayout();
  var center = circle.getCenter();
  var arrayLength = stride * (sides + 1);
  var flatCoordinates = new Array(arrayLength);
  for (var i2 = 0; i2 < arrayLength; i2 += stride) {
    flatCoordinates[i2] = 0;
    flatCoordinates[i2 + 1] = 0;
    for (var j = 2; j < stride; j++) {
      flatCoordinates[i2 + j] = center[j];
    }
  }
  var ends = [flatCoordinates.length];
  var polygon = new Polygon(flatCoordinates, layout, ends);
  makeRegular(polygon, center, circle.getRadius(), opt_angle);
  return polygon;
}
function makeRegular(polygon, center, radius, opt_angle) {
  var flatCoordinates = polygon.getFlatCoordinates();
  var stride = polygon.getStride();
  var sides = flatCoordinates.length / stride - 1;
  var startAngle = opt_angle ? opt_angle : 0;
  for (var i2 = 0; i2 <= sides; ++i2) {
    var offset2 = i2 * stride;
    var angle = startAngle + modulo(i2, sides) * 2 * Math.PI / sides;
    flatCoordinates[offset2] = center[0] + radius * Math.cos(angle);
    flatCoordinates[offset2 + 1] = center[1] + radius * Math.sin(angle);
  }
  polygon.changed();
}

// node_modules/ol/geom/flat/center.js
function linearRingss2(flatCoordinates, offset2, endss, stride) {
  var flatCenters = [];
  var extent = createEmpty();
  for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
    var ends = endss[i2];
    extent = createOrUpdateFromFlatCoordinates(flatCoordinates, offset2, ends[0], stride);
    flatCenters.push((extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2);
    offset2 = ends[ends.length - 1];
  }
  return flatCenters;
}

// node_modules/ol/geom/MultiPolygon.js
var __extends46 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MultiPolygon = (
  /** @class */
  function(_super) {
    __extends46(MultiPolygon2, _super);
    function MultiPolygon2(coordinates2, opt_layout, opt_endss) {
      var _this = _super.call(this) || this;
      _this.endss_ = [];
      _this.flatInteriorPointsRevision_ = -1;
      _this.flatInteriorPoints_ = null;
      _this.maxDelta_ = -1;
      _this.maxDeltaRevision_ = -1;
      _this.orientedRevision_ = -1;
      _this.orientedFlatCoordinates_ = null;
      if (!opt_endss && !Array.isArray(coordinates2[0])) {
        var layout = _this.getLayout();
        var polygons = (
          /** @type {Array<Polygon>} */
          coordinates2
        );
        var flatCoordinates = [];
        var endss = [];
        for (var i2 = 0, ii = polygons.length; i2 < ii; ++i2) {
          var polygon = polygons[i2];
          if (i2 === 0) {
            layout = polygon.getLayout();
          }
          var offset2 = flatCoordinates.length;
          var ends = polygon.getEnds();
          for (var j = 0, jj = ends.length; j < jj; ++j) {
            ends[j] += offset2;
          }
          extend(flatCoordinates, polygon.getFlatCoordinates());
          endss.push(ends);
        }
        opt_layout = layout;
        coordinates2 = flatCoordinates;
        opt_endss = endss;
      }
      if (opt_layout !== void 0 && opt_endss) {
        _this.setFlatCoordinates(
          opt_layout,
          /** @type {Array<number>} */
          coordinates2
        );
        _this.endss_ = opt_endss;
      } else {
        _this.setCoordinates(
          /** @type {Array<Array<Array<import("../coordinate.js").Coordinate>>>} */
          coordinates2,
          opt_layout
        );
      }
      return _this;
    }
    MultiPolygon2.prototype.appendPolygon = function(polygon) {
      var ends;
      if (!this.flatCoordinates) {
        this.flatCoordinates = polygon.getFlatCoordinates().slice();
        ends = polygon.getEnds().slice();
        this.endss_.push();
      } else {
        var offset2 = this.flatCoordinates.length;
        extend(this.flatCoordinates, polygon.getFlatCoordinates());
        ends = polygon.getEnds().slice();
        for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
          ends[i2] += offset2;
        }
      }
      this.endss_.push(ends);
      this.changed();
    };
    MultiPolygon2.prototype.clone = function() {
      var len = this.endss_.length;
      var newEndss = new Array(len);
      for (var i2 = 0; i2 < len; ++i2) {
        newEndss[i2] = this.endss_[i2].slice();
      }
      var multiPolygon = new MultiPolygon2(this.flatCoordinates.slice(), this.layout, newEndss);
      multiPolygon.applyProperties(this);
      return multiPolygon;
    };
    MultiPolygon2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      if (this.maxDeltaRevision_ != this.getRevision()) {
        this.maxDelta_ = Math.sqrt(multiArrayMaxSquaredDelta(this.flatCoordinates, 0, this.endss_, this.stride, 0));
        this.maxDeltaRevision_ = this.getRevision();
      }
      return assignClosestMultiArrayPoint(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);
    };
    MultiPolygon2.prototype.containsXY = function(x, y) {
      return linearRingssContainsXY(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, x, y);
    };
    MultiPolygon2.prototype.getArea = function() {
      return linearRingss(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride);
    };
    MultiPolygon2.prototype.getCoordinates = function(opt_right) {
      var flatCoordinates;
      if (opt_right !== void 0) {
        flatCoordinates = this.getOrientedFlatCoordinates().slice();
        orientLinearRingsArray(flatCoordinates, 0, this.endss_, this.stride, opt_right);
      } else {
        flatCoordinates = this.flatCoordinates;
      }
      return inflateMultiCoordinatesArray(flatCoordinates, 0, this.endss_, this.stride);
    };
    MultiPolygon2.prototype.getEndss = function() {
      return this.endss_;
    };
    MultiPolygon2.prototype.getFlatInteriorPoints = function() {
      if (this.flatInteriorPointsRevision_ != this.getRevision()) {
        var flatCenters = linearRingss2(this.flatCoordinates, 0, this.endss_, this.stride);
        this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, flatCenters);
        this.flatInteriorPointsRevision_ = this.getRevision();
      }
      return this.flatInteriorPoints_;
    };
    MultiPolygon2.prototype.getInteriorPoints = function() {
      return new MultiPoint_default(this.getFlatInteriorPoints().slice(), GeometryLayout_default.XYM);
    };
    MultiPolygon2.prototype.getOrientedFlatCoordinates = function() {
      if (this.orientedRevision_ != this.getRevision()) {
        var flatCoordinates = this.flatCoordinates;
        if (linearRingssAreOriented(flatCoordinates, 0, this.endss_, this.stride)) {
          this.orientedFlatCoordinates_ = flatCoordinates;
        } else {
          this.orientedFlatCoordinates_ = flatCoordinates.slice();
          this.orientedFlatCoordinates_.length = orientLinearRingsArray(this.orientedFlatCoordinates_, 0, this.endss_, this.stride);
        }
        this.orientedRevision_ = this.getRevision();
      }
      return this.orientedFlatCoordinates_;
    };
    MultiPolygon2.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
      var simplifiedFlatCoordinates = [];
      var simplifiedEndss = [];
      simplifiedFlatCoordinates.length = quantizeMultiArray(this.flatCoordinates, 0, this.endss_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEndss);
      return new MultiPolygon2(simplifiedFlatCoordinates, GeometryLayout_default.XY, simplifiedEndss);
    };
    MultiPolygon2.prototype.getPolygon = function(index) {
      if (index < 0 || this.endss_.length <= index) {
        return null;
      }
      var offset2;
      if (index === 0) {
        offset2 = 0;
      } else {
        var prevEnds = this.endss_[index - 1];
        offset2 = prevEnds[prevEnds.length - 1];
      }
      var ends = this.endss_[index].slice();
      var end = ends[ends.length - 1];
      if (offset2 !== 0) {
        for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
          ends[i2] -= offset2;
        }
      }
      return new Polygon_default(this.flatCoordinates.slice(offset2, end), this.layout, ends);
    };
    MultiPolygon2.prototype.getPolygons = function() {
      var layout = this.layout;
      var flatCoordinates = this.flatCoordinates;
      var endss = this.endss_;
      var polygons = [];
      var offset2 = 0;
      for (var i2 = 0, ii = endss.length; i2 < ii; ++i2) {
        var ends = endss[i2].slice();
        var end = ends[ends.length - 1];
        if (offset2 !== 0) {
          for (var j = 0, jj = ends.length; j < jj; ++j) {
            ends[j] -= offset2;
          }
        }
        var polygon = new Polygon_default(flatCoordinates.slice(offset2, end), layout, ends);
        polygons.push(polygon);
        offset2 = end;
      }
      return polygons;
    };
    MultiPolygon2.prototype.getType = function() {
      return "MultiPolygon";
    };
    MultiPolygon2.prototype.intersectsExtent = function(extent) {
      return intersectsLinearRingMultiArray(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent);
    };
    MultiPolygon2.prototype.setCoordinates = function(coordinates2, opt_layout) {
      this.setLayout(opt_layout, coordinates2, 3);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      var endss = deflateMultiCoordinatesArray(this.flatCoordinates, 0, coordinates2, this.stride, this.endss_);
      if (endss.length === 0) {
        this.flatCoordinates.length = 0;
      } else {
        var lastEnds = endss[endss.length - 1];
        this.flatCoordinates.length = lastEnds.length === 0 ? 0 : lastEnds[lastEnds.length - 1];
      }
      this.changed();
    };
    return MultiPolygon2;
  }(SimpleGeometry_default)
);
var MultiPolygon_default = MultiPolygon;

// node_modules/ol/format/MVT.js
var import_pbf = __toESM(require_pbf(), 1);

// node_modules/ol/Feature.js
var __extends47 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Feature = (
  /** @class */
  function(_super) {
    __extends47(Feature2, _super);
    function Feature2(opt_geometryOrProperties) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.id_ = void 0;
      _this.geometryName_ = "geometry";
      _this.style_ = null;
      _this.styleFunction_ = void 0;
      _this.geometryChangeKey_ = null;
      _this.addChangeListener(_this.geometryName_, _this.handleGeometryChanged_);
      if (opt_geometryOrProperties) {
        if (typeof /** @type {?} */
        opt_geometryOrProperties.getSimplifiedGeometry === "function") {
          var geometry2 = (
            /** @type {Geometry} */
            opt_geometryOrProperties
          );
          _this.setGeometry(geometry2);
        } else {
          var properties2 = opt_geometryOrProperties;
          _this.setProperties(properties2);
        }
      }
      return _this;
    }
    Feature2.prototype.clone = function() {
      var clone2 = (
        /** @type {Feature<Geometry>} */
        new Feature2(this.hasProperties() ? this.getProperties() : null)
      );
      clone2.setGeometryName(this.getGeometryName());
      var geometry2 = this.getGeometry();
      if (geometry2) {
        clone2.setGeometry(
          /** @type {Geometry} */
          geometry2.clone()
        );
      }
      var style2 = this.getStyle();
      if (style2) {
        clone2.setStyle(style2);
      }
      return clone2;
    };
    Feature2.prototype.getGeometry = function() {
      return (
        /** @type {Geometry|undefined} */
        this.get(this.geometryName_)
      );
    };
    Feature2.prototype.getId = function() {
      return this.id_;
    };
    Feature2.prototype.getGeometryName = function() {
      return this.geometryName_;
    };
    Feature2.prototype.getStyle = function() {
      return this.style_;
    };
    Feature2.prototype.getStyleFunction = function() {
      return this.styleFunction_;
    };
    Feature2.prototype.handleGeometryChange_ = function() {
      this.changed();
    };
    Feature2.prototype.handleGeometryChanged_ = function() {
      if (this.geometryChangeKey_) {
        unlistenByKey(this.geometryChangeKey_);
        this.geometryChangeKey_ = null;
      }
      var geometry2 = this.getGeometry();
      if (geometry2) {
        this.geometryChangeKey_ = listen(geometry2, EventType_default.CHANGE, this.handleGeometryChange_, this);
      }
      this.changed();
    };
    Feature2.prototype.setGeometry = function(geometry2) {
      this.set(this.geometryName_, geometry2);
    };
    Feature2.prototype.setStyle = function(opt_style) {
      this.style_ = opt_style;
      this.styleFunction_ = !opt_style ? void 0 : createStyleFunction(opt_style);
      this.changed();
    };
    Feature2.prototype.setId = function(id2) {
      this.id_ = id2;
      this.changed();
    };
    Feature2.prototype.setGeometryName = function(name) {
      this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);
      this.geometryName_ = name;
      this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);
      this.handleGeometryChanged_();
    };
    return Feature2;
  }(Object_default)
);
function createStyleFunction(obj) {
  if (typeof obj === "function") {
    return obj;
  } else {
    var styles_1;
    if (Array.isArray(obj)) {
      styles_1 = obj;
    } else {
      assert(typeof /** @type {?} */
      obj.getZIndex === "function", 41);
      var style2 = (
        /** @type {import("./style/Style.js").default} */
        obj
      );
      styles_1 = [style2];
    }
    return function() {
      return styles_1;
    };
  }
}
var Feature_default2 = Feature;

// node_modules/ol/geom/Circle.js
var __extends48 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Circle = (
  /** @class */
  function(_super) {
    __extends48(Circle2, _super);
    function Circle2(center, opt_radius, opt_layout) {
      var _this = _super.call(this) || this;
      if (opt_layout !== void 0 && opt_radius === void 0) {
        _this.setFlatCoordinates(opt_layout, center);
      } else {
        var radius = opt_radius ? opt_radius : 0;
        _this.setCenterAndRadius(center, radius, opt_layout);
      }
      return _this;
    }
    Circle2.prototype.clone = function() {
      var circle = new Circle2(this.flatCoordinates.slice(), void 0, this.layout);
      circle.applyProperties(this);
      return circle;
    };
    Circle2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      var flatCoordinates = this.flatCoordinates;
      var dx = x - flatCoordinates[0];
      var dy = y - flatCoordinates[1];
      var squaredDistance3 = dx * dx + dy * dy;
      if (squaredDistance3 < minSquaredDistance) {
        if (squaredDistance3 === 0) {
          for (var i2 = 0; i2 < this.stride; ++i2) {
            closestPoint[i2] = flatCoordinates[i2];
          }
        } else {
          var delta = this.getRadius() / Math.sqrt(squaredDistance3);
          closestPoint[0] = flatCoordinates[0] + delta * dx;
          closestPoint[1] = flatCoordinates[1] + delta * dy;
          for (var i2 = 2; i2 < this.stride; ++i2) {
            closestPoint[i2] = flatCoordinates[i2];
          }
        }
        closestPoint.length = this.stride;
        return squaredDistance3;
      } else {
        return minSquaredDistance;
      }
    };
    Circle2.prototype.containsXY = function(x, y) {
      var flatCoordinates = this.flatCoordinates;
      var dx = x - flatCoordinates[0];
      var dy = y - flatCoordinates[1];
      return dx * dx + dy * dy <= this.getRadiusSquared_();
    };
    Circle2.prototype.getCenter = function() {
      return this.flatCoordinates.slice(0, this.stride);
    };
    Circle2.prototype.computeExtent = function(extent) {
      var flatCoordinates = this.flatCoordinates;
      var radius = flatCoordinates[this.stride] - flatCoordinates[0];
      return createOrUpdate(flatCoordinates[0] - radius, flatCoordinates[1] - radius, flatCoordinates[0] + radius, flatCoordinates[1] + radius, extent);
    };
    Circle2.prototype.getRadius = function() {
      return Math.sqrt(this.getRadiusSquared_());
    };
    Circle2.prototype.getRadiusSquared_ = function() {
      var dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];
      var dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];
      return dx * dx + dy * dy;
    };
    Circle2.prototype.getType = function() {
      return "Circle";
    };
    Circle2.prototype.intersectsExtent = function(extent) {
      var circleExtent = this.getExtent();
      if (intersects(extent, circleExtent)) {
        var center = this.getCenter();
        if (extent[0] <= center[0] && extent[2] >= center[0]) {
          return true;
        }
        if (extent[1] <= center[1] && extent[3] >= center[1]) {
          return true;
        }
        return forEachCorner(extent, this.intersectsCoordinate.bind(this));
      }
      return false;
    };
    Circle2.prototype.setCenter = function(center) {
      var stride = this.stride;
      var radius = this.flatCoordinates[stride] - this.flatCoordinates[0];
      var flatCoordinates = center.slice();
      flatCoordinates[stride] = flatCoordinates[0] + radius;
      for (var i2 = 1; i2 < stride; ++i2) {
        flatCoordinates[stride + i2] = center[i2];
      }
      this.setFlatCoordinates(this.layout, flatCoordinates);
      this.changed();
    };
    Circle2.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
      this.setLayout(opt_layout, center, 0);
      if (!this.flatCoordinates) {
        this.flatCoordinates = [];
      }
      var flatCoordinates = this.flatCoordinates;
      var offset2 = deflateCoordinate(flatCoordinates, 0, center, this.stride);
      flatCoordinates[offset2++] = flatCoordinates[0] + radius;
      for (var i2 = 1, ii = this.stride; i2 < ii; ++i2) {
        flatCoordinates[offset2++] = flatCoordinates[i2];
      }
      flatCoordinates.length = offset2;
      this.changed();
    };
    Circle2.prototype.getCoordinates = function() {
      return null;
    };
    Circle2.prototype.setCoordinates = function(coordinates2, opt_layout) {
    };
    Circle2.prototype.setRadius = function(radius) {
      this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;
      this.changed();
    };
    Circle2.prototype.rotate = function(angle, anchor2) {
      var center = this.getCenter();
      var stride = this.getStride();
      this.setCenter(rotate2(center, 0, center.length, stride, angle, anchor2, center));
      this.changed();
    };
    Circle2.prototype.translate = function(deltaX, deltaY) {
      var center = this.getCenter();
      var stride = this.getStride();
      this.setCenter(translate2(center, 0, center.length, stride, deltaX, deltaY, center));
      this.changed();
    };
    return Circle2;
  }(SimpleGeometry_default)
);
Circle.prototype.transform;
var Circle_default2 = Circle;

// node_modules/ol/geom/GeometryCollection.js
var __extends49 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var GeometryCollection = (
  /** @class */
  function(_super) {
    __extends49(GeometryCollection2, _super);
    function GeometryCollection2(opt_geometries) {
      var _this = _super.call(this) || this;
      _this.geometries_ = opt_geometries ? opt_geometries : null;
      _this.changeEventsKeys_ = [];
      _this.listenGeometriesChange_();
      return _this;
    }
    GeometryCollection2.prototype.unlistenGeometriesChange_ = function() {
      this.changeEventsKeys_.forEach(unlistenByKey);
      this.changeEventsKeys_.length = 0;
    };
    GeometryCollection2.prototype.listenGeometriesChange_ = function() {
      if (!this.geometries_) {
        return;
      }
      for (var i2 = 0, ii = this.geometries_.length; i2 < ii; ++i2) {
        this.changeEventsKeys_.push(listen(this.geometries_[i2], EventType_default.CHANGE, this.changed, this));
      }
    };
    GeometryCollection2.prototype.clone = function() {
      var geometryCollection = new GeometryCollection2(null);
      geometryCollection.setGeometries(this.geometries_);
      geometryCollection.applyProperties(this);
      return geometryCollection;
    };
    GeometryCollection2.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
      if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
        return minSquaredDistance;
      }
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        minSquaredDistance = geometries[i2].closestPointXY(x, y, closestPoint, minSquaredDistance);
      }
      return minSquaredDistance;
    };
    GeometryCollection2.prototype.containsXY = function(x, y) {
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        if (geometries[i2].containsXY(x, y)) {
          return true;
        }
      }
      return false;
    };
    GeometryCollection2.prototype.computeExtent = function(extent) {
      createOrUpdateEmpty(extent);
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        extend2(extent, geometries[i2].getExtent());
      }
      return extent;
    };
    GeometryCollection2.prototype.getGeometries = function() {
      return cloneGeometries(this.geometries_);
    };
    GeometryCollection2.prototype.getGeometriesArray = function() {
      return this.geometries_;
    };
    GeometryCollection2.prototype.getGeometriesArrayRecursive = function() {
      var geometriesArray = [];
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        if (geometries[i2].getType() === this.getType()) {
          geometriesArray = geometriesArray.concat(
            /** @type {GeometryCollection} */
            geometries[i2].getGeometriesArrayRecursive()
          );
        } else {
          geometriesArray.push(geometries[i2]);
        }
      }
      return geometriesArray;
    };
    GeometryCollection2.prototype.getSimplifiedGeometry = function(squaredTolerance) {
      if (this.simplifiedGeometryRevision !== this.getRevision()) {
        this.simplifiedGeometryMaxMinSquaredTolerance = 0;
        this.simplifiedGeometryRevision = this.getRevision();
      }
      if (squaredTolerance < 0 || this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance) {
        return this;
      }
      var simplifiedGeometries = [];
      var geometries = this.geometries_;
      var simplified = false;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        var geometry2 = geometries[i2];
        var simplifiedGeometry = geometry2.getSimplifiedGeometry(squaredTolerance);
        simplifiedGeometries.push(simplifiedGeometry);
        if (simplifiedGeometry !== geometry2) {
          simplified = true;
        }
      }
      if (simplified) {
        var simplifiedGeometryCollection = new GeometryCollection2(null);
        simplifiedGeometryCollection.setGeometriesArray(simplifiedGeometries);
        return simplifiedGeometryCollection;
      } else {
        this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;
        return this;
      }
    };
    GeometryCollection2.prototype.getType = function() {
      return "GeometryCollection";
    };
    GeometryCollection2.prototype.intersectsExtent = function(extent) {
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        if (geometries[i2].intersectsExtent(extent)) {
          return true;
        }
      }
      return false;
    };
    GeometryCollection2.prototype.isEmpty = function() {
      return this.geometries_.length === 0;
    };
    GeometryCollection2.prototype.rotate = function(angle, anchor2) {
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        geometries[i2].rotate(angle, anchor2);
      }
      this.changed();
    };
    GeometryCollection2.prototype.scale = function(sx, opt_sy, opt_anchor) {
      var anchor2 = opt_anchor;
      if (!anchor2) {
        anchor2 = getCenter(this.getExtent());
      }
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        geometries[i2].scale(sx, opt_sy, anchor2);
      }
      this.changed();
    };
    GeometryCollection2.prototype.setGeometries = function(geometries) {
      this.setGeometriesArray(cloneGeometries(geometries));
    };
    GeometryCollection2.prototype.setGeometriesArray = function(geometries) {
      this.unlistenGeometriesChange_();
      this.geometries_ = geometries;
      this.listenGeometriesChange_();
      this.changed();
    };
    GeometryCollection2.prototype.applyTransform = function(transformFn) {
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        geometries[i2].applyTransform(transformFn);
      }
      this.changed();
    };
    GeometryCollection2.prototype.translate = function(deltaX, deltaY) {
      var geometries = this.geometries_;
      for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
        geometries[i2].translate(deltaX, deltaY);
      }
      this.changed();
    };
    GeometryCollection2.prototype.disposeInternal = function() {
      this.unlistenGeometriesChange_();
      _super.prototype.disposeInternal.call(this);
    };
    return GeometryCollection2;
  }(Geometry_default)
);
function cloneGeometries(geometries) {
  var clonedGeometries = [];
  for (var i2 = 0, ii = geometries.length; i2 < ii; ++i2) {
    clonedGeometries.push(geometries[i2].clone());
  }
  return clonedGeometries;
}
var GeometryCollection_default = GeometryCollection;

// node_modules/ol/render/Feature.js
var tmpTransform2 = create();
var RenderFeature = (
  /** @class */
  function() {
    function RenderFeature2(type, flatCoordinates, ends, properties2, id2) {
      this.styleFunction;
      this.extent_;
      this.id_ = id2;
      this.type_ = type;
      this.flatCoordinates_ = flatCoordinates;
      this.flatInteriorPoints_ = null;
      this.flatMidpoints_ = null;
      this.ends_ = ends;
      this.properties_ = properties2;
    }
    RenderFeature2.prototype.get = function(key) {
      return this.properties_[key];
    };
    RenderFeature2.prototype.getExtent = function() {
      if (!this.extent_) {
        this.extent_ = this.type_ === "Point" ? createOrUpdateFromCoordinate(this.flatCoordinates_) : createOrUpdateFromFlatCoordinates(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2);
      }
      return this.extent_;
    };
    RenderFeature2.prototype.getFlatInteriorPoint = function() {
      if (!this.flatInteriorPoints_) {
        var flatCenter = getCenter(this.getExtent());
        this.flatInteriorPoints_ = getInteriorPointOfArray(
          this.flatCoordinates_,
          0,
          /** @type {Array<number>} */
          this.ends_,
          2,
          flatCenter,
          0
        );
      }
      return this.flatInteriorPoints_;
    };
    RenderFeature2.prototype.getFlatInteriorPoints = function() {
      if (!this.flatInteriorPoints_) {
        var flatCenters = linearRingss2(
          this.flatCoordinates_,
          0,
          /** @type {Array<Array<number>>} */
          this.ends_,
          2
        );
        this.flatInteriorPoints_ = getInteriorPointsOfMultiArray(
          this.flatCoordinates_,
          0,
          /** @type {Array<Array<number>>} */
          this.ends_,
          2,
          flatCenters
        );
      }
      return this.flatInteriorPoints_;
    };
    RenderFeature2.prototype.getFlatMidpoint = function() {
      if (!this.flatMidpoints_) {
        this.flatMidpoints_ = interpolatePoint(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, 0.5);
      }
      return this.flatMidpoints_;
    };
    RenderFeature2.prototype.getFlatMidpoints = function() {
      if (!this.flatMidpoints_) {
        this.flatMidpoints_ = [];
        var flatCoordinates = this.flatCoordinates_;
        var offset2 = 0;
        var ends = (
          /** @type {Array<number>} */
          this.ends_
        );
        for (var i2 = 0, ii = ends.length; i2 < ii; ++i2) {
          var end = ends[i2];
          var midpoint = interpolatePoint(flatCoordinates, offset2, end, 2, 0.5);
          extend(this.flatMidpoints_, midpoint);
          offset2 = end;
        }
      }
      return this.flatMidpoints_;
    };
    RenderFeature2.prototype.getId = function() {
      return this.id_;
    };
    RenderFeature2.prototype.getOrientedFlatCoordinates = function() {
      return this.flatCoordinates_;
    };
    RenderFeature2.prototype.getGeometry = function() {
      return this;
    };
    RenderFeature2.prototype.getSimplifiedGeometry = function(squaredTolerance) {
      return this;
    };
    RenderFeature2.prototype.simplifyTransformed = function(squaredTolerance, opt_transform) {
      return this;
    };
    RenderFeature2.prototype.getProperties = function() {
      return this.properties_;
    };
    RenderFeature2.prototype.getStride = function() {
      return 2;
    };
    RenderFeature2.prototype.getStyleFunction = function() {
      return this.styleFunction;
    };
    RenderFeature2.prototype.getType = function() {
      return this.type_;
    };
    RenderFeature2.prototype.transform = function(projection) {
      projection = get3(projection);
      var pixelExtent = projection.getExtent();
      var projectedExtent = projection.getWorldExtent();
      if (pixelExtent && projectedExtent) {
        var scale5 = getHeight(projectedExtent) / getHeight(pixelExtent);
        compose2(tmpTransform2, projectedExtent[0], projectedExtent[3], scale5, -scale5, 0, 0, 0);
        transform2D(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, tmpTransform2, this.flatCoordinates_);
      }
    };
    RenderFeature2.prototype.getEnds = function() {
      return this.ends_;
    };
    return RenderFeature2;
  }()
);
RenderFeature.prototype.getEndss = RenderFeature.prototype.getEnds;
RenderFeature.prototype.getFlatCoordinates = RenderFeature.prototype.getOrientedFlatCoordinates;
var Feature_default3 = RenderFeature;

// node_modules/ol/format/MVT.js
var __extends50 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MVT = (
  /** @class */
  function(_super) {
    __extends50(MVT2, _super);
    function MVT2(opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options ? opt_options : {};
      _this.dataProjection = new Projection_default({
        code: "",
        units: Units_default.TILE_PIXELS
      });
      _this.featureClass_ = options.featureClass ? options.featureClass : Feature_default3;
      _this.geometryName_ = options.geometryName;
      _this.layerName_ = options.layerName ? options.layerName : "layer";
      _this.layers_ = options.layers ? options.layers : null;
      _this.idProperty_ = options.idProperty;
      _this.supportedMediaTypes = [
        "application/vnd.mapbox-vector-tile",
        "application/x-protobuf"
      ];
      return _this;
    }
    MVT2.prototype.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
      pbf.pos = feature.geometry;
      var end = pbf.readVarint() + pbf.pos;
      var cmd = 1;
      var length = 0;
      var x = 0;
      var y = 0;
      var coordsLen = 0;
      var currentEnd = 0;
      while (pbf.pos < end) {
        if (!length) {
          var cmdLen = pbf.readVarint();
          cmd = cmdLen & 7;
          length = cmdLen >> 3;
        }
        length--;
        if (cmd === 1 || cmd === 2) {
          x += pbf.readSVarint();
          y += pbf.readSVarint();
          if (cmd === 1) {
            if (coordsLen > currentEnd) {
              ends.push(coordsLen);
              currentEnd = coordsLen;
            }
          }
          flatCoordinates.push(x, y);
          coordsLen += 2;
        } else if (cmd === 7) {
          if (coordsLen > currentEnd) {
            flatCoordinates.push(flatCoordinates[currentEnd], flatCoordinates[currentEnd + 1]);
            coordsLen += 2;
          }
        } else {
          assert(false, 59);
        }
      }
      if (coordsLen > currentEnd) {
        ends.push(coordsLen);
        currentEnd = coordsLen;
      }
    };
    MVT2.prototype.createFeature_ = function(pbf, rawFeature, options) {
      var type = rawFeature.type;
      if (type === 0) {
        return null;
      }
      var feature;
      var values = rawFeature.properties;
      var id2;
      if (!this.idProperty_) {
        id2 = rawFeature.id;
      } else {
        id2 = values[this.idProperty_];
        delete values[this.idProperty_];
      }
      values[this.layerName_] = rawFeature.layer.name;
      var flatCoordinates = (
        /** @type {Array<number>} */
        []
      );
      var ends = (
        /** @type {Array<number>} */
        []
      );
      this.readRawGeometry_(pbf, rawFeature, flatCoordinates, ends);
      var geometryType2 = getGeometryType(type, ends.length);
      if (this.featureClass_ === Feature_default3) {
        feature = new this.featureClass_(geometryType2, flatCoordinates, ends, values, id2);
        feature.transform(options.dataProjection);
      } else {
        var geom = void 0;
        if (geometryType2 == "Polygon") {
          var endss = inflateEnds(flatCoordinates, ends);
          geom = endss.length > 1 ? new MultiPolygon_default(flatCoordinates, GeometryLayout_default.XY, endss) : new Polygon_default(flatCoordinates, GeometryLayout_default.XY, ends);
        } else {
          geom = geometryType2 === "Point" ? new Point_default(flatCoordinates, GeometryLayout_default.XY) : geometryType2 === "LineString" ? new LineString_default(flatCoordinates, GeometryLayout_default.XY) : geometryType2 === "MultiPoint" ? new MultiPoint_default(flatCoordinates, GeometryLayout_default.XY) : geometryType2 === "MultiLineString" ? new MultiLineString_default(flatCoordinates, GeometryLayout_default.XY, ends) : null;
        }
        var ctor = (
          /** @type {typeof import("../Feature.js").default} */
          this.featureClass_
        );
        feature = new ctor();
        if (this.geometryName_) {
          feature.setGeometryName(this.geometryName_);
        }
        var geometry2 = transformGeometryWithOptions(geom, false, options);
        feature.setGeometry(geometry2);
        if (id2 !== void 0) {
          feature.setId(id2);
        }
        feature.setProperties(values, true);
      }
      return feature;
    };
    MVT2.prototype.getType = function() {
      return "arraybuffer";
    };
    MVT2.prototype.readFeatures = function(source, opt_options) {
      var layers = this.layers_;
      var options = (
        /** @type {import("./Feature.js").ReadOptions} */
        this.adaptOptions(opt_options)
      );
      var dataProjection = get3(options.dataProjection);
      dataProjection.setWorldExtent(options.extent);
      options.dataProjection = dataProjection;
      var pbf = new import_pbf.default(
        /** @type {ArrayBuffer} */
        source
      );
      var pbfLayers = pbf.readFields(layersPBFReader, {});
      var features = [];
      for (var name_1 in pbfLayers) {
        if (layers && layers.indexOf(name_1) == -1) {
          continue;
        }
        var pbfLayer = pbfLayers[name_1];
        var extent = pbfLayer ? [0, 0, pbfLayer.extent, pbfLayer.extent] : null;
        dataProjection.setExtent(extent);
        for (var i2 = 0, ii = pbfLayer.length; i2 < ii; ++i2) {
          var rawFeature = readRawFeature(pbf, pbfLayer, i2);
          var feature = this.createFeature_(pbf, rawFeature, options);
          if (feature !== null) {
            features.push(feature);
          }
        }
      }
      return features;
    };
    MVT2.prototype.readProjection = function(source) {
      return this.dataProjection;
    };
    MVT2.prototype.setLayers = function(layers) {
      this.layers_ = layers;
    };
    return MVT2;
  }(Feature_default)
);
function layersPBFReader(tag, layers, pbf) {
  if (tag === 3) {
    var layer = {
      keys: [],
      values: [],
      features: []
    };
    var end = pbf.readVarint() + pbf.pos;
    pbf.readFields(layerPBFReader, layer, end);
    layer.length = layer.features.length;
    if (layer.length) {
      layers[layer.name] = layer;
    }
  }
}
function layerPBFReader(tag, layer, pbf) {
  if (tag === 15) {
    layer.version = pbf.readVarint();
  } else if (tag === 1) {
    layer.name = pbf.readString();
  } else if (tag === 5) {
    layer.extent = pbf.readVarint();
  } else if (tag === 2) {
    layer.features.push(pbf.pos);
  } else if (tag === 3) {
    layer.keys.push(pbf.readString());
  } else if (tag === 4) {
    var value = null;
    var end = pbf.readVarint() + pbf.pos;
    while (pbf.pos < end) {
      tag = pbf.readVarint() >> 3;
      value = tag === 1 ? pbf.readString() : tag === 2 ? pbf.readFloat() : tag === 3 ? pbf.readDouble() : tag === 4 ? pbf.readVarint64() : tag === 5 ? pbf.readVarint() : tag === 6 ? pbf.readSVarint() : tag === 7 ? pbf.readBoolean() : null;
    }
    layer.values.push(value);
  }
}
function featurePBFReader(tag, feature, pbf) {
  if (tag == 1) {
    feature.id = pbf.readVarint();
  } else if (tag == 2) {
    var end = pbf.readVarint() + pbf.pos;
    while (pbf.pos < end) {
      var key = feature.layer.keys[pbf.readVarint()];
      var value = feature.layer.values[pbf.readVarint()];
      feature.properties[key] = value;
    }
  } else if (tag == 3) {
    feature.type = pbf.readVarint();
  } else if (tag == 4) {
    feature.geometry = pbf.pos;
  }
}
function readRawFeature(pbf, layer, i2) {
  pbf.pos = layer.features[i2];
  var end = pbf.readVarint() + pbf.pos;
  var feature = {
    layer,
    type: 0,
    properties: {}
  };
  pbf.readFields(featurePBFReader, feature, end);
  return feature;
}
function getGeometryType(type, numEnds) {
  var geometryType2;
  if (type === 1) {
    geometryType2 = numEnds === 1 ? "Point" : "MultiPoint";
  } else if (type === 2) {
    geometryType2 = numEnds === 1 ? "LineString" : "MultiLineString";
  } else if (type === 3) {
    geometryType2 = "Polygon";
  }
  return geometryType2;
}
var MVT_default = MVT;

// node_modules/ol/format/JSONFeature.js
var __extends51 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var JSONFeature = (
  /** @class */
  function(_super) {
    __extends51(JSONFeature2, _super);
    function JSONFeature2() {
      return _super.call(this) || this;
    }
    JSONFeature2.prototype.getType = function() {
      return "json";
    };
    JSONFeature2.prototype.readFeature = function(source, opt_options) {
      return this.readFeatureFromObject(getObject(source), this.getReadOptions(source, opt_options));
    };
    JSONFeature2.prototype.readFeatures = function(source, opt_options) {
      return this.readFeaturesFromObject(getObject(source), this.getReadOptions(source, opt_options));
    };
    JSONFeature2.prototype.readFeatureFromObject = function(object, opt_options) {
      return abstract();
    };
    JSONFeature2.prototype.readFeaturesFromObject = function(object, opt_options) {
      return abstract();
    };
    JSONFeature2.prototype.readGeometry = function(source, opt_options) {
      return this.readGeometryFromObject(getObject(source), this.getReadOptions(source, opt_options));
    };
    JSONFeature2.prototype.readGeometryFromObject = function(object, opt_options) {
      return abstract();
    };
    JSONFeature2.prototype.readProjection = function(source) {
      return this.readProjectionFromObject(getObject(source));
    };
    JSONFeature2.prototype.readProjectionFromObject = function(object) {
      return abstract();
    };
    JSONFeature2.prototype.writeFeature = function(feature, opt_options) {
      return JSON.stringify(this.writeFeatureObject(feature, opt_options));
    };
    JSONFeature2.prototype.writeFeatureObject = function(feature, opt_options) {
      return abstract();
    };
    JSONFeature2.prototype.writeFeatures = function(features, opt_options) {
      return JSON.stringify(this.writeFeaturesObject(features, opt_options));
    };
    JSONFeature2.prototype.writeFeaturesObject = function(features, opt_options) {
      return abstract();
    };
    JSONFeature2.prototype.writeGeometry = function(geometry2, opt_options) {
      return JSON.stringify(this.writeGeometryObject(geometry2, opt_options));
    };
    JSONFeature2.prototype.writeGeometryObject = function(geometry2, opt_options) {
      return abstract();
    };
    return JSONFeature2;
  }(Feature_default)
);
function getObject(source) {
  if (typeof source === "string") {
    var object = JSON.parse(source);
    return object ? (
      /** @type {Object} */
      object
    ) : null;
  } else if (source !== null) {
    return source;
  } else {
    return null;
  }
}
var JSONFeature_default = JSONFeature;

// node_modules/ol/format/GeoJSON.js
var __extends52 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var GeoJSON = (
  /** @class */
  function(_super) {
    __extends52(GeoJSON2, _super);
    function GeoJSON2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this) || this;
      _this.dataProjection = get3(options.dataProjection ? options.dataProjection : "EPSG:4326");
      if (options.featureProjection) {
        _this.defaultFeatureProjection = get3(options.featureProjection);
      }
      _this.geometryName_ = options.geometryName;
      _this.extractGeometryName_ = options.extractGeometryName;
      _this.supportedMediaTypes = [
        "application/geo+json",
        "application/vnd.geo+json"
      ];
      return _this;
    }
    GeoJSON2.prototype.readFeatureFromObject = function(object, opt_options) {
      var geoJSONFeature = null;
      if (object["type"] === "Feature") {
        geoJSONFeature = /** @type {GeoJSONFeature} */
        object;
      } else {
        geoJSONFeature = {
          "type": "Feature",
          "geometry": (
            /** @type {GeoJSONGeometry} */
            object
          ),
          "properties": null
        };
      }
      var geometry2 = readGeometry(geoJSONFeature["geometry"], opt_options);
      var feature = new Feature_default2();
      if (this.geometryName_) {
        feature.setGeometryName(this.geometryName_);
      } else if (this.extractGeometryName_ && "geometry_name" in geoJSONFeature !== void 0) {
        feature.setGeometryName(geoJSONFeature["geometry_name"]);
      }
      feature.setGeometry(geometry2);
      if ("id" in geoJSONFeature) {
        feature.setId(geoJSONFeature["id"]);
      }
      if (geoJSONFeature["properties"]) {
        feature.setProperties(geoJSONFeature["properties"], true);
      }
      return feature;
    };
    GeoJSON2.prototype.readFeaturesFromObject = function(object, opt_options) {
      var geoJSONObject = (
        /** @type {GeoJSONObject} */
        object
      );
      var features = null;
      if (geoJSONObject["type"] === "FeatureCollection") {
        var geoJSONFeatureCollection = (
          /** @type {GeoJSONFeatureCollection} */
          object
        );
        features = [];
        var geoJSONFeatures = geoJSONFeatureCollection["features"];
        for (var i2 = 0, ii = geoJSONFeatures.length; i2 < ii; ++i2) {
          features.push(this.readFeatureFromObject(geoJSONFeatures[i2], opt_options));
        }
      } else {
        features = [this.readFeatureFromObject(object, opt_options)];
      }
      return features;
    };
    GeoJSON2.prototype.readGeometryFromObject = function(object, opt_options) {
      return readGeometry(object, opt_options);
    };
    GeoJSON2.prototype.readProjectionFromObject = function(object) {
      var crs = object["crs"];
      var projection;
      if (crs) {
        if (crs["type"] == "name") {
          projection = get3(crs["properties"]["name"]);
        } else if (crs["type"] === "EPSG") {
          projection = get3("EPSG:" + crs["properties"]["code"]);
        } else {
          assert(false, 36);
        }
      } else {
        projection = this.dataProjection;
      }
      return (
        /** @type {import("../proj/Projection.js").default} */
        projection
      );
    };
    GeoJSON2.prototype.writeFeatureObject = function(feature, opt_options) {
      opt_options = this.adaptOptions(opt_options);
      var object = {
        "type": "Feature",
        geometry: null,
        properties: null
      };
      var id2 = feature.getId();
      if (id2 !== void 0) {
        object.id = id2;
      }
      if (!feature.hasProperties()) {
        return object;
      }
      var properties2 = feature.getProperties();
      var geometry2 = feature.getGeometry();
      if (geometry2) {
        object.geometry = writeGeometry(geometry2, opt_options);
        delete properties2[feature.getGeometryName()];
      }
      if (!isEmpty(properties2)) {
        object.properties = properties2;
      }
      return object;
    };
    GeoJSON2.prototype.writeFeaturesObject = function(features, opt_options) {
      opt_options = this.adaptOptions(opt_options);
      var objects = [];
      for (var i2 = 0, ii = features.length; i2 < ii; ++i2) {
        objects.push(this.writeFeatureObject(features[i2], opt_options));
      }
      return {
        type: "FeatureCollection",
        features: objects
      };
    };
    GeoJSON2.prototype.writeGeometryObject = function(geometry2, opt_options) {
      return writeGeometry(geometry2, this.adaptOptions(opt_options));
    };
    return GeoJSON2;
  }(JSONFeature_default)
);
function readGeometry(object, opt_options) {
  if (!object) {
    return null;
  }
  var geometry2;
  switch (object["type"]) {
    case "Point": {
      geometry2 = readPointGeometry(
        /** @type {GeoJSONPoint} */
        object
      );
      break;
    }
    case "LineString": {
      geometry2 = readLineStringGeometry(
        /** @type {GeoJSONLineString} */
        object
      );
      break;
    }
    case "Polygon": {
      geometry2 = readPolygonGeometry(
        /** @type {GeoJSONPolygon} */
        object
      );
      break;
    }
    case "MultiPoint": {
      geometry2 = readMultiPointGeometry(
        /** @type {GeoJSONMultiPoint} */
        object
      );
      break;
    }
    case "MultiLineString": {
      geometry2 = readMultiLineStringGeometry(
        /** @type {GeoJSONMultiLineString} */
        object
      );
      break;
    }
    case "MultiPolygon": {
      geometry2 = readMultiPolygonGeometry(
        /** @type {GeoJSONMultiPolygon} */
        object
      );
      break;
    }
    case "GeometryCollection": {
      geometry2 = readGeometryCollectionGeometry(
        /** @type {GeoJSONGeometryCollection} */
        object
      );
      break;
    }
    default: {
      throw new Error("Unsupported GeoJSON type: " + object["type"]);
    }
  }
  return transformGeometryWithOptions(geometry2, false, opt_options);
}
function readGeometryCollectionGeometry(object, opt_options) {
  var geometries = object["geometries"].map(
    /**
     * @param {GeoJSONGeometry} geometry Geometry.
     * @return {import("../geom/Geometry.js").default} geometry Geometry.
     */
    function(geometry2) {
      return readGeometry(geometry2, opt_options);
    }
  );
  return new GeometryCollection_default(geometries);
}
function readPointGeometry(object) {
  return new Point_default(object["coordinates"]);
}
function readLineStringGeometry(object) {
  return new LineString_default(object["coordinates"]);
}
function readMultiLineStringGeometry(object) {
  return new MultiLineString_default(object["coordinates"]);
}
function readMultiPointGeometry(object) {
  return new MultiPoint_default(object["coordinates"]);
}
function readMultiPolygonGeometry(object) {
  return new MultiPolygon_default(object["coordinates"]);
}
function readPolygonGeometry(object) {
  return new Polygon_default(object["coordinates"]);
}
function writeGeometry(geometry2, opt_options) {
  geometry2 = transformGeometryWithOptions(geometry2, true, opt_options);
  var type = geometry2.getType();
  var geoJSON;
  switch (type) {
    case "Point": {
      geoJSON = writePointGeometry(
        /** @type {Point} */
        geometry2,
        opt_options
      );
      break;
    }
    case "LineString": {
      geoJSON = writeLineStringGeometry(
        /** @type {LineString} */
        geometry2,
        opt_options
      );
      break;
    }
    case "Polygon": {
      geoJSON = writePolygonGeometry(
        /** @type {Polygon} */
        geometry2,
        opt_options
      );
      break;
    }
    case "MultiPoint": {
      geoJSON = writeMultiPointGeometry(
        /** @type {MultiPoint} */
        geometry2,
        opt_options
      );
      break;
    }
    case "MultiLineString": {
      geoJSON = writeMultiLineStringGeometry(
        /** @type {MultiLineString} */
        geometry2,
        opt_options
      );
      break;
    }
    case "MultiPolygon": {
      geoJSON = writeMultiPolygonGeometry(
        /** @type {MultiPolygon} */
        geometry2,
        opt_options
      );
      break;
    }
    case "GeometryCollection": {
      geoJSON = writeGeometryCollectionGeometry(
        /** @type {GeometryCollection} */
        geometry2,
        opt_options
      );
      break;
    }
    case "Circle": {
      geoJSON = {
        type: "GeometryCollection",
        geometries: []
      };
      break;
    }
    default: {
      throw new Error("Unsupported geometry type: " + type);
    }
  }
  return geoJSON;
}
function writeGeometryCollectionGeometry(geometry2, opt_options) {
  var geometries = geometry2.getGeometriesArray().map(function(geometry3) {
    var options = assign({}, opt_options);
    delete options.featureProjection;
    return writeGeometry(geometry3, options);
  });
  return {
    type: "GeometryCollection",
    geometries
  };
}
function writeLineStringGeometry(geometry2, opt_options) {
  return {
    type: "LineString",
    coordinates: geometry2.getCoordinates()
  };
}
function writeMultiLineStringGeometry(geometry2, opt_options) {
  return {
    type: "MultiLineString",
    coordinates: geometry2.getCoordinates()
  };
}
function writeMultiPointGeometry(geometry2, opt_options) {
  return {
    type: "MultiPoint",
    coordinates: geometry2.getCoordinates()
  };
}
function writeMultiPolygonGeometry(geometry2, opt_options) {
  var right;
  if (opt_options) {
    right = opt_options.rightHanded;
  }
  return {
    type: "MultiPolygon",
    coordinates: geometry2.getCoordinates(right)
  };
}
function writePointGeometry(geometry2, opt_options) {
  return {
    type: "Point",
    coordinates: geometry2.getCoordinates()
  };
}
function writePolygonGeometry(geometry2, opt_options) {
  var right;
  if (opt_options) {
    right = opt_options.rightHanded;
  }
  return {
    type: "Polygon",
    coordinates: geometry2.getCoordinates(right)
  };
}
var GeoJSON_default = GeoJSON;

// node_modules/ol/renderer/Map.js
var __extends53 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MapRenderer = (
  /** @class */
  function(_super) {
    __extends53(MapRenderer2, _super);
    function MapRenderer2(map2) {
      var _this = _super.call(this) || this;
      _this.map_ = map2;
      return _this;
    }
    MapRenderer2.prototype.dispatchRenderEvent = function(type, frameState) {
      abstract();
    };
    MapRenderer2.prototype.calculateMatrices2D = function(frameState) {
      var viewState = frameState.viewState;
      var coordinateToPixelTransform = frameState.coordinateToPixelTransform;
      var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;
      compose2(coordinateToPixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / viewState.resolution, -1 / viewState.resolution, -viewState.rotation, -viewState.center[0], -viewState.center[1]);
      makeInverse(pixelToCoordinateTransform, coordinateToPixelTransform);
    };
    MapRenderer2.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, checkWrapped, callback, thisArg, layerFilter, thisArg2) {
      var result;
      var viewState = frameState.viewState;
      function forEachFeatureAtCoordinate(managed, feature, layer2, geometry2) {
        return callback.call(thisArg, feature, managed ? layer2 : null, geometry2);
      }
      var projection = viewState.projection;
      var translatedCoordinate = wrapX2(coordinate.slice(), projection);
      var offsets = [[0, 0]];
      if (projection.canWrapX() && checkWrapped) {
        var projectionExtent = projection.getExtent();
        var worldWidth = getWidth(projectionExtent);
        offsets.push([-worldWidth, 0], [worldWidth, 0]);
      }
      var layerStates = frameState.layerStatesArray;
      var numLayers = layerStates.length;
      var matches = (
        /** @type {Array<HitMatch<T>>} */
        []
      );
      var tmpCoord = [];
      for (var i2 = 0; i2 < offsets.length; i2++) {
        for (var j = numLayers - 1; j >= 0; --j) {
          var layerState = layerStates[j];
          var layer = layerState.layer;
          if (layer.hasRenderer() && inView(layerState, viewState) && layerFilter.call(thisArg2, layer)) {
            var layerRenderer = layer.getRenderer();
            var source = layer.getSource();
            if (layerRenderer && source) {
              var coordinates2 = source.getWrapX() ? translatedCoordinate : coordinate;
              var callback_1 = forEachFeatureAtCoordinate.bind(null, layerState.managed);
              tmpCoord[0] = coordinates2[0] + offsets[i2][0];
              tmpCoord[1] = coordinates2[1] + offsets[i2][1];
              result = layerRenderer.forEachFeatureAtCoordinate(tmpCoord, frameState, hitTolerance, callback_1, matches);
            }
            if (result) {
              return result;
            }
          }
        }
      }
      if (matches.length === 0) {
        return void 0;
      }
      var order = 1 / matches.length;
      matches.forEach(function(m, i3) {
        return m.distanceSq += i3 * order;
      });
      matches.sort(function(a, b) {
        return a.distanceSq - b.distanceSq;
      });
      matches.some(function(m) {
        return result = m.callback(m.feature, m.layer, m.geometry);
      });
      return result;
    };
    MapRenderer2.prototype.forEachLayerAtPixel = function(pixel, frameState, hitTolerance, callback, layerFilter) {
      return abstract();
    };
    MapRenderer2.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, checkWrapped, layerFilter, thisArg) {
      var hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, TRUE, this, layerFilter, thisArg);
      return hasFeature !== void 0;
    };
    MapRenderer2.prototype.getMap = function() {
      return this.map_;
    };
    MapRenderer2.prototype.renderFrame = function(frameState) {
      abstract();
    };
    MapRenderer2.prototype.scheduleExpireIconCache = function(frameState) {
      if (shared.canExpireCache()) {
        frameState.postRenderFunctions.push(expireIconCache);
      }
    };
    return MapRenderer2;
  }(Disposable_default)
);
function expireIconCache(map2, frameState) {
  shared.expire();
}
var Map_default = MapRenderer;

// node_modules/ol/renderer/Composite.js
var __extends54 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CompositeMapRenderer = (
  /** @class */
  function(_super) {
    __extends54(CompositeMapRenderer2, _super);
    function CompositeMapRenderer2(map2) {
      var _this = _super.call(this, map2) || this;
      _this.fontChangeListenerKey_ = listen(checkedFonts, ObjectEventType_default.PROPERTYCHANGE, map2.redrawText.bind(map2));
      _this.element_ = document.createElement("div");
      var style2 = _this.element_.style;
      style2.position = "absolute";
      style2.width = "100%";
      style2.height = "100%";
      style2.zIndex = "0";
      _this.element_.className = CLASS_UNSELECTABLE + " ol-layers";
      var container = map2.getViewport();
      container.insertBefore(_this.element_, container.firstChild || null);
      _this.children_ = [];
      _this.renderedVisible_ = true;
      return _this;
    }
    CompositeMapRenderer2.prototype.dispatchRenderEvent = function(type, frameState) {
      var map2 = this.getMap();
      if (map2.hasListener(type)) {
        var event_1 = new Event_default2(type, void 0, frameState);
        map2.dispatchEvent(event_1);
      }
    };
    CompositeMapRenderer2.prototype.disposeInternal = function() {
      unlistenByKey(this.fontChangeListenerKey_);
      this.element_.parentNode.removeChild(this.element_);
      _super.prototype.disposeInternal.call(this);
    };
    CompositeMapRenderer2.prototype.renderFrame = function(frameState) {
      if (!frameState) {
        if (this.renderedVisible_) {
          this.element_.style.display = "none";
          this.renderedVisible_ = false;
        }
        return;
      }
      this.calculateMatrices2D(frameState);
      this.dispatchRenderEvent(EventType_default2.PRECOMPOSE, frameState);
      var layerStatesArray = frameState.layerStatesArray.sort(function(a, b) {
        return a.zIndex - b.zIndex;
      });
      var viewState = frameState.viewState;
      this.children_.length = 0;
      var declutterLayers = [];
      var previousElement = null;
      for (var i2 = 0, ii = layerStatesArray.length; i2 < ii; ++i2) {
        var layerState = layerStatesArray[i2];
        frameState.layerIndex = i2;
        var layer = layerState.layer;
        var sourceState = layer.getSourceState();
        if (!inView(layerState, viewState) || sourceState != "ready" && sourceState != "undefined") {
          layer.unrender();
          continue;
        }
        var element = layer.render(frameState, previousElement);
        if (!element) {
          continue;
        }
        if (element !== previousElement) {
          this.children_.push(element);
          previousElement = element;
        }
        if ("getDeclutter" in layer) {
          declutterLayers.push(
            /** @type {import("../layer/BaseVector.js").default} */
            layer
          );
        }
      }
      for (var i2 = declutterLayers.length - 1; i2 >= 0; --i2) {
        declutterLayers[i2].renderDeclutter(frameState);
      }
      replaceChildren(this.element_, this.children_);
      this.dispatchRenderEvent(EventType_default2.POSTCOMPOSE, frameState);
      if (!this.renderedVisible_) {
        this.element_.style.display = "";
        this.renderedVisible_ = true;
      }
      this.scheduleExpireIconCache(frameState);
    };
    CompositeMapRenderer2.prototype.forEachLayerAtPixel = function(pixel, frameState, hitTolerance, callback, layerFilter) {
      var viewState = frameState.viewState;
      var layerStates = frameState.layerStatesArray;
      var numLayers = layerStates.length;
      for (var i2 = numLayers - 1; i2 >= 0; --i2) {
        var layerState = layerStates[i2];
        var layer = layerState.layer;
        if (layer.hasRenderer() && inView(layerState, viewState) && layerFilter(layer)) {
          var layerRenderer = layer.getRenderer();
          var data = layerRenderer.getDataAtPixel(pixel, frameState, hitTolerance);
          if (data) {
            var result = callback(layer, data);
            if (result) {
              return result;
            }
          }
        }
      }
      return void 0;
    };
    return CompositeMapRenderer2;
  }(Map_default)
);
var Composite_default = CompositeMapRenderer;

// node_modules/ol/CollectionEventType.js
var CollectionEventType_default = {
  /**
   * Triggered when an item is added to the collection.
   * @event module:ol/Collection.CollectionEvent#add
   * @api
   */
  ADD: "add",
  /**
   * Triggered when an item is removed from the collection.
   * @event module:ol/Collection.CollectionEvent#remove
   * @api
   */
  REMOVE: "remove"
};

// node_modules/ol/Collection.js
var __extends55 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Property2 = {
  LENGTH: "length"
};
var CollectionEvent = (
  /** @class */
  function(_super) {
    __extends55(CollectionEvent2, _super);
    function CollectionEvent2(type, opt_element, opt_index) {
      var _this = _super.call(this, type) || this;
      _this.element = opt_element;
      _this.index = opt_index;
      return _this;
    }
    return CollectionEvent2;
  }(Event_default)
);
var Collection = (
  /** @class */
  function(_super) {
    __extends55(Collection2, _super);
    function Collection2(opt_array, opt_options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      var options = opt_options || {};
      _this.unique_ = !!options.unique;
      _this.array_ = opt_array ? opt_array : [];
      if (_this.unique_) {
        for (var i2 = 0, ii = _this.array_.length; i2 < ii; ++i2) {
          _this.assertUnique_(_this.array_[i2], i2);
        }
      }
      _this.updateLength_();
      return _this;
    }
    Collection2.prototype.clear = function() {
      while (this.getLength() > 0) {
        this.pop();
      }
    };
    Collection2.prototype.extend = function(arr) {
      for (var i2 = 0, ii = arr.length; i2 < ii; ++i2) {
        this.push(arr[i2]);
      }
      return this;
    };
    Collection2.prototype.forEach = function(f) {
      var array2 = this.array_;
      for (var i2 = 0, ii = array2.length; i2 < ii; ++i2) {
        f(array2[i2], i2, array2);
      }
    };
    Collection2.prototype.getArray = function() {
      return this.array_;
    };
    Collection2.prototype.item = function(index) {
      return this.array_[index];
    };
    Collection2.prototype.getLength = function() {
      return this.get(Property2.LENGTH);
    };
    Collection2.prototype.insertAt = function(index, elem) {
      if (this.unique_) {
        this.assertUnique_(elem);
      }
      this.array_.splice(index, 0, elem);
      this.updateLength_();
      this.dispatchEvent(new CollectionEvent(CollectionEventType_default.ADD, elem, index));
    };
    Collection2.prototype.pop = function() {
      return this.removeAt(this.getLength() - 1);
    };
    Collection2.prototype.push = function(elem) {
      if (this.unique_) {
        this.assertUnique_(elem);
      }
      var n = this.getLength();
      this.insertAt(n, elem);
      return this.getLength();
    };
    Collection2.prototype.remove = function(elem) {
      var arr = this.array_;
      for (var i2 = 0, ii = arr.length; i2 < ii; ++i2) {
        if (arr[i2] === elem) {
          return this.removeAt(i2);
        }
      }
      return void 0;
    };
    Collection2.prototype.removeAt = function(index) {
      var prev = this.array_[index];
      this.array_.splice(index, 1);
      this.updateLength_();
      this.dispatchEvent(new CollectionEvent(CollectionEventType_default.REMOVE, prev, index));
      return prev;
    };
    Collection2.prototype.setAt = function(index, elem) {
      var n = this.getLength();
      if (index < n) {
        if (this.unique_) {
          this.assertUnique_(elem, index);
        }
        var prev = this.array_[index];
        this.array_[index] = elem;
        this.dispatchEvent(new CollectionEvent(CollectionEventType_default.REMOVE, prev, index));
        this.dispatchEvent(new CollectionEvent(CollectionEventType_default.ADD, elem, index));
      } else {
        for (var j = n; j < index; ++j) {
          this.insertAt(j, void 0);
        }
        this.insertAt(index, elem);
      }
    };
    Collection2.prototype.updateLength_ = function() {
      this.set(Property2.LENGTH, this.array_.length);
    };
    Collection2.prototype.assertUnique_ = function(elem, opt_except) {
      for (var i2 = 0, ii = this.array_.length; i2 < ii; ++i2) {
        if (this.array_[i2] === elem && i2 !== opt_except) {
          throw new AssertionError_default(58);
        }
      }
    };
    return Collection2;
  }(Object_default)
);
var Collection_default = Collection;

// node_modules/ol/layer/Group.js
var __extends56 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var GroupEvent = (
  /** @class */
  function(_super) {
    __extends56(GroupEvent2, _super);
    function GroupEvent2(type, layer) {
      var _this = _super.call(this, type) || this;
      _this.layer = layer;
      return _this;
    }
    return GroupEvent2;
  }(Event_default)
);
var Property3 = {
  LAYERS: "layers"
};
var LayerGroup = (
  /** @class */
  function(_super) {
    __extends56(LayerGroup2, _super);
    function LayerGroup2(opt_options) {
      var _this = this;
      var options = opt_options || {};
      var baseOptions = (
        /** @type {Options} */
        assign({}, options)
      );
      delete baseOptions.layers;
      var layers = options.layers;
      _this = _super.call(this, baseOptions) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.layersListenerKeys_ = [];
      _this.listenerKeys_ = {};
      _this.addChangeListener(Property3.LAYERS, _this.handleLayersChanged_);
      if (layers) {
        if (Array.isArray(layers)) {
          layers = new Collection_default(layers.slice(), { unique: true });
        } else {
          assert(typeof /** @type {?} */
          layers.getArray === "function", 43);
        }
      } else {
        layers = new Collection_default(void 0, { unique: true });
      }
      _this.setLayers(layers);
      return _this;
    }
    LayerGroup2.prototype.handleLayerChange_ = function() {
      this.changed();
    };
    LayerGroup2.prototype.handleLayersChanged_ = function() {
      this.layersListenerKeys_.forEach(unlistenByKey);
      this.layersListenerKeys_.length = 0;
      var layers = this.getLayers();
      this.layersListenerKeys_.push(listen(layers, CollectionEventType_default.ADD, this.handleLayersAdd_, this), listen(layers, CollectionEventType_default.REMOVE, this.handleLayersRemove_, this));
      for (var id2 in this.listenerKeys_) {
        this.listenerKeys_[id2].forEach(unlistenByKey);
      }
      clear(this.listenerKeys_);
      var layersArray = layers.getArray();
      for (var i2 = 0, ii = layersArray.length; i2 < ii; i2++) {
        var layer = layersArray[i2];
        this.registerLayerListeners_(layer);
        this.dispatchEvent(new GroupEvent("addlayer", layer));
      }
      this.changed();
    };
    LayerGroup2.prototype.registerLayerListeners_ = function(layer) {
      var listenerKeys = [
        listen(layer, ObjectEventType_default.PROPERTYCHANGE, this.handleLayerChange_, this),
        listen(layer, EventType_default.CHANGE, this.handleLayerChange_, this)
      ];
      if (layer instanceof LayerGroup2) {
        listenerKeys.push(listen(layer, "addlayer", this.handleLayerGroupAdd_, this), listen(layer, "removelayer", this.handleLayerGroupRemove_, this));
      }
      this.listenerKeys_[getUid(layer)] = listenerKeys;
    };
    LayerGroup2.prototype.handleLayerGroupAdd_ = function(event) {
      this.dispatchEvent(new GroupEvent("addlayer", event.layer));
    };
    LayerGroup2.prototype.handleLayerGroupRemove_ = function(event) {
      this.dispatchEvent(new GroupEvent("removelayer", event.layer));
    };
    LayerGroup2.prototype.handleLayersAdd_ = function(collectionEvent) {
      var layer = (
        /** @type {import("./Base.js").default} */
        collectionEvent.element
      );
      this.registerLayerListeners_(layer);
      this.dispatchEvent(new GroupEvent("addlayer", layer));
      this.changed();
    };
    LayerGroup2.prototype.handleLayersRemove_ = function(collectionEvent) {
      var layer = (
        /** @type {import("./Base.js").default} */
        collectionEvent.element
      );
      var key = getUid(layer);
      this.listenerKeys_[key].forEach(unlistenByKey);
      delete this.listenerKeys_[key];
      this.dispatchEvent(new GroupEvent("removelayer", layer));
      this.changed();
    };
    LayerGroup2.prototype.getLayers = function() {
      return (
        /** @type {!import("../Collection.js").default<import("./Base.js").default>} */
        this.get(Property3.LAYERS)
      );
    };
    LayerGroup2.prototype.setLayers = function(layers) {
      var collection = this.getLayers();
      if (collection) {
        var currentLayers = collection.getArray();
        for (var i2 = 0, ii = currentLayers.length; i2 < ii; ++i2) {
          this.dispatchEvent(new GroupEvent("removelayer", currentLayers[i2]));
        }
      }
      this.set(Property3.LAYERS, layers);
    };
    LayerGroup2.prototype.getLayersArray = function(opt_array) {
      var array2 = opt_array !== void 0 ? opt_array : [];
      this.getLayers().forEach(function(layer) {
        layer.getLayersArray(array2);
      });
      return array2;
    };
    LayerGroup2.prototype.getLayerStatesArray = function(opt_states) {
      var states = opt_states !== void 0 ? opt_states : [];
      var pos = states.length;
      this.getLayers().forEach(function(layer) {
        layer.getLayerStatesArray(states);
      });
      var ownLayerState = this.getLayerState();
      var defaultZIndex = ownLayerState.zIndex;
      if (!opt_states && ownLayerState.zIndex === void 0) {
        defaultZIndex = 0;
      }
      for (var i2 = pos, ii = states.length; i2 < ii; i2++) {
        var layerState = states[i2];
        layerState.opacity *= ownLayerState.opacity;
        layerState.visible = layerState.visible && ownLayerState.visible;
        layerState.maxResolution = Math.min(layerState.maxResolution, ownLayerState.maxResolution);
        layerState.minResolution = Math.max(layerState.minResolution, ownLayerState.minResolution);
        layerState.minZoom = Math.max(layerState.minZoom, ownLayerState.minZoom);
        layerState.maxZoom = Math.min(layerState.maxZoom, ownLayerState.maxZoom);
        if (ownLayerState.extent !== void 0) {
          if (layerState.extent !== void 0) {
            layerState.extent = getIntersection(layerState.extent, ownLayerState.extent);
          } else {
            layerState.extent = ownLayerState.extent;
          }
        }
        if (layerState.zIndex === void 0) {
          layerState.zIndex = defaultZIndex;
        }
      }
      return states;
    };
    LayerGroup2.prototype.getSourceState = function() {
      return "ready";
    };
    return LayerGroup2;
  }(Base_default)
);
var Group_default = LayerGroup;

// node_modules/ol/MapEvent.js
var __extends57 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MapEvent = (
  /** @class */
  function(_super) {
    __extends57(MapEvent2, _super);
    function MapEvent2(type, map2, opt_frameState) {
      var _this = _super.call(this, type) || this;
      _this.map = map2;
      _this.frameState = opt_frameState !== void 0 ? opt_frameState : null;
      return _this;
    }
    return MapEvent2;
  }(Event_default)
);
var MapEvent_default = MapEvent;

// node_modules/ol/MapBrowserEvent.js
var __extends58 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MapBrowserEvent = (
  /** @class */
  function(_super) {
    __extends58(MapBrowserEvent2, _super);
    function MapBrowserEvent2(type, map2, originalEvent, opt_dragging, opt_frameState, opt_activePointers) {
      var _this = _super.call(this, type, map2, opt_frameState) || this;
      _this.originalEvent = originalEvent;
      _this.pixel_ = null;
      _this.coordinate_ = null;
      _this.dragging = opt_dragging !== void 0 ? opt_dragging : false;
      _this.activePointers = opt_activePointers;
      return _this;
    }
    Object.defineProperty(MapBrowserEvent2.prototype, "pixel", {
      /**
       * The map pixel relative to the viewport corresponding to the original event.
       * @type {import("./pixel.js").Pixel}
       * @api
       */
      get: function() {
        if (!this.pixel_) {
          this.pixel_ = this.map.getEventPixel(this.originalEvent);
        }
        return this.pixel_;
      },
      set: function(pixel) {
        this.pixel_ = pixel;
      },
      enumerable: false,
      configurable: true
    });
    Object.defineProperty(MapBrowserEvent2.prototype, "coordinate", {
      /**
       * The coordinate corresponding to the original browser event.  This will be in the user
       * projection if one is set.  Otherwise it will be in the view projection.
       * @type {import("./coordinate.js").Coordinate}
       * @api
       */
      get: function() {
        if (!this.coordinate_) {
          this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel);
        }
        return this.coordinate_;
      },
      set: function(coordinate) {
        this.coordinate_ = coordinate;
      },
      enumerable: false,
      configurable: true
    });
    MapBrowserEvent2.prototype.preventDefault = function() {
      _super.prototype.preventDefault.call(this);
      if ("preventDefault" in this.originalEvent) {
        this.originalEvent.preventDefault();
      }
    };
    MapBrowserEvent2.prototype.stopPropagation = function() {
      _super.prototype.stopPropagation.call(this);
      if ("stopPropagation" in this.originalEvent) {
        this.originalEvent.stopPropagation();
      }
    };
    return MapBrowserEvent2;
  }(MapEvent_default)
);
var MapBrowserEvent_default = MapBrowserEvent;

// node_modules/ol/MapBrowserEventType.js
var MapBrowserEventType_default = {
  /**
   * A true single click with no dragging and no double click. Note that this
   * event is delayed by 250 ms to ensure that it is not a double click.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick
   * @api
   */
  SINGLECLICK: "singleclick",
  /**
   * A click with no dragging. A double click will fire two of this.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#click
   * @api
   */
  CLICK: EventType_default.CLICK,
  /**
   * A true double click, with no dragging.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick
   * @api
   */
  DBLCLICK: EventType_default.DBLCLICK,
  /**
   * Triggered when a pointer is dragged.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag
   * @api
   */
  POINTERDRAG: "pointerdrag",
  /**
   * Triggered when a pointer is moved. Note that on touch devices this is
   * triggered when the map is panned, so is not the same as mousemove.
   * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove
   * @api
   */
  POINTERMOVE: "pointermove",
  POINTERDOWN: "pointerdown",
  POINTERUP: "pointerup",
  POINTEROVER: "pointerover",
  POINTEROUT: "pointerout",
  POINTERENTER: "pointerenter",
  POINTERLEAVE: "pointerleave",
  POINTERCANCEL: "pointercancel"
};

// node_modules/ol/pointer/EventType.js
var EventType_default3 = {
  POINTERMOVE: "pointermove",
  POINTERDOWN: "pointerdown",
  POINTERUP: "pointerup",
  POINTEROVER: "pointerover",
  POINTEROUT: "pointerout",
  POINTERENTER: "pointerenter",
  POINTERLEAVE: "pointerleave",
  POINTERCANCEL: "pointercancel"
};

// node_modules/ol/MapBrowserEventHandler.js
var __extends59 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var MapBrowserEventHandler = (
  /** @class */
  function(_super) {
    __extends59(MapBrowserEventHandler2, _super);
    function MapBrowserEventHandler2(map2, moveTolerance) {
      var _this = _super.call(this, map2) || this;
      _this.map_ = map2;
      _this.clickTimeoutId_;
      _this.emulateClicks_ = false;
      _this.dragging_ = false;
      _this.dragListenerKeys_ = [];
      _this.moveTolerance_ = moveTolerance === void 0 ? 1 : moveTolerance;
      _this.down_ = null;
      var element = _this.map_.getViewport();
      _this.activePointers_ = [];
      _this.trackedTouches_ = {};
      _this.element_ = element;
      _this.pointerdownListenerKey_ = listen(element, EventType_default3.POINTERDOWN, _this.handlePointerDown_, _this);
      _this.originalPointerMoveEvent_;
      _this.relayedListenerKey_ = listen(element, EventType_default3.POINTERMOVE, _this.relayMoveEvent_, _this);
      _this.boundHandleTouchMove_ = _this.handleTouchMove_.bind(_this);
      _this.element_.addEventListener(EventType_default.TOUCHMOVE, _this.boundHandleTouchMove_, PASSIVE_EVENT_LISTENERS ? { passive: false } : false);
      return _this;
    }
    MapBrowserEventHandler2.prototype.emulateClick_ = function(pointerEvent) {
      var newEvent = new MapBrowserEvent_default(MapBrowserEventType_default.CLICK, this.map_, pointerEvent);
      this.dispatchEvent(newEvent);
      if (this.clickTimeoutId_ !== void 0) {
        clearTimeout(this.clickTimeoutId_);
        this.clickTimeoutId_ = void 0;
        newEvent = new MapBrowserEvent_default(MapBrowserEventType_default.DBLCLICK, this.map_, pointerEvent);
        this.dispatchEvent(newEvent);
      } else {
        this.clickTimeoutId_ = setTimeout(
          /** @this {MapBrowserEventHandler} */
          (function() {
            this.clickTimeoutId_ = void 0;
            var newEvent2 = new MapBrowserEvent_default(MapBrowserEventType_default.SINGLECLICK, this.map_, pointerEvent);
            this.dispatchEvent(newEvent2);
          }).bind(this),
          250
        );
      }
    };
    MapBrowserEventHandler2.prototype.updateActivePointers_ = function(pointerEvent) {
      var event = pointerEvent;
      var id2 = event.pointerId;
      if (event.type == MapBrowserEventType_default.POINTERUP || event.type == MapBrowserEventType_default.POINTERCANCEL) {
        delete this.trackedTouches_[id2];
        for (var pointerId in this.trackedTouches_) {
          if (this.trackedTouches_[pointerId].target !== event.target) {
            delete this.trackedTouches_[pointerId];
            break;
          }
        }
      } else if (event.type == MapBrowserEventType_default.POINTERDOWN || event.type == MapBrowserEventType_default.POINTERMOVE) {
        this.trackedTouches_[id2] = event;
      }
      this.activePointers_ = getValues(this.trackedTouches_);
    };
    MapBrowserEventHandler2.prototype.handlePointerUp_ = function(pointerEvent) {
      this.updateActivePointers_(pointerEvent);
      var newEvent = new MapBrowserEvent_default(MapBrowserEventType_default.POINTERUP, this.map_, pointerEvent, void 0, void 0, this.activePointers_);
      this.dispatchEvent(newEvent);
      if (this.emulateClicks_ && !newEvent.defaultPrevented && !this.dragging_ && this.isMouseActionButton_(pointerEvent)) {
        this.emulateClick_(this.down_);
      }
      if (this.activePointers_.length === 0) {
        this.dragListenerKeys_.forEach(unlistenByKey);
        this.dragListenerKeys_.length = 0;
        this.dragging_ = false;
        this.down_ = null;
      }
    };
    MapBrowserEventHandler2.prototype.isMouseActionButton_ = function(pointerEvent) {
      return pointerEvent.button === 0;
    };
    MapBrowserEventHandler2.prototype.handlePointerDown_ = function(pointerEvent) {
      this.emulateClicks_ = this.activePointers_.length === 0;
      this.updateActivePointers_(pointerEvent);
      var newEvent = new MapBrowserEvent_default(MapBrowserEventType_default.POINTERDOWN, this.map_, pointerEvent, void 0, void 0, this.activePointers_);
      this.dispatchEvent(newEvent);
      this.down_ = /** @type {PointerEvent} */
      {};
      for (var property in pointerEvent) {
        var value = pointerEvent[property];
        this.down_[property] = typeof value === "function" ? VOID : value;
      }
      if (this.dragListenerKeys_.length === 0) {
        var doc = this.map_.getOwnerDocument();
        this.dragListenerKeys_.push(
          listen(doc, MapBrowserEventType_default.POINTERMOVE, this.handlePointerMove_, this),
          listen(doc, MapBrowserEventType_default.POINTERUP, this.handlePointerUp_, this),
          /* Note that the listener for `pointercancel is set up on
           * `pointerEventHandler_` and not `documentPointerEventHandler_` like
           * the `pointerup` and `pointermove` listeners.
           *
           * The reason for this is the following: `TouchSource.vacuumTouches_()`
           * issues `pointercancel` events, when there was no `touchend` for a
           * `touchstart`. Now, let's say a first `touchstart` is registered on
           * `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.
           * But `documentPointerEventHandler_` doesn't know about the first
           * `touchstart`. If there is no `touchend` for the `touchstart`, we can
           * only receive a `touchcancel` from `pointerEventHandler_`, because it is
           * only registered there.
           */
          listen(this.element_, MapBrowserEventType_default.POINTERCANCEL, this.handlePointerUp_, this)
        );
        if (this.element_.getRootNode && this.element_.getRootNode() !== doc) {
          this.dragListenerKeys_.push(listen(this.element_.getRootNode(), MapBrowserEventType_default.POINTERUP, this.handlePointerUp_, this));
        }
      }
    };
    MapBrowserEventHandler2.prototype.handlePointerMove_ = function(pointerEvent) {
      if (this.isMoving_(pointerEvent)) {
        this.updateActivePointers_(pointerEvent);
        this.dragging_ = true;
        var newEvent = new MapBrowserEvent_default(MapBrowserEventType_default.POINTERDRAG, this.map_, pointerEvent, this.dragging_, void 0, this.activePointers_);
        this.dispatchEvent(newEvent);
      }
    };
    MapBrowserEventHandler2.prototype.relayMoveEvent_ = function(pointerEvent) {
      this.originalPointerMoveEvent_ = pointerEvent;
      var dragging = !!(this.down_ && this.isMoving_(pointerEvent));
      this.dispatchEvent(new MapBrowserEvent_default(MapBrowserEventType_default.POINTERMOVE, this.map_, pointerEvent, dragging));
    };
    MapBrowserEventHandler2.prototype.handleTouchMove_ = function(event) {
      var originalEvent = this.originalPointerMoveEvent_;
      if ((!originalEvent || originalEvent.defaultPrevented) && (typeof event.cancelable !== "boolean" || event.cancelable === true)) {
        event.preventDefault();
      }
    };
    MapBrowserEventHandler2.prototype.isMoving_ = function(pointerEvent) {
      return this.dragging_ || Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_;
    };
    MapBrowserEventHandler2.prototype.disposeInternal = function() {
      if (this.relayedListenerKey_) {
        unlistenByKey(this.relayedListenerKey_);
        this.relayedListenerKey_ = null;
      }
      this.element_.removeEventListener(EventType_default.TOUCHMOVE, this.boundHandleTouchMove_);
      if (this.pointerdownListenerKey_) {
        unlistenByKey(this.pointerdownListenerKey_);
        this.pointerdownListenerKey_ = null;
      }
      this.dragListenerKeys_.forEach(unlistenByKey);
      this.dragListenerKeys_.length = 0;
      this.element_ = null;
      _super.prototype.disposeInternal.call(this);
    };
    return MapBrowserEventHandler2;
  }(Target_default)
);
var MapBrowserEventHandler_default = MapBrowserEventHandler;

// node_modules/ol/MapEventType.js
var MapEventType_default = {
  /**
   * Triggered after a map frame is rendered.
   * @event module:ol/MapEvent~MapEvent#postrender
   * @api
   */
  POSTRENDER: "postrender",
  /**
   * Triggered when the map starts moving.
   * @event module:ol/MapEvent~MapEvent#movestart
   * @api
   */
  MOVESTART: "movestart",
  /**
   * Triggered after the map is moved.
   * @event module:ol/MapEvent~MapEvent#moveend
   * @api
   */
  MOVEEND: "moveend",
  /**
   * Triggered when loading of additional map data (tiles, images, features) starts.
   * @event module:ol/MapEvent~MapEvent#loadstart
   * @api
   */
  LOADSTART: "loadstart",
  /**
   * Triggered when loading of additional map data has completed.
   * @event module:ol/MapEvent~MapEvent#loadend
   * @api
   */
  LOADEND: "loadend"
};

// node_modules/ol/MapProperty.js
var MapProperty_default = {
  LAYERGROUP: "layergroup",
  SIZE: "size",
  TARGET: "target",
  VIEW: "view"
};

// node_modules/ol/structs/PriorityQueue.js
var DROP = Infinity;
var PriorityQueue = (
  /** @class */
  function() {
    function PriorityQueue2(priorityFunction, keyFunction) {
      this.priorityFunction_ = priorityFunction;
      this.keyFunction_ = keyFunction;
      this.elements_ = [];
      this.priorities_ = [];
      this.queuedElements_ = {};
    }
    PriorityQueue2.prototype.clear = function() {
      this.elements_.length = 0;
      this.priorities_.length = 0;
      clear(this.queuedElements_);
    };
    PriorityQueue2.prototype.dequeue = function() {
      var elements = this.elements_;
      var priorities = this.priorities_;
      var element = elements[0];
      if (elements.length == 1) {
        elements.length = 0;
        priorities.length = 0;
      } else {
        elements[0] = elements.pop();
        priorities[0] = priorities.pop();
        this.siftUp_(0);
      }
      var elementKey = this.keyFunction_(element);
      delete this.queuedElements_[elementKey];
      return element;
    };
    PriorityQueue2.prototype.enqueue = function(element) {
      assert(!(this.keyFunction_(element) in this.queuedElements_), 31);
      var priority = this.priorityFunction_(element);
      if (priority != DROP) {
        this.elements_.push(element);
        this.priorities_.push(priority);
        this.queuedElements_[this.keyFunction_(element)] = true;
        this.siftDown_(0, this.elements_.length - 1);
        return true;
      }
      return false;
    };
    PriorityQueue2.prototype.getCount = function() {
      return this.elements_.length;
    };
    PriorityQueue2.prototype.getLeftChildIndex_ = function(index) {
      return index * 2 + 1;
    };
    PriorityQueue2.prototype.getRightChildIndex_ = function(index) {
      return index * 2 + 2;
    };
    PriorityQueue2.prototype.getParentIndex_ = function(index) {
      return index - 1 >> 1;
    };
    PriorityQueue2.prototype.heapify_ = function() {
      var i2;
      for (i2 = (this.elements_.length >> 1) - 1; i2 >= 0; i2--) {
        this.siftUp_(i2);
      }
    };
    PriorityQueue2.prototype.isEmpty = function() {
      return this.elements_.length === 0;
    };
    PriorityQueue2.prototype.isKeyQueued = function(key) {
      return key in this.queuedElements_;
    };
    PriorityQueue2.prototype.isQueued = function(element) {
      return this.isKeyQueued(this.keyFunction_(element));
    };
    PriorityQueue2.prototype.siftUp_ = function(index) {
      var elements = this.elements_;
      var priorities = this.priorities_;
      var count = elements.length;
      var element = elements[index];
      var priority = priorities[index];
      var startIndex = index;
      while (index < count >> 1) {
        var lIndex = this.getLeftChildIndex_(index);
        var rIndex = this.getRightChildIndex_(index);
        var smallerChildIndex = rIndex < count && priorities[rIndex] < priorities[lIndex] ? rIndex : lIndex;
        elements[index] = elements[smallerChildIndex];
        priorities[index] = priorities[smallerChildIndex];
        index = smallerChildIndex;
      }
      elements[index] = element;
      priorities[index] = priority;
      this.siftDown_(startIndex, index);
    };
    PriorityQueue2.prototype.siftDown_ = function(startIndex, index) {
      var elements = this.elements_;
      var priorities = this.priorities_;
      var element = elements[index];
      var priority = priorities[index];
      while (index > startIndex) {
        var parentIndex = this.getParentIndex_(index);
        if (priorities[parentIndex] > priority) {
          elements[index] = elements[parentIndex];
          priorities[index] = priorities[parentIndex];
          index = parentIndex;
        } else {
          break;
        }
      }
      elements[index] = element;
      priorities[index] = priority;
    };
    PriorityQueue2.prototype.reprioritize = function() {
      var priorityFunction = this.priorityFunction_;
      var elements = this.elements_;
      var priorities = this.priorities_;
      var index = 0;
      var n = elements.length;
      var element, i2, priority;
      for (i2 = 0; i2 < n; ++i2) {
        element = elements[i2];
        priority = priorityFunction(element);
        if (priority == DROP) {
          delete this.queuedElements_[this.keyFunction_(element)];
        } else {
          priorities[index] = priority;
          elements[index++] = element;
        }
      }
      elements.length = index;
      priorities.length = index;
      this.heapify_();
    };
    return PriorityQueue2;
  }()
);
var PriorityQueue_default = PriorityQueue;

// node_modules/ol/TileQueue.js
var __extends60 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileQueue = (
  /** @class */
  function(_super) {
    __extends60(TileQueue2, _super);
    function TileQueue2(tilePriorityFunction, tileChangeCallback) {
      var _this = _super.call(
        this,
        /**
         * @param {Array} element Element.
         * @return {number} Priority.
         */
        function(element) {
          return tilePriorityFunction.apply(null, element);
        },
        /**
         * @param {Array} element Element.
         * @return {string} Key.
         */
        function(element) {
          return (
            /** @type {import("./Tile.js").default} */
            element[0].getKey()
          );
        }
      ) || this;
      _this.boundHandleTileChange_ = _this.handleTileChange.bind(_this);
      _this.tileChangeCallback_ = tileChangeCallback;
      _this.tilesLoading_ = 0;
      _this.tilesLoadingKeys_ = {};
      return _this;
    }
    TileQueue2.prototype.enqueue = function(element) {
      var added = _super.prototype.enqueue.call(this, element);
      if (added) {
        var tile = element[0];
        tile.addEventListener(EventType_default.CHANGE, this.boundHandleTileChange_);
      }
      return added;
    };
    TileQueue2.prototype.getTilesLoading = function() {
      return this.tilesLoading_;
    };
    TileQueue2.prototype.handleTileChange = function(event) {
      var tile = (
        /** @type {import("./Tile.js").default} */
        event.target
      );
      var state2 = tile.getState();
      if (state2 === TileState_default.LOADED || state2 === TileState_default.ERROR || state2 === TileState_default.EMPTY) {
        tile.removeEventListener(EventType_default.CHANGE, this.boundHandleTileChange_);
        var tileKey = tile.getKey();
        if (tileKey in this.tilesLoadingKeys_) {
          delete this.tilesLoadingKeys_[tileKey];
          --this.tilesLoading_;
        }
        this.tileChangeCallback_();
      }
    };
    TileQueue2.prototype.loadMoreTiles = function(maxTotalLoading, maxNewLoads) {
      var newLoads = 0;
      var state2, tile, tileKey;
      while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads && this.getCount() > 0) {
        tile = /** @type {import("./Tile.js").default} */
        this.dequeue()[0];
        tileKey = tile.getKey();
        state2 = tile.getState();
        if (state2 === TileState_default.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
          this.tilesLoadingKeys_[tileKey] = true;
          ++this.tilesLoading_;
          ++newLoads;
          tile.load();
        }
      }
    };
    return TileQueue2;
  }(PriorityQueue_default)
);
var TileQueue_default = TileQueue;
function getTilePriority(frameState, tile, tileSourceKey, tileCenter, tileResolution) {
  if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {
    return DROP;
  }
  if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {
    return DROP;
  }
  var center = frameState.viewState.center;
  var deltaX = tileCenter[0] - center[0];
  var deltaY = tileCenter[1] - center[1];
  return 65536 * Math.log(tileResolution) + Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution;
}

// node_modules/ol/ViewProperty.js
var ViewProperty_default = {
  CENTER: "center",
  RESOLUTION: "resolution",
  ROTATION: "rotation"
};

// node_modules/ol/centerconstraint.js
function createExtent(extent, onlyCenter, smooth) {
  return (
    /**
     * @param {import("./coordinate.js").Coordinate|undefined} center Center.
     * @param {number|undefined} resolution Resolution.
     * @param {import("./size.js").Size} size Viewport size; unused if `onlyCenter` was specified.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @param {Array<number>} [opt_centerShift] Shift between map center and viewport center.
     * @return {import("./coordinate.js").Coordinate|undefined} Center.
     */
    function(center, resolution, size, opt_isMoving, opt_centerShift) {
      if (!center) {
        return void 0;
      }
      if (!resolution && !onlyCenter) {
        return center;
      }
      var viewWidth = onlyCenter ? 0 : size[0] * resolution;
      var viewHeight = onlyCenter ? 0 : size[1] * resolution;
      var shiftX = opt_centerShift ? opt_centerShift[0] : 0;
      var shiftY = opt_centerShift ? opt_centerShift[1] : 0;
      var minX = extent[0] + viewWidth / 2 + shiftX;
      var maxX = extent[2] - viewWidth / 2 + shiftX;
      var minY = extent[1] + viewHeight / 2 + shiftY;
      var maxY = extent[3] - viewHeight / 2 + shiftY;
      if (minX > maxX) {
        minX = (maxX + minX) / 2;
        maxX = minX;
      }
      if (minY > maxY) {
        minY = (maxY + minY) / 2;
        maxY = minY;
      }
      var x = clamp(center[0], minX, maxX);
      var y = clamp(center[1], minY, maxY);
      if (opt_isMoving && smooth && resolution) {
        var ratio = 30 * resolution;
        x += -ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) + ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);
        y += -ratio * Math.log(1 + Math.max(0, minY - center[1]) / ratio) + ratio * Math.log(1 + Math.max(0, center[1] - maxY) / ratio);
      }
      return [x, y];
    }
  );
}
function none(center) {
  return center;
}

// node_modules/ol/resolutionconstraint.js
function getViewportClampedResolution(resolution, maxExtent, viewportSize, showFullExtent) {
  var xResolution = getWidth(maxExtent) / viewportSize[0];
  var yResolution = getHeight(maxExtent) / viewportSize[1];
  if (showFullExtent) {
    return Math.min(resolution, Math.max(xResolution, yResolution));
  }
  return Math.min(resolution, Math.min(xResolution, yResolution));
}
function getSmoothClampedResolution(resolution, maxResolution, minResolution) {
  var result = Math.min(resolution, maxResolution);
  var ratio = 50;
  result *= Math.log(1 + ratio * Math.max(0, resolution / maxResolution - 1)) / ratio + 1;
  if (minResolution) {
    result = Math.max(result, minResolution);
    result /= Math.log(1 + ratio * Math.max(0, minResolution / resolution - 1)) / ratio + 1;
  }
  return clamp(result, minResolution / 2, maxResolution * 2);
}
function createSnapToResolutions(resolutions, opt_smooth, opt_maxExtent, opt_showFullExtent) {
  return (
    /**
     * @param {number|undefined} resolution Resolution.
     * @param {number} direction Direction.
     * @param {import("./size.js").Size} size Viewport size.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Resolution.
     */
    function(resolution, direction, size, opt_isMoving) {
      if (resolution !== void 0) {
        var maxResolution = resolutions[0];
        var minResolution = resolutions[resolutions.length - 1];
        var cappedMaxRes = opt_maxExtent ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent) : maxResolution;
        if (opt_isMoving) {
          var smooth = opt_smooth !== void 0 ? opt_smooth : true;
          if (!smooth) {
            return clamp(resolution, minResolution, cappedMaxRes);
          }
          return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);
        }
        var capped = Math.min(cappedMaxRes, resolution);
        var z = Math.floor(linearFindNearest(resolutions, capped, direction));
        if (resolutions[z] > cappedMaxRes && z < resolutions.length - 1) {
          return resolutions[z + 1];
        }
        return resolutions[z];
      } else {
        return void 0;
      }
    }
  );
}
function createSnapToPower(power, maxResolution, opt_minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {
  return (
    /**
     * @param {number|undefined} resolution Resolution.
     * @param {number} direction Direction.
     * @param {import("./size.js").Size} size Viewport size.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Resolution.
     */
    function(resolution, direction, size, opt_isMoving) {
      if (resolution !== void 0) {
        var cappedMaxRes = opt_maxExtent ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent) : maxResolution;
        var minResolution = opt_minResolution !== void 0 ? opt_minResolution : 0;
        if (opt_isMoving) {
          var smooth = opt_smooth !== void 0 ? opt_smooth : true;
          if (!smooth) {
            return clamp(resolution, minResolution, cappedMaxRes);
          }
          return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);
        }
        var tolerance = 1e-9;
        var minZoomLevel = Math.ceil(Math.log(maxResolution / cappedMaxRes) / Math.log(power) - tolerance);
        var offset2 = -direction * (0.5 - tolerance) + 0.5;
        var capped = Math.min(cappedMaxRes, resolution);
        var cappedZoomLevel = Math.floor(Math.log(maxResolution / capped) / Math.log(power) + offset2);
        var zoomLevel = Math.max(minZoomLevel, cappedZoomLevel);
        var newResolution = maxResolution / Math.pow(power, zoomLevel);
        return clamp(newResolution, minResolution, cappedMaxRes);
      } else {
        return void 0;
      }
    }
  );
}
function createMinMaxResolution(maxResolution, minResolution, opt_smooth, opt_maxExtent, opt_showFullExtent) {
  return (
    /**
     * @param {number|undefined} resolution Resolution.
     * @param {number} direction Direction.
     * @param {import("./size.js").Size} size Viewport size.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Resolution.
     */
    function(resolution, direction, size, opt_isMoving) {
      if (resolution !== void 0) {
        var cappedMaxRes = opt_maxExtent ? getViewportClampedResolution(maxResolution, opt_maxExtent, size, opt_showFullExtent) : maxResolution;
        var smooth = opt_smooth !== void 0 ? opt_smooth : true;
        if (!smooth || !opt_isMoving) {
          return clamp(resolution, minResolution, cappedMaxRes);
        }
        return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);
      } else {
        return void 0;
      }
    }
  );
}

// node_modules/ol/rotationconstraint.js
function disable(rotation) {
  if (rotation !== void 0) {
    return 0;
  } else {
    return void 0;
  }
}
function none2(rotation) {
  if (rotation !== void 0) {
    return rotation;
  } else {
    return void 0;
  }
}
function createSnapToN(n) {
  var theta = 2 * Math.PI / n;
  return (
    /**
     * @param {number|undefined} rotation Rotation.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Rotation.
     */
    function(rotation, opt_isMoving) {
      if (opt_isMoving) {
        return rotation;
      }
      if (rotation !== void 0) {
        rotation = Math.floor(rotation / theta + 0.5) * theta;
        return rotation;
      } else {
        return void 0;
      }
    }
  );
}
function createSnapToZero(opt_tolerance) {
  var tolerance = opt_tolerance || toRadians(5);
  return (
    /**
     * @param {number|undefined} rotation Rotation.
     * @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
     * @return {number|undefined} Rotation.
     */
    function(rotation, opt_isMoving) {
      if (opt_isMoving) {
        return rotation;
      }
      if (rotation !== void 0) {
        if (Math.abs(rotation) <= tolerance) {
          return 0;
        } else {
          return rotation;
        }
      } else {
        return void 0;
      }
    }
  );
}

// node_modules/ol/View.js
var __extends61 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DEFAULT_MIN_ZOOM = 0;
var View = (
  /** @class */
  function(_super) {
    __extends61(View2, _super);
    function View2(opt_options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      var options = assign({}, opt_options);
      _this.hints_ = [0, 0];
      _this.animations_ = [];
      _this.updateAnimationKey_;
      _this.projection_ = createProjection(options.projection, "EPSG:3857");
      _this.viewportSize_ = [100, 100];
      _this.targetCenter_ = null;
      _this.targetResolution_;
      _this.targetRotation_;
      _this.nextCenter_ = null;
      _this.nextResolution_;
      _this.nextRotation_;
      _this.cancelAnchor_ = void 0;
      if (options.projection) {
        disableCoordinateWarning();
      }
      if (options.center) {
        options.center = fromUserCoordinate(options.center, _this.projection_);
      }
      if (options.extent) {
        options.extent = fromUserExtent(options.extent, _this.projection_);
      }
      _this.applyOptions_(options);
      return _this;
    }
    View2.prototype.applyOptions_ = function(options) {
      var properties2 = assign({}, options);
      for (var key in ViewProperty_default) {
        delete properties2[key];
      }
      this.setProperties(properties2, true);
      var resolutionConstraintInfo = createResolutionConstraint(options);
      this.maxResolution_ = resolutionConstraintInfo.maxResolution;
      this.minResolution_ = resolutionConstraintInfo.minResolution;
      this.zoomFactor_ = resolutionConstraintInfo.zoomFactor;
      this.resolutions_ = options.resolutions;
      this.padding_ = options.padding;
      this.minZoom_ = resolutionConstraintInfo.minZoom;
      var centerConstraint = createCenterConstraint(options);
      var resolutionConstraint = resolutionConstraintInfo.constraint;
      var rotationConstraint = createRotationConstraint(options);
      this.constraints_ = {
        center: centerConstraint,
        resolution: resolutionConstraint,
        rotation: rotationConstraint
      };
      this.setRotation(options.rotation !== void 0 ? options.rotation : 0);
      this.setCenterInternal(options.center !== void 0 ? options.center : null);
      if (options.resolution !== void 0) {
        this.setResolution(options.resolution);
      } else if (options.zoom !== void 0) {
        this.setZoom(options.zoom);
      }
    };
    Object.defineProperty(View2.prototype, "padding", {
      /**
       * Padding (in css pixels).
       * If the map viewport is partially covered with other content (overlays) along
       * its edges, this setting allows to shift the center of the viewport away from that
       * content. The order of the values in the array is top, right, bottom, left.
       * The default is no padding, which is equivalent to `[0, 0, 0, 0]`.
       * @type {Array<number>|undefined}
       * @api
       */
      get: function() {
        return this.padding_;
      },
      set: function(padding) {
        var oldPadding = this.padding_;
        this.padding_ = padding;
        var center = this.getCenter();
        if (center) {
          var newPadding = padding || [0, 0, 0, 0];
          oldPadding = oldPadding || [0, 0, 0, 0];
          var resolution = this.getResolution();
          var offsetX = resolution / 2 * (newPadding[3] - oldPadding[3] + oldPadding[1] - newPadding[1]);
          var offsetY = resolution / 2 * (newPadding[0] - oldPadding[0] + oldPadding[2] - newPadding[2]);
          this.setCenterInternal([center[0] + offsetX, center[1] - offsetY]);
        }
      },
      enumerable: false,
      configurable: true
    });
    View2.prototype.getUpdatedOptions_ = function(newOptions) {
      var options = this.getProperties();
      if (options.resolution !== void 0) {
        options.resolution = this.getResolution();
      } else {
        options.zoom = this.getZoom();
      }
      options.center = this.getCenterInternal();
      options.rotation = this.getRotation();
      return assign({}, options, newOptions);
    };
    View2.prototype.animate = function(var_args) {
      if (this.isDef() && !this.getAnimating()) {
        this.resolveConstraints(0);
      }
      var args = new Array(arguments.length);
      for (var i2 = 0; i2 < args.length; ++i2) {
        var options = arguments[i2];
        if (options.center) {
          options = assign({}, options);
          options.center = fromUserCoordinate(options.center, this.getProjection());
        }
        if (options.anchor) {
          options = assign({}, options);
          options.anchor = fromUserCoordinate(options.anchor, this.getProjection());
        }
        args[i2] = options;
      }
      this.animateInternal.apply(this, args);
    };
    View2.prototype.animateInternal = function(var_args) {
      var animationCount = arguments.length;
      var callback;
      if (animationCount > 1 && typeof arguments[animationCount - 1] === "function") {
        callback = arguments[animationCount - 1];
        --animationCount;
      }
      var i2 = 0;
      for (; i2 < animationCount && !this.isDef(); ++i2) {
        var state2 = arguments[i2];
        if (state2.center) {
          this.setCenterInternal(state2.center);
        }
        if (state2.zoom !== void 0) {
          this.setZoom(state2.zoom);
        } else if (state2.resolution) {
          this.setResolution(state2.resolution);
        }
        if (state2.rotation !== void 0) {
          this.setRotation(state2.rotation);
        }
      }
      if (i2 === animationCount) {
        if (callback) {
          animationCallback(callback, true);
        }
        return;
      }
      var start2 = Date.now();
      var center = this.targetCenter_.slice();
      var resolution = this.targetResolution_;
      var rotation = this.targetRotation_;
      var series = [];
      for (; i2 < animationCount; ++i2) {
        var options = (
          /** @type {AnimationOptions} */
          arguments[i2]
        );
        var animation = {
          start: start2,
          complete: false,
          anchor: options.anchor,
          duration: options.duration !== void 0 ? options.duration : 1e3,
          easing: options.easing || inAndOut,
          callback
        };
        if (options.center) {
          animation.sourceCenter = center;
          animation.targetCenter = options.center.slice();
          center = animation.targetCenter;
        }
        if (options.zoom !== void 0) {
          animation.sourceResolution = resolution;
          animation.targetResolution = this.getResolutionForZoom(options.zoom);
          resolution = animation.targetResolution;
        } else if (options.resolution) {
          animation.sourceResolution = resolution;
          animation.targetResolution = options.resolution;
          resolution = animation.targetResolution;
        }
        if (options.rotation !== void 0) {
          animation.sourceRotation = rotation;
          var delta = modulo(options.rotation - rotation + Math.PI, 2 * Math.PI) - Math.PI;
          animation.targetRotation = rotation + delta;
          rotation = animation.targetRotation;
        }
        if (isNoopAnimation(animation)) {
          animation.complete = true;
        } else {
          start2 += animation.duration;
        }
        series.push(animation);
      }
      this.animations_.push(series);
      this.setHint(ViewHint_default.ANIMATING, 1);
      this.updateAnimations_();
    };
    View2.prototype.getAnimating = function() {
      return this.hints_[ViewHint_default.ANIMATING] > 0;
    };
    View2.prototype.getInteracting = function() {
      return this.hints_[ViewHint_default.INTERACTING] > 0;
    };
    View2.prototype.cancelAnimations = function() {
      this.setHint(ViewHint_default.ANIMATING, -this.hints_[ViewHint_default.ANIMATING]);
      var anchor2;
      for (var i2 = 0, ii = this.animations_.length; i2 < ii; ++i2) {
        var series = this.animations_[i2];
        if (series[0].callback) {
          animationCallback(series[0].callback, false);
        }
        if (!anchor2) {
          for (var j = 0, jj = series.length; j < jj; ++j) {
            var animation = series[j];
            if (!animation.complete) {
              anchor2 = animation.anchor;
              break;
            }
          }
        }
      }
      this.animations_.length = 0;
      this.cancelAnchor_ = anchor2;
      this.nextCenter_ = null;
      this.nextResolution_ = NaN;
      this.nextRotation_ = NaN;
    };
    View2.prototype.updateAnimations_ = function() {
      if (this.updateAnimationKey_ !== void 0) {
        cancelAnimationFrame(this.updateAnimationKey_);
        this.updateAnimationKey_ = void 0;
      }
      if (!this.getAnimating()) {
        return;
      }
      var now = Date.now();
      var more = false;
      for (var i2 = this.animations_.length - 1; i2 >= 0; --i2) {
        var series = this.animations_[i2];
        var seriesComplete = true;
        for (var j = 0, jj = series.length; j < jj; ++j) {
          var animation = series[j];
          if (animation.complete) {
            continue;
          }
          var elapsed = now - animation.start;
          var fraction = animation.duration > 0 ? elapsed / animation.duration : 1;
          if (fraction >= 1) {
            animation.complete = true;
            fraction = 1;
          } else {
            seriesComplete = false;
          }
          var progress = animation.easing(fraction);
          if (animation.sourceCenter) {
            var x0 = animation.sourceCenter[0];
            var y0 = animation.sourceCenter[1];
            var x1 = animation.targetCenter[0];
            var y1 = animation.targetCenter[1];
            this.nextCenter_ = animation.targetCenter;
            var x = x0 + progress * (x1 - x0);
            var y = y0 + progress * (y1 - y0);
            this.targetCenter_ = [x, y];
          }
          if (animation.sourceResolution && animation.targetResolution) {
            var resolution = progress === 1 ? animation.targetResolution : animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution);
            if (animation.anchor) {
              var size = this.getViewportSize_(this.getRotation());
              var constrainedResolution = this.constraints_.resolution(resolution, 0, size, true);
              this.targetCenter_ = this.calculateCenterZoom(constrainedResolution, animation.anchor);
            }
            this.nextResolution_ = animation.targetResolution;
            this.targetResolution_ = resolution;
            this.applyTargetState_(true);
          }
          if (animation.sourceRotation !== void 0 && animation.targetRotation !== void 0) {
            var rotation = progress === 1 ? modulo(animation.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation);
            if (animation.anchor) {
              var constrainedRotation = this.constraints_.rotation(rotation, true);
              this.targetCenter_ = this.calculateCenterRotate(constrainedRotation, animation.anchor);
            }
            this.nextRotation_ = animation.targetRotation;
            this.targetRotation_ = rotation;
          }
          this.applyTargetState_(true);
          more = true;
          if (!animation.complete) {
            break;
          }
        }
        if (seriesComplete) {
          this.animations_[i2] = null;
          this.setHint(ViewHint_default.ANIMATING, -1);
          this.nextCenter_ = null;
          this.nextResolution_ = NaN;
          this.nextRotation_ = NaN;
          var callback = series[0].callback;
          if (callback) {
            animationCallback(callback, true);
          }
        }
      }
      this.animations_ = this.animations_.filter(Boolean);
      if (more && this.updateAnimationKey_ === void 0) {
        this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_.bind(this));
      }
    };
    View2.prototype.calculateCenterRotate = function(rotation, anchor2) {
      var center;
      var currentCenter = this.getCenterInternal();
      if (currentCenter !== void 0) {
        center = [currentCenter[0] - anchor2[0], currentCenter[1] - anchor2[1]];
        rotate3(center, rotation - this.getRotation());
        add3(center, anchor2);
      }
      return center;
    };
    View2.prototype.calculateCenterZoom = function(resolution, anchor2) {
      var center;
      var currentCenter = this.getCenterInternal();
      var currentResolution = this.getResolution();
      if (currentCenter !== void 0 && currentResolution !== void 0) {
        var x = anchor2[0] - resolution * (anchor2[0] - currentCenter[0]) / currentResolution;
        var y = anchor2[1] - resolution * (anchor2[1] - currentCenter[1]) / currentResolution;
        center = [x, y];
      }
      return center;
    };
    View2.prototype.getViewportSize_ = function(opt_rotation) {
      var size = this.viewportSize_;
      if (opt_rotation) {
        var w = size[0];
        var h = size[1];
        return [
          Math.abs(w * Math.cos(opt_rotation)) + Math.abs(h * Math.sin(opt_rotation)),
          Math.abs(w * Math.sin(opt_rotation)) + Math.abs(h * Math.cos(opt_rotation))
        ];
      } else {
        return size;
      }
    };
    View2.prototype.setViewportSize = function(opt_size) {
      this.viewportSize_ = Array.isArray(opt_size) ? opt_size.slice() : [100, 100];
      if (!this.getAnimating()) {
        this.resolveConstraints(0);
      }
    };
    View2.prototype.getCenter = function() {
      var center = this.getCenterInternal();
      if (!center) {
        return center;
      }
      return toUserCoordinate(center, this.getProjection());
    };
    View2.prototype.getCenterInternal = function() {
      return (
        /** @type {import("./coordinate.js").Coordinate|undefined} */
        this.get(ViewProperty_default.CENTER)
      );
    };
    View2.prototype.getConstraints = function() {
      return this.constraints_;
    };
    View2.prototype.getConstrainResolution = function() {
      return this.get("constrainResolution");
    };
    View2.prototype.getHints = function(opt_hints) {
      if (opt_hints !== void 0) {
        opt_hints[0] = this.hints_[0];
        opt_hints[1] = this.hints_[1];
        return opt_hints;
      } else {
        return this.hints_.slice();
      }
    };
    View2.prototype.calculateExtent = function(opt_size) {
      var extent = this.calculateExtentInternal(opt_size);
      return toUserExtent(extent, this.getProjection());
    };
    View2.prototype.calculateExtentInternal = function(opt_size) {
      var size = opt_size || this.getViewportSizeMinusPadding_();
      var center = (
        /** @type {!import("./coordinate.js").Coordinate} */
        this.getCenterInternal()
      );
      assert(center, 1);
      var resolution = (
        /** @type {!number} */
        this.getResolution()
      );
      assert(resolution !== void 0, 2);
      var rotation = (
        /** @type {!number} */
        this.getRotation()
      );
      assert(rotation !== void 0, 3);
      return getForViewAndSize(center, resolution, rotation, size);
    };
    View2.prototype.getMaxResolution = function() {
      return this.maxResolution_;
    };
    View2.prototype.getMinResolution = function() {
      return this.minResolution_;
    };
    View2.prototype.getMaxZoom = function() {
      return (
        /** @type {number} */
        this.getZoomForResolution(this.minResolution_)
      );
    };
    View2.prototype.setMaxZoom = function(zoom) {
      this.applyOptions_(this.getUpdatedOptions_({ maxZoom: zoom }));
    };
    View2.prototype.getMinZoom = function() {
      return (
        /** @type {number} */
        this.getZoomForResolution(this.maxResolution_)
      );
    };
    View2.prototype.setMinZoom = function(zoom) {
      this.applyOptions_(this.getUpdatedOptions_({ minZoom: zoom }));
    };
    View2.prototype.setConstrainResolution = function(enabled) {
      this.applyOptions_(this.getUpdatedOptions_({ constrainResolution: enabled }));
    };
    View2.prototype.getProjection = function() {
      return this.projection_;
    };
    View2.prototype.getResolution = function() {
      return (
        /** @type {number|undefined} */
        this.get(ViewProperty_default.RESOLUTION)
      );
    };
    View2.prototype.getResolutions = function() {
      return this.resolutions_;
    };
    View2.prototype.getResolutionForExtent = function(extent, opt_size) {
      return this.getResolutionForExtentInternal(fromUserExtent(extent, this.getProjection()), opt_size);
    };
    View2.prototype.getResolutionForExtentInternal = function(extent, opt_size) {
      var size = opt_size || this.getViewportSizeMinusPadding_();
      var xResolution = getWidth(extent) / size[0];
      var yResolution = getHeight(extent) / size[1];
      return Math.max(xResolution, yResolution);
    };
    View2.prototype.getResolutionForValueFunction = function(opt_power) {
      var power = opt_power || 2;
      var maxResolution = this.getConstrainedResolution(this.maxResolution_);
      var minResolution = this.minResolution_;
      var max = Math.log(maxResolution / minResolution) / Math.log(power);
      return (
        /**
         * @param {number} value Value.
         * @return {number} Resolution.
         */
        function(value) {
          var resolution = maxResolution / Math.pow(power, value * max);
          return resolution;
        }
      );
    };
    View2.prototype.getRotation = function() {
      return (
        /** @type {number} */
        this.get(ViewProperty_default.ROTATION)
      );
    };
    View2.prototype.getValueForResolutionFunction = function(opt_power) {
      var logPower = Math.log(opt_power || 2);
      var maxResolution = this.getConstrainedResolution(this.maxResolution_);
      var minResolution = this.minResolution_;
      var max = Math.log(maxResolution / minResolution) / logPower;
      return (
        /**
         * @param {number} resolution Resolution.
         * @return {number} Value.
         */
        function(resolution) {
          var value = Math.log(maxResolution / resolution) / logPower / max;
          return value;
        }
      );
    };
    View2.prototype.getViewportSizeMinusPadding_ = function(opt_rotation) {
      var size = this.getViewportSize_(opt_rotation);
      var padding = this.padding_;
      if (padding) {
        size = [
          size[0] - padding[1] - padding[3],
          size[1] - padding[0] - padding[2]
        ];
      }
      return size;
    };
    View2.prototype.getState = function() {
      var projection = this.getProjection();
      var resolution = this.getResolution();
      var rotation = this.getRotation();
      var center = (
        /** @type {import("./coordinate.js").Coordinate} */
        this.getCenterInternal()
      );
      var padding = this.padding_;
      if (padding) {
        var reducedSize = this.getViewportSizeMinusPadding_();
        center = calculateCenterOn(center, this.getViewportSize_(), [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);
      }
      return {
        center: center.slice(0),
        projection: projection !== void 0 ? projection : null,
        resolution,
        nextCenter: this.nextCenter_,
        nextResolution: this.nextResolution_,
        nextRotation: this.nextRotation_,
        rotation,
        zoom: this.getZoom()
      };
    };
    View2.prototype.getZoom = function() {
      var zoom;
      var resolution = this.getResolution();
      if (resolution !== void 0) {
        zoom = this.getZoomForResolution(resolution);
      }
      return zoom;
    };
    View2.prototype.getZoomForResolution = function(resolution) {
      var offset2 = this.minZoom_ || 0;
      var max, zoomFactor;
      if (this.resolutions_) {
        var nearest = linearFindNearest(this.resolutions_, resolution, 1);
        offset2 = nearest;
        max = this.resolutions_[nearest];
        if (nearest == this.resolutions_.length - 1) {
          zoomFactor = 2;
        } else {
          zoomFactor = max / this.resolutions_[nearest + 1];
        }
      } else {
        max = this.maxResolution_;
        zoomFactor = this.zoomFactor_;
      }
      return offset2 + Math.log(max / resolution) / Math.log(zoomFactor);
    };
    View2.prototype.getResolutionForZoom = function(zoom) {
      if (this.resolutions_) {
        if (this.resolutions_.length <= 1) {
          return 0;
        }
        var baseLevel = clamp(Math.floor(zoom), 0, this.resolutions_.length - 2);
        var zoomFactor = this.resolutions_[baseLevel] / this.resolutions_[baseLevel + 1];
        return this.resolutions_[baseLevel] / Math.pow(zoomFactor, clamp(zoom - baseLevel, 0, 1));
      } else {
        return this.maxResolution_ / Math.pow(this.zoomFactor_, zoom - this.minZoom_);
      }
    };
    View2.prototype.fit = function(geometryOrExtent, opt_options) {
      var geometry2;
      assert(Array.isArray(geometryOrExtent) || typeof /** @type {?} */
      geometryOrExtent.getSimplifiedGeometry === "function", 24);
      if (Array.isArray(geometryOrExtent)) {
        assert(!isEmpty2(geometryOrExtent), 25);
        var extent = fromUserExtent(geometryOrExtent, this.getProjection());
        geometry2 = fromExtent(extent);
      } else if (geometryOrExtent.getType() === "Circle") {
        var extent = fromUserExtent(geometryOrExtent.getExtent(), this.getProjection());
        geometry2 = fromExtent(extent);
        geometry2.rotate(this.getRotation(), getCenter(extent));
      } else {
        var userProjection2 = getUserProjection();
        if (userProjection2) {
          geometry2 = /** @type {import("./geom/SimpleGeometry.js").default} */
          geometryOrExtent.clone().transform(userProjection2, this.getProjection());
        } else {
          geometry2 = geometryOrExtent;
        }
      }
      this.fitInternal(geometry2, opt_options);
    };
    View2.prototype.rotatedExtentForGeometry = function(geometry2) {
      var rotation = this.getRotation();
      var cosAngle = Math.cos(rotation);
      var sinAngle = Math.sin(-rotation);
      var coords = geometry2.getFlatCoordinates();
      var stride = geometry2.getStride();
      var minRotX = Infinity;
      var minRotY = Infinity;
      var maxRotX = -Infinity;
      var maxRotY = -Infinity;
      for (var i2 = 0, ii = coords.length; i2 < ii; i2 += stride) {
        var rotX = coords[i2] * cosAngle - coords[i2 + 1] * sinAngle;
        var rotY = coords[i2] * sinAngle + coords[i2 + 1] * cosAngle;
        minRotX = Math.min(minRotX, rotX);
        minRotY = Math.min(minRotY, rotY);
        maxRotX = Math.max(maxRotX, rotX);
        maxRotY = Math.max(maxRotY, rotY);
      }
      return [minRotX, minRotY, maxRotX, maxRotY];
    };
    View2.prototype.fitInternal = function(geometry2, opt_options) {
      var options = opt_options || {};
      var size = options.size;
      if (!size) {
        size = this.getViewportSizeMinusPadding_();
      }
      var padding = options.padding !== void 0 ? options.padding : [0, 0, 0, 0];
      var nearest = options.nearest !== void 0 ? options.nearest : false;
      var minResolution;
      if (options.minResolution !== void 0) {
        minResolution = options.minResolution;
      } else if (options.maxZoom !== void 0) {
        minResolution = this.getResolutionForZoom(options.maxZoom);
      } else {
        minResolution = 0;
      }
      var rotatedExtent = this.rotatedExtentForGeometry(geometry2);
      var resolution = this.getResolutionForExtentInternal(rotatedExtent, [
        size[0] - padding[1] - padding[3],
        size[1] - padding[0] - padding[2]
      ]);
      resolution = isNaN(resolution) ? minResolution : Math.max(resolution, minResolution);
      resolution = this.getConstrainedResolution(resolution, nearest ? 0 : 1);
      var rotation = this.getRotation();
      var sinAngle = Math.sin(rotation);
      var cosAngle = Math.cos(rotation);
      var centerRot = getCenter(rotatedExtent);
      centerRot[0] += (padding[1] - padding[3]) / 2 * resolution;
      centerRot[1] += (padding[0] - padding[2]) / 2 * resolution;
      var centerX = centerRot[0] * cosAngle - centerRot[1] * sinAngle;
      var centerY = centerRot[1] * cosAngle + centerRot[0] * sinAngle;
      var center = this.getConstrainedCenter([centerX, centerY], resolution);
      var callback = options.callback ? options.callback : VOID;
      if (options.duration !== void 0) {
        this.animateInternal({
          resolution,
          center,
          duration: options.duration,
          easing: options.easing
        }, callback);
      } else {
        this.targetResolution_ = resolution;
        this.targetCenter_ = center;
        this.applyTargetState_(false, true);
        animationCallback(callback, true);
      }
    };
    View2.prototype.centerOn = function(coordinate, size, position) {
      this.centerOnInternal(fromUserCoordinate(coordinate, this.getProjection()), size, position);
    };
    View2.prototype.centerOnInternal = function(coordinate, size, position) {
      this.setCenterInternal(calculateCenterOn(coordinate, size, position, this.getResolution(), this.getRotation()));
    };
    View2.prototype.calculateCenterShift = function(center, resolution, rotation, size) {
      var centerShift;
      var padding = this.padding_;
      if (padding && center) {
        var reducedSize = this.getViewportSizeMinusPadding_(-rotation);
        var shiftedCenter = calculateCenterOn(center, size, [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);
        centerShift = [
          center[0] - shiftedCenter[0],
          center[1] - shiftedCenter[1]
        ];
      }
      return centerShift;
    };
    View2.prototype.isDef = function() {
      return !!this.getCenterInternal() && this.getResolution() !== void 0;
    };
    View2.prototype.adjustCenter = function(deltaCoordinates) {
      var center = toUserCoordinate(this.targetCenter_, this.getProjection());
      this.setCenter([
        center[0] + deltaCoordinates[0],
        center[1] + deltaCoordinates[1]
      ]);
    };
    View2.prototype.adjustCenterInternal = function(deltaCoordinates) {
      var center = this.targetCenter_;
      this.setCenterInternal([
        center[0] + deltaCoordinates[0],
        center[1] + deltaCoordinates[1]
      ]);
    };
    View2.prototype.adjustResolution = function(ratio, opt_anchor) {
      var anchor2 = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());
      this.adjustResolutionInternal(ratio, anchor2);
    };
    View2.prototype.adjustResolutionInternal = function(ratio, opt_anchor) {
      var isMoving = this.getAnimating() || this.getInteracting();
      var size = this.getViewportSize_(this.getRotation());
      var newResolution = this.constraints_.resolution(this.targetResolution_ * ratio, 0, size, isMoving);
      if (opt_anchor) {
        this.targetCenter_ = this.calculateCenterZoom(newResolution, opt_anchor);
      }
      this.targetResolution_ *= ratio;
      this.applyTargetState_();
    };
    View2.prototype.adjustZoom = function(delta, opt_anchor) {
      this.adjustResolution(Math.pow(this.zoomFactor_, -delta), opt_anchor);
    };
    View2.prototype.adjustRotation = function(delta, opt_anchor) {
      if (opt_anchor) {
        opt_anchor = fromUserCoordinate(opt_anchor, this.getProjection());
      }
      this.adjustRotationInternal(delta, opt_anchor);
    };
    View2.prototype.adjustRotationInternal = function(delta, opt_anchor) {
      var isMoving = this.getAnimating() || this.getInteracting();
      var newRotation = this.constraints_.rotation(this.targetRotation_ + delta, isMoving);
      if (opt_anchor) {
        this.targetCenter_ = this.calculateCenterRotate(newRotation, opt_anchor);
      }
      this.targetRotation_ += delta;
      this.applyTargetState_();
    };
    View2.prototype.setCenter = function(center) {
      this.setCenterInternal(center ? fromUserCoordinate(center, this.getProjection()) : center);
    };
    View2.prototype.setCenterInternal = function(center) {
      this.targetCenter_ = center;
      this.applyTargetState_();
    };
    View2.prototype.setHint = function(hint, delta) {
      this.hints_[hint] += delta;
      this.changed();
      return this.hints_[hint];
    };
    View2.prototype.setResolution = function(resolution) {
      this.targetResolution_ = resolution;
      this.applyTargetState_();
    };
    View2.prototype.setRotation = function(rotation) {
      this.targetRotation_ = rotation;
      this.applyTargetState_();
    };
    View2.prototype.setZoom = function(zoom) {
      this.setResolution(this.getResolutionForZoom(zoom));
    };
    View2.prototype.applyTargetState_ = function(opt_doNotCancelAnims, opt_forceMoving) {
      var isMoving = this.getAnimating() || this.getInteracting() || opt_forceMoving;
      var newRotation = this.constraints_.rotation(this.targetRotation_, isMoving);
      var size = this.getViewportSize_(newRotation);
      var newResolution = this.constraints_.resolution(this.targetResolution_, 0, size, isMoving);
      var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, isMoving, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));
      if (this.get(ViewProperty_default.ROTATION) !== newRotation) {
        this.set(ViewProperty_default.ROTATION, newRotation);
      }
      if (this.get(ViewProperty_default.RESOLUTION) !== newResolution) {
        this.set(ViewProperty_default.RESOLUTION, newResolution);
        this.set("zoom", this.getZoom(), true);
      }
      if (!newCenter || !this.get(ViewProperty_default.CENTER) || !equals3(this.get(ViewProperty_default.CENTER), newCenter)) {
        this.set(ViewProperty_default.CENTER, newCenter);
      }
      if (this.getAnimating() && !opt_doNotCancelAnims) {
        this.cancelAnimations();
      }
      this.cancelAnchor_ = void 0;
    };
    View2.prototype.resolveConstraints = function(opt_duration, opt_resolutionDirection, opt_anchor) {
      var duration = opt_duration !== void 0 ? opt_duration : 200;
      var direction = opt_resolutionDirection || 0;
      var newRotation = this.constraints_.rotation(this.targetRotation_);
      var size = this.getViewportSize_(newRotation);
      var newResolution = this.constraints_.resolution(this.targetResolution_, direction, size);
      var newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, false, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));
      if (duration === 0 && !this.cancelAnchor_) {
        this.targetResolution_ = newResolution;
        this.targetRotation_ = newRotation;
        this.targetCenter_ = newCenter;
        this.applyTargetState_();
        return;
      }
      var anchor2 = opt_anchor || (duration === 0 ? this.cancelAnchor_ : void 0);
      this.cancelAnchor_ = void 0;
      if (this.getResolution() !== newResolution || this.getRotation() !== newRotation || !this.getCenterInternal() || !equals3(this.getCenterInternal(), newCenter)) {
        if (this.getAnimating()) {
          this.cancelAnimations();
        }
        this.animateInternal({
          rotation: newRotation,
          center: newCenter,
          resolution: newResolution,
          duration,
          easing: easeOut,
          anchor: anchor2
        });
      }
    };
    View2.prototype.beginInteraction = function() {
      this.resolveConstraints(0);
      this.setHint(ViewHint_default.INTERACTING, 1);
    };
    View2.prototype.endInteraction = function(opt_duration, opt_resolutionDirection, opt_anchor) {
      var anchor2 = opt_anchor && fromUserCoordinate(opt_anchor, this.getProjection());
      this.endInteractionInternal(opt_duration, opt_resolutionDirection, anchor2);
    };
    View2.prototype.endInteractionInternal = function(opt_duration, opt_resolutionDirection, opt_anchor) {
      this.setHint(ViewHint_default.INTERACTING, -1);
      this.resolveConstraints(opt_duration, opt_resolutionDirection, opt_anchor);
    };
    View2.prototype.getConstrainedCenter = function(targetCenter, opt_targetResolution) {
      var size = this.getViewportSize_(this.getRotation());
      return this.constraints_.center(targetCenter, opt_targetResolution || this.getResolution(), size);
    };
    View2.prototype.getConstrainedZoom = function(targetZoom, opt_direction) {
      var targetRes = this.getResolutionForZoom(targetZoom);
      return this.getZoomForResolution(this.getConstrainedResolution(targetRes, opt_direction));
    };
    View2.prototype.getConstrainedResolution = function(targetResolution, opt_direction) {
      var direction = opt_direction || 0;
      var size = this.getViewportSize_(this.getRotation());
      return this.constraints_.resolution(targetResolution, direction, size);
    };
    return View2;
  }(Object_default)
);
function animationCallback(callback, returnValue) {
  setTimeout(function() {
    callback(returnValue);
  }, 0);
}
function createCenterConstraint(options) {
  if (options.extent !== void 0) {
    var smooth = options.smoothExtentConstraint !== void 0 ? options.smoothExtentConstraint : true;
    return createExtent(options.extent, options.constrainOnlyCenter, smooth);
  }
  var projection = createProjection(options.projection, "EPSG:3857");
  if (options.multiWorld !== true && projection.isGlobal()) {
    var extent = projection.getExtent().slice();
    extent[0] = -Infinity;
    extent[2] = Infinity;
    return createExtent(extent, false, false);
  }
  return none;
}
function createResolutionConstraint(options) {
  var resolutionConstraint;
  var maxResolution;
  var minResolution;
  var defaultMaxZoom = 28;
  var defaultZoomFactor = 2;
  var minZoom = options.minZoom !== void 0 ? options.minZoom : DEFAULT_MIN_ZOOM;
  var maxZoom = options.maxZoom !== void 0 ? options.maxZoom : defaultMaxZoom;
  var zoomFactor = options.zoomFactor !== void 0 ? options.zoomFactor : defaultZoomFactor;
  var multiWorld = options.multiWorld !== void 0 ? options.multiWorld : false;
  var smooth = options.smoothResolutionConstraint !== void 0 ? options.smoothResolutionConstraint : true;
  var showFullExtent = options.showFullExtent !== void 0 ? options.showFullExtent : false;
  var projection = createProjection(options.projection, "EPSG:3857");
  var projExtent = projection.getExtent();
  var constrainOnlyCenter = options.constrainOnlyCenter;
  var extent = options.extent;
  if (!multiWorld && !extent && projection.isGlobal()) {
    constrainOnlyCenter = false;
    extent = projExtent;
  }
  if (options.resolutions !== void 0) {
    var resolutions = options.resolutions;
    maxResolution = resolutions[minZoom];
    minResolution = resolutions[maxZoom] !== void 0 ? resolutions[maxZoom] : resolutions[resolutions.length - 1];
    if (options.constrainResolution) {
      resolutionConstraint = createSnapToResolutions(resolutions, smooth, !constrainOnlyCenter && extent, showFullExtent);
    } else {
      resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);
    }
  } else {
    var size = !projExtent ? (
      // use an extent that can fit the whole world if need be
      360 * METERS_PER_UNIT[Units_default.DEGREES] / projection.getMetersPerUnit()
    ) : Math.max(getWidth(projExtent), getHeight(projExtent));
    var defaultMaxResolution = size / DEFAULT_TILE_SIZE / Math.pow(defaultZoomFactor, DEFAULT_MIN_ZOOM);
    var defaultMinResolution = defaultMaxResolution / Math.pow(defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM);
    maxResolution = options.maxResolution;
    if (maxResolution !== void 0) {
      minZoom = 0;
    } else {
      maxResolution = defaultMaxResolution / Math.pow(zoomFactor, minZoom);
    }
    minResolution = options.minResolution;
    if (minResolution === void 0) {
      if (options.maxZoom !== void 0) {
        if (options.maxResolution !== void 0) {
          minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);
        } else {
          minResolution = defaultMaxResolution / Math.pow(zoomFactor, maxZoom);
        }
      } else {
        minResolution = defaultMinResolution;
      }
    }
    maxZoom = minZoom + Math.floor(Math.log(maxResolution / minResolution) / Math.log(zoomFactor));
    minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom);
    if (options.constrainResolution) {
      resolutionConstraint = createSnapToPower(zoomFactor, maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);
    } else {
      resolutionConstraint = createMinMaxResolution(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);
    }
  }
  return {
    constraint: resolutionConstraint,
    maxResolution,
    minResolution,
    minZoom,
    zoomFactor
  };
}
function createRotationConstraint(options) {
  var enableRotation = options.enableRotation !== void 0 ? options.enableRotation : true;
  if (enableRotation) {
    var constrainRotation = options.constrainRotation;
    if (constrainRotation === void 0 || constrainRotation === true) {
      return createSnapToZero();
    } else if (constrainRotation === false) {
      return none2;
    } else if (typeof constrainRotation === "number") {
      return createSnapToN(constrainRotation);
    } else {
      return none2;
    }
  } else {
    return disable;
  }
}
function isNoopAnimation(animation) {
  if (animation.sourceCenter && animation.targetCenter) {
    if (!equals3(animation.sourceCenter, animation.targetCenter)) {
      return false;
    }
  }
  if (animation.sourceResolution !== animation.targetResolution) {
    return false;
  }
  if (animation.sourceRotation !== animation.targetRotation) {
    return false;
  }
  return true;
}
function calculateCenterOn(coordinate, size, position, resolution, rotation) {
  var cosAngle = Math.cos(-rotation);
  var sinAngle = Math.sin(-rotation);
  var rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle;
  var rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle;
  rotX += (size[0] / 2 - position[0]) * resolution;
  rotY += (position[1] - size[1] / 2) * resolution;
  sinAngle = -sinAngle;
  var centerX = rotX * cosAngle - rotY * sinAngle;
  var centerY = rotY * cosAngle + rotX * sinAngle;
  return [centerX, centerY];
}
var View_default = View;

// node_modules/ol/PluggableMap.js
var __extends62 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
function removeLayerMapProperty(layer) {
  if (layer instanceof Layer_default) {
    layer.setMapInternal(null);
    return;
  }
  if (layer instanceof Group_default) {
    layer.getLayers().forEach(removeLayerMapProperty);
  }
}
function setLayerMapProperty(layer, map2) {
  if (layer instanceof Layer_default) {
    layer.setMapInternal(map2);
    return;
  }
  if (layer instanceof Group_default) {
    var layers = layer.getLayers().getArray();
    for (var i2 = 0, ii = layers.length; i2 < ii; ++i2) {
      setLayerMapProperty(layers[i2], map2);
    }
  }
}
var PluggableMap = (
  /** @class */
  function(_super) {
    __extends62(PluggableMap2, _super);
    function PluggableMap2(options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      var optionsInternal = createOptionsInternal(options);
      _this.renderComplete_;
      _this.loaded_ = true;
      _this.boundHandleBrowserEvent_ = _this.handleBrowserEvent.bind(_this);
      _this.maxTilesLoading_ = options.maxTilesLoading !== void 0 ? options.maxTilesLoading : 16;
      _this.pixelRatio_ = options.pixelRatio !== void 0 ? options.pixelRatio : DEVICE_PIXEL_RATIO;
      _this.postRenderTimeoutHandle_;
      _this.animationDelayKey_;
      _this.animationDelay_ = /** @this {PluggableMap} */
      (function() {
        this.animationDelayKey_ = void 0;
        this.renderFrame_(Date.now());
      }).bind(_this);
      _this.coordinateToPixelTransform_ = create();
      _this.pixelToCoordinateTransform_ = create();
      _this.frameIndex_ = 0;
      _this.frameState_ = null;
      _this.previousExtent_ = null;
      _this.viewPropertyListenerKey_ = null;
      _this.viewChangeListenerKey_ = null;
      _this.layerGroupPropertyListenerKeys_ = null;
      _this.viewport_ = document.createElement("div");
      _this.viewport_.className = "ol-viewport" + ("ontouchstart" in window ? " ol-touch" : "");
      _this.viewport_.style.position = "relative";
      _this.viewport_.style.overflow = "hidden";
      _this.viewport_.style.width = "100%";
      _this.viewport_.style.height = "100%";
      _this.overlayContainer_ = document.createElement("div");
      _this.overlayContainer_.style.position = "absolute";
      _this.overlayContainer_.style.zIndex = "0";
      _this.overlayContainer_.style.width = "100%";
      _this.overlayContainer_.style.height = "100%";
      _this.overlayContainer_.style.pointerEvents = "none";
      _this.overlayContainer_.className = "ol-overlaycontainer";
      _this.viewport_.appendChild(_this.overlayContainer_);
      _this.overlayContainerStopEvent_ = document.createElement("div");
      _this.overlayContainerStopEvent_.style.position = "absolute";
      _this.overlayContainerStopEvent_.style.zIndex = "0";
      _this.overlayContainerStopEvent_.style.width = "100%";
      _this.overlayContainerStopEvent_.style.height = "100%";
      _this.overlayContainerStopEvent_.style.pointerEvents = "none";
      _this.overlayContainerStopEvent_.className = "ol-overlaycontainer-stopevent";
      _this.viewport_.appendChild(_this.overlayContainerStopEvent_);
      _this.mapBrowserEventHandler_ = null;
      _this.moveTolerance_ = options.moveTolerance;
      _this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;
      _this.targetChangeHandlerKeys_ = null;
      _this.controls = optionsInternal.controls || new Collection_default();
      _this.interactions = optionsInternal.interactions || new Collection_default();
      _this.overlays_ = optionsInternal.overlays;
      _this.overlayIdIndex_ = {};
      _this.renderer_ = null;
      _this.postRenderFunctions_ = [];
      _this.tileQueue_ = new TileQueue_default(_this.getTilePriority.bind(_this), _this.handleTileChange_.bind(_this));
      _this.addChangeListener(MapProperty_default.LAYERGROUP, _this.handleLayerGroupChanged_);
      _this.addChangeListener(MapProperty_default.VIEW, _this.handleViewChanged_);
      _this.addChangeListener(MapProperty_default.SIZE, _this.handleSizeChanged_);
      _this.addChangeListener(MapProperty_default.TARGET, _this.handleTargetChanged_);
      _this.setProperties(optionsInternal.values);
      var map2 = _this;
      if (options.view && !(options.view instanceof View_default)) {
        options.view.then(function(viewOptions) {
          map2.setView(new View_default(viewOptions));
        });
      }
      _this.controls.addEventListener(
        CollectionEventType_default.ADD,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          event.element.setMap(this);
        }).bind(_this)
      );
      _this.controls.addEventListener(
        CollectionEventType_default.REMOVE,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          event.element.setMap(null);
        }).bind(_this)
      );
      _this.interactions.addEventListener(
        CollectionEventType_default.ADD,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          event.element.setMap(this);
        }).bind(_this)
      );
      _this.interactions.addEventListener(
        CollectionEventType_default.REMOVE,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          event.element.setMap(null);
        }).bind(_this)
      );
      _this.overlays_.addEventListener(
        CollectionEventType_default.ADD,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          this.addOverlayInternal_(
            /** @type {import("./Overlay.js").default} */
            event.element
          );
        }).bind(_this)
      );
      _this.overlays_.addEventListener(
        CollectionEventType_default.REMOVE,
        /**
         * @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
         */
        (function(event) {
          var overlay = (
            /** @type {import("./Overlay.js").default} */
            event.element
          );
          var id2 = overlay.getId();
          if (id2 !== void 0) {
            delete this.overlayIdIndex_[id2.toString()];
          }
          event.element.setMap(null);
        }).bind(_this)
      );
      _this.controls.forEach(
        /**
         * @param {import("./control/Control.js").default} control Control.
         * @this {PluggableMap}
         */
        (function(control) {
          control.setMap(this);
        }).bind(_this)
      );
      _this.interactions.forEach(
        /**
         * @param {import("./interaction/Interaction.js").default} interaction Interaction.
         * @this {PluggableMap}
         */
        (function(interaction) {
          interaction.setMap(this);
        }).bind(_this)
      );
      _this.overlays_.forEach(_this.addOverlayInternal_.bind(_this));
      return _this;
    }
    PluggableMap2.prototype.createRenderer = function() {
      throw new Error("Use a map type that has a createRenderer method");
    };
    PluggableMap2.prototype.addControl = function(control) {
      this.getControls().push(control);
    };
    PluggableMap2.prototype.addInteraction = function(interaction) {
      this.getInteractions().push(interaction);
    };
    PluggableMap2.prototype.addLayer = function(layer) {
      var layers = this.getLayerGroup().getLayers();
      layers.push(layer);
    };
    PluggableMap2.prototype.handleLayerAdd_ = function(event) {
      setLayerMapProperty(event.layer, this);
    };
    PluggableMap2.prototype.addOverlay = function(overlay) {
      this.getOverlays().push(overlay);
    };
    PluggableMap2.prototype.addOverlayInternal_ = function(overlay) {
      var id2 = overlay.getId();
      if (id2 !== void 0) {
        this.overlayIdIndex_[id2.toString()] = overlay;
      }
      overlay.setMap(this);
    };
    PluggableMap2.prototype.disposeInternal = function() {
      this.controls.clear();
      this.interactions.clear();
      this.overlays_.clear();
      this.setTarget(null);
      _super.prototype.disposeInternal.call(this);
    };
    PluggableMap2.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_options) {
      if (!this.frameState_ || !this.renderer_) {
        return;
      }
      var coordinate = this.getCoordinateFromPixelInternal(pixel);
      opt_options = opt_options !== void 0 ? opt_options : {};
      var hitTolerance = opt_options.hitTolerance !== void 0 ? opt_options.hitTolerance : 0;
      var layerFilter = opt_options.layerFilter !== void 0 ? opt_options.layerFilter : TRUE;
      var checkWrapped = opt_options.checkWrapped !== false;
      return this.renderer_.forEachFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, callback, null, layerFilter, null);
    };
    PluggableMap2.prototype.getFeaturesAtPixel = function(pixel, opt_options) {
      var features = [];
      this.forEachFeatureAtPixel(pixel, function(feature) {
        features.push(feature);
      }, opt_options);
      return features;
    };
    PluggableMap2.prototype.getAllLayers = function() {
      var layers = [];
      function addLayersFrom(layerGroup) {
        layerGroup.forEach(function(layer) {
          if (layer instanceof Group_default) {
            addLayersFrom(layer.getLayers());
          } else {
            layers.push(layer);
          }
        });
      }
      addLayersFrom(this.getLayers());
      return layers;
    };
    PluggableMap2.prototype.forEachLayerAtPixel = function(pixel, callback, opt_options) {
      if (!this.frameState_ || !this.renderer_) {
        return;
      }
      var options = opt_options || {};
      var hitTolerance = options.hitTolerance !== void 0 ? options.hitTolerance : 0;
      var layerFilter = options.layerFilter || TRUE;
      return this.renderer_.forEachLayerAtPixel(pixel, this.frameState_, hitTolerance, callback, layerFilter);
    };
    PluggableMap2.prototype.hasFeatureAtPixel = function(pixel, opt_options) {
      if (!this.frameState_ || !this.renderer_) {
        return false;
      }
      var coordinate = this.getCoordinateFromPixelInternal(pixel);
      opt_options = opt_options !== void 0 ? opt_options : {};
      var layerFilter = opt_options.layerFilter !== void 0 ? opt_options.layerFilter : TRUE;
      var hitTolerance = opt_options.hitTolerance !== void 0 ? opt_options.hitTolerance : 0;
      var checkWrapped = opt_options.checkWrapped !== false;
      return this.renderer_.hasFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, layerFilter, null);
    };
    PluggableMap2.prototype.getEventCoordinate = function(event) {
      return this.getCoordinateFromPixel(this.getEventPixel(event));
    };
    PluggableMap2.prototype.getEventCoordinateInternal = function(event) {
      return this.getCoordinateFromPixelInternal(this.getEventPixel(event));
    };
    PluggableMap2.prototype.getEventPixel = function(event) {
      var viewportPosition = this.viewport_.getBoundingClientRect();
      var eventPosition = (
        //FIXME Are we really calling this with a TouchEvent anywhere?
        "changedTouches" in event ? (
          /** @type {TouchEvent} */
          event.changedTouches[0]
        ) : (
          /** @type {MouseEvent} */
          event
        )
      );
      return [
        eventPosition.clientX - viewportPosition.left,
        eventPosition.clientY - viewportPosition.top
      ];
    };
    PluggableMap2.prototype.getTarget = function() {
      return (
        /** @type {HTMLElement|string|undefined} */
        this.get(MapProperty_default.TARGET)
      );
    };
    PluggableMap2.prototype.getTargetElement = function() {
      var target = this.getTarget();
      if (target !== void 0) {
        return typeof target === "string" ? document.getElementById(target) : target;
      } else {
        return null;
      }
    };
    PluggableMap2.prototype.getCoordinateFromPixel = function(pixel) {
      return toUserCoordinate(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());
    };
    PluggableMap2.prototype.getCoordinateFromPixelInternal = function(pixel) {
      var frameState = this.frameState_;
      if (!frameState) {
        return null;
      } else {
        return apply(frameState.pixelToCoordinateTransform, pixel.slice());
      }
    };
    PluggableMap2.prototype.getControls = function() {
      return this.controls;
    };
    PluggableMap2.prototype.getOverlays = function() {
      return this.overlays_;
    };
    PluggableMap2.prototype.getOverlayById = function(id2) {
      var overlay = this.overlayIdIndex_[id2.toString()];
      return overlay !== void 0 ? overlay : null;
    };
    PluggableMap2.prototype.getInteractions = function() {
      return this.interactions;
    };
    PluggableMap2.prototype.getLayerGroup = function() {
      return (
        /** @type {LayerGroup} */
        this.get(MapProperty_default.LAYERGROUP)
      );
    };
    PluggableMap2.prototype.setLayers = function(layers) {
      var group2 = this.getLayerGroup();
      if (layers instanceof Collection_default) {
        group2.setLayers(layers);
        return;
      }
      var collection = group2.getLayers();
      collection.clear();
      collection.extend(layers);
    };
    PluggableMap2.prototype.getLayers = function() {
      var layers = this.getLayerGroup().getLayers();
      return layers;
    };
    PluggableMap2.prototype.getLoadingOrNotReady = function() {
      var layerStatesArray = this.getLayerGroup().getLayerStatesArray();
      for (var i2 = 0, ii = layerStatesArray.length; i2 < ii; ++i2) {
        var state2 = layerStatesArray[i2];
        if (!state2.visible) {
          continue;
        }
        var renderer = state2.layer.getRenderer();
        if (renderer && !renderer.ready) {
          return true;
        }
        var source = (
          /** @type {import("./layer/Layer.js").default} */
          state2.layer.getSource()
        );
        if (source && source.loading) {
          return true;
        }
      }
      return false;
    };
    PluggableMap2.prototype.getPixelFromCoordinate = function(coordinate) {
      var viewCoordinate = fromUserCoordinate(coordinate, this.getView().getProjection());
      return this.getPixelFromCoordinateInternal(viewCoordinate);
    };
    PluggableMap2.prototype.getPixelFromCoordinateInternal = function(coordinate) {
      var frameState = this.frameState_;
      if (!frameState) {
        return null;
      } else {
        return apply(frameState.coordinateToPixelTransform, coordinate.slice(0, 2));
      }
    };
    PluggableMap2.prototype.getRenderer = function() {
      return this.renderer_;
    };
    PluggableMap2.prototype.getSize = function() {
      return (
        /** @type {import("./size.js").Size|undefined} */
        this.get(MapProperty_default.SIZE)
      );
    };
    PluggableMap2.prototype.getView = function() {
      return (
        /** @type {View} */
        this.get(MapProperty_default.VIEW)
      );
    };
    PluggableMap2.prototype.getViewport = function() {
      return this.viewport_;
    };
    PluggableMap2.prototype.getOverlayContainer = function() {
      return this.overlayContainer_;
    };
    PluggableMap2.prototype.getOverlayContainerStopEvent = function() {
      return this.overlayContainerStopEvent_;
    };
    PluggableMap2.prototype.getOwnerDocument = function() {
      var targetElement = this.getTargetElement();
      return targetElement ? targetElement.ownerDocument : document;
    };
    PluggableMap2.prototype.getTilePriority = function(tile, tileSourceKey, tileCenter, tileResolution) {
      return getTilePriority(this.frameState_, tile, tileSourceKey, tileCenter, tileResolution);
    };
    PluggableMap2.prototype.handleBrowserEvent = function(browserEvent, opt_type) {
      var type = opt_type || browserEvent.type;
      var mapBrowserEvent = new MapBrowserEvent_default(type, this, browserEvent);
      this.handleMapBrowserEvent(mapBrowserEvent);
    };
    PluggableMap2.prototype.handleMapBrowserEvent = function(mapBrowserEvent) {
      if (!this.frameState_) {
        return;
      }
      var originalEvent = (
        /** @type {PointerEvent} */
        mapBrowserEvent.originalEvent
      );
      var eventType = originalEvent.type;
      if (eventType === EventType_default3.POINTERDOWN || eventType === EventType_default.WHEEL || eventType === EventType_default.KEYDOWN) {
        var doc = this.getOwnerDocument();
        var rootNode = this.viewport_.getRootNode ? this.viewport_.getRootNode() : doc;
        var target = (
          /** @type {Node} */
          originalEvent.target
        );
        if (
          // Abort if the target is a child of the container for elements whose events are not meant
          // to be handled by map interactions.
          this.overlayContainerStopEvent_.contains(target) || // Abort if the event target is a child of the container that is no longer in the page.
          // It's possible for the target to no longer be in the page if it has been removed in an
          // event listener, this might happen in a Control that recreates it's content based on
          // user interaction either manually or via a render in something like https://reactjs.org/
          !(rootNode === doc ? doc.documentElement : rootNode).contains(target)
        ) {
          return;
        }
      }
      mapBrowserEvent.frameState = this.frameState_;
      if (this.dispatchEvent(mapBrowserEvent) !== false) {
        var interactionsArray = this.getInteractions().getArray().slice();
        for (var i2 = interactionsArray.length - 1; i2 >= 0; i2--) {
          var interaction = interactionsArray[i2];
          if (interaction.getMap() !== this || !interaction.getActive() || !this.getTargetElement()) {
            continue;
          }
          var cont = interaction.handleEvent(mapBrowserEvent);
          if (!cont || mapBrowserEvent.propagationStopped) {
            break;
          }
        }
      }
    };
    PluggableMap2.prototype.handlePostRender = function() {
      var frameState = this.frameState_;
      var tileQueue = this.tileQueue_;
      if (!tileQueue.isEmpty()) {
        var maxTotalLoading = this.maxTilesLoading_;
        var maxNewLoads = maxTotalLoading;
        if (frameState) {
          var hints = frameState.viewHints;
          if (hints[ViewHint_default.ANIMATING] || hints[ViewHint_default.INTERACTING]) {
            var lowOnFrameBudget = Date.now() - frameState.time > 8;
            maxTotalLoading = lowOnFrameBudget ? 0 : 8;
            maxNewLoads = lowOnFrameBudget ? 0 : 2;
          }
        }
        if (tileQueue.getTilesLoading() < maxTotalLoading) {
          tileQueue.reprioritize();
          tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);
        }
      }
      if (frameState && this.renderer_ && !frameState.animate) {
        if (this.renderComplete_ === true) {
          if (this.hasListener(EventType_default2.RENDERCOMPLETE)) {
            this.renderer_.dispatchRenderEvent(EventType_default2.RENDERCOMPLETE, frameState);
          }
          if (this.loaded_ === false) {
            this.loaded_ = true;
            this.dispatchEvent(new MapEvent_default(MapEventType_default.LOADEND, this, frameState));
          }
        } else if (this.loaded_ === true) {
          this.loaded_ = false;
          this.dispatchEvent(new MapEvent_default(MapEventType_default.LOADSTART, this, frameState));
        }
      }
      var postRenderFunctions = this.postRenderFunctions_;
      for (var i2 = 0, ii = postRenderFunctions.length; i2 < ii; ++i2) {
        postRenderFunctions[i2](this, frameState);
      }
      postRenderFunctions.length = 0;
    };
    PluggableMap2.prototype.handleSizeChanged_ = function() {
      if (this.getView() && !this.getView().getAnimating()) {
        this.getView().resolveConstraints(0);
      }
      this.render();
    };
    PluggableMap2.prototype.handleTargetChanged_ = function() {
      if (this.mapBrowserEventHandler_) {
        for (var i2 = 0, ii = this.targetChangeHandlerKeys_.length; i2 < ii; ++i2) {
          unlistenByKey(this.targetChangeHandlerKeys_[i2]);
        }
        this.targetChangeHandlerKeys_ = null;
        this.viewport_.removeEventListener(EventType_default.CONTEXTMENU, this.boundHandleBrowserEvent_);
        this.viewport_.removeEventListener(EventType_default.WHEEL, this.boundHandleBrowserEvent_);
        this.mapBrowserEventHandler_.dispose();
        this.mapBrowserEventHandler_ = null;
        removeNode(this.viewport_);
      }
      var targetElement = this.getTargetElement();
      if (!targetElement) {
        if (this.renderer_) {
          clearTimeout(this.postRenderTimeoutHandle_);
          this.postRenderTimeoutHandle_ = void 0;
          this.postRenderFunctions_.length = 0;
          this.renderer_.dispose();
          this.renderer_ = null;
        }
        if (this.animationDelayKey_) {
          cancelAnimationFrame(this.animationDelayKey_);
          this.animationDelayKey_ = void 0;
        }
      } else {
        targetElement.appendChild(this.viewport_);
        if (!this.renderer_) {
          this.renderer_ = this.createRenderer();
        }
        this.mapBrowserEventHandler_ = new MapBrowserEventHandler_default(this, this.moveTolerance_);
        for (var key in MapBrowserEventType_default) {
          this.mapBrowserEventHandler_.addEventListener(MapBrowserEventType_default[key], this.handleMapBrowserEvent.bind(this));
        }
        this.viewport_.addEventListener(EventType_default.CONTEXTMENU, this.boundHandleBrowserEvent_, false);
        this.viewport_.addEventListener(EventType_default.WHEEL, this.boundHandleBrowserEvent_, PASSIVE_EVENT_LISTENERS ? { passive: false } : false);
        var defaultView = this.getOwnerDocument().defaultView;
        var keyboardEventTarget = !this.keyboardEventTarget_ ? targetElement : this.keyboardEventTarget_;
        this.targetChangeHandlerKeys_ = [
          listen(keyboardEventTarget, EventType_default.KEYDOWN, this.handleBrowserEvent, this),
          listen(keyboardEventTarget, EventType_default.KEYPRESS, this.handleBrowserEvent, this),
          listen(defaultView, EventType_default.RESIZE, this.updateSize, this)
        ];
      }
      this.updateSize();
    };
    PluggableMap2.prototype.handleTileChange_ = function() {
      this.render();
    };
    PluggableMap2.prototype.handleViewPropertyChanged_ = function() {
      this.render();
    };
    PluggableMap2.prototype.handleViewChanged_ = function() {
      if (this.viewPropertyListenerKey_) {
        unlistenByKey(this.viewPropertyListenerKey_);
        this.viewPropertyListenerKey_ = null;
      }
      if (this.viewChangeListenerKey_) {
        unlistenByKey(this.viewChangeListenerKey_);
        this.viewChangeListenerKey_ = null;
      }
      var view = this.getView();
      if (view) {
        this.updateViewportSize_();
        this.viewPropertyListenerKey_ = listen(view, ObjectEventType_default.PROPERTYCHANGE, this.handleViewPropertyChanged_, this);
        this.viewChangeListenerKey_ = listen(view, EventType_default.CHANGE, this.handleViewPropertyChanged_, this);
        view.resolveConstraints(0);
      }
      this.render();
    };
    PluggableMap2.prototype.handleLayerGroupChanged_ = function() {
      if (this.layerGroupPropertyListenerKeys_) {
        this.layerGroupPropertyListenerKeys_.forEach(unlistenByKey);
        this.layerGroupPropertyListenerKeys_ = null;
      }
      var layerGroup = this.getLayerGroup();
      if (layerGroup) {
        this.handleLayerAdd_(new GroupEvent("addlayer", layerGroup));
        this.layerGroupPropertyListenerKeys_ = [
          listen(layerGroup, ObjectEventType_default.PROPERTYCHANGE, this.render, this),
          listen(layerGroup, EventType_default.CHANGE, this.render, this),
          listen(layerGroup, "addlayer", this.handleLayerAdd_, this),
          listen(layerGroup, "removelayer", this.handleLayerRemove_, this)
        ];
      }
      this.render();
    };
    PluggableMap2.prototype.isRendered = function() {
      return !!this.frameState_;
    };
    PluggableMap2.prototype.renderSync = function() {
      if (this.animationDelayKey_) {
        cancelAnimationFrame(this.animationDelayKey_);
      }
      this.animationDelay_();
    };
    PluggableMap2.prototype.redrawText = function() {
      var layerStates = this.getLayerGroup().getLayerStatesArray();
      for (var i2 = 0, ii = layerStates.length; i2 < ii; ++i2) {
        var layer = layerStates[i2].layer;
        if (layer.hasRenderer()) {
          layer.getRenderer().handleFontsChanged();
        }
      }
    };
    PluggableMap2.prototype.render = function() {
      if (this.renderer_ && this.animationDelayKey_ === void 0) {
        this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_);
      }
    };
    PluggableMap2.prototype.removeControl = function(control) {
      return this.getControls().remove(control);
    };
    PluggableMap2.prototype.removeInteraction = function(interaction) {
      return this.getInteractions().remove(interaction);
    };
    PluggableMap2.prototype.removeLayer = function(layer) {
      var layers = this.getLayerGroup().getLayers();
      return layers.remove(layer);
    };
    PluggableMap2.prototype.handleLayerRemove_ = function(event) {
      removeLayerMapProperty(event.layer);
    };
    PluggableMap2.prototype.removeOverlay = function(overlay) {
      return this.getOverlays().remove(overlay);
    };
    PluggableMap2.prototype.renderFrame_ = function(time) {
      var _this = this;
      var size = this.getSize();
      var view = this.getView();
      var previousFrameState = this.frameState_;
      var frameState = null;
      if (size !== void 0 && hasArea(size) && view && view.isDef()) {
        var viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : void 0);
        var viewState = view.getState();
        frameState = {
          animate: false,
          coordinateToPixelTransform: this.coordinateToPixelTransform_,
          declutterTree: null,
          extent: getForViewAndSize(viewState.center, viewState.resolution, viewState.rotation, size),
          index: this.frameIndex_++,
          layerIndex: 0,
          layerStatesArray: this.getLayerGroup().getLayerStatesArray(),
          pixelRatio: this.pixelRatio_,
          pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
          postRenderFunctions: [],
          size,
          tileQueue: this.tileQueue_,
          time,
          usedTiles: {},
          viewState,
          viewHints,
          wantedTiles: {},
          mapId: getUid(this),
          renderTargets: {}
        };
        if (viewState.nextCenter && viewState.nextResolution) {
          var rotation = isNaN(viewState.nextRotation) ? viewState.rotation : viewState.nextRotation;
          frameState.nextExtent = getForViewAndSize(viewState.nextCenter, viewState.nextResolution, rotation, size);
        }
      }
      this.frameState_ = frameState;
      this.renderer_.renderFrame(frameState);
      if (frameState) {
        if (frameState.animate) {
          this.render();
        }
        Array.prototype.push.apply(this.postRenderFunctions_, frameState.postRenderFunctions);
        if (previousFrameState) {
          var moveStart = !this.previousExtent_ || !isEmpty2(this.previousExtent_) && !equals2(frameState.extent, this.previousExtent_);
          if (moveStart) {
            this.dispatchEvent(new MapEvent_default(MapEventType_default.MOVESTART, this, previousFrameState));
            this.previousExtent_ = createOrUpdateEmpty(this.previousExtent_);
          }
        }
        var idle = this.previousExtent_ && !frameState.viewHints[ViewHint_default.ANIMATING] && !frameState.viewHints[ViewHint_default.INTERACTING] && !equals2(frameState.extent, this.previousExtent_);
        if (idle) {
          this.dispatchEvent(new MapEvent_default(MapEventType_default.MOVEEND, this, frameState));
          clone(frameState.extent, this.previousExtent_);
        }
      }
      this.dispatchEvent(new MapEvent_default(MapEventType_default.POSTRENDER, this, frameState));
      this.renderComplete_ = this.hasListener(MapEventType_default.LOADSTART) || this.hasListener(MapEventType_default.LOADEND) || this.hasListener(EventType_default2.RENDERCOMPLETE) ? !this.tileQueue_.getTilesLoading() && !this.tileQueue_.getCount() && !this.getLoadingOrNotReady() : void 0;
      if (!this.postRenderTimeoutHandle_) {
        this.postRenderTimeoutHandle_ = setTimeout(function() {
          _this.postRenderTimeoutHandle_ = void 0;
          _this.handlePostRender();
        }, 0);
      }
    };
    PluggableMap2.prototype.setLayerGroup = function(layerGroup) {
      var oldLayerGroup = this.getLayerGroup();
      if (oldLayerGroup) {
        this.handleLayerRemove_(new GroupEvent("removelayer", oldLayerGroup));
      }
      this.set(MapProperty_default.LAYERGROUP, layerGroup);
    };
    PluggableMap2.prototype.setSize = function(size) {
      this.set(MapProperty_default.SIZE, size);
    };
    PluggableMap2.prototype.setTarget = function(target) {
      this.set(MapProperty_default.TARGET, target);
    };
    PluggableMap2.prototype.setView = function(view) {
      if (!view || view instanceof View_default) {
        this.set(MapProperty_default.VIEW, view);
        return;
      }
      this.set(MapProperty_default.VIEW, new View_default());
      var map2 = this;
      view.then(function(viewOptions) {
        map2.setView(new View_default(viewOptions));
      });
    };
    PluggableMap2.prototype.updateSize = function() {
      var targetElement = this.getTargetElement();
      var size = void 0;
      if (targetElement) {
        var computedStyle = getComputedStyle(targetElement);
        var width = targetElement.offsetWidth - parseFloat(computedStyle["borderLeftWidth"]) - parseFloat(computedStyle["paddingLeft"]) - parseFloat(computedStyle["paddingRight"]) - parseFloat(computedStyle["borderRightWidth"]);
        var height = targetElement.offsetHeight - parseFloat(computedStyle["borderTopWidth"]) - parseFloat(computedStyle["paddingTop"]) - parseFloat(computedStyle["paddingBottom"]) - parseFloat(computedStyle["borderBottomWidth"]);
        if (!isNaN(width) && !isNaN(height)) {
          size = [width, height];
          if (!hasArea(size) && !!(targetElement.offsetWidth || targetElement.offsetHeight || targetElement.getClientRects().length)) {
            console.warn("No map visible because the map container's width or height are 0.");
          }
        }
      }
      this.setSize(size);
      this.updateViewportSize_();
    };
    PluggableMap2.prototype.updateViewportSize_ = function() {
      var view = this.getView();
      if (view) {
        var size = void 0;
        var computedStyle = getComputedStyle(this.viewport_);
        if (computedStyle.width && computedStyle.height) {
          size = [
            parseInt(computedStyle.width, 10),
            parseInt(computedStyle.height, 10)
          ];
        }
        view.setViewportSize(size);
      }
    };
    return PluggableMap2;
  }(Object_default)
);
function createOptionsInternal(options) {
  var keyboardEventTarget = null;
  if (options.keyboardEventTarget !== void 0) {
    keyboardEventTarget = typeof options.keyboardEventTarget === "string" ? document.getElementById(options.keyboardEventTarget) : options.keyboardEventTarget;
  }
  var values = {};
  var layerGroup = options.layers && typeof /** @type {?} */
  options.layers.getLayers === "function" ? (
    /** @type {LayerGroup} */
    options.layers
  ) : new Group_default({ layers: (
    /** @type {Collection} */
    options.layers
  ) });
  values[MapProperty_default.LAYERGROUP] = layerGroup;
  values[MapProperty_default.TARGET] = options.target;
  values[MapProperty_default.VIEW] = options.view instanceof View_default ? options.view : new View_default();
  var controls;
  if (options.controls !== void 0) {
    if (Array.isArray(options.controls)) {
      controls = new Collection_default(options.controls.slice());
    } else {
      assert(typeof /** @type {?} */
      options.controls.getArray === "function", 47);
      controls = /** @type {Collection} */
      options.controls;
    }
  }
  var interactions;
  if (options.interactions !== void 0) {
    if (Array.isArray(options.interactions)) {
      interactions = new Collection_default(options.interactions.slice());
    } else {
      assert(typeof /** @type {?} */
      options.interactions.getArray === "function", 48);
      interactions = /** @type {Collection} */
      options.interactions;
    }
  }
  var overlays;
  if (options.overlays !== void 0) {
    if (Array.isArray(options.overlays)) {
      overlays = new Collection_default(options.overlays.slice());
    } else {
      assert(typeof /** @type {?} */
      options.overlays.getArray === "function", 49);
      overlays = options.overlays;
    }
  } else {
    overlays = new Collection_default();
  }
  return {
    controls,
    interactions,
    keyboardEventTarget,
    overlays,
    values
  };
}
var PluggableMap_default = PluggableMap;

// node_modules/ol/control/Control.js
var __extends63 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Control = (
  /** @class */
  function(_super) {
    __extends63(Control2, _super);
    function Control2(options) {
      var _this = _super.call(this) || this;
      var element = options.element;
      if (element && !options.target && !element.style.pointerEvents) {
        element.style.pointerEvents = "auto";
      }
      _this.element = element ? element : null;
      _this.target_ = null;
      _this.map_ = null;
      _this.listenerKeys = [];
      if (options.render) {
        _this.render = options.render;
      }
      if (options.target) {
        _this.setTarget(options.target);
      }
      return _this;
    }
    Control2.prototype.disposeInternal = function() {
      removeNode(this.element);
      _super.prototype.disposeInternal.call(this);
    };
    Control2.prototype.getMap = function() {
      return this.map_;
    };
    Control2.prototype.setMap = function(map2) {
      if (this.map_) {
        removeNode(this.element);
      }
      for (var i2 = 0, ii = this.listenerKeys.length; i2 < ii; ++i2) {
        unlistenByKey(this.listenerKeys[i2]);
      }
      this.listenerKeys.length = 0;
      this.map_ = map2;
      if (map2) {
        var target = this.target_ ? this.target_ : map2.getOverlayContainerStopEvent();
        target.appendChild(this.element);
        if (this.render !== VOID) {
          this.listenerKeys.push(listen(map2, MapEventType_default.POSTRENDER, this.render, this));
        }
        map2.render();
      }
    };
    Control2.prototype.render = function(mapEvent) {
    };
    Control2.prototype.setTarget = function(target) {
      this.target_ = typeof target === "string" ? document.getElementById(target) : target;
    };
    return Control2;
  }(Object_default)
);
var Control_default = Control;

// node_modules/ol/control/Attribution.js
var __extends64 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Attribution = (
  /** @class */
  function(_super) {
    __extends64(Attribution2, _super);
    function Attribution2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this, {
        element: document.createElement("div"),
        render: options.render,
        target: options.target
      }) || this;
      _this.ulElement_ = document.createElement("ul");
      _this.collapsed_ = options.collapsed !== void 0 ? options.collapsed : true;
      _this.userCollapsed_ = _this.collapsed_;
      _this.overrideCollapsible_ = options.collapsible !== void 0;
      _this.collapsible_ = options.collapsible !== void 0 ? options.collapsible : true;
      if (!_this.collapsible_) {
        _this.collapsed_ = false;
      }
      var className = options.className !== void 0 ? options.className : "ol-attribution";
      var tipLabel = options.tipLabel !== void 0 ? options.tipLabel : "Attributions";
      var expandClassName = options.expandClassName !== void 0 ? options.expandClassName : className + "-expand";
      var collapseLabel = options.collapseLabel !== void 0 ? options.collapseLabel : "\u203A";
      var collapseClassName = options.collapseClassName !== void 0 ? options.collapseClassName : className + "-collapse";
      if (typeof collapseLabel === "string") {
        _this.collapseLabel_ = document.createElement("span");
        _this.collapseLabel_.textContent = collapseLabel;
        _this.collapseLabel_.className = collapseClassName;
      } else {
        _this.collapseLabel_ = collapseLabel;
      }
      var label = options.label !== void 0 ? options.label : "i";
      if (typeof label === "string") {
        _this.label_ = document.createElement("span");
        _this.label_.textContent = label;
        _this.label_.className = expandClassName;
      } else {
        _this.label_ = label;
      }
      var activeLabel = _this.collapsible_ && !_this.collapsed_ ? _this.collapseLabel_ : _this.label_;
      _this.toggleButton_ = document.createElement("button");
      _this.toggleButton_.setAttribute("type", "button");
      _this.toggleButton_.setAttribute("aria-expanded", String(!_this.collapsed_));
      _this.toggleButton_.title = tipLabel;
      _this.toggleButton_.appendChild(activeLabel);
      _this.toggleButton_.addEventListener(EventType_default.CLICK, _this.handleClick_.bind(_this), false);
      var cssClasses = className + " " + CLASS_UNSELECTABLE + " " + CLASS_CONTROL + (_this.collapsed_ && _this.collapsible_ ? " " + CLASS_COLLAPSED : "") + (_this.collapsible_ ? "" : " ol-uncollapsible");
      var element = _this.element;
      element.className = cssClasses;
      element.appendChild(_this.toggleButton_);
      element.appendChild(_this.ulElement_);
      _this.renderedAttributions_ = [];
      _this.renderedVisible_ = true;
      return _this;
    }
    Attribution2.prototype.collectSourceAttributions_ = function(frameState) {
      var lookup = {};
      var visibleAttributions = [];
      var collapsible = true;
      var layerStatesArray = frameState.layerStatesArray;
      for (var i2 = 0, ii = layerStatesArray.length; i2 < ii; ++i2) {
        var layerState = layerStatesArray[i2];
        if (!inView(layerState, frameState.viewState)) {
          continue;
        }
        var source = (
          /** @type {import("../layer/Layer.js").default} */
          layerState.layer.getSource()
        );
        if (!source) {
          continue;
        }
        var attributionGetter = source.getAttributions();
        if (!attributionGetter) {
          continue;
        }
        var attributions = attributionGetter(frameState);
        if (!attributions) {
          continue;
        }
        collapsible = collapsible && source.getAttributionsCollapsible() !== false;
        if (Array.isArray(attributions)) {
          for (var j = 0, jj = attributions.length; j < jj; ++j) {
            if (!(attributions[j] in lookup)) {
              visibleAttributions.push(attributions[j]);
              lookup[attributions[j]] = true;
            }
          }
        } else {
          if (!(attributions in lookup)) {
            visibleAttributions.push(attributions);
            lookup[attributions] = true;
          }
        }
      }
      if (!this.overrideCollapsible_) {
        this.setCollapsible(collapsible);
      }
      return visibleAttributions;
    };
    Attribution2.prototype.updateElement_ = function(frameState) {
      if (!frameState) {
        if (this.renderedVisible_) {
          this.element.style.display = "none";
          this.renderedVisible_ = false;
        }
        return;
      }
      var attributions = this.collectSourceAttributions_(frameState);
      var visible = attributions.length > 0;
      if (this.renderedVisible_ != visible) {
        this.element.style.display = visible ? "" : "none";
        this.renderedVisible_ = visible;
      }
      if (equals(attributions, this.renderedAttributions_)) {
        return;
      }
      removeChildren(this.ulElement_);
      for (var i2 = 0, ii = attributions.length; i2 < ii; ++i2) {
        var element = document.createElement("li");
        element.innerHTML = attributions[i2];
        this.ulElement_.appendChild(element);
      }
      this.renderedAttributions_ = attributions;
    };
    Attribution2.prototype.handleClick_ = function(event) {
      event.preventDefault();
      this.handleToggle_();
      this.userCollapsed_ = this.collapsed_;
    };
    Attribution2.prototype.handleToggle_ = function() {
      this.element.classList.toggle(CLASS_COLLAPSED);
      if (this.collapsed_) {
        replaceNode(this.collapseLabel_, this.label_);
      } else {
        replaceNode(this.label_, this.collapseLabel_);
      }
      this.collapsed_ = !this.collapsed_;
      this.toggleButton_.setAttribute("aria-expanded", String(!this.collapsed_));
    };
    Attribution2.prototype.getCollapsible = function() {
      return this.collapsible_;
    };
    Attribution2.prototype.setCollapsible = function(collapsible) {
      if (this.collapsible_ === collapsible) {
        return;
      }
      this.collapsible_ = collapsible;
      this.element.classList.toggle("ol-uncollapsible");
      if (this.userCollapsed_) {
        this.handleToggle_();
      }
    };
    Attribution2.prototype.setCollapsed = function(collapsed) {
      this.userCollapsed_ = collapsed;
      if (!this.collapsible_ || this.collapsed_ === collapsed) {
        return;
      }
      this.handleToggle_();
    };
    Attribution2.prototype.getCollapsed = function() {
      return this.collapsed_;
    };
    Attribution2.prototype.render = function(mapEvent) {
      this.updateElement_(mapEvent.frameState);
    };
    return Attribution2;
  }(Control_default)
);
var Attribution_default = Attribution;

// node_modules/ol/control/Rotate.js
var __extends65 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Rotate = (
  /** @class */
  function(_super) {
    __extends65(Rotate2, _super);
    function Rotate2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this, {
        element: document.createElement("div"),
        render: options.render,
        target: options.target
      }) || this;
      var className = options.className !== void 0 ? options.className : "ol-rotate";
      var label = options.label !== void 0 ? options.label : "\u21E7";
      var compassClassName = options.compassClassName !== void 0 ? options.compassClassName : "ol-compass";
      _this.label_ = null;
      if (typeof label === "string") {
        _this.label_ = document.createElement("span");
        _this.label_.className = compassClassName;
        _this.label_.textContent = label;
      } else {
        _this.label_ = label;
        _this.label_.classList.add(compassClassName);
      }
      var tipLabel = options.tipLabel ? options.tipLabel : "Reset rotation";
      var button = document.createElement("button");
      button.className = className + "-reset";
      button.setAttribute("type", "button");
      button.title = tipLabel;
      button.appendChild(_this.label_);
      button.addEventListener(EventType_default.CLICK, _this.handleClick_.bind(_this), false);
      var cssClasses = className + " " + CLASS_UNSELECTABLE + " " + CLASS_CONTROL;
      var element = _this.element;
      element.className = cssClasses;
      element.appendChild(button);
      _this.callResetNorth_ = options.resetNorth ? options.resetNorth : void 0;
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      _this.autoHide_ = options.autoHide !== void 0 ? options.autoHide : true;
      _this.rotation_ = void 0;
      if (_this.autoHide_) {
        _this.element.classList.add(CLASS_HIDDEN);
      }
      return _this;
    }
    Rotate2.prototype.handleClick_ = function(event) {
      event.preventDefault();
      if (this.callResetNorth_ !== void 0) {
        this.callResetNorth_();
      } else {
        this.resetNorth_();
      }
    };
    Rotate2.prototype.resetNorth_ = function() {
      var map2 = this.getMap();
      var view = map2.getView();
      if (!view) {
        return;
      }
      var rotation = view.getRotation();
      if (rotation !== void 0) {
        if (this.duration_ > 0 && rotation % (2 * Math.PI) !== 0) {
          view.animate({
            rotation: 0,
            duration: this.duration_,
            easing: easeOut
          });
        } else {
          view.setRotation(0);
        }
      }
    };
    Rotate2.prototype.render = function(mapEvent) {
      var frameState = mapEvent.frameState;
      if (!frameState) {
        return;
      }
      var rotation = frameState.viewState.rotation;
      if (rotation != this.rotation_) {
        var transform3 = "rotate(" + rotation + "rad)";
        if (this.autoHide_) {
          var contains = this.element.classList.contains(CLASS_HIDDEN);
          if (!contains && rotation === 0) {
            this.element.classList.add(CLASS_HIDDEN);
          } else if (contains && rotation !== 0) {
            this.element.classList.remove(CLASS_HIDDEN);
          }
        }
        this.label_.style.transform = transform3;
      }
      this.rotation_ = rotation;
    };
    return Rotate2;
  }(Control_default)
);
var Rotate_default = Rotate;

// node_modules/ol/control/Zoom.js
var __extends66 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Zoom = (
  /** @class */
  function(_super) {
    __extends66(Zoom2, _super);
    function Zoom2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this, {
        element: document.createElement("div"),
        target: options.target
      }) || this;
      var className = options.className !== void 0 ? options.className : "ol-zoom";
      var delta = options.delta !== void 0 ? options.delta : 1;
      var zoomInClassName = options.zoomInClassName !== void 0 ? options.zoomInClassName : className + "-in";
      var zoomOutClassName = options.zoomOutClassName !== void 0 ? options.zoomOutClassName : className + "-out";
      var zoomInLabel = options.zoomInLabel !== void 0 ? options.zoomInLabel : "+";
      var zoomOutLabel = options.zoomOutLabel !== void 0 ? options.zoomOutLabel : "\u2013";
      var zoomInTipLabel = options.zoomInTipLabel !== void 0 ? options.zoomInTipLabel : "Zoom in";
      var zoomOutTipLabel = options.zoomOutTipLabel !== void 0 ? options.zoomOutTipLabel : "Zoom out";
      var inElement = document.createElement("button");
      inElement.className = zoomInClassName;
      inElement.setAttribute("type", "button");
      inElement.title = zoomInTipLabel;
      inElement.appendChild(typeof zoomInLabel === "string" ? document.createTextNode(zoomInLabel) : zoomInLabel);
      inElement.addEventListener(EventType_default.CLICK, _this.handleClick_.bind(_this, delta), false);
      var outElement = document.createElement("button");
      outElement.className = zoomOutClassName;
      outElement.setAttribute("type", "button");
      outElement.title = zoomOutTipLabel;
      outElement.appendChild(typeof zoomOutLabel === "string" ? document.createTextNode(zoomOutLabel) : zoomOutLabel);
      outElement.addEventListener(EventType_default.CLICK, _this.handleClick_.bind(_this, -delta), false);
      var cssClasses = className + " " + CLASS_UNSELECTABLE + " " + CLASS_CONTROL;
      var element = _this.element;
      element.className = cssClasses;
      element.appendChild(inElement);
      element.appendChild(outElement);
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      return _this;
    }
    Zoom2.prototype.handleClick_ = function(delta, event) {
      event.preventDefault();
      this.zoomByDelta_(delta);
    };
    Zoom2.prototype.zoomByDelta_ = function(delta) {
      var map2 = this.getMap();
      var view = map2.getView();
      if (!view) {
        return;
      }
      var currentZoom = view.getZoom();
      if (currentZoom !== void 0) {
        var newZoom = view.getConstrainedZoom(currentZoom + delta);
        if (this.duration_ > 0) {
          if (view.getAnimating()) {
            view.cancelAnimations();
          }
          view.animate({
            zoom: newZoom,
            duration: this.duration_,
            easing: easeOut
          });
        } else {
          view.setZoom(newZoom);
        }
      }
    };
    return Zoom2;
  }(Control_default)
);
var Zoom_default = Zoom;

// node_modules/ol/control/FullScreen.js
var __extends67 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var events = [
  "fullscreenchange",
  "webkitfullscreenchange",
  "MSFullscreenChange"
];
var FullScreenEventType = {
  /**
   * Triggered after the map entered fullscreen.
   * @event FullScreenEventType#enterfullscreen
   * @api
   */
  ENTERFULLSCREEN: "enterfullscreen",
  /**
   * Triggered after the map leave fullscreen.
   * @event FullScreenEventType#leavefullscreen
   * @api
   */
  LEAVEFULLSCREEN: "leavefullscreen"
};
var FullScreen = (
  /** @class */
  function(_super) {
    __extends67(FullScreen2, _super);
    function FullScreen2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this, {
        element: document.createElement("div"),
        target: options.target
      }) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.keys_ = options.keys !== void 0 ? options.keys : false;
      _this.source_ = options.source;
      _this.isInFullscreen_ = false;
      _this.boundHandleMapTargetChange_ = _this.handleMapTargetChange_.bind(_this);
      _this.cssClassName_ = options.className !== void 0 ? options.className : "ol-full-screen";
      _this.documentListeners_ = [];
      _this.activeClassName_ = options.activeClassName !== void 0 ? options.activeClassName.split(" ") : [_this.cssClassName_ + "-true"];
      _this.inactiveClassName_ = options.inactiveClassName !== void 0 ? options.inactiveClassName.split(" ") : [_this.cssClassName_ + "-false"];
      var label = options.label !== void 0 ? options.label : "\u2922";
      _this.labelNode_ = typeof label === "string" ? document.createTextNode(label) : label;
      var labelActive = options.labelActive !== void 0 ? options.labelActive : "\xD7";
      _this.labelActiveNode_ = typeof labelActive === "string" ? document.createTextNode(labelActive) : labelActive;
      var tipLabel = options.tipLabel ? options.tipLabel : "Toggle full-screen";
      _this.button_ = document.createElement("button");
      _this.button_.title = tipLabel;
      _this.button_.setAttribute("type", "button");
      _this.button_.appendChild(_this.labelNode_);
      _this.button_.addEventListener(EventType_default.CLICK, _this.handleClick_.bind(_this), false);
      _this.setClassName_(_this.button_, _this.isInFullscreen_);
      _this.element.className = "".concat(_this.cssClassName_, " ").concat(CLASS_UNSELECTABLE, " ").concat(CLASS_CONTROL);
      _this.element.appendChild(_this.button_);
      return _this;
    }
    FullScreen2.prototype.handleClick_ = function(event) {
      event.preventDefault();
      this.handleFullScreen_();
    };
    FullScreen2.prototype.handleFullScreen_ = function() {
      var map2 = this.getMap();
      if (!map2) {
        return;
      }
      var doc = map2.getOwnerDocument();
      if (!isFullScreenSupported(doc)) {
        return;
      }
      if (isFullScreen(doc)) {
        exitFullScreen(doc);
      } else {
        var element = void 0;
        if (this.source_) {
          element = typeof this.source_ === "string" ? doc.getElementById(this.source_) : this.source_;
        } else {
          element = map2.getTargetElement();
        }
        if (this.keys_) {
          requestFullScreenWithKeys(element);
        } else {
          requestFullScreen(element);
        }
      }
    };
    FullScreen2.prototype.handleFullScreenChange_ = function() {
      var map2 = this.getMap();
      if (!map2) {
        return;
      }
      var wasInFullscreen = this.isInFullscreen_;
      this.isInFullscreen_ = isFullScreen(map2.getOwnerDocument());
      if (wasInFullscreen !== this.isInFullscreen_) {
        this.setClassName_(this.button_, this.isInFullscreen_);
        if (this.isInFullscreen_) {
          replaceNode(this.labelActiveNode_, this.labelNode_);
          this.dispatchEvent(FullScreenEventType.ENTERFULLSCREEN);
        } else {
          replaceNode(this.labelNode_, this.labelActiveNode_);
          this.dispatchEvent(FullScreenEventType.LEAVEFULLSCREEN);
        }
        map2.updateSize();
      }
    };
    FullScreen2.prototype.setClassName_ = function(element, fullscreen) {
      var _a56, _b, _c, _d;
      if (fullscreen) {
        (_a56 = element.classList).remove.apply(_a56, this.inactiveClassName_);
        (_b = element.classList).add.apply(_b, this.activeClassName_);
      } else {
        (_c = element.classList).remove.apply(_c, this.activeClassName_);
        (_d = element.classList).add.apply(_d, this.inactiveClassName_);
      }
    };
    FullScreen2.prototype.setMap = function(map2) {
      var oldMap = this.getMap();
      if (oldMap) {
        oldMap.removeChangeListener(MapProperty_default.TARGET, this.boundHandleMapTargetChange_);
      }
      _super.prototype.setMap.call(this, map2);
      this.handleMapTargetChange_();
      if (map2) {
        map2.addChangeListener(MapProperty_default.TARGET, this.boundHandleMapTargetChange_);
      }
    };
    FullScreen2.prototype.handleMapTargetChange_ = function() {
      var listeners = this.documentListeners_;
      for (var i2 = 0, ii = listeners.length; i2 < ii; ++i2) {
        unlistenByKey(listeners[i2]);
      }
      listeners.length = 0;
      var map2 = this.getMap();
      if (map2) {
        var doc = map2.getOwnerDocument();
        if (isFullScreenSupported(doc)) {
          this.element.classList.remove(CLASS_UNSUPPORTED);
        } else {
          this.element.classList.add(CLASS_UNSUPPORTED);
        }
        for (var i2 = 0, ii = events.length; i2 < ii; ++i2) {
          listeners.push(listen(doc, events[i2], this.handleFullScreenChange_, this));
        }
        this.handleFullScreenChange_();
      }
    };
    return FullScreen2;
  }(Control_default)
);
function isFullScreenSupported(doc) {
  var body = doc.body;
  return !!(body["webkitRequestFullscreen"] || body["msRequestFullscreen"] && doc["msFullscreenEnabled"] || body.requestFullscreen && doc.fullscreenEnabled);
}
function isFullScreen(doc) {
  return !!(doc["webkitIsFullScreen"] || doc["msFullscreenElement"] || doc.fullscreenElement);
}
function requestFullScreen(element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element["msRequestFullscreen"]) {
    element["msRequestFullscreen"]();
  } else if (element["webkitRequestFullscreen"]) {
    element["webkitRequestFullscreen"]();
  }
}
function requestFullScreenWithKeys(element) {
  if (element["webkitRequestFullscreen"]) {
    element["webkitRequestFullscreen"]();
  } else {
    requestFullScreen(element);
  }
}
function exitFullScreen(doc) {
  if (doc.exitFullscreen) {
    doc.exitFullscreen();
  } else if (doc["msExitFullscreen"]) {
    doc["msExitFullscreen"]();
  } else if (doc["webkitExitFullscreen"]) {
    doc["webkitExitFullscreen"]();
  }
}
var FullScreen_default = FullScreen;

// node_modules/ol/Overlay.js
var __extends68 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Property4 = {
  ELEMENT: "element",
  MAP: "map",
  OFFSET: "offset",
  POSITION: "position",
  POSITIONING: "positioning"
};
var Overlay2 = (
  /** @class */
  function(_super) {
    __extends68(Overlay3, _super);
    function Overlay3(options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.options = options;
      _this.id = options.id;
      _this.insertFirst = options.insertFirst !== void 0 ? options.insertFirst : true;
      _this.stopEvent = options.stopEvent !== void 0 ? options.stopEvent : true;
      _this.element = document.createElement("div");
      _this.element.className = options.className !== void 0 ? options.className : "ol-overlay-container " + CLASS_SELECTABLE;
      _this.element.style.position = "absolute";
      _this.element.style.pointerEvents = "auto";
      var autoPan = options.autoPan;
      if (autoPan && "object" !== typeof autoPan) {
        autoPan = {
          animation: options.autoPanAnimation,
          margin: options.autoPanMargin
        };
      }
      _this.autoPan = /** @type {PanIntoViewOptions} */
      autoPan || false;
      _this.rendered = {
        transform_: "",
        visible: true
      };
      _this.mapPostrenderListenerKey = null;
      _this.addChangeListener(Property4.ELEMENT, _this.handleElementChanged);
      _this.addChangeListener(Property4.MAP, _this.handleMapChanged);
      _this.addChangeListener(Property4.OFFSET, _this.handleOffsetChanged);
      _this.addChangeListener(Property4.POSITION, _this.handlePositionChanged);
      _this.addChangeListener(Property4.POSITIONING, _this.handlePositioningChanged);
      if (options.element !== void 0) {
        _this.setElement(options.element);
      }
      _this.setOffset(options.offset !== void 0 ? options.offset : [0, 0]);
      _this.setPositioning(options.positioning || "top-left");
      if (options.position !== void 0) {
        _this.setPosition(options.position);
      }
      return _this;
    }
    Overlay3.prototype.getElement = function() {
      return (
        /** @type {HTMLElement|undefined} */
        this.get(Property4.ELEMENT)
      );
    };
    Overlay3.prototype.getId = function() {
      return this.id;
    };
    Overlay3.prototype.getMap = function() {
      return (
        /** @type {import("./PluggableMap.js").default|null} */
        this.get(Property4.MAP) || null
      );
    };
    Overlay3.prototype.getOffset = function() {
      return (
        /** @type {Array<number>} */
        this.get(Property4.OFFSET)
      );
    };
    Overlay3.prototype.getPosition = function() {
      return (
        /** @type {import("./coordinate.js").Coordinate|undefined} */
        this.get(Property4.POSITION)
      );
    };
    Overlay3.prototype.getPositioning = function() {
      return (
        /** @type {Positioning} */
        this.get(Property4.POSITIONING)
      );
    };
    Overlay3.prototype.handleElementChanged = function() {
      removeChildren(this.element);
      var element = this.getElement();
      if (element) {
        this.element.appendChild(element);
      }
    };
    Overlay3.prototype.handleMapChanged = function() {
      if (this.mapPostrenderListenerKey) {
        removeNode(this.element);
        unlistenByKey(this.mapPostrenderListenerKey);
        this.mapPostrenderListenerKey = null;
      }
      var map2 = this.getMap();
      if (map2) {
        this.mapPostrenderListenerKey = listen(map2, MapEventType_default.POSTRENDER, this.render, this);
        this.updatePixelPosition();
        var container = this.stopEvent ? map2.getOverlayContainerStopEvent() : map2.getOverlayContainer();
        if (this.insertFirst) {
          container.insertBefore(this.element, container.childNodes[0] || null);
        } else {
          container.appendChild(this.element);
        }
        this.performAutoPan();
      }
    };
    Overlay3.prototype.render = function() {
      this.updatePixelPosition();
    };
    Overlay3.prototype.handleOffsetChanged = function() {
      this.updatePixelPosition();
    };
    Overlay3.prototype.handlePositionChanged = function() {
      this.updatePixelPosition();
      this.performAutoPan();
    };
    Overlay3.prototype.handlePositioningChanged = function() {
      this.updatePixelPosition();
    };
    Overlay3.prototype.setElement = function(element) {
      this.set(Property4.ELEMENT, element);
    };
    Overlay3.prototype.setMap = function(map2) {
      this.set(Property4.MAP, map2);
    };
    Overlay3.prototype.setOffset = function(offset2) {
      this.set(Property4.OFFSET, offset2);
    };
    Overlay3.prototype.setPosition = function(position) {
      this.set(Property4.POSITION, position);
    };
    Overlay3.prototype.performAutoPan = function() {
      if (this.autoPan) {
        this.panIntoView(this.autoPan);
      }
    };
    Overlay3.prototype.panIntoView = function(opt_panIntoViewOptions) {
      var map2 = this.getMap();
      if (!map2 || !map2.getTargetElement() || !this.get(Property4.POSITION)) {
        return;
      }
      var mapRect = this.getRect(map2.getTargetElement(), map2.getSize());
      var element = this.getElement();
      var overlayRect = this.getRect(element, [
        outerWidth(element),
        outerHeight(element)
      ]);
      var panIntoViewOptions = opt_panIntoViewOptions || {};
      var myMargin = panIntoViewOptions.margin === void 0 ? 20 : panIntoViewOptions.margin;
      if (!containsExtent(mapRect, overlayRect)) {
        var offsetLeft = overlayRect[0] - mapRect[0];
        var offsetRight = mapRect[2] - overlayRect[2];
        var offsetTop = overlayRect[1] - mapRect[1];
        var offsetBottom = mapRect[3] - overlayRect[3];
        var delta = [0, 0];
        if (offsetLeft < 0) {
          delta[0] = offsetLeft - myMargin;
        } else if (offsetRight < 0) {
          delta[0] = Math.abs(offsetRight) + myMargin;
        }
        if (offsetTop < 0) {
          delta[1] = offsetTop - myMargin;
        } else if (offsetBottom < 0) {
          delta[1] = Math.abs(offsetBottom) + myMargin;
        }
        if (delta[0] !== 0 || delta[1] !== 0) {
          var center = (
            /** @type {import("./coordinate.js").Coordinate} */
            map2.getView().getCenterInternal()
          );
          var centerPx = map2.getPixelFromCoordinateInternal(center);
          if (!centerPx) {
            return;
          }
          var newCenterPx = [centerPx[0] + delta[0], centerPx[1] + delta[1]];
          var panOptions = panIntoViewOptions.animation || {};
          map2.getView().animateInternal({
            center: map2.getCoordinateFromPixelInternal(newCenterPx),
            duration: panOptions.duration,
            easing: panOptions.easing
          });
        }
      }
    };
    Overlay3.prototype.getRect = function(element, size) {
      var box = element.getBoundingClientRect();
      var offsetX = box.left + window.pageXOffset;
      var offsetY = box.top + window.pageYOffset;
      return [offsetX, offsetY, offsetX + size[0], offsetY + size[1]];
    };
    Overlay3.prototype.setPositioning = function(positioning) {
      this.set(Property4.POSITIONING, positioning);
    };
    Overlay3.prototype.setVisible = function(visible) {
      if (this.rendered.visible !== visible) {
        this.element.style.display = visible ? "" : "none";
        this.rendered.visible = visible;
      }
    };
    Overlay3.prototype.updatePixelPosition = function() {
      var map2 = this.getMap();
      var position = this.getPosition();
      if (!map2 || !map2.isRendered() || !position) {
        this.setVisible(false);
        return;
      }
      var pixel = map2.getPixelFromCoordinate(position);
      var mapSize = map2.getSize();
      this.updateRenderedPosition(pixel, mapSize);
    };
    Overlay3.prototype.updateRenderedPosition = function(pixel, mapSize) {
      var style2 = this.element.style;
      var offset2 = this.getOffset();
      var positioning = this.getPositioning();
      this.setVisible(true);
      var x = Math.round(pixel[0] + offset2[0]) + "px";
      var y = Math.round(pixel[1] + offset2[1]) + "px";
      var posX = "0%";
      var posY = "0%";
      if (positioning == "bottom-right" || positioning == "center-right" || positioning == "top-right") {
        posX = "-100%";
      } else if (positioning == "bottom-center" || positioning == "center-center" || positioning == "top-center") {
        posX = "-50%";
      }
      if (positioning == "bottom-left" || positioning == "bottom-center" || positioning == "bottom-right") {
        posY = "-100%";
      } else if (positioning == "center-left" || positioning == "center-center" || positioning == "center-right") {
        posY = "-50%";
      }
      var transform3 = "translate(".concat(posX, ", ").concat(posY, ") translate(").concat(x, ", ").concat(y, ")");
      if (this.rendered.transform_ != transform3) {
        this.rendered.transform_ = transform3;
        style2.transform = transform3;
        style2.msTransform = transform3;
      }
    };
    Overlay3.prototype.getOptions = function() {
      return this.options;
    };
    return Overlay3;
  }(Object_default)
);
var Overlay_default = Overlay2;

// node_modules/ol/control.js
function defaults2(opt_options) {
  var options = opt_options ? opt_options : {};
  var controls = new Collection_default();
  var zoomControl = options.zoom !== void 0 ? options.zoom : true;
  if (zoomControl) {
    controls.push(new Zoom_default(options.zoomOptions));
  }
  var rotateControl = options.rotate !== void 0 ? options.rotate : true;
  if (rotateControl) {
    controls.push(new Rotate_default(options.rotateOptions));
  }
  var attributionControl = options.attribution !== void 0 ? options.attribution : true;
  if (attributionControl) {
    controls.push(new Attribution_default(options.attributionOptions));
  }
  return controls;
}

// node_modules/ol/interaction/Property.js
var Property_default2 = {
  ACTIVE: "active"
};

// node_modules/ol/interaction/Interaction.js
var __extends69 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Interaction = (
  /** @class */
  function(_super) {
    __extends69(Interaction2, _super);
    function Interaction2(opt_options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      if (opt_options && opt_options.handleEvent) {
        _this.handleEvent = opt_options.handleEvent;
      }
      _this.map_ = null;
      _this.setActive(true);
      return _this;
    }
    Interaction2.prototype.getActive = function() {
      return (
        /** @type {boolean} */
        this.get(Property_default2.ACTIVE)
      );
    };
    Interaction2.prototype.getMap = function() {
      return this.map_;
    };
    Interaction2.prototype.handleEvent = function(mapBrowserEvent) {
      return true;
    };
    Interaction2.prototype.setActive = function(active) {
      this.set(Property_default2.ACTIVE, active);
    };
    Interaction2.prototype.setMap = function(map2) {
      this.map_ = map2;
    };
    return Interaction2;
  }(Object_default)
);
function pan(view, delta, opt_duration) {
  var currentCenter = view.getCenterInternal();
  if (currentCenter) {
    var center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];
    view.animateInternal({
      duration: opt_duration !== void 0 ? opt_duration : 250,
      easing: linear,
      center: view.getConstrainedCenter(center)
    });
  }
}
function zoomByDelta(view, delta, opt_anchor, opt_duration) {
  var currentZoom = view.getZoom();
  if (currentZoom === void 0) {
    return;
  }
  var newZoom = view.getConstrainedZoom(currentZoom + delta);
  var newResolution = view.getResolutionForZoom(newZoom);
  if (view.getAnimating()) {
    view.cancelAnimations();
  }
  view.animate({
    resolution: newResolution,
    anchor: opt_anchor,
    duration: opt_duration !== void 0 ? opt_duration : 250,
    easing: easeOut
  });
}
var Interaction_default = Interaction;

// node_modules/ol/interaction/DoubleClickZoom.js
var __extends70 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DoubleClickZoom = (
  /** @class */
  function(_super) {
    __extends70(DoubleClickZoom2, _super);
    function DoubleClickZoom2(opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options ? opt_options : {};
      _this.delta_ = options.delta ? options.delta : 1;
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      return _this;
    }
    DoubleClickZoom2.prototype.handleEvent = function(mapBrowserEvent) {
      var stopEvent = false;
      if (mapBrowserEvent.type == MapBrowserEventType_default.DBLCLICK) {
        var browserEvent = (
          /** @type {MouseEvent} */
          mapBrowserEvent.originalEvent
        );
        var map2 = mapBrowserEvent.map;
        var anchor2 = mapBrowserEvent.coordinate;
        var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
        var view = map2.getView();
        zoomByDelta(view, delta, anchor2, this.duration_);
        browserEvent.preventDefault();
        stopEvent = true;
      }
      return !stopEvent;
    };
    return DoubleClickZoom2;
  }(Interaction_default)
);
var DoubleClickZoom_default = DoubleClickZoom;

// node_modules/ol/interaction/Pointer.js
var __extends71 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var PointerInteraction = (
  /** @class */
  function(_super) {
    __extends71(PointerInteraction2, _super);
    function PointerInteraction2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(
        this,
        /** @type {import("./Interaction.js").InteractionOptions} */
        options
      ) || this;
      if (options.handleDownEvent) {
        _this.handleDownEvent = options.handleDownEvent;
      }
      if (options.handleDragEvent) {
        _this.handleDragEvent = options.handleDragEvent;
      }
      if (options.handleMoveEvent) {
        _this.handleMoveEvent = options.handleMoveEvent;
      }
      if (options.handleUpEvent) {
        _this.handleUpEvent = options.handleUpEvent;
      }
      if (options.stopDown) {
        _this.stopDown = options.stopDown;
      }
      _this.handlingDownUpSequence = false;
      _this.targetPointers = [];
      return _this;
    }
    PointerInteraction2.prototype.getPointerCount = function() {
      return this.targetPointers.length;
    };
    PointerInteraction2.prototype.handleDownEvent = function(mapBrowserEvent) {
      return false;
    };
    PointerInteraction2.prototype.handleDragEvent = function(mapBrowserEvent) {
    };
    PointerInteraction2.prototype.handleEvent = function(mapBrowserEvent) {
      if (!mapBrowserEvent.originalEvent) {
        return true;
      }
      var stopEvent = false;
      this.updateTrackedPointers_(mapBrowserEvent);
      if (this.handlingDownUpSequence) {
        if (mapBrowserEvent.type == MapBrowserEventType_default.POINTERDRAG) {
          this.handleDragEvent(mapBrowserEvent);
          mapBrowserEvent.originalEvent.preventDefault();
        } else if (mapBrowserEvent.type == MapBrowserEventType_default.POINTERUP) {
          var handledUp = this.handleUpEvent(mapBrowserEvent);
          this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;
        }
      } else {
        if (mapBrowserEvent.type == MapBrowserEventType_default.POINTERDOWN) {
          var handled = this.handleDownEvent(mapBrowserEvent);
          this.handlingDownUpSequence = handled;
          stopEvent = this.stopDown(handled);
        } else if (mapBrowserEvent.type == MapBrowserEventType_default.POINTERMOVE) {
          this.handleMoveEvent(mapBrowserEvent);
        }
      }
      return !stopEvent;
    };
    PointerInteraction2.prototype.handleMoveEvent = function(mapBrowserEvent) {
    };
    PointerInteraction2.prototype.handleUpEvent = function(mapBrowserEvent) {
      return false;
    };
    PointerInteraction2.prototype.stopDown = function(handled) {
      return handled;
    };
    PointerInteraction2.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
      if (mapBrowserEvent.activePointers) {
        this.targetPointers = mapBrowserEvent.activePointers;
      }
    };
    return PointerInteraction2;
  }(Interaction_default)
);
function centroid(pointerEvents) {
  var length = pointerEvents.length;
  var clientX = 0;
  var clientY = 0;
  for (var i2 = 0; i2 < length; i2++) {
    clientX += pointerEvents[i2].clientX;
    clientY += pointerEvents[i2].clientY;
  }
  return [clientX / length, clientY / length];
}
var Pointer_default = PointerInteraction;

// node_modules/ol/events/condition.js
function all(var_args) {
  var conditions = arguments;
  return function(event) {
    var pass = true;
    for (var i2 = 0, ii = conditions.length; i2 < ii; ++i2) {
      pass = pass && conditions[i2](event);
      if (!pass) {
        break;
      }
    }
    return pass;
  };
}
var altKeyOnly = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    mapBrowserEvent.originalEvent
  );
  return originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey;
};
var altShiftKeysOnly = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    mapBrowserEvent.originalEvent
  );
  return originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey;
};
var focus = function(event) {
  var targetElement = event.map.getTargetElement();
  var activeElement = event.map.getOwnerDocument().activeElement;
  return targetElement.contains(activeElement);
};
var focusWithTabindex = function(event) {
  return event.map.getTargetElement().hasAttribute("tabindex") ? focus(event) : true;
};
var always = TRUE;
var click = function(mapBrowserEvent) {
  return mapBrowserEvent.type == MapBrowserEventType_default.CLICK;
};
var mouseActionButton = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {MouseEvent} */
    mapBrowserEvent.originalEvent
  );
  return originalEvent.button == 0 && !(WEBKIT && MAC && originalEvent.ctrlKey);
};
var never = FALSE;
var pointerMove = function(mapBrowserEvent) {
  return mapBrowserEvent.type == "pointermove";
};
var singleClick = function(mapBrowserEvent) {
  return mapBrowserEvent.type == MapBrowserEventType_default.SINGLECLICK;
};
var noModifierKeys = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    mapBrowserEvent.originalEvent
  );
  return !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey;
};
var shiftKeyOnly = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    mapBrowserEvent.originalEvent
  );
  return !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey;
};
var targetNotEditable = function(mapBrowserEvent) {
  var originalEvent = (
    /** @type {KeyboardEvent|MouseEvent|TouchEvent} */
    mapBrowserEvent.originalEvent
  );
  var tagName = (
    /** @type {Element} */
    originalEvent.target.tagName
  );
  return tagName !== "INPUT" && tagName !== "SELECT" && tagName !== "TEXTAREA" && // `isContentEditable` is only available on `HTMLElement`, but it may also be a
  // different type like `SVGElement`.
  // @ts-ignore
  !originalEvent.target.isContentEditable;
};
var mouseOnly = function(mapBrowserEvent) {
  var pointerEvent = (
    /** @type {import("../MapBrowserEvent").default} */
    mapBrowserEvent.originalEvent
  );
  assert(pointerEvent !== void 0, 56);
  return pointerEvent.pointerType == "mouse";
};
var primaryAction = function(mapBrowserEvent) {
  var pointerEvent = (
    /** @type {import("../MapBrowserEvent").default} */
    mapBrowserEvent.originalEvent
  );
  assert(pointerEvent !== void 0, 56);
  return pointerEvent.isPrimary && pointerEvent.button === 0;
};

// node_modules/ol/interaction/DragPan.js
var __extends72 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DragPan = (
  /** @class */
  function(_super) {
    __extends72(DragPan2, _super);
    function DragPan2(opt_options) {
      var _this = _super.call(this, {
        stopDown: FALSE
      }) || this;
      var options = opt_options ? opt_options : {};
      _this.kinetic_ = options.kinetic;
      _this.lastCentroid = null;
      _this.lastPointersCount_;
      _this.panning_ = false;
      var condition = options.condition ? options.condition : all(noModifierKeys, primaryAction);
      _this.condition_ = options.onFocusOnly ? all(focusWithTabindex, condition) : condition;
      _this.noKinetic_ = false;
      return _this;
    }
    DragPan2.prototype.handleDragEvent = function(mapBrowserEvent) {
      if (!this.panning_) {
        this.panning_ = true;
        this.getMap().getView().beginInteraction();
      }
      var targetPointers = this.targetPointers;
      var centroid2 = centroid(targetPointers);
      if (targetPointers.length == this.lastPointersCount_) {
        if (this.kinetic_) {
          this.kinetic_.update(centroid2[0], centroid2[1]);
        }
        if (this.lastCentroid) {
          var delta = [
            this.lastCentroid[0] - centroid2[0],
            centroid2[1] - this.lastCentroid[1]
          ];
          var map2 = mapBrowserEvent.map;
          var view = map2.getView();
          scale4(delta, view.getResolution());
          rotate3(delta, view.getRotation());
          view.adjustCenterInternal(delta);
        }
      } else if (this.kinetic_) {
        this.kinetic_.begin();
      }
      this.lastCentroid = centroid2;
      this.lastPointersCount_ = targetPointers.length;
      mapBrowserEvent.originalEvent.preventDefault();
    };
    DragPan2.prototype.handleUpEvent = function(mapBrowserEvent) {
      var map2 = mapBrowserEvent.map;
      var view = map2.getView();
      if (this.targetPointers.length === 0) {
        if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
          var distance2 = this.kinetic_.getDistance();
          var angle = this.kinetic_.getAngle();
          var center = view.getCenterInternal();
          var centerpx = map2.getPixelFromCoordinateInternal(center);
          var dest = map2.getCoordinateFromPixelInternal([
            centerpx[0] - distance2 * Math.cos(angle),
            centerpx[1] - distance2 * Math.sin(angle)
          ]);
          view.animateInternal({
            center: view.getConstrainedCenter(dest),
            duration: 500,
            easing: easeOut
          });
        }
        if (this.panning_) {
          this.panning_ = false;
          view.endInteraction();
        }
        return false;
      } else {
        if (this.kinetic_) {
          this.kinetic_.begin();
        }
        this.lastCentroid = null;
        return true;
      }
    };
    DragPan2.prototype.handleDownEvent = function(mapBrowserEvent) {
      if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {
        var map2 = mapBrowserEvent.map;
        var view = map2.getView();
        this.lastCentroid = null;
        if (view.getAnimating()) {
          view.cancelAnimations();
        }
        if (this.kinetic_) {
          this.kinetic_.begin();
        }
        this.noKinetic_ = this.targetPointers.length > 1;
        return true;
      } else {
        return false;
      }
    };
    return DragPan2;
  }(Pointer_default)
);
var DragPan_default = DragPan;

// node_modules/ol/interaction/DragRotate.js
var __extends73 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DragRotate = (
  /** @class */
  function(_super) {
    __extends73(DragRotate2, _super);
    function DragRotate2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(this, {
        stopDown: FALSE
      }) || this;
      _this.condition_ = options.condition ? options.condition : altShiftKeysOnly;
      _this.lastAngle_ = void 0;
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      return _this;
    }
    DragRotate2.prototype.handleDragEvent = function(mapBrowserEvent) {
      if (!mouseOnly(mapBrowserEvent)) {
        return;
      }
      var map2 = mapBrowserEvent.map;
      var view = map2.getView();
      if (view.getConstraints().rotation === disable) {
        return;
      }
      var size = map2.getSize();
      var offset2 = mapBrowserEvent.pixel;
      var theta = Math.atan2(size[1] / 2 - offset2[1], offset2[0] - size[0] / 2);
      if (this.lastAngle_ !== void 0) {
        var delta = theta - this.lastAngle_;
        view.adjustRotationInternal(-delta);
      }
      this.lastAngle_ = theta;
    };
    DragRotate2.prototype.handleUpEvent = function(mapBrowserEvent) {
      if (!mouseOnly(mapBrowserEvent)) {
        return true;
      }
      var map2 = mapBrowserEvent.map;
      var view = map2.getView();
      view.endInteraction(this.duration_);
      return false;
    };
    DragRotate2.prototype.handleDownEvent = function(mapBrowserEvent) {
      if (!mouseOnly(mapBrowserEvent)) {
        return false;
      }
      if (mouseActionButton(mapBrowserEvent) && this.condition_(mapBrowserEvent)) {
        var map2 = mapBrowserEvent.map;
        map2.getView().beginInteraction();
        this.lastAngle_ = void 0;
        return true;
      } else {
        return false;
      }
    };
    return DragRotate2;
  }(Pointer_default)
);
var DragRotate_default = DragRotate;

// node_modules/ol/render/Box.js
var __extends74 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var RenderBox = (
  /** @class */
  function(_super) {
    __extends74(RenderBox2, _super);
    function RenderBox2(className) {
      var _this = _super.call(this) || this;
      _this.geometry_ = null;
      _this.element_ = document.createElement("div");
      _this.element_.style.position = "absolute";
      _this.element_.style.pointerEvents = "auto";
      _this.element_.className = "ol-box " + className;
      _this.map_ = null;
      _this.startPixel_ = null;
      _this.endPixel_ = null;
      return _this;
    }
    RenderBox2.prototype.disposeInternal = function() {
      this.setMap(null);
    };
    RenderBox2.prototype.render_ = function() {
      var startPixel = this.startPixel_;
      var endPixel = this.endPixel_;
      var px = "px";
      var style2 = this.element_.style;
      style2.left = Math.min(startPixel[0], endPixel[0]) + px;
      style2.top = Math.min(startPixel[1], endPixel[1]) + px;
      style2.width = Math.abs(endPixel[0] - startPixel[0]) + px;
      style2.height = Math.abs(endPixel[1] - startPixel[1]) + px;
    };
    RenderBox2.prototype.setMap = function(map2) {
      if (this.map_) {
        this.map_.getOverlayContainer().removeChild(this.element_);
        var style2 = this.element_.style;
        style2.left = "inherit";
        style2.top = "inherit";
        style2.width = "inherit";
        style2.height = "inherit";
      }
      this.map_ = map2;
      if (this.map_) {
        this.map_.getOverlayContainer().appendChild(this.element_);
      }
    };
    RenderBox2.prototype.setPixels = function(startPixel, endPixel) {
      this.startPixel_ = startPixel;
      this.endPixel_ = endPixel;
      this.createOrUpdateGeometry();
      this.render_();
    };
    RenderBox2.prototype.createOrUpdateGeometry = function() {
      var startPixel = this.startPixel_;
      var endPixel = this.endPixel_;
      var pixels = [
        startPixel,
        [startPixel[0], endPixel[1]],
        endPixel,
        [endPixel[0], startPixel[1]]
      ];
      var coordinates2 = pixels.map(this.map_.getCoordinateFromPixelInternal, this.map_);
      coordinates2[4] = coordinates2[0].slice();
      if (!this.geometry_) {
        this.geometry_ = new Polygon_default([coordinates2]);
      } else {
        this.geometry_.setCoordinates([coordinates2]);
      }
    };
    RenderBox2.prototype.getGeometry = function() {
      return this.geometry_;
    };
    return RenderBox2;
  }(Disposable_default)
);
var Box_default = RenderBox;

// node_modules/ol/interaction/DragBox.js
var __extends75 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DragBoxEventType = {
  /**
   * Triggered upon drag box start.
   * @event DragBoxEvent#boxstart
   * @api
   */
  BOXSTART: "boxstart",
  /**
   * Triggered on drag when box is active.
   * @event DragBoxEvent#boxdrag
   * @api
   */
  BOXDRAG: "boxdrag",
  /**
   * Triggered upon drag box end.
   * @event DragBoxEvent#boxend
   * @api
   */
  BOXEND: "boxend",
  /**
   * Triggered upon drag box canceled.
   * @event DragBoxEvent#boxcancel
   * @api
   */
  BOXCANCEL: "boxcancel"
};
var DragBoxEvent = (
  /** @class */
  function(_super) {
    __extends75(DragBoxEvent2, _super);
    function DragBoxEvent2(type, coordinate, mapBrowserEvent) {
      var _this = _super.call(this, type) || this;
      _this.coordinate = coordinate;
      _this.mapBrowserEvent = mapBrowserEvent;
      return _this;
    }
    return DragBoxEvent2;
  }(Event_default)
);
var DragBox = (
  /** @class */
  function(_super) {
    __extends75(DragBox2, _super);
    function DragBox2(opt_options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      var options = opt_options ? opt_options : {};
      _this.box_ = new Box_default(options.className || "ol-dragbox");
      _this.minArea_ = options.minArea !== void 0 ? options.minArea : 64;
      if (options.onBoxEnd) {
        _this.onBoxEnd = options.onBoxEnd;
      }
      _this.startPixel_ = null;
      _this.condition_ = options.condition ? options.condition : mouseActionButton;
      _this.boxEndCondition_ = options.boxEndCondition ? options.boxEndCondition : _this.defaultBoxEndCondition;
      return _this;
    }
    DragBox2.prototype.defaultBoxEndCondition = function(mapBrowserEvent, startPixel, endPixel) {
      var width = endPixel[0] - startPixel[0];
      var height = endPixel[1] - startPixel[1];
      return width * width + height * height >= this.minArea_;
    };
    DragBox2.prototype.getGeometry = function() {
      return this.box_.getGeometry();
    };
    DragBox2.prototype.handleDragEvent = function(mapBrowserEvent) {
      this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);
      this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXDRAG, mapBrowserEvent.coordinate, mapBrowserEvent));
    };
    DragBox2.prototype.handleUpEvent = function(mapBrowserEvent) {
      this.box_.setMap(null);
      var completeBox = this.boxEndCondition_(mapBrowserEvent, this.startPixel_, mapBrowserEvent.pixel);
      if (completeBox) {
        this.onBoxEnd(mapBrowserEvent);
      }
      this.dispatchEvent(new DragBoxEvent(completeBox ? DragBoxEventType.BOXEND : DragBoxEventType.BOXCANCEL, mapBrowserEvent.coordinate, mapBrowserEvent));
      return false;
    };
    DragBox2.prototype.handleDownEvent = function(mapBrowserEvent) {
      if (this.condition_(mapBrowserEvent)) {
        this.startPixel_ = mapBrowserEvent.pixel;
        this.box_.setMap(mapBrowserEvent.map);
        this.box_.setPixels(this.startPixel_, this.startPixel_);
        this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXSTART, mapBrowserEvent.coordinate, mapBrowserEvent));
        return true;
      } else {
        return false;
      }
    };
    DragBox2.prototype.onBoxEnd = function(event) {
    };
    return DragBox2;
  }(Pointer_default)
);
var DragBox_default = DragBox;

// node_modules/ol/interaction/DragZoom.js
var __extends76 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DragZoom = (
  /** @class */
  function(_super) {
    __extends76(DragZoom2, _super);
    function DragZoom2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var condition = options.condition ? options.condition : shiftKeyOnly;
      _this = _super.call(this, {
        condition,
        className: options.className || "ol-dragzoom",
        minArea: options.minArea
      }) || this;
      _this.duration_ = options.duration !== void 0 ? options.duration : 200;
      _this.out_ = options.out !== void 0 ? options.out : false;
      return _this;
    }
    DragZoom2.prototype.onBoxEnd = function(event) {
      var map2 = this.getMap();
      var view = (
        /** @type {!import("../View.js").default} */
        map2.getView()
      );
      var geometry2 = this.getGeometry();
      if (this.out_) {
        var rotatedExtent = view.rotatedExtentForGeometry(geometry2);
        var resolution = view.getResolutionForExtentInternal(rotatedExtent);
        var factor = view.getResolution() / resolution;
        geometry2 = geometry2.clone();
        geometry2.scale(factor * factor);
      }
      view.fitInternal(geometry2, {
        duration: this.duration_,
        easing: easeOut
      });
    };
    return DragZoom2;
  }(DragBox_default)
);
var DragZoom_default = DragZoom;

// node_modules/ol/events/KeyCode.js
var KeyCode_default = {
  LEFT: 37,
  UP: 38,
  RIGHT: 39,
  DOWN: 40
};

// node_modules/ol/interaction/KeyboardPan.js
var __extends77 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var KeyboardPan = (
  /** @class */
  function(_super) {
    __extends77(KeyboardPan2, _super);
    function KeyboardPan2(opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options || {};
      _this.defaultCondition_ = function(mapBrowserEvent) {
        return noModifierKeys(mapBrowserEvent) && targetNotEditable(mapBrowserEvent);
      };
      _this.condition_ = options.condition !== void 0 ? options.condition : _this.defaultCondition_;
      _this.duration_ = options.duration !== void 0 ? options.duration : 100;
      _this.pixelDelta_ = options.pixelDelta !== void 0 ? options.pixelDelta : 128;
      return _this;
    }
    KeyboardPan2.prototype.handleEvent = function(mapBrowserEvent) {
      var stopEvent = false;
      if (mapBrowserEvent.type == EventType_default.KEYDOWN) {
        var keyEvent = (
          /** @type {KeyboardEvent} */
          mapBrowserEvent.originalEvent
        );
        var keyCode = keyEvent.keyCode;
        if (this.condition_(mapBrowserEvent) && (keyCode == KeyCode_default.DOWN || keyCode == KeyCode_default.LEFT || keyCode == KeyCode_default.RIGHT || keyCode == KeyCode_default.UP)) {
          var map2 = mapBrowserEvent.map;
          var view = map2.getView();
          var mapUnitsDelta = view.getResolution() * this.pixelDelta_;
          var deltaX = 0, deltaY = 0;
          if (keyCode == KeyCode_default.DOWN) {
            deltaY = -mapUnitsDelta;
          } else if (keyCode == KeyCode_default.LEFT) {
            deltaX = -mapUnitsDelta;
          } else if (keyCode == KeyCode_default.RIGHT) {
            deltaX = mapUnitsDelta;
          } else {
            deltaY = mapUnitsDelta;
          }
          var delta = [deltaX, deltaY];
          rotate3(delta, view.getRotation());
          pan(view, delta, this.duration_);
          keyEvent.preventDefault();
          stopEvent = true;
        }
      }
      return !stopEvent;
    };
    return KeyboardPan2;
  }(Interaction_default)
);
var KeyboardPan_default = KeyboardPan;

// node_modules/ol/interaction/KeyboardZoom.js
var __extends78 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var KeyboardZoom = (
  /** @class */
  function(_super) {
    __extends78(KeyboardZoom2, _super);
    function KeyboardZoom2(opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options ? opt_options : {};
      _this.condition_ = options.condition ? options.condition : targetNotEditable;
      _this.delta_ = options.delta ? options.delta : 1;
      _this.duration_ = options.duration !== void 0 ? options.duration : 100;
      return _this;
    }
    KeyboardZoom2.prototype.handleEvent = function(mapBrowserEvent) {
      var stopEvent = false;
      if (mapBrowserEvent.type == EventType_default.KEYDOWN || mapBrowserEvent.type == EventType_default.KEYPRESS) {
        var keyEvent = (
          /** @type {KeyboardEvent} */
          mapBrowserEvent.originalEvent
        );
        var charCode = keyEvent.charCode;
        if (this.condition_(mapBrowserEvent) && (charCode == "+".charCodeAt(0) || charCode == "-".charCodeAt(0))) {
          var map2 = mapBrowserEvent.map;
          var delta = charCode == "+".charCodeAt(0) ? this.delta_ : -this.delta_;
          var view = map2.getView();
          zoomByDelta(view, delta, void 0, this.duration_);
          keyEvent.preventDefault();
          stopEvent = true;
        }
      }
      return !stopEvent;
    };
    return KeyboardZoom2;
  }(Interaction_default)
);
var KeyboardZoom_default = KeyboardZoom;

// node_modules/ol/Kinetic.js
var Kinetic = (
  /** @class */
  function() {
    function Kinetic2(decay, minVelocity, delay2) {
      this.decay_ = decay;
      this.minVelocity_ = minVelocity;
      this.delay_ = delay2;
      this.points_ = [];
      this.angle_ = 0;
      this.initialVelocity_ = 0;
    }
    Kinetic2.prototype.begin = function() {
      this.points_.length = 0;
      this.angle_ = 0;
      this.initialVelocity_ = 0;
    };
    Kinetic2.prototype.update = function(x, y) {
      this.points_.push(x, y, Date.now());
    };
    Kinetic2.prototype.end = function() {
      if (this.points_.length < 6) {
        return false;
      }
      var delay2 = Date.now() - this.delay_;
      var lastIndex = this.points_.length - 3;
      if (this.points_[lastIndex + 2] < delay2) {
        return false;
      }
      var firstIndex = lastIndex - 3;
      while (firstIndex > 0 && this.points_[firstIndex + 2] > delay2) {
        firstIndex -= 3;
      }
      var duration = this.points_[lastIndex + 2] - this.points_[firstIndex + 2];
      if (duration < 1e3 / 60) {
        return false;
      }
      var dx = this.points_[lastIndex] - this.points_[firstIndex];
      var dy = this.points_[lastIndex + 1] - this.points_[firstIndex + 1];
      this.angle_ = Math.atan2(dy, dx);
      this.initialVelocity_ = Math.sqrt(dx * dx + dy * dy) / duration;
      return this.initialVelocity_ > this.minVelocity_;
    };
    Kinetic2.prototype.getDistance = function() {
      return (this.minVelocity_ - this.initialVelocity_) / this.decay_;
    };
    Kinetic2.prototype.getAngle = function() {
      return this.angle_;
    };
    return Kinetic2;
  }()
);
var Kinetic_default = Kinetic;

// node_modules/ol/interaction/MouseWheelZoom.js
var __extends79 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Mode = {
  TRACKPAD: "trackpad",
  WHEEL: "wheel"
};
var MouseWheelZoom = (
  /** @class */
  function(_super) {
    __extends79(MouseWheelZoom2, _super);
    function MouseWheelZoom2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      _this = _super.call(
        this,
        /** @type {import("./Interaction.js").InteractionOptions} */
        options
      ) || this;
      _this.totalDelta_ = 0;
      _this.lastDelta_ = 0;
      _this.maxDelta_ = options.maxDelta !== void 0 ? options.maxDelta : 1;
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      _this.timeout_ = options.timeout !== void 0 ? options.timeout : 80;
      _this.useAnchor_ = options.useAnchor !== void 0 ? options.useAnchor : true;
      _this.constrainResolution_ = options.constrainResolution !== void 0 ? options.constrainResolution : false;
      var condition = options.condition ? options.condition : always;
      _this.condition_ = options.onFocusOnly ? all(focusWithTabindex, condition) : condition;
      _this.lastAnchor_ = null;
      _this.startTime_ = void 0;
      _this.timeoutId_;
      _this.mode_ = void 0;
      _this.trackpadEventGap_ = 400;
      _this.trackpadTimeoutId_;
      _this.deltaPerZoom_ = 300;
      return _this;
    }
    MouseWheelZoom2.prototype.endInteraction_ = function() {
      this.trackpadTimeoutId_ = void 0;
      var map2 = this.getMap();
      if (!map2) {
        return;
      }
      var view = map2.getView();
      view.endInteraction(void 0, this.lastDelta_ ? this.lastDelta_ > 0 ? 1 : -1 : 0, this.lastAnchor_);
    };
    MouseWheelZoom2.prototype.handleEvent = function(mapBrowserEvent) {
      if (!this.condition_(mapBrowserEvent)) {
        return true;
      }
      var type = mapBrowserEvent.type;
      if (type !== EventType_default.WHEEL) {
        return true;
      }
      var map2 = mapBrowserEvent.map;
      var wheelEvent = (
        /** @type {WheelEvent} */
        mapBrowserEvent.originalEvent
      );
      wheelEvent.preventDefault();
      if (this.useAnchor_) {
        this.lastAnchor_ = mapBrowserEvent.coordinate;
      }
      var delta;
      if (mapBrowserEvent.type == EventType_default.WHEEL) {
        delta = wheelEvent.deltaY;
        if (FIREFOX && wheelEvent.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {
          delta /= DEVICE_PIXEL_RATIO;
        }
        if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {
          delta *= 40;
        }
      }
      if (delta === 0) {
        return false;
      } else {
        this.lastDelta_ = delta;
      }
      var now = Date.now();
      if (this.startTime_ === void 0) {
        this.startTime_ = now;
      }
      if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {
        this.mode_ = Math.abs(delta) < 4 ? Mode.TRACKPAD : Mode.WHEEL;
      }
      var view = map2.getView();
      if (this.mode_ === Mode.TRACKPAD && !(view.getConstrainResolution() || this.constrainResolution_)) {
        if (this.trackpadTimeoutId_) {
          clearTimeout(this.trackpadTimeoutId_);
        } else {
          if (view.getAnimating()) {
            view.cancelAnimations();
          }
          view.beginInteraction();
        }
        this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.timeout_);
        view.adjustZoom(-delta / this.deltaPerZoom_, this.lastAnchor_);
        this.startTime_ = now;
        return false;
      }
      this.totalDelta_ += delta;
      var timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0);
      clearTimeout(this.timeoutId_);
      this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map2), timeLeft);
      return false;
    };
    MouseWheelZoom2.prototype.handleWheelZoom_ = function(map2) {
      var view = map2.getView();
      if (view.getAnimating()) {
        view.cancelAnimations();
      }
      var delta = -clamp(this.totalDelta_, -this.maxDelta_ * this.deltaPerZoom_, this.maxDelta_ * this.deltaPerZoom_) / this.deltaPerZoom_;
      if (view.getConstrainResolution() || this.constrainResolution_) {
        delta = delta ? delta > 0 ? 1 : -1 : 0;
      }
      zoomByDelta(view, delta, this.lastAnchor_, this.duration_);
      this.mode_ = void 0;
      this.totalDelta_ = 0;
      this.lastAnchor_ = null;
      this.startTime_ = void 0;
      this.timeoutId_ = void 0;
    };
    MouseWheelZoom2.prototype.setMouseAnchor = function(useAnchor) {
      this.useAnchor_ = useAnchor;
      if (!useAnchor) {
        this.lastAnchor_ = null;
      }
    };
    return MouseWheelZoom2;
  }(Interaction_default)
);
var MouseWheelZoom_default = MouseWheelZoom;

// node_modules/ol/interaction/PinchRotate.js
var __extends80 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var PinchRotate = (
  /** @class */
  function(_super) {
    __extends80(PinchRotate2, _super);
    function PinchRotate2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var pointerOptions = (
        /** @type {import("./Pointer.js").Options} */
        options
      );
      if (!pointerOptions.stopDown) {
        pointerOptions.stopDown = FALSE;
      }
      _this = _super.call(this, pointerOptions) || this;
      _this.anchor_ = null;
      _this.lastAngle_ = void 0;
      _this.rotating_ = false;
      _this.rotationDelta_ = 0;
      _this.threshold_ = options.threshold !== void 0 ? options.threshold : 0.3;
      _this.duration_ = options.duration !== void 0 ? options.duration : 250;
      return _this;
    }
    PinchRotate2.prototype.handleDragEvent = function(mapBrowserEvent) {
      var rotationDelta = 0;
      var touch0 = this.targetPointers[0];
      var touch1 = this.targetPointers[1];
      var angle = Math.atan2(touch1.clientY - touch0.clientY, touch1.clientX - touch0.clientX);
      if (this.lastAngle_ !== void 0) {
        var delta = angle - this.lastAngle_;
        this.rotationDelta_ += delta;
        if (!this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_) {
          this.rotating_ = true;
        }
        rotationDelta = delta;
      }
      this.lastAngle_ = angle;
      var map2 = mapBrowserEvent.map;
      var view = map2.getView();
      if (view.getConstraints().rotation === disable) {
        return;
      }
      var viewportPosition = map2.getViewport().getBoundingClientRect();
      var centroid2 = centroid(this.targetPointers);
      centroid2[0] -= viewportPosition.left;
      centroid2[1] -= viewportPosition.top;
      this.anchor_ = map2.getCoordinateFromPixelInternal(centroid2);
      if (this.rotating_) {
        map2.render();
        view.adjustRotationInternal(rotationDelta, this.anchor_);
      }
    };
    PinchRotate2.prototype.handleUpEvent = function(mapBrowserEvent) {
      if (this.targetPointers.length < 2) {
        var map2 = mapBrowserEvent.map;
        var view = map2.getView();
        view.endInteraction(this.duration_);
        return false;
      } else {
        return true;
      }
    };
    PinchRotate2.prototype.handleDownEvent = function(mapBrowserEvent) {
      if (this.targetPointers.length >= 2) {
        var map2 = mapBrowserEvent.map;
        this.anchor_ = null;
        this.lastAngle_ = void 0;
        this.rotating_ = false;
        this.rotationDelta_ = 0;
        if (!this.handlingDownUpSequence) {
          map2.getView().beginInteraction();
        }
        return true;
      } else {
        return false;
      }
    };
    return PinchRotate2;
  }(Pointer_default)
);
var PinchRotate_default = PinchRotate;

// node_modules/ol/interaction/PinchZoom.js
var __extends81 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var PinchZoom = (
  /** @class */
  function(_super) {
    __extends81(PinchZoom2, _super);
    function PinchZoom2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var pointerOptions = (
        /** @type {import("./Pointer.js").Options} */
        options
      );
      if (!pointerOptions.stopDown) {
        pointerOptions.stopDown = FALSE;
      }
      _this = _super.call(this, pointerOptions) || this;
      _this.anchor_ = null;
      _this.duration_ = options.duration !== void 0 ? options.duration : 400;
      _this.lastDistance_ = void 0;
      _this.lastScaleDelta_ = 1;
      return _this;
    }
    PinchZoom2.prototype.handleDragEvent = function(mapBrowserEvent) {
      var scaleDelta = 1;
      var touch0 = this.targetPointers[0];
      var touch1 = this.targetPointers[1];
      var dx = touch0.clientX - touch1.clientX;
      var dy = touch0.clientY - touch1.clientY;
      var distance2 = Math.sqrt(dx * dx + dy * dy);
      if (this.lastDistance_ !== void 0) {
        scaleDelta = this.lastDistance_ / distance2;
      }
      this.lastDistance_ = distance2;
      var map2 = mapBrowserEvent.map;
      var view = map2.getView();
      if (scaleDelta != 1) {
        this.lastScaleDelta_ = scaleDelta;
      }
      var viewportPosition = map2.getViewport().getBoundingClientRect();
      var centroid2 = centroid(this.targetPointers);
      centroid2[0] -= viewportPosition.left;
      centroid2[1] -= viewportPosition.top;
      this.anchor_ = map2.getCoordinateFromPixelInternal(centroid2);
      map2.render();
      view.adjustResolutionInternal(scaleDelta, this.anchor_);
    };
    PinchZoom2.prototype.handleUpEvent = function(mapBrowserEvent) {
      if (this.targetPointers.length < 2) {
        var map2 = mapBrowserEvent.map;
        var view = map2.getView();
        var direction = this.lastScaleDelta_ > 1 ? 1 : -1;
        view.endInteraction(this.duration_, direction);
        return false;
      } else {
        return true;
      }
    };
    PinchZoom2.prototype.handleDownEvent = function(mapBrowserEvent) {
      if (this.targetPointers.length >= 2) {
        var map2 = mapBrowserEvent.map;
        this.anchor_ = null;
        this.lastDistance_ = void 0;
        this.lastScaleDelta_ = 1;
        if (!this.handlingDownUpSequence) {
          map2.getView().beginInteraction();
        }
        return true;
      } else {
        return false;
      }
    };
    return PinchZoom2;
  }(Pointer_default)
);
var PinchZoom_default = PinchZoom;

// node_modules/ol/renderer/canvas/VectorLayer.js
var __extends82 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CanvasVectorLayerRenderer = (
  /** @class */
  function(_super) {
    __extends82(CanvasVectorLayerRenderer2, _super);
    function CanvasVectorLayerRenderer2(vectorLayer) {
      var _this = _super.call(this, vectorLayer) || this;
      _this.boundHandleStyleImageChange_ = _this.handleStyleImageChange_.bind(_this);
      _this.animatingOrInteracting_;
      _this.hitDetectionImageData_ = null;
      _this.renderedFeatures_ = null;
      _this.renderedRevision_ = -1;
      _this.renderedResolution_ = NaN;
      _this.renderedExtent_ = createEmpty();
      _this.wrappedRenderedExtent_ = createEmpty();
      _this.renderedRotation_;
      _this.renderedCenter_ = null;
      _this.renderedProjection_ = null;
      _this.renderedRenderOrder_ = null;
      _this.replayGroup_ = null;
      _this.replayGroupChanged = true;
      _this.declutterExecutorGroup = null;
      _this.clipping = true;
      _this.compositionContext_ = null;
      _this.opacity_ = 1;
      return _this;
    }
    CanvasVectorLayerRenderer2.prototype.renderWorlds = function(executorGroup, frameState, opt_declutterTree) {
      var extent = frameState.extent;
      var viewState = frameState.viewState;
      var center = viewState.center;
      var resolution = viewState.resolution;
      var projection = viewState.projection;
      var rotation = viewState.rotation;
      var projectionExtent = projection.getExtent();
      var vectorSource = this.getLayer().getSource();
      var pixelRatio = frameState.pixelRatio;
      var viewHints = frameState.viewHints;
      var snapToPixel = !(viewHints[ViewHint_default.ANIMATING] || viewHints[ViewHint_default.INTERACTING]);
      var context2 = this.compositionContext_;
      var width = Math.round(frameState.size[0] * pixelRatio);
      var height = Math.round(frameState.size[1] * pixelRatio);
      var multiWorld = vectorSource.getWrapX() && projection.canWrapX();
      var worldWidth = multiWorld ? getWidth(projectionExtent) : null;
      var endWorld = multiWorld ? Math.ceil((extent[2] - projectionExtent[2]) / worldWidth) + 1 : 1;
      var world = multiWorld ? Math.floor((extent[0] - projectionExtent[0]) / worldWidth) : 0;
      do {
        var transform3 = this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, world * worldWidth);
        executorGroup.execute(context2, 1, transform3, rotation, snapToPixel, void 0, opt_declutterTree);
      } while (++world < endWorld);
    };
    CanvasVectorLayerRenderer2.prototype.setupCompositionContext_ = function() {
      if (this.opacity_ !== 1) {
        var compositionContext = createCanvasContext2D(this.context.canvas.width, this.context.canvas.height, canvasPool);
        this.compositionContext_ = compositionContext;
      } else {
        this.compositionContext_ = this.context;
      }
    };
    CanvasVectorLayerRenderer2.prototype.releaseCompositionContext_ = function() {
      if (this.opacity_ !== 1) {
        var alpha = this.context.globalAlpha;
        this.context.globalAlpha = this.opacity_;
        this.context.drawImage(this.compositionContext_.canvas, 0, 0);
        this.context.globalAlpha = alpha;
        releaseCanvas(this.compositionContext_);
        canvasPool.push(this.compositionContext_.canvas);
        this.compositionContext_ = null;
      }
    };
    CanvasVectorLayerRenderer2.prototype.renderDeclutter = function(frameState) {
      if (this.declutterExecutorGroup) {
        this.setupCompositionContext_();
        this.renderWorlds(this.declutterExecutorGroup, frameState, frameState.declutterTree);
        this.releaseCompositionContext_();
      }
    };
    CanvasVectorLayerRenderer2.prototype.renderFrame = function(frameState, target) {
      var pixelRatio = frameState.pixelRatio;
      var layerState = frameState.layerStatesArray[frameState.layerIndex];
      makeScale(this.pixelTransform, 1 / pixelRatio, 1 / pixelRatio);
      makeInverse(this.inversePixelTransform, this.pixelTransform);
      var canvasTransform = toString2(this.pixelTransform);
      this.useContainer(target, canvasTransform, this.getBackground(frameState));
      var context2 = this.context;
      var canvas = context2.canvas;
      var replayGroup = this.replayGroup_;
      var declutterExecutorGroup = this.declutterExecutorGroup;
      if ((!replayGroup || replayGroup.isEmpty()) && (!declutterExecutorGroup || declutterExecutorGroup.isEmpty())) {
        return null;
      }
      var width = Math.round(frameState.size[0] * pixelRatio);
      var height = Math.round(frameState.size[1] * pixelRatio);
      if (canvas.width != width || canvas.height != height) {
        canvas.width = width;
        canvas.height = height;
        if (canvas.style.transform !== canvasTransform) {
          canvas.style.transform = canvasTransform;
        }
      } else if (!this.containerReused) {
        context2.clearRect(0, 0, width, height);
      }
      this.preRender(context2, frameState);
      var viewState = frameState.viewState;
      var projection = viewState.projection;
      this.opacity_ = layerState.opacity;
      this.setupCompositionContext_();
      var clipped = false;
      var render2 = true;
      if (layerState.extent && this.clipping) {
        var layerExtent = fromUserExtent(layerState.extent, projection);
        render2 = intersects(layerExtent, frameState.extent);
        clipped = render2 && !containsExtent(layerExtent, frameState.extent);
        if (clipped) {
          this.clipUnrotated(this.compositionContext_, frameState, layerExtent);
        }
      }
      if (render2) {
        this.renderWorlds(replayGroup, frameState);
      }
      if (clipped) {
        this.compositionContext_.restore();
      }
      this.releaseCompositionContext_();
      this.postRender(context2, frameState);
      if (this.renderedRotation_ !== viewState.rotation) {
        this.renderedRotation_ = viewState.rotation;
        this.hitDetectionImageData_ = null;
      }
      return this.container;
    };
    CanvasVectorLayerRenderer2.prototype.getFeatures = function(pixel) {
      return new Promise(
        /**
         * @param {function(Array<import("../../Feature").default|import("../../render/Feature").default>): void} resolve Resolver function.
         * @this {CanvasVectorLayerRenderer}
         */
        (function(resolve) {
          if (!this.hitDetectionImageData_ && !this.animatingOrInteracting_) {
            var size = [this.context.canvas.width, this.context.canvas.height];
            apply(this.pixelTransform, size);
            var center = this.renderedCenter_;
            var resolution = this.renderedResolution_;
            var rotation = this.renderedRotation_;
            var projection = this.renderedProjection_;
            var extent = this.wrappedRenderedExtent_;
            var layer = this.getLayer();
            var transforms2 = [];
            var width = size[0] * HIT_DETECT_RESOLUTION;
            var height = size[1] * HIT_DETECT_RESOLUTION;
            transforms2.push(this.getRenderTransform(center, resolution, rotation, HIT_DETECT_RESOLUTION, width, height, 0).slice());
            var source = layer.getSource();
            var projectionExtent = projection.getExtent();
            if (source.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, extent)) {
              var startX = extent[0];
              var worldWidth = getWidth(projectionExtent);
              var world = 0;
              var offsetX = void 0;
              while (startX < projectionExtent[0]) {
                --world;
                offsetX = worldWidth * world;
                transforms2.push(this.getRenderTransform(center, resolution, rotation, HIT_DETECT_RESOLUTION, width, height, offsetX).slice());
                startX += worldWidth;
              }
              world = 0;
              startX = extent[2];
              while (startX > projectionExtent[2]) {
                ++world;
                offsetX = worldWidth * world;
                transforms2.push(this.getRenderTransform(center, resolution, rotation, HIT_DETECT_RESOLUTION, width, height, offsetX).slice());
                startX -= worldWidth;
              }
            }
            this.hitDetectionImageData_ = createHitDetectionImageData(size, transforms2, this.renderedFeatures_, layer.getStyleFunction(), extent, resolution, rotation);
          }
          resolve(hitDetect(pixel, this.renderedFeatures_, this.hitDetectionImageData_));
        }).bind(this)
      );
    };
    CanvasVectorLayerRenderer2.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, matches) {
      var _this = this;
      if (!this.replayGroup_) {
        return void 0;
      }
      var resolution = frameState.viewState.resolution;
      var rotation = frameState.viewState.rotation;
      var layer = this.getLayer();
      var features = {};
      var featureCallback = function(feature, geometry2, distanceSq) {
        var key = getUid(feature);
        var match2 = features[key];
        if (!match2) {
          if (distanceSq === 0) {
            features[key] = true;
            return callback(feature, layer, geometry2);
          }
          matches.push(features[key] = {
            feature,
            layer,
            geometry: geometry2,
            distanceSq,
            callback
          });
        } else if (match2 !== true && distanceSq < match2.distanceSq) {
          if (distanceSq === 0) {
            features[key] = true;
            matches.splice(matches.lastIndexOf(match2), 1);
            return callback(feature, layer, geometry2);
          }
          match2.geometry = geometry2;
          match2.distanceSq = distanceSq;
        }
        return void 0;
      };
      var result;
      var executorGroups = [this.replayGroup_];
      if (this.declutterExecutorGroup) {
        executorGroups.push(this.declutterExecutorGroup);
      }
      executorGroups.some(function(executorGroup) {
        return result = executorGroup.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, featureCallback, executorGroup === _this.declutterExecutorGroup && frameState.declutterTree ? frameState.declutterTree.all().map(function(item) {
          return item.value;
        }) : null);
      });
      return result;
    };
    CanvasVectorLayerRenderer2.prototype.handleFontsChanged = function() {
      var layer = this.getLayer();
      if (layer.getVisible() && this.replayGroup_) {
        layer.changed();
      }
    };
    CanvasVectorLayerRenderer2.prototype.handleStyleImageChange_ = function(event) {
      this.renderIfReadyAndVisible();
    };
    CanvasVectorLayerRenderer2.prototype.prepareFrame = function(frameState) {
      var vectorLayer = this.getLayer();
      var vectorSource = vectorLayer.getSource();
      if (!vectorSource) {
        return false;
      }
      var animating = frameState.viewHints[ViewHint_default.ANIMATING];
      var interacting = frameState.viewHints[ViewHint_default.INTERACTING];
      var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();
      var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();
      if (this.ready && !updateWhileAnimating && animating || !updateWhileInteracting && interacting) {
        this.animatingOrInteracting_ = true;
        return true;
      }
      this.animatingOrInteracting_ = false;
      var frameStateExtent = frameState.extent;
      var viewState = frameState.viewState;
      var projection = viewState.projection;
      var resolution = viewState.resolution;
      var pixelRatio = frameState.pixelRatio;
      var vectorLayerRevision = vectorLayer.getRevision();
      var vectorLayerRenderBuffer = vectorLayer.getRenderBuffer();
      var vectorLayerRenderOrder = vectorLayer.getRenderOrder();
      if (vectorLayerRenderOrder === void 0) {
        vectorLayerRenderOrder = defaultOrder;
      }
      var center = viewState.center.slice();
      var extent = buffer2(frameStateExtent, vectorLayerRenderBuffer * resolution);
      var renderedExtent = extent.slice();
      var loadExtents = [extent.slice()];
      var projectionExtent = projection.getExtent();
      if (vectorSource.getWrapX() && projection.canWrapX() && !containsExtent(projectionExtent, frameState.extent)) {
        var worldWidth = getWidth(projectionExtent);
        var gutter = Math.max(getWidth(extent) / 2, worldWidth);
        extent[0] = projectionExtent[0] - gutter;
        extent[2] = projectionExtent[2] + gutter;
        wrapX2(center, projection);
        var loadExtent = wrapX(loadExtents[0], projection);
        if (loadExtent[0] < projectionExtent[0] && loadExtent[2] < projectionExtent[2]) {
          loadExtents.push([
            loadExtent[0] + worldWidth,
            loadExtent[1],
            loadExtent[2] + worldWidth,
            loadExtent[3]
          ]);
        } else if (loadExtent[0] > projectionExtent[0] && loadExtent[2] > projectionExtent[2]) {
          loadExtents.push([
            loadExtent[0] - worldWidth,
            loadExtent[1],
            loadExtent[2] - worldWidth,
            loadExtent[3]
          ]);
        }
      }
      if (this.ready && this.renderedResolution_ == resolution && this.renderedRevision_ == vectorLayerRevision && this.renderedRenderOrder_ == vectorLayerRenderOrder && containsExtent(this.wrappedRenderedExtent_, extent)) {
        if (!equals(this.renderedExtent_, renderedExtent)) {
          this.hitDetectionImageData_ = null;
          this.renderedExtent_ = renderedExtent;
        }
        this.renderedCenter_ = center;
        this.replayGroupChanged = false;
        return true;
      }
      this.replayGroup_ = null;
      var replayGroup = new BuilderGroup_default(getTolerance(resolution, pixelRatio), extent, resolution, pixelRatio);
      var declutterBuilderGroup;
      if (this.getLayer().getDeclutter()) {
        declutterBuilderGroup = new BuilderGroup_default(getTolerance(resolution, pixelRatio), extent, resolution, pixelRatio);
      }
      var userProjection2 = getUserProjection();
      var userTransform;
      if (userProjection2) {
        for (var i2 = 0, ii = loadExtents.length; i2 < ii; ++i2) {
          var extent_1 = loadExtents[i2];
          var userExtent_1 = toUserExtent(extent_1, projection);
          vectorSource.loadFeatures(userExtent_1, toUserResolution(resolution, projection), userProjection2);
        }
        userTransform = getTransformFromProjections(userProjection2, projection);
      } else {
        for (var i2 = 0, ii = loadExtents.length; i2 < ii; ++i2) {
          vectorSource.loadFeatures(loadExtents[i2], resolution, projection);
        }
      }
      var squaredTolerance = getSquaredTolerance(resolution, pixelRatio);
      var ready = true;
      var render2 = (
        /**
         * @param {import("../../Feature.js").default} feature Feature.
         * @this {CanvasVectorLayerRenderer}
         */
        (function(feature) {
          var styles;
          var styleFunction = feature.getStyleFunction() || vectorLayer.getStyleFunction();
          if (styleFunction) {
            styles = styleFunction(feature, resolution);
          }
          if (styles) {
            var dirty = this.renderFeature(feature, squaredTolerance, styles, replayGroup, userTransform, declutterBuilderGroup);
            ready = ready && !dirty;
          }
        }).bind(this)
      );
      var userExtent = toUserExtent(extent, projection);
      var features = vectorSource.getFeaturesInExtent(userExtent);
      if (vectorLayerRenderOrder) {
        features.sort(vectorLayerRenderOrder);
      }
      for (var i2 = 0, ii = features.length; i2 < ii; ++i2) {
        render2(features[i2]);
      }
      this.renderedFeatures_ = features;
      this.ready = ready;
      var replayGroupInstructions = replayGroup.finish();
      var executorGroup = new ExecutorGroup_default(extent, resolution, pixelRatio, vectorSource.getOverlaps(), replayGroupInstructions, vectorLayer.getRenderBuffer());
      if (declutterBuilderGroup) {
        this.declutterExecutorGroup = new ExecutorGroup_default(extent, resolution, pixelRatio, vectorSource.getOverlaps(), declutterBuilderGroup.finish(), vectorLayer.getRenderBuffer());
      }
      this.renderedResolution_ = resolution;
      this.renderedRevision_ = vectorLayerRevision;
      this.renderedRenderOrder_ = vectorLayerRenderOrder;
      this.renderedExtent_ = renderedExtent;
      this.wrappedRenderedExtent_ = extent;
      this.renderedCenter_ = center;
      this.renderedProjection_ = projection;
      this.replayGroup_ = executorGroup;
      this.hitDetectionImageData_ = null;
      this.replayGroupChanged = true;
      return true;
    };
    CanvasVectorLayerRenderer2.prototype.renderFeature = function(feature, squaredTolerance, styles, builderGroup, opt_transform, opt_declutterBuilderGroup) {
      if (!styles) {
        return false;
      }
      var loading = false;
      if (Array.isArray(styles)) {
        for (var i2 = 0, ii = styles.length; i2 < ii; ++i2) {
          loading = renderFeature(builderGroup, feature, styles[i2], squaredTolerance, this.boundHandleStyleImageChange_, opt_transform, opt_declutterBuilderGroup) || loading;
        }
      } else {
        loading = renderFeature(builderGroup, feature, styles, squaredTolerance, this.boundHandleStyleImageChange_, opt_transform, opt_declutterBuilderGroup);
      }
      return loading;
    };
    return CanvasVectorLayerRenderer2;
  }(Layer_default3)
);
var VectorLayer_default = CanvasVectorLayerRenderer;

// node_modules/ol/layer/Vector.js
var __extends83 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var VectorLayer = (
  /** @class */
  function(_super) {
    __extends83(VectorLayer2, _super);
    function VectorLayer2(opt_options) {
      return _super.call(this, opt_options) || this;
    }
    VectorLayer2.prototype.createRenderer = function() {
      return new VectorLayer_default(this);
    };
    return VectorLayer2;
  }(BaseVector_default)
);
var Vector_default = VectorLayer;

// node_modules/ol/structs/RBush.js
var import_rbush2 = __toESM(require_rbush_min(), 1);
var RBush2 = (
  /** @class */
  function() {
    function RBush3(opt_maxEntries) {
      this.rbush_ = new import_rbush2.default(opt_maxEntries);
      this.items_ = {};
    }
    RBush3.prototype.insert = function(extent, value) {
      var item = {
        minX: extent[0],
        minY: extent[1],
        maxX: extent[2],
        maxY: extent[3],
        value
      };
      this.rbush_.insert(item);
      this.items_[getUid(value)] = item;
    };
    RBush3.prototype.load = function(extents, values) {
      var items = new Array(values.length);
      for (var i2 = 0, l = values.length; i2 < l; i2++) {
        var extent = extents[i2];
        var value = values[i2];
        var item = {
          minX: extent[0],
          minY: extent[1],
          maxX: extent[2],
          maxY: extent[3],
          value
        };
        items[i2] = item;
        this.items_[getUid(value)] = item;
      }
      this.rbush_.load(items);
    };
    RBush3.prototype.remove = function(value) {
      var uid = getUid(value);
      var item = this.items_[uid];
      delete this.items_[uid];
      return this.rbush_.remove(item) !== null;
    };
    RBush3.prototype.update = function(extent, value) {
      var item = this.items_[getUid(value)];
      var bbox = [item.minX, item.minY, item.maxX, item.maxY];
      if (!equals2(bbox, extent)) {
        this.remove(value);
        this.insert(extent, value);
      }
    };
    RBush3.prototype.getAll = function() {
      var items = this.rbush_.all();
      return items.map(function(item) {
        return item.value;
      });
    };
    RBush3.prototype.getInExtent = function(extent) {
      var bbox = {
        minX: extent[0],
        minY: extent[1],
        maxX: extent[2],
        maxY: extent[3]
      };
      var items = this.rbush_.search(bbox);
      return items.map(function(item) {
        return item.value;
      });
    };
    RBush3.prototype.forEach = function(callback) {
      return this.forEach_(this.getAll(), callback);
    };
    RBush3.prototype.forEachInExtent = function(extent, callback) {
      return this.forEach_(this.getInExtent(extent), callback);
    };
    RBush3.prototype.forEach_ = function(values, callback) {
      var result;
      for (var i2 = 0, l = values.length; i2 < l; i2++) {
        result = callback(values[i2]);
        if (result) {
          return result;
        }
      }
      return result;
    };
    RBush3.prototype.isEmpty = function() {
      return isEmpty(this.items_);
    };
    RBush3.prototype.clear = function() {
      this.rbush_.clear();
      this.items_ = {};
    };
    RBush3.prototype.getExtent = function(opt_extent) {
      var data = this.rbush_.toJSON();
      return createOrUpdate(data.minX, data.minY, data.maxX, data.maxY, opt_extent);
    };
    RBush3.prototype.concat = function(rbush) {
      this.rbush_.load(rbush.rbush_.all());
      for (var i2 in rbush.items_) {
        this.items_[i2] = rbush.items_[i2];
      }
    };
    return RBush3;
  }()
);
var RBush_default = RBush2;

// node_modules/ol/source/VectorEventType.js
var VectorEventType_default = {
  /**
   * Triggered when a feature is added to the source.
   * @event module:ol/source/Vector.VectorSourceEvent#addfeature
   * @api
   */
  ADDFEATURE: "addfeature",
  /**
   * Triggered when a feature is updated.
   * @event module:ol/source/Vector.VectorSourceEvent#changefeature
   * @api
   */
  CHANGEFEATURE: "changefeature",
  /**
   * Triggered when the clear method is called on the source.
   * @event module:ol/source/Vector.VectorSourceEvent#clear
   * @api
   */
  CLEAR: "clear",
  /**
   * Triggered when a feature is removed from the source.
   * See {@link module:ol/source/Vector~VectorSource#clear source.clear()} for exceptions.
   * @event module:ol/source/Vector.VectorSourceEvent#removefeature
   * @api
   */
  REMOVEFEATURE: "removefeature",
  /**
   * Triggered when features starts loading.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloadstart
   * @api
   */
  FEATURESLOADSTART: "featuresloadstart",
  /**
   * Triggered when features finishes loading.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloadend
   * @api
   */
  FEATURESLOADEND: "featuresloadend",
  /**
   * Triggered if feature loading results in an error.
   * @event module:ol/source/Vector.VectorSourceEvent#featuresloaderror
   * @api
   */
  FEATURESLOADERROR: "featuresloaderror"
};

// node_modules/ol/loadingstrategy.js
function all2(extent, resolution) {
  return [[-Infinity, -Infinity, Infinity, Infinity]];
}

// node_modules/ol/source/Vector.js
var __extends84 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var VectorSourceEvent = (
  /** @class */
  function(_super) {
    __extends84(VectorSourceEvent2, _super);
    function VectorSourceEvent2(type, opt_feature, opt_features) {
      var _this = _super.call(this, type) || this;
      _this.feature = opt_feature;
      _this.features = opt_features;
      return _this;
    }
    return VectorSourceEvent2;
  }(Event_default)
);
var VectorSource = (
  /** @class */
  function(_super) {
    __extends84(VectorSource2, _super);
    function VectorSource2(opt_options) {
      var _this = this;
      var options = opt_options || {};
      _this = _super.call(this, {
        attributions: options.attributions,
        interpolate: true,
        projection: void 0,
        state: "ready",
        wrapX: options.wrapX !== void 0 ? options.wrapX : true
      }) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.loader_ = VOID;
      _this.format_ = options.format;
      _this.overlaps_ = options.overlaps === void 0 ? true : options.overlaps;
      _this.url_ = options.url;
      if (options.loader !== void 0) {
        _this.loader_ = options.loader;
      } else if (_this.url_ !== void 0) {
        assert(_this.format_, 7);
        _this.loader_ = xhr(
          _this.url_,
          /** @type {import("../format/Feature.js").default} */
          _this.format_
        );
      }
      _this.strategy_ = options.strategy !== void 0 ? options.strategy : all2;
      var useSpatialIndex = options.useSpatialIndex !== void 0 ? options.useSpatialIndex : true;
      _this.featuresRtree_ = useSpatialIndex ? new RBush_default() : null;
      _this.loadedExtentsRtree_ = new RBush_default();
      _this.loadingExtentsCount_ = 0;
      _this.nullGeometryFeatures_ = {};
      _this.idIndex_ = {};
      _this.uidIndex_ = {};
      _this.featureChangeKeys_ = {};
      _this.featuresCollection_ = null;
      var collection, features;
      if (Array.isArray(options.features)) {
        features = /** @type {Array<import("../Feature.js").default<Geometry>>} */
        options.features;
      } else if (options.features) {
        collection = /** @type {Collection<import("../Feature.js").default<Geometry>>} */
        options.features;
        features = collection.getArray();
      }
      if (!useSpatialIndex && collection === void 0) {
        collection = new Collection_default(features);
      }
      if (features !== void 0) {
        _this.addFeaturesInternal(features);
      }
      if (collection !== void 0) {
        _this.bindFeaturesCollection_(collection);
      }
      return _this;
    }
    VectorSource2.prototype.addFeature = function(feature) {
      this.addFeatureInternal(feature);
      this.changed();
    };
    VectorSource2.prototype.addFeatureInternal = function(feature) {
      var featureKey = getUid(feature);
      if (!this.addToIndex_(featureKey, feature)) {
        if (this.featuresCollection_) {
          this.featuresCollection_.remove(feature);
        }
        return;
      }
      this.setupChangeEvents_(featureKey, feature);
      var geometry2 = feature.getGeometry();
      if (geometry2) {
        var extent = geometry2.getExtent();
        if (this.featuresRtree_) {
          this.featuresRtree_.insert(extent, feature);
        }
      } else {
        this.nullGeometryFeatures_[featureKey] = feature;
      }
      this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.ADDFEATURE, feature));
    };
    VectorSource2.prototype.setupChangeEvents_ = function(featureKey, feature) {
      this.featureChangeKeys_[featureKey] = [
        listen(feature, EventType_default.CHANGE, this.handleFeatureChange_, this),
        listen(feature, ObjectEventType_default.PROPERTYCHANGE, this.handleFeatureChange_, this)
      ];
    };
    VectorSource2.prototype.addToIndex_ = function(featureKey, feature) {
      var valid = true;
      var id2 = feature.getId();
      if (id2 !== void 0) {
        if (!(id2.toString() in this.idIndex_)) {
          this.idIndex_[id2.toString()] = feature;
        } else {
          valid = false;
        }
      }
      if (valid) {
        assert(!(featureKey in this.uidIndex_), 30);
        this.uidIndex_[featureKey] = feature;
      }
      return valid;
    };
    VectorSource2.prototype.addFeatures = function(features) {
      this.addFeaturesInternal(features);
      this.changed();
    };
    VectorSource2.prototype.addFeaturesInternal = function(features) {
      var extents = [];
      var newFeatures = [];
      var geometryFeatures = [];
      for (var i2 = 0, length_1 = features.length; i2 < length_1; i2++) {
        var feature = features[i2];
        var featureKey = getUid(feature);
        if (this.addToIndex_(featureKey, feature)) {
          newFeatures.push(feature);
        }
      }
      for (var i2 = 0, length_2 = newFeatures.length; i2 < length_2; i2++) {
        var feature = newFeatures[i2];
        var featureKey = getUid(feature);
        this.setupChangeEvents_(featureKey, feature);
        var geometry2 = feature.getGeometry();
        if (geometry2) {
          var extent = geometry2.getExtent();
          extents.push(extent);
          geometryFeatures.push(feature);
        } else {
          this.nullGeometryFeatures_[featureKey] = feature;
        }
      }
      if (this.featuresRtree_) {
        this.featuresRtree_.load(extents, geometryFeatures);
      }
      if (this.hasListener(VectorEventType_default.ADDFEATURE)) {
        for (var i2 = 0, length_3 = newFeatures.length; i2 < length_3; i2++) {
          this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.ADDFEATURE, newFeatures[i2]));
        }
      }
    };
    VectorSource2.prototype.bindFeaturesCollection_ = function(collection) {
      var modifyingCollection = false;
      this.addEventListener(
        VectorEventType_default.ADDFEATURE,
        /**
         * @param {VectorSourceEvent<Geometry>} evt The vector source event
         */
        function(evt) {
          if (!modifyingCollection) {
            modifyingCollection = true;
            collection.push(evt.feature);
            modifyingCollection = false;
          }
        }
      );
      this.addEventListener(
        VectorEventType_default.REMOVEFEATURE,
        /**
         * @param {VectorSourceEvent<Geometry>} evt The vector source event
         */
        function(evt) {
          if (!modifyingCollection) {
            modifyingCollection = true;
            collection.remove(evt.feature);
            modifyingCollection = false;
          }
        }
      );
      collection.addEventListener(
        CollectionEventType_default.ADD,
        /**
         * @param {import("../Collection.js").CollectionEvent} evt The collection event
         */
        (function(evt) {
          if (!modifyingCollection) {
            modifyingCollection = true;
            this.addFeature(
              /** @type {import("../Feature.js").default<Geometry>} */
              evt.element
            );
            modifyingCollection = false;
          }
        }).bind(this)
      );
      collection.addEventListener(
        CollectionEventType_default.REMOVE,
        /**
         * @param {import("../Collection.js").CollectionEvent} evt The collection event
         */
        (function(evt) {
          if (!modifyingCollection) {
            modifyingCollection = true;
            this.removeFeature(
              /** @type {import("../Feature.js").default<Geometry>} */
              evt.element
            );
            modifyingCollection = false;
          }
        }).bind(this)
      );
      this.featuresCollection_ = collection;
    };
    VectorSource2.prototype.clear = function(opt_fast) {
      if (opt_fast) {
        for (var featureId in this.featureChangeKeys_) {
          var keys = this.featureChangeKeys_[featureId];
          keys.forEach(unlistenByKey);
        }
        if (!this.featuresCollection_) {
          this.featureChangeKeys_ = {};
          this.idIndex_ = {};
          this.uidIndex_ = {};
        }
      } else {
        if (this.featuresRtree_) {
          var removeAndIgnoreReturn = (function(feature) {
            this.removeFeatureInternal(feature);
          }).bind(this);
          this.featuresRtree_.forEach(removeAndIgnoreReturn);
          for (var id2 in this.nullGeometryFeatures_) {
            this.removeFeatureInternal(this.nullGeometryFeatures_[id2]);
          }
        }
      }
      if (this.featuresCollection_) {
        this.featuresCollection_.clear();
      }
      if (this.featuresRtree_) {
        this.featuresRtree_.clear();
      }
      this.nullGeometryFeatures_ = {};
      var clearEvent = new VectorSourceEvent(VectorEventType_default.CLEAR);
      this.dispatchEvent(clearEvent);
      this.changed();
    };
    VectorSource2.prototype.forEachFeature = function(callback) {
      if (this.featuresRtree_) {
        return this.featuresRtree_.forEach(callback);
      } else if (this.featuresCollection_) {
        this.featuresCollection_.forEach(callback);
      }
    };
    VectorSource2.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, callback) {
      var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];
      return this.forEachFeatureInExtent(extent, function(feature) {
        var geometry2 = feature.getGeometry();
        if (geometry2.intersectsCoordinate(coordinate)) {
          return callback(feature);
        } else {
          return void 0;
        }
      });
    };
    VectorSource2.prototype.forEachFeatureInExtent = function(extent, callback) {
      if (this.featuresRtree_) {
        return this.featuresRtree_.forEachInExtent(extent, callback);
      } else if (this.featuresCollection_) {
        this.featuresCollection_.forEach(callback);
      }
    };
    VectorSource2.prototype.forEachFeatureIntersectingExtent = function(extent, callback) {
      return this.forEachFeatureInExtent(
        extent,
        /**
         * @param {import("../Feature.js").default<Geometry>} feature Feature.
         * @return {T|undefined} The return value from the last call to the callback.
         */
        function(feature) {
          var geometry2 = feature.getGeometry();
          if (geometry2.intersectsExtent(extent)) {
            var result = callback(feature);
            if (result) {
              return result;
            }
          }
        }
      );
    };
    VectorSource2.prototype.getFeaturesCollection = function() {
      return this.featuresCollection_;
    };
    VectorSource2.prototype.getFeatures = function() {
      var features;
      if (this.featuresCollection_) {
        features = this.featuresCollection_.getArray().slice(0);
      } else if (this.featuresRtree_) {
        features = this.featuresRtree_.getAll();
        if (!isEmpty(this.nullGeometryFeatures_)) {
          extend(features, getValues(this.nullGeometryFeatures_));
        }
      }
      return (
        /** @type {Array<import("../Feature.js").default<Geometry>>} */
        features
      );
    };
    VectorSource2.prototype.getFeaturesAtCoordinate = function(coordinate) {
      var features = [];
      this.forEachFeatureAtCoordinateDirect(coordinate, function(feature) {
        features.push(feature);
      });
      return features;
    };
    VectorSource2.prototype.getFeaturesInExtent = function(extent, opt_projection) {
      var _this = this;
      if (this.featuresRtree_) {
        var multiWorld = opt_projection && opt_projection.canWrapX() && this.getWrapX();
        if (!multiWorld) {
          return this.featuresRtree_.getInExtent(extent);
        }
        var extents = wrapAndSliceX(extent, opt_projection);
        return [].concat.apply([], extents.map(function(anExtent) {
          return _this.featuresRtree_.getInExtent(anExtent);
        }));
      } else if (this.featuresCollection_) {
        return this.featuresCollection_.getArray().slice(0);
      } else {
        return [];
      }
    };
    VectorSource2.prototype.getClosestFeatureToCoordinate = function(coordinate, opt_filter) {
      var x = coordinate[0];
      var y = coordinate[1];
      var closestFeature = null;
      var closestPoint = [NaN, NaN];
      var minSquaredDistance = Infinity;
      var extent = [-Infinity, -Infinity, Infinity, Infinity];
      var filter2 = opt_filter ? opt_filter : TRUE;
      this.featuresRtree_.forEachInExtent(
        extent,
        /**
         * @param {import("../Feature.js").default<Geometry>} feature Feature.
         */
        function(feature) {
          if (filter2(feature)) {
            var geometry2 = feature.getGeometry();
            var previousMinSquaredDistance = minSquaredDistance;
            minSquaredDistance = geometry2.closestPointXY(x, y, closestPoint, minSquaredDistance);
            if (minSquaredDistance < previousMinSquaredDistance) {
              closestFeature = feature;
              var minDistance = Math.sqrt(minSquaredDistance);
              extent[0] = x - minDistance;
              extent[1] = y - minDistance;
              extent[2] = x + minDistance;
              extent[3] = y + minDistance;
            }
          }
        }
      );
      return closestFeature;
    };
    VectorSource2.prototype.getExtent = function(opt_extent) {
      return this.featuresRtree_.getExtent(opt_extent);
    };
    VectorSource2.prototype.getFeatureById = function(id2) {
      var feature = this.idIndex_[id2.toString()];
      return feature !== void 0 ? feature : null;
    };
    VectorSource2.prototype.getFeatureByUid = function(uid) {
      var feature = this.uidIndex_[uid];
      return feature !== void 0 ? feature : null;
    };
    VectorSource2.prototype.getFormat = function() {
      return this.format_;
    };
    VectorSource2.prototype.getOverlaps = function() {
      return this.overlaps_;
    };
    VectorSource2.prototype.getUrl = function() {
      return this.url_;
    };
    VectorSource2.prototype.handleFeatureChange_ = function(event) {
      var feature = (
        /** @type {import("../Feature.js").default<Geometry>} */
        event.target
      );
      var featureKey = getUid(feature);
      var geometry2 = feature.getGeometry();
      if (!geometry2) {
        if (!(featureKey in this.nullGeometryFeatures_)) {
          if (this.featuresRtree_) {
            this.featuresRtree_.remove(feature);
          }
          this.nullGeometryFeatures_[featureKey] = feature;
        }
      } else {
        var extent = geometry2.getExtent();
        if (featureKey in this.nullGeometryFeatures_) {
          delete this.nullGeometryFeatures_[featureKey];
          if (this.featuresRtree_) {
            this.featuresRtree_.insert(extent, feature);
          }
        } else {
          if (this.featuresRtree_) {
            this.featuresRtree_.update(extent, feature);
          }
        }
      }
      var id2 = feature.getId();
      if (id2 !== void 0) {
        var sid = id2.toString();
        if (this.idIndex_[sid] !== feature) {
          this.removeFromIdIndex_(feature);
          this.idIndex_[sid] = feature;
        }
      } else {
        this.removeFromIdIndex_(feature);
        this.uidIndex_[featureKey] = feature;
      }
      this.changed();
      this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.CHANGEFEATURE, feature));
    };
    VectorSource2.prototype.hasFeature = function(feature) {
      var id2 = feature.getId();
      if (id2 !== void 0) {
        return id2 in this.idIndex_;
      } else {
        return getUid(feature) in this.uidIndex_;
      }
    };
    VectorSource2.prototype.isEmpty = function() {
      if (this.featuresRtree_) {
        return this.featuresRtree_.isEmpty() && isEmpty(this.nullGeometryFeatures_);
      }
      if (this.featuresCollection_) {
        return this.featuresCollection_.getLength() === 0;
      }
      return true;
    };
    VectorSource2.prototype.loadFeatures = function(extent, resolution, projection) {
      var loadedExtentsRtree = this.loadedExtentsRtree_;
      var extentsToLoad = this.strategy_(extent, resolution, projection);
      var _loop_1 = function(i3, ii2) {
        var extentToLoad = extentsToLoad[i3];
        var alreadyLoaded = loadedExtentsRtree.forEachInExtent(
          extentToLoad,
          /**
           * @param {{extent: import("../extent.js").Extent}} object Object.
           * @return {boolean} Contains.
           */
          function(object) {
            return containsExtent(object.extent, extentToLoad);
          }
        );
        if (!alreadyLoaded) {
          ++this_1.loadingExtentsCount_;
          this_1.dispatchEvent(new VectorSourceEvent(VectorEventType_default.FEATURESLOADSTART));
          this_1.loader_.call(this_1, extentToLoad, resolution, projection, (function(features) {
            --this.loadingExtentsCount_;
            this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.FEATURESLOADEND, void 0, features));
          }).bind(this_1), (function() {
            --this.loadingExtentsCount_;
            this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.FEATURESLOADERROR));
          }).bind(this_1));
          loadedExtentsRtree.insert(extentToLoad, { extent: extentToLoad.slice() });
        }
      };
      var this_1 = this;
      for (var i2 = 0, ii = extentsToLoad.length; i2 < ii; ++i2) {
        _loop_1(i2, ii);
      }
      this.loading = this.loader_.length < 4 ? false : this.loadingExtentsCount_ > 0;
    };
    VectorSource2.prototype.refresh = function() {
      this.clear(true);
      this.loadedExtentsRtree_.clear();
      _super.prototype.refresh.call(this);
    };
    VectorSource2.prototype.removeLoadedExtent = function(extent) {
      var loadedExtentsRtree = this.loadedExtentsRtree_;
      var obj;
      loadedExtentsRtree.forEachInExtent(extent, function(object) {
        if (equals2(object.extent, extent)) {
          obj = object;
          return true;
        }
      });
      if (obj) {
        loadedExtentsRtree.remove(obj);
      }
    };
    VectorSource2.prototype.removeFeature = function(feature) {
      if (!feature) {
        return;
      }
      var featureKey = getUid(feature);
      if (featureKey in this.nullGeometryFeatures_) {
        delete this.nullGeometryFeatures_[featureKey];
      } else {
        if (this.featuresRtree_) {
          this.featuresRtree_.remove(feature);
        }
      }
      var result = this.removeFeatureInternal(feature);
      if (result) {
        this.changed();
      }
    };
    VectorSource2.prototype.removeFeatureInternal = function(feature) {
      var featureKey = getUid(feature);
      var featureChangeKeys = this.featureChangeKeys_[featureKey];
      if (!featureChangeKeys) {
        return;
      }
      featureChangeKeys.forEach(unlistenByKey);
      delete this.featureChangeKeys_[featureKey];
      var id2 = feature.getId();
      if (id2 !== void 0) {
        delete this.idIndex_[id2.toString()];
      }
      delete this.uidIndex_[featureKey];
      this.dispatchEvent(new VectorSourceEvent(VectorEventType_default.REMOVEFEATURE, feature));
      return feature;
    };
    VectorSource2.prototype.removeFromIdIndex_ = function(feature) {
      var removed = false;
      for (var id2 in this.idIndex_) {
        if (this.idIndex_[id2] === feature) {
          delete this.idIndex_[id2];
          removed = true;
          break;
        }
      }
      return removed;
    };
    VectorSource2.prototype.setLoader = function(loader) {
      this.loader_ = loader;
    };
    VectorSource2.prototype.setUrl = function(url) {
      assert(this.format_, 7);
      this.url_ = url;
      this.setLoader(xhr(url, this.format_));
    };
    return VectorSource2;
  }(Source_default)
);
var Vector_default2 = VectorSource;

// node_modules/ol/interaction/Draw.js
var __extends85 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Mode2 = {
  POINT: "Point",
  LINE_STRING: "LineString",
  POLYGON: "Polygon",
  CIRCLE: "Circle"
};
var DrawEventType = {
  /**
   * Triggered upon feature draw start
   * @event DrawEvent#drawstart
   * @api
   */
  DRAWSTART: "drawstart",
  /**
   * Triggered upon feature draw end
   * @event DrawEvent#drawend
   * @api
   */
  DRAWEND: "drawend",
  /**
   * Triggered upon feature draw abortion
   * @event DrawEvent#drawabort
   * @api
   */
  DRAWABORT: "drawabort"
};
var DrawEvent = (
  /** @class */
  function(_super) {
    __extends85(DrawEvent2, _super);
    function DrawEvent2(type, feature) {
      var _this = _super.call(this, type) || this;
      _this.feature = feature;
      return _this;
    }
    return DrawEvent2;
  }(Event_default)
);
var Draw = (
  /** @class */
  function(_super) {
    __extends85(Draw2, _super);
    function Draw2(options) {
      var _this = this;
      var pointerOptions = (
        /** @type {import("./Pointer.js").Options} */
        options
      );
      if (!pointerOptions.stopDown) {
        pointerOptions.stopDown = FALSE;
      }
      _this = _super.call(this, pointerOptions) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.shouldHandle_ = false;
      _this.downPx_ = null;
      _this.downTimeout_;
      _this.lastDragTime_;
      _this.pointerType_;
      _this.freehand_ = false;
      _this.source_ = options.source ? options.source : null;
      _this.features_ = options.features ? options.features : null;
      _this.snapTolerance_ = options.snapTolerance ? options.snapTolerance : 12;
      _this.type_ = /** @type {import("../geom/Geometry.js").Type} */
      options.type;
      _this.mode_ = getMode(_this.type_);
      _this.stopClick_ = !!options.stopClick;
      _this.minPoints_ = options.minPoints ? options.minPoints : _this.mode_ === Mode2.POLYGON ? 3 : 2;
      _this.maxPoints_ = _this.mode_ === Mode2.CIRCLE ? 2 : options.maxPoints ? options.maxPoints : Infinity;
      _this.finishCondition_ = options.finishCondition ? options.finishCondition : TRUE;
      _this.geometryLayout_ = options.geometryLayout ? options.geometryLayout : GeometryLayout_default.XY;
      var geometryFunction = options.geometryFunction;
      if (!geometryFunction) {
        var mode_1 = _this.mode_;
        if (mode_1 === Mode2.CIRCLE) {
          geometryFunction = function(coordinates2, geometry2, projection) {
            var circle = geometry2 ? (
              /** @type {Circle} */
              geometry2
            ) : new Circle_default2([NaN, NaN]);
            var center = fromUserCoordinate(coordinates2[0], projection);
            var squaredLength = squaredDistance2(center, fromUserCoordinate(coordinates2[coordinates2.length - 1], projection));
            circle.setCenterAndRadius(center, Math.sqrt(squaredLength), this.geometryLayout_);
            var userProjection2 = getUserProjection();
            if (userProjection2) {
              circle.transform(projection, userProjection2);
            }
            return circle;
          };
        } else {
          var Constructor_1;
          if (mode_1 === Mode2.POINT) {
            Constructor_1 = Point_default;
          } else if (mode_1 === Mode2.LINE_STRING) {
            Constructor_1 = LineString_default;
          } else if (mode_1 === Mode2.POLYGON) {
            Constructor_1 = Polygon_default;
          }
          geometryFunction = function(coordinates2, geometry2, projection) {
            if (geometry2) {
              if (mode_1 === Mode2.POLYGON) {
                if (coordinates2[0].length) {
                  geometry2.setCoordinates([coordinates2[0].concat([coordinates2[0][0]])], this.geometryLayout_);
                } else {
                  geometry2.setCoordinates([], this.geometryLayout_);
                }
              } else {
                geometry2.setCoordinates(coordinates2, this.geometryLayout_);
              }
            } else {
              geometry2 = new Constructor_1(coordinates2, this.geometryLayout_);
            }
            return geometry2;
          };
        }
      }
      _this.geometryFunction_ = geometryFunction;
      _this.dragVertexDelay_ = options.dragVertexDelay !== void 0 ? options.dragVertexDelay : 500;
      _this.finishCoordinate_ = null;
      _this.sketchFeature_ = null;
      _this.sketchPoint_ = null;
      _this.sketchCoords_ = null;
      _this.sketchLine_ = null;
      _this.sketchLineCoords_ = null;
      _this.squaredClickTolerance_ = options.clickTolerance ? options.clickTolerance * options.clickTolerance : 36;
      _this.overlay_ = new Vector_default({
        source: new Vector_default2({
          useSpatialIndex: false,
          wrapX: options.wrapX ? options.wrapX : false
        }),
        style: options.style ? options.style : getDefaultStyleFunction(),
        updateWhileInteracting: true
      });
      _this.geometryName_ = options.geometryName;
      _this.condition_ = options.condition ? options.condition : noModifierKeys;
      _this.freehandCondition_;
      if (options.freehand) {
        _this.freehandCondition_ = always;
      } else {
        _this.freehandCondition_ = options.freehandCondition ? options.freehandCondition : shiftKeyOnly;
      }
      _this.addChangeListener(Property_default2.ACTIVE, _this.updateState_);
      return _this;
    }
    Draw2.prototype.setMap = function(map2) {
      _super.prototype.setMap.call(this, map2);
      this.updateState_();
    };
    Draw2.prototype.getOverlay = function() {
      return this.overlay_;
    };
    Draw2.prototype.handleEvent = function(event) {
      if (event.originalEvent.type === EventType_default.CONTEXTMENU) {
        event.originalEvent.preventDefault();
      }
      this.freehand_ = this.mode_ !== Mode2.POINT && this.freehandCondition_(event);
      var move = event.type === MapBrowserEventType_default.POINTERMOVE;
      var pass = true;
      if (!this.freehand_ && this.lastDragTime_ && event.type === MapBrowserEventType_default.POINTERDRAG) {
        var now = Date.now();
        if (now - this.lastDragTime_ >= this.dragVertexDelay_) {
          this.downPx_ = event.pixel;
          this.shouldHandle_ = !this.freehand_;
          move = true;
        } else {
          this.lastDragTime_ = void 0;
        }
        if (this.shouldHandle_ && this.downTimeout_ !== void 0) {
          clearTimeout(this.downTimeout_);
          this.downTimeout_ = void 0;
        }
      }
      if (this.freehand_ && event.type === MapBrowserEventType_default.POINTERDRAG && this.sketchFeature_ !== null) {
        this.addToDrawing_(event.coordinate);
        pass = false;
      } else if (this.freehand_ && event.type === MapBrowserEventType_default.POINTERDOWN) {
        pass = false;
      } else if (move && this.getPointerCount() < 2) {
        pass = event.type === MapBrowserEventType_default.POINTERMOVE;
        if (pass && this.freehand_) {
          this.handlePointerMove_(event);
          if (this.shouldHandle_) {
            event.originalEvent.preventDefault();
          }
        } else if (event.originalEvent.pointerType === "mouse" || event.type === MapBrowserEventType_default.POINTERDRAG && this.downTimeout_ === void 0) {
          this.handlePointerMove_(event);
        }
      } else if (event.type === MapBrowserEventType_default.DBLCLICK) {
        pass = false;
      }
      return _super.prototype.handleEvent.call(this, event) && pass;
    };
    Draw2.prototype.handleDownEvent = function(event) {
      this.shouldHandle_ = !this.freehand_;
      if (this.freehand_) {
        this.downPx_ = event.pixel;
        if (!this.finishCoordinate_) {
          this.startDrawing_(event.coordinate);
        }
        return true;
      } else if (this.condition_(event)) {
        this.lastDragTime_ = Date.now();
        this.downTimeout_ = setTimeout((function() {
          this.handlePointerMove_(new MapBrowserEvent_default(MapBrowserEventType_default.POINTERMOVE, event.map, event.originalEvent, false, event.frameState));
        }).bind(this), this.dragVertexDelay_);
        this.downPx_ = event.pixel;
        return true;
      } else {
        this.lastDragTime_ = void 0;
        return false;
      }
    };
    Draw2.prototype.handleUpEvent = function(event) {
      var pass = true;
      if (this.getPointerCount() === 0) {
        if (this.downTimeout_) {
          clearTimeout(this.downTimeout_);
          this.downTimeout_ = void 0;
        }
        this.handlePointerMove_(event);
        if (this.shouldHandle_) {
          var startingToDraw = !this.finishCoordinate_;
          if (startingToDraw) {
            this.startDrawing_(event.coordinate);
          }
          if (!startingToDraw && this.freehand_) {
            this.finishDrawing();
          } else if (!this.freehand_ && (!startingToDraw || this.mode_ === Mode2.POINT)) {
            if (this.atFinish_(event.pixel)) {
              if (this.finishCondition_(event)) {
                this.finishDrawing();
              }
            } else {
              this.addToDrawing_(event.coordinate);
            }
          }
          pass = false;
        } else if (this.freehand_) {
          this.abortDrawing();
        }
      }
      if (!pass && this.stopClick_) {
        event.preventDefault();
      }
      return pass;
    };
    Draw2.prototype.handlePointerMove_ = function(event) {
      this.pointerType_ = event.originalEvent.pointerType;
      if (this.downPx_ && (!this.freehand_ && this.shouldHandle_ || this.freehand_ && !this.shouldHandle_)) {
        var downPx = this.downPx_;
        var clickPx = event.pixel;
        var dx = downPx[0] - clickPx[0];
        var dy = downPx[1] - clickPx[1];
        var squaredDistance3 = dx * dx + dy * dy;
        this.shouldHandle_ = this.freehand_ ? squaredDistance3 > this.squaredClickTolerance_ : squaredDistance3 <= this.squaredClickTolerance_;
        if (!this.shouldHandle_) {
          return;
        }
      }
      if (this.finishCoordinate_) {
        this.modifyDrawing_(event.coordinate);
      } else {
        this.createOrUpdateSketchPoint_(event.coordinate.slice());
      }
    };
    Draw2.prototype.atFinish_ = function(pixel) {
      var at = false;
      if (this.sketchFeature_) {
        var potentiallyDone = false;
        var potentiallyFinishCoordinates = [this.finishCoordinate_];
        var mode = this.mode_;
        if (mode === Mode2.POINT) {
          at = true;
        } else if (mode === Mode2.CIRCLE) {
          at = this.sketchCoords_.length === 2;
        } else if (mode === Mode2.LINE_STRING) {
          potentiallyDone = this.sketchCoords_.length > this.minPoints_;
        } else if (mode === Mode2.POLYGON) {
          var sketchCoords = (
            /** @type {PolyCoordType} */
            this.sketchCoords_
          );
          potentiallyDone = sketchCoords[0].length > this.minPoints_;
          potentiallyFinishCoordinates = [
            sketchCoords[0][0],
            sketchCoords[0][sketchCoords[0].length - 2]
          ];
        }
        if (potentiallyDone) {
          var map2 = this.getMap();
          for (var i2 = 0, ii = potentiallyFinishCoordinates.length; i2 < ii; i2++) {
            var finishCoordinate = potentiallyFinishCoordinates[i2];
            var finishPixel = map2.getPixelFromCoordinate(finishCoordinate);
            var dx = pixel[0] - finishPixel[0];
            var dy = pixel[1] - finishPixel[1];
            var snapTolerance = this.freehand_ ? 1 : this.snapTolerance_;
            at = Math.sqrt(dx * dx + dy * dy) <= snapTolerance;
            if (at) {
              this.finishCoordinate_ = finishCoordinate;
              break;
            }
          }
        }
      }
      return at;
    };
    Draw2.prototype.createOrUpdateSketchPoint_ = function(coordinates2) {
      if (!this.sketchPoint_) {
        this.sketchPoint_ = new Feature_default2(new Point_default(coordinates2));
        this.updateSketchFeatures_();
      } else {
        var sketchPointGeom = this.sketchPoint_.getGeometry();
        sketchPointGeom.setCoordinates(coordinates2);
      }
    };
    Draw2.prototype.createOrUpdateCustomSketchLine_ = function(geometry2) {
      if (!this.sketchLine_) {
        this.sketchLine_ = new Feature_default2();
      }
      var ring = geometry2.getLinearRing(0);
      var sketchLineGeom = this.sketchLine_.getGeometry();
      if (!sketchLineGeom) {
        sketchLineGeom = new LineString_default(ring.getFlatCoordinates(), ring.getLayout());
        this.sketchLine_.setGeometry(sketchLineGeom);
      } else {
        sketchLineGeom.setFlatCoordinates(ring.getLayout(), ring.getFlatCoordinates());
        sketchLineGeom.changed();
      }
    };
    Draw2.prototype.startDrawing_ = function(start2) {
      var projection = this.getMap().getView().getProjection();
      var stride = getStrideForLayout(this.geometryLayout_);
      while (start2.length < stride) {
        start2.push(0);
      }
      this.finishCoordinate_ = start2;
      if (this.mode_ === Mode2.POINT) {
        this.sketchCoords_ = start2.slice();
      } else if (this.mode_ === Mode2.POLYGON) {
        this.sketchCoords_ = [[start2.slice(), start2.slice()]];
        this.sketchLineCoords_ = this.sketchCoords_[0];
      } else {
        this.sketchCoords_ = [start2.slice(), start2.slice()];
      }
      if (this.sketchLineCoords_) {
        this.sketchLine_ = new Feature_default2(new LineString_default(this.sketchLineCoords_));
      }
      var geometry2 = this.geometryFunction_(this.sketchCoords_, void 0, projection);
      this.sketchFeature_ = new Feature_default2();
      if (this.geometryName_) {
        this.sketchFeature_.setGeometryName(this.geometryName_);
      }
      this.sketchFeature_.setGeometry(geometry2);
      this.updateSketchFeatures_();
      this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));
    };
    Draw2.prototype.modifyDrawing_ = function(coordinate) {
      var map2 = this.getMap();
      var geometry2 = this.sketchFeature_.getGeometry();
      var projection = map2.getView().getProjection();
      var stride = getStrideForLayout(this.geometryLayout_);
      var coordinates2, last2;
      while (coordinate.length < stride) {
        coordinate.push(0);
      }
      if (this.mode_ === Mode2.POINT) {
        last2 = this.sketchCoords_;
      } else if (this.mode_ === Mode2.POLYGON) {
        coordinates2 = /** @type {PolyCoordType} */
        this.sketchCoords_[0];
        last2 = coordinates2[coordinates2.length - 1];
        if (this.atFinish_(map2.getPixelFromCoordinate(coordinate))) {
          coordinate = this.finishCoordinate_.slice();
        }
      } else {
        coordinates2 = this.sketchCoords_;
        last2 = coordinates2[coordinates2.length - 1];
      }
      last2[0] = coordinate[0];
      last2[1] = coordinate[1];
      this.geometryFunction_(
        /** @type {!LineCoordType} */
        this.sketchCoords_,
        geometry2,
        projection
      );
      if (this.sketchPoint_) {
        var sketchPointGeom = this.sketchPoint_.getGeometry();
        sketchPointGeom.setCoordinates(coordinate);
      }
      if (geometry2.getType() === "Polygon" && this.mode_ !== Mode2.POLYGON) {
        this.createOrUpdateCustomSketchLine_(
          /** @type {Polygon} */
          geometry2
        );
      } else if (this.sketchLineCoords_) {
        var sketchLineGeom = this.sketchLine_.getGeometry();
        sketchLineGeom.setCoordinates(this.sketchLineCoords_);
      }
      this.updateSketchFeatures_();
    };
    Draw2.prototype.addToDrawing_ = function(coordinate) {
      var geometry2 = this.sketchFeature_.getGeometry();
      var projection = this.getMap().getView().getProjection();
      var done;
      var coordinates2;
      var mode = this.mode_;
      if (mode === Mode2.LINE_STRING || mode === Mode2.CIRCLE) {
        this.finishCoordinate_ = coordinate.slice();
        coordinates2 = /** @type {LineCoordType} */
        this.sketchCoords_;
        if (coordinates2.length >= this.maxPoints_) {
          if (this.freehand_) {
            coordinates2.pop();
          } else {
            done = true;
          }
        }
        coordinates2.push(coordinate.slice());
        this.geometryFunction_(coordinates2, geometry2, projection);
      } else if (mode === Mode2.POLYGON) {
        coordinates2 = /** @type {PolyCoordType} */
        this.sketchCoords_[0];
        if (coordinates2.length >= this.maxPoints_) {
          if (this.freehand_) {
            coordinates2.pop();
          } else {
            done = true;
          }
        }
        coordinates2.push(coordinate.slice());
        if (done) {
          this.finishCoordinate_ = coordinates2[0];
        }
        this.geometryFunction_(this.sketchCoords_, geometry2, projection);
      }
      this.createOrUpdateSketchPoint_(coordinate.slice());
      this.updateSketchFeatures_();
      if (done) {
        this.finishDrawing();
      }
    };
    Draw2.prototype.removeLastPoint = function() {
      if (!this.sketchFeature_) {
        return;
      }
      var geometry2 = this.sketchFeature_.getGeometry();
      var projection = this.getMap().getView().getProjection();
      var coordinates2;
      var mode = this.mode_;
      if (mode === Mode2.LINE_STRING || mode === Mode2.CIRCLE) {
        coordinates2 = /** @type {LineCoordType} */
        this.sketchCoords_;
        coordinates2.splice(-2, 1);
        if (coordinates2.length >= 2) {
          this.finishCoordinate_ = coordinates2[coordinates2.length - 2].slice();
          var finishCoordinate = this.finishCoordinate_.slice();
          coordinates2[coordinates2.length - 1] = finishCoordinate;
          this.createOrUpdateSketchPoint_(finishCoordinate);
        }
        this.geometryFunction_(coordinates2, geometry2, projection);
        if (geometry2.getType() === "Polygon" && this.sketchLine_) {
          this.createOrUpdateCustomSketchLine_(
            /** @type {Polygon} */
            geometry2
          );
        }
      } else if (mode === Mode2.POLYGON) {
        coordinates2 = /** @type {PolyCoordType} */
        this.sketchCoords_[0];
        coordinates2.splice(-2, 1);
        var sketchLineGeom = this.sketchLine_.getGeometry();
        if (coordinates2.length >= 2) {
          var finishCoordinate = coordinates2[coordinates2.length - 2].slice();
          coordinates2[coordinates2.length - 1] = finishCoordinate;
          this.createOrUpdateSketchPoint_(finishCoordinate);
        }
        sketchLineGeom.setCoordinates(coordinates2);
        this.geometryFunction_(this.sketchCoords_, geometry2, projection);
      }
      if (coordinates2.length === 1) {
        this.abortDrawing();
      }
      this.updateSketchFeatures_();
    };
    Draw2.prototype.finishDrawing = function() {
      var sketchFeature = this.abortDrawing_();
      if (!sketchFeature) {
        return;
      }
      var coordinates2 = this.sketchCoords_;
      var geometry2 = sketchFeature.getGeometry();
      var projection = this.getMap().getView().getProjection();
      if (this.mode_ === Mode2.LINE_STRING) {
        coordinates2.pop();
        this.geometryFunction_(coordinates2, geometry2, projection);
      } else if (this.mode_ === Mode2.POLYGON) {
        coordinates2[0].pop();
        this.geometryFunction_(coordinates2, geometry2, projection);
        coordinates2 = geometry2.getCoordinates();
      }
      if (this.type_ === "MultiPoint") {
        sketchFeature.setGeometry(new MultiPoint_default([
          /** @type {PointCoordType} */
          coordinates2
        ]));
      } else if (this.type_ === "MultiLineString") {
        sketchFeature.setGeometry(new MultiLineString_default([
          /** @type {LineCoordType} */
          coordinates2
        ]));
      } else if (this.type_ === "MultiPolygon") {
        sketchFeature.setGeometry(new MultiPolygon_default([
          /** @type {PolyCoordType} */
          coordinates2
        ]));
      }
      this.dispatchEvent(new DrawEvent(DrawEventType.DRAWEND, sketchFeature));
      if (this.features_) {
        this.features_.push(sketchFeature);
      }
      if (this.source_) {
        this.source_.addFeature(sketchFeature);
      }
    };
    Draw2.prototype.abortDrawing_ = function() {
      this.finishCoordinate_ = null;
      var sketchFeature = this.sketchFeature_;
      this.sketchFeature_ = null;
      this.sketchPoint_ = null;
      this.sketchLine_ = null;
      this.overlay_.getSource().clear(true);
      return sketchFeature;
    };
    Draw2.prototype.abortDrawing = function() {
      var sketchFeature = this.abortDrawing_();
      if (sketchFeature) {
        this.dispatchEvent(new DrawEvent(DrawEventType.DRAWABORT, sketchFeature));
      }
    };
    Draw2.prototype.appendCoordinates = function(coordinates2) {
      var mode = this.mode_;
      var newDrawing = !this.sketchFeature_;
      if (newDrawing) {
        this.startDrawing_(coordinates2[0]);
      }
      var sketchCoords;
      if (mode === Mode2.LINE_STRING || mode === Mode2.CIRCLE) {
        sketchCoords = /** @type {LineCoordType} */
        this.sketchCoords_;
      } else if (mode === Mode2.POLYGON) {
        sketchCoords = this.sketchCoords_ && this.sketchCoords_.length ? (
          /** @type {PolyCoordType} */
          this.sketchCoords_[0]
        ) : [];
      } else {
        return;
      }
      if (newDrawing) {
        sketchCoords.shift();
      }
      sketchCoords.pop();
      for (var i2 = 0; i2 < coordinates2.length; i2++) {
        this.addToDrawing_(coordinates2[i2]);
      }
      var ending = coordinates2[coordinates2.length - 1];
      this.addToDrawing_(ending);
      this.modifyDrawing_(ending);
    };
    Draw2.prototype.extend = function(feature) {
      var geometry2 = feature.getGeometry();
      var lineString = geometry2;
      this.sketchFeature_ = feature;
      this.sketchCoords_ = lineString.getCoordinates();
      var last2 = this.sketchCoords_[this.sketchCoords_.length - 1];
      this.finishCoordinate_ = last2.slice();
      this.sketchCoords_.push(last2.slice());
      this.sketchPoint_ = new Feature_default2(new Point_default(last2));
      this.updateSketchFeatures_();
      this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));
    };
    Draw2.prototype.updateSketchFeatures_ = function() {
      var sketchFeatures = [];
      if (this.sketchFeature_) {
        sketchFeatures.push(this.sketchFeature_);
      }
      if (this.sketchLine_) {
        sketchFeatures.push(this.sketchLine_);
      }
      if (this.sketchPoint_) {
        sketchFeatures.push(this.sketchPoint_);
      }
      var overlaySource = this.overlay_.getSource();
      overlaySource.clear(true);
      overlaySource.addFeatures(sketchFeatures);
    };
    Draw2.prototype.updateState_ = function() {
      var map2 = this.getMap();
      var active = this.getActive();
      if (!map2 || !active) {
        this.abortDrawing();
      }
      this.overlay_.setMap(active ? map2 : null);
    };
    return Draw2;
  }(Pointer_default)
);
function getDefaultStyleFunction() {
  var styles = createEditingStyle();
  return function(feature, resolution) {
    return styles[feature.getGeometry().getType()];
  };
}
function createRegularPolygon(opt_sides, opt_angle) {
  return function(coordinates2, opt_geometry, projection) {
    var center = fromUserCoordinate(
      /** @type {LineCoordType} */
      coordinates2[0],
      projection
    );
    var end = fromUserCoordinate(
      /** @type {LineCoordType} */
      coordinates2[coordinates2.length - 1],
      projection
    );
    var radius = Math.sqrt(squaredDistance2(center, end));
    var geometry2 = opt_geometry ? (
      /** @type {Polygon} */
      opt_geometry
    ) : fromCircle(new Circle_default2(center), opt_sides);
    var angle = opt_angle;
    if (!opt_angle && opt_angle !== 0) {
      var x = end[0] - center[0];
      var y = end[1] - center[1];
      angle = Math.atan2(y, x);
    }
    makeRegular(geometry2, center, radius, angle);
    var userProjection2 = getUserProjection();
    if (userProjection2) {
      geometry2.transform(projection, userProjection2);
    }
    return geometry2;
  };
}
function createBox() {
  return function(coordinates2, opt_geometry, projection) {
    var extent = boundingExtent(
      /** @type {LineCoordType} */
      [
        coordinates2[0],
        coordinates2[coordinates2.length - 1]
      ].map(function(coordinate) {
        return fromUserCoordinate(coordinate, projection);
      })
    );
    var boxCoordinates = [
      [
        getBottomLeft(extent),
        getBottomRight(extent),
        getTopRight(extent),
        getTopLeft(extent),
        getBottomLeft(extent)
      ]
    ];
    var geometry2 = opt_geometry;
    if (geometry2) {
      geometry2.setCoordinates(boxCoordinates);
    } else {
      geometry2 = new Polygon_default(boxCoordinates);
    }
    var userProjection2 = getUserProjection();
    if (userProjection2) {
      geometry2.transform(projection, userProjection2);
    }
    return geometry2;
  };
}
function getMode(type) {
  switch (type) {
    case "Point":
    case "MultiPoint":
      return Mode2.POINT;
    case "LineString":
    case "MultiLineString":
      return Mode2.LINE_STRING;
    case "Polygon":
    case "MultiPolygon":
      return Mode2.POLYGON;
    case "Circle":
      return Mode2.CIRCLE;
    default:
      throw new Error("Invalid type: " + type);
  }
}
var Draw_default = Draw;

// node_modules/ol/interaction/Modify.js
var __extends86 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var CIRCLE_CENTER_INDEX = 0;
var CIRCLE_CIRCUMFERENCE_INDEX = 1;
var tempExtent = [0, 0, 0, 0];
var tempSegment = [];
var ModifyEventType = {
  /**
   * Triggered upon feature modification start
   * @event ModifyEvent#modifystart
   * @api
   */
  MODIFYSTART: "modifystart",
  /**
   * Triggered upon feature modification end
   * @event ModifyEvent#modifyend
   * @api
   */
  MODIFYEND: "modifyend"
};
var ModifyEvent = (
  /** @class */
  function(_super) {
    __extends86(ModifyEvent2, _super);
    function ModifyEvent2(type, features, mapBrowserEvent) {
      var _this = _super.call(this, type) || this;
      _this.features = features;
      _this.mapBrowserEvent = mapBrowserEvent;
      return _this;
    }
    return ModifyEvent2;
  }(Event_default)
);
var Modify = (
  /** @class */
  function(_super) {
    __extends86(Modify2, _super);
    function Modify2(options) {
      var _this = _super.call(
        this,
        /** @type {import("./Pointer.js").Options} */
        options
      ) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.boundHandleFeatureChange_ = _this.handleFeatureChange_.bind(_this);
      _this.condition_ = options.condition ? options.condition : primaryAction;
      _this.defaultDeleteCondition_ = function(mapBrowserEvent) {
        return altKeyOnly(mapBrowserEvent) && singleClick(mapBrowserEvent);
      };
      _this.deleteCondition_ = options.deleteCondition ? options.deleteCondition : _this.defaultDeleteCondition_;
      _this.insertVertexCondition_ = options.insertVertexCondition ? options.insertVertexCondition : always;
      _this.vertexFeature_ = null;
      _this.vertexSegments_ = null;
      _this.lastPixel_ = [0, 0];
      _this.ignoreNextSingleClick_ = false;
      _this.featuresBeingModified_ = null;
      _this.rBush_ = new RBush_default();
      _this.pixelTolerance_ = options.pixelTolerance !== void 0 ? options.pixelTolerance : 10;
      _this.snappedToVertex_ = false;
      _this.changingFeature_ = false;
      _this.dragSegments_ = [];
      _this.overlay_ = new Vector_default({
        source: new Vector_default2({
          useSpatialIndex: false,
          wrapX: !!options.wrapX
        }),
        style: options.style ? options.style : getDefaultStyleFunction2(),
        updateWhileAnimating: true,
        updateWhileInteracting: true
      });
      _this.SEGMENT_WRITERS_ = {
        "Point": _this.writePointGeometry_.bind(_this),
        "LineString": _this.writeLineStringGeometry_.bind(_this),
        "LinearRing": _this.writeLineStringGeometry_.bind(_this),
        "Polygon": _this.writePolygonGeometry_.bind(_this),
        "MultiPoint": _this.writeMultiPointGeometry_.bind(_this),
        "MultiLineString": _this.writeMultiLineStringGeometry_.bind(_this),
        "MultiPolygon": _this.writeMultiPolygonGeometry_.bind(_this),
        "Circle": _this.writeCircleGeometry_.bind(_this),
        "GeometryCollection": _this.writeGeometryCollectionGeometry_.bind(_this)
      };
      _this.source_ = null;
      _this.hitDetection_ = null;
      var features;
      if (options.features) {
        features = options.features;
      } else if (options.source) {
        _this.source_ = options.source;
        features = new Collection_default(_this.source_.getFeatures());
        _this.source_.addEventListener(VectorEventType_default.ADDFEATURE, _this.handleSourceAdd_.bind(_this));
        _this.source_.addEventListener(VectorEventType_default.REMOVEFEATURE, _this.handleSourceRemove_.bind(_this));
      }
      if (!features) {
        throw new Error("The modify interaction requires features, a source or a layer");
      }
      if (options.hitDetection) {
        _this.hitDetection_ = options.hitDetection;
      }
      _this.features_ = features;
      _this.features_.forEach(_this.addFeature_.bind(_this));
      _this.features_.addEventListener(CollectionEventType_default.ADD, _this.handleFeatureAdd_.bind(_this));
      _this.features_.addEventListener(CollectionEventType_default.REMOVE, _this.handleFeatureRemove_.bind(_this));
      _this.lastPointerEvent_ = null;
      _this.delta_ = [0, 0];
      _this.snapToPointer_ = options.snapToPointer === void 0 ? !_this.hitDetection_ : options.snapToPointer;
      return _this;
    }
    Modify2.prototype.addFeature_ = function(feature) {
      var geometry2 = feature.getGeometry();
      if (geometry2) {
        var writer = this.SEGMENT_WRITERS_[geometry2.getType()];
        if (writer) {
          writer(feature, geometry2);
        }
      }
      var map2 = this.getMap();
      if (map2 && map2.isRendered() && this.getActive()) {
        this.handlePointerAtPixel_(this.lastPixel_, map2);
      }
      feature.addEventListener(EventType_default.CHANGE, this.boundHandleFeatureChange_);
    };
    Modify2.prototype.willModifyFeatures_ = function(evt, segments) {
      if (!this.featuresBeingModified_) {
        this.featuresBeingModified_ = new Collection_default();
        var features = this.featuresBeingModified_.getArray();
        for (var i2 = 0, ii = segments.length; i2 < ii; ++i2) {
          var segment = segments[i2];
          for (var s = 0, ss = segment.length; s < ss; ++s) {
            var feature = segment[s].feature;
            if (feature && features.indexOf(feature) === -1) {
              this.featuresBeingModified_.push(feature);
            }
          }
        }
        if (this.featuresBeingModified_.getLength() === 0) {
          this.featuresBeingModified_ = null;
        } else {
          this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYSTART, this.featuresBeingModified_, evt));
        }
      }
    };
    Modify2.prototype.removeFeature_ = function(feature) {
      this.removeFeatureSegmentData_(feature);
      if (this.vertexFeature_ && this.features_.getLength() === 0) {
        this.overlay_.getSource().removeFeature(this.vertexFeature_);
        this.vertexFeature_ = null;
      }
      feature.removeEventListener(EventType_default.CHANGE, this.boundHandleFeatureChange_);
    };
    Modify2.prototype.removeFeatureSegmentData_ = function(feature) {
      var rBush = this.rBush_;
      var nodesToRemove = [];
      rBush.forEach(
        /**
         * @param {SegmentData} node RTree node.
         */
        function(node) {
          if (feature === node.feature) {
            nodesToRemove.push(node);
          }
        }
      );
      for (var i2 = nodesToRemove.length - 1; i2 >= 0; --i2) {
        var nodeToRemove = nodesToRemove[i2];
        for (var j = this.dragSegments_.length - 1; j >= 0; --j) {
          if (this.dragSegments_[j][0] === nodeToRemove) {
            this.dragSegments_.splice(j, 1);
          }
        }
        rBush.remove(nodeToRemove);
      }
    };
    Modify2.prototype.setActive = function(active) {
      if (this.vertexFeature_ && !active) {
        this.overlay_.getSource().removeFeature(this.vertexFeature_);
        this.vertexFeature_ = null;
      }
      _super.prototype.setActive.call(this, active);
    };
    Modify2.prototype.setMap = function(map2) {
      this.overlay_.setMap(map2);
      _super.prototype.setMap.call(this, map2);
    };
    Modify2.prototype.getOverlay = function() {
      return this.overlay_;
    };
    Modify2.prototype.handleSourceAdd_ = function(event) {
      if (event.feature) {
        this.features_.push(event.feature);
      }
    };
    Modify2.prototype.handleSourceRemove_ = function(event) {
      if (event.feature) {
        this.features_.remove(event.feature);
      }
    };
    Modify2.prototype.handleFeatureAdd_ = function(evt) {
      this.addFeature_(
        /** @type {Feature} */
        evt.element
      );
    };
    Modify2.prototype.handleFeatureChange_ = function(evt) {
      if (!this.changingFeature_) {
        var feature = (
          /** @type {Feature} */
          evt.target
        );
        this.removeFeature_(feature);
        this.addFeature_(feature);
      }
    };
    Modify2.prototype.handleFeatureRemove_ = function(evt) {
      var feature = (
        /** @type {Feature} */
        evt.element
      );
      this.removeFeature_(feature);
    };
    Modify2.prototype.writePointGeometry_ = function(feature, geometry2) {
      var coordinates2 = geometry2.getCoordinates();
      var segmentData = {
        feature,
        geometry: geometry2,
        segment: [coordinates2, coordinates2]
      };
      this.rBush_.insert(geometry2.getExtent(), segmentData);
    };
    Modify2.prototype.writeMultiPointGeometry_ = function(feature, geometry2) {
      var points = geometry2.getCoordinates();
      for (var i2 = 0, ii = points.length; i2 < ii; ++i2) {
        var coordinates2 = points[i2];
        var segmentData = {
          feature,
          geometry: geometry2,
          depth: [i2],
          index: i2,
          segment: [coordinates2, coordinates2]
        };
        this.rBush_.insert(geometry2.getExtent(), segmentData);
      }
    };
    Modify2.prototype.writeLineStringGeometry_ = function(feature, geometry2) {
      var coordinates2 = geometry2.getCoordinates();
      for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
        var segment = coordinates2.slice(i2, i2 + 2);
        var segmentData = {
          feature,
          geometry: geometry2,
          index: i2,
          segment
        };
        this.rBush_.insert(boundingExtent(segment), segmentData);
      }
    };
    Modify2.prototype.writeMultiLineStringGeometry_ = function(feature, geometry2) {
      var lines = geometry2.getCoordinates();
      for (var j = 0, jj = lines.length; j < jj; ++j) {
        var coordinates2 = lines[j];
        for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
          var segment = coordinates2.slice(i2, i2 + 2);
          var segmentData = {
            feature,
            geometry: geometry2,
            depth: [j],
            index: i2,
            segment
          };
          this.rBush_.insert(boundingExtent(segment), segmentData);
        }
      }
    };
    Modify2.prototype.writePolygonGeometry_ = function(feature, geometry2) {
      var rings = geometry2.getCoordinates();
      for (var j = 0, jj = rings.length; j < jj; ++j) {
        var coordinates2 = rings[j];
        for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
          var segment = coordinates2.slice(i2, i2 + 2);
          var segmentData = {
            feature,
            geometry: geometry2,
            depth: [j],
            index: i2,
            segment
          };
          this.rBush_.insert(boundingExtent(segment), segmentData);
        }
      }
    };
    Modify2.prototype.writeMultiPolygonGeometry_ = function(feature, geometry2) {
      var polygons = geometry2.getCoordinates();
      for (var k = 0, kk = polygons.length; k < kk; ++k) {
        var rings = polygons[k];
        for (var j = 0, jj = rings.length; j < jj; ++j) {
          var coordinates2 = rings[j];
          for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
            var segment = coordinates2.slice(i2, i2 + 2);
            var segmentData = {
              feature,
              geometry: geometry2,
              depth: [j, k],
              index: i2,
              segment
            };
            this.rBush_.insert(boundingExtent(segment), segmentData);
          }
        }
      }
    };
    Modify2.prototype.writeCircleGeometry_ = function(feature, geometry2) {
      var coordinates2 = geometry2.getCenter();
      var centerSegmentData = {
        feature,
        geometry: geometry2,
        index: CIRCLE_CENTER_INDEX,
        segment: [coordinates2, coordinates2]
      };
      var circumferenceSegmentData = {
        feature,
        geometry: geometry2,
        index: CIRCLE_CIRCUMFERENCE_INDEX,
        segment: [coordinates2, coordinates2]
      };
      var featureSegments = [centerSegmentData, circumferenceSegmentData];
      centerSegmentData.featureSegments = featureSegments;
      circumferenceSegmentData.featureSegments = featureSegments;
      this.rBush_.insert(createOrUpdateFromCoordinate(coordinates2), centerSegmentData);
      var circleGeometry = (
        /** @type {import("../geom/Geometry.js").default} */
        geometry2
      );
      var userProjection2 = getUserProjection();
      if (userProjection2 && this.getMap()) {
        var projection = this.getMap().getView().getProjection();
        circleGeometry = circleGeometry.clone().transform(userProjection2, projection);
        circleGeometry = fromCircle(
          /** @type {import("../geom/Circle.js").default} */
          circleGeometry
        ).transform(projection, userProjection2);
      }
      this.rBush_.insert(circleGeometry.getExtent(), circumferenceSegmentData);
    };
    Modify2.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry2) {
      var geometries = geometry2.getGeometriesArray();
      for (var i2 = 0; i2 < geometries.length; ++i2) {
        var geometry_1 = geometries[i2];
        var writer = this.SEGMENT_WRITERS_[geometry_1.getType()];
        writer(feature, geometry_1);
      }
    };
    Modify2.prototype.createOrUpdateVertexFeature_ = function(coordinates2, features, geometries) {
      var vertexFeature = this.vertexFeature_;
      if (!vertexFeature) {
        vertexFeature = new Feature_default2(new Point_default(coordinates2));
        this.vertexFeature_ = vertexFeature;
        this.overlay_.getSource().addFeature(vertexFeature);
      } else {
        var geometry2 = vertexFeature.getGeometry();
        geometry2.setCoordinates(coordinates2);
      }
      vertexFeature.set("features", features);
      vertexFeature.set("geometries", geometries);
      return vertexFeature;
    };
    Modify2.prototype.handleEvent = function(mapBrowserEvent) {
      if (!mapBrowserEvent.originalEvent) {
        return true;
      }
      this.lastPointerEvent_ = mapBrowserEvent;
      var handled;
      if (!mapBrowserEvent.map.getView().getInteracting() && mapBrowserEvent.type == MapBrowserEventType_default.POINTERMOVE && !this.handlingDownUpSequence) {
        this.handlePointerMove_(mapBrowserEvent);
      }
      if (this.vertexFeature_ && this.deleteCondition_(mapBrowserEvent)) {
        if (mapBrowserEvent.type != MapBrowserEventType_default.SINGLECLICK || !this.ignoreNextSingleClick_) {
          handled = this.removePoint();
        } else {
          handled = true;
        }
      }
      if (mapBrowserEvent.type == MapBrowserEventType_default.SINGLECLICK) {
        this.ignoreNextSingleClick_ = false;
      }
      return _super.prototype.handleEvent.call(this, mapBrowserEvent) && !handled;
    };
    Modify2.prototype.handleDragEvent = function(evt) {
      this.ignoreNextSingleClick_ = false;
      this.willModifyFeatures_(evt, this.dragSegments_);
      var vertex = [
        evt.coordinate[0] + this.delta_[0],
        evt.coordinate[1] + this.delta_[1]
      ];
      var features = [];
      var geometries = [];
      for (var i2 = 0, ii = this.dragSegments_.length; i2 < ii; ++i2) {
        var dragSegment = this.dragSegments_[i2];
        var segmentData = dragSegment[0];
        var feature = segmentData.feature;
        if (features.indexOf(feature) === -1) {
          features.push(feature);
        }
        var geometry2 = segmentData.geometry;
        if (geometries.indexOf(geometry2) === -1) {
          geometries.push(geometry2);
        }
        var depth = segmentData.depth;
        var coordinates2 = void 0;
        var segment = segmentData.segment;
        var index = dragSegment[1];
        while (vertex.length < geometry2.getStride()) {
          vertex.push(segment[index][vertex.length]);
        }
        switch (geometry2.getType()) {
          case "Point":
            coordinates2 = vertex;
            segment[0] = vertex;
            segment[1] = vertex;
            break;
          case "MultiPoint":
            coordinates2 = geometry2.getCoordinates();
            coordinates2[segmentData.index] = vertex;
            segment[0] = vertex;
            segment[1] = vertex;
            break;
          case "LineString":
            coordinates2 = geometry2.getCoordinates();
            coordinates2[segmentData.index + index] = vertex;
            segment[index] = vertex;
            break;
          case "MultiLineString":
            coordinates2 = geometry2.getCoordinates();
            coordinates2[depth[0]][segmentData.index + index] = vertex;
            segment[index] = vertex;
            break;
          case "Polygon":
            coordinates2 = geometry2.getCoordinates();
            coordinates2[depth[0]][segmentData.index + index] = vertex;
            segment[index] = vertex;
            break;
          case "MultiPolygon":
            coordinates2 = geometry2.getCoordinates();
            coordinates2[depth[1]][depth[0]][segmentData.index + index] = vertex;
            segment[index] = vertex;
            break;
          case "Circle":
            segment[0] = vertex;
            segment[1] = vertex;
            if (segmentData.index === CIRCLE_CENTER_INDEX) {
              this.changingFeature_ = true;
              geometry2.setCenter(vertex);
              this.changingFeature_ = false;
            } else {
              this.changingFeature_ = true;
              var projection = evt.map.getView().getProjection();
              var radius = distance(fromUserCoordinate(geometry2.getCenter(), projection), fromUserCoordinate(vertex, projection));
              var userProjection2 = getUserProjection();
              if (userProjection2) {
                var circleGeometry = geometry2.clone().transform(userProjection2, projection);
                circleGeometry.setRadius(radius);
                radius = circleGeometry.transform(projection, userProjection2).getRadius();
              }
              geometry2.setRadius(radius);
              this.changingFeature_ = false;
            }
            break;
          default:
        }
        if (coordinates2) {
          this.setGeometryCoordinates_(geometry2, coordinates2);
        }
      }
      this.createOrUpdateVertexFeature_(vertex, features, geometries);
    };
    Modify2.prototype.handleDownEvent = function(evt) {
      if (!this.condition_(evt)) {
        return false;
      }
      var pixelCoordinate = evt.coordinate;
      this.handlePointerAtPixel_(evt.pixel, evt.map, pixelCoordinate);
      this.dragSegments_.length = 0;
      this.featuresBeingModified_ = null;
      var vertexFeature = this.vertexFeature_;
      if (vertexFeature) {
        var projection = evt.map.getView().getProjection();
        var insertVertices = [];
        var vertex = vertexFeature.getGeometry().getCoordinates();
        var vertexExtent = boundingExtent([vertex]);
        var segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
        var componentSegments = {};
        segmentDataMatches.sort(compareIndexes);
        for (var i2 = 0, ii = segmentDataMatches.length; i2 < ii; ++i2) {
          var segmentDataMatch = segmentDataMatches[i2];
          var segment = segmentDataMatch.segment;
          var uid = getUid(segmentDataMatch.geometry);
          var depth = segmentDataMatch.depth;
          if (depth) {
            uid += "-" + depth.join("-");
          }
          if (!componentSegments[uid]) {
            componentSegments[uid] = new Array(2);
          }
          if (segmentDataMatch.geometry.getType() === "Circle" && segmentDataMatch.index === CIRCLE_CIRCUMFERENCE_INDEX) {
            var closestVertex = closestOnSegmentData(pixelCoordinate, segmentDataMatch, projection);
            if (equals3(closestVertex, vertex) && !componentSegments[uid][0]) {
              this.dragSegments_.push([segmentDataMatch, 0]);
              componentSegments[uid][0] = segmentDataMatch;
            }
            continue;
          }
          if (equals3(segment[0], vertex) && !componentSegments[uid][0]) {
            this.dragSegments_.push([segmentDataMatch, 0]);
            componentSegments[uid][0] = segmentDataMatch;
            continue;
          }
          if (equals3(segment[1], vertex) && !componentSegments[uid][1]) {
            if (componentSegments[uid][0] && componentSegments[uid][0].index === 0) {
              var coordinates2 = segmentDataMatch.geometry.getCoordinates();
              switch (segmentDataMatch.geometry.getType()) {
                case "LineString":
                case "MultiLineString":
                  continue;
                case "MultiPolygon":
                  coordinates2 = coordinates2[depth[1]];
                case "Polygon":
                  if (segmentDataMatch.index !== coordinates2[depth[0]].length - 2) {
                    continue;
                  }
                  break;
                default:
              }
            }
            this.dragSegments_.push([segmentDataMatch, 1]);
            componentSegments[uid][1] = segmentDataMatch;
            continue;
          }
          if (getUid(segment) in this.vertexSegments_ && !componentSegments[uid][0] && !componentSegments[uid][1] && this.insertVertexCondition_(evt)) {
            insertVertices.push(segmentDataMatch);
          }
        }
        if (insertVertices.length) {
          this.willModifyFeatures_(evt, [insertVertices]);
        }
        for (var j = insertVertices.length - 1; j >= 0; --j) {
          this.insertVertex_(insertVertices[j], vertex);
        }
      }
      return !!this.vertexFeature_;
    };
    Modify2.prototype.handleUpEvent = function(evt) {
      for (var i2 = this.dragSegments_.length - 1; i2 >= 0; --i2) {
        var segmentData = this.dragSegments_[i2][0];
        var geometry2 = segmentData.geometry;
        if (geometry2.getType() === "Circle") {
          var coordinates2 = geometry2.getCenter();
          var centerSegmentData = segmentData.featureSegments[0];
          var circumferenceSegmentData = segmentData.featureSegments[1];
          centerSegmentData.segment[0] = coordinates2;
          centerSegmentData.segment[1] = coordinates2;
          circumferenceSegmentData.segment[0] = coordinates2;
          circumferenceSegmentData.segment[1] = coordinates2;
          this.rBush_.update(createOrUpdateFromCoordinate(coordinates2), centerSegmentData);
          var circleGeometry = geometry2;
          var userProjection2 = getUserProjection();
          if (userProjection2) {
            var projection = evt.map.getView().getProjection();
            circleGeometry = circleGeometry.clone().transform(userProjection2, projection);
            circleGeometry = fromCircle(circleGeometry).transform(projection, userProjection2);
          }
          this.rBush_.update(circleGeometry.getExtent(), circumferenceSegmentData);
        } else {
          this.rBush_.update(boundingExtent(segmentData.segment), segmentData);
        }
      }
      if (this.featuresBeingModified_) {
        this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));
        this.featuresBeingModified_ = null;
      }
      return false;
    };
    Modify2.prototype.handlePointerMove_ = function(evt) {
      this.lastPixel_ = evt.pixel;
      this.handlePointerAtPixel_(evt.pixel, evt.map, evt.coordinate);
    };
    Modify2.prototype.handlePointerAtPixel_ = function(pixel, map2, opt_coordinate) {
      var _this = this;
      var pixelCoordinate = opt_coordinate || map2.getCoordinateFromPixel(pixel);
      var projection = map2.getView().getProjection();
      var sortByDistance = function(a, b) {
        return projectedDistanceToSegmentDataSquared(pixelCoordinate, a, projection) - projectedDistanceToSegmentDataSquared(pixelCoordinate, b, projection);
      };
      var nodes;
      var hitPointGeometry;
      if (this.hitDetection_) {
        var layerFilter = typeof this.hitDetection_ === "object" ? function(layer) {
          return layer === _this.hitDetection_;
        } : void 0;
        map2.forEachFeatureAtPixel(pixel, function(feature, layer, geometry2) {
          geometry2 = geometry2 || /** @type {import("../geom/SimpleGeometry").default} */
          feature.getGeometry();
          if (geometry2.getType() === "Point" && includes(_this.features_.getArray(), feature)) {
            hitPointGeometry = geometry2;
            var coordinate = geometry2.getFlatCoordinates().slice(0, 2);
            nodes = [
              {
                feature,
                geometry: geometry2,
                segment: [coordinate, coordinate]
              }
            ];
          }
          return true;
        }, { layerFilter });
      }
      if (!nodes) {
        var viewExtent = fromUserExtent(createOrUpdateFromCoordinate(pixelCoordinate, tempExtent), projection);
        var buffer3 = map2.getView().getResolution() * this.pixelTolerance_;
        var box = toUserExtent(buffer2(viewExtent, buffer3, tempExtent), projection);
        nodes = this.rBush_.getInExtent(box);
      }
      if (nodes && nodes.length > 0) {
        var node = nodes.sort(sortByDistance)[0];
        var closestSegment = node.segment;
        var vertex = closestOnSegmentData(pixelCoordinate, node, projection);
        var vertexPixel = map2.getPixelFromCoordinate(vertex);
        var dist = distance(pixel, vertexPixel);
        if (hitPointGeometry || dist <= this.pixelTolerance_) {
          var vertexSegments = {};
          vertexSegments[getUid(closestSegment)] = true;
          if (!this.snapToPointer_) {
            this.delta_[0] = vertex[0] - pixelCoordinate[0];
            this.delta_[1] = vertex[1] - pixelCoordinate[1];
          }
          if (node.geometry.getType() === "Circle" && node.index === CIRCLE_CIRCUMFERENCE_INDEX) {
            this.snappedToVertex_ = true;
            this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);
          } else {
            var pixel1 = map2.getPixelFromCoordinate(closestSegment[0]);
            var pixel2 = map2.getPixelFromCoordinate(closestSegment[1]);
            var squaredDist1 = squaredDistance2(vertexPixel, pixel1);
            var squaredDist2 = squaredDistance2(vertexPixel, pixel2);
            dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));
            this.snappedToVertex_ = dist <= this.pixelTolerance_;
            if (this.snappedToVertex_) {
              vertex = squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];
            }
            this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);
            var geometries = {};
            geometries[getUid(node.geometry)] = true;
            for (var i2 = 1, ii = nodes.length; i2 < ii; ++i2) {
              var segment = nodes[i2].segment;
              if (equals3(closestSegment[0], segment[0]) && equals3(closestSegment[1], segment[1]) || equals3(closestSegment[0], segment[1]) && equals3(closestSegment[1], segment[0])) {
                var geometryUid = getUid(nodes[i2].geometry);
                if (!(geometryUid in geometries)) {
                  geometries[geometryUid] = true;
                  vertexSegments[getUid(segment)] = true;
                }
              } else {
                break;
              }
            }
          }
          this.vertexSegments_ = vertexSegments;
          return;
        }
      }
      if (this.vertexFeature_) {
        this.overlay_.getSource().removeFeature(this.vertexFeature_);
        this.vertexFeature_ = null;
      }
    };
    Modify2.prototype.insertVertex_ = function(segmentData, vertex) {
      var segment = segmentData.segment;
      var feature = segmentData.feature;
      var geometry2 = segmentData.geometry;
      var depth = segmentData.depth;
      var index = segmentData.index;
      var coordinates2;
      while (vertex.length < geometry2.getStride()) {
        vertex.push(0);
      }
      switch (geometry2.getType()) {
        case "MultiLineString":
          coordinates2 = geometry2.getCoordinates();
          coordinates2[depth[0]].splice(index + 1, 0, vertex);
          break;
        case "Polygon":
          coordinates2 = geometry2.getCoordinates();
          coordinates2[depth[0]].splice(index + 1, 0, vertex);
          break;
        case "MultiPolygon":
          coordinates2 = geometry2.getCoordinates();
          coordinates2[depth[1]][depth[0]].splice(index + 1, 0, vertex);
          break;
        case "LineString":
          coordinates2 = geometry2.getCoordinates();
          coordinates2.splice(index + 1, 0, vertex);
          break;
        default:
          return;
      }
      this.setGeometryCoordinates_(geometry2, coordinates2);
      var rTree = this.rBush_;
      rTree.remove(segmentData);
      this.updateSegmentIndices_(geometry2, index, depth, 1);
      var newSegmentData = {
        segment: [segment[0], vertex],
        feature,
        geometry: geometry2,
        depth,
        index
      };
      rTree.insert(boundingExtent(newSegmentData.segment), newSegmentData);
      this.dragSegments_.push([newSegmentData, 1]);
      var newSegmentData2 = {
        segment: [vertex, segment[1]],
        feature,
        geometry: geometry2,
        depth,
        index: index + 1
      };
      rTree.insert(boundingExtent(newSegmentData2.segment), newSegmentData2);
      this.dragSegments_.push([newSegmentData2, 0]);
      this.ignoreNextSingleClick_ = true;
    };
    Modify2.prototype.removePoint = function() {
      if (this.lastPointerEvent_ && this.lastPointerEvent_.type != MapBrowserEventType_default.POINTERDRAG) {
        var evt = this.lastPointerEvent_;
        this.willModifyFeatures_(evt, this.dragSegments_);
        var removed = this.removeVertex_();
        if (this.featuresBeingModified_) {
          this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));
        }
        this.featuresBeingModified_ = null;
        return removed;
      }
      return false;
    };
    Modify2.prototype.removeVertex_ = function() {
      var dragSegments = this.dragSegments_;
      var segmentsByFeature = {};
      var deleted = false;
      var component, coordinates2, dragSegment, geometry2, i2, index, left;
      var newIndex, right, segmentData, uid;
      for (i2 = dragSegments.length - 1; i2 >= 0; --i2) {
        dragSegment = dragSegments[i2];
        segmentData = dragSegment[0];
        uid = getUid(segmentData.feature);
        if (segmentData.depth) {
          uid += "-" + segmentData.depth.join("-");
        }
        if (!(uid in segmentsByFeature)) {
          segmentsByFeature[uid] = {};
        }
        if (dragSegment[1] === 0) {
          segmentsByFeature[uid].right = segmentData;
          segmentsByFeature[uid].index = segmentData.index;
        } else if (dragSegment[1] == 1) {
          segmentsByFeature[uid].left = segmentData;
          segmentsByFeature[uid].index = segmentData.index + 1;
        }
      }
      for (uid in segmentsByFeature) {
        right = segmentsByFeature[uid].right;
        left = segmentsByFeature[uid].left;
        index = segmentsByFeature[uid].index;
        newIndex = index - 1;
        if (left !== void 0) {
          segmentData = left;
        } else {
          segmentData = right;
        }
        if (newIndex < 0) {
          newIndex = 0;
        }
        geometry2 = segmentData.geometry;
        coordinates2 = geometry2.getCoordinates();
        component = coordinates2;
        deleted = false;
        switch (geometry2.getType()) {
          case "MultiLineString":
            if (coordinates2[segmentData.depth[0]].length > 2) {
              coordinates2[segmentData.depth[0]].splice(index, 1);
              deleted = true;
            }
            break;
          case "LineString":
            if (coordinates2.length > 2) {
              coordinates2.splice(index, 1);
              deleted = true;
            }
            break;
          case "MultiPolygon":
            component = component[segmentData.depth[1]];
          case "Polygon":
            component = component[segmentData.depth[0]];
            if (component.length > 4) {
              if (index == component.length - 1) {
                index = 0;
              }
              component.splice(index, 1);
              deleted = true;
              if (index === 0) {
                component.pop();
                component.push(component[0]);
                newIndex = component.length - 1;
              }
            }
            break;
          default:
        }
        if (deleted) {
          this.setGeometryCoordinates_(geometry2, coordinates2);
          var segments = [];
          if (left !== void 0) {
            this.rBush_.remove(left);
            segments.push(left.segment[0]);
          }
          if (right !== void 0) {
            this.rBush_.remove(right);
            segments.push(right.segment[1]);
          }
          if (left !== void 0 && right !== void 0) {
            var newSegmentData = {
              depth: segmentData.depth,
              feature: segmentData.feature,
              geometry: segmentData.geometry,
              index: newIndex,
              segment: segments
            };
            this.rBush_.insert(boundingExtent(newSegmentData.segment), newSegmentData);
          }
          this.updateSegmentIndices_(geometry2, index, segmentData.depth, -1);
          if (this.vertexFeature_) {
            this.overlay_.getSource().removeFeature(this.vertexFeature_);
            this.vertexFeature_ = null;
          }
          dragSegments.length = 0;
        }
      }
      return deleted;
    };
    Modify2.prototype.setGeometryCoordinates_ = function(geometry2, coordinates2) {
      this.changingFeature_ = true;
      geometry2.setCoordinates(coordinates2);
      this.changingFeature_ = false;
    };
    Modify2.prototype.updateSegmentIndices_ = function(geometry2, index, depth, delta) {
      this.rBush_.forEachInExtent(geometry2.getExtent(), function(segmentDataMatch) {
        if (segmentDataMatch.geometry === geometry2 && (depth === void 0 || segmentDataMatch.depth === void 0 || equals(segmentDataMatch.depth, depth)) && segmentDataMatch.index > index) {
          segmentDataMatch.index += delta;
        }
      });
    };
    return Modify2;
  }(Pointer_default)
);
function compareIndexes(a, b) {
  return a.index - b.index;
}
function projectedDistanceToSegmentDataSquared(pointCoordinates, segmentData, projection) {
  var geometry2 = segmentData.geometry;
  if (geometry2.getType() === "Circle") {
    var circleGeometry = (
      /** @type {import("../geom/Circle.js").default} */
      geometry2
    );
    if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
      var userProjection2 = getUserProjection();
      if (userProjection2) {
        circleGeometry = /** @type {import("../geom/Circle.js").default} */
        circleGeometry.clone().transform(userProjection2, projection);
      }
      var distanceToCenterSquared = squaredDistance2(circleGeometry.getCenter(), fromUserCoordinate(pointCoordinates, projection));
      var distanceToCircumference = Math.sqrt(distanceToCenterSquared) - circleGeometry.getRadius();
      return distanceToCircumference * distanceToCircumference;
    }
  }
  var coordinate = fromUserCoordinate(pointCoordinates, projection);
  tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);
  tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);
  return squaredDistanceToSegment(coordinate, tempSegment);
}
function closestOnSegmentData(pointCoordinates, segmentData, projection) {
  var geometry2 = segmentData.geometry;
  if (geometry2.getType() === "Circle" && segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
    var circleGeometry = (
      /** @type {import("../geom/Circle.js").default} */
      geometry2
    );
    var userProjection2 = getUserProjection();
    if (userProjection2) {
      circleGeometry = /** @type {import("../geom/Circle.js").default} */
      circleGeometry.clone().transform(userProjection2, projection);
    }
    return toUserCoordinate(circleGeometry.getClosestPoint(fromUserCoordinate(pointCoordinates, projection)), projection);
  }
  var coordinate = fromUserCoordinate(pointCoordinates, projection);
  tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);
  tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);
  return toUserCoordinate(closestOnSegment(coordinate, tempSegment), projection);
}
function getDefaultStyleFunction2() {
  var style2 = createEditingStyle();
  return function(feature, resolution) {
    return style2["Point"];
  };
}
var Modify_default = Modify;

// node_modules/ol/interaction/Select.js
var __extends87 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var SelectEventType = {
  /**
   * Triggered when feature(s) has been (de)selected.
   * @event SelectEvent#select
   * @api
   */
  SELECT: "select"
};
var SelectEvent = (
  /** @class */
  function(_super) {
    __extends87(SelectEvent2, _super);
    function SelectEvent2(type, selected, deselected, mapBrowserEvent) {
      var _this = _super.call(this, type) || this;
      _this.selected = selected;
      _this.deselected = deselected;
      _this.mapBrowserEvent = mapBrowserEvent;
      return _this;
    }
    return SelectEvent2;
  }(Event_default)
);
var originalFeatureStyles = {};
var Select = (
  /** @class */
  function(_super) {
    __extends87(Select2, _super);
    function Select2(opt_options) {
      var _this = _super.call(this) || this;
      _this.on;
      _this.once;
      _this.un;
      var options = opt_options ? opt_options : {};
      _this.boundAddFeature_ = _this.addFeature_.bind(_this);
      _this.boundRemoveFeature_ = _this.removeFeature_.bind(_this);
      _this.condition_ = options.condition ? options.condition : singleClick;
      _this.addCondition_ = options.addCondition ? options.addCondition : never;
      _this.removeCondition_ = options.removeCondition ? options.removeCondition : never;
      _this.toggleCondition_ = options.toggleCondition ? options.toggleCondition : shiftKeyOnly;
      _this.multi_ = options.multi ? options.multi : false;
      _this.filter_ = options.filter ? options.filter : TRUE;
      _this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;
      _this.style_ = options.style !== void 0 ? options.style : getDefaultStyleFunction3();
      _this.features_ = options.features || new Collection_default();
      var layerFilter;
      if (options.layers) {
        if (typeof options.layers === "function") {
          layerFilter = options.layers;
        } else {
          var layers_1 = options.layers;
          layerFilter = function(layer) {
            return includes(layers_1, layer);
          };
        }
      } else {
        layerFilter = TRUE;
      }
      _this.layerFilter_ = layerFilter;
      _this.featureLayerAssociation_ = {};
      return _this;
    }
    Select2.prototype.addFeatureLayerAssociation_ = function(feature, layer) {
      this.featureLayerAssociation_[getUid(feature)] = layer;
    };
    Select2.prototype.getFeatures = function() {
      return this.features_;
    };
    Select2.prototype.getHitTolerance = function() {
      return this.hitTolerance_;
    };
    Select2.prototype.getLayer = function(feature) {
      return (
        /** @type {import('../layer/Vector.js').default} */
        this.featureLayerAssociation_[getUid(feature)]
      );
    };
    Select2.prototype.setHitTolerance = function(hitTolerance) {
      this.hitTolerance_ = hitTolerance;
    };
    Select2.prototype.setMap = function(map2) {
      var currentMap = this.getMap();
      if (currentMap && this.style_) {
        this.features_.forEach(this.restorePreviousStyle_.bind(this));
      }
      _super.prototype.setMap.call(this, map2);
      if (map2) {
        this.features_.addEventListener(CollectionEventType_default.ADD, this.boundAddFeature_);
        this.features_.addEventListener(CollectionEventType_default.REMOVE, this.boundRemoveFeature_);
        if (this.style_) {
          this.features_.forEach(this.applySelectedStyle_.bind(this));
        }
      } else {
        this.features_.removeEventListener(CollectionEventType_default.ADD, this.boundAddFeature_);
        this.features_.removeEventListener(CollectionEventType_default.REMOVE, this.boundRemoveFeature_);
      }
    };
    Select2.prototype.addFeature_ = function(evt) {
      var feature = evt.element;
      if (this.style_) {
        this.applySelectedStyle_(feature);
      }
      if (!this.getLayer(feature)) {
        var layer = (
          /** @type {VectorLayer} */
          this.getMap().getAllLayers().find(function(layer2) {
            if (layer2 instanceof Vector_default && layer2.getSource() && layer2.getSource().hasFeature(feature)) {
              return layer2;
            }
          })
        );
        if (layer) {
          this.addFeatureLayerAssociation_(feature, layer);
        }
      }
    };
    Select2.prototype.removeFeature_ = function(evt) {
      var feature = evt.element;
      if (this.style_) {
        this.restorePreviousStyle_(feature);
      }
    };
    Select2.prototype.getStyle = function() {
      return this.style_;
    };
    Select2.prototype.applySelectedStyle_ = function(feature) {
      var key = getUid(feature);
      if (!(key in originalFeatureStyles)) {
        originalFeatureStyles[key] = feature.getStyle();
      }
      feature.setStyle(this.style_);
    };
    Select2.prototype.restorePreviousStyle_ = function(feature) {
      var interactions = this.getMap().getInteractions().getArray();
      for (var i2 = interactions.length - 1; i2 >= 0; --i2) {
        var interaction = interactions[i2];
        if (interaction !== this && interaction instanceof Select2 && interaction.getStyle() && interaction.getFeatures().getArray().lastIndexOf(feature) !== -1) {
          feature.setStyle(interaction.getStyle());
          return;
        }
      }
      var key = getUid(feature);
      feature.setStyle(originalFeatureStyles[key]);
      delete originalFeatureStyles[key];
    };
    Select2.prototype.removeFeatureLayerAssociation_ = function(feature) {
      delete this.featureLayerAssociation_[getUid(feature)];
    };
    Select2.prototype.handleEvent = function(mapBrowserEvent) {
      if (!this.condition_(mapBrowserEvent)) {
        return true;
      }
      var add5 = this.addCondition_(mapBrowserEvent);
      var remove2 = this.removeCondition_(mapBrowserEvent);
      var toggle = this.toggleCondition_(mapBrowserEvent);
      var set2 = !add5 && !remove2 && !toggle;
      var map2 = mapBrowserEvent.map;
      var features = this.getFeatures();
      var deselected = [];
      var selected = [];
      if (set2) {
        clear(this.featureLayerAssociation_);
        map2.forEachFeatureAtPixel(
          mapBrowserEvent.pixel,
          /**
           * @param {import("../Feature.js").FeatureLike} feature Feature.
           * @param {import("../layer/Layer.js").default} layer Layer.
           * @return {boolean|undefined} Continue to iterate over the features.
           */
          (function(feature2, layer) {
            if (this.filter_(feature2, layer)) {
              this.addFeatureLayerAssociation_(feature2, layer);
              selected.push(feature2);
              return !this.multi_;
            }
          }).bind(this),
          {
            layerFilter: this.layerFilter_,
            hitTolerance: this.hitTolerance_
          }
        );
        for (var i2 = features.getLength() - 1; i2 >= 0; --i2) {
          var feature = features.item(i2);
          var index = selected.indexOf(feature);
          if (index > -1) {
            selected.splice(index, 1);
          } else {
            features.remove(feature);
            deselected.push(feature);
          }
        }
        if (selected.length !== 0) {
          features.extend(selected);
        }
      } else {
        map2.forEachFeatureAtPixel(
          mapBrowserEvent.pixel,
          /**
           * @param {import("../Feature.js").FeatureLike} feature Feature.
           * @param {import("../layer/Layer.js").default} layer Layer.
           * @return {boolean|undefined} Continue to iterate over the features.
           */
          (function(feature2, layer) {
            if (this.filter_(feature2, layer)) {
              if ((add5 || toggle) && !includes(features.getArray(), feature2)) {
                this.addFeatureLayerAssociation_(feature2, layer);
                selected.push(feature2);
              } else if ((remove2 || toggle) && includes(features.getArray(), feature2)) {
                deselected.push(feature2);
                this.removeFeatureLayerAssociation_(feature2);
              }
              return !this.multi_;
            }
          }).bind(this),
          {
            layerFilter: this.layerFilter_,
            hitTolerance: this.hitTolerance_
          }
        );
        for (var j = deselected.length - 1; j >= 0; --j) {
          features.remove(deselected[j]);
        }
        features.extend(selected);
      }
      if (selected.length > 0 || deselected.length > 0) {
        this.dispatchEvent(new SelectEvent(SelectEventType.SELECT, selected, deselected, mapBrowserEvent));
      }
      return true;
    };
    return Select2;
  }(Interaction_default)
);
function getDefaultStyleFunction3() {
  var styles = createEditingStyle();
  extend(styles["Polygon"], styles["LineString"]);
  extend(styles["GeometryCollection"], styles["LineString"]);
  return function(feature) {
    if (!feature.getGeometry()) {
      return null;
    }
    return styles[feature.getGeometry().getType()];
  };
}
var Select_default = Select;

// node_modules/ol/interaction/Snap.js
var __extends88 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
function getFeatureFromEvent(evt) {
  if (
    /** @type {import("../source/Vector.js").VectorSourceEvent} */
    evt.feature
  ) {
    return (
      /** @type {import("../source/Vector.js").VectorSourceEvent} */
      evt.feature
    );
  } else if (
    /** @type {import("../Collection.js").CollectionEvent} */
    evt.element
  ) {
    return (
      /** @type {import("../Feature.js").default} */
      /** @type {import("../Collection.js").CollectionEvent} */
      evt.element
    );
  }
}
var tempSegment2 = [];
var Snap = (
  /** @class */
  function(_super) {
    __extends88(Snap2, _super);
    function Snap2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var pointerOptions = (
        /** @type {import("./Pointer.js").Options} */
        options
      );
      if (!pointerOptions.handleDownEvent) {
        pointerOptions.handleDownEvent = TRUE;
      }
      if (!pointerOptions.stopDown) {
        pointerOptions.stopDown = FALSE;
      }
      _this = _super.call(this, pointerOptions) || this;
      _this.source_ = options.source ? options.source : null;
      _this.vertex_ = options.vertex !== void 0 ? options.vertex : true;
      _this.edge_ = options.edge !== void 0 ? options.edge : true;
      _this.features_ = options.features ? options.features : null;
      _this.featuresListenerKeys_ = [];
      _this.featureChangeListenerKeys_ = {};
      _this.indexedFeaturesExtents_ = {};
      _this.pendingFeatures_ = {};
      _this.pixelTolerance_ = options.pixelTolerance !== void 0 ? options.pixelTolerance : 10;
      _this.rBush_ = new RBush_default();
      _this.GEOMETRY_SEGMENTERS_ = {
        "Point": _this.segmentPointGeometry_.bind(_this),
        "LineString": _this.segmentLineStringGeometry_.bind(_this),
        "LinearRing": _this.segmentLineStringGeometry_.bind(_this),
        "Polygon": _this.segmentPolygonGeometry_.bind(_this),
        "MultiPoint": _this.segmentMultiPointGeometry_.bind(_this),
        "MultiLineString": _this.segmentMultiLineStringGeometry_.bind(_this),
        "MultiPolygon": _this.segmentMultiPolygonGeometry_.bind(_this),
        "GeometryCollection": _this.segmentGeometryCollectionGeometry_.bind(_this),
        "Circle": _this.segmentCircleGeometry_.bind(_this)
      };
      return _this;
    }
    Snap2.prototype.addFeature = function(feature, opt_listen) {
      var register3 = opt_listen !== void 0 ? opt_listen : true;
      var feature_uid = getUid(feature);
      var geometry2 = feature.getGeometry();
      if (geometry2) {
        var segmenter = this.GEOMETRY_SEGMENTERS_[geometry2.getType()];
        if (segmenter) {
          this.indexedFeaturesExtents_[feature_uid] = geometry2.getExtent(createEmpty());
          var segments = (
            /** @type {Array<Array<import('../coordinate.js').Coordinate>>} */
            []
          );
          segmenter(segments, geometry2);
          if (segments.length === 1) {
            this.rBush_.insert(boundingExtent(segments[0]), {
              feature,
              segment: segments[0]
            });
          } else if (segments.length > 1) {
            var extents = segments.map(function(s) {
              return boundingExtent(s);
            });
            var segmentsData = segments.map(function(segment) {
              return {
                feature,
                segment
              };
            });
            this.rBush_.load(extents, segmentsData);
          }
        }
      }
      if (register3) {
        this.featureChangeListenerKeys_[feature_uid] = listen(feature, EventType_default.CHANGE, this.handleFeatureChange_, this);
      }
    };
    Snap2.prototype.forEachFeatureAdd_ = function(feature) {
      this.addFeature(feature);
    };
    Snap2.prototype.forEachFeatureRemove_ = function(feature) {
      this.removeFeature(feature);
    };
    Snap2.prototype.getFeatures_ = function() {
      var features;
      if (this.features_) {
        features = this.features_;
      } else if (this.source_) {
        features = this.source_.getFeatures();
      }
      return features;
    };
    Snap2.prototype.handleEvent = function(evt) {
      var result = this.snapTo(evt.pixel, evt.coordinate, evt.map);
      if (result) {
        evt.coordinate = result.vertex.slice(0, 2);
        evt.pixel = result.vertexPixel;
      }
      return _super.prototype.handleEvent.call(this, evt);
    };
    Snap2.prototype.handleFeatureAdd_ = function(evt) {
      var feature = getFeatureFromEvent(evt);
      this.addFeature(feature);
    };
    Snap2.prototype.handleFeatureRemove_ = function(evt) {
      var feature = getFeatureFromEvent(evt);
      this.removeFeature(feature);
    };
    Snap2.prototype.handleFeatureChange_ = function(evt) {
      var feature = (
        /** @type {import("../Feature.js").default} */
        evt.target
      );
      if (this.handlingDownUpSequence) {
        var uid = getUid(feature);
        if (!(uid in this.pendingFeatures_)) {
          this.pendingFeatures_[uid] = feature;
        }
      } else {
        this.updateFeature_(feature);
      }
    };
    Snap2.prototype.handleUpEvent = function(evt) {
      var featuresToUpdate = getValues(this.pendingFeatures_);
      if (featuresToUpdate.length) {
        featuresToUpdate.forEach(this.updateFeature_.bind(this));
        this.pendingFeatures_ = {};
      }
      return false;
    };
    Snap2.prototype.removeFeature = function(feature, opt_unlisten) {
      var unregister = opt_unlisten !== void 0 ? opt_unlisten : true;
      var feature_uid = getUid(feature);
      var extent = this.indexedFeaturesExtents_[feature_uid];
      if (extent) {
        var rBush = this.rBush_;
        var nodesToRemove_1 = [];
        rBush.forEachInExtent(extent, function(node) {
          if (feature === node.feature) {
            nodesToRemove_1.push(node);
          }
        });
        for (var i2 = nodesToRemove_1.length - 1; i2 >= 0; --i2) {
          rBush.remove(nodesToRemove_1[i2]);
        }
      }
      if (unregister) {
        unlistenByKey(this.featureChangeListenerKeys_[feature_uid]);
        delete this.featureChangeListenerKeys_[feature_uid];
      }
    };
    Snap2.prototype.setMap = function(map2) {
      var currentMap = this.getMap();
      var keys = this.featuresListenerKeys_;
      var features = (
        /** @type {Array<import("../Feature.js").default>} */
        this.getFeatures_()
      );
      if (currentMap) {
        keys.forEach(unlistenByKey);
        keys.length = 0;
        features.forEach(this.forEachFeatureRemove_.bind(this));
      }
      _super.prototype.setMap.call(this, map2);
      if (map2) {
        if (this.features_) {
          keys.push(listen(this.features_, CollectionEventType_default.ADD, this.handleFeatureAdd_, this), listen(this.features_, CollectionEventType_default.REMOVE, this.handleFeatureRemove_, this));
        } else if (this.source_) {
          keys.push(listen(this.source_, VectorEventType_default.ADDFEATURE, this.handleFeatureAdd_, this), listen(this.source_, VectorEventType_default.REMOVEFEATURE, this.handleFeatureRemove_, this));
        }
        features.forEach(this.forEachFeatureAdd_.bind(this));
      }
    };
    Snap2.prototype.snapTo = function(pixel, pixelCoordinate, map2) {
      var lowerLeft = map2.getCoordinateFromPixel([
        pixel[0] - this.pixelTolerance_,
        pixel[1] + this.pixelTolerance_
      ]);
      var upperRight = map2.getCoordinateFromPixel([
        pixel[0] + this.pixelTolerance_,
        pixel[1] - this.pixelTolerance_
      ]);
      var box = boundingExtent([lowerLeft, upperRight]);
      var segments = this.rBush_.getInExtent(box);
      var segmentsLength = segments.length;
      if (segmentsLength === 0) {
        return null;
      }
      var projection = map2.getView().getProjection();
      var projectedCoordinate = fromUserCoordinate(pixelCoordinate, projection);
      var closestVertex;
      var minSquaredDistance = Infinity;
      var squaredPixelTolerance = this.pixelTolerance_ * this.pixelTolerance_;
      var getResult = function() {
        if (closestVertex) {
          var vertexPixel = map2.getPixelFromCoordinate(closestVertex);
          var squaredPixelDistance = squaredDistance2(pixel, vertexPixel);
          if (squaredPixelDistance <= squaredPixelTolerance) {
            return {
              vertex: closestVertex,
              vertexPixel: [
                Math.round(vertexPixel[0]),
                Math.round(vertexPixel[1])
              ]
            };
          }
        }
        return null;
      };
      if (this.vertex_) {
        for (var i2 = 0; i2 < segmentsLength; ++i2) {
          var segmentData = segments[i2];
          if (segmentData.feature.getGeometry().getType() !== "Circle") {
            segmentData.segment.forEach(function(vertex2) {
              var tempVertexCoord = fromUserCoordinate(vertex2, projection);
              var delta2 = squaredDistance2(projectedCoordinate, tempVertexCoord);
              if (delta2 < minSquaredDistance) {
                closestVertex = vertex2;
                minSquaredDistance = delta2;
              }
            });
          }
        }
        var result = getResult();
        if (result) {
          return result;
        }
      }
      if (this.edge_) {
        for (var i2 = 0; i2 < segmentsLength; ++i2) {
          var vertex = null;
          var segmentData = segments[i2];
          if (segmentData.feature.getGeometry().getType() === "Circle") {
            var circleGeometry = segmentData.feature.getGeometry();
            var userProjection2 = getUserProjection();
            if (userProjection2) {
              circleGeometry = circleGeometry.clone().transform(userProjection2, projection);
            }
            vertex = toUserCoordinate(closestOnCircle(
              projectedCoordinate,
              /** @type {import("../geom/Circle.js").default} */
              circleGeometry
            ), projection);
          } else {
            var _a56 = segmentData.segment, segmentStart = _a56[0], segmentEnd = _a56[1];
            if (segmentEnd) {
              tempSegment2[0] = fromUserCoordinate(segmentStart, projection);
              tempSegment2[1] = fromUserCoordinate(segmentEnd, projection);
              vertex = closestOnSegment(projectedCoordinate, tempSegment2);
            }
          }
          if (vertex) {
            var delta = squaredDistance2(projectedCoordinate, vertex);
            if (delta < minSquaredDistance) {
              closestVertex = vertex;
              minSquaredDistance = delta;
            }
          }
        }
        var result = getResult();
        if (result) {
          return result;
        }
      }
      return null;
    };
    Snap2.prototype.updateFeature_ = function(feature) {
      this.removeFeature(feature, false);
      this.addFeature(feature, false);
    };
    Snap2.prototype.segmentCircleGeometry_ = function(segments, geometry2) {
      var projection = this.getMap().getView().getProjection();
      var circleGeometry = geometry2;
      var userProjection2 = getUserProjection();
      if (userProjection2) {
        circleGeometry = /** @type {import("../geom/Circle.js").default} */
        circleGeometry.clone().transform(userProjection2, projection);
      }
      var polygon = fromCircle(circleGeometry);
      if (userProjection2) {
        polygon.transform(projection, userProjection2);
      }
      var coordinates2 = polygon.getCoordinates()[0];
      for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
        segments.push(coordinates2.slice(i2, i2 + 2));
      }
    };
    Snap2.prototype.segmentGeometryCollectionGeometry_ = function(segments, geometry2) {
      var geometries = geometry2.getGeometriesArray();
      for (var i2 = 0; i2 < geometries.length; ++i2) {
        var segmenter = this.GEOMETRY_SEGMENTERS_[geometries[i2].getType()];
        if (segmenter) {
          segmenter(segments, geometries[i2]);
        }
      }
    };
    Snap2.prototype.segmentLineStringGeometry_ = function(segments, geometry2) {
      var coordinates2 = geometry2.getCoordinates();
      for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
        segments.push(coordinates2.slice(i2, i2 + 2));
      }
    };
    Snap2.prototype.segmentMultiLineStringGeometry_ = function(segments, geometry2) {
      var lines = geometry2.getCoordinates();
      for (var j = 0, jj = lines.length; j < jj; ++j) {
        var coordinates2 = lines[j];
        for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
          segments.push(coordinates2.slice(i2, i2 + 2));
        }
      }
    };
    Snap2.prototype.segmentMultiPointGeometry_ = function(segments, geometry2) {
      geometry2.getCoordinates().forEach(function(point) {
        segments.push([point]);
      });
    };
    Snap2.prototype.segmentMultiPolygonGeometry_ = function(segments, geometry2) {
      var polygons = geometry2.getCoordinates();
      for (var k = 0, kk = polygons.length; k < kk; ++k) {
        var rings = polygons[k];
        for (var j = 0, jj = rings.length; j < jj; ++j) {
          var coordinates2 = rings[j];
          for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
            segments.push(coordinates2.slice(i2, i2 + 2));
          }
        }
      }
    };
    Snap2.prototype.segmentPointGeometry_ = function(segments, geometry2) {
      segments.push([geometry2.getCoordinates()]);
    };
    Snap2.prototype.segmentPolygonGeometry_ = function(segments, geometry2) {
      var rings = geometry2.getCoordinates();
      for (var j = 0, jj = rings.length; j < jj; ++j) {
        var coordinates2 = rings[j];
        for (var i2 = 0, ii = coordinates2.length - 1; i2 < ii; ++i2) {
          segments.push(coordinates2.slice(i2, i2 + 2));
        }
      }
    };
    return Snap2;
  }(Pointer_default)
);
var Snap_default = Snap;

// node_modules/ol/interaction.js
function defaults3(opt_options) {
  var options = opt_options ? opt_options : {};
  var interactions = new Collection_default();
  var kinetic = new Kinetic_default(-5e-3, 0.05, 100);
  var altShiftDragRotate = options.altShiftDragRotate !== void 0 ? options.altShiftDragRotate : true;
  if (altShiftDragRotate) {
    interactions.push(new DragRotate_default());
  }
  var doubleClickZoom = options.doubleClickZoom !== void 0 ? options.doubleClickZoom : true;
  if (doubleClickZoom) {
    interactions.push(new DoubleClickZoom_default({
      delta: options.zoomDelta,
      duration: options.zoomDuration
    }));
  }
  var dragPan = options.dragPan !== void 0 ? options.dragPan : true;
  if (dragPan) {
    interactions.push(new DragPan_default({
      onFocusOnly: options.onFocusOnly,
      kinetic
    }));
  }
  var pinchRotate = options.pinchRotate !== void 0 ? options.pinchRotate : true;
  if (pinchRotate) {
    interactions.push(new PinchRotate_default());
  }
  var pinchZoom = options.pinchZoom !== void 0 ? options.pinchZoom : true;
  if (pinchZoom) {
    interactions.push(new PinchZoom_default({
      duration: options.zoomDuration
    }));
  }
  var keyboard = options.keyboard !== void 0 ? options.keyboard : true;
  if (keyboard) {
    interactions.push(new KeyboardPan_default());
    interactions.push(new KeyboardZoom_default({
      delta: options.zoomDelta,
      duration: options.zoomDuration
    }));
  }
  var mouseWheelZoom = options.mouseWheelZoom !== void 0 ? options.mouseWheelZoom : true;
  if (mouseWheelZoom) {
    interactions.push(new MouseWheelZoom_default({
      onFocusOnly: options.onFocusOnly,
      duration: options.zoomDuration
    }));
  }
  var shiftDragZoom = options.shiftDragZoom !== void 0 ? options.shiftDragZoom : true;
  if (shiftDragZoom) {
    interactions.push(new DragZoom_default({
      duration: options.zoomDuration
    }));
  }
  return interactions;
}

// node_modules/ol/Map.js
var __extends89 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Map2 = (
  /** @class */
  function(_super) {
    __extends89(Map3, _super);
    function Map3(options) {
      options = assign({}, options);
      if (!options.controls) {
        options.controls = defaults2();
      }
      if (!options.interactions) {
        options.interactions = defaults3({
          onFocusOnly: true
        });
      }
      return _super.call(this, options) || this;
    }
    Map3.prototype.createRenderer = function() {
      return new Composite_default(this);
    };
    return Map3;
  }(PluggableMap_default)
);
var Map_default2 = Map2;

// node_modules/ol/source/TileImage.js
var __extends90 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileImage = (
  /** @class */
  function(_super) {
    __extends90(TileImage2, _super);
    function TileImage2(options) {
      var _this = this;
      var interpolate2 = options.imageSmoothing !== void 0 ? options.imageSmoothing : true;
      if (options.interpolate !== void 0) {
        interpolate2 = options.interpolate;
      }
      _this = _super.call(this, {
        attributions: options.attributions,
        cacheSize: options.cacheSize,
        opaque: options.opaque,
        projection: options.projection,
        state: options.state,
        tileGrid: options.tileGrid,
        tileLoadFunction: options.tileLoadFunction ? options.tileLoadFunction : defaultTileLoadFunction,
        tilePixelRatio: options.tilePixelRatio,
        tileUrlFunction: options.tileUrlFunction,
        url: options.url,
        urls: options.urls,
        wrapX: options.wrapX,
        transition: options.transition,
        interpolate: interpolate2,
        key: options.key,
        attributionsCollapsible: options.attributionsCollapsible,
        zDirection: options.zDirection
      }) || this;
      _this.crossOrigin = options.crossOrigin !== void 0 ? options.crossOrigin : null;
      _this.tileClass = options.tileClass !== void 0 ? options.tileClass : ImageTile_default;
      _this.tileCacheForProjection = {};
      _this.tileGridForProjection = {};
      _this.reprojectionErrorThreshold_ = options.reprojectionErrorThreshold;
      _this.renderReprojectionEdges_ = false;
      return _this;
    }
    TileImage2.prototype.canExpireCache = function() {
      if (!ENABLE_RASTER_REPROJECTION) {
        return _super.prototype.canExpireCache.call(this);
      }
      if (this.tileCache.canExpireCache()) {
        return true;
      } else {
        for (var key in this.tileCacheForProjection) {
          if (this.tileCacheForProjection[key].canExpireCache()) {
            return true;
          }
        }
      }
      return false;
    };
    TileImage2.prototype.expireCache = function(projection, usedTiles) {
      if (!ENABLE_RASTER_REPROJECTION) {
        _super.prototype.expireCache.call(this, projection, usedTiles);
        return;
      }
      var usedTileCache = this.getTileCacheForProjection(projection);
      this.tileCache.expireCache(this.tileCache == usedTileCache ? usedTiles : {});
      for (var id2 in this.tileCacheForProjection) {
        var tileCache = this.tileCacheForProjection[id2];
        tileCache.expireCache(tileCache == usedTileCache ? usedTiles : {});
      }
    };
    TileImage2.prototype.getGutterForProjection = function(projection) {
      if (ENABLE_RASTER_REPROJECTION && this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
        return 0;
      } else {
        return this.getGutter();
      }
    };
    TileImage2.prototype.getGutter = function() {
      return 0;
    };
    TileImage2.prototype.getKey = function() {
      var key = _super.prototype.getKey.call(this);
      if (!this.getInterpolate()) {
        key += ":disable-interpolation";
      }
      return key;
    };
    TileImage2.prototype.getOpaque = function(projection) {
      if (ENABLE_RASTER_REPROJECTION && this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
        return false;
      } else {
        return _super.prototype.getOpaque.call(this, projection);
      }
    };
    TileImage2.prototype.getTileGridForProjection = function(projection) {
      if (!ENABLE_RASTER_REPROJECTION) {
        return _super.prototype.getTileGridForProjection.call(this, projection);
      }
      var thisProj = this.getProjection();
      if (this.tileGrid && (!thisProj || equivalent(thisProj, projection))) {
        return this.tileGrid;
      } else {
        var projKey = getUid(projection);
        if (!(projKey in this.tileGridForProjection)) {
          this.tileGridForProjection[projKey] = getForProjection(projection);
        }
        return this.tileGridForProjection[projKey];
      }
    };
    TileImage2.prototype.getTileCacheForProjection = function(projection) {
      if (!ENABLE_RASTER_REPROJECTION) {
        return _super.prototype.getTileCacheForProjection.call(this, projection);
      }
      var thisProj = this.getProjection();
      if (!thisProj || equivalent(thisProj, projection)) {
        return this.tileCache;
      } else {
        var projKey = getUid(projection);
        if (!(projKey in this.tileCacheForProjection)) {
          this.tileCacheForProjection[projKey] = new TileCache_default(this.tileCache.highWaterMark);
        }
        return this.tileCacheForProjection[projKey];
      }
    };
    TileImage2.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key) {
      var tileCoord = [z, x, y];
      var urlTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);
      var tileUrl = urlTileCoord ? this.tileUrlFunction(urlTileCoord, pixelRatio, projection) : void 0;
      var tile = new this.tileClass(tileCoord, tileUrl !== void 0 ? TileState_default.IDLE : TileState_default.EMPTY, tileUrl !== void 0 ? tileUrl : "", this.crossOrigin, this.tileLoadFunction, this.tileOptions);
      tile.key = key;
      tile.addEventListener(EventType_default.CHANGE, this.handleTileChange.bind(this));
      return tile;
    };
    TileImage2.prototype.getTile = function(z, x, y, pixelRatio, projection) {
      var sourceProjection = this.getProjection();
      if (!ENABLE_RASTER_REPROJECTION || !sourceProjection || !projection || equivalent(sourceProjection, projection)) {
        return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection);
      } else {
        var cache2 = this.getTileCacheForProjection(projection);
        var tileCoord = [z, x, y];
        var tile = void 0;
        var tileCoordKey = getKey3(tileCoord);
        if (cache2.containsKey(tileCoordKey)) {
          tile = cache2.get(tileCoordKey);
        }
        var key = this.getKey();
        if (tile && tile.key == key) {
          return tile;
        } else {
          var sourceTileGrid = this.getTileGridForProjection(sourceProjection);
          var targetTileGrid = this.getTileGridForProjection(projection);
          var wrappedTileCoord = this.getTileCoordForTileUrlFunction(tileCoord, projection);
          var newTile = new Tile_default2(sourceProjection, sourceTileGrid, projection, targetTileGrid, tileCoord, wrappedTileCoord, this.getTilePixelRatio(pixelRatio), this.getGutter(), (function(z2, x2, y2, pixelRatio2) {
            return this.getTileInternal(z2, x2, y2, pixelRatio2, sourceProjection);
          }).bind(this), this.reprojectionErrorThreshold_, this.renderReprojectionEdges_, this.getInterpolate());
          newTile.key = key;
          if (tile) {
            newTile.interimTile = tile;
            newTile.refreshInterimChain();
            cache2.replace(tileCoordKey, newTile);
          } else {
            cache2.set(tileCoordKey, newTile);
          }
          return newTile;
        }
      }
    };
    TileImage2.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
      var tile = null;
      var tileCoordKey = getKeyZXY(z, x, y);
      var key = this.getKey();
      if (!this.tileCache.containsKey(tileCoordKey)) {
        tile = this.createTile_(z, x, y, pixelRatio, projection, key);
        this.tileCache.set(tileCoordKey, tile);
      } else {
        tile = this.tileCache.get(tileCoordKey);
        if (tile.key != key) {
          var interimTile = tile;
          tile = this.createTile_(z, x, y, pixelRatio, projection, key);
          if (interimTile.getState() == TileState_default.IDLE) {
            tile.interimTile = interimTile.interimTile;
          } else {
            tile.interimTile = interimTile;
          }
          tile.refreshInterimChain();
          this.tileCache.replace(tileCoordKey, tile);
        }
      }
      return tile;
    };
    TileImage2.prototype.setRenderReprojectionEdges = function(render2) {
      if (!ENABLE_RASTER_REPROJECTION || this.renderReprojectionEdges_ == render2) {
        return;
      }
      this.renderReprojectionEdges_ = render2;
      for (var id2 in this.tileCacheForProjection) {
        this.tileCacheForProjection[id2].clear();
      }
      this.changed();
    };
    TileImage2.prototype.setTileGridForProjection = function(projection, tilegrid) {
      if (ENABLE_RASTER_REPROJECTION) {
        var proj = get3(projection);
        if (proj) {
          var projKey = getUid(proj);
          if (!(projKey in this.tileGridForProjection)) {
            this.tileGridForProjection[projKey] = tilegrid;
          }
        }
      }
    };
    return TileImage2;
  }(UrlTile_default)
);
function defaultTileLoadFunction(imageTile, src) {
  imageTile.getImage().src = src;
}
var TileImage_default = TileImage;

// node_modules/ol/layer/BaseTile.js
var __extends91 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var BaseTileLayer = (
  /** @class */
  function(_super) {
    __extends91(BaseTileLayer2, _super);
    function BaseTileLayer2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var baseOptions = assign({}, options);
      delete baseOptions.preload;
      delete baseOptions.useInterimTilesOnError;
      _this = _super.call(this, baseOptions) || this;
      _this.on;
      _this.once;
      _this.un;
      _this.setPreload(options.preload !== void 0 ? options.preload : 0);
      _this.setUseInterimTilesOnError(options.useInterimTilesOnError !== void 0 ? options.useInterimTilesOnError : true);
      return _this;
    }
    BaseTileLayer2.prototype.getPreload = function() {
      return (
        /** @type {number} */
        this.get(TileProperty_default.PRELOAD)
      );
    };
    BaseTileLayer2.prototype.setPreload = function(preload) {
      this.set(TileProperty_default.PRELOAD, preload);
    };
    BaseTileLayer2.prototype.getUseInterimTilesOnError = function() {
      return (
        /** @type {boolean} */
        this.get(TileProperty_default.USE_INTERIM_TILES_ON_ERROR)
      );
    };
    BaseTileLayer2.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) {
      this.set(TileProperty_default.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
    };
    BaseTileLayer2.prototype.getData = function(pixel) {
      return _super.prototype.getData.call(this, pixel);
    };
    return BaseTileLayer2;
  }(Layer_default)
);
var BaseTile_default = BaseTileLayer;

// node_modules/ol/layer/Tile.js
var __extends92 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileLayer = (
  /** @class */
  function(_super) {
    __extends92(TileLayer2, _super);
    function TileLayer2(opt_options) {
      return _super.call(this, opt_options) || this;
    }
    TileLayer2.prototype.createRenderer = function() {
      return new TileLayer_default(this);
    };
    return TileLayer2;
  }(BaseTile_default)
);
var Tile_default4 = TileLayer;

// node_modules/ol-mapbox-style/dist/index.js
var csscolorparser = {};
var parseCSSColor_1;
var kCSSColorTable = {
  "transparent": [
    0,
    0,
    0,
    0
  ],
  "aliceblue": [
    240,
    248,
    255,
    1
  ],
  "antiquewhite": [
    250,
    235,
    215,
    1
  ],
  "aqua": [
    0,
    255,
    255,
    1
  ],
  "aquamarine": [
    127,
    255,
    212,
    1
  ],
  "azure": [
    240,
    255,
    255,
    1
  ],
  "beige": [
    245,
    245,
    220,
    1
  ],
  "bisque": [
    255,
    228,
    196,
    1
  ],
  "black": [
    0,
    0,
    0,
    1
  ],
  "blanchedalmond": [
    255,
    235,
    205,
    1
  ],
  "blue": [
    0,
    0,
    255,
    1
  ],
  "blueviolet": [
    138,
    43,
    226,
    1
  ],
  "brown": [
    165,
    42,
    42,
    1
  ],
  "burlywood": [
    222,
    184,
    135,
    1
  ],
  "cadetblue": [
    95,
    158,
    160,
    1
  ],
  "chartreuse": [
    127,
    255,
    0,
    1
  ],
  "chocolate": [
    210,
    105,
    30,
    1
  ],
  "coral": [
    255,
    127,
    80,
    1
  ],
  "cornflowerblue": [
    100,
    149,
    237,
    1
  ],
  "cornsilk": [
    255,
    248,
    220,
    1
  ],
  "crimson": [
    220,
    20,
    60,
    1
  ],
  "cyan": [
    0,
    255,
    255,
    1
  ],
  "darkblue": [
    0,
    0,
    139,
    1
  ],
  "darkcyan": [
    0,
    139,
    139,
    1
  ],
  "darkgoldenrod": [
    184,
    134,
    11,
    1
  ],
  "darkgray": [
    169,
    169,
    169,
    1
  ],
  "darkgreen": [
    0,
    100,
    0,
    1
  ],
  "darkgrey": [
    169,
    169,
    169,
    1
  ],
  "darkkhaki": [
    189,
    183,
    107,
    1
  ],
  "darkmagenta": [
    139,
    0,
    139,
    1
  ],
  "darkolivegreen": [
    85,
    107,
    47,
    1
  ],
  "darkorange": [
    255,
    140,
    0,
    1
  ],
  "darkorchid": [
    153,
    50,
    204,
    1
  ],
  "darkred": [
    139,
    0,
    0,
    1
  ],
  "darksalmon": [
    233,
    150,
    122,
    1
  ],
  "darkseagreen": [
    143,
    188,
    143,
    1
  ],
  "darkslateblue": [
    72,
    61,
    139,
    1
  ],
  "darkslategray": [
    47,
    79,
    79,
    1
  ],
  "darkslategrey": [
    47,
    79,
    79,
    1
  ],
  "darkturquoise": [
    0,
    206,
    209,
    1
  ],
  "darkviolet": [
    148,
    0,
    211,
    1
  ],
  "deeppink": [
    255,
    20,
    147,
    1
  ],
  "deepskyblue": [
    0,
    191,
    255,
    1
  ],
  "dimgray": [
    105,
    105,
    105,
    1
  ],
  "dimgrey": [
    105,
    105,
    105,
    1
  ],
  "dodgerblue": [
    30,
    144,
    255,
    1
  ],
  "firebrick": [
    178,
    34,
    34,
    1
  ],
  "floralwhite": [
    255,
    250,
    240,
    1
  ],
  "forestgreen": [
    34,
    139,
    34,
    1
  ],
  "fuchsia": [
    255,
    0,
    255,
    1
  ],
  "gainsboro": [
    220,
    220,
    220,
    1
  ],
  "ghostwhite": [
    248,
    248,
    255,
    1
  ],
  "gold": [
    255,
    215,
    0,
    1
  ],
  "goldenrod": [
    218,
    165,
    32,
    1
  ],
  "gray": [
    128,
    128,
    128,
    1
  ],
  "green": [
    0,
    128,
    0,
    1
  ],
  "greenyellow": [
    173,
    255,
    47,
    1
  ],
  "grey": [
    128,
    128,
    128,
    1
  ],
  "honeydew": [
    240,
    255,
    240,
    1
  ],
  "hotpink": [
    255,
    105,
    180,
    1
  ],
  "indianred": [
    205,
    92,
    92,
    1
  ],
  "indigo": [
    75,
    0,
    130,
    1
  ],
  "ivory": [
    255,
    255,
    240,
    1
  ],
  "khaki": [
    240,
    230,
    140,
    1
  ],
  "lavender": [
    230,
    230,
    250,
    1
  ],
  "lavenderblush": [
    255,
    240,
    245,
    1
  ],
  "lawngreen": [
    124,
    252,
    0,
    1
  ],
  "lemonchiffon": [
    255,
    250,
    205,
    1
  ],
  "lightblue": [
    173,
    216,
    230,
    1
  ],
  "lightcoral": [
    240,
    128,
    128,
    1
  ],
  "lightcyan": [
    224,
    255,
    255,
    1
  ],
  "lightgoldenrodyellow": [
    250,
    250,
    210,
    1
  ],
  "lightgray": [
    211,
    211,
    211,
    1
  ],
  "lightgreen": [
    144,
    238,
    144,
    1
  ],
  "lightgrey": [
    211,
    211,
    211,
    1
  ],
  "lightpink": [
    255,
    182,
    193,
    1
  ],
  "lightsalmon": [
    255,
    160,
    122,
    1
  ],
  "lightseagreen": [
    32,
    178,
    170,
    1
  ],
  "lightskyblue": [
    135,
    206,
    250,
    1
  ],
  "lightslategray": [
    119,
    136,
    153,
    1
  ],
  "lightslategrey": [
    119,
    136,
    153,
    1
  ],
  "lightsteelblue": [
    176,
    196,
    222,
    1
  ],
  "lightyellow": [
    255,
    255,
    224,
    1
  ],
  "lime": [
    0,
    255,
    0,
    1
  ],
  "limegreen": [
    50,
    205,
    50,
    1
  ],
  "linen": [
    250,
    240,
    230,
    1
  ],
  "magenta": [
    255,
    0,
    255,
    1
  ],
  "maroon": [
    128,
    0,
    0,
    1
  ],
  "mediumaquamarine": [
    102,
    205,
    170,
    1
  ],
  "mediumblue": [
    0,
    0,
    205,
    1
  ],
  "mediumorchid": [
    186,
    85,
    211,
    1
  ],
  "mediumpurple": [
    147,
    112,
    219,
    1
  ],
  "mediumseagreen": [
    60,
    179,
    113,
    1
  ],
  "mediumslateblue": [
    123,
    104,
    238,
    1
  ],
  "mediumspringgreen": [
    0,
    250,
    154,
    1
  ],
  "mediumturquoise": [
    72,
    209,
    204,
    1
  ],
  "mediumvioletred": [
    199,
    21,
    133,
    1
  ],
  "midnightblue": [
    25,
    25,
    112,
    1
  ],
  "mintcream": [
    245,
    255,
    250,
    1
  ],
  "mistyrose": [
    255,
    228,
    225,
    1
  ],
  "moccasin": [
    255,
    228,
    181,
    1
  ],
  "navajowhite": [
    255,
    222,
    173,
    1
  ],
  "navy": [
    0,
    0,
    128,
    1
  ],
  "oldlace": [
    253,
    245,
    230,
    1
  ],
  "olive": [
    128,
    128,
    0,
    1
  ],
  "olivedrab": [
    107,
    142,
    35,
    1
  ],
  "orange": [
    255,
    165,
    0,
    1
  ],
  "orangered": [
    255,
    69,
    0,
    1
  ],
  "orchid": [
    218,
    112,
    214,
    1
  ],
  "palegoldenrod": [
    238,
    232,
    170,
    1
  ],
  "palegreen": [
    152,
    251,
    152,
    1
  ],
  "paleturquoise": [
    175,
    238,
    238,
    1
  ],
  "palevioletred": [
    219,
    112,
    147,
    1
  ],
  "papayawhip": [
    255,
    239,
    213,
    1
  ],
  "peachpuff": [
    255,
    218,
    185,
    1
  ],
  "peru": [
    205,
    133,
    63,
    1
  ],
  "pink": [
    255,
    192,
    203,
    1
  ],
  "plum": [
    221,
    160,
    221,
    1
  ],
  "powderblue": [
    176,
    224,
    230,
    1
  ],
  "purple": [
    128,
    0,
    128,
    1
  ],
  "rebeccapurple": [
    102,
    51,
    153,
    1
  ],
  "red": [
    255,
    0,
    0,
    1
  ],
  "rosybrown": [
    188,
    143,
    143,
    1
  ],
  "royalblue": [
    65,
    105,
    225,
    1
  ],
  "saddlebrown": [
    139,
    69,
    19,
    1
  ],
  "salmon": [
    250,
    128,
    114,
    1
  ],
  "sandybrown": [
    244,
    164,
    96,
    1
  ],
  "seagreen": [
    46,
    139,
    87,
    1
  ],
  "seashell": [
    255,
    245,
    238,
    1
  ],
  "sienna": [
    160,
    82,
    45,
    1
  ],
  "silver": [
    192,
    192,
    192,
    1
  ],
  "skyblue": [
    135,
    206,
    235,
    1
  ],
  "slateblue": [
    106,
    90,
    205,
    1
  ],
  "slategray": [
    112,
    128,
    144,
    1
  ],
  "slategrey": [
    112,
    128,
    144,
    1
  ],
  "snow": [
    255,
    250,
    250,
    1
  ],
  "springgreen": [
    0,
    255,
    127,
    1
  ],
  "steelblue": [
    70,
    130,
    180,
    1
  ],
  "tan": [
    210,
    180,
    140,
    1
  ],
  "teal": [
    0,
    128,
    128,
    1
  ],
  "thistle": [
    216,
    191,
    216,
    1
  ],
  "tomato": [
    255,
    99,
    71,
    1
  ],
  "turquoise": [
    64,
    224,
    208,
    1
  ],
  "violet": [
    238,
    130,
    238,
    1
  ],
  "wheat": [
    245,
    222,
    179,
    1
  ],
  "white": [
    255,
    255,
    255,
    1
  ],
  "whitesmoke": [
    245,
    245,
    245,
    1
  ],
  "yellow": [
    255,
    255,
    0,
    1
  ],
  "yellowgreen": [
    154,
    205,
    50,
    1
  ]
};
function clamp_css_byte(i2) {
  i2 = Math.round(i2);
  return i2 < 0 ? 0 : i2 > 255 ? 255 : i2;
}
function clamp_css_float(f) {
  return f < 0 ? 0 : f > 1 ? 1 : f;
}
function parse_css_int(str2) {
  if (str2[str2.length - 1] === "%") {
    return clamp_css_byte(parseFloat(str2) / 100 * 255);
  }
  return clamp_css_byte(parseInt(str2));
}
function parse_css_float(str2) {
  if (str2[str2.length - 1] === "%") {
    return clamp_css_float(parseFloat(str2) / 100);
  }
  return clamp_css_float(parseFloat(str2));
}
function css_hue_to_rgb(m1, m2, h) {
  if (h < 0) {
    h += 1;
  } else if (h > 1) {
    h -= 1;
  }
  if (h * 6 < 1) {
    return m1 + (m2 - m1) * h * 6;
  }
  if (h * 2 < 1) {
    return m2;
  }
  if (h * 3 < 2) {
    return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  }
  return m1;
}
function parseCSSColor(css_str) {
  var str2 = css_str.replace(/ /g, "").toLowerCase();
  if (str2 in kCSSColorTable) {
    return kCSSColorTable[str2].slice();
  }
  if (str2[0] === "#") {
    if (str2.length === 4) {
      var iv = parseInt(str2.substr(1), 16);
      if (!(iv >= 0 && iv <= 4095)) {
        return null;
      }
      return [
        (iv & 3840) >> 4 | (iv & 3840) >> 8,
        iv & 240 | (iv & 240) >> 4,
        iv & 15 | (iv & 15) << 4,
        1
      ];
    } else if (str2.length === 7) {
      var iv = parseInt(str2.substr(1), 16);
      if (!(iv >= 0 && iv <= 16777215)) {
        return null;
      }
      return [
        (iv & 16711680) >> 16,
        (iv & 65280) >> 8,
        iv & 255,
        1
      ];
    }
    return null;
  }
  var op = str2.indexOf("("), ep = str2.indexOf(")");
  if (op !== -1 && ep + 1 === str2.length) {
    var fname = str2.substr(0, op);
    var params = str2.substr(op + 1, ep - (op + 1)).split(",");
    var alpha = 1;
    switch (fname) {
      case "rgba":
        if (params.length !== 4) {
          return null;
        }
        alpha = parse_css_float(params.pop());
      case "rgb":
        if (params.length !== 3) {
          return null;
        }
        return [
          parse_css_int(params[0]),
          parse_css_int(params[1]),
          parse_css_int(params[2]),
          alpha
        ];
      case "hsla":
        if (params.length !== 4) {
          return null;
        }
        alpha = parse_css_float(params.pop());
      case "hsl":
        if (params.length !== 3) {
          return null;
        }
        var h = (parseFloat(params[0]) % 360 + 360) % 360 / 360;
        var s = parse_css_float(params[1]);
        var l = parse_css_float(params[2]);
        var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
        var m1 = l * 2 - m2;
        return [
          clamp_css_byte(css_hue_to_rgb(m1, m2, h + 1 / 3) * 255),
          clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),
          clamp_css_byte(css_hue_to_rgb(m1, m2, h - 1 / 3) * 255),
          alpha
        ];
      default:
        return null;
    }
  }
  return null;
}
try {
  parseCSSColor_1 = csscolorparser.parseCSSColor = parseCSSColor;
} catch (e) {
}
var Color = function Color2(r, g, b, a) {
  if (a === void 0) a = 1;
  this.r = r;
  this.g = g;
  this.b = b;
  this.a = a;
};
Color.parse = function parse(input2) {
  if (!input2) {
    return void 0;
  }
  if (input2 instanceof Color) {
    return input2;
  }
  if (typeof input2 !== "string") {
    return void 0;
  }
  var rgba2 = parseCSSColor_1(input2);
  if (!rgba2) {
    return void 0;
  }
  return new Color(rgba2[0] / 255 * rgba2[3], rgba2[1] / 255 * rgba2[3], rgba2[2] / 255 * rgba2[3], rgba2[3]);
};
Color.prototype.toString = function toString3() {
  var ref = this.toArray();
  var r = ref[0];
  var g = ref[1];
  var b = ref[2];
  var a = ref[3];
  return "rgba(" + Math.round(r) + "," + Math.round(g) + "," + Math.round(b) + "," + a + ")";
};
Color.prototype.toArray = function toArray() {
  var ref = this;
  var r = ref.r;
  var g = ref.g;
  var b = ref.b;
  var a = ref.a;
  return a === 0 ? [
    0,
    0,
    0,
    0
  ] : [
    r * 255 / a,
    g * 255 / a,
    b * 255 / a,
    a
  ];
};
Color.prototype.toArray01 = function toArray01() {
  var ref = this;
  var r = ref.r;
  var g = ref.g;
  var b = ref.b;
  var a = ref.a;
  return a === 0 ? [
    0,
    0,
    0,
    0
  ] : [
    r / a,
    g / a,
    b / a,
    a
  ];
};
Color.prototype.toArray01PremultipliedAlpha = function toArray01PremultipliedAlpha() {
  var ref = this;
  var r = ref.r;
  var g = ref.g;
  var b = ref.b;
  var a = ref.a;
  return [
    r,
    g,
    b,
    a
  ];
};
Color.black = new Color(0, 0, 0, 1);
Color.white = new Color(1, 1, 1, 1);
Color.transparent = new Color(0, 0, 0, 0);
Color.red = new Color(1, 0, 0, 1);
Color.blue = new Color(0, 0, 1, 1);
function convertLiteral(value) {
  return typeof value === "object" ? [
    "literal",
    value
  ] : value;
}
function convertFunction(parameters, propertySpec) {
  var stops = parameters.stops;
  if (!stops) {
    return convertIdentityFunction(parameters, propertySpec);
  }
  var zoomAndFeatureDependent = stops && typeof stops[0][0] === "object";
  var featureDependent = zoomAndFeatureDependent || parameters.property !== void 0;
  var zoomDependent = zoomAndFeatureDependent || !featureDependent;
  stops = stops.map(function(stop) {
    if (!featureDependent && propertySpec.tokens && typeof stop[1] === "string") {
      return [
        stop[0],
        convertTokenString(stop[1])
      ];
    }
    return [
      stop[0],
      convertLiteral(stop[1])
    ];
  });
  if (zoomAndFeatureDependent) {
    return convertZoomAndPropertyFunction(parameters, propertySpec, stops);
  } else if (zoomDependent) {
    return convertZoomFunction(parameters, propertySpec, stops);
  } else {
    return convertPropertyFunction(parameters, propertySpec, stops);
  }
}
function convertIdentityFunction(parameters, propertySpec) {
  var get8 = [
    "get",
    parameters.property
  ];
  if (parameters.default === void 0) {
    return propertySpec.type === "string" ? [
      "string",
      get8
    ] : get8;
  } else if (propertySpec.type === "enum") {
    return [
      "match",
      get8,
      Object.keys(propertySpec.values),
      get8,
      parameters.default
    ];
  } else {
    var expression = [
      propertySpec.type === "color" ? "to-color" : propertySpec.type,
      get8,
      convertLiteral(parameters.default)
    ];
    if (propertySpec.type === "array") {
      expression.splice(1, 0, propertySpec.value, propertySpec.length || null);
    }
    return expression;
  }
}
function getInterpolateOperator(parameters) {
  switch (parameters.colorSpace) {
    case "hcl":
      return "interpolate-hcl";
    case "lab":
      return "interpolate-lab";
    default:
      return "interpolate";
  }
}
function convertZoomAndPropertyFunction(parameters, propertySpec, stops) {
  var featureFunctionParameters = {};
  var featureFunctionStops = {};
  var zoomStops = [];
  for (var s = 0; s < stops.length; s++) {
    var stop = stops[s];
    var zoom = stop[0].zoom;
    if (featureFunctionParameters[zoom] === void 0) {
      featureFunctionParameters[zoom] = {
        zoom,
        type: parameters.type,
        property: parameters.property,
        default: parameters.default
      };
      featureFunctionStops[zoom] = [];
      zoomStops.push(zoom);
    }
    featureFunctionStops[zoom].push([
      stop[0].value,
      stop[1]
    ]);
  }
  var functionType = getFunctionType({}, propertySpec);
  if (functionType === "exponential") {
    var expression = [
      getInterpolateOperator(parameters),
      ["linear"],
      ["zoom"]
    ];
    for (var i2 = 0, list = zoomStops; i2 < list.length; i2 += 1) {
      var z = list[i2];
      var output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);
      appendStopPair(expression, z, output, false);
    }
    return expression;
  } else {
    var expression$1 = [
      "step",
      ["zoom"]
    ];
    for (var i$1 = 0, list$1 = zoomStops; i$1 < list$1.length; i$1 += 1) {
      var z$1 = list$1[i$1];
      var output$1 = convertPropertyFunction(featureFunctionParameters[z$1], propertySpec, featureFunctionStops[z$1]);
      appendStopPair(expression$1, z$1, output$1, true);
    }
    fixupDegenerateStepCurve(expression$1);
    return expression$1;
  }
}
function coalesce(a, b) {
  if (a !== void 0) {
    return a;
  }
  if (b !== void 0) {
    return b;
  }
}
function getFallback(parameters, propertySpec) {
  var defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));
  if (defaultValue === void 0 && propertySpec.type === "resolvedImage") {
    return "";
  }
  return defaultValue;
}
function convertPropertyFunction(parameters, propertySpec, stops) {
  var type = getFunctionType(parameters, propertySpec);
  var get8 = [
    "get",
    parameters.property
  ];
  if (type === "categorical" && typeof stops[0][0] === "boolean") {
    var expression = ["case"];
    for (var i2 = 0, list = stops; i2 < list.length; i2 += 1) {
      var stop = list[i2];
      expression.push([
        "==",
        get8,
        stop[0]
      ], stop[1]);
    }
    expression.push(getFallback(parameters, propertySpec));
    return expression;
  } else if (type === "categorical") {
    var expression$1 = [
      "match",
      get8
    ];
    for (var i$1 = 0, list$1 = stops; i$1 < list$1.length; i$1 += 1) {
      var stop$1 = list$1[i$1];
      appendStopPair(expression$1, stop$1[0], stop$1[1], false);
    }
    expression$1.push(getFallback(parameters, propertySpec));
    return expression$1;
  } else if (type === "interval") {
    var expression$2 = [
      "step",
      [
        "number",
        get8
      ]
    ];
    for (var i$2 = 0, list$2 = stops; i$2 < list$2.length; i$2 += 1) {
      var stop$2 = list$2[i$2];
      appendStopPair(expression$2, stop$2[0], stop$2[1], true);
    }
    fixupDegenerateStepCurve(expression$2);
    return parameters.default === void 0 ? expression$2 : [
      "case",
      [
        "==",
        [
          "typeof",
          get8
        ],
        "number"
      ],
      expression$2,
      convertLiteral(parameters.default)
    ];
  } else if (type === "exponential") {
    var base = parameters.base !== void 0 ? parameters.base : 1;
    var expression$3 = [
      getInterpolateOperator(parameters),
      base === 1 ? ["linear"] : [
        "exponential",
        base
      ],
      [
        "number",
        get8
      ]
    ];
    for (var i$3 = 0, list$3 = stops; i$3 < list$3.length; i$3 += 1) {
      var stop$3 = list$3[i$3];
      appendStopPair(expression$3, stop$3[0], stop$3[1], false);
    }
    return parameters.default === void 0 ? expression$3 : [
      "case",
      [
        "==",
        [
          "typeof",
          get8
        ],
        "number"
      ],
      expression$3,
      convertLiteral(parameters.default)
    ];
  } else {
    throw new Error("Unknown property function type " + type);
  }
}
function convertZoomFunction(parameters, propertySpec, stops, input2) {
  if (input2 === void 0) input2 = ["zoom"];
  var type = getFunctionType(parameters, propertySpec);
  var expression;
  var isStep = false;
  if (type === "interval") {
    expression = [
      "step",
      input2
    ];
    isStep = true;
  } else if (type === "exponential") {
    var base = parameters.base !== void 0 ? parameters.base : 1;
    expression = [
      getInterpolateOperator(parameters),
      base === 1 ? ["linear"] : [
        "exponential",
        base
      ],
      input2
    ];
  } else {
    throw new Error('Unknown zoom function type "' + type + '"');
  }
  for (var i2 = 0, list = stops; i2 < list.length; i2 += 1) {
    var stop = list[i2];
    appendStopPair(expression, stop[0], stop[1], isStep);
  }
  fixupDegenerateStepCurve(expression);
  return expression;
}
function fixupDegenerateStepCurve(expression) {
  if (expression[0] === "step" && expression.length === 3) {
    expression.push(0);
    expression.push(expression[3]);
  }
}
function appendStopPair(curve, input2, output, isStep) {
  if (curve.length > 3 && input2 === curve[curve.length - 2]) {
    return;
  }
  if (!(isStep && curve.length === 2)) {
    curve.push(input2);
  }
  curve.push(output);
}
function getFunctionType(parameters, propertySpec) {
  if (parameters.type) {
    return parameters.type;
  } else {
    return propertySpec.expression.interpolated ? "exponential" : "interval";
  }
}
function convertTokenString(s) {
  var result = ["concat"];
  var re = /{([^{}]+)}/g;
  var pos = 0;
  for (var match2 = re.exec(s); match2 !== null; match2 = re.exec(s)) {
    var literal = s.slice(pos, re.lastIndex - match2[0].length);
    pos = re.lastIndex;
    if (literal.length > 0) {
      result.push(literal);
    }
    result.push([
      "get",
      match2[1]
    ]);
  }
  if (result.length === 1) {
    return s;
  }
  if (pos < s.length) {
    result.push(s.slice(pos));
  } else if (result.length === 2) {
    return [
      "to-string",
      result[1]
    ];
  }
  return result;
}
var ParsingError = /* @__PURE__ */ function(Error2) {
  function ParsingError2(key, message) {
    Error2.call(this, message);
    this.message = message;
    this.key = key;
  }
  if (Error2) ParsingError2.__proto__ = Error2;
  ParsingError2.prototype = Object.create(Error2 && Error2.prototype);
  ParsingError2.prototype.constructor = ParsingError2;
  return ParsingError2;
}(Error);
var Scope = function Scope2(parent, bindings) {
  if (bindings === void 0) bindings = [];
  this.parent = parent;
  this.bindings = {};
  for (var i2 = 0, list = bindings; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var name = ref[0];
    var expression = ref[1];
    this.bindings[name] = expression;
  }
};
Scope.prototype.concat = function concat2(bindings) {
  return new Scope(this, bindings);
};
Scope.prototype.get = function get5(name) {
  if (this.bindings[name]) {
    return this.bindings[name];
  }
  if (this.parent) {
    return this.parent.get(name);
  }
  throw new Error(name + " not found in scope.");
};
Scope.prototype.has = function has(name) {
  if (this.bindings[name]) {
    return true;
  }
  return this.parent ? this.parent.has(name) : false;
};
var NullType = { kind: "null" };
var NumberType = { kind: "number" };
var StringType = { kind: "string" };
var BooleanType = { kind: "boolean" };
var ColorType = { kind: "color" };
var ObjectType = { kind: "object" };
var ValueType = { kind: "value" };
var ErrorType = { kind: "error" };
var CollatorType = { kind: "collator" };
var FormattedType = { kind: "formatted" };
var ResolvedImageType = { kind: "resolvedImage" };
function array$1(itemType, N) {
  return {
    kind: "array",
    itemType,
    N
  };
}
function toString$1(type) {
  if (type.kind === "array") {
    var itemType = toString$1(type.itemType);
    return typeof type.N === "number" ? "array<" + itemType + ", " + type.N + ">" : type.itemType.kind === "value" ? "array" : "array<" + itemType + ">";
  } else {
    return type.kind;
  }
}
var valueMemberTypes = [
  NullType,
  NumberType,
  StringType,
  BooleanType,
  ColorType,
  FormattedType,
  ObjectType,
  array$1(ValueType),
  ResolvedImageType
];
function checkSubtype(expected, t) {
  if (t.kind === "error") {
    return null;
  } else if (expected.kind === "array") {
    if (t.kind === "array" && (t.N === 0 && t.itemType.kind === "value" || !checkSubtype(expected.itemType, t.itemType)) && (typeof expected.N !== "number" || expected.N === t.N)) {
      return null;
    }
  } else if (expected.kind === t.kind) {
    return null;
  } else if (expected.kind === "value") {
    for (var i2 = 0, list = valueMemberTypes; i2 < list.length; i2 += 1) {
      var memberType = list[i2];
      if (!checkSubtype(memberType, t)) {
        return null;
      }
    }
  }
  return "Expected " + toString$1(expected) + " but found " + toString$1(t) + " instead.";
}
function isValidType(provided, allowedTypes) {
  return allowedTypes.some(function(t) {
    return t.kind === provided.kind;
  });
}
function isValidNativeType(provided, allowedTypes) {
  return allowedTypes.some(function(t) {
    if (t === "null") {
      return provided === null;
    } else if (t === "array") {
      return Array.isArray(provided);
    } else if (t === "object") {
      return provided && !Array.isArray(provided) && typeof provided === "object";
    } else {
      return t === typeof provided;
    }
  });
}
var Collator = function Collator2(caseSensitive, diacriticSensitive, locale) {
  if (caseSensitive) {
    this.sensitivity = diacriticSensitive ? "variant" : "case";
  } else {
    this.sensitivity = diacriticSensitive ? "accent" : "base";
  }
  this.locale = locale;
  this.collator = new Intl.Collator(this.locale ? this.locale : [], {
    sensitivity: this.sensitivity,
    usage: "search"
  });
};
Collator.prototype.compare = function compare(lhs, rhs) {
  return this.collator.compare(lhs, rhs);
};
Collator.prototype.resolvedLocale = function resolvedLocale() {
  return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;
};
var FormattedSection = function FormattedSection2(text, image, scale5, fontStack, textColor) {
  this.text = text.normalize ? text.normalize() : text;
  this.image = image;
  this.scale = scale5;
  this.fontStack = fontStack;
  this.textColor = textColor;
};
var Formatted = function Formatted2(sections) {
  this.sections = sections;
};
Formatted.fromString = function fromString2(unformatted) {
  return new Formatted([new FormattedSection(unformatted, null, null, null, null)]);
};
Formatted.prototype.isEmpty = function isEmpty3() {
  if (this.sections.length === 0) {
    return true;
  }
  return !this.sections.some(function(section) {
    return section.text.length !== 0 || section.image && section.image.name.length !== 0;
  });
};
Formatted.factory = function factory(text) {
  if (text instanceof Formatted) {
    return text;
  } else {
    return Formatted.fromString(text);
  }
};
Formatted.prototype.toString = function toString4() {
  if (this.sections.length === 0) {
    return "";
  }
  return this.sections.map(function(section) {
    return section.text;
  }).join("");
};
Formatted.prototype.serialize = function serialize() {
  var serialized = ["format"];
  for (var i2 = 0, list = this.sections; i2 < list.length; i2 += 1) {
    var section = list[i2];
    if (section.image) {
      serialized.push([
        "image",
        section.image.name
      ]);
      continue;
    }
    serialized.push(section.text);
    var options = {};
    if (section.fontStack) {
      options["text-font"] = [
        "literal",
        section.fontStack.split(",")
      ];
    }
    if (section.scale) {
      options["font-scale"] = section.scale;
    }
    if (section.textColor) {
      options["text-color"] = ["rgba"].concat(section.textColor.toArray());
    }
    serialized.push(options);
  }
  return serialized;
};
var ResolvedImage = function ResolvedImage2(options) {
  this.name = options.name;
  this.available = options.available;
};
ResolvedImage.prototype.toString = function toString5() {
  return this.name;
};
ResolvedImage.fromString = function fromString3(name) {
  if (!name) {
    return null;
  }
  return new ResolvedImage({
    name,
    available: false
  });
};
ResolvedImage.prototype.serialize = function serialize2() {
  return [
    "image",
    this.name
  ];
};
function validateRGBA(r, g, b, a) {
  if (!(typeof r === "number" && r >= 0 && r <= 255 && typeof g === "number" && g >= 0 && g <= 255 && typeof b === "number" && b >= 0 && b <= 255)) {
    var value = typeof a === "number" ? [
      r,
      g,
      b,
      a
    ] : [
      r,
      g,
      b
    ];
    return "Invalid rgba value [" + value.join(", ") + "]: 'r', 'g', and 'b' must be between 0 and 255.";
  }
  if (!(typeof a === "undefined" || typeof a === "number" && a >= 0 && a <= 1)) {
    return "Invalid rgba value [" + [
      r,
      g,
      b,
      a
    ].join(", ") + "]: 'a' must be between 0 and 1.";
  }
  return null;
}
function isValue2(mixed) {
  if (mixed === null) {
    return true;
  } else if (typeof mixed === "string") {
    return true;
  } else if (typeof mixed === "boolean") {
    return true;
  } else if (typeof mixed === "number") {
    return true;
  } else if (mixed instanceof Color) {
    return true;
  } else if (mixed instanceof Collator) {
    return true;
  } else if (mixed instanceof Formatted) {
    return true;
  } else if (mixed instanceof ResolvedImage) {
    return true;
  } else if (Array.isArray(mixed)) {
    for (var i2 = 0, list = mixed; i2 < list.length; i2 += 1) {
      var item = list[i2];
      if (!isValue2(item)) {
        return false;
      }
    }
    return true;
  } else if (typeof mixed === "object") {
    for (var key in mixed) {
      if (!isValue2(mixed[key])) {
        return false;
      }
    }
    return true;
  } else {
    return false;
  }
}
function typeOf(value) {
  if (value === null) {
    return NullType;
  } else if (typeof value === "string") {
    return StringType;
  } else if (typeof value === "boolean") {
    return BooleanType;
  } else if (typeof value === "number") {
    return NumberType;
  } else if (value instanceof Color) {
    return ColorType;
  } else if (value instanceof Collator) {
    return CollatorType;
  } else if (value instanceof Formatted) {
    return FormattedType;
  } else if (value instanceof ResolvedImage) {
    return ResolvedImageType;
  } else if (Array.isArray(value)) {
    var length = value.length;
    var itemType;
    for (var i2 = 0, list = value; i2 < list.length; i2 += 1) {
      var item = list[i2];
      var t = typeOf(item);
      if (!itemType) {
        itemType = t;
      } else if (itemType === t) {
        continue;
      } else {
        itemType = ValueType;
        break;
      }
    }
    return array$1(itemType || ValueType, length);
  } else {
    return ObjectType;
  }
}
function toString6(value) {
  var type = typeof value;
  if (value === null) {
    return "";
  } else if (type === "string" || type === "number" || type === "boolean") {
    return String(value);
  } else if (value instanceof Color || value instanceof Formatted || value instanceof ResolvedImage) {
    return value.toString();
  } else {
    return JSON.stringify(value);
  }
}
var Literal = function Literal2(type, value) {
  this.type = type;
  this.value = value;
};
Literal.parse = function parse2(args, context2) {
  if (args.length !== 2) {
    return context2.error("'literal' expression requires exactly one argument, but found " + (args.length - 1) + " instead.");
  }
  if (!isValue2(args[1])) {
    return context2.error("invalid value");
  }
  var value = args[1];
  var type = typeOf(value);
  var expected = context2.expectedType;
  if (type.kind === "array" && type.N === 0 && expected && expected.kind === "array" && (typeof expected.N !== "number" || expected.N === 0)) {
    type = expected;
  }
  return new Literal(type, value);
};
Literal.prototype.evaluate = function evaluate() {
  return this.value;
};
Literal.prototype.eachChild = function eachChild() {
};
Literal.prototype.outputDefined = function outputDefined() {
  return true;
};
Literal.prototype.serialize = function serialize3() {
  if (this.type.kind === "array" || this.type.kind === "object") {
    return [
      "literal",
      this.value
    ];
  } else if (this.value instanceof Color) {
    return ["rgba"].concat(this.value.toArray());
  } else if (this.value instanceof Formatted) {
    return this.value.serialize();
  } else {
    return this.value;
  }
};
var RuntimeError2 = function RuntimeError3(message) {
  this.name = "ExpressionEvaluationError";
  this.message = message;
};
RuntimeError2.prototype.toJSON = function toJSON() {
  return this.message;
};
var types$2 = {
  string: StringType,
  number: NumberType,
  boolean: BooleanType,
  object: ObjectType
};
var Assertion = function Assertion2(type, args) {
  this.type = type;
  this.args = args;
};
Assertion.parse = function parse3(args, context2) {
  if (args.length < 2) {
    return context2.error("Expected at least one argument.");
  }
  var i2 = 1;
  var type;
  var name = args[0];
  if (name === "array") {
    var itemType;
    if (args.length > 2) {
      var type$1 = args[1];
      if (typeof type$1 !== "string" || !(type$1 in types$2) || type$1 === "object") {
        return context2.error('The item type argument of "array" must be one of string, number, boolean', 1);
      }
      itemType = types$2[type$1];
      i2++;
    } else {
      itemType = ValueType;
    }
    var N;
    if (args.length > 3) {
      if (args[2] !== null && (typeof args[2] !== "number" || args[2] < 0 || args[2] !== Math.floor(args[2]))) {
        return context2.error('The length argument to "array" must be a positive integer literal', 2);
      }
      N = args[2];
      i2++;
    }
    type = array$1(itemType, N);
  } else {
    type = types$2[name];
  }
  var parsed = [];
  for (; i2 < args.length; i2++) {
    var input2 = context2.parse(args[i2], i2, ValueType);
    if (!input2) {
      return null;
    }
    parsed.push(input2);
  }
  return new Assertion(type, parsed);
};
Assertion.prototype.evaluate = function evaluate2(ctx) {
  for (var i2 = 0; i2 < this.args.length; i2++) {
    var value = this.args[i2].evaluate(ctx);
    var error3 = checkSubtype(this.type, typeOf(value));
    if (!error3) {
      return value;
    } else if (i2 === this.args.length - 1) {
      throw new RuntimeError2("Expected value to be of type " + toString$1(this.type) + ", but found " + toString$1(typeOf(value)) + " instead.");
    }
  }
  return null;
};
Assertion.prototype.eachChild = function eachChild2(fn) {
  this.args.forEach(fn);
};
Assertion.prototype.outputDefined = function outputDefined2() {
  return this.args.every(function(arg) {
    return arg.outputDefined();
  });
};
Assertion.prototype.serialize = function serialize4() {
  var type = this.type;
  var serialized = [type.kind];
  if (type.kind === "array") {
    var itemType = type.itemType;
    if (itemType.kind === "string" || itemType.kind === "number" || itemType.kind === "boolean") {
      serialized.push(itemType.kind);
      var N = type.N;
      if (typeof N === "number" || this.args.length > 1) {
        serialized.push(N);
      }
    }
  }
  return serialized.concat(this.args.map(function(arg) {
    return arg.serialize();
  }));
};
var FormatExpression = function FormatExpression2(sections) {
  this.type = FormattedType;
  this.sections = sections;
};
FormatExpression.parse = function parse4(args, context2) {
  if (args.length < 2) {
    return context2.error("Expected at least one argument.");
  }
  var firstArg = args[1];
  if (!Array.isArray(firstArg) && typeof firstArg === "object") {
    return context2.error("First argument must be an image or text section.");
  }
  var sections = [];
  var nextTokenMayBeObject = false;
  for (var i2 = 1; i2 <= args.length - 1; ++i2) {
    var arg = args[i2];
    if (nextTokenMayBeObject && typeof arg === "object" && !Array.isArray(arg)) {
      nextTokenMayBeObject = false;
      var scale5 = null;
      if (arg["font-scale"]) {
        scale5 = context2.parse(arg["font-scale"], 1, NumberType);
        if (!scale5) {
          return null;
        }
      }
      var font = null;
      if (arg["text-font"]) {
        font = context2.parse(arg["text-font"], 1, array$1(StringType));
        if (!font) {
          return null;
        }
      }
      var textColor = null;
      if (arg["text-color"]) {
        textColor = context2.parse(arg["text-color"], 1, ColorType);
        if (!textColor) {
          return null;
        }
      }
      var lastExpression = sections[sections.length - 1];
      lastExpression.scale = scale5;
      lastExpression.font = font;
      lastExpression.textColor = textColor;
    } else {
      var content = context2.parse(args[i2], 1, ValueType);
      if (!content) {
        return null;
      }
      var kind = content.type.kind;
      if (kind !== "string" && kind !== "value" && kind !== "null" && kind !== "resolvedImage") {
        return context2.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");
      }
      nextTokenMayBeObject = true;
      sections.push({
        content,
        scale: null,
        font: null,
        textColor: null
      });
    }
  }
  return new FormatExpression(sections);
};
FormatExpression.prototype.evaluate = function evaluate3(ctx) {
  var evaluateSection = function(section) {
    var evaluatedContent = section.content.evaluate(ctx);
    if (typeOf(evaluatedContent) === ResolvedImageType) {
      return new FormattedSection("", evaluatedContent, null, null, null);
    }
    return new FormattedSection(toString6(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(",") : null, section.textColor ? section.textColor.evaluate(ctx) : null);
  };
  return new Formatted(this.sections.map(evaluateSection));
};
FormatExpression.prototype.eachChild = function eachChild3(fn) {
  for (var i2 = 0, list = this.sections; i2 < list.length; i2 += 1) {
    var section = list[i2];
    fn(section.content);
    if (section.scale) {
      fn(section.scale);
    }
    if (section.font) {
      fn(section.font);
    }
    if (section.textColor) {
      fn(section.textColor);
    }
  }
};
FormatExpression.prototype.outputDefined = function outputDefined3() {
  return false;
};
FormatExpression.prototype.serialize = function serialize5() {
  var serialized = ["format"];
  for (var i2 = 0, list = this.sections; i2 < list.length; i2 += 1) {
    var section = list[i2];
    serialized.push(section.content.serialize());
    var options = {};
    if (section.scale) {
      options["font-scale"] = section.scale.serialize();
    }
    if (section.font) {
      options["text-font"] = section.font.serialize();
    }
    if (section.textColor) {
      options["text-color"] = section.textColor.serialize();
    }
    serialized.push(options);
  }
  return serialized;
};
var ImageExpression = function ImageExpression2(input2) {
  this.type = ResolvedImageType;
  this.input = input2;
};
ImageExpression.parse = function parse5(args, context2) {
  if (args.length !== 2) {
    return context2.error("Expected two arguments.");
  }
  var name = context2.parse(args[1], 1, StringType);
  if (!name) {
    return context2.error("No image name provided.");
  }
  return new ImageExpression(name);
};
ImageExpression.prototype.evaluate = function evaluate4(ctx) {
  var evaluatedImageName = this.input.evaluate(ctx);
  var value = ResolvedImage.fromString(evaluatedImageName);
  if (value && ctx.availableImages) {
    value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;
  }
  return value;
};
ImageExpression.prototype.eachChild = function eachChild4(fn) {
  fn(this.input);
};
ImageExpression.prototype.outputDefined = function outputDefined4() {
  return false;
};
ImageExpression.prototype.serialize = function serialize6() {
  return [
    "image",
    this.input.serialize()
  ];
};
var types$1 = {
  "to-boolean": BooleanType,
  "to-color": ColorType,
  "to-number": NumberType,
  "to-string": StringType
};
var Coercion = function Coercion2(type, args) {
  this.type = type;
  this.args = args;
};
Coercion.parse = function parse6(args, context2) {
  if (args.length < 2) {
    return context2.error("Expected at least one argument.");
  }
  var name = args[0];
  if ((name === "to-boolean" || name === "to-string") && args.length !== 2) {
    return context2.error("Expected one argument.");
  }
  var type = types$1[name];
  var parsed = [];
  for (var i2 = 1; i2 < args.length; i2++) {
    var input2 = context2.parse(args[i2], i2, ValueType);
    if (!input2) {
      return null;
    }
    parsed.push(input2);
  }
  return new Coercion(type, parsed);
};
Coercion.prototype.evaluate = function evaluate5(ctx) {
  if (this.type.kind === "boolean") {
    return Boolean(this.args[0].evaluate(ctx));
  } else if (this.type.kind === "color") {
    var input2;
    var error3;
    for (var i2 = 0, list = this.args; i2 < list.length; i2 += 1) {
      var arg = list[i2];
      input2 = arg.evaluate(ctx);
      error3 = null;
      if (input2 instanceof Color) {
        return input2;
      } else if (typeof input2 === "string") {
        var c = ctx.parseColor(input2);
        if (c) {
          return c;
        }
      } else if (Array.isArray(input2)) {
        if (input2.length < 3 || input2.length > 4) {
          error3 = "Invalid rbga value " + JSON.stringify(input2) + ": expected an array containing either three or four numeric values.";
        } else {
          error3 = validateRGBA(input2[0], input2[1], input2[2], input2[3]);
        }
        if (!error3) {
          return new Color(input2[0] / 255, input2[1] / 255, input2[2] / 255, input2[3]);
        }
      }
    }
    throw new RuntimeError2(error3 || "Could not parse color from value '" + (typeof input2 === "string" ? input2 : String(JSON.stringify(input2))) + "'");
  } else if (this.type.kind === "number") {
    var value = null;
    for (var i$1 = 0, list$1 = this.args; i$1 < list$1.length; i$1 += 1) {
      var arg$1 = list$1[i$1];
      value = arg$1.evaluate(ctx);
      if (value === null) {
        return 0;
      }
      var num = Number(value);
      if (isNaN(num)) {
        continue;
      }
      return num;
    }
    throw new RuntimeError2("Could not convert " + JSON.stringify(value) + " to number.");
  } else if (this.type.kind === "formatted") {
    return Formatted.fromString(toString6(this.args[0].evaluate(ctx)));
  } else if (this.type.kind === "resolvedImage") {
    return ResolvedImage.fromString(toString6(this.args[0].evaluate(ctx)));
  } else {
    return toString6(this.args[0].evaluate(ctx));
  }
};
Coercion.prototype.eachChild = function eachChild5(fn) {
  this.args.forEach(fn);
};
Coercion.prototype.outputDefined = function outputDefined5() {
  return this.args.every(function(arg) {
    return arg.outputDefined();
  });
};
Coercion.prototype.serialize = function serialize7() {
  if (this.type.kind === "formatted") {
    return new FormatExpression([{
      content: this.args[0],
      scale: null,
      font: null,
      textColor: null
    }]).serialize();
  }
  if (this.type.kind === "resolvedImage") {
    return new ImageExpression(this.args[0]).serialize();
  }
  var serialized = ["to-" + this.type.kind];
  this.eachChild(function(child) {
    serialized.push(child.serialize());
  });
  return serialized;
};
var geometryTypes = [
  "Unknown",
  "Point",
  "LineString",
  "Polygon"
];
var EvaluationContext = function EvaluationContext2() {
  this.globals = null;
  this.feature = null;
  this.featureState = null;
  this.formattedSection = null;
  this._parseColorCache = {};
  this.availableImages = null;
  this.canonical = null;
  this.featureTileCoord = null;
  this.featureDistanceData = null;
};
EvaluationContext.prototype.id = function id() {
  return this.feature && "id" in this.feature && this.feature.id ? this.feature.id : null;
};
EvaluationContext.prototype.geometryType = function geometryType() {
  return this.feature ? typeof this.feature.type === "number" ? geometryTypes[this.feature.type] : this.feature.type : null;
};
EvaluationContext.prototype.geometry = function geometry() {
  return this.feature && "geometry" in this.feature ? this.feature.geometry : null;
};
EvaluationContext.prototype.canonicalID = function canonicalID() {
  return this.canonical;
};
EvaluationContext.prototype.properties = function properties() {
  return this.feature && this.feature.properties || {};
};
EvaluationContext.prototype.distanceFromCenter = function distanceFromCenter() {
  if (this.featureTileCoord && this.featureDistanceData) {
    var c = this.featureDistanceData.center;
    var scale5 = this.featureDistanceData.scale;
    var ref = this.featureTileCoord;
    var x = ref.x;
    var y = ref.y;
    var dX = x * scale5 - c[0];
    var dY = y * scale5 - c[1];
    var bX = this.featureDistanceData.bearing[0];
    var bY = this.featureDistanceData.bearing[1];
    var dist = bX * dX + bY * dY;
    return dist;
  }
  return 0;
};
EvaluationContext.prototype.parseColor = function parseColor(input2) {
  var cached = this._parseColorCache[input2];
  if (!cached) {
    cached = this._parseColorCache[input2] = Color.parse(input2);
  }
  return cached;
};
var CompoundExpression = function CompoundExpression2(name, type, evaluate25, args) {
  this.name = name;
  this.type = type;
  this._evaluate = evaluate25;
  this.args = args;
};
CompoundExpression.prototype.evaluate = function evaluate6(ctx) {
  return this._evaluate(ctx, this.args);
};
CompoundExpression.prototype.eachChild = function eachChild6(fn) {
  this.args.forEach(fn);
};
CompoundExpression.prototype.outputDefined = function outputDefined6() {
  return false;
};
CompoundExpression.prototype.serialize = function serialize8() {
  return [this.name].concat(this.args.map(function(arg) {
    return arg.serialize();
  }));
};
CompoundExpression.parse = function parse7(args, context2) {
  var ref$1;
  var op = args[0];
  var definition = CompoundExpression.definitions[op];
  if (!definition) {
    return context2.error('Unknown expression "' + op + '". If you wanted a literal array, use ["literal", [...]].', 0);
  }
  var type = Array.isArray(definition) ? definition[0] : definition.type;
  var availableOverloads = Array.isArray(definition) ? [[
    definition[1],
    definition[2]
  ]] : definition.overloads;
  var overloads = availableOverloads.filter(
    function(ref2) {
      var signature = ref2[0];
      return !Array.isArray(signature) || // varags
      signature.length === args.length - 1;
    }
    // correct param count
  );
  var signatureContext = null;
  for (var i$3 = 0, list = overloads; i$3 < list.length; i$3 += 1) {
    var ref = list[i$3];
    var params = ref[0];
    var evaluate25 = ref[1];
    signatureContext = new ParsingContext(context2.registry, context2.path, null, context2.scope);
    var parsedArgs = [];
    var argParseFailed = false;
    for (var i2 = 1; i2 < args.length; i2++) {
      var arg = args[i2];
      var expectedType = Array.isArray(params) ? params[i2 - 1] : params.type;
      var parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);
      if (!parsed) {
        argParseFailed = true;
        break;
      }
      parsedArgs.push(parsed);
    }
    if (argParseFailed) {
      continue;
    }
    if (Array.isArray(params)) {
      if (params.length !== parsedArgs.length) {
        signatureContext.error("Expected " + params.length + " arguments, but found " + parsedArgs.length + " instead.");
        continue;
      }
    }
    for (var i$1 = 0; i$1 < parsedArgs.length; i$1++) {
      var expected = Array.isArray(params) ? params[i$1] : params.type;
      var arg$1 = parsedArgs[i$1];
      signatureContext.concat(i$1 + 1).checkSubtype(expected, arg$1.type);
    }
    if (signatureContext.errors.length === 0) {
      return new CompoundExpression(op, type, evaluate25, parsedArgs);
    }
  }
  if (overloads.length === 1) {
    (ref$1 = context2.errors).push.apply(ref$1, signatureContext.errors);
  } else {
    var expected$1 = overloads.length ? overloads : availableOverloads;
    var signatures = expected$1.map(function(ref2) {
      var params2 = ref2[0];
      return stringifySignature(params2);
    }).join(" | ");
    var actualTypes = [];
    for (var i$2 = 1; i$2 < args.length; i$2++) {
      var parsed$1 = context2.parse(args[i$2], 1 + actualTypes.length);
      if (!parsed$1) {
        return null;
      }
      actualTypes.push(toString$1(parsed$1.type));
    }
    context2.error("Expected arguments of type " + signatures + ", but found (" + actualTypes.join(", ") + ") instead.");
  }
  return null;
};
CompoundExpression.register = function register(registry, definitions) {
  CompoundExpression.definitions = definitions;
  for (var name in definitions) {
    registry[name] = CompoundExpression;
  }
};
function stringifySignature(signature) {
  if (Array.isArray(signature)) {
    return "(" + signature.map(toString$1).join(", ") + ")";
  } else {
    return "(" + toString$1(signature.type) + "...)";
  }
}
var CollatorExpression = function CollatorExpression2(caseSensitive, diacriticSensitive, locale) {
  this.type = CollatorType;
  this.locale = locale;
  this.caseSensitive = caseSensitive;
  this.diacriticSensitive = diacriticSensitive;
};
CollatorExpression.parse = function parse8(args, context2) {
  if (args.length !== 2) {
    return context2.error("Expected one argument.");
  }
  var options = args[1];
  if (typeof options !== "object" || Array.isArray(options)) {
    return context2.error("Collator options argument must be an object.");
  }
  var caseSensitive = context2.parse(options["case-sensitive"] === void 0 ? false : options["case-sensitive"], 1, BooleanType);
  if (!caseSensitive) {
    return null;
  }
  var diacriticSensitive = context2.parse(options["diacritic-sensitive"] === void 0 ? false : options["diacritic-sensitive"], 1, BooleanType);
  if (!diacriticSensitive) {
    return null;
  }
  var locale = null;
  if (options["locale"]) {
    locale = context2.parse(options["locale"], 1, StringType);
    if (!locale) {
      return null;
    }
  }
  return new CollatorExpression(caseSensitive, diacriticSensitive, locale);
};
CollatorExpression.prototype.evaluate = function evaluate7(ctx) {
  return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);
};
CollatorExpression.prototype.eachChild = function eachChild7(fn) {
  fn(this.caseSensitive);
  fn(this.diacriticSensitive);
  if (this.locale) {
    fn(this.locale);
  }
};
CollatorExpression.prototype.outputDefined = function outputDefined7() {
  return false;
};
CollatorExpression.prototype.serialize = function serialize9() {
  var options = {};
  options["case-sensitive"] = this.caseSensitive.serialize();
  options["diacritic-sensitive"] = this.diacriticSensitive.serialize();
  if (this.locale) {
    options["locale"] = this.locale.serialize();
  }
  return [
    "collator",
    options
  ];
};
var EXTENT3 = 8192;
function updateBBox(bbox, coord) {
  bbox[0] = Math.min(bbox[0], coord[0]);
  bbox[1] = Math.min(bbox[1], coord[1]);
  bbox[2] = Math.max(bbox[2], coord[0]);
  bbox[3] = Math.max(bbox[3], coord[1]);
}
function mercatorXfromLng(lng) {
  return (180 + lng) / 360;
}
function mercatorYfromLat(lat) {
  return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))) / 360;
}
function boxWithinBox(bbox1, bbox2) {
  if (bbox1[0] <= bbox2[0]) {
    return false;
  }
  if (bbox1[2] >= bbox2[2]) {
    return false;
  }
  if (bbox1[1] <= bbox2[1]) {
    return false;
  }
  if (bbox1[3] >= bbox2[3]) {
    return false;
  }
  return true;
}
function getTileCoordinates(p, canonical) {
  var x = mercatorXfromLng(p[0]);
  var y = mercatorYfromLat(p[1]);
  var tilesAtZoom = Math.pow(2, canonical.z);
  return [
    Math.round(x * tilesAtZoom * EXTENT3),
    Math.round(y * tilesAtZoom * EXTENT3)
  ];
}
function onBoundary(p, p12, p22) {
  var x1 = p[0] - p12[0];
  var y1 = p[1] - p12[1];
  var x2 = p[0] - p22[0];
  var y2 = p[1] - p22[1];
  return x1 * y2 - x2 * y1 === 0 && x1 * x2 <= 0 && y1 * y2 <= 0;
}
function rayIntersect(p, p12, p22) {
  return p12[1] > p[1] !== p22[1] > p[1] && p[0] < (p22[0] - p12[0]) * (p[1] - p12[1]) / (p22[1] - p12[1]) + p12[0];
}
function pointWithinPolygon(point, rings) {
  var inside = false;
  for (var i2 = 0, len = rings.length; i2 < len; i2++) {
    var ring = rings[i2];
    for (var j = 0, len2 = ring.length; j < len2 - 1; j++) {
      if (onBoundary(point, ring[j], ring[j + 1])) {
        return false;
      }
      if (rayIntersect(point, ring[j], ring[j + 1])) {
        inside = !inside;
      }
    }
  }
  return inside;
}
function pointWithinPolygons(point, polygons) {
  for (var i2 = 0; i2 < polygons.length; i2++) {
    if (pointWithinPolygon(point, polygons[i2])) {
      return true;
    }
  }
  return false;
}
function perp(v14, v2) {
  return v14[0] * v2[1] - v14[1] * v2[0];
}
function twoSided(p12, p22, q1, q2) {
  var x1 = p12[0] - q1[0];
  var y1 = p12[1] - q1[1];
  var x2 = p22[0] - q1[0];
  var y2 = p22[1] - q1[1];
  var x3 = q2[0] - q1[0];
  var y3 = q2[1] - q1[1];
  var det1 = x1 * y3 - x3 * y1;
  var det2 = x2 * y3 - x3 * y2;
  if (det1 > 0 && det2 < 0 || det1 < 0 && det2 > 0) {
    return true;
  }
  return false;
}
function lineIntersectLine(a, b, c, d) {
  var vectorP = [
    b[0] - a[0],
    b[1] - a[1]
  ];
  var vectorQ = [
    d[0] - c[0],
    d[1] - c[1]
  ];
  if (perp(vectorQ, vectorP) === 0) {
    return false;
  }
  if (twoSided(a, b, c, d) && twoSided(c, d, a, b)) {
    return true;
  }
  return false;
}
function lineIntersectPolygon(p12, p22, polygon) {
  for (var i2 = 0, list = polygon; i2 < list.length; i2 += 1) {
    var ring = list[i2];
    for (var j = 0; j < ring.length - 1; ++j) {
      if (lineIntersectLine(p12, p22, ring[j], ring[j + 1])) {
        return true;
      }
    }
  }
  return false;
}
function lineStringWithinPolygon(line, polygon) {
  for (var i2 = 0; i2 < line.length; ++i2) {
    if (!pointWithinPolygon(line[i2], polygon)) {
      return false;
    }
  }
  for (var i$1 = 0; i$1 < line.length - 1; ++i$1) {
    if (lineIntersectPolygon(line[i$1], line[i$1 + 1], polygon)) {
      return false;
    }
  }
  return true;
}
function lineStringWithinPolygons(line, polygons) {
  for (var i2 = 0; i2 < polygons.length; i2++) {
    if (lineStringWithinPolygon(line, polygons[i2])) {
      return true;
    }
  }
  return false;
}
function getTilePolygon(coordinates2, bbox, canonical) {
  var polygon = [];
  for (var i2 = 0; i2 < coordinates2.length; i2++) {
    var ring = [];
    for (var j = 0; j < coordinates2[i2].length; j++) {
      var coord = getTileCoordinates(coordinates2[i2][j], canonical);
      updateBBox(bbox, coord);
      ring.push(coord);
    }
    polygon.push(ring);
  }
  return polygon;
}
function getTilePolygons(coordinates2, bbox, canonical) {
  var polygons = [];
  for (var i2 = 0; i2 < coordinates2.length; i2++) {
    var polygon = getTilePolygon(coordinates2[i2], bbox, canonical);
    polygons.push(polygon);
  }
  return polygons;
}
function updatePoint(p, bbox, polyBBox, worldSize) {
  if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {
    var halfWorldSize = worldSize * 0.5;
    var shift = p[0] - polyBBox[0] > halfWorldSize ? -worldSize : polyBBox[0] - p[0] > halfWorldSize ? worldSize : 0;
    if (shift === 0) {
      shift = p[0] - polyBBox[2] > halfWorldSize ? -worldSize : polyBBox[2] - p[0] > halfWorldSize ? worldSize : 0;
    }
    p[0] += shift;
  }
  updateBBox(bbox, p);
}
function resetBBox(bbox) {
  bbox[0] = bbox[1] = Infinity;
  bbox[2] = bbox[3] = -Infinity;
}
function getTilePoints(geometry2, pointBBox, polyBBox, canonical) {
  var worldSize = Math.pow(2, canonical.z) * EXTENT3;
  var shifts = [
    canonical.x * EXTENT3,
    canonical.y * EXTENT3
  ];
  var tilePoints = [];
  if (!geometry2) {
    return tilePoints;
  }
  for (var i$1 = 0, list$1 = geometry2; i$1 < list$1.length; i$1 += 1) {
    var points = list$1[i$1];
    for (var i2 = 0, list = points; i2 < list.length; i2 += 1) {
      var point = list[i2];
      var p = [
        point.x + shifts[0],
        point.y + shifts[1]
      ];
      updatePoint(p, pointBBox, polyBBox, worldSize);
      tilePoints.push(p);
    }
  }
  return tilePoints;
}
function getTileLines(geometry2, lineBBox, polyBBox, canonical) {
  var worldSize = Math.pow(2, canonical.z) * EXTENT3;
  var shifts = [
    canonical.x * EXTENT3,
    canonical.y * EXTENT3
  ];
  var tileLines = [];
  if (!geometry2) {
    return tileLines;
  }
  for (var i$1 = 0, list$1 = geometry2; i$1 < list$1.length; i$1 += 1) {
    var line = list$1[i$1];
    var tileLine = [];
    for (var i2 = 0, list = line; i2 < list.length; i2 += 1) {
      var point = list[i2];
      var p = [
        point.x + shifts[0],
        point.y + shifts[1]
      ];
      updateBBox(lineBBox, p);
      tileLine.push(p);
    }
    tileLines.push(tileLine);
  }
  if (lineBBox[2] - lineBBox[0] <= worldSize / 2) {
    resetBBox(lineBBox);
    for (var i$3 = 0, list$3 = tileLines; i$3 < list$3.length; i$3 += 1) {
      var line$1 = list$3[i$3];
      for (var i$2 = 0, list$2 = line$1; i$2 < list$2.length; i$2 += 1) {
        var p$1 = list$2[i$2];
        updatePoint(p$1, lineBBox, polyBBox, worldSize);
      }
    }
  }
  return tileLines;
}
function pointsWithinPolygons(ctx, polygonGeometry) {
  var pointBBox = [
    Infinity,
    Infinity,
    -Infinity,
    -Infinity
  ];
  var polyBBox = [
    Infinity,
    Infinity,
    -Infinity,
    -Infinity
  ];
  var canonical = ctx.canonicalID();
  if (!canonical) {
    return false;
  }
  if (polygonGeometry.type === "Polygon") {
    var tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);
    var tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);
    if (!boxWithinBox(pointBBox, polyBBox)) {
      return false;
    }
    for (var i2 = 0, list = tilePoints; i2 < list.length; i2 += 1) {
      var point = list[i2];
      if (!pointWithinPolygon(point, tilePolygon)) {
        return false;
      }
    }
  }
  if (polygonGeometry.type === "MultiPolygon") {
    var tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);
    var tilePoints$1 = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);
    if (!boxWithinBox(pointBBox, polyBBox)) {
      return false;
    }
    for (var i$1 = 0, list$1 = tilePoints$1; i$1 < list$1.length; i$1 += 1) {
      var point$1 = list$1[i$1];
      if (!pointWithinPolygons(point$1, tilePolygons)) {
        return false;
      }
    }
  }
  return true;
}
function linesWithinPolygons(ctx, polygonGeometry) {
  var lineBBox = [
    Infinity,
    Infinity,
    -Infinity,
    -Infinity
  ];
  var polyBBox = [
    Infinity,
    Infinity,
    -Infinity,
    -Infinity
  ];
  var canonical = ctx.canonicalID();
  if (!canonical) {
    return false;
  }
  if (polygonGeometry.type === "Polygon") {
    var tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);
    var tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);
    if (!boxWithinBox(lineBBox, polyBBox)) {
      return false;
    }
    for (var i2 = 0, list = tileLines; i2 < list.length; i2 += 1) {
      var line = list[i2];
      if (!lineStringWithinPolygon(line, tilePolygon)) {
        return false;
      }
    }
  }
  if (polygonGeometry.type === "MultiPolygon") {
    var tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);
    var tileLines$1 = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);
    if (!boxWithinBox(lineBBox, polyBBox)) {
      return false;
    }
    for (var i$1 = 0, list$1 = tileLines$1; i$1 < list$1.length; i$1 += 1) {
      var line$1 = list$1[i$1];
      if (!lineStringWithinPolygons(line$1, tilePolygons)) {
        return false;
      }
    }
  }
  return true;
}
var Within = function Within2(geojson, geometries) {
  this.type = BooleanType;
  this.geojson = geojson;
  this.geometries = geometries;
};
Within.parse = function parse9(args, context2) {
  if (args.length !== 2) {
    return context2.error("'within' expression requires exactly one argument, but found " + (args.length - 1) + " instead.");
  }
  if (isValue2(args[1])) {
    var geojson = args[1];
    if (geojson.type === "FeatureCollection") {
      for (var i2 = 0; i2 < geojson.features.length; ++i2) {
        var type = geojson.features[i2].geometry.type;
        if (type === "Polygon" || type === "MultiPolygon") {
          return new Within(geojson, geojson.features[i2].geometry);
        }
      }
    } else if (geojson.type === "Feature") {
      var type$1 = geojson.geometry.type;
      if (type$1 === "Polygon" || type$1 === "MultiPolygon") {
        return new Within(geojson, geojson.geometry);
      }
    } else if (geojson.type === "Polygon" || geojson.type === "MultiPolygon") {
      return new Within(geojson, geojson);
    }
  }
  return context2.error("'within' expression requires valid geojson object that contains polygon geometry type.");
};
Within.prototype.evaluate = function evaluate8(ctx) {
  if (ctx.geometry() != null && ctx.canonicalID() != null) {
    if (ctx.geometryType() === "Point") {
      return pointsWithinPolygons(ctx, this.geometries);
    } else if (ctx.geometryType() === "LineString") {
      return linesWithinPolygons(ctx, this.geometries);
    }
  }
  return false;
};
Within.prototype.eachChild = function eachChild8() {
};
Within.prototype.outputDefined = function outputDefined8() {
  return true;
};
Within.prototype.serialize = function serialize10() {
  return [
    "within",
    this.geojson
  ];
};
function isFeatureConstant(e) {
  if (e instanceof CompoundExpression) {
    if (e.name === "get" && e.args.length === 1) {
      return false;
    } else if (e.name === "feature-state") {
      return false;
    } else if (e.name === "has" && e.args.length === 1) {
      return false;
    } else if (e.name === "properties" || e.name === "geometry-type" || e.name === "id") {
      return false;
    } else if (/^filter-/.test(e.name)) {
      return false;
    }
  }
  if (e instanceof Within) {
    return false;
  }
  var result = true;
  e.eachChild(function(arg) {
    if (result && !isFeatureConstant(arg)) {
      result = false;
    }
  });
  return result;
}
function isStateConstant(e) {
  if (e instanceof CompoundExpression) {
    if (e.name === "feature-state") {
      return false;
    }
  }
  var result = true;
  e.eachChild(function(arg) {
    if (result && !isStateConstant(arg)) {
      result = false;
    }
  });
  return result;
}
function isGlobalPropertyConstant(e, properties2) {
  if (e instanceof CompoundExpression && properties2.indexOf(e.name) >= 0) {
    return false;
  }
  var result = true;
  e.eachChild(function(arg) {
    if (result && !isGlobalPropertyConstant(arg, properties2)) {
      result = false;
    }
  });
  return result;
}
var Var = function Var2(name, boundExpression) {
  this.type = boundExpression.type;
  this.name = name;
  this.boundExpression = boundExpression;
};
Var.parse = function parse10(args, context2) {
  if (args.length !== 2 || typeof args[1] !== "string") {
    return context2.error("'var' expression requires exactly one string literal argument.");
  }
  var name = args[1];
  if (!context2.scope.has(name)) {
    return context2.error('Unknown variable "' + name + '". Make sure "' + name + '" has been bound in an enclosing "let" expression before using it.', 1);
  }
  return new Var(name, context2.scope.get(name));
};
Var.prototype.evaluate = function evaluate9(ctx) {
  return this.boundExpression.evaluate(ctx);
};
Var.prototype.eachChild = function eachChild9() {
};
Var.prototype.outputDefined = function outputDefined9() {
  return false;
};
Var.prototype.serialize = function serialize11() {
  return [
    "var",
    this.name
  ];
};
var ParsingContext = function ParsingContext2(registry, path, expectedType, scope, errors) {
  if (path === void 0) path = [];
  if (scope === void 0) scope = new Scope();
  if (errors === void 0) errors = [];
  this.registry = registry;
  this.path = path;
  this.key = path.map(function(part) {
    return "[" + part + "]";
  }).join("");
  this.scope = scope;
  this.errors = errors;
  this.expectedType = expectedType;
};
ParsingContext.prototype.parse = function parse11(expr, index, expectedType, bindings, options) {
  if (options === void 0) options = {};
  if (index) {
    return this.concat(index, expectedType, bindings)._parse(expr, options);
  }
  return this._parse(expr, options);
};
ParsingContext.prototype._parse = function _parse(expr, options) {
  if (expr === null || typeof expr === "string" || typeof expr === "boolean" || typeof expr === "number") {
    expr = [
      "literal",
      expr
    ];
  }
  function annotate(parsed2, type, typeAnnotation) {
    if (typeAnnotation === "assert") {
      return new Assertion(type, [parsed2]);
    } else if (typeAnnotation === "coerce") {
      return new Coercion(type, [parsed2]);
    } else {
      return parsed2;
    }
  }
  if (Array.isArray(expr)) {
    if (expr.length === 0) {
      return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');
    }
    var op = expr[0];
    if (typeof op !== "string") {
      this.error("Expression name must be a string, but found " + typeof op + ' instead. If you wanted a literal array, use ["literal", [...]].', 0);
      return null;
    }
    var Expr = this.registry[op];
    if (Expr) {
      var parsed = Expr.parse(expr, this);
      if (!parsed) {
        return null;
      }
      if (this.expectedType) {
        var expected = this.expectedType;
        var actual = parsed.type;
        if ((expected.kind === "string" || expected.kind === "number" || expected.kind === "boolean" || expected.kind === "object" || expected.kind === "array") && actual.kind === "value") {
          parsed = annotate(parsed, expected, options.typeAnnotation || "assert");
        } else if ((expected.kind === "color" || expected.kind === "formatted" || expected.kind === "resolvedImage") && (actual.kind === "value" || actual.kind === "string")) {
          parsed = annotate(parsed, expected, options.typeAnnotation || "coerce");
        } else if (this.checkSubtype(expected, actual)) {
          return null;
        }
      }
      if (!(parsed instanceof Literal) && parsed.type.kind !== "resolvedImage" && isConstant(parsed)) {
        var ec = new EvaluationContext();
        try {
          parsed = new Literal(parsed.type, parsed.evaluate(ec));
        } catch (e) {
          this.error(e.message);
          return null;
        }
      }
      return parsed;
    }
    return this.error('Unknown expression "' + op + '". If you wanted a literal array, use ["literal", [...]].', 0);
  } else if (typeof expr === "undefined") {
    return this.error("'undefined' value invalid. Use null instead.");
  } else if (typeof expr === "object") {
    return this.error('Bare objects invalid. Use ["literal", {...}] instead.');
  } else {
    return this.error("Expected an array, but found " + typeof expr + " instead.");
  }
};
ParsingContext.prototype.concat = function concat3(index, expectedType, bindings) {
  var path = typeof index === "number" ? this.path.concat(index) : this.path;
  var scope = bindings ? this.scope.concat(bindings) : this.scope;
  return new ParsingContext(this.registry, path, expectedType || null, scope, this.errors);
};
ParsingContext.prototype.error = function error(error$1) {
  var keys = [], len = arguments.length - 1;
  while (len-- > 0) keys[len] = arguments[len + 1];
  var key = "" + this.key + keys.map(function(k) {
    return "[" + k + "]";
  }).join("");
  this.errors.push(new ParsingError(key, error$1));
};
ParsingContext.prototype.checkSubtype = function checkSubtype$1(expected, t) {
  var error3 = checkSubtype(expected, t);
  if (error3) {
    this.error(error3);
  }
  return error3;
};
function isConstant(expression) {
  if (expression instanceof Var) {
    return isConstant(expression.boundExpression);
  } else if (expression instanceof CompoundExpression && expression.name === "error") {
    return false;
  } else if (expression instanceof CollatorExpression) {
    return false;
  } else if (expression instanceof Within) {
    return false;
  }
  var isTypeAnnotation = expression instanceof Coercion || expression instanceof Assertion;
  var childrenConstant = true;
  expression.eachChild(function(child) {
    if (isTypeAnnotation) {
      childrenConstant = childrenConstant && isConstant(child);
    } else {
      childrenConstant = childrenConstant && child instanceof Literal;
    }
  });
  if (!childrenConstant) {
    return false;
  }
  return isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [
    "zoom",
    "heatmap-density",
    "line-progress",
    "sky-radial-progress",
    "accumulated",
    "is-supported-script",
    "pitch",
    "distance-from-center"
  ]);
}
function findStopLessThanOrEqualTo(stops, input2) {
  var lastIndex = stops.length - 1;
  var lowerIndex = 0;
  var upperIndex = lastIndex;
  var currentIndex = 0;
  var currentValue, nextValue;
  while (lowerIndex <= upperIndex) {
    currentIndex = Math.floor((lowerIndex + upperIndex) / 2);
    currentValue = stops[currentIndex];
    nextValue = stops[currentIndex + 1];
    if (currentValue <= input2) {
      if (currentIndex === lastIndex || input2 < nextValue) {
        return currentIndex;
      }
      lowerIndex = currentIndex + 1;
    } else if (currentValue > input2) {
      upperIndex = currentIndex - 1;
    } else {
      throw new RuntimeError2("Input is not a number.");
    }
  }
  return 0;
}
var Step = function Step2(type, input2, stops) {
  this.type = type;
  this.input = input2;
  this.labels = [];
  this.outputs = [];
  for (var i2 = 0, list = stops; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var label = ref[0];
    var expression = ref[1];
    this.labels.push(label);
    this.outputs.push(expression);
  }
};
Step.parse = function parse12(args, context2) {
  if (args.length - 1 < 4) {
    return context2.error("Expected at least 4 arguments, but found only " + (args.length - 1) + ".");
  }
  if ((args.length - 1) % 2 !== 0) {
    return context2.error("Expected an even number of arguments.");
  }
  var input2 = context2.parse(args[1], 1, NumberType);
  if (!input2) {
    return null;
  }
  var stops = [];
  var outputType = null;
  if (context2.expectedType && context2.expectedType.kind !== "value") {
    outputType = context2.expectedType;
  }
  for (var i2 = 1; i2 < args.length; i2 += 2) {
    var label = i2 === 1 ? -Infinity : args[i2];
    var value = args[i2 + 1];
    var labelKey = i2;
    var valueKey = i2 + 1;
    if (typeof label !== "number") {
      return context2.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);
    }
    if (stops.length && stops[stops.length - 1][0] >= label) {
      return context2.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', labelKey);
    }
    var parsed = context2.parse(value, valueKey, outputType);
    if (!parsed) {
      return null;
    }
    outputType = outputType || parsed.type;
    stops.push([
      label,
      parsed
    ]);
  }
  return new Step(outputType, input2, stops);
};
Step.prototype.evaluate = function evaluate10(ctx) {
  var labels = this.labels;
  var outputs = this.outputs;
  if (labels.length === 1) {
    return outputs[0].evaluate(ctx);
  }
  var value = this.input.evaluate(ctx);
  if (value <= labels[0]) {
    return outputs[0].evaluate(ctx);
  }
  var stopCount = labels.length;
  if (value >= labels[stopCount - 1]) {
    return outputs[stopCount - 1].evaluate(ctx);
  }
  var index = findStopLessThanOrEqualTo(labels, value);
  return outputs[index].evaluate(ctx);
};
Step.prototype.eachChild = function eachChild10(fn) {
  fn(this.input);
  for (var i2 = 0, list = this.outputs; i2 < list.length; i2 += 1) {
    var expression = list[i2];
    fn(expression);
  }
};
Step.prototype.outputDefined = function outputDefined10() {
  return this.outputs.every(function(out) {
    return out.outputDefined();
  });
};
Step.prototype.serialize = function serialize12() {
  var serialized = [
    "step",
    this.input.serialize()
  ];
  for (var i2 = 0; i2 < this.labels.length; i2++) {
    if (i2 > 0) {
      serialized.push(this.labels[i2]);
    }
    serialized.push(this.outputs[i2].serialize());
  }
  return serialized;
};
var unitbezier = UnitBezier;
function UnitBezier(p1x, p1y, p2x, p2y) {
  this.cx = 3 * p1x;
  this.bx = 3 * (p2x - p1x) - this.cx;
  this.ax = 1 - this.cx - this.bx;
  this.cy = 3 * p1y;
  this.by = 3 * (p2y - p1y) - this.cy;
  this.ay = 1 - this.cy - this.by;
  this.p1x = p1x;
  this.p1y = p2y;
  this.p2x = p2x;
  this.p2y = p2y;
}
UnitBezier.prototype.sampleCurveX = function(t) {
  return ((this.ax * t + this.bx) * t + this.cx) * t;
};
UnitBezier.prototype.sampleCurveY = function(t) {
  return ((this.ay * t + this.by) * t + this.cy) * t;
};
UnitBezier.prototype.sampleCurveDerivativeX = function(t) {
  return (3 * this.ax * t + 2 * this.bx) * t + this.cx;
};
UnitBezier.prototype.solveCurveX = function(x, epsilon) {
  if (typeof epsilon === "undefined") {
    epsilon = 1e-6;
  }
  var t02, t12, t22, x2, i2;
  for (t22 = x, i2 = 0; i2 < 8; i2++) {
    x2 = this.sampleCurveX(t22) - x;
    if (Math.abs(x2) < epsilon) {
      return t22;
    }
    var d2 = this.sampleCurveDerivativeX(t22);
    if (Math.abs(d2) < 1e-6) {
      break;
    }
    t22 = t22 - x2 / d2;
  }
  t02 = 0;
  t12 = 1;
  t22 = x;
  if (t22 < t02) {
    return t02;
  }
  if (t22 > t12) {
    return t12;
  }
  while (t02 < t12) {
    x2 = this.sampleCurveX(t22);
    if (Math.abs(x2 - x) < epsilon) {
      return t22;
    }
    if (x > x2) {
      t02 = t22;
    } else {
      t12 = t22;
    }
    t22 = (t12 - t02) * 0.5 + t02;
  }
  return t22;
};
UnitBezier.prototype.solve = function(x, epsilon) {
  return this.sampleCurveY(this.solveCurveX(x, epsilon));
};
function number(a, b, t) {
  return a * (1 - t) + b * t;
}
function color(from2, to, t) {
  return new Color(number(from2.r, to.r, t), number(from2.g, to.g, t), number(from2.b, to.b, t), number(from2.a, to.a, t));
}
function array(from2, to, t) {
  return from2.map(function(d, i2) {
    return number(d, to[i2], t);
  });
}
var interpolate = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  number,
  color,
  array
});
var Xn = 0.95047;
var Yn = 1;
var Zn = 1.08883;
var t0 = 4 / 29;
var t1 = 6 / 29;
var t2 = 3 * t1 * t1;
var t3 = t1 * t1 * t1;
var deg2rad$1 = Math.PI / 180;
var rad2deg = 180 / Math.PI;
function xyz2lab(t) {
  return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
}
function lab2xyz(t) {
  return t > t1 ? t * t * t : t2 * (t - t0);
}
function xyz2rgb(x) {
  return 255 * (x <= 31308e-7 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
}
function rgb2xyz(x) {
  x /= 255;
  return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
}
function rgbToLab(rgbColor) {
  var b = rgb2xyz(rgbColor.r), a = rgb2xyz(rgbColor.g), l = rgb2xyz(rgbColor.b), x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn), y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.072175 * l) / Yn), z = xyz2lab((0.0193339 * b + 0.119192 * a + 0.9503041 * l) / Zn);
  return {
    l: 116 * y - 16,
    a: 500 * (x - y),
    b: 200 * (y - z),
    alpha: rgbColor.a
  };
}
function labToRgb(labColor) {
  var y = (labColor.l + 16) / 116, x = isNaN(labColor.a) ? y : y + labColor.a / 500, z = isNaN(labColor.b) ? y : y - labColor.b / 200;
  y = Yn * lab2xyz(y);
  x = Xn * lab2xyz(x);
  z = Zn * lab2xyz(z);
  return new Color(
    xyz2rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z),
    // D65 -> sRGB
    xyz2rgb(-0.969266 * x + 1.8760108 * y + 0.041556 * z),
    xyz2rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z),
    labColor.alpha
  );
}
function interpolateLab(from2, to, t) {
  return {
    l: number(from2.l, to.l, t),
    a: number(from2.a, to.a, t),
    b: number(from2.b, to.b, t),
    alpha: number(from2.alpha, to.alpha, t)
  };
}
function rgbToHcl(rgbColor) {
  var ref = rgbToLab(rgbColor);
  var l = ref.l;
  var a = ref.a;
  var b = ref.b;
  var h = Math.atan2(b, a) * rad2deg;
  return {
    h: h < 0 ? h + 360 : h,
    c: Math.sqrt(a * a + b * b),
    l,
    alpha: rgbColor.a
  };
}
function hclToRgb(hclColor) {
  var h = hclColor.h * deg2rad$1, c = hclColor.c, l = hclColor.l;
  return labToRgb({
    l,
    a: Math.cos(h) * c,
    b: Math.sin(h) * c,
    alpha: hclColor.alpha
  });
}
function interpolateHue(a, b, t) {
  var d = b - a;
  return a + t * (d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d);
}
function interpolateHcl(from2, to, t) {
  return {
    h: interpolateHue(from2.h, to.h, t),
    c: number(from2.c, to.c, t),
    l: number(from2.l, to.l, t),
    alpha: number(from2.alpha, to.alpha, t)
  };
}
var lab = {
  forward: rgbToLab,
  reverse: labToRgb,
  interpolate: interpolateLab
};
var hcl = {
  forward: rgbToHcl,
  reverse: hclToRgb,
  interpolate: interpolateHcl
};
var Interpolate = function Interpolate2(type, operator, interpolation, input2, stops) {
  this.type = type;
  this.operator = operator;
  this.interpolation = interpolation;
  this.input = input2;
  this.labels = [];
  this.outputs = [];
  for (var i2 = 0, list = stops; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var label = ref[0];
    var expression = ref[1];
    this.labels.push(label);
    this.outputs.push(expression);
  }
};
Interpolate.interpolationFactor = function interpolationFactor(interpolation, input2, lower, upper) {
  var t = 0;
  if (interpolation.name === "exponential") {
    t = exponentialInterpolation(input2, interpolation.base, lower, upper);
  } else if (interpolation.name === "linear") {
    t = exponentialInterpolation(input2, 1, lower, upper);
  } else if (interpolation.name === "cubic-bezier") {
    var c = interpolation.controlPoints;
    var ub = new unitbezier(c[0], c[1], c[2], c[3]);
    t = ub.solve(exponentialInterpolation(input2, 1, lower, upper));
  }
  return t;
};
Interpolate.parse = function parse13(args, context2) {
  var operator = args[0];
  var interpolation = args[1];
  var input2 = args[2];
  var rest = args.slice(3);
  if (!Array.isArray(interpolation) || interpolation.length === 0) {
    return context2.error("Expected an interpolation type expression.", 1);
  }
  if (interpolation[0] === "linear") {
    interpolation = { name: "linear" };
  } else if (interpolation[0] === "exponential") {
    var base = interpolation[1];
    if (typeof base !== "number") {
      return context2.error("Exponential interpolation requires a numeric base.", 1, 1);
    }
    interpolation = {
      name: "exponential",
      base
    };
  } else if (interpolation[0] === "cubic-bezier") {
    var controlPoints = interpolation.slice(1);
    if (controlPoints.length !== 4 || controlPoints.some(function(t) {
      return typeof t !== "number" || t < 0 || t > 1;
    })) {
      return context2.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1);
    }
    interpolation = {
      name: "cubic-bezier",
      controlPoints
    };
  } else {
    return context2.error("Unknown interpolation type " + String(interpolation[0]), 1, 0);
  }
  if (args.length - 1 < 4) {
    return context2.error("Expected at least 4 arguments, but found only " + (args.length - 1) + ".");
  }
  if ((args.length - 1) % 2 !== 0) {
    return context2.error("Expected an even number of arguments.");
  }
  input2 = context2.parse(input2, 2, NumberType);
  if (!input2) {
    return null;
  }
  var stops = [];
  var outputType = null;
  if (operator === "interpolate-hcl" || operator === "interpolate-lab") {
    outputType = ColorType;
  } else if (context2.expectedType && context2.expectedType.kind !== "value") {
    outputType = context2.expectedType;
  }
  for (var i2 = 0; i2 < rest.length; i2 += 2) {
    var label = rest[i2];
    var value = rest[i2 + 1];
    var labelKey = i2 + 3;
    var valueKey = i2 + 4;
    if (typeof label !== "number") {
      return context2.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);
    }
    if (stops.length && stops[stops.length - 1][0] >= label) {
      return context2.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', labelKey);
    }
    var parsed = context2.parse(value, valueKey, outputType);
    if (!parsed) {
      return null;
    }
    outputType = outputType || parsed.type;
    stops.push([
      label,
      parsed
    ]);
  }
  if (outputType.kind !== "number" && outputType.kind !== "color" && !(outputType.kind === "array" && outputType.itemType.kind === "number" && typeof outputType.N === "number")) {
    return context2.error("Type " + toString$1(outputType) + " is not interpolatable.");
  }
  return new Interpolate(outputType, operator, interpolation, input2, stops);
};
Interpolate.prototype.evaluate = function evaluate11(ctx) {
  var labels = this.labels;
  var outputs = this.outputs;
  if (labels.length === 1) {
    return outputs[0].evaluate(ctx);
  }
  var value = this.input.evaluate(ctx);
  if (value <= labels[0]) {
    return outputs[0].evaluate(ctx);
  }
  var stopCount = labels.length;
  if (value >= labels[stopCount - 1]) {
    return outputs[stopCount - 1].evaluate(ctx);
  }
  var index = findStopLessThanOrEqualTo(labels, value);
  var lower = labels[index];
  var upper = labels[index + 1];
  var t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);
  var outputLower = outputs[index].evaluate(ctx);
  var outputUpper = outputs[index + 1].evaluate(ctx);
  if (this.operator === "interpolate") {
    return interpolate[this.type.kind.toLowerCase()](outputLower, outputUpper, t);
  } else if (this.operator === "interpolate-hcl") {
    return hcl.reverse(hcl.interpolate(hcl.forward(outputLower), hcl.forward(outputUpper), t));
  } else {
    return lab.reverse(lab.interpolate(lab.forward(outputLower), lab.forward(outputUpper), t));
  }
};
Interpolate.prototype.eachChild = function eachChild11(fn) {
  fn(this.input);
  for (var i2 = 0, list = this.outputs; i2 < list.length; i2 += 1) {
    var expression = list[i2];
    fn(expression);
  }
};
Interpolate.prototype.outputDefined = function outputDefined11() {
  return this.outputs.every(function(out) {
    return out.outputDefined();
  });
};
Interpolate.prototype.serialize = function serialize13() {
  var interpolation;
  if (this.interpolation.name === "linear") {
    interpolation = ["linear"];
  } else if (this.interpolation.name === "exponential") {
    if (this.interpolation.base === 1) {
      interpolation = ["linear"];
    } else {
      interpolation = [
        "exponential",
        this.interpolation.base
      ];
    }
  } else {
    interpolation = ["cubic-bezier"].concat(this.interpolation.controlPoints);
  }
  var serialized = [
    this.operator,
    interpolation,
    this.input.serialize()
  ];
  for (var i2 = 0; i2 < this.labels.length; i2++) {
    serialized.push(this.labels[i2], this.outputs[i2].serialize());
  }
  return serialized;
};
function exponentialInterpolation(input2, base, lowerValue, upperValue) {
  var difference = upperValue - lowerValue;
  var progress = input2 - lowerValue;
  if (difference === 0) {
    return 0;
  } else if (base === 1) {
    return progress / difference;
  } else {
    return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);
  }
}
var Coalesce = function Coalesce2(type, args) {
  this.type = type;
  this.args = args;
};
Coalesce.parse = function parse14(args, context2) {
  if (args.length < 2) {
    return context2.error("Expectected at least one argument.");
  }
  var outputType = null;
  var expectedType = context2.expectedType;
  if (expectedType && expectedType.kind !== "value") {
    outputType = expectedType;
  }
  var parsedArgs = [];
  for (var i2 = 0, list = args.slice(1); i2 < list.length; i2 += 1) {
    var arg = list[i2];
    var parsed = context2.parse(arg, 1 + parsedArgs.length, outputType, void 0, { typeAnnotation: "omit" });
    if (!parsed) {
      return null;
    }
    outputType = outputType || parsed.type;
    parsedArgs.push(parsed);
  }
  var needsAnnotation = expectedType && parsedArgs.some(function(arg2) {
    return checkSubtype(expectedType, arg2.type);
  });
  return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);
};
Coalesce.prototype.evaluate = function evaluate12(ctx) {
  var result = null;
  var argCount = 0;
  var firstImage;
  for (var i2 = 0, list = this.args; i2 < list.length; i2 += 1) {
    var arg = list[i2];
    argCount++;
    result = arg.evaluate(ctx);
    if (result && result instanceof ResolvedImage && !result.available) {
      if (!firstImage) {
        firstImage = result;
      }
      result = null;
      if (argCount === this.args.length) {
        return firstImage;
      }
    }
    if (result !== null) {
      break;
    }
  }
  return result;
};
Coalesce.prototype.eachChild = function eachChild12(fn) {
  this.args.forEach(fn);
};
Coalesce.prototype.outputDefined = function outputDefined12() {
  return this.args.every(function(arg) {
    return arg.outputDefined();
  });
};
Coalesce.prototype.serialize = function serialize14() {
  var serialized = ["coalesce"];
  this.eachChild(function(child) {
    serialized.push(child.serialize());
  });
  return serialized;
};
var Let = function Let2(bindings, result) {
  this.type = result.type;
  this.bindings = [].concat(bindings);
  this.result = result;
};
Let.prototype.evaluate = function evaluate13(ctx) {
  return this.result.evaluate(ctx);
};
Let.prototype.eachChild = function eachChild13(fn) {
  for (var i2 = 0, list = this.bindings; i2 < list.length; i2 += 1) {
    var binding = list[i2];
    fn(binding[1]);
  }
  fn(this.result);
};
Let.parse = function parse15(args, context2) {
  if (args.length < 4) {
    return context2.error("Expected at least 3 arguments, but found " + (args.length - 1) + " instead.");
  }
  var bindings = [];
  for (var i2 = 1; i2 < args.length - 1; i2 += 2) {
    var name = args[i2];
    if (typeof name !== "string") {
      return context2.error("Expected string, but found " + typeof name + " instead.", i2);
    }
    if (/[^a-zA-Z0-9_]/.test(name)) {
      return context2.error("Variable names must contain only alphanumeric characters or '_'.", i2);
    }
    var value = context2.parse(args[i2 + 1], i2 + 1);
    if (!value) {
      return null;
    }
    bindings.push([
      name,
      value
    ]);
  }
  var result = context2.parse(args[args.length - 1], args.length - 1, context2.expectedType, bindings);
  if (!result) {
    return null;
  }
  return new Let(bindings, result);
};
Let.prototype.outputDefined = function outputDefined13() {
  return this.result.outputDefined();
};
Let.prototype.serialize = function serialize15() {
  var serialized = ["let"];
  for (var i2 = 0, list = this.bindings; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var name = ref[0];
    var expr = ref[1];
    serialized.push(name, expr.serialize());
  }
  serialized.push(this.result.serialize());
  return serialized;
};
var At = function At2(type, index, input2) {
  this.type = type;
  this.index = index;
  this.input = input2;
};
At.parse = function parse16(args, context2) {
  if (args.length !== 3) {
    return context2.error("Expected 2 arguments, but found " + (args.length - 1) + " instead.");
  }
  var index = context2.parse(args[1], 1, NumberType);
  var input2 = context2.parse(args[2], 2, array$1(context2.expectedType || ValueType));
  if (!index || !input2) {
    return null;
  }
  var t = input2.type;
  return new At(t.itemType, index, input2);
};
At.prototype.evaluate = function evaluate14(ctx) {
  var index = this.index.evaluate(ctx);
  var array2 = this.input.evaluate(ctx);
  if (index < 0) {
    throw new RuntimeError2("Array index out of bounds: " + index + " < 0.");
  }
  if (index >= array2.length) {
    throw new RuntimeError2("Array index out of bounds: " + index + " > " + (array2.length - 1) + ".");
  }
  if (index !== Math.floor(index)) {
    throw new RuntimeError2("Array index must be an integer, but found " + index + " instead.");
  }
  return array2[index];
};
At.prototype.eachChild = function eachChild14(fn) {
  fn(this.index);
  fn(this.input);
};
At.prototype.outputDefined = function outputDefined14() {
  return false;
};
At.prototype.serialize = function serialize16() {
  return [
    "at",
    this.index.serialize(),
    this.input.serialize()
  ];
};
var In = function In2(needle, haystack) {
  this.type = BooleanType;
  this.needle = needle;
  this.haystack = haystack;
};
In.parse = function parse17(args, context2) {
  if (args.length !== 3) {
    return context2.error("Expected 2 arguments, but found " + (args.length - 1) + " instead.");
  }
  var needle = context2.parse(args[1], 1, ValueType);
  var haystack = context2.parse(args[2], 2, ValueType);
  if (!needle || !haystack) {
    return null;
  }
  if (!isValidType(needle.type, [
    BooleanType,
    StringType,
    NumberType,
    NullType,
    ValueType
  ])) {
    return context2.error("Expected first argument to be of type boolean, string, number or null, but found " + toString$1(needle.type) + " instead");
  }
  return new In(needle, haystack);
};
In.prototype.evaluate = function evaluate15(ctx) {
  var needle = this.needle.evaluate(ctx);
  var haystack = this.haystack.evaluate(ctx);
  if (haystack == null) {
    return false;
  }
  if (!isValidNativeType(needle, [
    "boolean",
    "string",
    "number",
    "null"
  ])) {
    throw new RuntimeError2("Expected first argument to be of type boolean, string, number or null, but found " + toString$1(typeOf(needle)) + " instead.");
  }
  if (!isValidNativeType(haystack, [
    "string",
    "array"
  ])) {
    throw new RuntimeError2("Expected second argument to be of type array or string, but found " + toString$1(typeOf(haystack)) + " instead.");
  }
  return haystack.indexOf(needle) >= 0;
};
In.prototype.eachChild = function eachChild15(fn) {
  fn(this.needle);
  fn(this.haystack);
};
In.prototype.outputDefined = function outputDefined15() {
  return true;
};
In.prototype.serialize = function serialize17() {
  return [
    "in",
    this.needle.serialize(),
    this.haystack.serialize()
  ];
};
var IndexOf = function IndexOf2(needle, haystack, fromIndex) {
  this.type = NumberType;
  this.needle = needle;
  this.haystack = haystack;
  this.fromIndex = fromIndex;
};
IndexOf.parse = function parse18(args, context2) {
  if (args.length <= 2 || args.length >= 5) {
    return context2.error("Expected 3 or 4 arguments, but found " + (args.length - 1) + " instead.");
  }
  var needle = context2.parse(args[1], 1, ValueType);
  var haystack = context2.parse(args[2], 2, ValueType);
  if (!needle || !haystack) {
    return null;
  }
  if (!isValidType(needle.type, [
    BooleanType,
    StringType,
    NumberType,
    NullType,
    ValueType
  ])) {
    return context2.error("Expected first argument to be of type boolean, string, number or null, but found " + toString$1(needle.type) + " instead");
  }
  if (args.length === 4) {
    var fromIndex = context2.parse(args[3], 3, NumberType);
    if (!fromIndex) {
      return null;
    }
    return new IndexOf(needle, haystack, fromIndex);
  } else {
    return new IndexOf(needle, haystack);
  }
};
IndexOf.prototype.evaluate = function evaluate16(ctx) {
  var needle = this.needle.evaluate(ctx);
  var haystack = this.haystack.evaluate(ctx);
  if (!isValidNativeType(needle, [
    "boolean",
    "string",
    "number",
    "null"
  ])) {
    throw new RuntimeError2("Expected first argument to be of type boolean, string, number or null, but found " + toString$1(typeOf(needle)) + " instead.");
  }
  if (!isValidNativeType(haystack, [
    "string",
    "array"
  ])) {
    throw new RuntimeError2("Expected second argument to be of type array or string, but found " + toString$1(typeOf(haystack)) + " instead.");
  }
  if (this.fromIndex) {
    var fromIndex = this.fromIndex.evaluate(ctx);
    return haystack.indexOf(needle, fromIndex);
  }
  return haystack.indexOf(needle);
};
IndexOf.prototype.eachChild = function eachChild16(fn) {
  fn(this.needle);
  fn(this.haystack);
  if (this.fromIndex) {
    fn(this.fromIndex);
  }
};
IndexOf.prototype.outputDefined = function outputDefined16() {
  return false;
};
IndexOf.prototype.serialize = function serialize18() {
  if (this.fromIndex != null && this.fromIndex !== void 0) {
    var fromIndex = this.fromIndex.serialize();
    return [
      "index-of",
      this.needle.serialize(),
      this.haystack.serialize(),
      fromIndex
    ];
  }
  return [
    "index-of",
    this.needle.serialize(),
    this.haystack.serialize()
  ];
};
var Match = function Match2(inputType, outputType, input2, cases, outputs, otherwise) {
  this.inputType = inputType;
  this.type = outputType;
  this.input = input2;
  this.cases = cases;
  this.outputs = outputs;
  this.otherwise = otherwise;
};
Match.parse = function parse19(args, context2) {
  if (args.length < 5) {
    return context2.error("Expected at least 4 arguments, but found only " + (args.length - 1) + ".");
  }
  if (args.length % 2 !== 1) {
    return context2.error("Expected an even number of arguments.");
  }
  var inputType;
  var outputType;
  if (context2.expectedType && context2.expectedType.kind !== "value") {
    outputType = context2.expectedType;
  }
  var cases = {};
  var outputs = [];
  for (var i2 = 2; i2 < args.length - 1; i2 += 2) {
    var labels = args[i2];
    var value = args[i2 + 1];
    if (!Array.isArray(labels)) {
      labels = [labels];
    }
    var labelContext = context2.concat(i2);
    if (labels.length === 0) {
      return labelContext.error("Expected at least one branch label.");
    }
    for (var i$1 = 0, list = labels; i$1 < list.length; i$1 += 1) {
      var label = list[i$1];
      if (typeof label !== "number" && typeof label !== "string") {
        return labelContext.error("Branch labels must be numbers or strings.");
      } else if (typeof label === "number" && Math.abs(label) > Number.MAX_SAFE_INTEGER) {
        return labelContext.error("Branch labels must be integers no larger than " + Number.MAX_SAFE_INTEGER + ".");
      } else if (typeof label === "number" && Math.floor(label) !== label) {
        return labelContext.error("Numeric branch labels must be integer values.");
      } else if (!inputType) {
        inputType = typeOf(label);
      } else if (labelContext.checkSubtype(inputType, typeOf(label))) {
        return null;
      }
      if (typeof cases[String(label)] !== "undefined") {
        return labelContext.error("Branch labels must be unique.");
      }
      cases[String(label)] = outputs.length;
    }
    var result = context2.parse(value, i2, outputType);
    if (!result) {
      return null;
    }
    outputType = outputType || result.type;
    outputs.push(result);
  }
  var input2 = context2.parse(args[1], 1, ValueType);
  if (!input2) {
    return null;
  }
  var otherwise = context2.parse(args[args.length - 1], args.length - 1, outputType);
  if (!otherwise) {
    return null;
  }
  if (input2.type.kind !== "value" && context2.concat(1).checkSubtype(inputType, input2.type)) {
    return null;
  }
  return new Match(inputType, outputType, input2, cases, outputs, otherwise);
};
Match.prototype.evaluate = function evaluate17(ctx) {
  var input2 = this.input.evaluate(ctx);
  var output = typeOf(input2) === this.inputType && this.outputs[this.cases[input2]] || this.otherwise;
  return output.evaluate(ctx);
};
Match.prototype.eachChild = function eachChild17(fn) {
  fn(this.input);
  this.outputs.forEach(fn);
  fn(this.otherwise);
};
Match.prototype.outputDefined = function outputDefined17() {
  return this.outputs.every(function(out) {
    return out.outputDefined();
  }) && this.otherwise.outputDefined();
};
Match.prototype.serialize = function serialize19() {
  var this$1$1 = this;
  var serialized = [
    "match",
    this.input.serialize()
  ];
  var sortedLabels = Object.keys(this.cases).sort();
  var groupedByOutput = [];
  var outputLookup = {};
  for (var i2 = 0, list = sortedLabels; i2 < list.length; i2 += 1) {
    var label = list[i2];
    var outputIndex = outputLookup[this.cases[label]];
    if (outputIndex === void 0) {
      outputLookup[this.cases[label]] = groupedByOutput.length;
      groupedByOutput.push([
        this.cases[label],
        [label]
      ]);
    } else {
      groupedByOutput[outputIndex][1].push(label);
    }
  }
  var coerceLabel = function(label2) {
    return this$1$1.inputType.kind === "number" ? Number(label2) : label2;
  };
  for (var i$1 = 0, list$1 = groupedByOutput; i$1 < list$1.length; i$1 += 1) {
    var ref = list$1[i$1];
    var outputIndex = ref[0];
    var labels = ref[1];
    if (labels.length === 1) {
      serialized.push(coerceLabel(labels[0]));
    } else {
      serialized.push(labels.map(coerceLabel));
    }
    serialized.push(this.outputs[outputIndex$1].serialize());
  }
  serialized.push(this.otherwise.serialize());
  return serialized;
};
var Case = function Case2(type, branches, otherwise) {
  this.type = type;
  this.branches = branches;
  this.otherwise = otherwise;
};
Case.parse = function parse20(args, context2) {
  if (args.length < 4) {
    return context2.error("Expected at least 3 arguments, but found only " + (args.length - 1) + ".");
  }
  if (args.length % 2 !== 0) {
    return context2.error("Expected an odd number of arguments.");
  }
  var outputType;
  if (context2.expectedType && context2.expectedType.kind !== "value") {
    outputType = context2.expectedType;
  }
  var branches = [];
  for (var i2 = 1; i2 < args.length - 1; i2 += 2) {
    var test = context2.parse(args[i2], i2, BooleanType);
    if (!test) {
      return null;
    }
    var result = context2.parse(args[i2 + 1], i2 + 1, outputType);
    if (!result) {
      return null;
    }
    branches.push([
      test,
      result
    ]);
    outputType = outputType || result.type;
  }
  var otherwise = context2.parse(args[args.length - 1], args.length - 1, outputType);
  if (!otherwise) {
    return null;
  }
  return new Case(outputType, branches, otherwise);
};
Case.prototype.evaluate = function evaluate18(ctx) {
  for (var i2 = 0, list = this.branches; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var test = ref[0];
    var expression = ref[1];
    if (test.evaluate(ctx)) {
      return expression.evaluate(ctx);
    }
  }
  return this.otherwise.evaluate(ctx);
};
Case.prototype.eachChild = function eachChild18(fn) {
  for (var i2 = 0, list = this.branches; i2 < list.length; i2 += 1) {
    var ref = list[i2];
    var test = ref[0];
    var expression = ref[1];
    fn(test);
    fn(expression);
  }
  fn(this.otherwise);
};
Case.prototype.outputDefined = function outputDefined18() {
  return this.branches.every(function(ref) {
    ref[0];
    var out = ref[1];
    return out.outputDefined();
  }) && this.otherwise.outputDefined();
};
Case.prototype.serialize = function serialize20() {
  var serialized = ["case"];
  this.eachChild(function(child) {
    serialized.push(child.serialize());
  });
  return serialized;
};
var Slice = function Slice2(type, input2, beginIndex, endIndex) {
  this.type = type;
  this.input = input2;
  this.beginIndex = beginIndex;
  this.endIndex = endIndex;
};
Slice.parse = function parse21(args, context2) {
  if (args.length <= 2 || args.length >= 5) {
    return context2.error("Expected 3 or 4 arguments, but found " + (args.length - 1) + " instead.");
  }
  var input2 = context2.parse(args[1], 1, ValueType);
  var beginIndex = context2.parse(args[2], 2, NumberType);
  if (!input2 || !beginIndex) {
    return null;
  }
  if (!isValidType(input2.type, [
    array$1(ValueType),
    StringType,
    ValueType
  ])) {
    return context2.error("Expected first argument to be of type array or string, but found " + toString$1(input2.type) + " instead");
  }
  if (args.length === 4) {
    var endIndex = context2.parse(args[3], 3, NumberType);
    if (!endIndex) {
      return null;
    }
    return new Slice(input2.type, input2, beginIndex, endIndex);
  } else {
    return new Slice(input2.type, input2, beginIndex);
  }
};
Slice.prototype.evaluate = function evaluate19(ctx) {
  var input2 = this.input.evaluate(ctx);
  var beginIndex = this.beginIndex.evaluate(ctx);
  if (!isValidNativeType(input2, [
    "string",
    "array"
  ])) {
    throw new RuntimeError2("Expected first argument to be of type array or string, but found " + toString$1(typeOf(input2)) + " instead.");
  }
  if (this.endIndex) {
    var endIndex = this.endIndex.evaluate(ctx);
    return input2.slice(beginIndex, endIndex);
  }
  return input2.slice(beginIndex);
};
Slice.prototype.eachChild = function eachChild19(fn) {
  fn(this.input);
  fn(this.beginIndex);
  if (this.endIndex) {
    fn(this.endIndex);
  }
};
Slice.prototype.outputDefined = function outputDefined19() {
  return false;
};
Slice.prototype.serialize = function serialize21() {
  if (this.endIndex != null && this.endIndex !== void 0) {
    var endIndex = this.endIndex.serialize();
    return [
      "slice",
      this.input.serialize(),
      this.beginIndex.serialize(),
      endIndex
    ];
  }
  return [
    "slice",
    this.input.serialize(),
    this.beginIndex.serialize()
  ];
};
function isComparableType(op, type) {
  if (op === "==" || op === "!=") {
    return type.kind === "boolean" || type.kind === "string" || type.kind === "number" || type.kind === "null" || type.kind === "value";
  } else {
    return type.kind === "string" || type.kind === "number" || type.kind === "value";
  }
}
function eq(ctx, a, b) {
  return a === b;
}
function neq(ctx, a, b) {
  return a !== b;
}
function lt(ctx, a, b) {
  return a < b;
}
function gt(ctx, a, b) {
  return a > b;
}
function lteq(ctx, a, b) {
  return a <= b;
}
function gteq(ctx, a, b) {
  return a >= b;
}
function eqCollate(ctx, a, b, c) {
  return c.compare(a, b) === 0;
}
function neqCollate(ctx, a, b, c) {
  return !eqCollate(ctx, a, b, c);
}
function ltCollate(ctx, a, b, c) {
  return c.compare(a, b) < 0;
}
function gtCollate(ctx, a, b, c) {
  return c.compare(a, b) > 0;
}
function lteqCollate(ctx, a, b, c) {
  return c.compare(a, b) <= 0;
}
function gteqCollate(ctx, a, b, c) {
  return c.compare(a, b) >= 0;
}
function makeComparison(op, compareBasic, compareWithCollator) {
  var isOrderComparison = op !== "==" && op !== "!=";
  return /* @__PURE__ */ function() {
    function Comparison(lhs, rhs, collator) {
      this.type = BooleanType;
      this.lhs = lhs;
      this.rhs = rhs;
      this.collator = collator;
      this.hasUntypedArgument = lhs.type.kind === "value" || rhs.type.kind === "value";
    }
    Comparison.parse = function parse25(args, context2) {
      if (args.length !== 3 && args.length !== 4) {
        return context2.error("Expected two or three arguments.");
      }
      var op2 = args[0];
      var lhs = context2.parse(args[1], 1, ValueType);
      if (!lhs) {
        return null;
      }
      if (!isComparableType(op2, lhs.type)) {
        return context2.concat(1).error('"' + op2 + `" comparisons are not supported for type '` + toString$1(lhs.type) + "'.");
      }
      var rhs = context2.parse(args[2], 2, ValueType);
      if (!rhs) {
        return null;
      }
      if (!isComparableType(op2, rhs.type)) {
        return context2.concat(2).error('"' + op2 + `" comparisons are not supported for type '` + toString$1(rhs.type) + "'.");
      }
      if (lhs.type.kind !== rhs.type.kind && lhs.type.kind !== "value" && rhs.type.kind !== "value") {
        return context2.error("Cannot compare types '" + toString$1(lhs.type) + "' and '" + toString$1(rhs.type) + "'.");
      }
      if (isOrderComparison) {
        if (lhs.type.kind === "value" && rhs.type.kind !== "value") {
          lhs = new Assertion(rhs.type, [lhs]);
        } else if (lhs.type.kind !== "value" && rhs.type.kind === "value") {
          rhs = new Assertion(lhs.type, [rhs]);
        }
      }
      var collator = null;
      if (args.length === 4) {
        if (lhs.type.kind !== "string" && rhs.type.kind !== "string" && lhs.type.kind !== "value" && rhs.type.kind !== "value") {
          return context2.error("Cannot use collator to compare non-string types.");
        }
        collator = context2.parse(args[3], 3, CollatorType);
        if (!collator) {
          return null;
        }
      }
      return new Comparison(lhs, rhs, collator);
    };
    Comparison.prototype.evaluate = function evaluate25(ctx) {
      var lhs = this.lhs.evaluate(ctx);
      var rhs = this.rhs.evaluate(ctx);
      if (isOrderComparison && this.hasUntypedArgument) {
        var lt2 = typeOf(lhs);
        var rt = typeOf(rhs);
        if (lt2.kind !== rt.kind || !(lt2.kind === "string" || lt2.kind === "number")) {
          throw new RuntimeError2('Expected arguments for "' + op + '" to be (string, string) or (number, number), but found (' + lt2.kind + ", " + rt.kind + ") instead.");
        }
      }
      if (this.collator && !isOrderComparison && this.hasUntypedArgument) {
        var lt$1 = typeOf(lhs);
        var rt$1 = typeOf(rhs);
        if (lt$1.kind !== "string" || rt$1.kind !== "string") {
          return compareBasic(ctx, lhs, rhs);
        }
      }
      return this.collator ? compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) : compareBasic(ctx, lhs, rhs);
    };
    Comparison.prototype.eachChild = function eachChild22(fn) {
      fn(this.lhs);
      fn(this.rhs);
      if (this.collator) {
        fn(this.collator);
      }
    };
    Comparison.prototype.outputDefined = function outputDefined22() {
      return true;
    };
    Comparison.prototype.serialize = function serialize24() {
      var serialized = [op];
      this.eachChild(function(child) {
        serialized.push(child.serialize());
      });
      return serialized;
    };
    return Comparison;
  }();
}
var Equals = makeComparison("==", eq, eqCollate);
var NotEquals = makeComparison("!=", neq, neqCollate);
var LessThan = makeComparison("<", lt, ltCollate);
var GreaterThan = makeComparison(">", gt, gtCollate);
var LessThanOrEqual = makeComparison("<=", lteq, lteqCollate);
var GreaterThanOrEqual = makeComparison(">=", gteq, gteqCollate);
var NumberFormat = function NumberFormat2(number2, locale, currency, minFractionDigits, maxFractionDigits) {
  this.type = StringType;
  this.number = number2;
  this.locale = locale;
  this.currency = currency;
  this.minFractionDigits = minFractionDigits;
  this.maxFractionDigits = maxFractionDigits;
};
NumberFormat.parse = function parse22(args, context2) {
  if (args.length !== 3) {
    return context2.error("Expected two arguments.");
  }
  var number2 = context2.parse(args[1], 1, NumberType);
  if (!number2) {
    return null;
  }
  var options = args[2];
  if (typeof options !== "object" || Array.isArray(options)) {
    return context2.error("NumberFormat options argument must be an object.");
  }
  var locale = null;
  if (options["locale"]) {
    locale = context2.parse(options["locale"], 1, StringType);
    if (!locale) {
      return null;
    }
  }
  var currency = null;
  if (options["currency"]) {
    currency = context2.parse(options["currency"], 1, StringType);
    if (!currency) {
      return null;
    }
  }
  var minFractionDigits = null;
  if (options["min-fraction-digits"]) {
    minFractionDigits = context2.parse(options["min-fraction-digits"], 1, NumberType);
    if (!minFractionDigits) {
      return null;
    }
  }
  var maxFractionDigits = null;
  if (options["max-fraction-digits"]) {
    maxFractionDigits = context2.parse(options["max-fraction-digits"], 1, NumberType);
    if (!maxFractionDigits) {
      return null;
    }
  }
  return new NumberFormat(number2, locale, currency, minFractionDigits, maxFractionDigits);
};
NumberFormat.prototype.evaluate = function evaluate20(ctx) {
  return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {
    style: this.currency ? "currency" : "decimal",
    currency: this.currency ? this.currency.evaluate(ctx) : void 0,
    minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : void 0,
    maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : void 0
  }).format(this.number.evaluate(ctx));
};
NumberFormat.prototype.eachChild = function eachChild20(fn) {
  fn(this.number);
  if (this.locale) {
    fn(this.locale);
  }
  if (this.currency) {
    fn(this.currency);
  }
  if (this.minFractionDigits) {
    fn(this.minFractionDigits);
  }
  if (this.maxFractionDigits) {
    fn(this.maxFractionDigits);
  }
};
NumberFormat.prototype.outputDefined = function outputDefined20() {
  return false;
};
NumberFormat.prototype.serialize = function serialize22() {
  var options = {};
  if (this.locale) {
    options["locale"] = this.locale.serialize();
  }
  if (this.currency) {
    options["currency"] = this.currency.serialize();
  }
  if (this.minFractionDigits) {
    options["min-fraction-digits"] = this.minFractionDigits.serialize();
  }
  if (this.maxFractionDigits) {
    options["max-fraction-digits"] = this.maxFractionDigits.serialize();
  }
  return [
    "number-format",
    this.number.serialize(),
    options
  ];
};
var Length = function Length2(input2) {
  this.type = NumberType;
  this.input = input2;
};
Length.parse = function parse23(args, context2) {
  if (args.length !== 2) {
    return context2.error("Expected 1 argument, but found " + (args.length - 1) + " instead.");
  }
  var input2 = context2.parse(args[1], 1);
  if (!input2) {
    return null;
  }
  if (input2.type.kind !== "array" && input2.type.kind !== "string" && input2.type.kind !== "value") {
    return context2.error("Expected argument of type string or array, but found " + toString$1(input2.type) + " instead.");
  }
  return new Length(input2);
};
Length.prototype.evaluate = function evaluate21(ctx) {
  var input2 = this.input.evaluate(ctx);
  if (typeof input2 === "string") {
    return input2.length;
  } else if (Array.isArray(input2)) {
    return input2.length;
  } else {
    throw new RuntimeError2("Expected value to be of type string or array, but found " + toString$1(typeOf(input2)) + " instead.");
  }
};
Length.prototype.eachChild = function eachChild21(fn) {
  fn(this.input);
};
Length.prototype.outputDefined = function outputDefined21() {
  return false;
};
Length.prototype.serialize = function serialize23() {
  var serialized = ["length"];
  this.eachChild(function(child) {
    serialized.push(child.serialize());
  });
  return serialized;
};
var expressions = {
  // special forms
  "==": Equals,
  "!=": NotEquals,
  ">": GreaterThan,
  "<": LessThan,
  ">=": GreaterThanOrEqual,
  "<=": LessThanOrEqual,
  "array": Assertion,
  "at": At,
  "boolean": Assertion,
  "case": Case,
  "coalesce": Coalesce,
  "collator": CollatorExpression,
  "format": FormatExpression,
  "image": ImageExpression,
  "in": In,
  "index-of": IndexOf,
  "interpolate": Interpolate,
  "interpolate-hcl": Interpolate,
  "interpolate-lab": Interpolate,
  "length": Length,
  "let": Let,
  "literal": Literal,
  "match": Match,
  "number": Assertion,
  "number-format": NumberFormat,
  "object": Assertion,
  "slice": Slice,
  "step": Step,
  "string": Assertion,
  "to-boolean": Coercion,
  "to-color": Coercion,
  "to-number": Coercion,
  "to-string": Coercion,
  "var": Var,
  "within": Within
};
function rgba(ctx, ref) {
  var r = ref[0];
  var g = ref[1];
  var b = ref[2];
  var a = ref[3];
  r = r.evaluate(ctx);
  g = g.evaluate(ctx);
  b = b.evaluate(ctx);
  var alpha = a ? a.evaluate(ctx) : 1;
  var error3 = validateRGBA(r, g, b, alpha);
  if (error3) {
    throw new RuntimeError2(error3);
  }
  return new Color(r / 255 * alpha, g / 255 * alpha, b / 255 * alpha, alpha);
}
function has2(key, obj) {
  return key in obj;
}
function get6(key, obj) {
  var v = obj[key];
  return typeof v === "undefined" ? null : v;
}
function binarySearch2(v, a, i2, j) {
  while (i2 <= j) {
    var m = i2 + j >> 1;
    if (a[m] === v) {
      return true;
    }
    if (a[m] > v) {
      j = m - 1;
    } else {
      i2 = m + 1;
    }
  }
  return false;
}
function varargs(type) {
  return { type };
}
CompoundExpression.register(expressions, {
  "error": [
    ErrorType,
    [StringType],
    function(ctx, ref) {
      var v = ref[0];
      throw new RuntimeError2(v.evaluate(ctx));
    }
  ],
  "typeof": [
    StringType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      return toString$1(typeOf(v.evaluate(ctx)));
    }
  ],
  "to-rgba": [
    array$1(NumberType, 4),
    [ColorType],
    function(ctx, ref) {
      var v = ref[0];
      return v.evaluate(ctx).toArray();
    }
  ],
  "rgb": [
    ColorType,
    [
      NumberType,
      NumberType,
      NumberType
    ],
    rgba
  ],
  "rgba": [
    ColorType,
    [
      NumberType,
      NumberType,
      NumberType,
      NumberType
    ],
    rgba
  ],
  "has": {
    type: BooleanType,
    overloads: [
      [
        [StringType],
        function(ctx, ref) {
          var key = ref[0];
          return has2(key.evaluate(ctx), ctx.properties());
        }
      ],
      [
        [
          StringType,
          ObjectType
        ],
        function(ctx, ref) {
          var key = ref[0];
          var obj = ref[1];
          return has2(key.evaluate(ctx), obj.evaluate(ctx));
        }
      ]
    ]
  },
  "get": {
    type: ValueType,
    overloads: [
      [
        [StringType],
        function(ctx, ref) {
          var key = ref[0];
          return get6(key.evaluate(ctx), ctx.properties());
        }
      ],
      [
        [
          StringType,
          ObjectType
        ],
        function(ctx, ref) {
          var key = ref[0];
          var obj = ref[1];
          return get6(key.evaluate(ctx), obj.evaluate(ctx));
        }
      ]
    ]
  },
  "feature-state": [
    ValueType,
    [StringType],
    function(ctx, ref) {
      var key = ref[0];
      return get6(key.evaluate(ctx), ctx.featureState || {});
    }
  ],
  "properties": [
    ObjectType,
    [],
    function(ctx) {
      return ctx.properties();
    }
  ],
  "geometry-type": [
    StringType,
    [],
    function(ctx) {
      return ctx.geometryType();
    }
  ],
  "id": [
    ValueType,
    [],
    function(ctx) {
      return ctx.id();
    }
  ],
  "zoom": [
    NumberType,
    [],
    function(ctx) {
      return ctx.globals.zoom;
    }
  ],
  "pitch": [
    NumberType,
    [],
    function(ctx) {
      return ctx.globals.pitch || 0;
    }
  ],
  "distance-from-center": [
    NumberType,
    [],
    function(ctx) {
      return ctx.distanceFromCenter();
    }
  ],
  "heatmap-density": [
    NumberType,
    [],
    function(ctx) {
      return ctx.globals.heatmapDensity || 0;
    }
  ],
  "line-progress": [
    NumberType,
    [],
    function(ctx) {
      return ctx.globals.lineProgress || 0;
    }
  ],
  "sky-radial-progress": [
    NumberType,
    [],
    function(ctx) {
      return ctx.globals.skyRadialProgress || 0;
    }
  ],
  "accumulated": [
    ValueType,
    [],
    function(ctx) {
      return ctx.globals.accumulated === void 0 ? null : ctx.globals.accumulated;
    }
  ],
  "+": [
    NumberType,
    varargs(NumberType),
    function(ctx, args) {
      var result = 0;
      for (var i2 = 0, list = args; i2 < list.length; i2 += 1) {
        var arg = list[i2];
        result += arg.evaluate(ctx);
      }
      return result;
    }
  ],
  "*": [
    NumberType,
    varargs(NumberType),
    function(ctx, args) {
      var result = 1;
      for (var i2 = 0, list = args; i2 < list.length; i2 += 1) {
        var arg = list[i2];
        result *= arg.evaluate(ctx);
      }
      return result;
    }
  ],
  "-": {
    type: NumberType,
    overloads: [
      [
        [
          NumberType,
          NumberType
        ],
        function(ctx, ref) {
          var a = ref[0];
          var b = ref[1];
          return a.evaluate(ctx) - b.evaluate(ctx);
        }
      ],
      [
        [NumberType],
        function(ctx, ref) {
          var a = ref[0];
          return -a.evaluate(ctx);
        }
      ]
    ]
  },
  "/": [
    NumberType,
    [
      NumberType,
      NumberType
    ],
    function(ctx, ref) {
      var a = ref[0];
      var b = ref[1];
      return a.evaluate(ctx) / b.evaluate(ctx);
    }
  ],
  "%": [
    NumberType,
    [
      NumberType,
      NumberType
    ],
    function(ctx, ref) {
      var a = ref[0];
      var b = ref[1];
      return a.evaluate(ctx) % b.evaluate(ctx);
    }
  ],
  "ln2": [
    NumberType,
    [],
    function() {
      return Math.LN2;
    }
  ],
  "pi": [
    NumberType,
    [],
    function() {
      return Math.PI;
    }
  ],
  "e": [
    NumberType,
    [],
    function() {
      return Math.E;
    }
  ],
  "^": [
    NumberType,
    [
      NumberType,
      NumberType
    ],
    function(ctx, ref) {
      var b = ref[0];
      var e = ref[1];
      return Math.pow(b.evaluate(ctx), e.evaluate(ctx));
    }
  ],
  "sqrt": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var x = ref[0];
      return Math.sqrt(x.evaluate(ctx));
    }
  ],
  "log10": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.log(n.evaluate(ctx)) / Math.LN10;
    }
  ],
  "ln": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.log(n.evaluate(ctx));
    }
  ],
  "log2": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.log(n.evaluate(ctx)) / Math.LN2;
    }
  ],
  "sin": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.sin(n.evaluate(ctx));
    }
  ],
  "cos": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.cos(n.evaluate(ctx));
    }
  ],
  "tan": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.tan(n.evaluate(ctx));
    }
  ],
  "asin": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.asin(n.evaluate(ctx));
    }
  ],
  "acos": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.acos(n.evaluate(ctx));
    }
  ],
  "atan": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.atan(n.evaluate(ctx));
    }
  ],
  "min": [
    NumberType,
    varargs(NumberType),
    function(ctx, args) {
      return Math.min.apply(Math, args.map(function(arg) {
        return arg.evaluate(ctx);
      }));
    }
  ],
  "max": [
    NumberType,
    varargs(NumberType),
    function(ctx, args) {
      return Math.max.apply(Math, args.map(function(arg) {
        return arg.evaluate(ctx);
      }));
    }
  ],
  "abs": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.abs(n.evaluate(ctx));
    }
  ],
  "round": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      var v = n.evaluate(ctx);
      return v < 0 ? -Math.round(-v) : Math.round(v);
    }
  ],
  "floor": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.floor(n.evaluate(ctx));
    }
  ],
  "ceil": [
    NumberType,
    [NumberType],
    function(ctx, ref) {
      var n = ref[0];
      return Math.ceil(n.evaluate(ctx));
    }
  ],
  "filter-==": [
    BooleanType,
    [
      StringType,
      ValueType
    ],
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      return ctx.properties()[k.value] === v.value;
    }
  ],
  "filter-id-==": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      return ctx.id() === v.value;
    }
  ],
  "filter-type-==": [
    BooleanType,
    [StringType],
    function(ctx, ref) {
      var v = ref[0];
      return ctx.geometryType() === v.value;
    }
  ],
  "filter-<": [
    BooleanType,
    [
      StringType,
      ValueType
    ],
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      var a = ctx.properties()[k.value];
      var b = v.value;
      return typeof a === typeof b && a < b;
    }
  ],
  "filter-id-<": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      var a = ctx.id();
      var b = v.value;
      return typeof a === typeof b && a < b;
    }
  ],
  "filter->": [
    BooleanType,
    [
      StringType,
      ValueType
    ],
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      var a = ctx.properties()[k.value];
      var b = v.value;
      return typeof a === typeof b && a > b;
    }
  ],
  "filter-id->": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      var a = ctx.id();
      var b = v.value;
      return typeof a === typeof b && a > b;
    }
  ],
  "filter-<=": [
    BooleanType,
    [
      StringType,
      ValueType
    ],
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      var a = ctx.properties()[k.value];
      var b = v.value;
      return typeof a === typeof b && a <= b;
    }
  ],
  "filter-id-<=": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      var a = ctx.id();
      var b = v.value;
      return typeof a === typeof b && a <= b;
    }
  ],
  "filter->=": [
    BooleanType,
    [
      StringType,
      ValueType
    ],
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      var a = ctx.properties()[k.value];
      var b = v.value;
      return typeof a === typeof b && a >= b;
    }
  ],
  "filter-id->=": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var v = ref[0];
      var a = ctx.id();
      var b = v.value;
      return typeof a === typeof b && a >= b;
    }
  ],
  "filter-has": [
    BooleanType,
    [ValueType],
    function(ctx, ref) {
      var k = ref[0];
      return k.value in ctx.properties();
    }
  ],
  "filter-has-id": [
    BooleanType,
    [],
    function(ctx) {
      return ctx.id() !== null && ctx.id() !== void 0;
    }
  ],
  "filter-type-in": [
    BooleanType,
    [array$1(StringType)],
    function(ctx, ref) {
      var v = ref[0];
      return v.value.indexOf(ctx.geometryType()) >= 0;
    }
  ],
  "filter-id-in": [
    BooleanType,
    [array$1(ValueType)],
    function(ctx, ref) {
      var v = ref[0];
      return v.value.indexOf(ctx.id()) >= 0;
    }
  ],
  "filter-in-small": [
    BooleanType,
    [
      StringType,
      array$1(ValueType)
    ],
    // assumes v is an array literal
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      return v.value.indexOf(ctx.properties()[k.value]) >= 0;
    }
  ],
  "filter-in-large": [
    BooleanType,
    [
      StringType,
      array$1(ValueType)
    ],
    // assumes v is a array literal with values sorted in ascending order and of a single type
    function(ctx, ref) {
      var k = ref[0];
      var v = ref[1];
      return binarySearch2(ctx.properties()[k.value], v.value, 0, v.value.length - 1);
    }
  ],
  "all": {
    type: BooleanType,
    overloads: [
      [
        [
          BooleanType,
          BooleanType
        ],
        function(ctx, ref) {
          var a = ref[0];
          var b = ref[1];
          return a.evaluate(ctx) && b.evaluate(ctx);
        }
      ],
      [
        varargs(BooleanType),
        function(ctx, args) {
          for (var i2 = 0, list = args; i2 < list.length; i2 += 1) {
            var arg = list[i2];
            if (!arg.evaluate(ctx)) {
              return false;
            }
          }
          return true;
        }
      ]
    ]
  },
  "any": {
    type: BooleanType,
    overloads: [
      [
        [
          BooleanType,
          BooleanType
        ],
        function(ctx, ref) {
          var a = ref[0];
          var b = ref[1];
          return a.evaluate(ctx) || b.evaluate(ctx);
        }
      ],
      [
        varargs(BooleanType),
        function(ctx, args) {
          for (var i2 = 0, list = args; i2 < list.length; i2 += 1) {
            var arg = list[i2];
            if (arg.evaluate(ctx)) {
              return true;
            }
          }
          return false;
        }
      ]
    ]
  },
  "!": [
    BooleanType,
    [BooleanType],
    function(ctx, ref) {
      var b = ref[0];
      return !b.evaluate(ctx);
    }
  ],
  "is-supported-script": [
    BooleanType,
    [StringType],
    // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant
    function(ctx, ref) {
      var s = ref[0];
      var isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;
      if (isSupportedScript) {
        return isSupportedScript(s.evaluate(ctx));
      }
      return true;
    }
  ],
  "upcase": [
    StringType,
    [StringType],
    function(ctx, ref) {
      var s = ref[0];
      return s.evaluate(ctx).toUpperCase();
    }
  ],
  "downcase": [
    StringType,
    [StringType],
    function(ctx, ref) {
      var s = ref[0];
      return s.evaluate(ctx).toLowerCase();
    }
  ],
  "concat": [
    StringType,
    varargs(ValueType),
    function(ctx, args) {
      return args.map(function(arg) {
        return toString6(arg.evaluate(ctx));
      }).join("");
    }
  ],
  "resolved-locale": [
    StringType,
    [CollatorType],
    function(ctx, ref) {
      var collator = ref[0];
      return collator.evaluate(ctx).resolvedLocale();
    }
  ]
});
function success(value) {
  return {
    result: "success",
    value
  };
}
function error2(value) {
  return {
    result: "error",
    value
  };
}
function supportsPropertyExpression(spec2) {
  return spec2["property-type"] === "data-driven" || spec2["property-type"] === "cross-faded-data-driven";
}
function supportsZoomExpression(spec2) {
  return !!spec2.expression && spec2.expression.parameters.indexOf("zoom") > -1;
}
function supportsInterpolation(spec2) {
  return !!spec2.expression && spec2.expression.interpolated;
}
function isFunction2(value) {
  return typeof value === "object" && value !== null && !Array.isArray(value);
}
var StyleExpression = function StyleExpression2(expression, propertySpec) {
  this.expression = expression;
  this._warningHistory = {};
  this._evaluator = new EvaluationContext();
  this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;
  this._enumValues = propertySpec && propertySpec.type === "enum" ? propertySpec.values : null;
};
StyleExpression.prototype.evaluateWithoutErrorHandling = function evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
  this._evaluator.globals = globals;
  this._evaluator.feature = feature;
  this._evaluator.featureState = featureState;
  this._evaluator.canonical = canonical || null;
  this._evaluator.availableImages = availableImages || null;
  this._evaluator.formattedSection = formattedSection;
  this._evaluator.featureTileCoord = featureTileCoord || null;
  this._evaluator.featureDistanceData = featureDistanceData || null;
  return this.expression.evaluate(this._evaluator);
};
StyleExpression.prototype.evaluate = function evaluate22(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
  this._evaluator.globals = globals;
  this._evaluator.feature = feature || null;
  this._evaluator.featureState = featureState || null;
  this._evaluator.canonical = canonical || null;
  this._evaluator.availableImages = availableImages || null;
  this._evaluator.formattedSection = formattedSection || null;
  this._evaluator.featureTileCoord = featureTileCoord || null;
  this._evaluator.featureDistanceData = featureDistanceData || null;
  try {
    var val = this.expression.evaluate(this._evaluator);
    if (val === null || val === void 0 || typeof val === "number" && val !== val) {
      return this._defaultValue;
    }
    if (this._enumValues && !(val in this._enumValues)) {
      throw new RuntimeError2("Expected value to be one of " + Object.keys(this._enumValues).map(function(v) {
        return JSON.stringify(v);
      }).join(", ") + ", but found " + JSON.stringify(val) + " instead.");
    }
    return val;
  } catch (e) {
    if (!this._warningHistory[e.message]) {
      this._warningHistory[e.message] = true;
      if (typeof console !== "undefined") {
        console.warn(e.message);
      }
    }
    return this._defaultValue;
  }
};
function isExpression(expression) {
  return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === "string" && expression[0] in expressions;
}
function createExpression(expression, propertySpec) {
  var parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0);
  var parsed = parser.parse(expression, void 0, void 0, void 0, propertySpec && propertySpec.type === "string" ? { typeAnnotation: "coerce" } : void 0);
  if (!parsed) {
    return error2(parser.errors);
  }
  return success(new StyleExpression(parsed, propertySpec));
}
var ZoomConstantExpression = function ZoomConstantExpression2(kind, expression) {
  this.kind = kind;
  this._styleExpression = expression;
  this.isStateDependent = kind !== "constant" && !isStateConstant(expression.expression);
};
ZoomConstantExpression.prototype.evaluateWithoutErrorHandling = function evaluateWithoutErrorHandling2(globals, feature, featureState, canonical, availableImages, formattedSection) {
  return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);
};
ZoomConstantExpression.prototype.evaluate = function evaluate23(globals, feature, featureState, canonical, availableImages, formattedSection) {
  return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);
};
var ZoomDependentExpression = function ZoomDependentExpression2(kind, expression, zoomStops, interpolationType) {
  this.kind = kind;
  this.zoomStops = zoomStops;
  this._styleExpression = expression;
  this.isStateDependent = kind !== "camera" && !isStateConstant(expression.expression);
  this.interpolationType = interpolationType;
};
ZoomDependentExpression.prototype.evaluateWithoutErrorHandling = function evaluateWithoutErrorHandling3(globals, feature, featureState, canonical, availableImages, formattedSection) {
  return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);
};
ZoomDependentExpression.prototype.evaluate = function evaluate24(globals, feature, featureState, canonical, availableImages, formattedSection) {
  return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);
};
ZoomDependentExpression.prototype.interpolationFactor = function interpolationFactor2(input2, lower, upper) {
  if (this.interpolationType) {
    return Interpolate.interpolationFactor(this.interpolationType, input2, lower, upper);
  } else {
    return 0;
  }
};
function createPropertyExpression(expression, propertySpec) {
  expression = createExpression(expression, propertySpec);
  if (expression.result === "error") {
    return expression;
  }
  var parsed = expression.value.expression;
  var isFeatureConstant$1 = isFeatureConstant(parsed);
  if (!isFeatureConstant$1 && !supportsPropertyExpression(propertySpec)) {
    return error2([new ParsingError("", "data expressions not supported")]);
  }
  var isZoomConstant = isGlobalPropertyConstant(parsed, [
    "zoom",
    "pitch",
    "distance-from-center"
  ]);
  if (!isZoomConstant && !supportsZoomExpression(propertySpec)) {
    return error2([new ParsingError("", "zoom expressions not supported")]);
  }
  var zoomCurve = findZoomCurve(parsed);
  if (!zoomCurve && !isZoomConstant) {
    return error2([new ParsingError("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
  } else if (zoomCurve instanceof ParsingError) {
    return error2([zoomCurve]);
  } else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {
    return error2([new ParsingError("", '"interpolate" expressions cannot be used with this property')]);
  }
  if (!zoomCurve) {
    return success(isFeatureConstant$1 ? new ZoomConstantExpression("constant", expression.value) : new ZoomConstantExpression("source", expression.value));
  }
  var interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
  return success(isFeatureConstant$1 ? new ZoomDependentExpression("camera", expression.value, zoomCurve.labels, interpolationType) : new ZoomDependentExpression("composite", expression.value, zoomCurve.labels, interpolationType));
}
function findZoomCurve(expression) {
  var result = null;
  if (expression instanceof Let) {
    result = findZoomCurve(expression.result);
  } else if (expression instanceof Coalesce) {
    for (var i2 = 0, list = expression.args; i2 < list.length; i2 += 1) {
      var arg = list[i2];
      result = findZoomCurve(arg);
      if (result) {
        break;
      }
    }
  } else if ((expression instanceof Step || expression instanceof Interpolate) && expression.input instanceof CompoundExpression && expression.input.name === "zoom") {
    result = expression;
  }
  if (result instanceof ParsingError) {
    return result;
  }
  expression.eachChild(function(child) {
    var childResult = findZoomCurve(child);
    if (childResult instanceof ParsingError) {
      result = childResult;
    } else if (!result && childResult) {
      result = new ParsingError("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.');
    } else if (result && childResult && result !== childResult) {
      result = new ParsingError("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.');
    }
  });
  return result;
}
function getExpectedType(spec2) {
  var types2 = {
    color: ColorType,
    string: StringType,
    number: NumberType,
    enum: StringType,
    boolean: BooleanType,
    formatted: FormattedType,
    resolvedImage: ResolvedImageType
  };
  if (spec2.type === "array") {
    return array$1(types2[spec2.value] || ValueType, spec2.length);
  }
  return types2[spec2.type];
}
function getDefaultValue(spec2) {
  if (spec2.type === "color" && (isFunction2(spec2.default) || Array.isArray(spec2.default))) {
    return new Color(0, 0, 0, 0);
  } else if (spec2.type === "color") {
    return Color.parse(spec2.default) || null;
  } else if (spec2.default === void 0) {
    return null;
  } else {
    return spec2.default;
  }
}
function unbundle(value) {
  if (value instanceof Number || value instanceof String || value instanceof Boolean) {
    return value.valueOf();
  } else {
    return value;
  }
}
function deepUnbundle(value) {
  if (Array.isArray(value)) {
    return value.map(deepUnbundle);
  } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {
    var unbundledValue = {};
    for (var key in value) {
      unbundledValue[key] = deepUnbundle(value[key]);
    }
    return unbundledValue;
  }
  return unbundle(value);
}
var spec = { "$version": 8, "$root": { "version": { "required": true, "type": "enum", "values": [8] }, "name": { "type": "string" }, "metadata": { "type": "*" }, "center": { "type": "array", "value": "number" }, "zoom": { "type": "number" }, "bearing": { "type": "number", "default": 0, "period": 360, "units": "degrees" }, "pitch": { "type": "number", "default": 0, "units": "degrees" }, "light": { "type": "light" }, "terrain": { "type": "terrain" }, "fog": { "type": "fog" }, "sources": { "required": true, "type": "sources" }, "sprite": { "type": "string" }, "glyphs": { "type": "string" }, "transition": { "type": "transition" }, "projection": { "type": "projection" }, "layers": { "required": true, "type": "array", "value": "layer" } }, "sources": { "*": { "type": "source" } }, "source": ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], "source_vector": { "type": { "required": true, "type": "enum", "values": { "vector": {} } }, "url": { "type": "string" }, "tiles": { "type": "array", "value": "string" }, "bounds": { "type": "array", "value": "number", "length": 4, "default": [-180, -85.051129, 180, 85.051129] }, "scheme": { "type": "enum", "values": { "xyz": {}, "tms": {} }, "default": "xyz" }, "minzoom": { "type": "number", "default": 0 }, "maxzoom": { "type": "number", "default": 22 }, "attribution": { "type": "string" }, "promoteId": { "type": "promoteId" }, "volatile": { "type": "boolean", "default": false }, "*": { "type": "*" } }, "source_raster": { "type": { "required": true, "type": "enum", "values": { "raster": {} } }, "url": { "type": "string" }, "tiles": { "type": "array", "value": "string" }, "bounds": { "type": "array", "value": "number", "length": 4, "default": [-180, -85.051129, 180, 85.051129] }, "minzoom": { "type": "number", "default": 0 }, "maxzoom": { "type": "number", "default": 22 }, "tileSize": { "type": "number", "default": 512, "units": "pixels" }, "scheme": { "type": "enum", "values": { "xyz": {}, "tms": {} }, "default": "xyz" }, "attribution": { "type": "string" }, "volatile": { "type": "boolean", "default": false }, "*": { "type": "*" } }, "source_raster_dem": { "type": { "required": true, "type": "enum", "values": { "raster-dem": {} } }, "url": { "type": "string" }, "tiles": { "type": "array", "value": "string" }, "bounds": { "type": "array", "value": "number", "length": 4, "default": [-180, -85.051129, 180, 85.051129] }, "minzoom": { "type": "number", "default": 0 }, "maxzoom": { "type": "number", "default": 22 }, "tileSize": { "type": "number", "default": 512, "units": "pixels" }, "attribution": { "type": "string" }, "encoding": { "type": "enum", "values": { "terrarium": {}, "mapbox": {} }, "default": "mapbox" }, "volatile": { "type": "boolean", "default": false }, "*": { "type": "*" } }, "source_geojson": { "type": { "required": true, "type": "enum", "values": { "geojson": {} } }, "data": { "type": "*" }, "maxzoom": { "type": "number", "default": 18 }, "attribution": { "type": "string" }, "buffer": { "type": "number", "default": 128, "maximum": 512, "minimum": 0 }, "filter": { "type": "*" }, "tolerance": { "type": "number", "default": 0.375 }, "cluster": { "type": "boolean", "default": false }, "clusterRadius": { "type": "number", "default": 50, "minimum": 0 }, "clusterMaxZoom": { "type": "number" }, "clusterMinPoints": { "type": "number" }, "clusterProperties": { "type": "*" }, "lineMetrics": { "type": "boolean", "default": false }, "generateId": { "type": "boolean", "default": false }, "promoteId": { "type": "promoteId" } }, "source_video": { "type": { "required": true, "type": "enum", "values": { "video": {} } }, "urls": { "required": true, "type": "array", "value": "string" }, "coordinates": { "required": true, "type": "array", "length": 4, "value": { "type": "array", "length": 2, "value": "number" } } }, "source_image": { "type": { "required": true, "type": "enum", "values": { "image": {} } }, "url": { "required": true, "type": "string" }, "coordinates": { "required": true, "type": "array", "length": 4, "value": { "type": "array", "length": 2, "value": "number" } } }, "layer": { "id": { "type": "string", "required": true }, "type": { "type": "enum", "values": { "fill": {}, "line": {}, "symbol": {}, "circle": {}, "heatmap": {}, "fill-extrusion": {}, "raster": {}, "hillshade": {}, "background": {}, "sky": {} }, "required": true }, "metadata": { "type": "*" }, "source": { "type": "string" }, "source-layer": { "type": "string" }, "minzoom": { "type": "number", "minimum": 0, "maximum": 24 }, "maxzoom": { "type": "number", "minimum": 0, "maximum": 24 }, "filter": { "type": "filter" }, "layout": { "type": "layout" }, "paint": { "type": "paint" } }, "layout": ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background", "layout_sky"], "layout_background": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_sky": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_fill": { "fill-sort-key": { "type": "number", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_circle": { "circle-sort-key": { "type": "number", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_heatmap": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_fill-extrusion": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_line": { "line-cap": { "type": "enum", "values": { "butt": {}, "round": {}, "square": {} }, "default": "butt", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "line-join": { "type": "enum", "values": { "bevel": {}, "round": {}, "miter": {} }, "default": "miter", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { "type": "number", "default": 2, "requires": [{ "line-join": "miter" }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { "type": "number", "default": 1.05, "requires": [{ "line-join": "round" }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { "type": "number", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_symbol": { "symbol-placement": { "type": "enum", "values": { "point": {}, "line": {}, "line-center": {} }, "default": "point", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { "type": "number", "default": 250, "minimum": 1, "units": "pixels", "requires": [{ "symbol-placement": "line" }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { "type": "boolean", "default": false, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { "type": "number", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { "type": "enum", "values": { "auto": {}, "viewport-y": {}, "source": {} }, "default": "auto", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { "type": "boolean", "default": false, "requires": ["icon-image"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { "type": "boolean", "default": false, "requires": ["icon-image"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { "type": "boolean", "default": false, "requires": ["icon-image", "text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { "type": "enum", "values": { "map": {}, "viewport": {}, "auto": {} }, "default": "auto", "requires": ["icon-image"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-size": { "type": "number", "default": 1, "minimum": 0, "units": "factor of the original icon size", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { "type": "enum", "values": { "none": {}, "width": {}, "height": {}, "both": {} }, "default": "none", "requires": ["icon-image", "text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { "type": "array", "value": "number", "length": 4, "default": [0, 0, 0, 0], "units": "pixels", "requires": ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-image": { "type": "resolvedImage", "tokens": true, "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { "type": "number", "default": 0, "period": 360, "units": "degrees", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { "type": "number", "default": 2, "minimum": 0, "units": "pixels", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-keep-upright": { "type": "boolean", "default": false, "requires": ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { "type": "enum", "values": { "center": {}, "left": {}, "right": {}, "top": {}, "bottom": {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, "default": "center", "requires": ["icon-image"], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { "type": "enum", "values": { "map": {}, "viewport": {}, "auto": {} }, "default": "auto", "requires": ["icon-image"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { "type": "enum", "values": { "map": {}, "viewport": {}, "auto": {} }, "default": "auto", "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { "type": "enum", "values": { "map": {}, "viewport": {}, "auto": {} }, "default": "auto", "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-field": { "type": "formatted", "default": "", "tokens": true, "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { "type": "array", "value": "string", "default": ["Open Sans Regular", "Arial Unicode MS Regular"], "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { "type": "number", "default": 16, "minimum": 0, "units": "pixels", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { "type": "number", "default": 10, "minimum": 0, "units": "ems", "requires": ["text-field", { "symbol-placement": ["point"] }], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { "type": "number", "default": 1.2, "units": "ems", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-letter-spacing": { "type": "number", "default": 0, "units": "ems", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { "type": "enum", "values": { "auto": {}, "left": {}, "center": {}, "right": {} }, "default": "center", "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { "type": "number", "units": "ems", "default": 0, "requires": ["text-field"], "property-type": "data-driven", "expression": { "interpolated": true, "parameters": ["zoom", "feature"] } }, "text-variable-anchor": { "type": "array", "value": "enum", "values": { "center": {}, "left": {}, "right": {}, "top": {}, "bottom": {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, "requires": ["text-field", { "symbol-placement": ["point"] }], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { "type": "enum", "values": { "center": {}, "left": {}, "right": {}, "top": {}, "bottom": {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, "default": "center", "requires": ["text-field", { "!": "text-variable-anchor" }], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { "type": "number", "default": 45, "units": "degrees", "requires": ["text-field", { "symbol-placement": ["line", "line-center"] }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { "type": "array", "value": "enum", "values": { "horizontal": {}, "vertical": {} }, "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { "type": "number", "default": 0, "period": 360, "units": "degrees", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { "type": "number", "default": 2, "minimum": 0, "units": "pixels", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { "type": "boolean", "default": true, "requires": ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-transform": { "type": "enum", "values": { "none": {}, "uppercase": {}, "lowercase": {} }, "default": "none", "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { "type": "array", "value": "number", "units": "ems", "length": 2, "default": [0, 0], "requires": ["text-field", { "!": "text-radial-offset" }], "expression": { "interpolated": true, "parameters": ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { "type": "boolean", "default": false, "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-ignore-placement": { "type": "boolean", "default": false, "requires": ["text-field"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-optional": { "type": "boolean", "default": false, "requires": ["text-field", "icon-image"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_raster": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "layout_hillshade": { "visibility": { "type": "enum", "values": { "visible": {}, "none": {} }, "default": "visible", "property-type": "constant" } }, "filter": { "type": "array", "value": "*" }, "filter_symbol": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature", "pitch", "distance-from-center"] } }, "filter_fill": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] } }, "filter_line": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] } }, "filter_circle": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] } }, "filter_fill-extrusion": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] } }, "filter_heatmap": { "type": "boolean", "default": false, "transition": false, "property-type": "data-driven", "expression": { "interpolated": false, "parameters": ["zoom", "feature"] } }, "filter_operator": { "type": "enum", "values": { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, "in": {}, "!in": {}, "all": {}, "any": {}, "none": {}, "has": {}, "!has": {}, "within": {} } }, "geometry_type": { "type": "enum", "values": { "Point": {}, "LineString": {}, "Polygon": {} } }, "function": { "expression": { "type": "expression" }, "stops": { "type": "array", "value": "function_stop" }, "base": { "type": "number", "default": 1, "minimum": 0 }, "property": { "type": "string", "default": "$zoom" }, "type": { "type": "enum", "values": { "identity": {}, "exponential": {}, "interval": {}, "categorical": {} }, "default": "exponential" }, "colorSpace": { "type": "enum", "values": { "rgb": {}, "lab": {}, "hcl": {} }, "default": "rgb" }, "default": { "type": "*", "required": false } }, "function_stop": { "type": "array", "minimum": 0, "maximum": 24, "value": ["number", "color"], "length": 2 }, "expression": { "type": "array", "value": "*", "minimum": 1 }, "expression_name": { "type": "enum", "values": { "let": { "group": "Variable binding" }, "var": { "group": "Variable binding" }, "literal": { "group": "Types" }, "array": { "group": "Types" }, "at": { "group": "Lookup" }, "in": { "group": "Lookup" }, "index-of": { "group": "Lookup" }, "slice": { "group": "Lookup" }, "case": { "group": "Decision" }, "match": { "group": "Decision" }, "coalesce": { "group": "Decision" }, "step": { "group": "Ramps, scales, curves" }, "interpolate": { "group": "Ramps, scales, curves" }, "interpolate-hcl": { "group": "Ramps, scales, curves" }, "interpolate-lab": { "group": "Ramps, scales, curves" }, "ln2": { "group": "Math" }, "pi": { "group": "Math" }, "e": { "group": "Math" }, "typeof": { "group": "Types" }, "string": { "group": "Types" }, "number": { "group": "Types" }, "boolean": { "group": "Types" }, "object": { "group": "Types" }, "collator": { "group": "Types" }, "format": { "group": "Types" }, "image": { "group": "Types" }, "number-format": { "group": "Types" }, "to-string": { "group": "Types" }, "to-number": { "group": "Types" }, "to-boolean": { "group": "Types" }, "to-rgba": { "group": "Color" }, "to-color": { "group": "Types" }, "rgb": { "group": "Color" }, "rgba": { "group": "Color" }, "get": { "group": "Lookup" }, "has": { "group": "Lookup" }, "length": { "group": "Lookup" }, "properties": { "group": "Feature data" }, "feature-state": { "group": "Feature data" }, "geometry-type": { "group": "Feature data" }, "id": { "group": "Feature data" }, "zoom": { "group": "Camera" }, "pitch": { "group": "Camera" }, "distance-from-center": { "group": "Camera" }, "heatmap-density": { "group": "Heatmap" }, "line-progress": { "group": "Feature data" }, "sky-radial-progress": { "group": "sky" }, "accumulated": { "group": "Feature data" }, "+": { "group": "Math" }, "*": { "group": "Math" }, "-": { "group": "Math" }, "/": { "group": "Math" }, "%": { "group": "Math" }, "^": { "group": "Math" }, "sqrt": { "group": "Math" }, "log10": { "group": "Math" }, "ln": { "group": "Math" }, "log2": { "group": "Math" }, "sin": { "group": "Math" }, "cos": { "group": "Math" }, "tan": { "group": "Math" }, "asin": { "group": "Math" }, "acos": { "group": "Math" }, "atan": { "group": "Math" }, "min": { "group": "Math" }, "max": { "group": "Math" }, "round": { "group": "Math" }, "abs": { "group": "Math" }, "ceil": { "group": "Math" }, "floor": { "group": "Math" }, "distance": { "group": "Math" }, "==": { "group": "Decision" }, "!=": { "group": "Decision" }, ">": { "group": "Decision" }, "<": { "group": "Decision" }, ">=": { "group": "Decision" }, "<=": { "group": "Decision" }, "all": { "group": "Decision" }, "any": { "group": "Decision" }, "!": { "group": "Decision" }, "within": { "group": "Decision" }, "is-supported-script": { "group": "String" }, "upcase": { "group": "String" }, "downcase": { "group": "String" }, "concat": { "group": "String" }, "resolved-locale": { "group": "String" } } }, "fog": { "range": { "type": "array", "default": [0.5, 10], "minimum": -20, "maximum": 20, "length": 2, "value": "number", "property-type": "data-constant", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] } }, "color": { "type": "color", "property-type": "data-constant", "default": "#ffffff", "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true }, "high-color": { "type": "color", "property-type": "data-constant", "default": "#245cdf", "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true }, "space-color": { "type": "color", "property-type": "data-constant", "default": ["interpolate", ["linear"], ["zoom"], 4, "#010b19", 7, "#367ab9"], "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true }, "horizon-blend": { "type": "number", "property-type": "data-constant", "default": ["interpolate", ["linear"], ["zoom"], 4, 0.2, 7, 0.1], "minimum": 0, "maximum": 1, "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true }, "star-intensity": { "type": "number", "property-type": "data-constant", "default": ["interpolate", ["linear"], ["zoom"], 5, 0.35, 6, 0], "minimum": 0, "maximum": 1, "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true } }, "light": { "anchor": { "type": "enum", "default": "viewport", "values": { "map": {}, "viewport": {} }, "property-type": "data-constant", "transition": false, "expression": { "interpolated": false, "parameters": ["zoom"] } }, "position": { "type": "array", "default": [1.15, 210, 30], "length": 3, "value": "number", "property-type": "data-constant", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] } }, "color": { "type": "color", "property-type": "data-constant", "default": "#ffffff", "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true }, "intensity": { "type": "number", "property-type": "data-constant", "default": 0.5, "minimum": 0, "maximum": 1, "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true } }, "projection": { "name": { "type": "enum", "values": { "albers": {}, "equalEarth": {}, "equirectangular": {}, "lambertConformalConic": {}, "mercator": {}, "naturalEarth": {}, "winkelTripel": {}, "globe": {} }, "default": "mercator", "required": true }, "center": { "type": "array", "length": 2, "value": "number", "property-type": "data-constant", "minimum": [-180, -90], "maximum": [180, 90], "transition": false, "requires": [{ "name": ["albers", "lambertConformalConic"] }] }, "parallels": { "type": "array", "length": 2, "value": "number", "property-type": "data-constant", "minimum": [-90, -90], "maximum": [90, 90], "transition": false, "requires": [{ "name": ["albers", "lambertConformalConic"] }] } }, "terrain": { "source": { "type": "string", "required": true }, "exaggeration": { "type": "number", "property-type": "data-constant", "default": 1, "minimum": 0, "maximum": 1e3, "expression": { "interpolated": true, "parameters": ["zoom"] }, "transition": true, "requires": ["source"] } }, "paint": ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background", "paint_sky"], "paint_fill": { "fill-antialias": { "type": "boolean", "default": true, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-color": { "type": "color", "default": "#000000", "transition": true, "requires": [{ "!": "fill-pattern" }], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-outline-color": { "type": "color", "transition": true, "requires": [{ "!": "fill-pattern" }, { "fill-antialias": true }], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["fill-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-pattern": { "type": "resolvedImage", "transition": true, "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-color": { "type": "color", "default": "#000000", "transition": true, "requires": [{ "!": "fill-extrusion-pattern" }], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["fill-extrusion-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern": { "type": "resolvedImage", "transition": true, "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "fill-extrusion-height": { "type": "number", "default": 0, "minimum": 0, "units": "meters", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-base": { "type": "number", "default": 0, "minimum": 0, "units": "meters", "transition": true, "requires": ["fill-extrusion-height"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-vertical-gradient": { "type": "boolean", "default": true, "transition": false, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_line": { "line-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-color": { "type": "color", "default": "#000000", "transition": true, "requires": [{ "!": "line-pattern" }], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "line-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["line-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "line-width": { "type": "number", "default": 1, "minimum": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-gap-width": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-offset": { "type": "number", "default": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-blur": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-dasharray": { "type": "array", "value": "number", "minimum": 0, "transition": true, "units": "line widths", "requires": [{ "!": "line-pattern" }], "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-pattern": { "type": "resolvedImage", "transition": true, "expression": { "interpolated": false, "parameters": ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-gradient": { "type": "color", "transition": false, "requires": [{ "!": "line-pattern" }, { "source": "geojson", "has": { "lineMetrics": true } }], "expression": { "interpolated": true, "parameters": ["line-progress"] }, "property-type": "color-ramp" }, "line-trim-offset": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "minimum": [0, 0], "maximum": [1, 1], "transition": false, "requires": [{ "source": "geojson", "has": { "lineMetrics": true } }], "property-type": "constant" } }, "paint_circle": { "circle-radius": { "type": "number", "default": 5, "minimum": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-color": { "type": "color", "default": "#000000", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-blur": { "type": "number", "default": 0, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "circle-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["circle-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-scale": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-alignment": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "viewport", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "circle-stroke-width": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-color": { "type": "color", "default": "#000000", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" } }, "paint_heatmap": { "heatmap-radius": { "type": "number", "default": 30, "minimum": 1, "transition": true, "units": "pixels", "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-weight": { "type": "number", "default": 1, "minimum": 0, "transition": false, "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-intensity": { "type": "number", "default": 1, "minimum": 0, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "heatmap-color": { "type": "color", "default": ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", 0.1, "royalblue", 0.3, "cyan", 0.5, "lime", 0.7, "yellow", 1, "red"], "transition": false, "expression": { "interpolated": true, "parameters": ["heatmap-density"] }, "property-type": "color-ramp" }, "heatmap-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_symbol": { "icon-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-color": { "type": "color", "default": "#000000", "transition": true, "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-color": { "type": "color", "default": "rgba(0, 0, 0, 0)", "transition": true, "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-width": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-blur": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "requires": ["icon-image"], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "icon-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["icon-image", "icon-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-color": { "type": "color", "default": "#000000", "transition": true, "overridable": true, "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-color": { "type": "color", "default": "rgba(0, 0, 0, 0)", "transition": true, "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-width": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-blur": { "type": "number", "default": 0, "minimum": 0, "transition": true, "units": "pixels", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-translate": { "type": "array", "value": "number", "length": 2, "default": [0, 0], "transition": true, "units": "pixels", "requires": ["text-field"], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "text-translate-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "map", "requires": ["text-field", "text-translate"], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_raster": { "raster-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-hue-rotate": { "type": "number", "default": 0, "period": 360, "transition": true, "units": "degrees", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-min": { "type": "number", "default": 0, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-max": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-saturation": { "type": "number", "default": 0, "minimum": -1, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-contrast": { "type": "number", "default": 0, "minimum": -1, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-resampling": { "type": "enum", "values": { "linear": {}, "nearest": {} }, "default": "linear", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "raster-fade-duration": { "type": "number", "default": 300, "minimum": 0, "transition": false, "units": "milliseconds", "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_hillshade": { "hillshade-illumination-direction": { "type": "number", "default": 335, "minimum": 0, "maximum": 359, "transition": false, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "hillshade-illumination-anchor": { "type": "enum", "values": { "map": {}, "viewport": {} }, "default": "viewport", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "hillshade-exaggeration": { "type": "number", "default": 0.5, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "hillshade-shadow-color": { "type": "color", "default": "#000000", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "hillshade-highlight-color": { "type": "color", "default": "#FFFFFF", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "hillshade-accent-color": { "type": "color", "default": "#000000", "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_background": { "background-color": { "type": "color", "default": "#000000", "transition": true, "requires": [{ "!": "background-pattern" }], "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" }, "background-pattern": { "type": "resolvedImage", "transition": true, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "cross-faded" }, "background-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "paint_sky": { "sky-type": { "type": "enum", "values": { "gradient": {}, "atmosphere": {} }, "default": "atmosphere", "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "sky-atmosphere-sun": { "type": "array", "value": "number", "length": 2, "units": "degrees", "minimum": [0, 0], "maximum": [360, 180], "transition": false, "requires": [{ "sky-type": "atmosphere" }], "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "sky-atmosphere-sun-intensity": { "type": "number", "requires": [{ "sky-type": "atmosphere" }], "default": 10, "minimum": 0, "maximum": 100, "transition": false, "property-type": "data-constant" }, "sky-gradient-center": { "type": "array", "requires": [{ "sky-type": "gradient" }], "value": "number", "default": [0, 0], "length": 2, "units": "degrees", "minimum": [0, 0], "maximum": [360, 180], "transition": false, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "sky-gradient-radius": { "type": "number", "requires": [{ "sky-type": "gradient" }], "default": 90, "minimum": 0, "maximum": 180, "transition": false, "expression": { "interpolated": false, "parameters": ["zoom"] }, "property-type": "data-constant" }, "sky-gradient": { "type": "color", "default": ["interpolate", ["linear"], ["sky-radial-progress"], 0.8, "#87ceeb", 1, "white"], "transition": false, "requires": [{ "sky-type": "gradient" }], "expression": { "interpolated": true, "parameters": ["sky-radial-progress"] }, "property-type": "color-ramp" }, "sky-atmosphere-halo-color": { "type": "color", "default": "white", "transition": false, "requires": [{ "sky-type": "atmosphere" }], "property-type": "data-constant" }, "sky-atmosphere-color": { "type": "color", "default": "white", "transition": false, "requires": [{ "sky-type": "atmosphere" }], "property-type": "data-constant" }, "sky-opacity": { "type": "number", "default": 1, "minimum": 0, "maximum": 1, "transition": true, "expression": { "interpolated": true, "parameters": ["zoom"] }, "property-type": "data-constant" } }, "transition": { "duration": { "type": "number", "default": 300, "minimum": 0, "units": "milliseconds" }, "delay": { "type": "number", "default": 0, "minimum": 0, "units": "milliseconds" } }, "property-type": { "data-driven": { "type": "property-type" }, "cross-faded": { "type": "property-type" }, "cross-faded-data-driven": { "type": "property-type" }, "color-ramp": { "type": "property-type" }, "data-constant": { "type": "property-type" }, "constant": { "type": "property-type" } }, "promoteId": { "*": { "type": "string" } } };
function isExpressionFilter(filter2) {
  if (filter2 === true || filter2 === false) {
    return true;
  }
  if (!Array.isArray(filter2) || filter2.length === 0) {
    return false;
  }
  switch (filter2[0]) {
    case "has":
      return filter2.length >= 2 && filter2[1] !== "$id" && filter2[1] !== "$type";
    case "in":
      return filter2.length >= 3 && (typeof filter2[1] !== "string" || Array.isArray(filter2[2]));
    case "!in":
    case "!has":
    case "none":
      return false;
    case "==":
    case "!=":
    case ">":
    case ">=":
    case "<":
    case "<=":
      return filter2.length !== 3 || (Array.isArray(filter2[1]) || Array.isArray(filter2[2]));
    case "any":
    case "all":
      for (var i2 = 0, list = filter2.slice(1); i2 < list.length; i2 += 1) {
        var f = list[i2];
        if (!isExpressionFilter(f) && typeof f !== "boolean") {
          return false;
        }
      }
      return true;
    default:
      return true;
  }
}
function createFilter(filter2, layerType) {
  if (layerType === void 0) layerType = "fill";
  if (filter2 === null || filter2 === void 0) {
    return {
      filter: function() {
        return true;
      },
      needGeometry: false,
      needFeature: false
    };
  }
  if (!isExpressionFilter(filter2)) {
    filter2 = convertFilter(filter2);
  }
  var filterExp = filter2;
  var staticFilter = true;
  try {
    staticFilter = extractStaticFilter(filterExp);
  } catch (e) {
    console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n" + JSON.stringify(filterExp, null, 2) + "\n        ");
  }
  var filterSpec = spec["filter_" + layerType];
  var compiledStaticFilter = createExpression(staticFilter, filterSpec);
  var filterFunc2 = null;
  if (compiledStaticFilter.result === "error") {
    throw new Error(compiledStaticFilter.value.map(function(err) {
      return err.key + ": " + err.message;
    }).join(", "));
  } else {
    filterFunc2 = function(globalProperties, feature, canonical) {
      return compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);
    };
  }
  var dynamicFilterFunc = null;
  var needFeature = null;
  if (staticFilter !== filterExp) {
    var compiledDynamicFilter = createExpression(filterExp, filterSpec);
    if (compiledDynamicFilter.result === "error") {
      throw new Error(compiledDynamicFilter.value.map(function(err) {
        return err.key + ": " + err.message;
      }).join(", "));
    } else {
      dynamicFilterFunc = function(globalProperties, feature, canonical, featureTileCoord, featureDistanceData) {
        return compiledDynamicFilter.value.evaluate(globalProperties, feature, {}, canonical, void 0, void 0, featureTileCoord, featureDistanceData);
      };
      needFeature = !isFeatureConstant(compiledDynamicFilter.value.expression);
    }
  }
  filterFunc2 = filterFunc2;
  var needGeometry = geometryNeeded(staticFilter);
  return {
    filter: filterFunc2,
    dynamicFilter: dynamicFilterFunc ? dynamicFilterFunc : void 0,
    needGeometry,
    needFeature: !!needFeature
  };
}
function extractStaticFilter(filter2) {
  if (!isDynamicFilter(filter2)) {
    return filter2;
  }
  var result = deepUnbundle(filter2);
  unionDynamicBranches(result);
  result = collapseDynamicBooleanExpressions(result);
  return result;
}
function collapseDynamicBooleanExpressions(expression) {
  if (!Array.isArray(expression)) {
    return expression;
  }
  var collapsed = collapsedExpression(expression);
  if (collapsed === true) {
    return collapsed;
  } else {
    return collapsed.map(function(subExpression) {
      return collapseDynamicBooleanExpressions(subExpression);
    });
  }
}
function unionDynamicBranches(filter2) {
  var isBranchingDynamically = false;
  var branches = [];
  if (filter2[0] === "case") {
    for (var i2 = 1; i2 < filter2.length - 1; i2 += 2) {
      isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter2[i2]);
      branches.push(filter2[i2 + 1]);
    }
    branches.push(filter2[filter2.length - 1]);
  } else if (filter2[0] === "match") {
    isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter2[1]);
    for (var i$1 = 2; i$1 < filter2.length - 1; i$1 += 2) {
      branches.push(filter2[i$1 + 1]);
    }
    branches.push(filter2[filter2.length - 1]);
  } else if (filter2[0] === "step") {
    isBranchingDynamically = isBranchingDynamically || isDynamicFilter(filter2[1]);
    for (var i$2 = 1; i$2 < filter2.length - 1; i$2 += 2) {
      branches.push(filter2[i$2 + 1]);
    }
  }
  if (isBranchingDynamically) {
    filter2.length = 0;
    filter2.push.apply(filter2, ["any"].concat(branches));
  }
  for (var i$3 = 1; i$3 < filter2.length; i$3++) {
    unionDynamicBranches(filter2[i$3]);
  }
}
function isDynamicFilter(filter2) {
  if (!Array.isArray(filter2)) {
    return false;
  }
  if (isRootExpressionDynamic(filter2[0])) {
    return true;
  }
  for (var i2 = 1; i2 < filter2.length; i2++) {
    var child = filter2[i2];
    if (isDynamicFilter(child)) {
      return true;
    }
  }
  return false;
}
function isRootExpressionDynamic(expression) {
  return expression === "pitch" || expression === "distance-from-center";
}
var dynamicConditionExpressions = /* @__PURE__ */ new Set([
  "in",
  "==",
  "!=",
  ">",
  ">=",
  "<",
  "<=",
  "to-boolean"
]);
function collapsedExpression(expression) {
  if (dynamicConditionExpressions.has(expression[0])) {
    for (var i2 = 1; i2 < expression.length; i2++) {
      var param = expression[i2];
      if (isDynamicFilter(param)) {
        return true;
      }
    }
  }
  return expression;
}
function compare2(a, b) {
  return a < b ? -1 : a > b ? 1 : 0;
}
function geometryNeeded(filter2) {
  if (!Array.isArray(filter2)) {
    return false;
  }
  if (filter2[0] === "within") {
    return true;
  }
  for (var index = 1; index < filter2.length; index++) {
    if (geometryNeeded(filter2[index])) {
      return true;
    }
  }
  return false;
}
function convertFilter(filter2) {
  if (!filter2) {
    return true;
  }
  var op = filter2[0];
  if (filter2.length <= 1) {
    return op !== "any";
  }
  var converted = op === "==" ? convertComparisonOp(filter2[1], filter2[2], "==") : op === "!=" ? convertNegation(convertComparisonOp(filter2[1], filter2[2], "==")) : op === "<" || op === ">" || op === "<=" || op === ">=" ? convertComparisonOp(filter2[1], filter2[2], op) : op === "any" ? convertDisjunctionOp(filter2.slice(1)) : op === "all" ? ["all"].concat(filter2.slice(1).map(convertFilter)) : op === "none" ? ["all"].concat(filter2.slice(1).map(convertFilter).map(convertNegation)) : op === "in" ? convertInOp(filter2[1], filter2.slice(2)) : op === "!in" ? convertNegation(convertInOp(filter2[1], filter2.slice(2))) : op === "has" ? convertHasOp(filter2[1]) : op === "!has" ? convertNegation(convertHasOp(filter2[1])) : op === "within" ? filter2 : true;
  return converted;
}
function convertComparisonOp(property, value, op) {
  switch (property) {
    case "$type":
      return [
        "filter-type-" + op,
        value
      ];
    case "$id":
      return [
        "filter-id-" + op,
        value
      ];
    default:
      return [
        "filter-" + op,
        property,
        value
      ];
  }
}
function convertDisjunctionOp(filters) {
  return ["any"].concat(filters.map(convertFilter));
}
function convertInOp(property, values) {
  if (values.length === 0) {
    return false;
  }
  switch (property) {
    case "$type":
      return [
        "filter-type-in",
        [
          "literal",
          values
        ]
      ];
    case "$id":
      return [
        "filter-id-in",
        [
          "literal",
          values
        ]
      ];
    default:
      if (values.length > 200 && !values.some(function(v) {
        return typeof v !== typeof values[0];
      })) {
        return [
          "filter-in-large",
          property,
          [
            "literal",
            values.sort(compare2)
          ]
        ];
      } else {
        return [
          "filter-in-small",
          property,
          [
            "literal",
            values
          ]
        ];
      }
  }
}
function convertHasOp(property) {
  switch (property) {
    case "$type":
      return true;
    case "$id":
      return ["filter-has-id"];
    default:
      return [
        "filter-has",
        property
      ];
  }
}
function convertNegation(filter2) {
  return [
    "!",
    filter2
  ];
}
var refProperties = [
  "type",
  "source",
  "source-layer",
  "minzoom",
  "maxzoom",
  "filter",
  "layout"
];
function deref(layer, parent) {
  var result = {};
  for (var k in layer) {
    if (k !== "ref") {
      result[k] = layer[k];
    }
  }
  refProperties.forEach(function(k2) {
    if (k2 in parent) {
      result[k2] = parent[k2];
    }
  });
  return result;
}
function derefLayers(layers) {
  layers = layers.slice();
  var map2 = /* @__PURE__ */ Object.create(null);
  for (var i2 = 0; i2 < layers.length; i2++) {
    map2[layers[i2].id] = layers[i2];
  }
  for (var i$1 = 0; i$1 < layers.length; i$1++) {
    if ("ref" in layers[i$1]) {
      layers[i$1] = deref(layers[i$1], map2[layers[i$1].ref]);
    }
  }
  return layers;
}
var fontWeights = {
  thin: 100,
  hairline: 100,
  "ultra-light": 100,
  "extra-light": 100,
  light: 200,
  book: 300,
  regular: 400,
  normal: 400,
  plain: 400,
  roman: 400,
  standard: 400,
  medium: 500,
  "semi-bold": 600,
  "demi-bold": 600,
  bold: 700,
  heavy: 800,
  black: 800,
  "extra-bold": 800,
  "ultra-black": 900,
  "extra-black": 900,
  "ultra-bold": 900,
  "heavy-black": 900,
  fat: 900,
  poster: 900
};
var sp = " ";
var italicRE = /(italic|oblique)$/i;
var fontCache = {};
var mapboxToCssFont = function(fonts, size, lineHeight) {
  var cssData = fontCache[fonts];
  if (!cssData) {
    if (!Array.isArray(fonts)) {
      fonts = [fonts];
    }
    var weight = 400;
    var style2 = "normal";
    var fontFamilies = [];
    var haveWeight, haveStyle;
    for (var i2 = 0, ii = fonts.length; i2 < ii; ++i2) {
      var font = fonts[i2];
      var parts = font.split(" ");
      var maybeWeight = parts[parts.length - 1].toLowerCase();
      if (maybeWeight == "normal" || maybeWeight == "italic" || maybeWeight == "oblique") {
        style2 = haveStyle ? style2 : maybeWeight;
        parts.pop();
        maybeWeight = parts[parts.length - 1].toLowerCase();
      } else if (italicRE.test(maybeWeight)) {
        maybeWeight = maybeWeight.replace(italicRE, "");
        style2 = haveStyle ? style2 : parts[parts.length - 1].replace(maybeWeight, "");
      }
      for (var w in fontWeights) {
        var previousPart = parts.length > 1 ? parts[parts.length - 2].toLowerCase() : "";
        if (maybeWeight == w || maybeWeight == w.replace("-", "") || previousPart + "-" + maybeWeight == w) {
          weight = haveWeight ? weight : fontWeights[w];
          parts.pop();
          if (previousPart && w.startsWith(previousPart)) {
            parts.pop();
          }
          break;
        }
      }
      if (!haveWeight && typeof maybeWeight == "number") {
        weight = maybeWeight;
      }
      var fontFamily = parts.join(sp).replace("Klokantech Noto Sans", "Noto Sans");
      if (fontFamily.indexOf(sp) !== -1) {
        fontFamily = '"' + fontFamily + '"';
      }
      fontFamilies.push(fontFamily);
    }
    cssData = fontCache[fonts] = [
      style2,
      weight,
      fontFamilies
    ];
  }
  return cssData[0] + sp + cssData[1] + sp + size + "px" + (lineHeight ? "/" + lineHeight : "") + sp + cssData[2];
};
function deg2rad(degrees) {
  return degrees * Math.PI / 180;
}
var defaultResolutions = function() {
  var resolutions = [];
  for (var res = 78271.51696402048; resolutions.length <= 24; res /= 2) {
    resolutions.push(res);
  }
  return resolutions;
}();
function createCanvas(width, height) {
  if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof OffscreenCanvas !== "undefined") {
    return new OffscreenCanvas(width, height);
  } else {
    var canvas = document.createElement("canvas");
    canvas.width = width;
    canvas.height = height;
    return canvas;
  }
}
function getZoomForResolution(resolution, resolutions) {
  var i2 = 0;
  var ii = resolutions.length;
  for (; i2 < ii; ++i2) {
    var candidate = resolutions[i2];
    if (candidate < resolution && i2 + 1 < ii) {
      var zoomFactor = resolutions[i2] / resolutions[i2 + 1];
      return i2 + Math.log(resolutions[i2] / resolution) / Math.log(zoomFactor);
    }
  }
  return ii - 1;
}
var hairSpacePool = Array(256).join("\u200A");
function applyLetterSpacing(text, letterSpacing) {
  if (letterSpacing >= 0.05) {
    var textWithLetterSpacing = "";
    var lines = text.split("\n");
    var joinSpaceString = hairSpacePool.slice(0, Math.round(letterSpacing / 0.1));
    for (var l = 0, ll = lines.length; l < ll; ++l) {
      if (l > 0) {
        textWithLetterSpacing += "\n";
      }
      textWithLetterSpacing += lines[l].split("").join(joinSpaceString);
    }
    return textWithLetterSpacing;
  }
  return text;
}
var measureContext2;
function getMeasureContext() {
  if (!measureContext2) {
    measureContext2 = createCanvas(1, 1).getContext("2d");
  }
  return measureContext2;
}
function measureText2(text, letterSpacing) {
  return getMeasureContext().measureText(text).width + (text.length - 1) * letterSpacing;
}
var measureCache = {};
function wrapText(text, font, em, letterSpacing) {
  if (text.indexOf("\n") !== -1) {
    var hardLines = text.split("\n");
    var lines = [];
    for (var i2 = 0, ii = hardLines.length; i2 < ii; ++i2) {
      lines.push(wrapText(hardLines[i2], font, em, letterSpacing));
    }
    return lines.join("\n");
  }
  var key = em + "," + font + "," + text + "," + letterSpacing;
  var wrappedText = measureCache[key];
  if (!wrappedText) {
    var words = text.split(" ");
    if (words.length > 1) {
      var ctx = getMeasureContext();
      ctx.font = font;
      var oneEm = ctx.measureText("M").width;
      var maxWidth = oneEm * em;
      var line = "";
      var lines$1 = [];
      for (var i$1 = 0, ii$1 = words.length; i$1 < ii$1; ++i$1) {
        var word = words[i$1];
        var testLine = line + (line ? " " : "") + word;
        if (measureText2(testLine, letterSpacing) <= maxWidth) {
          line = testLine;
        } else {
          if (line) {
            lines$1.push(line);
          }
          line = word;
        }
      }
      if (line) {
        lines$1.push(line);
      }
      for (var i$2 = 0, ii$2 = lines$1.length; i$2 < ii$2 && ii$2 > 1; ++i$2) {
        var line$1 = lines$1[i$2];
        if (measureText2(line$1, letterSpacing) < maxWidth * 0.35) {
          var prevWidth = i$2 > 0 ? measureText2(lines$1[i$2 - 1], letterSpacing) : Infinity;
          var nextWidth = i$2 < ii$2 - 1 ? measureText2(lines$1[i$2 + 1], letterSpacing) : Infinity;
          lines$1.splice(i$2, 1);
          ii$2 -= 1;
          if (prevWidth < nextWidth) {
            lines$1[i$2 - 1] += " " + line$1;
            i$2 -= 1;
          } else {
            lines$1[i$2] = line$1 + " " + lines$1[i$2];
          }
        }
      }
      for (var i$3 = 0, ii$3 = lines$1.length - 1; i$3 < ii$3; ++i$3) {
        var line$2 = lines$1[i$3];
        var next = lines$1[i$3 + 1];
        if (measureText2(line$2, letterSpacing) > maxWidth * 0.7 && measureText2(next, letterSpacing) < maxWidth * 0.6) {
          var lineWords = line$2.split(" ");
          var lastWord = lineWords.pop();
          if (measureText2(lastWord, letterSpacing) < maxWidth * 0.2) {
            lines$1[i$3] = lineWords.join(" ");
            lines$1[i$3 + 1] = lastWord + " " + next;
          }
          ii$3 -= 1;
        }
      }
      wrappedText = lines$1.join("\n");
    } else {
      wrappedText = text;
    }
    wrappedText = applyLetterSpacing(wrappedText, letterSpacing);
    measureCache[key] = wrappedText;
  }
  return wrappedText;
}
var types = {
  "Point": 1,
  "MultiPoint": 1,
  "LineString": 2,
  "MultiLineString": 2,
  "Polygon": 3,
  "MultiPolygon": 3
};
var anchor = {
  "center": [
    0.5,
    0.5
  ],
  "left": [
    0,
    0.5
  ],
  "right": [
    1,
    0.5
  ],
  "top": [
    0.5,
    0
  ],
  "bottom": [
    0.5,
    1
  ],
  "top-left": [
    0,
    0
  ],
  "top-right": [
    1,
    0
  ],
  "bottom-left": [
    0,
    1
  ],
  "bottom-right": [
    1,
    1
  ]
};
var expressionData = function(rawExpression, propertySpec) {
  var compiledExpression = createPropertyExpression(rawExpression, propertySpec);
  if (compiledExpression.result === "error") {
    throw new Error(compiledExpression.value.map(function(err) {
      return err.key + ": " + err.message;
    }).join(", "));
  }
  return compiledExpression.value;
};
var emptyObj$1 = {};
var zoomObj = { zoom: 0 };
var renderFeatureCoordinates;
var renderFeature2;
function getValue(layer, layoutOrPaint, property, zoom, feature, functionCache, featureState) {
  var layerId = layer.id;
  if (!functionCache) {
    functionCache = {};
    console.warn("No functionCache provided to getValue()");
  }
  if (!functionCache[layerId]) {
    functionCache[layerId] = {};
  }
  var functions = functionCache[layerId];
  if (!functions[property]) {
    var value = (layer[layoutOrPaint] || emptyObj$1)[property];
    var propertySpec = spec[layoutOrPaint + "_" + layer.type][property];
    if (value === void 0) {
      value = propertySpec.default;
    }
    var isExpr = isExpression(value);
    if (!isExpr && isFunction2(value)) {
      value = convertFunction(value, propertySpec);
      isExpr = true;
    }
    if (isExpr) {
      var compiledExpression = expressionData(value, propertySpec);
      functions[property] = compiledExpression.evaluate.bind(compiledExpression);
    } else {
      if (propertySpec.type == "color") {
        value = Color.parse(value);
      }
      functions[property] = function() {
        return value;
      };
    }
  }
  zoomObj.zoom = zoom;
  return functions[property](zoomObj, feature, featureState);
}
function getIconDeclutterMode(layer, zoom, feature, functionCache) {
  var allowOverlap = getValue(layer, "layout", "icon-allow-overlap", zoom, feature, functionCache);
  if (!allowOverlap) {
    return "declutter";
  }
  var ignorePlacement = getValue(layer, "layout", "icon-ignore-placement", zoom, feature, functionCache);
  if (!ignorePlacement) {
    return "obstacle";
  }
  return "none";
}
function evaluateFilter(layerId, filter2, feature, zoom, filterCache) {
  if (!filterCache) {
    console.warn("No filterCache provided to evaluateFilter()");
  }
  if (!(layerId in filterCache)) {
    filterCache[layerId] = createFilter(filter2).filter;
  }
  zoomObj.zoom = zoom;
  return filterCache[layerId](zoomObj, feature);
}
var renderTransparentEnabled = false;
function colorWithOpacity(color2, opacity) {
  if (color2) {
    if (!renderTransparentEnabled && (color2.a === 0 || opacity === 0)) {
      return void 0;
    }
    var a = color2.a;
    opacity = opacity === void 0 ? 1 : opacity;
    return a === 0 ? "transparent" : "rgba(" + Math.round(color2.r * 255 / a) + "," + Math.round(color2.g * 255 / a) + "," + Math.round(color2.b * 255 / a) + "," + a * opacity + ")";
  }
  return color2;
}
var templateRegEx = /\{[^{}}]*\}/g;
function fromTemplate(text, properties2) {
  return text.replace(templateRegEx, function(match2) {
    return properties2[match2.slice(1, -1)] || "";
  });
}
var recordLayer = false;
function stylefunction(olLayer, glStyle, sourceOrLayers, resolutions, spriteData, spriteImageUrl, getFonts) {
  if (resolutions === void 0) resolutions = defaultResolutions;
  if (spriteData === void 0) spriteData = void 0;
  if (spriteImageUrl === void 0) spriteImageUrl = void 0;
  if (getFonts === void 0) getFonts = void 0;
  if (typeof glStyle == "string") {
    glStyle = JSON.parse(glStyle);
  }
  if (glStyle.version != 8) {
    throw new Error("glStyle version 8 required.");
  }
  var spriteImage, spriteImgSize;
  if (spriteImageUrl) {
    if (typeof Image !== "undefined") {
      var img = new Image();
      img.crossOrigin = "anonymous";
      img.onload = function() {
        spriteImage = img;
        spriteImgSize = [
          img.width,
          img.height
        ];
        olLayer.changed();
        img.onload = null;
      };
      img.src = spriteImageUrl;
    } else if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) {
      var worker = self;
      worker.postMessage({
        action: "loadImage",
        src: spriteImageUrl
      });
      worker.addEventListener("message", function handler(event) {
        if (event.data.action === "imageLoaded" && event.data.src === spriteImageUrl) {
          spriteImage = event.data.image;
          spriteImgSize = [
            spriteImage.width,
            spriteImage.height
          ];
        }
      });
    }
  }
  var allLayers = derefLayers(glStyle.layers);
  var layersBySourceLayer = {};
  var mapboxLayers = [];
  var iconImageCache = {};
  var patternCache = {};
  var functionCache = {};
  var filterCache = {};
  var mapboxSource;
  for (var i2 = 0, ii = allLayers.length; i2 < ii; ++i2) {
    var layer = allLayers[i2];
    var layerId = layer.id;
    if (typeof sourceOrLayers == "string" && layer.source == sourceOrLayers || sourceOrLayers.indexOf(layerId) !== -1) {
      var sourceLayer = layer["source-layer"];
      if (!mapboxSource) {
        mapboxSource = layer.source;
        var source = glStyle.sources[mapboxSource];
        if (!source) {
          throw new Error('Source "' + mapboxSource + '" is not defined');
        }
        var type = source.type;
        if (type !== "vector" && type !== "geojson") {
          throw new Error('Source "' + mapboxSource + '" is not of type "vector" or "geojson", but "' + type + '"');
        }
      } else if (layer.source !== mapboxSource) {
        throw new Error('Layer "' + layerId + '" does not use source "' + mapboxSource);
      }
      var layers = layersBySourceLayer[sourceLayer];
      if (!layers) {
        layers = [];
        layersBySourceLayer[sourceLayer] = layers;
      }
      layers.push({
        layer,
        index: i2
      });
      mapboxLayers.push(layerId);
    }
  }
  var textHalo = new Stroke_default();
  var textColor = new Fill_default();
  var styles = [];
  var styleFunction = function(feature, resolution) {
    var properties2 = feature.getProperties();
    var layers2 = layersBySourceLayer[properties2.layer];
    if (!layers2) {
      return;
    }
    var zoom = resolutions.indexOf(resolution);
    if (zoom == -1) {
      zoom = getZoomForResolution(resolution, resolutions);
    }
    var type2 = types[feature.getGeometry().getType()];
    var f = {
      properties: properties2,
      type: type2
    };
    var featureState = olLayer.get("mapbox-featurestate")[feature.getId()];
    var stylesLength = -1;
    var featureBelongsToLayer;
    for (var i3 = 0, ii2 = layers2.length; i3 < ii2; ++i3) {
      var layerData = layers2[i3];
      var layer2 = layerData.layer;
      var layerId2 = layer2.id;
      var layout = layer2.layout || emptyObj$1;
      var paint = layer2.paint || emptyObj$1;
      if (layout.visibility === "none" || "minzoom" in layer2 && zoom < layer2.minzoom || "maxzoom" in layer2 && zoom >= layer2.maxzoom) {
        continue;
      }
      var filter2 = layer2.filter;
      if (!filter2 || evaluateFilter(layerId2, filter2, f, zoom, filterCache)) {
        featureBelongsToLayer = layer2;
        var color2 = void 0, opacity = void 0, fill = void 0, stroke = void 0, strokeColor = void 0, style2 = void 0;
        var index = layerData.index;
        if (type2 == 3 && (layer2.type == "fill" || layer2.type == "fill-extrusion")) {
          opacity = getValue(layer2, "paint", layer2.type + "-opacity", zoom, f, functionCache, featureState);
          if (layer2.type + "-pattern" in paint) {
            var fillIcon = getValue(layer2, "paint", layer2.type + "-pattern", zoom, f, functionCache, featureState);
            if (fillIcon) {
              var icon = typeof fillIcon === "string" ? fromTemplate(fillIcon, properties2) : fillIcon.toString();
              if (spriteImage && spriteData && spriteData[icon]) {
                ++stylesLength;
                style2 = styles[stylesLength];
                if (!style2 || !style2.getFill() || style2.getStroke() || style2.getText()) {
                  style2 = new Style_default({ fill: new Fill_default() });
                  styles[stylesLength] = style2;
                }
                fill = style2.getFill();
                style2.setZIndex(index);
                var icon_cache_key = icon + "." + opacity;
                var pattern = patternCache[icon_cache_key];
                if (!pattern) {
                  var spriteImageData = spriteData[icon];
                  var canvas = createCanvas(spriteImageData.width, spriteImageData.height);
                  var ctx = canvas.getContext("2d");
                  ctx.globalAlpha = opacity;
                  ctx.drawImage(spriteImage, spriteImageData.x, spriteImageData.y, spriteImageData.width, spriteImageData.height, 0, 0, spriteImageData.width, spriteImageData.height);
                  pattern = ctx.createPattern(canvas, "repeat");
                  patternCache[icon_cache_key] = pattern;
                }
                fill.setColor(pattern);
              }
            }
          } else {
            color2 = colorWithOpacity(getValue(layer2, "paint", layer2.type + "-color", zoom, f, functionCache, featureState), opacity);
            if (layer2.type + "-outline-color" in paint) {
              strokeColor = colorWithOpacity(getValue(layer2, "paint", layer2.type + "-outline-color", zoom, f, functionCache, featureState), opacity);
            }
            if (!strokeColor) {
              strokeColor = color2;
            }
            if (color2 || strokeColor) {
              ++stylesLength;
              style2 = styles[stylesLength];
              if (!style2 || color2 && !style2.getFill() || !color2 && style2.getFill() || strokeColor && !style2.getStroke() || !strokeColor && style2.getStroke() || style2.getText()) {
                style2 = new Style_default({
                  fill: color2 ? new Fill_default() : void 0,
                  stroke: strokeColor ? new Stroke_default() : void 0
                });
                styles[stylesLength] = style2;
              }
              if (color2) {
                fill = style2.getFill();
                fill.setColor(color2);
              }
              if (strokeColor) {
                stroke = style2.getStroke();
                stroke.setColor(strokeColor);
                stroke.setWidth(0.5);
              }
              style2.setZIndex(index);
            }
          }
        }
        if (type2 != 1 && layer2.type == "line") {
          color2 = !("line-pattern" in paint) && "line-color" in paint ? colorWithOpacity(getValue(layer2, "paint", "line-color", zoom, f, functionCache, featureState), getValue(layer2, "paint", "line-opacity", zoom, f, functionCache, featureState)) : void 0;
          var width = getValue(layer2, "paint", "line-width", zoom, f, functionCache, featureState);
          if (color2 && width > 0) {
            ++stylesLength;
            style2 = styles[stylesLength];
            if (!style2 || !style2.getStroke() || style2.getFill() || style2.getText()) {
              style2 = new Style_default({ stroke: new Stroke_default() });
              styles[stylesLength] = style2;
            }
            stroke = style2.getStroke();
            stroke.setLineCap(getValue(layer2, "layout", "line-cap", zoom, f, functionCache, featureState));
            stroke.setLineJoin(getValue(layer2, "layout", "line-join", zoom, f, functionCache, featureState));
            stroke.setMiterLimit(getValue(layer2, "layout", "line-miter-limit", zoom, f, functionCache, featureState));
            stroke.setColor(color2);
            stroke.setWidth(width);
            stroke.setLineDash(paint["line-dasharray"] ? getValue(layer2, "paint", "line-dasharray", zoom, f, functionCache, featureState).map(function(x) {
              return x * width;
            }) : null);
            style2.setZIndex(index);
          }
        }
        var hasImage = false;
        var text = null;
        var placementAngle = 0;
        var icon$1 = void 0, iconImg = void 0, skipLabel = void 0;
        if ((type2 == 1 || type2 == 2) && "icon-image" in layout) {
          var iconImage = getValue(layer2, "layout", "icon-image", zoom, f, functionCache, featureState);
          if (iconImage) {
            icon$1 = typeof iconImage === "string" ? fromTemplate(iconImage, properties2) : iconImage.toString();
            var styleGeom = void 0;
            if (spriteImage && spriteData && spriteData[icon$1]) {
              var iconRotationAlignment = getValue(layer2, "layout", "icon-rotation-alignment", zoom, f, functionCache, featureState);
              if (type2 == 2) {
                var geom = feature.getGeometry();
                if (geom.getFlatMidpoint || geom.getFlatMidpoints) {
                  var extent = geom.getExtent();
                  var size = Math.sqrt(Math.max(Math.pow((extent[2] - extent[0]) / resolution, 2), Math.pow((extent[3] - extent[1]) / resolution, 2)));
                  if (size > 150) {
                    var midpoint = geom.getType() === "MultiLineString" ? geom.getFlatMidpoints() : geom.getFlatMidpoint();
                    if (!renderFeature2) {
                      renderFeatureCoordinates = [
                        NaN,
                        NaN
                      ];
                      renderFeature2 = new Feature_default3("Point", renderFeatureCoordinates, [], {}, null);
                    }
                    styleGeom = renderFeature2;
                    renderFeatureCoordinates[0] = midpoint[0];
                    renderFeatureCoordinates[1] = midpoint[1];
                    var placement = getValue(layer2, "layout", "symbol-placement", zoom, f, functionCache, featureState);
                    if (placement === "line" && iconRotationAlignment === "map") {
                      var stride = geom.getStride();
                      var coordinates2 = geom.getFlatCoordinates();
                      for (var i$1 = 0, ii$1 = coordinates2.length - stride; i$1 < ii$1; i$1 += stride) {
                        var x1 = coordinates2[i$1];
                        var y1 = coordinates2[i$1 + 1];
                        var x2 = coordinates2[i$1 + stride];
                        var y2 = coordinates2[i$1 + stride + 1];
                        var minX = Math.min(x1, x2);
                        var minY = Math.min(y1, y2);
                        var maxX = Math.max(x1, x2);
                        var maxY = Math.max(y1, y2);
                        if (midpoint[0] >= minX && midpoint[0] <= maxX && midpoint[1] >= minY && midpoint[1] <= maxY) {
                          placementAngle = Math.atan2(y1 - y2, x2 - x1);
                          break;
                        }
                      }
                    }
                  }
                }
              }
              if (type2 !== 2 || styleGeom) {
                var iconSize = getValue(layer2, "layout", "icon-size", zoom, f, functionCache, featureState);
                var iconColor = paint["icon-color"] !== void 0 ? getValue(layer2, "paint", "icon-color", zoom, f, functionCache, featureState) : null;
                if (!iconColor || iconColor.a !== 0) {
                  var icon_cache_key$1 = icon$1 + "." + iconSize;
                  if (iconColor !== null) {
                    icon_cache_key$1 += "." + iconColor;
                  }
                  iconImg = iconImageCache[icon_cache_key$1];
                  if (!iconImg) {
                    var spriteImageData$1 = spriteData[icon$1];
                    var declutterMode = getIconDeclutterMode(layer2, zoom, f, functionCache);
                    iconImg = new Icon_default({
                      color: iconColor ? [
                        iconColor.r * 255,
                        iconColor.g * 255,
                        iconColor.b * 255,
                        iconColor.a
                      ] : void 0,
                      img: spriteImage,
                      imgSize: spriteImgSize,
                      size: [
                        spriteImageData$1.width,
                        spriteImageData$1.height
                      ],
                      offset: [
                        spriteImageData$1.x,
                        spriteImageData$1.y
                      ],
                      rotateWithView: iconRotationAlignment === "map",
                      scale: iconSize / spriteImageData$1.pixelRatio,
                      displacement: "icon-offset" in layout ? getValue(layer2, "layout", "icon-offset", zoom, f, functionCache, featureState).map(function(v) {
                        return -v * spriteImageData$1.pixelRatio;
                      }) : void 0,
                      declutterMode
                    });
                    iconImageCache[icon_cache_key$1] = iconImg;
                  }
                }
                if (iconImg) {
                  ++stylesLength;
                  style2 = styles[stylesLength];
                  if (!style2 || !style2.getImage() || style2.getFill() || style2.getStroke()) {
                    style2 = new Style_default();
                    styles[stylesLength] = style2;
                  }
                  style2.setGeometry(styleGeom);
                  iconImg.setRotation(placementAngle + deg2rad(getValue(layer2, "layout", "icon-rotate", zoom, f, functionCache, featureState)));
                  iconImg.setOpacity(getValue(layer2, "paint", "icon-opacity", zoom, f, functionCache, featureState));
                  iconImg.setAnchor(anchor[getValue(layer2, "layout", "icon-anchor", zoom, f, functionCache, featureState)]);
                  style2.setImage(iconImg);
                  text = style2.getText();
                  style2.setText(void 0);
                  style2.setZIndex(index);
                  hasImage = true;
                  skipLabel = false;
                }
              } else {
                skipLabel = true;
              }
            }
          }
        }
        if (type2 == 1 && layer2.type === "circle") {
          ++stylesLength;
          style2 = styles[stylesLength];
          if (!style2 || !style2.getImage() || style2.getFill() || style2.getStroke()) {
            style2 = new Style_default();
            styles[stylesLength] = style2;
          }
          var circleRadius = "circle-radius" in paint ? getValue(layer2, "paint", "circle-radius", zoom, f, functionCache, featureState) : 5;
          var circleStrokeColor = colorWithOpacity(getValue(layer2, "paint", "circle-stroke-color", zoom, f, functionCache, featureState), getValue(layer2, "paint", "circle-stroke-opacity", zoom, f, functionCache, featureState));
          var circleColor = colorWithOpacity(getValue(layer2, "paint", "circle-color", zoom, f, functionCache, featureState), getValue(layer2, "paint", "circle-opacity", zoom, f, functionCache, featureState));
          var circleStrokeWidth = getValue(layer2, "paint", "circle-stroke-width", zoom, f, functionCache, featureState);
          var cache_key = circleRadius + "." + circleStrokeColor + "." + circleColor + "." + circleStrokeWidth;
          iconImg = iconImageCache[cache_key];
          if (!iconImg) {
            iconImg = new Circle_default({
              radius: circleRadius,
              stroke: circleStrokeColor && circleStrokeWidth > 0 ? new Stroke_default({
                width: circleStrokeWidth,
                color: circleStrokeColor
              }) : void 0,
              fill: circleColor ? new Fill_default({ color: circleColor }) : void 0,
              declutterMode: "none"
            });
            iconImageCache[cache_key] = iconImg;
          }
          style2.setImage(iconImg);
          text = style2.getText();
          style2.setText(void 0);
          style2.setGeometry(void 0);
          style2.setZIndex(index);
          hasImage = true;
        }
        var label = void 0, font = void 0, textLineHeight = void 0, textSize = void 0, letterSpacing = void 0, maxTextWidth = void 0;
        if ("text-field" in layout) {
          textSize = Math.round(getValue(layer2, "layout", "text-size", zoom, f, functionCache, featureState));
          var fontArray = getValue(layer2, "layout", "text-font", zoom, f, functionCache, featureState);
          textLineHeight = getValue(layer2, "layout", "text-line-height", zoom, f, functionCache, featureState);
          font = mapboxToCssFont(getFonts ? getFonts(fontArray) : fontArray, textSize, textLineHeight);
          if (!font.includes("sans-serif")) {
            font += ",sans-serif";
          }
          letterSpacing = getValue(layer2, "layout", "text-letter-spacing", zoom, f, functionCache, featureState);
          maxTextWidth = getValue(layer2, "layout", "text-max-width", zoom, f, functionCache, featureState);
          var textField = getValue(layer2, "layout", "text-field", zoom, f, functionCache, featureState);
          if (typeof textField === "object" && textField.sections) {
            if (textField.sections.length === 1) {
              label = textField.toString();
            } else {
              label = textField.sections.reduce(function(acc, chunk2, i4) {
                var fonts = chunk2.fontStack ? chunk2.fontStack.split(",") : fontArray;
                var chunkFont = mapboxToCssFont(getFonts ? getFonts(fonts) : fonts, textSize * (chunk2.scale || 1), textLineHeight);
                var text2 = chunk2.text;
                if (text2 === "\n") {
                  acc.push("\n", "");
                  return acc;
                }
                if (type2 == 2) {
                  acc.push(applyLetterSpacing(text2, letterSpacing), chunkFont);
                  return;
                }
                text2 = wrapText(text2, chunkFont, maxTextWidth, letterSpacing).split("\n");
                for (var i$12 = 0, ii3 = text2.length; i$12 < ii3; ++i$12) {
                  if (i$12 > 0) {
                    acc.push("\n", "");
                  }
                  acc.push(text2[i$12], chunkFont);
                }
                return acc;
              }, []);
            }
          } else {
            label = fromTemplate(textField, properties2).trim();
          }
          opacity = getValue(layer2, "paint", "text-opacity", zoom, f, functionCache, featureState);
        }
        if (label && opacity && !skipLabel) {
          if (!hasImage) {
            ++stylesLength;
            style2 = styles[stylesLength];
            if (!style2 || !style2.getText() || style2.getFill() || style2.getStroke()) {
              style2 = new Style_default();
              styles[stylesLength] = style2;
            }
            style2.setImage(void 0);
            style2.setGeometry(void 0);
          }
          if (!style2.getText()) {
            style2.setText(text || new Text_default({
              padding: [
                2,
                2,
                2,
                2
              ]
            }));
          }
          text = style2.getText();
          var textTransform = layout["text-transform"];
          if (textTransform == "uppercase") {
            label = Array.isArray(label) ? label.map(function(t, i4) {
              return i4 % 2 ? t : t.toUpperCase();
            }) : label.toUpperCase();
          } else if (textTransform == "lowercase") {
            label = Array.isArray(label) ? label.map(function(t, i4) {
              return i4 % 2 ? t : t.toLowerCase();
            }) : label.toLowerCase();
          }
          var wrappedLabel = Array.isArray(label) ? label : type2 == 2 ? applyLetterSpacing(label, letterSpacing) : wrapText(label, font, maxTextWidth, letterSpacing);
          text.setText(wrappedLabel);
          text.setFont(font);
          text.setRotation(deg2rad(getValue(layer2, "layout", "text-rotate", zoom, f, functionCache, featureState)));
          var textAnchor = getValue(layer2, "layout", "text-anchor", zoom, f, functionCache, featureState);
          var placement$1 = hasImage || type2 == 1 ? "point" : getValue(layer2, "layout", "symbol-placement", zoom, f, functionCache, featureState);
          text.setPlacement(placement$1);
          text.setOverflow(placement$1 === "point");
          var textHaloWidth = getValue(layer2, "paint", "text-halo-width", zoom, f, functionCache, featureState);
          var textOffset = getValue(layer2, "layout", "text-offset", zoom, f, functionCache, featureState);
          var textTranslate = getValue(layer2, "paint", "text-translate", zoom, f, functionCache, featureState);
          var vOffset = 0;
          var hOffset = 0;
          if (placement$1 == "point") {
            var textAlign = "center";
            if (textAnchor.indexOf("left") !== -1) {
              textAlign = "left";
              hOffset = textHaloWidth;
            } else if (textAnchor.indexOf("right") !== -1) {
              textAlign = "right";
              hOffset = -textHaloWidth;
            }
            text.setTextAlign(textAlign);
            var textRotationAlignment = getValue(layer2, "layout", "text-rotation-alignment", zoom, f, functionCache, featureState);
            text.setRotateWithView(textRotationAlignment == "map");
          } else {
            text.setMaxAngle(deg2rad(getValue(layer2, "layout", "text-max-angle", zoom, f, functionCache, featureState)) * label.length / wrappedLabel.length);
            text.setTextAlign();
            text.setRotateWithView(false);
          }
          var textBaseline = "middle";
          if (textAnchor.indexOf("bottom") == 0) {
            textBaseline = "bottom";
            vOffset = -textHaloWidth - 0.5 * (textLineHeight - 1) * textSize;
          } else if (textAnchor.indexOf("top") == 0) {
            textBaseline = "top";
            vOffset = textHaloWidth + 0.5 * (textLineHeight - 1) * textSize;
          }
          text.setTextBaseline(textBaseline);
          text.setOffsetX(textOffset[0] * textSize + hOffset + textTranslate[0]);
          text.setOffsetY(textOffset[1] * textSize + vOffset + textTranslate[1]);
          textColor.setColor(colorWithOpacity(getValue(layer2, "paint", "text-color", zoom, f, functionCache, featureState), opacity));
          text.setFill(textColor);
          var haloColor = colorWithOpacity(getValue(layer2, "paint", "text-halo-color", zoom, f, functionCache, featureState), opacity);
          if (haloColor) {
            textHalo.setColor(haloColor);
            textHaloWidth *= 2;
            var halfTextSize = 0.5 * textSize;
            textHalo.setWidth(textHaloWidth <= halfTextSize ? textHaloWidth : halfTextSize);
            text.setStroke(textHalo);
          } else {
            text.setStroke(void 0);
          }
          var textPadding = getValue(layer2, "layout", "text-padding", zoom, f, functionCache, featureState);
          var padding = text.getPadding();
          if (textPadding !== padding[0]) {
            padding[0] = textPadding;
            padding[1] = textPadding;
            padding[2] = textPadding;
            padding[3] = textPadding;
          }
          style2.setZIndex(index);
        }
      }
    }
    if (stylesLength > -1) {
      styles.length = stylesLength + 1;
      if (recordLayer) {
        if (typeof feature.set === "function") {
          feature.set("mapbox-layer", featureBelongsToLayer);
        } else {
          feature.getProperties()["mapbox-layer"] = featureBelongsToLayer;
        }
      }
      return styles;
    }
  };
  olLayer.setStyle(styleFunction);
  olLayer.set("mapbox-source", mapboxSource);
  olLayer.set("mapbox-layers", mapboxLayers);
  olLayer.set("mapbox-featurestate", {});
  return styleFunction;
}
var geoJsonFormat = new GeoJSON_default();

// node_modules/ol/webgl.js
var ARRAY_BUFFER = 34962;
var ELEMENT_ARRAY_BUFFER = 34963;
var STREAM_DRAW = 35040;
var STATIC_DRAW = 35044;
var DYNAMIC_DRAW = 35048;
var UNSIGNED_BYTE = 5121;
var UNSIGNED_SHORT = 5123;
var UNSIGNED_INT = 5125;
var FLOAT = 5126;
var CONTEXT_IDS = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"];
function getContext2(canvas, opt_attributes) {
  var attributes = assign({
    preserveDrawingBuffer: true,
    antialias: SAFARI_BUG_237906 ? false : true
    // https://bugs.webkit.org/show_bug.cgi?id=237906
  }, opt_attributes);
  var ii = CONTEXT_IDS.length;
  for (var i2 = 0; i2 < ii; ++i2) {
    try {
      var context2 = canvas.getContext(CONTEXT_IDS[i2], attributes);
      if (context2) {
        return (
          /** @type {!WebGLRenderingContext} */
          context2
        );
      }
    } catch (e) {
    }
  }
  return null;
}

// node_modules/ol/webgl/Buffer.js
var BufferUsage = {
  STATIC_DRAW,
  STREAM_DRAW,
  DYNAMIC_DRAW
};
var WebGLArrayBuffer = (
  /** @class */
  function() {
    function WebGLArrayBuffer2(type, opt_usage) {
      this.array = null;
      this.type = type;
      assert(type === ARRAY_BUFFER || type === ELEMENT_ARRAY_BUFFER, 62);
      this.usage = opt_usage !== void 0 ? opt_usage : BufferUsage.STATIC_DRAW;
    }
    WebGLArrayBuffer2.prototype.ofSize = function(size) {
      this.array = new (getArrayClassForType(this.type))(size);
    };
    WebGLArrayBuffer2.prototype.fromArray = function(array2) {
      var arrayClass = getArrayClassForType(this.type);
      this.array = arrayClass.from ? arrayClass.from(array2) : new arrayClass(array2);
    };
    WebGLArrayBuffer2.prototype.fromArrayBuffer = function(buffer3) {
      this.array = new (getArrayClassForType(this.type))(buffer3);
    };
    WebGLArrayBuffer2.prototype.getType = function() {
      return this.type;
    };
    WebGLArrayBuffer2.prototype.getArray = function() {
      return this.array;
    };
    WebGLArrayBuffer2.prototype.getUsage = function() {
      return this.usage;
    };
    WebGLArrayBuffer2.prototype.getSize = function() {
      return this.array ? this.array.length : 0;
    };
    return WebGLArrayBuffer2;
  }()
);
function getArrayClassForType(type) {
  switch (type) {
    case ARRAY_BUFFER:
      return Float32Array;
    case ELEMENT_ARRAY_BUFFER:
      return Uint32Array;
    default:
      return Float32Array;
  }
}
var Buffer_default = WebGLArrayBuffer;

// node_modules/ol/webgl/ContextEventType.js
var ContextEventType_default = {
  LOST: "webglcontextlost",
  RESTORED: "webglcontextrestored"
};

// node_modules/ol/webgl/PostProcessingPass.js
var DEFAULT_VERTEX_SHADER = "\n  precision mediump float;\n  \n  attribute vec2 a_position;\n  varying vec2 v_texCoord;\n  varying vec2 v_screenCoord;\n  \n  uniform vec2 u_screenSize;\n   \n  void main() {\n    v_texCoord = a_position * 0.5 + 0.5;\n    v_screenCoord = v_texCoord * u_screenSize;\n    gl_Position = vec4(a_position, 0.0, 1.0);\n  }\n";
var DEFAULT_FRAGMENT_SHADER = "\n  precision mediump float;\n   \n  uniform sampler2D u_image;\n  uniform float u_opacity;\n   \n  varying vec2 v_texCoord;\n   \n  void main() {\n    gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n  }\n";
var WebGLPostProcessingPass = (
  /** @class */
  function() {
    function WebGLPostProcessingPass2(options) {
      this.gl_ = options.webGlContext;
      var gl = this.gl_;
      this.scaleRatio_ = options.scaleRatio || 1;
      this.renderTargetTexture_ = gl.createTexture();
      this.renderTargetTextureSize_ = null;
      this.frameBuffer_ = gl.createFramebuffer();
      var vertexShader = gl.createShader(gl.VERTEX_SHADER);
      gl.shaderSource(vertexShader, options.vertexShader || DEFAULT_VERTEX_SHADER);
      gl.compileShader(vertexShader);
      var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
      gl.shaderSource(fragmentShader, options.fragmentShader || DEFAULT_FRAGMENT_SHADER);
      gl.compileShader(fragmentShader);
      this.renderTargetProgram_ = gl.createProgram();
      gl.attachShader(this.renderTargetProgram_, vertexShader);
      gl.attachShader(this.renderTargetProgram_, fragmentShader);
      gl.linkProgram(this.renderTargetProgram_);
      this.renderTargetVerticesBuffer_ = gl.createBuffer();
      var verticesArray = [-1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1];
      gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
      gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesArray), gl.STATIC_DRAW);
      this.renderTargetAttribLocation_ = gl.getAttribLocation(this.renderTargetProgram_, "a_position");
      this.renderTargetUniformLocation_ = gl.getUniformLocation(this.renderTargetProgram_, "u_screenSize");
      this.renderTargetOpacityLocation_ = gl.getUniformLocation(this.renderTargetProgram_, "u_opacity");
      this.renderTargetTextureLocation_ = gl.getUniformLocation(this.renderTargetProgram_, "u_image");
      this.uniforms_ = [];
      options.uniforms && Object.keys(options.uniforms).forEach((function(name) {
        this.uniforms_.push({
          value: options.uniforms[name],
          location: gl.getUniformLocation(this.renderTargetProgram_, name)
        });
      }).bind(this));
    }
    WebGLPostProcessingPass2.prototype.getGL = function() {
      return this.gl_;
    };
    WebGLPostProcessingPass2.prototype.init = function(frameState) {
      var gl = this.getGL();
      var textureSize = [
        gl.drawingBufferWidth * this.scaleRatio_,
        gl.drawingBufferHeight * this.scaleRatio_
      ];
      gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());
      gl.viewport(0, 0, textureSize[0], textureSize[1]);
      if (!this.renderTargetTextureSize_ || this.renderTargetTextureSize_[0] !== textureSize[0] || this.renderTargetTextureSize_[1] !== textureSize[1]) {
        this.renderTargetTextureSize_ = textureSize;
        var level = 0;
        var internalFormat = gl.RGBA;
        var border = 0;
        var format = gl.RGBA;
        var type = gl.UNSIGNED_BYTE;
        var data = null;
        gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
        gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, textureSize[0], textureSize[1], border, format, type, data);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.renderTargetTexture_, 0);
      }
    };
    WebGLPostProcessingPass2.prototype.apply = function(frameState, nextPass, preCompose, postCompose) {
      var gl = this.getGL();
      var size = frameState.size;
      gl.bindFramebuffer(gl.FRAMEBUFFER, nextPass ? nextPass.getFrameBuffer() : null);
      gl.activeTexture(gl.TEXTURE0);
      gl.bindTexture(gl.TEXTURE_2D, this.renderTargetTexture_);
      if (!nextPass) {
        var canvasId = getUid(gl.canvas);
        if (!frameState.renderTargets[canvasId]) {
          var attributes = gl.getContextAttributes();
          if (attributes && attributes.preserveDrawingBuffer) {
            gl.clearColor(0, 0, 0, 0);
            gl.clear(gl.COLOR_BUFFER_BIT);
          }
          frameState.renderTargets[canvasId] = true;
        }
      }
      gl.enable(gl.BLEND);
      gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
      gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
      gl.bindBuffer(gl.ARRAY_BUFFER, this.renderTargetVerticesBuffer_);
      gl.useProgram(this.renderTargetProgram_);
      gl.enableVertexAttribArray(this.renderTargetAttribLocation_);
      gl.vertexAttribPointer(this.renderTargetAttribLocation_, 2, gl.FLOAT, false, 0, 0);
      gl.uniform2f(this.renderTargetUniformLocation_, size[0], size[1]);
      gl.uniform1i(this.renderTargetTextureLocation_, 0);
      var opacity = frameState.layerStatesArray[frameState.layerIndex].opacity;
      gl.uniform1f(this.renderTargetOpacityLocation_, opacity);
      this.applyUniforms(frameState);
      if (preCompose) {
        preCompose(gl, frameState);
      }
      gl.drawArrays(gl.TRIANGLES, 0, 6);
      if (postCompose) {
        postCompose(gl, frameState);
      }
    };
    WebGLPostProcessingPass2.prototype.getFrameBuffer = function() {
      return this.frameBuffer_;
    };
    WebGLPostProcessingPass2.prototype.applyUniforms = function(frameState) {
      var gl = this.getGL();
      var value;
      var textureSlot = 1;
      this.uniforms_.forEach(function(uniform) {
        value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
        if (value instanceof HTMLCanvasElement || value instanceof ImageData) {
          if (!uniform.texture) {
            uniform.texture = gl.createTexture();
          }
          gl.activeTexture(gl["TEXTURE".concat(textureSlot)]);
          gl.bindTexture(gl.TEXTURE_2D, uniform.texture);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
          if (value instanceof ImageData) {
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, value.width, value.height, 0, gl.UNSIGNED_BYTE, new Uint8Array(value.data));
          } else {
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, value);
          }
          gl.uniform1i(uniform.location, textureSlot++);
        } else if (Array.isArray(value)) {
          switch (value.length) {
            case 2:
              gl.uniform2f(uniform.location, value[0], value[1]);
              return;
            case 3:
              gl.uniform3f(uniform.location, value[0], value[1], value[2]);
              return;
            case 4:
              gl.uniform4f(uniform.location, value[0], value[1], value[2], value[3]);
              return;
            default:
              return;
          }
        } else if (typeof value === "number") {
          gl.uniform1f(uniform.location, value);
        }
      });
    };
    return WebGLPostProcessingPass2;
  }()
);
var PostProcessingPass_default = WebGLPostProcessingPass;

// node_modules/ol/vec/mat4.js
function create2() {
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
}
function fromTransform(mat4, transform3) {
  mat4[0] = transform3[0];
  mat4[1] = transform3[1];
  mat4[4] = transform3[2];
  mat4[5] = transform3[3];
  mat4[12] = transform3[4];
  mat4[13] = transform3[5];
  return mat4;
}

// node_modules/ol/webgl/Helper.js
var __extends93 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var DefaultUniform = {
  PROJECTION_MATRIX: "u_projectionMatrix",
  OFFSET_SCALE_MATRIX: "u_offsetScaleMatrix",
  OFFSET_ROTATION_MATRIX: "u_offsetRotateMatrix",
  TIME: "u_time",
  ZOOM: "u_zoom",
  RESOLUTION: "u_resolution"
};
var AttributeType = {
  UNSIGNED_BYTE,
  UNSIGNED_SHORT,
  UNSIGNED_INT,
  FLOAT
};
var canvasCache = {};
function getSharedCanvasCacheKey(key) {
  return "shared/" + key;
}
var uniqueCanvasCacheKeyCount = 0;
function getUniqueCanvasCacheKey() {
  var key = "unique/" + uniqueCanvasCacheKeyCount;
  uniqueCanvasCacheKeyCount += 1;
  return key;
}
function getCanvas(key) {
  var cacheItem = canvasCache[key];
  if (!cacheItem) {
    var canvas = document.createElement("canvas");
    canvas.style.position = "absolute";
    canvas.style.left = "0";
    cacheItem = { users: 0, canvas };
    canvasCache[key] = cacheItem;
  }
  cacheItem.users += 1;
  return cacheItem.canvas;
}
function releaseCanvas2(key) {
  var cacheItem = canvasCache[key];
  if (!cacheItem) {
    return;
  }
  cacheItem.users -= 1;
  if (cacheItem.users > 0) {
    return;
  }
  var canvas = cacheItem.canvas;
  var gl = getContext2(canvas);
  var extension = gl.getExtension("WEBGL_lose_context");
  if (extension) {
    extension.loseContext();
  }
  delete canvasCache[key];
}
var WebGLHelper = (
  /** @class */
  function(_super) {
    __extends93(WebGLHelper2, _super);
    function WebGLHelper2(opt_options) {
      var _this = _super.call(this) || this;
      var options = opt_options || {};
      _this.boundHandleWebGLContextLost_ = _this.handleWebGLContextLost.bind(_this);
      _this.boundHandleWebGLContextRestored_ = _this.handleWebGLContextRestored.bind(_this);
      _this.canvasCacheKey_ = options.canvasCacheKey ? getSharedCanvasCacheKey(options.canvasCacheKey) : getUniqueCanvasCacheKey();
      _this.canvas_ = getCanvas(_this.canvasCacheKey_);
      _this.gl_ = getContext2(_this.canvas_);
      _this.bufferCache_ = {};
      _this.extensionCache_ = {};
      _this.currentProgram_ = null;
      _this.canvas_.addEventListener(ContextEventType_default.LOST, _this.boundHandleWebGLContextLost_);
      _this.canvas_.addEventListener(ContextEventType_default.RESTORED, _this.boundHandleWebGLContextRestored_);
      _this.offsetRotateMatrix_ = create();
      _this.offsetScaleMatrix_ = create();
      _this.tmpMat4_ = create2();
      _this.uniformLocations_ = {};
      _this.attribLocations_ = {};
      _this.uniforms_ = [];
      if (options.uniforms) {
        _this.setUniforms(options.uniforms);
      }
      var gl = _this.getGL();
      _this.postProcessPasses_ = options.postProcesses ? options.postProcesses.map(function(options2) {
        return new PostProcessingPass_default({
          webGlContext: gl,
          scaleRatio: options2.scaleRatio,
          vertexShader: options2.vertexShader,
          fragmentShader: options2.fragmentShader,
          uniforms: options2.uniforms
        });
      }) : [new PostProcessingPass_default({ webGlContext: gl })];
      _this.shaderCompileErrors_ = null;
      _this.startTime_ = Date.now();
      return _this;
    }
    WebGLHelper2.prototype.setUniforms = function(uniforms) {
      this.uniforms_ = [];
      for (var name_1 in uniforms) {
        this.uniforms_.push({
          name: name_1,
          value: uniforms[name_1]
        });
      }
      this.uniformLocations_ = {};
    };
    WebGLHelper2.prototype.canvasCacheKeyMatches = function(canvasCacheKey) {
      return this.canvasCacheKey_ === getSharedCanvasCacheKey(canvasCacheKey);
    };
    WebGLHelper2.prototype.getExtension = function(name) {
      if (name in this.extensionCache_) {
        return this.extensionCache_[name];
      }
      var extension = this.gl_.getExtension(name);
      this.extensionCache_[name] = extension;
      return extension;
    };
    WebGLHelper2.prototype.bindBuffer = function(buffer3) {
      var gl = this.getGL();
      var bufferKey = getUid(buffer3);
      var bufferCache = this.bufferCache_[bufferKey];
      if (!bufferCache) {
        var webGlBuffer = gl.createBuffer();
        bufferCache = {
          buffer: buffer3,
          webGlBuffer
        };
        this.bufferCache_[bufferKey] = bufferCache;
      }
      gl.bindBuffer(buffer3.getType(), bufferCache.webGlBuffer);
    };
    WebGLHelper2.prototype.flushBufferData = function(buffer3) {
      var gl = this.getGL();
      this.bindBuffer(buffer3);
      gl.bufferData(buffer3.getType(), buffer3.getArray(), buffer3.getUsage());
    };
    WebGLHelper2.prototype.deleteBuffer = function(buf) {
      var gl = this.getGL();
      var bufferKey = getUid(buf);
      var bufferCacheEntry = this.bufferCache_[bufferKey];
      if (bufferCacheEntry && !gl.isContextLost()) {
        gl.deleteBuffer(bufferCacheEntry.webGlBuffer);
      }
      delete this.bufferCache_[bufferKey];
    };
    WebGLHelper2.prototype.disposeInternal = function() {
      this.canvas_.removeEventListener(ContextEventType_default.LOST, this.boundHandleWebGLContextLost_);
      this.canvas_.removeEventListener(ContextEventType_default.RESTORED, this.boundHandleWebGLContextRestored_);
      releaseCanvas2(this.canvasCacheKey_);
      delete this.gl_;
      delete this.canvas_;
    };
    WebGLHelper2.prototype.prepareDraw = function(frameState, opt_disableAlphaBlend) {
      var gl = this.getGL();
      var canvas = this.getCanvas();
      var size = frameState.size;
      var pixelRatio = frameState.pixelRatio;
      canvas.width = size[0] * pixelRatio;
      canvas.height = size[1] * pixelRatio;
      canvas.style.width = size[0] + "px";
      canvas.style.height = size[1] + "px";
      gl.useProgram(this.currentProgram_);
      for (var i2 = this.postProcessPasses_.length - 1; i2 >= 0; i2--) {
        this.postProcessPasses_[i2].init(frameState);
      }
      gl.bindTexture(gl.TEXTURE_2D, null);
      gl.clearColor(0, 0, 0, 0);
      gl.clear(gl.COLOR_BUFFER_BIT);
      gl.enable(gl.BLEND);
      gl.blendFunc(gl.ONE, opt_disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
      gl.useProgram(this.currentProgram_);
      this.applyFrameState(frameState);
      this.applyUniforms(frameState);
    };
    WebGLHelper2.prototype.prepareDrawToRenderTarget = function(frameState, renderTarget, opt_disableAlphaBlend) {
      var gl = this.getGL();
      var size = renderTarget.getSize();
      gl.bindFramebuffer(gl.FRAMEBUFFER, renderTarget.getFramebuffer());
      gl.viewport(0, 0, size[0], size[1]);
      gl.bindTexture(gl.TEXTURE_2D, renderTarget.getTexture());
      gl.clearColor(0, 0, 0, 0);
      gl.clear(gl.COLOR_BUFFER_BIT);
      gl.enable(gl.BLEND);
      gl.blendFunc(gl.ONE, opt_disableAlphaBlend ? gl.ZERO : gl.ONE_MINUS_SRC_ALPHA);
      gl.useProgram(this.currentProgram_);
      this.applyFrameState(frameState);
      this.applyUniforms(frameState);
    };
    WebGLHelper2.prototype.drawElements = function(start2, end) {
      var gl = this.getGL();
      this.getExtension("OES_element_index_uint");
      var elementType = gl.UNSIGNED_INT;
      var elementSize = 4;
      var numItems = end - start2;
      var offsetInBytes = start2 * elementSize;
      gl.drawElements(gl.TRIANGLES, numItems, elementType, offsetInBytes);
    };
    WebGLHelper2.prototype.finalizeDraw = function(frameState, preCompose, postCompose) {
      for (var i2 = 0, ii = this.postProcessPasses_.length; i2 < ii; i2++) {
        if (i2 === ii - 1) {
          this.postProcessPasses_[i2].apply(frameState, null, preCompose, postCompose);
        } else {
          this.postProcessPasses_[i2].apply(frameState, this.postProcessPasses_[i2 + 1]);
        }
      }
    };
    WebGLHelper2.prototype.getCanvas = function() {
      return this.canvas_;
    };
    WebGLHelper2.prototype.getGL = function() {
      return this.gl_;
    };
    WebGLHelper2.prototype.applyFrameState = function(frameState) {
      var size = frameState.size;
      var rotation = frameState.viewState.rotation;
      var offsetScaleMatrix = reset(this.offsetScaleMatrix_);
      scale2(offsetScaleMatrix, 2 / size[0], 2 / size[1]);
      var offsetRotateMatrix = reset(this.offsetRotateMatrix_);
      if (rotation !== 0) {
        rotate(offsetRotateMatrix, -rotation);
      }
      this.setUniformMatrixValue(DefaultUniform.OFFSET_SCALE_MATRIX, fromTransform(this.tmpMat4_, offsetScaleMatrix));
      this.setUniformMatrixValue(DefaultUniform.OFFSET_ROTATION_MATRIX, fromTransform(this.tmpMat4_, offsetRotateMatrix));
      this.setUniformFloatValue(DefaultUniform.TIME, (Date.now() - this.startTime_) * 1e-3);
      this.setUniformFloatValue(DefaultUniform.ZOOM, frameState.viewState.zoom);
      this.setUniformFloatValue(DefaultUniform.RESOLUTION, frameState.viewState.resolution);
    };
    WebGLHelper2.prototype.applyUniforms = function(frameState) {
      var gl = this.getGL();
      var value;
      var textureSlot = 0;
      this.uniforms_.forEach((function(uniform) {
        value = typeof uniform.value === "function" ? uniform.value(frameState) : uniform.value;
        if (value instanceof HTMLCanvasElement || value instanceof HTMLImageElement || value instanceof ImageData) {
          if (!uniform.texture) {
            uniform.prevValue = void 0;
            uniform.texture = gl.createTexture();
          }
          gl.activeTexture(gl["TEXTURE".concat(textureSlot)]);
          gl.bindTexture(gl.TEXTURE_2D, uniform.texture);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
          gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
          var imageReady = !(value instanceof HTMLImageElement) || /** @type {HTMLImageElement} */
          value.complete;
          if (imageReady && uniform.prevValue !== value) {
            uniform.prevValue = value;
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, value);
          }
          gl.uniform1i(this.getUniformLocation(uniform.name), textureSlot++);
        } else if (Array.isArray(value) && value.length === 6) {
          this.setUniformMatrixValue(uniform.name, fromTransform(this.tmpMat4_, value));
        } else if (Array.isArray(value) && value.length <= 4) {
          switch (value.length) {
            case 2:
              gl.uniform2f(this.getUniformLocation(uniform.name), value[0], value[1]);
              return;
            case 3:
              gl.uniform3f(this.getUniformLocation(uniform.name), value[0], value[1], value[2]);
              return;
            case 4:
              gl.uniform4f(this.getUniformLocation(uniform.name), value[0], value[1], value[2], value[3]);
              return;
            default:
              return;
          }
        } else if (typeof value === "number") {
          gl.uniform1f(this.getUniformLocation(uniform.name), value);
        }
      }).bind(this));
    };
    WebGLHelper2.prototype.useProgram = function(program) {
      if (program == this.currentProgram_) {
        return false;
      } else {
        var gl = this.getGL();
        gl.useProgram(program);
        this.currentProgram_ = program;
        this.uniformLocations_ = {};
        this.attribLocations_ = {};
        return true;
      }
    };
    WebGLHelper2.prototype.compileShader = function(source, type) {
      var gl = this.getGL();
      var shader = gl.createShader(type);
      gl.shaderSource(shader, source);
      gl.compileShader(shader);
      return shader;
    };
    WebGLHelper2.prototype.getProgram = function(fragmentShaderSource, vertexShaderSource) {
      var gl = this.getGL();
      var fragmentShader = this.compileShader(fragmentShaderSource, gl.FRAGMENT_SHADER);
      var vertexShader = this.compileShader(vertexShaderSource, gl.VERTEX_SHADER);
      var program = gl.createProgram();
      gl.attachShader(program, fragmentShader);
      gl.attachShader(program, vertexShader);
      gl.linkProgram(program);
      if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
        var message = "Fragment shader compliation failed: ".concat(gl.getShaderInfoLog(fragmentShader));
        throw new Error(message);
      }
      gl.deleteShader(fragmentShader);
      if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
        var message = "Vertex shader compilation failed: ".concat(gl.getShaderInfoLog(vertexShader));
        throw new Error(message);
      }
      gl.deleteShader(vertexShader);
      if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
        var message = "GL program linking failed: ".concat(gl.getShaderInfoLog(vertexShader));
        throw new Error(message);
      }
      return program;
    };
    WebGLHelper2.prototype.getUniformLocation = function(name) {
      if (this.uniformLocations_[name] === void 0) {
        this.uniformLocations_[name] = this.getGL().getUniformLocation(this.currentProgram_, name);
      }
      return this.uniformLocations_[name];
    };
    WebGLHelper2.prototype.getAttributeLocation = function(name) {
      if (this.attribLocations_[name] === void 0) {
        this.attribLocations_[name] = this.getGL().getAttribLocation(this.currentProgram_, name);
      }
      return this.attribLocations_[name];
    };
    WebGLHelper2.prototype.makeProjectionTransform = function(frameState, transform3) {
      var size = frameState.size;
      var rotation = frameState.viewState.rotation;
      var resolution = frameState.viewState.resolution;
      var center = frameState.viewState.center;
      reset(transform3);
      compose2(transform3, 0, 0, 2 / (resolution * size[0]), 2 / (resolution * size[1]), -rotation, -center[0], -center[1]);
      return transform3;
    };
    WebGLHelper2.prototype.setUniformFloatValue = function(uniform, value) {
      this.getGL().uniform1f(this.getUniformLocation(uniform), value);
    };
    WebGLHelper2.prototype.setUniformFloatVec4 = function(uniform, value) {
      this.getGL().uniform4fv(this.getUniformLocation(uniform), value);
    };
    WebGLHelper2.prototype.setUniformMatrixValue = function(uniform, value) {
      this.getGL().uniformMatrix4fv(this.getUniformLocation(uniform), false, value);
    };
    WebGLHelper2.prototype.enableAttributeArray_ = function(attribName, size, type, stride, offset2) {
      var location2 = this.getAttributeLocation(attribName);
      if (location2 < 0) {
        return;
      }
      this.getGL().enableVertexAttribArray(location2);
      this.getGL().vertexAttribPointer(location2, size, type, false, stride, offset2);
    };
    WebGLHelper2.prototype.enableAttributes = function(attributes) {
      var stride = computeAttributesStride(attributes);
      var offset2 = 0;
      for (var i2 = 0; i2 < attributes.length; i2++) {
        var attr = attributes[i2];
        this.enableAttributeArray_(attr.name, attr.size, attr.type || FLOAT, stride, offset2);
        offset2 += attr.size * getByteSizeFromType(attr.type);
      }
    };
    WebGLHelper2.prototype.handleWebGLContextLost = function() {
      clear(this.bufferCache_);
      this.currentProgram_ = null;
    };
    WebGLHelper2.prototype.handleWebGLContextRestored = function() {
    };
    WebGLHelper2.prototype.createTexture = function(size, opt_data, opt_texture) {
      var gl = this.getGL();
      var texture = opt_texture || gl.createTexture();
      var level = 0;
      var internalFormat = gl.RGBA;
      var border = 0;
      var format = gl.RGBA;
      var type = gl.UNSIGNED_BYTE;
      gl.bindTexture(gl.TEXTURE_2D, texture);
      if (opt_data) {
        gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, format, type, opt_data);
      } else {
        gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, size[0], size[1], border, format, type, null);
      }
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
      return texture;
    };
    return WebGLHelper2;
  }(Disposable_default)
);
function computeAttributesStride(attributes) {
  var stride = 0;
  for (var i2 = 0; i2 < attributes.length; i2++) {
    var attr = attributes[i2];
    stride += attr.size * getByteSizeFromType(attr.type);
  }
  return stride;
}
function getByteSizeFromType(type) {
  switch (type) {
    case AttributeType.UNSIGNED_BYTE:
      return Uint8Array.BYTES_PER_ELEMENT;
    case AttributeType.UNSIGNED_SHORT:
      return Uint16Array.BYTES_PER_ELEMENT;
    case AttributeType.UNSIGNED_INT:
      return Uint32Array.BYTES_PER_ELEMENT;
    case AttributeType.FLOAT:
    default:
      return Float32Array.BYTES_PER_ELEMENT;
  }
}
var Helper_default = WebGLHelper;

// node_modules/ol/renderer/webgl/Layer.js
var __extends94 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var WebGLWorkerMessageType = {
  GENERATE_BUFFERS: "GENERATE_BUFFERS"
};
var WebGLLayerRenderer = (
  /** @class */
  function(_super) {
    __extends94(WebGLLayerRenderer2, _super);
    function WebGLLayerRenderer2(layer, opt_options) {
      var _this = _super.call(this, layer) || this;
      var options = opt_options || {};
      _this.inversePixelTransform_ = create();
      _this.pixelContext_ = null;
      _this.postProcesses_ = options.postProcesses;
      _this.uniforms_ = options.uniforms;
      _this.helper;
      layer.addChangeListener(Property_default.MAP, _this.removeHelper.bind(_this));
      _this.dispatchPreComposeEvent = _this.dispatchPreComposeEvent.bind(_this);
      _this.dispatchPostComposeEvent = _this.dispatchPostComposeEvent.bind(_this);
      return _this;
    }
    WebGLLayerRenderer2.prototype.dispatchPreComposeEvent = function(context2, frameState) {
      var layer = this.getLayer();
      if (layer.hasListener(EventType_default2.PRECOMPOSE)) {
        var event_1 = new Event_default2(EventType_default2.PRECOMPOSE, void 0, frameState, context2);
        layer.dispatchEvent(event_1);
      }
    };
    WebGLLayerRenderer2.prototype.dispatchPostComposeEvent = function(context2, frameState) {
      var layer = this.getLayer();
      if (layer.hasListener(EventType_default2.POSTCOMPOSE)) {
        var event_2 = new Event_default2(EventType_default2.POSTCOMPOSE, void 0, frameState, context2);
        layer.dispatchEvent(event_2);
      }
    };
    WebGLLayerRenderer2.prototype.reset = function(options) {
      this.uniforms_ = options.uniforms;
      if (this.helper) {
        this.helper.setUniforms(this.uniforms_);
      }
    };
    WebGLLayerRenderer2.prototype.removeHelper = function() {
      if (this.helper) {
        this.helper.dispose();
        delete this.helper;
      }
    };
    WebGLLayerRenderer2.prototype.prepareFrame = function(frameState) {
      if (this.getLayer().getRenderSource()) {
        var incrementGroup = true;
        var groupNumber = -1;
        var className = void 0;
        for (var i2 = 0, ii = frameState.layerStatesArray.length; i2 < ii; i2++) {
          var layer = frameState.layerStatesArray[i2].layer;
          var renderer = layer.getRenderer();
          if (!(renderer instanceof WebGLLayerRenderer2)) {
            incrementGroup = true;
            continue;
          }
          var layerClassName = layer.getClassName();
          if (incrementGroup || layerClassName !== className) {
            groupNumber += 1;
            incrementGroup = false;
          }
          className = layerClassName;
          if (renderer === this) {
            break;
          }
        }
        var canvasCacheKey = "map/" + frameState.mapId + "/group/" + groupNumber;
        if (!this.helper || !this.helper.canvasCacheKeyMatches(canvasCacheKey)) {
          this.removeHelper();
          this.helper = new Helper_default({
            postProcesses: this.postProcesses_,
            uniforms: this.uniforms_,
            canvasCacheKey
          });
          if (className) {
            this.helper.getCanvas().className = className;
          }
          this.afterHelperCreated();
        }
      }
      return this.prepareFrameInternal(frameState);
    };
    WebGLLayerRenderer2.prototype.afterHelperCreated = function() {
    };
    WebGLLayerRenderer2.prototype.prepareFrameInternal = function(frameState) {
      return true;
    };
    WebGLLayerRenderer2.prototype.disposeInternal = function() {
      this.removeHelper();
      _super.prototype.disposeInternal.call(this);
    };
    WebGLLayerRenderer2.prototype.dispatchRenderEvent_ = function(type, context2, frameState) {
      var layer = this.getLayer();
      if (layer.hasListener(type)) {
        compose2(this.inversePixelTransform_, 0, 0, frameState.pixelRatio, -frameState.pixelRatio, 0, 0, -frameState.size[1]);
        var event_3 = new Event_default2(type, this.inversePixelTransform_, frameState, context2);
        layer.dispatchEvent(event_3);
      }
    };
    WebGLLayerRenderer2.prototype.preRender = function(context2, frameState) {
      this.dispatchRenderEvent_(EventType_default2.PRERENDER, context2, frameState);
    };
    WebGLLayerRenderer2.prototype.postRender = function(context2, frameState) {
      this.dispatchRenderEvent_(EventType_default2.POSTRENDER, context2, frameState);
    };
    WebGLLayerRenderer2.prototype.getDataAtPixel = function(pixel, frameState, hitTolerance) {
      var renderPixel = apply([frameState.pixelRatio, 0, 0, frameState.pixelRatio, 0, 0], pixel.slice());
      var gl = this.helper.getGL();
      if (!gl) {
        return null;
      }
      var layer = this.getLayer();
      var layerExtent = layer.getExtent();
      if (layerExtent) {
        var renderCoordinate = apply(frameState.pixelToCoordinateTransform, pixel.slice());
        if (!containsCoordinate(layerExtent, renderCoordinate)) {
          return null;
        }
      }
      var attributes = gl.getContextAttributes();
      if (!attributes || !attributes.preserveDrawingBuffer) {
        return new Uint8Array();
      }
      var x = Math.round(renderPixel[0]);
      var y = Math.round(renderPixel[1]);
      var pixelContext2 = this.pixelContext_;
      if (!pixelContext2) {
        var pixelCanvas = document.createElement("canvas");
        pixelCanvas.width = 1;
        pixelCanvas.height = 1;
        pixelContext2 = pixelCanvas.getContext("2d");
        this.pixelContext_ = pixelContext2;
      }
      pixelContext2.clearRect(0, 0, 1, 1);
      var data;
      try {
        pixelContext2.drawImage(gl.canvas, x, y, 1, 1, 0, 0, 1, 1);
        data = pixelContext2.getImageData(0, 0, 1, 1).data;
      } catch (err) {
        return data;
      }
      if (data[3] === 0) {
        return null;
      }
      return data;
    };
    return WebGLLayerRenderer2;
  }(Layer_default2)
);
function colorEncodeId(id2, opt_array) {
  var array2 = opt_array || [];
  var radix = 256;
  var divide = radix - 1;
  array2[0] = Math.floor(id2 / radix / radix / radix) / divide;
  array2[1] = Math.floor(id2 / radix / radix) % radix / divide;
  array2[2] = Math.floor(id2 / radix) % radix / divide;
  array2[3] = id2 % radix / divide;
  return array2;
}
function colorDecodeId(color2) {
  var id2 = 0;
  var radix = 256;
  var mult = radix - 1;
  id2 += Math.round(color2[0] * radix * radix * radix * mult);
  id2 += Math.round(color2[1] * radix * radix * mult);
  id2 += Math.round(color2[2] * radix * mult);
  id2 += Math.round(color2[3] * mult);
  return id2;
}
var Layer_default4 = WebGLLayerRenderer;

// node_modules/ol/webgl/RenderTarget.js
var tmpArray4 = new Uint8Array(4);
var WebGLRenderTarget = (
  /** @class */
  function() {
    function WebGLRenderTarget2(helper, opt_size) {
      this.helper_ = helper;
      var gl = helper.getGL();
      this.texture_ = gl.createTexture();
      this.framebuffer_ = gl.createFramebuffer();
      this.size_ = opt_size || [1, 1];
      this.data_ = new Uint8Array(0);
      this.dataCacheDirty_ = true;
      this.updateSize_();
    }
    WebGLRenderTarget2.prototype.setSize = function(size) {
      if (equals(size, this.size_)) {
        return;
      }
      this.size_[0] = size[0];
      this.size_[1] = size[1];
      this.updateSize_();
    };
    WebGLRenderTarget2.prototype.getSize = function() {
      return this.size_;
    };
    WebGLRenderTarget2.prototype.clearCachedData = function() {
      this.dataCacheDirty_ = true;
    };
    WebGLRenderTarget2.prototype.readAll = function() {
      if (this.dataCacheDirty_) {
        var size = this.size_;
        var gl = this.helper_.getGL();
        gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer_);
        gl.readPixels(0, 0, size[0], size[1], gl.RGBA, gl.UNSIGNED_BYTE, this.data_);
        this.dataCacheDirty_ = false;
      }
      return this.data_;
    };
    WebGLRenderTarget2.prototype.readPixel = function(x, y) {
      if (x < 0 || y < 0 || x > this.size_[0] || y >= this.size_[1]) {
        tmpArray4[0] = 0;
        tmpArray4[1] = 0;
        tmpArray4[2] = 0;
        tmpArray4[3] = 0;
        return tmpArray4;
      }
      this.readAll();
      var index = Math.floor(x) + (this.size_[1] - Math.floor(y) - 1) * this.size_[0];
      tmpArray4[0] = this.data_[index * 4];
      tmpArray4[1] = this.data_[index * 4 + 1];
      tmpArray4[2] = this.data_[index * 4 + 2];
      tmpArray4[3] = this.data_[index * 4 + 3];
      return tmpArray4;
    };
    WebGLRenderTarget2.prototype.getTexture = function() {
      return this.texture_;
    };
    WebGLRenderTarget2.prototype.getFramebuffer = function() {
      return this.framebuffer_;
    };
    WebGLRenderTarget2.prototype.updateSize_ = function() {
      var size = this.size_;
      var gl = this.helper_.getGL();
      this.texture_ = this.helper_.createTexture(size, null, this.texture_);
      gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer_);
      gl.viewport(0, 0, size[0], size[1]);
      gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture_, 0);
      this.data_ = new Uint8Array(size[0] * size[1] * 4);
    };
    return WebGLRenderTarget2;
  }()
);
var RenderTarget_default = WebGLRenderTarget;

// node_modules/ol/worker/webgl.js
function create3() {
  var source = 'const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";n.indexOf("firefox");-1!==n.indexOf("safari")&&-1==n.indexOf("chrom")&&(n.indexOf("version/15.4")>=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t<d.length;t++)d[t]=e[n+2+t];let g=c?c.vertexPosition:0,x=c?c.indexPosition:0;const h=g/l;return i(t,g,a,u,0),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,1),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,2),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,3),d.length&&t.set(d,g+3),g+=l,s[x++]=h,s[x++]=h+1,s[x++]=h+3,s[x++]=h+1,s[x++]=h+2,s[x++]=h+3,r.vertexPosition=g,r.indexPosition=x,r}const f=self;f.onmessage=n=>{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e<c.length;e+=i)g=s(c,e,d,u,r,g);const x=e({vertexBuffer:d.buffer,indexBuffer:u.buffer,renderInstructions:c.buffer},o);f.postMessage(x,[d.buffer,u.buffer,c.buffer])}};';
  return new Worker(typeof Blob === "undefined" ? "data:application/javascript;base64," + Buffer.from(source, "binary").toString("base64") : URL.createObjectURL(new Blob([source], { type: "application/javascript" })));
}

// node_modules/ol/renderer/webgl/PointsLayer.js
var __extends95 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var WebGLPointsLayerRenderer = (
  /** @class */
  function(_super) {
    __extends95(WebGLPointsLayerRenderer2, _super);
    function WebGLPointsLayerRenderer2(layer, options) {
      var _this = this;
      var uniforms = options.uniforms || {};
      var projectionMatrixTransform = create();
      uniforms[DefaultUniform.PROJECTION_MATRIX] = projectionMatrixTransform;
      _this = _super.call(this, layer, {
        uniforms,
        postProcesses: options.postProcesses
      }) || this;
      _this.ready = false;
      _this.sourceRevision_ = -1;
      _this.verticesBuffer_ = new Buffer_default(ARRAY_BUFFER, DYNAMIC_DRAW);
      _this.hitVerticesBuffer_ = new Buffer_default(ARRAY_BUFFER, DYNAMIC_DRAW);
      _this.indicesBuffer_ = new Buffer_default(ELEMENT_ARRAY_BUFFER, DYNAMIC_DRAW);
      _this.vertexShader_ = options.vertexShader;
      _this.fragmentShader_ = options.fragmentShader;
      _this.program_;
      _this.hitDetectionEnabled_ = options.hitFragmentShader && options.hitVertexShader ? true : false;
      _this.hitVertexShader_ = options.hitVertexShader;
      _this.hitFragmentShader_ = options.hitFragmentShader;
      _this.hitProgram_;
      var customAttributes = options.attributes ? options.attributes.map(function(attribute) {
        return {
          name: "a_" + attribute.name,
          size: 1,
          type: AttributeType.FLOAT
        };
      }) : [];
      _this.attributes = [
        {
          name: "a_position",
          size: 2,
          type: AttributeType.FLOAT
        },
        {
          name: "a_index",
          size: 1,
          type: AttributeType.FLOAT
        }
      ].concat(customAttributes);
      _this.hitDetectionAttributes = [
        {
          name: "a_position",
          size: 2,
          type: AttributeType.FLOAT
        },
        {
          name: "a_index",
          size: 1,
          type: AttributeType.FLOAT
        },
        {
          name: "a_hitColor",
          size: 4,
          type: AttributeType.FLOAT
        },
        {
          name: "a_featureUid",
          size: 1,
          type: AttributeType.FLOAT
        }
      ].concat(customAttributes);
      _this.customAttributes = options.attributes ? options.attributes : [];
      _this.previousExtent_ = createEmpty();
      _this.currentTransform_ = projectionMatrixTransform;
      _this.renderTransform_ = create();
      _this.invertRenderTransform_ = create();
      _this.renderInstructions_ = new Float32Array(0);
      _this.hitRenderInstructions_ = new Float32Array(0);
      _this.hitRenderTarget_;
      _this.generateBuffersRun_ = 0;
      _this.worker_ = create3();
      _this.worker_.addEventListener(
        "message",
        /**
         * @param {*} event Event.
         * @this {WebGLPointsLayerRenderer}
         */
        (function(event) {
          var received = event.data;
          if (received.type === WebGLWorkerMessageType.GENERATE_BUFFERS) {
            var projectionTransform = received.projectionTransform;
            if (received.hitDetection) {
              this.hitVerticesBuffer_.fromArrayBuffer(received.vertexBuffer);
              this.helper.flushBufferData(this.hitVerticesBuffer_);
            } else {
              this.verticesBuffer_.fromArrayBuffer(received.vertexBuffer);
              this.helper.flushBufferData(this.verticesBuffer_);
            }
            this.indicesBuffer_.fromArrayBuffer(received.indexBuffer);
            this.helper.flushBufferData(this.indicesBuffer_);
            this.renderTransform_ = projectionTransform;
            makeInverse(this.invertRenderTransform_, this.renderTransform_);
            if (received.hitDetection) {
              this.hitRenderInstructions_ = new Float32Array(event.data.renderInstructions);
            } else {
              this.renderInstructions_ = new Float32Array(event.data.renderInstructions);
              if (received.generateBuffersRun === this.generateBuffersRun_) {
                this.ready = true;
              }
            }
            this.getLayer().changed();
          }
        }).bind(_this)
      );
      _this.featureCache_ = {};
      _this.featureCount_ = 0;
      var source = _this.getLayer().getSource();
      _this.sourceListenKeys_ = [
        listen(source, VectorEventType_default.ADDFEATURE, _this.handleSourceFeatureAdded_, _this),
        listen(source, VectorEventType_default.CHANGEFEATURE, _this.handleSourceFeatureChanged_, _this),
        listen(source, VectorEventType_default.REMOVEFEATURE, _this.handleSourceFeatureDelete_, _this),
        listen(source, VectorEventType_default.CLEAR, _this.handleSourceFeatureClear_, _this)
      ];
      source.forEachFeature((function(feature) {
        this.featureCache_[getUid(feature)] = {
          feature,
          properties: feature.getProperties(),
          geometry: feature.getGeometry()
        };
        this.featureCount_++;
      }).bind(_this));
      return _this;
    }
    WebGLPointsLayerRenderer2.prototype.afterHelperCreated = function() {
      this.program_ = this.helper.getProgram(this.fragmentShader_, this.vertexShader_);
      if (this.hitDetectionEnabled_) {
        this.hitProgram_ = this.helper.getProgram(this.hitFragmentShader_, this.hitVertexShader_);
        this.hitRenderTarget_ = new RenderTarget_default(this.helper);
      }
    };
    WebGLPointsLayerRenderer2.prototype.handleSourceFeatureAdded_ = function(event) {
      var feature = event.feature;
      this.featureCache_[getUid(feature)] = {
        feature,
        properties: feature.getProperties(),
        geometry: feature.getGeometry()
      };
      this.featureCount_++;
    };
    WebGLPointsLayerRenderer2.prototype.handleSourceFeatureChanged_ = function(event) {
      var feature = event.feature;
      this.featureCache_[getUid(feature)] = {
        feature,
        properties: feature.getProperties(),
        geometry: feature.getGeometry()
      };
    };
    WebGLPointsLayerRenderer2.prototype.handleSourceFeatureDelete_ = function(event) {
      var feature = event.feature;
      delete this.featureCache_[getUid(feature)];
      this.featureCount_--;
    };
    WebGLPointsLayerRenderer2.prototype.handleSourceFeatureClear_ = function() {
      this.featureCache_ = {};
      this.featureCount_ = 0;
    };
    WebGLPointsLayerRenderer2.prototype.renderFrame = function(frameState) {
      var gl = this.helper.getGL();
      this.preRender(gl, frameState);
      var projection = frameState.viewState.projection;
      var layer = this.getLayer();
      var vectorSource = layer.getSource();
      var multiWorld = vectorSource.getWrapX() && projection.canWrapX();
      var projectionExtent = projection.getExtent();
      var extent = frameState.extent;
      var worldWidth = multiWorld ? getWidth(projectionExtent) : null;
      var endWorld = multiWorld ? Math.ceil((extent[2] - projectionExtent[2]) / worldWidth) + 1 : 1;
      var startWorld = multiWorld ? Math.floor((extent[0] - projectionExtent[0]) / worldWidth) : 0;
      var world = startWorld;
      var renderCount = this.indicesBuffer_.getSize();
      do {
        this.helper.makeProjectionTransform(frameState, this.currentTransform_);
        translate(this.currentTransform_, world * worldWidth, 0);
        multiply(this.currentTransform_, this.invertRenderTransform_);
        this.helper.applyUniforms(frameState);
        this.helper.drawElements(0, renderCount);
      } while (++world < endWorld);
      this.helper.finalizeDraw(frameState, this.dispatchPreComposeEvent, this.dispatchPostComposeEvent);
      var canvas = this.helper.getCanvas();
      if (this.hitDetectionEnabled_) {
        this.renderHitDetection(frameState, startWorld, endWorld, worldWidth);
        this.hitRenderTarget_.clearCachedData();
      }
      this.postRender(gl, frameState);
      return canvas;
    };
    WebGLPointsLayerRenderer2.prototype.prepareFrameInternal = function(frameState) {
      var layer = this.getLayer();
      var vectorSource = layer.getSource();
      var viewState = frameState.viewState;
      var viewNotMoving = !frameState.viewHints[ViewHint_default.ANIMATING] && !frameState.viewHints[ViewHint_default.INTERACTING];
      var extentChanged = !equals2(this.previousExtent_, frameState.extent);
      var sourceChanged = this.sourceRevision_ < vectorSource.getRevision();
      if (sourceChanged) {
        this.sourceRevision_ = vectorSource.getRevision();
      }
      if (viewNotMoving && (extentChanged || sourceChanged)) {
        var projection = viewState.projection;
        var resolution = viewState.resolution;
        var renderBuffer = layer instanceof BaseVector_default ? layer.getRenderBuffer() : 0;
        var extent = buffer2(frameState.extent, renderBuffer * resolution);
        vectorSource.loadFeatures(extent, resolution, projection);
        this.rebuildBuffers_(frameState);
        this.previousExtent_ = frameState.extent.slice();
      }
      this.helper.useProgram(this.program_);
      this.helper.prepareDraw(frameState);
      this.helper.bindBuffer(this.verticesBuffer_);
      this.helper.bindBuffer(this.indicesBuffer_);
      this.helper.enableAttributes(this.attributes);
      return true;
    };
    WebGLPointsLayerRenderer2.prototype.rebuildBuffers_ = function(frameState) {
      var projectionTransform = create();
      this.helper.makeProjectionTransform(frameState, projectionTransform);
      var totalInstructionsCount = (2 + this.customAttributes.length) * this.featureCount_;
      if (!this.renderInstructions_ || this.renderInstructions_.length !== totalInstructionsCount) {
        this.renderInstructions_ = new Float32Array(totalInstructionsCount);
      }
      if (this.hitDetectionEnabled_) {
        var totalHitInstructionsCount = (7 + this.customAttributes.length) * this.featureCount_;
        if (!this.hitRenderInstructions_ || this.hitRenderInstructions_.length !== totalHitInstructionsCount) {
          this.hitRenderInstructions_ = new Float32Array(totalHitInstructionsCount);
        }
      }
      var featureCache, geometry2;
      var tmpCoords = [];
      var tmpColor = [];
      var renderIndex = 0;
      var hitIndex = 0;
      var hitColor;
      for (var featureUid in this.featureCache_) {
        featureCache = this.featureCache_[featureUid];
        geometry2 = /** @type {import("../../geom").Point} */
        featureCache.geometry;
        if (!geometry2 || geometry2.getType() !== "Point") {
          continue;
        }
        tmpCoords[0] = geometry2.getFlatCoordinates()[0];
        tmpCoords[1] = geometry2.getFlatCoordinates()[1];
        apply(projectionTransform, tmpCoords);
        hitColor = colorEncodeId(hitIndex + 6, tmpColor);
        this.renderInstructions_[renderIndex++] = tmpCoords[0];
        this.renderInstructions_[renderIndex++] = tmpCoords[1];
        if (this.hitDetectionEnabled_) {
          this.hitRenderInstructions_[hitIndex++] = tmpCoords[0];
          this.hitRenderInstructions_[hitIndex++] = tmpCoords[1];
          this.hitRenderInstructions_[hitIndex++] = hitColor[0];
          this.hitRenderInstructions_[hitIndex++] = hitColor[1];
          this.hitRenderInstructions_[hitIndex++] = hitColor[2];
          this.hitRenderInstructions_[hitIndex++] = hitColor[3];
          this.hitRenderInstructions_[hitIndex++] = Number(featureUid);
        }
        var value = void 0;
        for (var j = 0; j < this.customAttributes.length; j++) {
          value = this.customAttributes[j].callback(featureCache.feature, featureCache.properties);
          this.renderInstructions_[renderIndex++] = value;
          if (this.hitDetectionEnabled_) {
            this.hitRenderInstructions_[hitIndex++] = value;
          }
        }
      }
      var message = {
        type: WebGLWorkerMessageType.GENERATE_BUFFERS,
        renderInstructions: this.renderInstructions_.buffer,
        customAttributesCount: this.customAttributes.length
      };
      message["projectionTransform"] = projectionTransform;
      message["generateBuffersRun"] = ++this.generateBuffersRun_;
      this.ready = false;
      this.worker_.postMessage(message, [this.renderInstructions_.buffer]);
      this.renderInstructions_ = null;
      if (this.hitDetectionEnabled_) {
        var hitMessage = {
          type: WebGLWorkerMessageType.GENERATE_BUFFERS,
          renderInstructions: this.hitRenderInstructions_.buffer,
          customAttributesCount: 5 + this.customAttributes.length
        };
        hitMessage["projectionTransform"] = projectionTransform;
        hitMessage["hitDetection"] = true;
        this.worker_.postMessage(hitMessage, [
          this.hitRenderInstructions_.buffer
        ]);
        this.hitRenderInstructions_ = null;
      }
    };
    WebGLPointsLayerRenderer2.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, hitTolerance, callback, matches) {
      assert(this.hitDetectionEnabled_, 66);
      if (!this.hitRenderInstructions_) {
        return void 0;
      }
      var pixel = apply(frameState.coordinateToPixelTransform, coordinate.slice());
      var data = this.hitRenderTarget_.readPixel(pixel[0] / 2, pixel[1] / 2);
      var color2 = [data[0] / 255, data[1] / 255, data[2] / 255, data[3] / 255];
      var index = colorDecodeId(color2);
      var opacity = this.hitRenderInstructions_[index];
      var uid = Math.floor(opacity).toString();
      var source = this.getLayer().getSource();
      var feature = source.getFeatureByUid(uid);
      if (feature) {
        return callback(feature, this.getLayer(), null);
      }
      return void 0;
    };
    WebGLPointsLayerRenderer2.prototype.renderHitDetection = function(frameState, startWorld, endWorld, worldWidth) {
      if (!this.hitVerticesBuffer_.getSize()) {
        return;
      }
      var world = startWorld;
      this.hitRenderTarget_.setSize([
        Math.floor(frameState.size[0] / 2),
        Math.floor(frameState.size[1] / 2)
      ]);
      this.helper.useProgram(this.hitProgram_);
      this.helper.prepareDrawToRenderTarget(frameState, this.hitRenderTarget_, true);
      this.helper.bindBuffer(this.hitVerticesBuffer_);
      this.helper.bindBuffer(this.indicesBuffer_);
      this.helper.enableAttributes(this.hitDetectionAttributes);
      do {
        this.helper.makeProjectionTransform(frameState, this.currentTransform_);
        translate(this.currentTransform_, world * worldWidth, 0);
        multiply(this.currentTransform_, this.invertRenderTransform_);
        this.helper.applyUniforms(frameState);
        var renderCount = this.indicesBuffer_.getSize();
        this.helper.drawElements(0, renderCount);
      } while (++world < endWorld);
    };
    WebGLPointsLayerRenderer2.prototype.disposeInternal = function() {
      this.worker_.terminate();
      this.layer_ = null;
      this.sourceListenKeys_.forEach(function(key) {
        unlistenByKey(key);
      });
      this.sourceListenKeys_ = null;
      _super.prototype.disposeInternal.call(this);
    };
    return WebGLPointsLayerRenderer2;
  }(Layer_default4)
);
var PointsLayer_default = WebGLPointsLayerRenderer;

// node_modules/ol/layer/Heatmap.js
var __extends96 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Property5 = {
  BLUR: "blur",
  GRADIENT: "gradient",
  RADIUS: "radius"
};
var DEFAULT_GRADIENT = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"];
var Heatmap = (
  /** @class */
  function(_super) {
    __extends96(Heatmap2, _super);
    function Heatmap2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : {};
      var baseOptions = assign({}, options);
      delete baseOptions.gradient;
      delete baseOptions.radius;
      delete baseOptions.blur;
      delete baseOptions.weight;
      _this = _super.call(this, baseOptions) || this;
      _this.gradient_ = null;
      _this.addChangeListener(Property5.GRADIENT, _this.handleGradientChanged_);
      _this.setGradient(options.gradient ? options.gradient : DEFAULT_GRADIENT);
      _this.setBlur(options.blur !== void 0 ? options.blur : 15);
      _this.setRadius(options.radius !== void 0 ? options.radius : 8);
      var weight = options.weight ? options.weight : "weight";
      if (typeof weight === "string") {
        _this.weightFunction_ = function(feature) {
          return feature.get(weight);
        };
      } else {
        _this.weightFunction_ = weight;
      }
      _this.setRenderOrder(null);
      return _this;
    }
    Heatmap2.prototype.getBlur = function() {
      return (
        /** @type {number} */
        this.get(Property5.BLUR)
      );
    };
    Heatmap2.prototype.getGradient = function() {
      return (
        /** @type {Array<string>} */
        this.get(Property5.GRADIENT)
      );
    };
    Heatmap2.prototype.getRadius = function() {
      return (
        /** @type {number} */
        this.get(Property5.RADIUS)
      );
    };
    Heatmap2.prototype.handleGradientChanged_ = function() {
      this.gradient_ = createGradient(this.getGradient());
    };
    Heatmap2.prototype.setBlur = function(blur) {
      this.set(Property5.BLUR, blur);
    };
    Heatmap2.prototype.setGradient = function(colors) {
      this.set(Property5.GRADIENT, colors);
    };
    Heatmap2.prototype.setRadius = function(radius) {
      this.set(Property5.RADIUS, radius);
    };
    Heatmap2.prototype.createRenderer = function() {
      return new PointsLayer_default(this, {
        className: this.getClassName(),
        attributes: [
          {
            name: "weight",
            callback: (function(feature) {
              var weight = this.weightFunction_(feature);
              return weight !== void 0 ? clamp(weight, 0, 1) : 1;
            }).bind(this)
          }
        ],
        vertexShader: "\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_weight = a_weight;\n        }",
        fragmentShader: "\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n        }",
        hitVertexShader: "\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n        attribute vec4 a_hitColor;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_hitColor = a_hitColor;\n          v_weight = a_weight;\n        }",
        hitFragmentShader: "\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          if (alpha < 0.05) {\n            discard;\n          }\n\n          gl_FragColor = v_hitColor;\n        }",
        uniforms: {
          u_size: (function() {
            return (this.get(Property5.RADIUS) + this.get(Property5.BLUR)) * 2;
          }).bind(this),
          u_blurSlope: (function() {
            return this.get(Property5.RADIUS) / Math.max(1, this.get(Property5.BLUR));
          }).bind(this)
        },
        postProcesses: [
          {
            fragmentShader: "\n            precision mediump float;\n\n            uniform sampler2D u_image;\n            uniform sampler2D u_gradientTexture;\n            uniform float u_opacity;\n\n            varying vec2 v_texCoord;\n\n            void main() {\n              vec4 color = texture2D(u_image, v_texCoord);\n              gl_FragColor.a = color.a * u_opacity;\n              gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n              gl_FragColor.rgb *= gl_FragColor.a;\n            }",
            uniforms: {
              u_gradientTexture: (function() {
                return this.gradient_;
              }).bind(this),
              u_opacity: (function() {
                return this.getOpacity();
              }).bind(this)
            }
          }
        ]
      });
    };
    Heatmap2.prototype.renderDeclutter = function() {
    };
    return Heatmap2;
  }(BaseVector_default)
);
function createGradient(colors) {
  var width = 1;
  var height = 256;
  var context2 = createCanvasContext2D(width, height);
  var gradient = context2.createLinearGradient(0, 0, width, height);
  var step = 1 / (colors.length - 1);
  for (var i2 = 0, ii = colors.length; i2 < ii; ++i2) {
    gradient.addColorStop(i2 * step, colors[i2]);
  }
  context2.fillStyle = gradient;
  context2.fillRect(0, 0, width, height);
  return context2.canvas;
}
var Heatmap_default = Heatmap;

// node_modules/ol/proj/proj4.js
function register2(proj42) {
  var projCodes = Object.keys(proj42.defs);
  var len = projCodes.length;
  var i2, j;
  for (i2 = 0; i2 < len; ++i2) {
    var code = projCodes[i2];
    if (!get3(code)) {
      var def = proj42.defs(code);
      var units = def.units;
      if (!units && def.projName === "longlat") {
        units = Units_default.DEGREES;
      }
      addProjection(new Projection_default({
        code,
        axisOrientation: def.axis,
        metersPerUnit: def.to_meter,
        units
      }));
    }
  }
  for (i2 = 0; i2 < len; ++i2) {
    var code1 = projCodes[i2];
    var proj1 = get3(code1);
    for (j = 0; j < len; ++j) {
      var code2 = projCodes[j];
      var proj2 = get3(code2);
      if (!get2(code1, code2)) {
        if (proj42.defs[code1] === proj42.defs[code2]) {
          addEquivalentProjections([proj1, proj2]);
        } else {
          var transform3 = proj42(code1, code2);
          addCoordinateTransforms(proj1, proj2, createSafeCoordinateTransform(proj1, proj2, transform3.forward), createSafeCoordinateTransform(proj2, proj1, transform3.inverse));
        }
      }
    }
  }
}

// node_modules/ol/source/XYZ.js
var __extends97 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var XYZ = (
  /** @class */
  function(_super) {
    __extends97(XYZ2, _super);
    function XYZ2(opt_options) {
      var _this = this;
      var options = opt_options || {};
      var interpolate2 = options.imageSmoothing !== void 0 ? options.imageSmoothing : true;
      if (options.interpolate !== void 0) {
        interpolate2 = options.interpolate;
      }
      var projection = options.projection !== void 0 ? options.projection : "EPSG:3857";
      var tileGrid = options.tileGrid !== void 0 ? options.tileGrid : createXYZ({
        extent: extentFromProjection(projection),
        maxResolution: options.maxResolution,
        maxZoom: options.maxZoom,
        minZoom: options.minZoom,
        tileSize: options.tileSize
      });
      _this = _super.call(this, {
        attributions: options.attributions,
        cacheSize: options.cacheSize,
        crossOrigin: options.crossOrigin,
        interpolate: interpolate2,
        opaque: options.opaque,
        projection,
        reprojectionErrorThreshold: options.reprojectionErrorThreshold,
        tileGrid,
        tileLoadFunction: options.tileLoadFunction,
        tilePixelRatio: options.tilePixelRatio,
        tileUrlFunction: options.tileUrlFunction,
        url: options.url,
        urls: options.urls,
        wrapX: options.wrapX !== void 0 ? options.wrapX : true,
        transition: options.transition,
        attributionsCollapsible: options.attributionsCollapsible,
        zDirection: options.zDirection
      }) || this;
      _this.gutter_ = options.gutter !== void 0 ? options.gutter : 0;
      return _this;
    }
    XYZ2.prototype.getGutter = function() {
      return this.gutter_;
    };
    return XYZ2;
  }(TileImage_default)
);
var XYZ_default = XYZ;

// node_modules/ol/source/OSM.js
var __extends98 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var ATTRIBUTION = '&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';
var OSM = (
  /** @class */
  function(_super) {
    __extends98(OSM2, _super);
    function OSM2(opt_options) {
      var options = opt_options || {};
      var interpolate2 = options.imageSmoothing !== void 0 ? options.imageSmoothing : true;
      if (options.interpolate !== void 0) {
        interpolate2 = options.interpolate;
      }
      var attributions;
      if (options.attributions !== void 0) {
        attributions = options.attributions;
      } else {
        attributions = [ATTRIBUTION];
      }
      var crossOrigin = options.crossOrigin !== void 0 ? options.crossOrigin : "anonymous";
      var url = options.url !== void 0 ? options.url : "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";
      return _super.call(this, {
        attributions,
        attributionsCollapsible: false,
        cacheSize: options.cacheSize,
        crossOrigin,
        interpolate: interpolate2,
        maxZoom: options.maxZoom !== void 0 ? options.maxZoom : 19,
        opaque: options.opaque !== void 0 ? options.opaque : true,
        reprojectionErrorThreshold: options.reprojectionErrorThreshold,
        tileLoadFunction: options.tileLoadFunction,
        transition: options.transition,
        url,
        wrapX: options.wrapX,
        zDirection: options.zDirection
      }) || this;
    }
    return OSM2;
  }(XYZ_default)
);
var OSM_default = OSM;

// node_modules/ol/source/wms.js
var DEFAULT_VERSION = "1.3.0";

// node_modules/ol/uri.js
function appendParams(uri, params) {
  var keyParams = [];
  Object.keys(params).forEach(function(k) {
    if (params[k] !== null && params[k] !== void 0) {
      keyParams.push(k + "=" + encodeURIComponent(params[k]));
    }
  });
  var qs = keyParams.join("&");
  uri = uri.replace(/[?&]$/, "");
  uri = uri.indexOf("?") === -1 ? uri + "?" : uri + "&";
  return uri + qs;
}

// node_modules/ol/source/TileWMS.js
var __extends99 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var TileWMS = (
  /** @class */
  function(_super) {
    __extends99(TileWMS2, _super);
    function TileWMS2(opt_options) {
      var _this = this;
      var options = opt_options ? opt_options : (
        /** @type {Options} */
        {}
      );
      var interpolate2 = options.imageSmoothing !== void 0 ? options.imageSmoothing : true;
      if (options.interpolate !== void 0) {
        interpolate2 = options.interpolate;
      }
      var params = options.params || {};
      var transparent = "TRANSPARENT" in params ? params["TRANSPARENT"] : true;
      _this = _super.call(this, {
        attributions: options.attributions,
        attributionsCollapsible: options.attributionsCollapsible,
        cacheSize: options.cacheSize,
        crossOrigin: options.crossOrigin,
        interpolate: interpolate2,
        opaque: !transparent,
        projection: options.projection,
        reprojectionErrorThreshold: options.reprojectionErrorThreshold,
        tileClass: options.tileClass,
        tileGrid: options.tileGrid,
        tileLoadFunction: options.tileLoadFunction,
        url: options.url,
        urls: options.urls,
        wrapX: options.wrapX !== void 0 ? options.wrapX : true,
        transition: options.transition,
        zDirection: options.zDirection
      }) || this;
      _this.gutter_ = options.gutter !== void 0 ? options.gutter : 0;
      _this.params_ = params;
      _this.v13_ = true;
      _this.serverType_ = options.serverType;
      _this.hidpi_ = options.hidpi !== void 0 ? options.hidpi : true;
      _this.tmpExtent_ = createEmpty();
      _this.updateV13_();
      _this.setKey(_this.getKeyForParams_());
      return _this;
    }
    TileWMS2.prototype.getFeatureInfoUrl = function(coordinate, resolution, projection, params) {
      var projectionObj = get3(projection);
      var sourceProjectionObj = this.getProjection();
      var tileGrid = this.getTileGrid();
      if (!tileGrid) {
        tileGrid = this.getTileGridForProjection(projectionObj);
      }
      var z = tileGrid.getZForResolution(resolution, this.zDirection);
      var tileCoord = tileGrid.getTileCoordForCoordAndZ(coordinate, z);
      if (tileGrid.getResolutions().length <= tileCoord[0]) {
        return void 0;
      }
      var tileResolution = tileGrid.getResolution(tileCoord[0]);
      var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);
      var tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);
      var gutter = this.gutter_;
      if (gutter !== 0) {
        tileSize = buffer(tileSize, gutter, this.tmpSize);
        tileExtent = buffer2(tileExtent, tileResolution * gutter, tileExtent);
      }
      if (sourceProjectionObj && sourceProjectionObj !== projectionObj) {
        tileResolution = calculateSourceResolution(sourceProjectionObj, projectionObj, coordinate, tileResolution);
        tileExtent = transformExtent(tileExtent, projectionObj, sourceProjectionObj);
        coordinate = transform(coordinate, projectionObj, sourceProjectionObj);
      }
      var baseParams = {
        "SERVICE": "WMS",
        "VERSION": DEFAULT_VERSION,
        "REQUEST": "GetFeatureInfo",
        "FORMAT": "image/png",
        "TRANSPARENT": true,
        "QUERY_LAYERS": this.params_["LAYERS"]
      };
      assign(baseParams, this.params_, params);
      var x = Math.floor((coordinate[0] - tileExtent[0]) / tileResolution);
      var y = Math.floor((tileExtent[3] - coordinate[1]) / tileResolution);
      baseParams[this.v13_ ? "I" : "X"] = x;
      baseParams[this.v13_ ? "J" : "Y"] = y;
      return this.getRequestUrl_(tileCoord, tileSize, tileExtent, 1, sourceProjectionObj || projectionObj, baseParams);
    };
    TileWMS2.prototype.getLegendUrl = function(resolution, params) {
      if (this.urls[0] === void 0) {
        return void 0;
      }
      var baseParams = {
        "SERVICE": "WMS",
        "VERSION": DEFAULT_VERSION,
        "REQUEST": "GetLegendGraphic",
        "FORMAT": "image/png"
      };
      if (params === void 0 || params["LAYER"] === void 0) {
        var layers = this.params_.LAYERS;
        var isSingleLayer = !Array.isArray(layers) || layers.length === 1;
        if (!isSingleLayer) {
          return void 0;
        }
        baseParams["LAYER"] = layers;
      }
      if (resolution !== void 0) {
        var mpu = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1;
        var pixelSize = 28e-5;
        baseParams["SCALE"] = resolution * mpu / pixelSize;
      }
      assign(baseParams, params);
      return appendParams(
        /** @type {string} */
        this.urls[0],
        baseParams
      );
    };
    TileWMS2.prototype.getGutter = function() {
      return this.gutter_;
    };
    TileWMS2.prototype.getParams = function() {
      return this.params_;
    };
    TileWMS2.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent, pixelRatio, projection, params) {
      var urls = this.urls;
      if (!urls) {
        return void 0;
      }
      params["WIDTH"] = tileSize[0];
      params["HEIGHT"] = tileSize[1];
      params[this.v13_ ? "CRS" : "SRS"] = projection.getCode();
      if (!("STYLES" in this.params_)) {
        params["STYLES"] = "";
      }
      if (pixelRatio != 1) {
        switch (this.serverType_) {
          case "geoserver":
            var dpi = 90 * pixelRatio + 0.5 | 0;
            if ("FORMAT_OPTIONS" in params) {
              params["FORMAT_OPTIONS"] += ";dpi:" + dpi;
            } else {
              params["FORMAT_OPTIONS"] = "dpi:" + dpi;
            }
            break;
          case "mapserver":
            params["MAP_RESOLUTION"] = 90 * pixelRatio;
            break;
          case "carmentaserver":
          case "qgis":
            params["DPI"] = 90 * pixelRatio;
            break;
          default:
            assert(false, 52);
            break;
        }
      }
      var axisOrientation = projection.getAxisOrientation();
      var bbox = tileExtent;
      if (this.v13_ && axisOrientation.substr(0, 2) == "ne") {
        var tmp = void 0;
        tmp = tileExtent[0];
        bbox[0] = tileExtent[1];
        bbox[1] = tmp;
        tmp = tileExtent[2];
        bbox[2] = tileExtent[3];
        bbox[3] = tmp;
      }
      params["BBOX"] = bbox.join(",");
      var url;
      if (urls.length == 1) {
        url = urls[0];
      } else {
        var index = modulo(hash(tileCoord), urls.length);
        url = urls[index];
      }
      return appendParams(url, params);
    };
    TileWMS2.prototype.getTilePixelRatio = function(pixelRatio) {
      return !this.hidpi_ || this.serverType_ === void 0 ? 1 : pixelRatio;
    };
    TileWMS2.prototype.getKeyForParams_ = function() {
      var i2 = 0;
      var res = [];
      for (var key in this.params_) {
        res[i2++] = key + "-" + this.params_[key];
      }
      return res.join("/");
    };
    TileWMS2.prototype.updateParams = function(params) {
      assign(this.params_, params);
      this.updateV13_();
      this.setKey(this.getKeyForParams_());
    };
    TileWMS2.prototype.updateV13_ = function() {
      var version = this.params_["VERSION"] || DEFAULT_VERSION;
      this.v13_ = compareVersions(version, "1.3") >= 0;
    };
    TileWMS2.prototype.tileUrlFunction = function(tileCoord, pixelRatio, projection) {
      var tileGrid = this.getTileGrid();
      if (!tileGrid) {
        tileGrid = this.getTileGridForProjection(projection);
      }
      if (tileGrid.getResolutions().length <= tileCoord[0]) {
        return void 0;
      }
      if (pixelRatio != 1 && (!this.hidpi_ || this.serverType_ === void 0)) {
        pixelRatio = 1;
      }
      var tileResolution = tileGrid.getResolution(tileCoord[0]);
      var tileExtent = tileGrid.getTileCoordExtent(tileCoord, this.tmpExtent_);
      var tileSize = toSize(tileGrid.getTileSize(tileCoord[0]), this.tmpSize);
      var gutter = this.gutter_;
      if (gutter !== 0) {
        tileSize = buffer(tileSize, gutter, this.tmpSize);
        tileExtent = buffer2(tileExtent, tileResolution * gutter, tileExtent);
      }
      if (pixelRatio != 1) {
        tileSize = scale(tileSize, pixelRatio, this.tmpSize);
      }
      var baseParams = {
        "SERVICE": "WMS",
        "VERSION": DEFAULT_VERSION,
        "REQUEST": "GetMap",
        "FORMAT": "image/png",
        "TRANSPARENT": true
      };
      assign(baseParams, this.params_);
      return this.getRequestUrl_(tileCoord, tileSize, tileExtent, pixelRatio, projection, baseParams);
    };
    return TileWMS2;
  }(TileImage_default)
);
var TileWMS_default = TileWMS;

// node_modules/proj4/lib/global.js
function global_default(defs2) {
  defs2("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
  defs2("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
  defs2("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
  defs2.WGS84 = defs2["EPSG:4326"];
  defs2["EPSG:3785"] = defs2["EPSG:3857"];
  defs2.GOOGLE = defs2["EPSG:3857"];
  defs2["EPSG:900913"] = defs2["EPSG:3857"];
  defs2["EPSG:102113"] = defs2["EPSG:3857"];
}

// node_modules/proj4/lib/constants/values.js
var PJD_3PARAM = 1;
var PJD_7PARAM = 2;
var PJD_WGS84 = 4;
var PJD_NODATUM = 5;
var SEC_TO_RAD = 484813681109536e-20;
var HALF_PI = Math.PI / 2;
var SIXTH = 0.16666666666666666;
var RA4 = 0.04722222222222222;
var RA6 = 0.022156084656084655;
var EPSLN = 1e-10;
var D2R = 0.017453292519943295;
var R2D = 57.29577951308232;
var FORTPI = Math.PI / 4;
var TWO_PI = Math.PI * 2;
var SPI = 3.14159265359;

// node_modules/proj4/lib/constants/PrimeMeridian.js
var exports = {};
exports.greenwich = 0;
exports.lisbon = -9.131906111111;
exports.paris = 2.337229166667;
exports.bogota = -74.080916666667;
exports.madrid = -3.687938888889;
exports.rome = 12.452333333333;
exports.bern = 7.439583333333;
exports.jakarta = 106.807719444444;
exports.ferro = -17.666666666667;
exports.brussels = 4.367975;
exports.stockholm = 18.058277777778;
exports.athens = 23.7163375;
exports.oslo = 10.722916666667;

// node_modules/proj4/lib/constants/units.js
var units_default = {
  ft: { to_meter: 0.3048 },
  "us-ft": { to_meter: 1200 / 3937 }
};

// node_modules/proj4/lib/match.js
var ignoredChar = /[\s_\-\/\(\)]/g;
function match(obj, key) {
  if (obj[key]) {
    return obj[key];
  }
  var keys = Object.keys(obj);
  var lkey = key.toLowerCase().replace(ignoredChar, "");
  var i2 = -1;
  var testkey, processedKey;
  while (++i2 < keys.length) {
    testkey = keys[i2];
    processedKey = testkey.toLowerCase().replace(ignoredChar, "");
    if (processedKey === lkey) {
      return obj[testkey];
    }
  }
}

// node_modules/proj4/lib/projString.js
function projString_default(defData) {
  var self2 = {};
  var paramObj = defData.split("+").map(function(v) {
    return v.trim();
  }).filter(function(a) {
    return a;
  }).reduce(function(p, a) {
    var split = a.split("=");
    split.push(true);
    p[split[0].toLowerCase()] = split[1];
    return p;
  }, {});
  var paramName, paramVal, paramOutname;
  var params = {
    proj: "projName",
    datum: "datumCode",
    rf: function(v) {
      self2.rf = parseFloat(v);
    },
    lat_0: function(v) {
      self2.lat0 = v * D2R;
    },
    lat_1: function(v) {
      self2.lat1 = v * D2R;
    },
    lat_2: function(v) {
      self2.lat2 = v * D2R;
    },
    lat_ts: function(v) {
      self2.lat_ts = v * D2R;
    },
    lon_0: function(v) {
      self2.long0 = v * D2R;
    },
    lon_1: function(v) {
      self2.long1 = v * D2R;
    },
    lon_2: function(v) {
      self2.long2 = v * D2R;
    },
    alpha: function(v) {
      self2.alpha = parseFloat(v) * D2R;
    },
    lonc: function(v) {
      self2.longc = v * D2R;
    },
    x_0: function(v) {
      self2.x0 = parseFloat(v);
    },
    y_0: function(v) {
      self2.y0 = parseFloat(v);
    },
    k_0: function(v) {
      self2.k0 = parseFloat(v);
    },
    k: function(v) {
      self2.k0 = parseFloat(v);
    },
    a: function(v) {
      self2.a = parseFloat(v);
    },
    b: function(v) {
      self2.b = parseFloat(v);
    },
    r_a: function() {
      self2.R_A = true;
    },
    zone: function(v) {
      self2.zone = parseInt(v, 10);
    },
    south: function() {
      self2.utmSouth = true;
    },
    towgs84: function(v) {
      self2.datum_params = v.split(",").map(function(a) {
        return parseFloat(a);
      });
    },
    to_meter: function(v) {
      self2.to_meter = parseFloat(v);
    },
    units: function(v) {
      self2.units = v;
      var unit = match(units_default, v);
      if (unit) {
        self2.to_meter = unit.to_meter;
      }
    },
    from_greenwich: function(v) {
      self2.from_greenwich = v * D2R;
    },
    pm: function(v) {
      var pm = match(exports, v);
      self2.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;
    },
    nadgrids: function(v) {
      if (v === "@null") {
        self2.datumCode = "none";
      } else {
        self2.nadgrids = v;
      }
    },
    axis: function(v) {
      var legalAxis = "ewnsud";
      if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {
        self2.axis = v;
      }
    }
  };
  for (paramName in paramObj) {
    paramVal = paramObj[paramName];
    if (paramName in params) {
      paramOutname = params[paramName];
      if (typeof paramOutname === "function") {
        paramOutname(paramVal);
      } else {
        self2[paramOutname] = paramVal;
      }
    } else {
      self2[paramName] = paramVal;
    }
  }
  if (typeof self2.datumCode === "string" && self2.datumCode !== "WGS84") {
    self2.datumCode = self2.datumCode.toLowerCase();
  }
  return self2;
}

// node_modules/wkt-parser/parser.js
var parser_default = parseString;
var NEUTRAL = 1;
var KEYWORD = 2;
var NUMBER = 3;
var QUOTED = 4;
var AFTERQUOTE = 5;
var ENDED = -1;
var whitespace = /\s/;
var latin = /[A-Za-z]/;
var keyword = /[A-Za-z84_]/;
var endThings = /[,\]]/;
var digets = /[\d\.E\-\+]/;
function Parser(text) {
  if (typeof text !== "string") {
    throw new Error("not a string");
  }
  this.text = text.trim();
  this.level = 0;
  this.place = 0;
  this.root = null;
  this.stack = [];
  this.currentObject = null;
  this.state = NEUTRAL;
}
Parser.prototype.readCharicter = function() {
  var char = this.text[this.place++];
  if (this.state !== QUOTED) {
    while (whitespace.test(char)) {
      if (this.place >= this.text.length) {
        return;
      }
      char = this.text[this.place++];
    }
  }
  switch (this.state) {
    case NEUTRAL:
      return this.neutral(char);
    case KEYWORD:
      return this.keyword(char);
    case QUOTED:
      return this.quoted(char);
    case AFTERQUOTE:
      return this.afterquote(char);
    case NUMBER:
      return this.number(char);
    case ENDED:
      return;
  }
};
Parser.prototype.afterquote = function(char) {
  if (char === '"') {
    this.word += '"';
    this.state = QUOTED;
    return;
  }
  if (endThings.test(char)) {
    this.word = this.word.trim();
    this.afterItem(char);
    return;
  }
  throw new Error(`havn't handled "` + char + '" in afterquote yet, index ' + this.place);
};
Parser.prototype.afterItem = function(char) {
  if (char === ",") {
    if (this.word !== null) {
      this.currentObject.push(this.word);
    }
    this.word = null;
    this.state = NEUTRAL;
    return;
  }
  if (char === "]") {
    this.level--;
    if (this.word !== null) {
      this.currentObject.push(this.word);
      this.word = null;
    }
    this.state = NEUTRAL;
    this.currentObject = this.stack.pop();
    if (!this.currentObject) {
      this.state = ENDED;
    }
    return;
  }
};
Parser.prototype.number = function(char) {
  if (digets.test(char)) {
    this.word += char;
    return;
  }
  if (endThings.test(char)) {
    this.word = parseFloat(this.word);
    this.afterItem(char);
    return;
  }
  throw new Error(`havn't handled "` + char + '" in number yet, index ' + this.place);
};
Parser.prototype.quoted = function(char) {
  if (char === '"') {
    this.state = AFTERQUOTE;
    return;
  }
  this.word += char;
  return;
};
Parser.prototype.keyword = function(char) {
  if (keyword.test(char)) {
    this.word += char;
    return;
  }
  if (char === "[") {
    var newObjects = [];
    newObjects.push(this.word);
    this.level++;
    if (this.root === null) {
      this.root = newObjects;
    } else {
      this.currentObject.push(newObjects);
    }
    this.stack.push(this.currentObject);
    this.currentObject = newObjects;
    this.state = NEUTRAL;
    return;
  }
  if (endThings.test(char)) {
    this.afterItem(char);
    return;
  }
  throw new Error(`havn't handled "` + char + '" in keyword yet, index ' + this.place);
};
Parser.prototype.neutral = function(char) {
  if (latin.test(char)) {
    this.word = char;
    this.state = KEYWORD;
    return;
  }
  if (char === '"') {
    this.word = "";
    this.state = QUOTED;
    return;
  }
  if (digets.test(char)) {
    this.word = char;
    this.state = NUMBER;
    return;
  }
  if (endThings.test(char)) {
    this.afterItem(char);
    return;
  }
  throw new Error(`havn't handled "` + char + '" in neutral yet, index ' + this.place);
};
Parser.prototype.output = function() {
  while (this.place < this.text.length) {
    this.readCharicter();
  }
  if (this.state === ENDED) {
    return this.root;
  }
  throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
};
function parseString(txt) {
  var parser = new Parser(txt);
  return parser.output();
}

// node_modules/wkt-parser/process.js
function mapit(obj, key, value) {
  if (Array.isArray(key)) {
    value.unshift(key);
    key = null;
  }
  var thing = key ? {} : obj;
  var out = value.reduce(function(newObj, item) {
    sExpr(item, newObj);
    return newObj;
  }, thing);
  if (key) {
    obj[key] = out;
  }
}
function sExpr(v, obj) {
  if (!Array.isArray(v)) {
    obj[v] = true;
    return;
  }
  var key = v.shift();
  if (key === "PARAMETER") {
    key = v.shift();
  }
  if (v.length === 1) {
    if (Array.isArray(v[0])) {
      obj[key] = {};
      sExpr(v[0], obj[key]);
      return;
    }
    obj[key] = v[0];
    return;
  }
  if (!v.length) {
    obj[key] = true;
    return;
  }
  if (key === "TOWGS84") {
    obj[key] = v;
    return;
  }
  if (key === "AXIS") {
    if (!(key in obj)) {
      obj[key] = [];
    }
    obj[key].push(v);
    return;
  }
  if (!Array.isArray(key)) {
    obj[key] = {};
  }
  var i2;
  switch (key) {
    case "UNIT":
    case "PRIMEM":
    case "VERT_DATUM":
      obj[key] = {
        name: v[0].toLowerCase(),
        convert: v[1]
      };
      if (v.length === 3) {
        sExpr(v[2], obj[key]);
      }
      return;
    case "SPHEROID":
    case "ELLIPSOID":
      obj[key] = {
        name: v[0],
        a: v[1],
        rf: v[2]
      };
      if (v.length === 4) {
        sExpr(v[3], obj[key]);
      }
      return;
    case "PROJECTEDCRS":
    case "PROJCRS":
    case "GEOGCS":
    case "GEOCCS":
    case "PROJCS":
    case "LOCAL_CS":
    case "GEODCRS":
    case "GEODETICCRS":
    case "GEODETICDATUM":
    case "EDATUM":
    case "ENGINEERINGDATUM":
    case "VERT_CS":
    case "VERTCRS":
    case "VERTICALCRS":
    case "COMPD_CS":
    case "COMPOUNDCRS":
    case "ENGINEERINGCRS":
    case "ENGCRS":
    case "FITTED_CS":
    case "LOCAL_DATUM":
    case "DATUM":
      v[0] = ["name", v[0]];
      mapit(obj, key, v);
      return;
    default:
      i2 = -1;
      while (++i2 < v.length) {
        if (!Array.isArray(v[i2])) {
          return sExpr(v, obj[key]);
        }
      }
      return mapit(obj, key, v);
  }
}

// node_modules/wkt-parser/index.js
var D2R2 = 0.017453292519943295;
function rename(obj, params) {
  var outName = params[0];
  var inName = params[1];
  if (!(outName in obj) && inName in obj) {
    obj[outName] = obj[inName];
    if (params.length === 3) {
      obj[outName] = params[2](obj[outName]);
    }
  }
}
function d2r(input2) {
  return input2 * D2R2;
}
function cleanWKT(wkt) {
  if (wkt.type === "GEOGCS") {
    wkt.projName = "longlat";
  } else if (wkt.type === "LOCAL_CS") {
    wkt.projName = "identity";
    wkt.local = true;
  } else {
    if (typeof wkt.PROJECTION === "object") {
      wkt.projName = Object.keys(wkt.PROJECTION)[0];
    } else {
      wkt.projName = wkt.PROJECTION;
    }
  }
  if (wkt.AXIS) {
    var axisOrder = "";
    for (var i2 = 0, ii = wkt.AXIS.length; i2 < ii; ++i2) {
      var axis = [wkt.AXIS[i2][0].toLowerCase(), wkt.AXIS[i2][1].toLowerCase()];
      if (axis[0].indexOf("north") !== -1 || (axis[0] === "y" || axis[0] === "lat") && axis[1] === "north") {
        axisOrder += "n";
      } else if (axis[0].indexOf("south") !== -1 || (axis[0] === "y" || axis[0] === "lat") && axis[1] === "south") {
        axisOrder += "s";
      } else if (axis[0].indexOf("east") !== -1 || (axis[0] === "x" || axis[0] === "lon") && axis[1] === "east") {
        axisOrder += "e";
      } else if (axis[0].indexOf("west") !== -1 || (axis[0] === "x" || axis[0] === "lon") && axis[1] === "west") {
        axisOrder += "w";
      }
    }
    if (axisOrder.length === 2) {
      axisOrder += "u";
    }
    if (axisOrder.length === 3) {
      wkt.axis = axisOrder;
    }
  }
  if (wkt.UNIT) {
    wkt.units = wkt.UNIT.name.toLowerCase();
    if (wkt.units === "metre") {
      wkt.units = "meter";
    }
    if (wkt.UNIT.convert) {
      if (wkt.type === "GEOGCS") {
        if (wkt.DATUM && wkt.DATUM.SPHEROID) {
          wkt.to_meter = wkt.UNIT.convert * wkt.DATUM.SPHEROID.a;
        }
      } else {
        wkt.to_meter = wkt.UNIT.convert;
      }
    }
  }
  var geogcs = wkt.GEOGCS;
  if (wkt.type === "GEOGCS") {
    geogcs = wkt;
  }
  if (geogcs) {
    if (geogcs.DATUM) {
      wkt.datumCode = geogcs.DATUM.name.toLowerCase();
    } else {
      wkt.datumCode = geogcs.name.toLowerCase();
    }
    if (wkt.datumCode.slice(0, 2) === "d_") {
      wkt.datumCode = wkt.datumCode.slice(2);
    }
    if (wkt.datumCode === "new_zealand_geodetic_datum_1949" || wkt.datumCode === "new_zealand_1949") {
      wkt.datumCode = "nzgd49";
    }
    if (wkt.datumCode === "wgs_1984" || wkt.datumCode === "world_geodetic_system_1984") {
      if (wkt.PROJECTION === "Mercator_Auxiliary_Sphere") {
        wkt.sphere = true;
      }
      wkt.datumCode = "wgs84";
    }
    if (wkt.datumCode.slice(-6) === "_ferro") {
      wkt.datumCode = wkt.datumCode.slice(0, -6);
    }
    if (wkt.datumCode.slice(-8) === "_jakarta") {
      wkt.datumCode = wkt.datumCode.slice(0, -8);
    }
    if (~wkt.datumCode.indexOf("belge")) {
      wkt.datumCode = "rnb72";
    }
    if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
      wkt.ellps = geogcs.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk");
      if (wkt.ellps.toLowerCase().slice(0, 13) === "international") {
        wkt.ellps = "intl";
      }
      wkt.a = geogcs.DATUM.SPHEROID.a;
      wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
    }
    if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
      wkt.datum_params = geogcs.DATUM.TOWGS84;
    }
    if (~wkt.datumCode.indexOf("osgb_1936")) {
      wkt.datumCode = "osgb36";
    }
    if (~wkt.datumCode.indexOf("osni_1952")) {
      wkt.datumCode = "osni52";
    }
    if (~wkt.datumCode.indexOf("tm65") || ~wkt.datumCode.indexOf("geodetic_datum_of_1965")) {
      wkt.datumCode = "ire65";
    }
    if (wkt.datumCode === "ch1903+") {
      wkt.datumCode = "ch1903";
    }
    if (~wkt.datumCode.indexOf("israel")) {
      wkt.datumCode = "isr93";
    }
  }
  if (wkt.b && !isFinite(wkt.b)) {
    wkt.b = wkt.a;
  }
  function toMeter(input2) {
    var ratio = wkt.to_meter || 1;
    return input2 * ratio;
  }
  var renamer = function(a) {
    return rename(wkt, a);
  };
  var list = [
    ["standard_parallel_1", "Standard_Parallel_1"],
    ["standard_parallel_1", "Latitude of 1st standard parallel"],
    ["standard_parallel_2", "Standard_Parallel_2"],
    ["standard_parallel_2", "Latitude of 2nd standard parallel"],
    ["false_easting", "False_Easting"],
    ["false_easting", "False easting"],
    ["false-easting", "Easting at false origin"],
    ["false_northing", "False_Northing"],
    ["false_northing", "False northing"],
    ["false_northing", "Northing at false origin"],
    ["central_meridian", "Central_Meridian"],
    ["central_meridian", "Longitude of natural origin"],
    ["central_meridian", "Longitude of false origin"],
    ["latitude_of_origin", "Latitude_Of_Origin"],
    ["latitude_of_origin", "Central_Parallel"],
    ["latitude_of_origin", "Latitude of natural origin"],
    ["latitude_of_origin", "Latitude of false origin"],
    ["scale_factor", "Scale_Factor"],
    ["k0", "scale_factor"],
    ["latitude_of_center", "Latitude_Of_Center"],
    ["latitude_of_center", "Latitude_of_center"],
    ["lat0", "latitude_of_center", d2r],
    ["longitude_of_center", "Longitude_Of_Center"],
    ["longitude_of_center", "Longitude_of_center"],
    ["longc", "longitude_of_center", d2r],
    ["x0", "false_easting", toMeter],
    ["y0", "false_northing", toMeter],
    ["long0", "central_meridian", d2r],
    ["lat0", "latitude_of_origin", d2r],
    ["lat0", "standard_parallel_1", d2r],
    ["lat1", "standard_parallel_1", d2r],
    ["lat2", "standard_parallel_2", d2r],
    ["azimuth", "Azimuth"],
    ["alpha", "azimuth", d2r],
    ["srsCode", "name"]
  ];
  list.forEach(renamer);
  if (!wkt.long0 && wkt.longc && (wkt.projName === "Albers_Conic_Equal_Area" || wkt.projName === "Lambert_Azimuthal_Equal_Area")) {
    wkt.long0 = wkt.longc;
  }
  if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === "Stereographic_South_Pole" || wkt.projName === "Polar Stereographic (variant B)")) {
    wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
    wkt.lat_ts = wkt.lat1;
  } else if (!wkt.lat_ts && wkt.lat0 && wkt.projName === "Polar_Stereographic") {
    wkt.lat_ts = wkt.lat0;
    wkt.lat0 = d2r(wkt.lat0 > 0 ? 90 : -90);
  }
}
function wkt_parser_default(wkt) {
  var lisp = parser_default(wkt);
  var type = lisp.shift();
  var name = lisp.shift();
  lisp.unshift(["name", name]);
  lisp.unshift(["type", type]);
  var obj = {};
  sExpr(lisp, obj);
  cleanWKT(obj);
  return obj;
}

// node_modules/proj4/lib/defs.js
function defs(name) {
  var that = this;
  if (arguments.length === 2) {
    var def = arguments[1];
    if (typeof def === "string") {
      if (def.charAt(0) === "+") {
        defs[name] = projString_default(arguments[1]);
      } else {
        defs[name] = wkt_parser_default(arguments[1]);
      }
    } else {
      defs[name] = def;
    }
  } else if (arguments.length === 1) {
    if (Array.isArray(name)) {
      return name.map(function(v) {
        if (Array.isArray(v)) {
          defs.apply(that, v);
        } else {
          defs(v);
        }
      });
    } else if (typeof name === "string") {
      if (name in defs) {
        return defs[name];
      }
    } else if ("EPSG" in name) {
      defs["EPSG:" + name.EPSG] = name;
    } else if ("ESRI" in name) {
      defs["ESRI:" + name.ESRI] = name;
    } else if ("IAU2000" in name) {
      defs["IAU2000:" + name.IAU2000] = name;
    } else {
      console.log(name);
    }
    return;
  }
}
global_default(defs);
var defs_default = defs;

// node_modules/proj4/lib/parseCode.js
function testObj(code) {
  return typeof code === "string";
}
function testDef(code) {
  return code in defs_default;
}
var codeWords = ["PROJECTEDCRS", "PROJCRS", "GEOGCS", "GEOCCS", "PROJCS", "LOCAL_CS", "GEODCRS", "GEODETICCRS", "GEODETICDATUM", "ENGCRS", "ENGINEERINGCRS"];
function testWKT(code) {
  return codeWords.some(function(word) {
    return code.indexOf(word) > -1;
  });
}
var codes = ["3857", "900913", "3785", "102113"];
function checkMercator(item) {
  var auth = match(item, "authority");
  if (!auth) {
    return;
  }
  var code = match(auth, "epsg");
  return code && codes.indexOf(code) > -1;
}
function checkProjStr(item) {
  var ext = match(item, "extension");
  if (!ext) {
    return;
  }
  return match(ext, "proj4");
}
function testProj(code) {
  return code[0] === "+";
}
function parse24(code) {
  if (testObj(code)) {
    if (testDef(code)) {
      return defs_default[code];
    }
    if (testWKT(code)) {
      var out = wkt_parser_default(code);
      if (checkMercator(out)) {
        return defs_default["EPSG:3857"];
      }
      var maybeProjStr = checkProjStr(out);
      if (maybeProjStr) {
        return projString_default(maybeProjStr);
      }
      return out;
    }
    if (testProj(code)) {
      return projString_default(code);
    }
  } else {
    return code;
  }
}
var parseCode_default = parse24;

// node_modules/proj4/lib/extend.js
function extend_default(destination, source) {
  destination = destination || {};
  var value, property;
  if (!source) {
    return destination;
  }
  for (property in source) {
    value = source[property];
    if (value !== void 0) {
      destination[property] = value;
    }
  }
  return destination;
}

// node_modules/proj4/lib/common/msfnz.js
function msfnz_default(eccent, sinphi, cosphi) {
  var con = eccent * sinphi;
  return cosphi / Math.sqrt(1 - con * con);
}

// node_modules/proj4/lib/common/sign.js
function sign_default(x) {
  return x < 0 ? -1 : 1;
}

// node_modules/proj4/lib/common/adjust_lon.js
function adjust_lon_default(x) {
  return Math.abs(x) <= SPI ? x : x - sign_default(x) * TWO_PI;
}

// node_modules/proj4/lib/common/tsfnz.js
function tsfnz_default(eccent, phi, sinphi) {
  var con = eccent * sinphi;
  var com = 0.5 * eccent;
  con = Math.pow((1 - con) / (1 + con), com);
  return Math.tan(0.5 * (HALF_PI - phi)) / con;
}

// node_modules/proj4/lib/common/phi2z.js
function phi2z_default(eccent, ts) {
  var eccnth = 0.5 * eccent;
  var con, dphi;
  var phi = HALF_PI - 2 * Math.atan(ts);
  for (var i2 = 0; i2 <= 15; i2++) {
    con = eccent * Math.sin(phi);
    dphi = HALF_PI - 2 * Math.atan(ts * Math.pow((1 - con) / (1 + con), eccnth)) - phi;
    phi += dphi;
    if (Math.abs(dphi) <= 1e-10) {
      return phi;
    }
  }
  return -9999;
}

// node_modules/proj4/lib/projections/merc.js
function init() {
  var con = this.b / this.a;
  this.es = 1 - con * con;
  if (!("x0" in this)) {
    this.x0 = 0;
  }
  if (!("y0" in this)) {
    this.y0 = 0;
  }
  this.e = Math.sqrt(this.es);
  if (this.lat_ts) {
    if (this.sphere) {
      this.k0 = Math.cos(this.lat_ts);
    } else {
      this.k0 = msfnz_default(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
    }
  } else {
    if (!this.k0) {
      if (this.k) {
        this.k0 = this.k;
      } else {
        this.k0 = 1;
      }
    }
  }
}
function forward(p) {
  var lon = p.x;
  var lat = p.y;
  if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {
    return null;
  }
  var x, y;
  if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
    return null;
  } else {
    if (this.sphere) {
      x = this.x0 + this.a * this.k0 * adjust_lon_default(lon - this.long0);
      y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
    } else {
      var sinphi = Math.sin(lat);
      var ts = tsfnz_default(this.e, lat, sinphi);
      x = this.x0 + this.a * this.k0 * adjust_lon_default(lon - this.long0);
      y = this.y0 - this.a * this.k0 * Math.log(ts);
    }
    p.x = x;
    p.y = y;
    return p;
  }
}
function inverse(p) {
  var x = p.x - this.x0;
  var y = p.y - this.y0;
  var lon, lat;
  if (this.sphere) {
    lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));
  } else {
    var ts = Math.exp(-y / (this.a * this.k0));
    lat = phi2z_default(this.e, ts);
    if (lat === -9999) {
      return null;
    }
  }
  lon = adjust_lon_default(this.long0 + x / (this.a * this.k0));
  p.x = lon;
  p.y = lat;
  return p;
}
var names = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
var merc_default = {
  init,
  forward,
  inverse,
  names
};

// node_modules/proj4/lib/projections/longlat.js
function init2() {
}
function identity2(pt) {
  return pt;
}
var names2 = ["longlat", "identity"];
var longlat_default = {
  init: init2,
  forward: identity2,
  inverse: identity2,
  names: names2
};

// node_modules/proj4/lib/projections.js
var projs = [merc_default, longlat_default];
var names3 = {};
var projStore = [];
function add4(proj, i2) {
  var len = projStore.length;
  if (!proj.names) {
    console.log(i2);
    return true;
  }
  projStore[len] = proj;
  proj.names.forEach(function(n) {
    names3[n.toLowerCase()] = len;
  });
  return this;
}
function get7(name) {
  if (!name) {
    return false;
  }
  var n = name.toLowerCase();
  if (typeof names3[n] !== "undefined" && projStore[names3[n]]) {
    return projStore[names3[n]];
  }
}
function start() {
  projs.forEach(add4);
}
var projections_default = {
  start,
  add: add4,
  get: get7
};

// node_modules/proj4/lib/constants/Ellipsoid.js
var exports2 = {};
exports2.MERIT = {
  a: 6378137,
  rf: 298.257,
  ellipseName: "MERIT 1983"
};
exports2.SGS85 = {
  a: 6378136,
  rf: 298.257,
  ellipseName: "Soviet Geodetic System 85"
};
exports2.GRS80 = {
  a: 6378137,
  rf: 298.257222101,
  ellipseName: "GRS 1980(IUGG, 1980)"
};
exports2.IAU76 = {
  a: 6378140,
  rf: 298.257,
  ellipseName: "IAU 1976"
};
exports2.airy = {
  a: 6377563396e-3,
  b: 635625691e-2,
  ellipseName: "Airy 1830"
};
exports2.APL4 = {
  a: 6378137,
  rf: 298.25,
  ellipseName: "Appl. Physics. 1965"
};
exports2.NWL9D = {
  a: 6378145,
  rf: 298.25,
  ellipseName: "Naval Weapons Lab., 1965"
};
exports2.mod_airy = {
  a: 6377340189e-3,
  b: 6356034446e-3,
  ellipseName: "Modified Airy"
};
exports2.andrae = {
  a: 637710443e-2,
  rf: 300,
  ellipseName: "Andrae 1876 (Den., Iclnd.)"
};
exports2.aust_SA = {
  a: 6378160,
  rf: 298.25,
  ellipseName: "Australian Natl & S. Amer. 1969"
};
exports2.GRS67 = {
  a: 6378160,
  rf: 298.247167427,
  ellipseName: "GRS 67(IUGG 1967)"
};
exports2.bessel = {
  a: 6377397155e-3,
  rf: 299.1528128,
  ellipseName: "Bessel 1841"
};
exports2.bess_nam = {
  a: 6377483865e-3,
  rf: 299.1528128,
  ellipseName: "Bessel 1841 (Namibia)"
};
exports2.clrk66 = {
  a: 63782064e-1,
  b: 63565838e-1,
  ellipseName: "Clarke 1866"
};
exports2.clrk80 = {
  a: 6378249145e-3,
  rf: 293.4663,
  ellipseName: "Clarke 1880 mod."
};
exports2.clrk58 = {
  a: 6378293645208759e-9,
  rf: 294.2606763692654,
  ellipseName: "Clarke 1858"
};
exports2.CPM = {
  a: 63757387e-1,
  rf: 334.29,
  ellipseName: "Comm. des Poids et Mesures 1799"
};
exports2.delmbr = {
  a: 6376428,
  rf: 311.5,
  ellipseName: "Delambre 1810 (Belgium)"
};
exports2.engelis = {
  a: 637813605e-2,
  rf: 298.2566,
  ellipseName: "Engelis 1985"
};
exports2.evrst30 = {
  a: 6377276345e-3,
  rf: 300.8017,
  ellipseName: "Everest 1830"
};
exports2.evrst48 = {
  a: 6377304063e-3,
  rf: 300.8017,
  ellipseName: "Everest 1948"
};
exports2.evrst56 = {
  a: 6377301243e-3,
  rf: 300.8017,
  ellipseName: "Everest 1956"
};
exports2.evrst69 = {
  a: 6377295664e-3,
  rf: 300.8017,
  ellipseName: "Everest 1969"
};
exports2.evrstSS = {
  a: 6377298556e-3,
  rf: 300.8017,
  ellipseName: "Everest (Sabah & Sarawak)"
};
exports2.fschr60 = {
  a: 6378166,
  rf: 298.3,
  ellipseName: "Fischer (Mercury Datum) 1960"
};
exports2.fschr60m = {
  a: 6378155,
  rf: 298.3,
  ellipseName: "Fischer 1960"
};
exports2.fschr68 = {
  a: 6378150,
  rf: 298.3,
  ellipseName: "Fischer 1968"
};
exports2.helmert = {
  a: 6378200,
  rf: 298.3,
  ellipseName: "Helmert 1906"
};
exports2.hough = {
  a: 6378270,
  rf: 297,
  ellipseName: "Hough"
};
exports2.intl = {
  a: 6378388,
  rf: 297,
  ellipseName: "International 1909 (Hayford)"
};
exports2.kaula = {
  a: 6378163,
  rf: 298.24,
  ellipseName: "Kaula 1961"
};
exports2.lerch = {
  a: 6378139,
  rf: 298.257,
  ellipseName: "Lerch 1979"
};
exports2.mprts = {
  a: 6397300,
  rf: 191,
  ellipseName: "Maupertius 1738"
};
exports2.new_intl = {
  a: 63781575e-1,
  b: 63567722e-1,
  ellipseName: "New International 1967"
};
exports2.plessis = {
  a: 6376523,
  rf: 6355863,
  ellipseName: "Plessis 1817 (France)"
};
exports2.krass = {
  a: 6378245,
  rf: 298.3,
  ellipseName: "Krassovsky, 1942"
};
exports2.SEasia = {
  a: 6378155,
  b: 63567733205e-4,
  ellipseName: "Southeast Asia"
};
exports2.walbeck = {
  a: 6376896,
  b: 63558348467e-4,
  ellipseName: "Walbeck"
};
exports2.WGS60 = {
  a: 6378165,
  rf: 298.3,
  ellipseName: "WGS 60"
};
exports2.WGS66 = {
  a: 6378145,
  rf: 298.25,
  ellipseName: "WGS 66"
};
exports2.WGS7 = {
  a: 6378135,
  rf: 298.26,
  ellipseName: "WGS 72"
};
var WGS84 = exports2.WGS84 = {
  a: 6378137,
  rf: 298.257223563,
  ellipseName: "WGS 84"
};
exports2.sphere = {
  a: 6370997,
  b: 6370997,
  ellipseName: "Normal Sphere (r=6370997)"
};

// node_modules/proj4/lib/deriveConstants.js
function eccentricity(a, b, rf, R_A) {
  var a2 = a * a;
  var b2 = b * b;
  var es = (a2 - b2) / a2;
  var e = 0;
  if (R_A) {
    a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));
    a2 = a * a;
    es = 0;
  } else {
    e = Math.sqrt(es);
  }
  var ep2 = (a2 - b2) / b2;
  return {
    es,
    e,
    ep2
  };
}
function sphere(a, b, rf, ellps, sphere2) {
  if (!a) {
    var ellipse = match(exports2, ellps);
    if (!ellipse) {
      ellipse = WGS84;
    }
    a = ellipse.a;
    b = ellipse.b;
    rf = ellipse.rf;
  }
  if (rf && !b) {
    b = (1 - 1 / rf) * a;
  }
  if (rf === 0 || Math.abs(a - b) < EPSLN) {
    sphere2 = true;
    b = a;
  }
  return {
    a,
    b,
    rf,
    sphere: sphere2
  };
}

// node_modules/proj4/lib/constants/Datum.js
var exports3 = {};
exports3.wgs84 = {
  towgs84: "0,0,0",
  ellipse: "WGS84",
  datumName: "WGS84"
};
exports3.ch1903 = {
  towgs84: "674.374,15.056,405.346",
  ellipse: "bessel",
  datumName: "swiss"
};
exports3.ggrs87 = {
  towgs84: "-199.87,74.79,246.62",
  ellipse: "GRS80",
  datumName: "Greek_Geodetic_Reference_System_1987"
};
exports3.nad83 = {
  towgs84: "0,0,0",
  ellipse: "GRS80",
  datumName: "North_American_Datum_1983"
};
exports3.nad27 = {
  nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
  ellipse: "clrk66",
  datumName: "North_American_Datum_1927"
};
exports3.potsdam = {
  towgs84: "606.0,23.0,413.0",
  ellipse: "bessel",
  datumName: "Potsdam Rauenberg 1950 DHDN"
};
exports3.carthage = {
  towgs84: "-263.0,6.0,431.0",
  ellipse: "clark80",
  datumName: "Carthage 1934 Tunisia"
};
exports3.hermannskogel = {
  towgs84: "653.0,-212.0,449.0",
  ellipse: "bessel",
  datumName: "Hermannskogel"
};
exports3.osni52 = {
  towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  ellipse: "airy",
  datumName: "Irish National"
};
exports3.ire65 = {
  towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  ellipse: "mod_airy",
  datumName: "Ireland 1965"
};
exports3.rassadiran = {
  towgs84: "-133.63,-157.5,-158.62",
  ellipse: "intl",
  datumName: "Rassadiran"
};
exports3.nzgd49 = {
  towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
  ellipse: "intl",
  datumName: "New Zealand Geodetic Datum 1949"
};
exports3.osgb36 = {
  towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
  ellipse: "airy",
  datumName: "Airy 1830"
};
exports3.s_jtsk = {
  towgs84: "589,76,480",
  ellipse: "bessel",
  datumName: "S-JTSK (Ferro)"
};
exports3.beduaram = {
  towgs84: "-106,-87,188",
  ellipse: "clrk80",
  datumName: "Beduaram"
};
exports3.gunung_segara = {
  towgs84: "-403,684,41",
  ellipse: "bessel",
  datumName: "Gunung Segara Jakarta"
};
exports3.rnb72 = {
  towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
  ellipse: "intl",
  datumName: "Reseau National Belge 1972"
};

// node_modules/proj4/lib/datum.js
function datum(datumCode, datum_params, a, b, es, ep2) {
  var out = {};
  if (datumCode === void 0 || datumCode === "none") {
    out.datum_type = PJD_NODATUM;
  } else {
    out.datum_type = PJD_WGS84;
  }
  if (datum_params) {
    out.datum_params = datum_params.map(parseFloat);
    if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
      out.datum_type = PJD_3PARAM;
    }
    if (out.datum_params.length > 3) {
      if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
        out.datum_type = PJD_7PARAM;
        out.datum_params[3] *= SEC_TO_RAD;
        out.datum_params[4] *= SEC_TO_RAD;
        out.datum_params[5] *= SEC_TO_RAD;
        out.datum_params[6] = out.datum_params[6] / 1e6 + 1;
      }
    }
  }
  out.a = a;
  out.b = b;
  out.es = es;
  out.ep2 = ep2;
  return out;
}
var datum_default = datum;

// node_modules/proj4/lib/Proj.js
function Projection2(srsCode, callback) {
  if (!(this instanceof Projection2)) {
    return new Projection2(srsCode);
  }
  callback = callback || function(error3) {
    if (error3) {
      throw error3;
    }
  };
  var json = parseCode_default(srsCode);
  if (typeof json !== "object") {
    callback(srsCode);
    return;
  }
  var ourProj = Projection2.projections.get(json.projName);
  if (!ourProj) {
    callback(srsCode);
    return;
  }
  if (json.datumCode && json.datumCode !== "none") {
    var datumDef = match(exports3, json.datumCode);
    if (datumDef) {
      json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(",") : null;
      json.ellps = datumDef.ellipse;
      json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
    }
  }
  json.k0 = json.k0 || 1;
  json.axis = json.axis || "enu";
  json.ellps = json.ellps || "wgs84";
  var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
  var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
  var datumObj = json.datum || datum_default(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2);
  extend_default(this, json);
  extend_default(this, ourProj);
  this.a = sphere_.a;
  this.b = sphere_.b;
  this.rf = sphere_.rf;
  this.sphere = sphere_.sphere;
  this.es = ecc.es;
  this.e = ecc.e;
  this.ep2 = ecc.ep2;
  this.datum = datumObj;
  this.init();
  callback(null, this);
}
Projection2.projections = projections_default;
Projection2.projections.start();
var Proj_default = Projection2;

// node_modules/proj4/lib/datumUtils.js
function compareDatums(source, dest) {
  if (source.datum_type !== dest.datum_type) {
    return false;
  } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 5e-11) {
    return false;
  } else if (source.datum_type === PJD_3PARAM) {
    return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2];
  } else if (source.datum_type === PJD_7PARAM) {
    return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6];
  } else {
    return true;
  }
}
function geodeticToGeocentric(p, es, a) {
  var Longitude = p.x;
  var Latitude = p.y;
  var Height = p.z ? p.z : 0;
  var Rn;
  var Sin_Lat;
  var Sin2_Lat;
  var Cos_Lat;
  if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {
    Latitude = -HALF_PI;
  } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {
    Latitude = HALF_PI;
  } else if (Latitude < -HALF_PI) {
    return { x: -Infinity, y: -Infinity, z: p.z };
  } else if (Latitude > HALF_PI) {
    return { x: Infinity, y: Infinity, z: p.z };
  }
  if (Longitude > Math.PI) {
    Longitude -= 2 * Math.PI;
  }
  Sin_Lat = Math.sin(Latitude);
  Cos_Lat = Math.cos(Latitude);
  Sin2_Lat = Sin_Lat * Sin_Lat;
  Rn = a / Math.sqrt(1 - es * Sin2_Lat);
  return {
    x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),
    y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),
    z: (Rn * (1 - es) + Height) * Sin_Lat
  };
}
function geocentricToGeodetic(p, es, a, b) {
  var genau = 1e-12;
  var genau2 = genau * genau;
  var maxiter = 30;
  var P;
  var RR;
  var CT;
  var ST;
  var RX;
  var RK;
  var RN;
  var CPHI0;
  var SPHI0;
  var CPHI;
  var SPHI;
  var SDPHI;
  var iter;
  var X = p.x;
  var Y = p.y;
  var Z3 = p.z ? p.z : 0;
  var Longitude;
  var Latitude;
  var Height;
  P = Math.sqrt(X * X + Y * Y);
  RR = Math.sqrt(X * X + Y * Y + Z3 * Z3);
  if (P / a < genau) {
    Longitude = 0;
    if (RR / a < genau) {
      Latitude = HALF_PI;
      Height = -b;
      return {
        x: p.x,
        y: p.y,
        z: p.z
      };
    }
  } else {
    Longitude = Math.atan2(Y, X);
  }
  CT = Z3 / RR;
  ST = P / RR;
  RX = 1 / Math.sqrt(1 - es * (2 - es) * ST * ST);
  CPHI0 = ST * (1 - es) * RX;
  SPHI0 = CT * RX;
  iter = 0;
  do {
    iter++;
    RN = a / Math.sqrt(1 - es * SPHI0 * SPHI0);
    Height = P * CPHI0 + Z3 * SPHI0 - RN * (1 - es * SPHI0 * SPHI0);
    RK = es * RN / (RN + Height);
    RX = 1 / Math.sqrt(1 - RK * (2 - RK) * ST * ST);
    CPHI = ST * (1 - RK) * RX;
    SPHI = CT * RX;
    SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
    CPHI0 = CPHI;
    SPHI0 = SPHI;
  } while (SDPHI * SDPHI > genau2 && iter < maxiter);
  Latitude = Math.atan(SPHI / Math.abs(CPHI));
  return {
    x: Longitude,
    y: Latitude,
    z: Height
  };
}
function geocentricToWgs84(p, datum_type, datum_params) {
  if (datum_type === PJD_3PARAM) {
    return {
      x: p.x + datum_params[0],
      y: p.y + datum_params[1],
      z: p.z + datum_params[2]
    };
  } else if (datum_type === PJD_7PARAM) {
    var Dx_BF = datum_params[0];
    var Dy_BF = datum_params[1];
    var Dz_BF = datum_params[2];
    var Rx_BF = datum_params[3];
    var Ry_BF = datum_params[4];
    var Rz_BF = datum_params[5];
    var M_BF = datum_params[6];
    return {
      x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,
      y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,
      z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF
    };
  }
}
function geocentricFromWgs84(p, datum_type, datum_params) {
  if (datum_type === PJD_3PARAM) {
    return {
      x: p.x - datum_params[0],
      y: p.y - datum_params[1],
      z: p.z - datum_params[2]
    };
  } else if (datum_type === PJD_7PARAM) {
    var Dx_BF = datum_params[0];
    var Dy_BF = datum_params[1];
    var Dz_BF = datum_params[2];
    var Rx_BF = datum_params[3];
    var Ry_BF = datum_params[4];
    var Rz_BF = datum_params[5];
    var M_BF = datum_params[6];
    var x_tmp = (p.x - Dx_BF) / M_BF;
    var y_tmp = (p.y - Dy_BF) / M_BF;
    var z_tmp = (p.z - Dz_BF) / M_BF;
    return {
      x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,
      y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,
      z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp
    };
  }
}

// node_modules/proj4/lib/datum_transform.js
function checkParams(type) {
  return type === PJD_3PARAM || type === PJD_7PARAM;
}
function datum_transform_default(source, dest, point) {
  if (compareDatums(source, dest)) {
    return point;
  }
  if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {
    return point;
  }
  if (source.es === dest.es && source.a === dest.a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {
    return point;
  }
  point = geodeticToGeocentric(point, source.es, source.a);
  if (checkParams(source.datum_type)) {
    point = geocentricToWgs84(point, source.datum_type, source.datum_params);
  }
  if (checkParams(dest.datum_type)) {
    point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);
  }
  return geocentricToGeodetic(point, dest.es, dest.a, dest.b);
}

// node_modules/proj4/lib/adjust_axis.js
function adjust_axis_default(crs, denorm, point) {
  var xin = point.x, yin = point.y, zin = point.z || 0;
  var v, t, i2;
  var out = {};
  for (i2 = 0; i2 < 3; i2++) {
    if (denorm && i2 === 2 && point.z === void 0) {
      continue;
    }
    if (i2 === 0) {
      v = xin;
      t = "x";
    } else if (i2 === 1) {
      v = yin;
      t = "y";
    } else {
      v = zin;
      t = "z";
    }
    switch (crs.axis[i2]) {
      case "e":
        out[t] = v;
        break;
      case "w":
        out[t] = -v;
        break;
      case "n":
        out[t] = v;
        break;
      case "s":
        out[t] = -v;
        break;
      case "u":
        if (point[t] !== void 0) {
          out.z = v;
        }
        break;
      case "d":
        if (point[t] !== void 0) {
          out.z = -v;
        }
        break;
      default:
        return null;
    }
  }
  return out;
}

// node_modules/proj4/lib/common/toPoint.js
function toPoint_default(array2) {
  var out = {
    x: array2[0],
    y: array2[1]
  };
  if (array2.length > 2) {
    out.z = array2[2];
  }
  if (array2.length > 3) {
    out.m = array2[3];
  }
  return out;
}

// node_modules/proj4/lib/checkSanity.js
function checkSanity_default(point) {
  checkCoord(point.x);
  checkCoord(point.y);
}
function checkCoord(num) {
  if (typeof Number.isFinite === "function") {
    if (Number.isFinite(num)) {
      return;
    }
    throw new TypeError("coordinates must be finite numbers");
  }
  if (typeof num !== "number" || num !== num || !isFinite(num)) {
    throw new TypeError("coordinates must be finite numbers");
  }
}

// node_modules/proj4/lib/transform.js
function checkNotWGS(source, dest) {
  return (source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM) && dest.datumCode !== "WGS84" || (dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM) && source.datumCode !== "WGS84";
}
function transform2(source, dest, point) {
  var wgs842;
  if (Array.isArray(point)) {
    point = toPoint_default(point);
  }
  checkSanity_default(point);
  if (source.datum && dest.datum && checkNotWGS(source, dest)) {
    wgs842 = new Proj_default("WGS84");
    point = transform2(source, wgs842, point);
    source = wgs842;
  }
  if (source.axis !== "enu") {
    point = adjust_axis_default(source, false, point);
  }
  if (source.projName === "longlat") {
    point = {
      x: point.x * D2R,
      y: point.y * D2R,
      z: point.z || 0
    };
  } else {
    if (source.to_meter) {
      point = {
        x: point.x * source.to_meter,
        y: point.y * source.to_meter,
        z: point.z || 0
      };
    }
    point = source.inverse(point);
  }
  if (source.from_greenwich) {
    point.x += source.from_greenwich;
  }
  point = datum_transform_default(source.datum, dest.datum, point);
  if (dest.from_greenwich) {
    point = {
      x: point.x - dest.from_greenwich,
      y: point.y,
      z: point.z || 0
    };
  }
  if (dest.projName === "longlat") {
    point = {
      x: point.x * R2D,
      y: point.y * R2D,
      z: point.z || 0
    };
  } else {
    point = dest.forward(point);
    if (dest.to_meter) {
      point = {
        x: point.x / dest.to_meter,
        y: point.y / dest.to_meter,
        z: point.z || 0
      };
    }
  }
  if (dest.axis !== "enu") {
    return adjust_axis_default(dest, true, point);
  }
  return point;
}

// node_modules/proj4/lib/core.js
var wgs84 = Proj_default("WGS84");
function transformer(from2, to, coords) {
  var transformedArray, out, keys;
  if (Array.isArray(coords)) {
    transformedArray = transform2(from2, to, coords) || { x: NaN, y: NaN };
    if (coords.length > 2) {
      if (typeof from2.name !== "undefined" && from2.name === "geocent" || typeof to.name !== "undefined" && to.name === "geocent") {
        if (typeof transformedArray.z === "number") {
          return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));
        } else {
          return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));
        }
      } else {
        return [transformedArray.x, transformedArray.y].concat(coords.splice(2));
      }
    } else {
      return [transformedArray.x, transformedArray.y];
    }
  } else {
    out = transform2(from2, to, coords);
    keys = Object.keys(coords);
    if (keys.length === 2) {
      return out;
    }
    keys.forEach(function(key) {
      if (typeof from2.name !== "undefined" && from2.name === "geocent" || typeof to.name !== "undefined" && to.name === "geocent") {
        if (key === "x" || key === "y" || key === "z") {
          return;
        }
      } else {
        if (key === "x" || key === "y") {
          return;
        }
      }
      out[key] = coords[key];
    });
    return out;
  }
}
function checkProj(item) {
  if (item instanceof Proj_default) {
    return item;
  }
  if (item.oProj) {
    return item.oProj;
  }
  return Proj_default(item);
}
function proj4(fromProj, toProj, coord) {
  fromProj = checkProj(fromProj);
  var single = false;
  var obj;
  if (typeof toProj === "undefined") {
    toProj = fromProj;
    fromProj = wgs84;
    single = true;
  } else if (typeof toProj.x !== "undefined" || Array.isArray(toProj)) {
    coord = toProj;
    toProj = fromProj;
    fromProj = wgs84;
    single = true;
  }
  toProj = checkProj(toProj);
  if (coord) {
    return transformer(fromProj, toProj, coord);
  } else {
    obj = {
      forward: function(coords) {
        return transformer(fromProj, toProj, coords);
      },
      inverse: function(coords) {
        return transformer(toProj, fromProj, coords);
      }
    };
    if (single) {
      obj.oProj = toProj;
    }
    return obj;
  }
}
var core_default = proj4;

// node_modules/mgrs/mgrs.js
var NUM_100K_SETS = 6;
var SET_ORIGIN_COLUMN_LETTERS = "AJSAJS";
var SET_ORIGIN_ROW_LETTERS = "AFAFAF";
var A2 = 65;
var I = 73;
var O = 79;
var V = 86;
var Z2 = 90;
var mgrs_default = {
  forward: forward2,
  inverse: inverse2,
  toPoint
};
function forward2(ll, accuracy) {
  accuracy = accuracy || 5;
  return encode(LLtoUTM({
    lat: ll[1],
    lon: ll[0]
  }), accuracy);
}
function inverse2(mgrs) {
  var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  if (bbox.lat && bbox.lon) {
    return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
  }
  return [bbox.left, bbox.bottom, bbox.right, bbox.top];
}
function toPoint(mgrs) {
  var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  if (bbox.lat && bbox.lon) {
    return [bbox.lon, bbox.lat];
  }
  return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];
}
function degToRad(deg) {
  return deg * (Math.PI / 180);
}
function radToDeg(rad) {
  return 180 * (rad / Math.PI);
}
function LLtoUTM(ll) {
  var Lat = ll.lat;
  var Long = ll.lon;
  var a = 6378137;
  var eccSquared = 669438e-8;
  var k0 = 0.9996;
  var LongOrigin;
  var eccPrimeSquared;
  var N, T, C, A3, M;
  var LatRad = degToRad(Lat);
  var LongRad = degToRad(Long);
  var LongOriginRad;
  var ZoneNumber;
  ZoneNumber = Math.floor((Long + 180) / 6) + 1;
  if (Long === 180) {
    ZoneNumber = 60;
  }
  if (Lat >= 56 && Lat < 64 && Long >= 3 && Long < 12) {
    ZoneNumber = 32;
  }
  if (Lat >= 72 && Lat < 84) {
    if (Long >= 0 && Long < 9) {
      ZoneNumber = 31;
    } else if (Long >= 9 && Long < 21) {
      ZoneNumber = 33;
    } else if (Long >= 21 && Long < 33) {
      ZoneNumber = 35;
    } else if (Long >= 33 && Long < 42) {
      ZoneNumber = 37;
    }
  }
  LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3;
  LongOriginRad = degToRad(LongOrigin);
  eccPrimeSquared = eccSquared / (1 - eccSquared);
  N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));
  T = Math.tan(LatRad) * Math.tan(LatRad);
  C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);
  A3 = Math.cos(LatRad) * (LongRad - LongOriginRad);
  M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - 35 * eccSquared * eccSquared * eccSquared / 3072 * Math.sin(6 * LatRad));
  var UTMEasting = k0 * N * (A3 + (1 - T + C) * A3 * A3 * A3 / 6 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A3 * A3 * A3 * A3 * A3 / 120) + 5e5;
  var UTMNorthing = k0 * (M + N * Math.tan(LatRad) * (A3 * A3 / 2 + (5 - T + 9 * C + 4 * C * C) * A3 * A3 * A3 * A3 / 24 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A3 * A3 * A3 * A3 * A3 * A3 / 720));
  if (Lat < 0) {
    UTMNorthing += 1e7;
  }
  return {
    northing: Math.round(UTMNorthing),
    easting: Math.round(UTMEasting),
    zoneNumber: ZoneNumber,
    zoneLetter: getLetterDesignator(Lat)
  };
}
function UTMtoLL(utm) {
  var UTMNorthing = utm.northing;
  var UTMEasting = utm.easting;
  var zoneLetter = utm.zoneLetter;
  var zoneNumber = utm.zoneNumber;
  if (zoneNumber < 0 || zoneNumber > 60) {
    return null;
  }
  var k0 = 0.9996;
  var a = 6378137;
  var eccSquared = 669438e-8;
  var eccPrimeSquared;
  var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));
  var N1, T1, C12, R1, D, M;
  var LongOrigin;
  var mu, phi1Rad;
  var x = UTMEasting - 5e5;
  var y = UTMNorthing;
  if (zoneLetter < "N") {
    y -= 1e7;
  }
  LongOrigin = (zoneNumber - 1) * 6 - 180 + 3;
  eccPrimeSquared = eccSquared / (1 - eccSquared);
  M = y / k0;
  mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));
  phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + 151 * e1 * e1 * e1 / 96 * Math.sin(6 * mu);
  N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));
  T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);
  C12 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);
  R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);
  D = x / (N1 * k0);
  var lat = phi1Rad - N1 * Math.tan(phi1Rad) / R1 * (D * D / 2 - (5 + 3 * T1 + 10 * C12 - 4 * C12 * C12 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C12 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C12 * C12) * D * D * D * D * D * D / 720);
  lat = radToDeg(lat);
  var lon = (D - (1 + 2 * T1 + C12) * D * D * D / 6 + (5 - 2 * C12 + 28 * T1 - 3 * C12 * C12 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);
  lon = LongOrigin + radToDeg(lon);
  var result;
  if (utm.accuracy) {
    var topRight = UTMtoLL({
      northing: utm.northing + utm.accuracy,
      easting: utm.easting + utm.accuracy,
      zoneLetter: utm.zoneLetter,
      zoneNumber: utm.zoneNumber
    });
    result = {
      top: topRight.lat,
      right: topRight.lon,
      bottom: lat,
      left: lon
    };
  } else {
    result = {
      lat,
      lon
    };
  }
  return result;
}
function getLetterDesignator(lat) {
  var LetterDesignator = "Z";
  if (84 >= lat && lat >= 72) {
    LetterDesignator = "X";
  } else if (72 > lat && lat >= 64) {
    LetterDesignator = "W";
  } else if (64 > lat && lat >= 56) {
    LetterDesignator = "V";
  } else if (56 > lat && lat >= 48) {
    LetterDesignator = "U";
  } else if (48 > lat && lat >= 40) {
    LetterDesignator = "T";
  } else if (40 > lat && lat >= 32) {
    LetterDesignator = "S";
  } else if (32 > lat && lat >= 24) {
    LetterDesignator = "R";
  } else if (24 > lat && lat >= 16) {
    LetterDesignator = "Q";
  } else if (16 > lat && lat >= 8) {
    LetterDesignator = "P";
  } else if (8 > lat && lat >= 0) {
    LetterDesignator = "N";
  } else if (0 > lat && lat >= -8) {
    LetterDesignator = "M";
  } else if (-8 > lat && lat >= -16) {
    LetterDesignator = "L";
  } else if (-16 > lat && lat >= -24) {
    LetterDesignator = "K";
  } else if (-24 > lat && lat >= -32) {
    LetterDesignator = "J";
  } else if (-32 > lat && lat >= -40) {
    LetterDesignator = "H";
  } else if (-40 > lat && lat >= -48) {
    LetterDesignator = "G";
  } else if (-48 > lat && lat >= -56) {
    LetterDesignator = "F";
  } else if (-56 > lat && lat >= -64) {
    LetterDesignator = "E";
  } else if (-64 > lat && lat >= -72) {
    LetterDesignator = "D";
  } else if (-72 > lat && lat >= -80) {
    LetterDesignator = "C";
  }
  return LetterDesignator;
}
function encode(utm, accuracy) {
  var seasting = "00000" + utm.easting, snorthing = "00000" + utm.northing;
  return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
}
function get100kID(easting, northing, zoneNumber) {
  var setParm = get100kSetForZone(zoneNumber);
  var setColumn = Math.floor(easting / 1e5);
  var setRow = Math.floor(northing / 1e5) % 20;
  return getLetter100kID(setColumn, setRow, setParm);
}
function get100kSetForZone(i2) {
  var setParm = i2 % NUM_100K_SETS;
  if (setParm === 0) {
    setParm = NUM_100K_SETS;
  }
  return setParm;
}
function getLetter100kID(column, row, parm) {
  var index = parm - 1;
  var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);
  var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);
  var colInt = colOrigin + column - 1;
  var rowInt = rowOrigin + row;
  var rollover = false;
  if (colInt > Z2) {
    colInt = colInt - Z2 + A2 - 1;
    rollover = true;
  }
  if (colInt === I || colOrigin < I && colInt > I || (colInt > I || colOrigin < I) && rollover) {
    colInt++;
  }
  if (colInt === O || colOrigin < O && colInt > O || (colInt > O || colOrigin < O) && rollover) {
    colInt++;
    if (colInt === I) {
      colInt++;
    }
  }
  if (colInt > Z2) {
    colInt = colInt - Z2 + A2 - 1;
  }
  if (rowInt > V) {
    rowInt = rowInt - V + A2 - 1;
    rollover = true;
  } else {
    rollover = false;
  }
  if (rowInt === I || rowOrigin < I && rowInt > I || (rowInt > I || rowOrigin < I) && rollover) {
    rowInt++;
  }
  if (rowInt === O || rowOrigin < O && rowInt > O || (rowInt > O || rowOrigin < O) && rollover) {
    rowInt++;
    if (rowInt === I) {
      rowInt++;
    }
  }
  if (rowInt > V) {
    rowInt = rowInt - V + A2 - 1;
  }
  var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);
  return twoLetter;
}
function decode(mgrsString) {
  if (mgrsString && mgrsString.length === 0) {
    throw "MGRSPoint coverting from nothing";
  }
  var length = mgrsString.length;
  var hunK = null;
  var sb = "";
  var testChar;
  var i2 = 0;
  while (!/[A-Z]/.test(testChar = mgrsString.charAt(i2))) {
    if (i2 >= 2) {
      throw "MGRSPoint bad conversion from: " + mgrsString;
    }
    sb += testChar;
    i2++;
  }
  var zoneNumber = parseInt(sb, 10);
  if (i2 === 0 || i2 + 3 > length) {
    throw "MGRSPoint bad conversion from: " + mgrsString;
  }
  var zoneLetter = mgrsString.charAt(i2++);
  if (zoneLetter <= "A" || zoneLetter === "B" || zoneLetter === "Y" || zoneLetter >= "Z" || zoneLetter === "I" || zoneLetter === "O") {
    throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
  }
  hunK = mgrsString.substring(i2, i2 += 2);
  var set2 = get100kSetForZone(zoneNumber);
  var east100k = getEastingFromChar(hunK.charAt(0), set2);
  var north100k = getNorthingFromChar(hunK.charAt(1), set2);
  while (north100k < getMinNorthing(zoneLetter)) {
    north100k += 2e6;
  }
  var remainder = length - i2;
  if (remainder % 2 !== 0) {
    throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString;
  }
  var sep = remainder / 2;
  var sepEasting = 0;
  var sepNorthing = 0;
  var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;
  if (sep > 0) {
    accuracyBonus = 1e5 / Math.pow(10, sep);
    sepEastingString = mgrsString.substring(i2, i2 + sep);
    sepEasting = parseFloat(sepEastingString) * accuracyBonus;
    sepNorthingString = mgrsString.substring(i2 + sep);
    sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;
  }
  easting = sepEasting + east100k;
  northing = sepNorthing + north100k;
  return {
    easting,
    northing,
    zoneLetter,
    zoneNumber,
    accuracy: accuracyBonus
  };
}
function getEastingFromChar(e, set2) {
  var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set2 - 1);
  var eastingValue = 1e5;
  var rewindMarker = false;
  while (curCol !== e.charCodeAt(0)) {
    curCol++;
    if (curCol === I) {
      curCol++;
    }
    if (curCol === O) {
      curCol++;
    }
    if (curCol > Z2) {
      if (rewindMarker) {
        throw "Bad character: " + e;
      }
      curCol = A2;
      rewindMarker = true;
    }
    eastingValue += 1e5;
  }
  return eastingValue;
}
function getNorthingFromChar(n, set2) {
  if (n > "V") {
    throw "MGRSPoint given invalid Northing " + n;
  }
  var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set2 - 1);
  var northingValue = 0;
  var rewindMarker = false;
  while (curRow !== n.charCodeAt(0)) {
    curRow++;
    if (curRow === I) {
      curRow++;
    }
    if (curRow === O) {
      curRow++;
    }
    if (curRow > V) {
      if (rewindMarker) {
        throw "Bad character: " + n;
      }
      curRow = A2;
      rewindMarker = true;
    }
    northingValue += 1e5;
  }
  return northingValue;
}
function getMinNorthing(zoneLetter) {
  var northing;
  switch (zoneLetter) {
    case "C":
      northing = 11e5;
      break;
    case "D":
      northing = 2e6;
      break;
    case "E":
      northing = 28e5;
      break;
    case "F":
      northing = 37e5;
      break;
    case "G":
      northing = 46e5;
      break;
    case "H":
      northing = 55e5;
      break;
    case "J":
      northing = 64e5;
      break;
    case "K":
      northing = 73e5;
      break;
    case "L":
      northing = 82e5;
      break;
    case "M":
      northing = 91e5;
      break;
    case "N":
      northing = 0;
      break;
    case "P":
      northing = 8e5;
      break;
    case "Q":
      northing = 17e5;
      break;
    case "R":
      northing = 26e5;
      break;
    case "S":
      northing = 35e5;
      break;
    case "T":
      northing = 44e5;
      break;
    case "U":
      northing = 53e5;
      break;
    case "V":
      northing = 62e5;
      break;
    case "W":
      northing = 7e6;
      break;
    case "X":
      northing = 79e5;
      break;
    default:
      northing = -1;
  }
  if (northing >= 0) {
    return northing;
  } else {
    throw "Invalid zone letter: " + zoneLetter;
  }
}

// node_modules/proj4/lib/Point.js
function Point2(x, y, z) {
  if (!(this instanceof Point2)) {
    return new Point2(x, y, z);
  }
  if (Array.isArray(x)) {
    this.x = x[0];
    this.y = x[1];
    this.z = x[2] || 0;
  } else if (typeof x === "object") {
    this.x = x.x;
    this.y = x.y;
    this.z = x.z || 0;
  } else if (typeof x === "string" && typeof y === "undefined") {
    var coords = x.split(",");
    this.x = parseFloat(coords[0], 10);
    this.y = parseFloat(coords[1], 10);
    this.z = parseFloat(coords[2], 10) || 0;
  } else {
    this.x = x;
    this.y = y;
    this.z = z || 0;
  }
  console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
}
Point2.fromMGRS = function(mgrsStr) {
  return new Point2(toPoint(mgrsStr));
};
Point2.prototype.toMGRS = function(accuracy) {
  return forward2([this.x, this.y], accuracy);
};
var Point_default2 = Point2;

// node_modules/proj4/lib/common/pj_enfn.js
var C00 = 1;
var C02 = 0.25;
var C04 = 0.046875;
var C06 = 0.01953125;
var C08 = 0.01068115234375;
var C22 = 0.75;
var C44 = 0.46875;
var C46 = 0.013020833333333334;
var C48 = 0.007120768229166667;
var C66 = 0.3645833333333333;
var C68 = 0.005696614583333333;
var C88 = 0.3076171875;
function pj_enfn_default(es) {
  var en = [];
  en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
  en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  var t = es * es;
  en[2] = t * (C44 - es * (C46 + es * C48));
  t *= es;
  en[3] = t * (C66 - es * C68);
  en[4] = t * es * C88;
  return en;
}

// node_modules/proj4/lib/common/pj_mlfn.js
function pj_mlfn_default(phi, sphi, cphi, en) {
  cphi *= sphi;
  sphi *= sphi;
  return en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
}

// node_modules/proj4/lib/common/pj_inv_mlfn.js
var MAX_ITER = 20;
function pj_inv_mlfn_default(arg, es, en) {
  var k = 1 / (1 - es);
  var phi = arg;
  for (var i2 = MAX_ITER; i2; --i2) {
    var s = Math.sin(phi);
    var t = 1 - es * s * s;
    t = (pj_mlfn_default(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
    phi -= t;
    if (Math.abs(t) < EPSLN) {
      return phi;
    }
  }
  return phi;
}

// node_modules/proj4/lib/projections/tmerc.js
function init3() {
  this.x0 = this.x0 !== void 0 ? this.x0 : 0;
  this.y0 = this.y0 !== void 0 ? this.y0 : 0;
  this.long0 = this.long0 !== void 0 ? this.long0 : 0;
  this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0;
  if (this.es) {
    this.en = pj_enfn_default(this.es);
    this.ml0 = pj_mlfn_default(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);
  }
}
function forward3(p) {
  var lon = p.x;
  var lat = p.y;
  var delta_lon = adjust_lon_default(lon - this.long0);
  var con;
  var x, y;
  var sin_phi = Math.sin(lat);
  var cos_phi = Math.cos(lat);
  if (!this.es) {
    var b = cos_phi * Math.sin(delta_lon);
    if (Math.abs(Math.abs(b) - 1) < EPSLN) {
      return 93;
    } else {
      x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;
      y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));
      b = Math.abs(y);
      if (b >= 1) {
        if (b - 1 > EPSLN) {
          return 93;
        } else {
          y = 0;
        }
      } else {
        y = Math.acos(y);
      }
      if (lat < 0) {
        y = -y;
      }
      y = this.a * this.k0 * (y - this.lat0) + this.y0;
    }
  } else {
    var al = cos_phi * delta_lon;
    var als = Math.pow(al, 2);
    var c = this.ep2 * Math.pow(cos_phi, 2);
    var cs = Math.pow(c, 2);
    var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;
    var t = Math.pow(tq, 2);
    var ts = Math.pow(t, 2);
    con = 1 - this.es * Math.pow(sin_phi, 2);
    al = al / Math.sqrt(con);
    var ml = pj_mlfn_default(lat, sin_phi, cos_phi, this.en);
    x = this.a * (this.k0 * al * (1 + als / 6 * (1 - t + c + als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c + als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) + this.x0;
    y = this.a * (this.k0 * (ml - this.ml0 + sin_phi * delta_lon * al / 2 * (1 + als / 12 * (5 - t + 9 * c + 4 * cs + als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c + als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) + this.y0;
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse3(p) {
  var con, phi;
  var lat, lon;
  var x = (p.x - this.x0) * (1 / this.a);
  var y = (p.y - this.y0) * (1 / this.a);
  if (!this.es) {
    var f = Math.exp(x / this.k0);
    var g = 0.5 * (f - 1 / f);
    var temp = this.lat0 + y / this.k0;
    var h = Math.cos(temp);
    con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));
    lat = Math.asin(con);
    if (y < 0) {
      lat = -lat;
    }
    if (g === 0 && h === 0) {
      lon = 0;
    } else {
      lon = adjust_lon_default(Math.atan2(g, h) + this.long0);
    }
  } else {
    con = this.ml0 + y / this.k0;
    phi = pj_inv_mlfn_default(con, this.es, this.en);
    if (Math.abs(phi) < HALF_PI) {
      var sin_phi = Math.sin(phi);
      var cos_phi = Math.cos(phi);
      var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;
      var c = this.ep2 * Math.pow(cos_phi, 2);
      var cs = Math.pow(c, 2);
      var t = Math.pow(tan_phi, 2);
      var ts = Math.pow(t, 2);
      con = 1 - this.es * Math.pow(sin_phi, 2);
      var d = x * Math.sqrt(con) / this.k0;
      var ds = Math.pow(d, 2);
      con = con * tan_phi;
      lat = phi - con * ds / (1 - this.es) * 0.5 * (1 - ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs - ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c - ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));
      lon = adjust_lon_default(this.long0 + d * (1 - ds / 6 * (1 + 2 * t + c - ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi);
    } else {
      lat = HALF_PI * sign_default(y);
      lon = 0;
    }
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names4 = ["Transverse_Mercator", "Transverse Mercator", "tmerc"];
var tmerc_default = {
  init: init3,
  forward: forward3,
  inverse: inverse3,
  names: names4
};

// node_modules/proj4/lib/common/sinh.js
function sinh_default(x) {
  var r = Math.exp(x);
  r = (r - 1 / r) / 2;
  return r;
}

// node_modules/proj4/lib/common/hypot.js
function hypot_default(x, y) {
  x = Math.abs(x);
  y = Math.abs(y);
  var a = Math.max(x, y);
  var b = Math.min(x, y) / (a ? a : 1);
  return a * Math.sqrt(1 + Math.pow(b, 2));
}

// node_modules/proj4/lib/common/log1py.js
function log1py_default(x) {
  var y = 1 + x;
  var z = y - 1;
  return z === 0 ? x : x * Math.log(y) / z;
}

// node_modules/proj4/lib/common/asinhy.js
function asinhy_default(x) {
  var y = Math.abs(x);
  y = log1py_default(y * (1 + y / (hypot_default(1, y) + 1)));
  return x < 0 ? -y : y;
}

// node_modules/proj4/lib/common/gatg.js
function gatg_default(pp, B) {
  var cos_2B = 2 * Math.cos(2 * B);
  var i2 = pp.length - 1;
  var h1 = pp[i2];
  var h2 = 0;
  var h;
  while (--i2 >= 0) {
    h = -h2 + cos_2B * h1 + pp[i2];
    h2 = h1;
    h1 = h;
  }
  return B + h * Math.sin(2 * B);
}

// node_modules/proj4/lib/common/clens.js
function clens_default(pp, arg_r) {
  var r = 2 * Math.cos(arg_r);
  var i2 = pp.length - 1;
  var hr1 = pp[i2];
  var hr2 = 0;
  var hr;
  while (--i2 >= 0) {
    hr = -hr2 + r * hr1 + pp[i2];
    hr2 = hr1;
    hr1 = hr;
  }
  return Math.sin(arg_r) * hr;
}

// node_modules/proj4/lib/common/cosh.js
function cosh_default(x) {
  var r = Math.exp(x);
  r = (r + 1 / r) / 2;
  return r;
}

// node_modules/proj4/lib/common/clens_cmplx.js
function clens_cmplx_default(pp, arg_r, arg_i) {
  var sin_arg_r = Math.sin(arg_r);
  var cos_arg_r = Math.cos(arg_r);
  var sinh_arg_i = sinh_default(arg_i);
  var cosh_arg_i = cosh_default(arg_i);
  var r = 2 * cos_arg_r * cosh_arg_i;
  var i2 = -2 * sin_arg_r * sinh_arg_i;
  var j = pp.length - 1;
  var hr = pp[j];
  var hi1 = 0;
  var hr1 = 0;
  var hi = 0;
  var hr2;
  var hi2;
  while (--j >= 0) {
    hr2 = hr1;
    hi2 = hi1;
    hr1 = hr;
    hi1 = hi;
    hr = -hr2 + r * hr1 - i2 * hi1 + pp[j];
    hi = -hi2 + i2 * hr1 + r * hi1;
  }
  r = sin_arg_r * cosh_arg_i;
  i2 = cos_arg_r * sinh_arg_i;
  return [r * hr - i2 * hi, r * hi + i2 * hr];
}

// node_modules/proj4/lib/projections/etmerc.js
function init4() {
  if (this.es === void 0 || this.es <= 0) {
    throw new Error("incorrect elliptical usage");
  }
  this.x0 = this.x0 !== void 0 ? this.x0 : 0;
  this.y0 = this.y0 !== void 0 ? this.y0 : 0;
  this.long0 = this.long0 !== void 0 ? this.long0 : 0;
  this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0;
  this.cgb = [];
  this.cbg = [];
  this.utg = [];
  this.gtu = [];
  var f = this.es / (1 + Math.sqrt(1 - this.es));
  var n = f / (2 - f);
  var np = n;
  this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675))))));
  this.cbg[0] = n * (-2 + n * (2 / 3 + n * (4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));
  np = np * n;
  this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));
  this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * (-13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));
  np = np * n;
  this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));
  this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));
  np = np * n;
  this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));
  this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * (-24832 / 14175)));
  np = np * n;
  this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));
  this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));
  np = np * n;
  this.cgb[5] = np * (601676 / 22275);
  this.cbg[5] = np * (444337 / 155925);
  np = Math.pow(n, 2);
  this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));
  this.utg[0] = n * (-0.5 + n * (2 / 3 + n * (-37 / 96 + n * (1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));
  this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));
  this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));
  this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));
  np = np * n;
  this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720))));
  this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));
  np = np * n;
  this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));
  this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));
  np = np * n;
  this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));
  this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));
  np = np * n;
  this.utg[5] = np * (-20648693 / 638668800);
  this.gtu[5] = np * (212378941 / 319334400);
  var Z3 = gatg_default(this.cbg, this.lat0);
  this.Zb = -this.Qn * (Z3 + clens_default(this.gtu, 2 * Z3));
}
function forward4(p) {
  var Ce = adjust_lon_default(p.x - this.long0);
  var Cn = p.y;
  Cn = gatg_default(this.cbg, Cn);
  var sin_Cn = Math.sin(Cn);
  var cos_Cn = Math.cos(Cn);
  var sin_Ce = Math.sin(Ce);
  var cos_Ce = Math.cos(Ce);
  Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);
  Ce = Math.atan2(sin_Ce * cos_Cn, hypot_default(sin_Cn, cos_Cn * cos_Ce));
  Ce = asinhy_default(Math.tan(Ce));
  var tmp = clens_cmplx_default(this.gtu, 2 * Cn, 2 * Ce);
  Cn = Cn + tmp[0];
  Ce = Ce + tmp[1];
  var x;
  var y;
  if (Math.abs(Ce) <= 2.623395162778) {
    x = this.a * (this.Qn * Ce) + this.x0;
    y = this.a * (this.Qn * Cn + this.Zb) + this.y0;
  } else {
    x = Infinity;
    y = Infinity;
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse4(p) {
  var Ce = (p.x - this.x0) * (1 / this.a);
  var Cn = (p.y - this.y0) * (1 / this.a);
  Cn = (Cn - this.Zb) / this.Qn;
  Ce = Ce / this.Qn;
  var lon;
  var lat;
  if (Math.abs(Ce) <= 2.623395162778) {
    var tmp = clens_cmplx_default(this.utg, 2 * Cn, 2 * Ce);
    Cn = Cn + tmp[0];
    Ce = Ce + tmp[1];
    Ce = Math.atan(sinh_default(Ce));
    var sin_Cn = Math.sin(Cn);
    var cos_Cn = Math.cos(Cn);
    var sin_Ce = Math.sin(Ce);
    var cos_Ce = Math.cos(Ce);
    Cn = Math.atan2(sin_Cn * cos_Ce, hypot_default(sin_Ce, cos_Ce * cos_Cn));
    Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
    lon = adjust_lon_default(Ce + this.long0);
    lat = gatg_default(this.cgb, Cn);
  } else {
    lon = Infinity;
    lat = Infinity;
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names5 = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc"];
var etmerc_default = {
  init: init4,
  forward: forward4,
  inverse: inverse4,
  names: names5
};

// node_modules/proj4/lib/common/adjust_zone.js
function adjust_zone_default(zone, lon) {
  if (zone === void 0) {
    zone = Math.floor((adjust_lon_default(lon) + Math.PI) * 30 / Math.PI) + 1;
    if (zone < 0) {
      return 0;
    } else if (zone > 60) {
      return 60;
    }
  }
  return zone;
}

// node_modules/proj4/lib/projections/utm.js
var dependsOn = "etmerc";
function init5() {
  var zone = adjust_zone_default(this.zone, this.long0);
  if (zone === void 0) {
    throw new Error("unknown utm zone");
  }
  this.lat0 = 0;
  this.long0 = (6 * Math.abs(zone) - 183) * D2R;
  this.x0 = 5e5;
  this.y0 = this.utmSouth ? 1e7 : 0;
  this.k0 = 0.9996;
  etmerc_default.init.apply(this);
  this.forward = etmerc_default.forward;
  this.inverse = etmerc_default.inverse;
}
var names6 = ["Universal Transverse Mercator System", "utm"];
var utm_default = {
  init: init5,
  names: names6,
  dependsOn
};

// node_modules/proj4/lib/common/srat.js
function srat_default(esinp, exp) {
  return Math.pow((1 - esinp) / (1 + esinp), exp);
}

// node_modules/proj4/lib/projections/gauss.js
var MAX_ITER2 = 20;
function init6() {
  var sphi = Math.sin(this.lat0);
  var cphi = Math.cos(this.lat0);
  cphi *= cphi;
  this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);
  this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));
  this.phic0 = Math.asin(sphi / this.C);
  this.ratexp = 0.5 * this.C * this.e;
  this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat_default(this.e * sphi, this.ratexp));
}
function forward5(p) {
  var lon = p.x;
  var lat = p.y;
  p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat_default(this.e * Math.sin(lat), this.ratexp)) - HALF_PI;
  p.x = this.C * lon;
  return p;
}
function inverse5(p) {
  var DEL_TOL = 1e-14;
  var lon = p.x / this.C;
  var lat = p.y;
  var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);
  for (var i2 = MAX_ITER2; i2 > 0; --i2) {
    lat = 2 * Math.atan(num * srat_default(this.e * Math.sin(p.y), -0.5 * this.e)) - HALF_PI;
    if (Math.abs(lat - p.y) < DEL_TOL) {
      break;
    }
    p.y = lat;
  }
  if (!i2) {
    return null;
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names7 = ["gauss"];
var gauss_default = {
  init: init6,
  forward: forward5,
  inverse: inverse5,
  names: names7
};

// node_modules/proj4/lib/projections/sterea.js
function init7() {
  gauss_default.init.apply(this);
  if (!this.rc) {
    return;
  }
  this.sinc0 = Math.sin(this.phic0);
  this.cosc0 = Math.cos(this.phic0);
  this.R2 = 2 * this.rc;
  if (!this.title) {
    this.title = "Oblique Stereographic Alternative";
  }
}
function forward6(p) {
  var sinc, cosc, cosl, k;
  p.x = adjust_lon_default(p.x - this.long0);
  gauss_default.forward.apply(this, [p]);
  sinc = Math.sin(p.y);
  cosc = Math.cos(p.y);
  cosl = Math.cos(p.x);
  k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
  p.x = k * cosc * Math.sin(p.x);
  p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
  p.x = this.a * p.x + this.x0;
  p.y = this.a * p.y + this.y0;
  return p;
}
function inverse6(p) {
  var sinc, cosc, lon, lat, rho;
  p.x = (p.x - this.x0) / this.a;
  p.y = (p.y - this.y0) / this.a;
  p.x /= this.k0;
  p.y /= this.k0;
  if (rho = Math.sqrt(p.x * p.x + p.y * p.y)) {
    var c = 2 * Math.atan2(rho, this.R2);
    sinc = Math.sin(c);
    cosc = Math.cos(c);
    lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
    lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
  } else {
    lat = this.phic0;
    lon = 0;
  }
  p.x = lon;
  p.y = lat;
  gauss_default.inverse.apply(this, [p]);
  p.x = adjust_lon_default(p.x + this.long0);
  return p;
}
var names8 = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
var sterea_default = {
  init: init7,
  forward: forward6,
  inverse: inverse6,
  names: names8
};

// node_modules/proj4/lib/projections/stere.js
function ssfn_(phit, sinphi, eccen) {
  sinphi *= eccen;
  return Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen);
}
function init8() {
  this.coslat0 = Math.cos(this.lat0);
  this.sinlat0 = Math.sin(this.lat0);
  if (this.sphere) {
    if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
      this.k0 = 0.5 * (1 + sign_default(this.lat0) * Math.sin(this.lat_ts));
    }
  } else {
    if (Math.abs(this.coslat0) <= EPSLN) {
      if (this.lat0 > 0) {
        this.con = 1;
      } else {
        this.con = -1;
      }
    }
    this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
    if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
      this.k0 = 0.5 * this.cons * msfnz_default(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz_default(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));
    }
    this.ms1 = msfnz_default(this.e, this.sinlat0, this.coslat0);
    this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;
    this.cosX0 = Math.cos(this.X0);
    this.sinX0 = Math.sin(this.X0);
  }
}
function forward7(p) {
  var lon = p.x;
  var lat = p.y;
  var sinlat = Math.sin(lat);
  var coslat = Math.cos(lat);
  var A3, X, sinX, cosX, ts, rh;
  var dlon = adjust_lon_default(lon - this.long0);
  if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
    p.x = NaN;
    p.y = NaN;
    return p;
  }
  if (this.sphere) {
    A3 = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));
    p.x = this.a * A3 * coslat * Math.sin(dlon) + this.x0;
    p.y = this.a * A3 * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;
    return p;
  } else {
    X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;
    cosX = Math.cos(X);
    sinX = Math.sin(X);
    if (Math.abs(this.coslat0) <= EPSLN) {
      ts = tsfnz_default(this.e, lat * this.con, this.con * sinlat);
      rh = 2 * this.a * this.k0 * ts / this.cons;
      p.x = this.x0 + rh * Math.sin(lon - this.long0);
      p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);
      return p;
    } else if (Math.abs(this.sinlat0) < EPSLN) {
      A3 = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));
      p.y = A3 * sinX;
    } else {
      A3 = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));
      p.y = A3 * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;
    }
    p.x = A3 * cosX * Math.sin(dlon) + this.x0;
  }
  return p;
}
function inverse7(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var lon, lat, ts, ce, Chi;
  var rh = Math.sqrt(p.x * p.x + p.y * p.y);
  if (this.sphere) {
    var c = 2 * Math.atan(rh / (2 * this.a * this.k0));
    lon = this.long0;
    lat = this.lat0;
    if (rh <= EPSLN) {
      p.x = lon;
      p.y = lat;
      return p;
    }
    lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
    if (Math.abs(this.coslat0) < EPSLN) {
      if (this.lat0 > 0) {
        lon = adjust_lon_default(this.long0 + Math.atan2(p.x, -1 * p.y));
      } else {
        lon = adjust_lon_default(this.long0 + Math.atan2(p.x, p.y));
      }
    } else {
      lon = adjust_lon_default(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));
    }
    p.x = lon;
    p.y = lat;
    return p;
  } else {
    if (Math.abs(this.coslat0) <= EPSLN) {
      if (rh <= EPSLN) {
        lat = this.lat0;
        lon = this.long0;
        p.x = lon;
        p.y = lat;
        return p;
      }
      p.x *= this.con;
      p.y *= this.con;
      ts = rh * this.cons / (2 * this.a * this.k0);
      lat = this.con * phi2z_default(this.e, ts);
      lon = this.con * adjust_lon_default(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
    } else {
      ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
      lon = this.long0;
      if (rh <= EPSLN) {
        Chi = this.X0;
      } else {
        Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
        lon = adjust_lon_default(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));
      }
      lat = -1 * phi2z_default(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
    }
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names9 = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"];
var stere_default = {
  init: init8,
  forward: forward7,
  inverse: inverse7,
  names: names9,
  ssfn_
};

// node_modules/proj4/lib/projections/somerc.js
function init9() {
  var phy0 = this.lat0;
  this.lambda0 = this.long0;
  var sinPhy0 = Math.sin(phy0);
  var semiMajorAxis = this.a;
  var invF = this.rf;
  var flattening = 1 / invF;
  var e2 = 2 * flattening - Math.pow(flattening, 2);
  var e = this.e = Math.sqrt(e2);
  this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));
  this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));
  this.b0 = Math.asin(sinPhy0 / this.alpha);
  var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));
  var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));
  var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));
  this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
}
function forward8(p) {
  var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
  var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
  var S = -this.alpha * (Sa1 + Sa2) + this.K;
  var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);
  var I2 = this.alpha * (p.x - this.lambda0);
  var rotI = Math.atan(Math.sin(I2) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I2)));
  var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I2));
  p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;
  p.x = this.R * rotI + this.x0;
  return p;
}
function inverse8(p) {
  var Y = p.x - this.x0;
  var X = p.y - this.y0;
  var rotI = Y / this.R;
  var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);
  var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));
  var I2 = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));
  var lambda = this.lambda0 + I2 / this.alpha;
  var S = 0;
  var phy = b;
  var prevPhy = -1e3;
  var iteration = 0;
  while (Math.abs(phy - prevPhy) > 1e-7) {
    if (++iteration > 20) {
      return;
    }
    S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));
    prevPhy = phy;
    phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;
  }
  p.x = lambda;
  p.y = phy;
  return p;
}
var names10 = ["somerc"];
var somerc_default = {
  init: init9,
  forward: forward8,
  inverse: inverse8,
  names: names10
};

// node_modules/proj4/lib/projections/omerc.js
function init10() {
  this.no_off = this.no_off || false;
  this.no_rot = this.no_rot || false;
  if (isNaN(this.k0)) {
    this.k0 = 1;
  }
  var sinlat = Math.sin(this.lat0);
  var coslat = Math.cos(this.lat0);
  var con = this.e * sinlat;
  this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));
  this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);
  var t02 = tsfnz_default(this.e, this.lat0, sinlat);
  var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));
  if (dl * dl < 1) {
    dl = 1;
  }
  var fl;
  var gl;
  if (!isNaN(this.longc)) {
    if (this.lat0 >= 0) {
      fl = dl + Math.sqrt(dl * dl - 1);
    } else {
      fl = dl - Math.sqrt(dl * dl - 1);
    }
    this.el = fl * Math.pow(t02, this.bl);
    gl = 0.5 * (fl - 1 / fl);
    this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);
    this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;
  } else {
    var t12 = tsfnz_default(this.e, this.lat1, Math.sin(this.lat1));
    var t22 = tsfnz_default(this.e, this.lat2, Math.sin(this.lat2));
    if (this.lat0 >= 0) {
      this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t02, this.bl);
    } else {
      this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t02, this.bl);
    }
    var hl = Math.pow(t12, this.bl);
    var ll = Math.pow(t22, this.bl);
    fl = this.el / hl;
    gl = 0.5 * (fl - 1 / fl);
    var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);
    var pl = (ll - hl) / (ll + hl);
    var dlon12 = adjust_lon_default(this.long1 - this.long2);
    this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * dlon12) / pl) / this.bl;
    this.long0 = adjust_lon_default(this.long0);
    var dlon10 = adjust_lon_default(this.long1 - this.long0);
    this.gamma0 = Math.atan(Math.sin(this.bl * dlon10) / gl);
    this.alpha = Math.asin(dl * Math.sin(this.gamma0));
  }
  if (this.no_off) {
    this.uc = 0;
  } else {
    if (this.lat0 >= 0) {
      this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
    } else {
      this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));
    }
  }
}
function forward9(p) {
  var lon = p.x;
  var lat = p.y;
  var dlon = adjust_lon_default(lon - this.long0);
  var us, vs;
  var con;
  if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
    if (lat > 0) {
      con = -1;
    } else {
      con = 1;
    }
    vs = this.al / this.bl * Math.log(Math.tan(FORTPI + con * this.gamma0 * 0.5));
    us = -1 * con * HALF_PI * this.al / this.bl;
  } else {
    var t = tsfnz_default(this.e, lat, Math.sin(lat));
    var ql = this.el / Math.pow(t, this.bl);
    var sl = 0.5 * (ql - 1 / ql);
    var tl = 0.5 * (ql + 1 / ql);
    var vl = Math.sin(this.bl * dlon);
    var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;
    if (Math.abs(Math.abs(ul) - 1) <= EPSLN) {
      vs = Number.POSITIVE_INFINITY;
    } else {
      vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;
    }
    if (Math.abs(Math.cos(this.bl * dlon)) <= EPSLN) {
      us = this.al * this.bl * dlon;
    } else {
      us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;
    }
  }
  if (this.no_rot) {
    p.x = this.x0 + us;
    p.y = this.y0 + vs;
  } else {
    us -= this.uc;
    p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);
    p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);
  }
  return p;
}
function inverse9(p) {
  var us, vs;
  if (this.no_rot) {
    vs = p.y - this.y0;
    us = p.x - this.x0;
  } else {
    vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);
    us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);
    us += this.uc;
  }
  var qp = Math.exp(-1 * this.bl * vs / this.al);
  var sp2 = 0.5 * (qp - 1 / qp);
  var tp = 0.5 * (qp + 1 / qp);
  var vp = Math.sin(this.bl * us / this.al);
  var up = (vp * Math.cos(this.gamma0) + sp2 * Math.sin(this.gamma0)) / tp;
  var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);
  if (Math.abs(up - 1) < EPSLN) {
    p.x = this.long0;
    p.y = HALF_PI;
  } else if (Math.abs(up + 1) < EPSLN) {
    p.x = this.long0;
    p.y = -1 * HALF_PI;
  } else {
    p.y = phi2z_default(this.e, ts);
    p.x = adjust_lon_default(this.long0 - Math.atan2(sp2 * Math.cos(this.gamma0) - vp * Math.sin(this.gamma0), Math.cos(this.bl * us / this.al)) / this.bl);
  }
  return p;
}
var names11 = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "omerc"];
var omerc_default = {
  init: init10,
  forward: forward9,
  inverse: inverse9,
  names: names11
};

// node_modules/proj4/lib/projections/lcc.js
function init11() {
  if (!this.lat2) {
    this.lat2 = this.lat1;
  }
  if (!this.k0) {
    this.k0 = 1;
  }
  this.x0 = this.x0 || 0;
  this.y0 = this.y0 || 0;
  if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
    return;
  }
  var temp = this.b / this.a;
  this.e = Math.sqrt(1 - temp * temp);
  var sin1 = Math.sin(this.lat1);
  var cos1 = Math.cos(this.lat1);
  var ms1 = msfnz_default(this.e, sin1, cos1);
  var ts1 = tsfnz_default(this.e, this.lat1, sin1);
  var sin2 = Math.sin(this.lat2);
  var cos2 = Math.cos(this.lat2);
  var ms2 = msfnz_default(this.e, sin2, cos2);
  var ts2 = tsfnz_default(this.e, this.lat2, sin2);
  var ts0 = tsfnz_default(this.e, this.lat0, Math.sin(this.lat0));
  if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
    this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
  } else {
    this.ns = sin1;
  }
  if (isNaN(this.ns)) {
    this.ns = sin1;
  }
  this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
  this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
  if (!this.title) {
    this.title = "Lambert Conformal Conic";
  }
}
function forward10(p) {
  var lon = p.x;
  var lat = p.y;
  if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {
    lat = sign_default(lat) * (HALF_PI - 2 * EPSLN);
  }
  var con = Math.abs(Math.abs(lat) - HALF_PI);
  var ts, rh1;
  if (con > EPSLN) {
    ts = tsfnz_default(this.e, lat, Math.sin(lat));
    rh1 = this.a * this.f0 * Math.pow(ts, this.ns);
  } else {
    con = lat * this.ns;
    if (con <= 0) {
      return null;
    }
    rh1 = 0;
  }
  var theta = this.ns * adjust_lon_default(lon - this.long0);
  p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
  p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
  return p;
}
function inverse10(p) {
  var rh1, con, ts;
  var lat, lon;
  var x = (p.x - this.x0) / this.k0;
  var y = this.rh - (p.y - this.y0) / this.k0;
  if (this.ns > 0) {
    rh1 = Math.sqrt(x * x + y * y);
    con = 1;
  } else {
    rh1 = -Math.sqrt(x * x + y * y);
    con = -1;
  }
  var theta = 0;
  if (rh1 !== 0) {
    theta = Math.atan2(con * x, con * y);
  }
  if (rh1 !== 0 || this.ns > 0) {
    con = 1 / this.ns;
    ts = Math.pow(rh1 / (this.a * this.f0), con);
    lat = phi2z_default(this.e, ts);
    if (lat === -9999) {
      return null;
    }
  } else {
    lat = -HALF_PI;
  }
  lon = adjust_lon_default(theta / this.ns + this.long0);
  p.x = lon;
  p.y = lat;
  return p;
}
var names12 = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_2SP", "lcc"];
var lcc_default = {
  init: init11,
  forward: forward10,
  inverse: inverse10,
  names: names12
};

// node_modules/proj4/lib/projections/krovak.js
function init12() {
  this.a = 6377397155e-3;
  this.es = 0.006674372230614;
  this.e = Math.sqrt(this.es);
  if (!this.lat0) {
    this.lat0 = 0.863937979737193;
  }
  if (!this.long0) {
    this.long0 = 0.7417649320975901 - 0.308341501185665;
  }
  if (!this.k0) {
    this.k0 = 0.9999;
  }
  this.s45 = 0.785398163397448;
  this.s90 = 2 * this.s45;
  this.fi0 = this.lat0;
  this.e2 = this.es;
  this.e = Math.sqrt(this.e2);
  this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2));
  this.uq = 1.04216856380474;
  this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);
  this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);
  this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;
  this.k1 = this.k0;
  this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));
  this.s0 = 1.37008346281555;
  this.n = Math.sin(this.s0);
  this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);
  this.ad = this.s90 - this.uq;
}
function forward11(p) {
  var gfi, u2, deltav, s, d, eps, ro;
  var lon = p.x;
  var lat = p.y;
  var delta_lon = adjust_lon_default(lon - this.long0);
  gfi = Math.pow((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat)), this.alfa * this.e / 2);
  u2 = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
  deltav = -delta_lon * this.alfa;
  s = Math.asin(Math.cos(this.ad) * Math.sin(u2) + Math.sin(this.ad) * Math.cos(u2) * Math.cos(deltav));
  d = Math.asin(Math.cos(u2) * Math.sin(deltav) / Math.cos(s));
  eps = this.n * d;
  ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
  p.y = ro * Math.cos(eps) / 1;
  p.x = ro * Math.sin(eps) / 1;
  if (!this.czech) {
    p.y *= -1;
    p.x *= -1;
  }
  return p;
}
function inverse11(p) {
  var u2, deltav, s, d, eps, ro, fi1;
  var ok;
  var tmp = p.x;
  p.x = p.y;
  p.y = tmp;
  if (!this.czech) {
    p.y *= -1;
    p.x *= -1;
  }
  ro = Math.sqrt(p.x * p.x + p.y * p.y);
  eps = Math.atan2(p.y, p.x);
  d = eps / Math.sin(this.s0);
  s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);
  u2 = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));
  deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u2));
  p.x = this.long0 - deltav / this.alfa;
  fi1 = u2;
  ok = 0;
  var iter = 0;
  do {
    p.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(u2 / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);
    if (Math.abs(fi1 - p.y) < 1e-10) {
      ok = 1;
    }
    fi1 = p.y;
    iter += 1;
  } while (ok === 0 && iter < 15);
  if (iter >= 15) {
    return null;
  }
  return p;
}
var names13 = ["Krovak", "krovak"];
var krovak_default = {
  init: init12,
  forward: forward11,
  inverse: inverse11,
  names: names13
};

// node_modules/proj4/lib/common/mlfn.js
function mlfn_default(e0, e1, e2, e3, phi) {
  return e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi);
}

// node_modules/proj4/lib/common/e0fn.js
function e0fn_default(x) {
  return 1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x));
}

// node_modules/proj4/lib/common/e1fn.js
function e1fn_default(x) {
  return 0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x));
}

// node_modules/proj4/lib/common/e2fn.js
function e2fn_default(x) {
  return 0.05859375 * x * x * (1 + 0.75 * x);
}

// node_modules/proj4/lib/common/e3fn.js
function e3fn_default(x) {
  return x * x * x * (35 / 3072);
}

// node_modules/proj4/lib/common/gN.js
function gN_default(a, e, sinphi) {
  var temp = e * sinphi;
  return a / Math.sqrt(1 - temp * temp);
}

// node_modules/proj4/lib/common/adjust_lat.js
function adjust_lat_default(x) {
  return Math.abs(x) < HALF_PI ? x : x - sign_default(x) * Math.PI;
}

// node_modules/proj4/lib/common/imlfn.js
function imlfn_default(ml, e0, e1, e2, e3) {
  var phi;
  var dphi;
  phi = ml / e0;
  for (var i2 = 0; i2 < 15; i2++) {
    dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));
    phi += dphi;
    if (Math.abs(dphi) <= 1e-10) {
      return phi;
    }
  }
  return NaN;
}

// node_modules/proj4/lib/projections/cass.js
function init13() {
  if (!this.sphere) {
    this.e0 = e0fn_default(this.es);
    this.e1 = e1fn_default(this.es);
    this.e2 = e2fn_default(this.es);
    this.e3 = e3fn_default(this.es);
    this.ml0 = this.a * mlfn_default(this.e0, this.e1, this.e2, this.e3, this.lat0);
  }
}
function forward12(p) {
  var x, y;
  var lam = p.x;
  var phi = p.y;
  lam = adjust_lon_default(lam - this.long0);
  if (this.sphere) {
    x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
    y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);
  } else {
    var sinphi = Math.sin(phi);
    var cosphi = Math.cos(phi);
    var nl = gN_default(this.a, this.e, sinphi);
    var tl = Math.tan(phi) * Math.tan(phi);
    var al = lam * Math.cos(phi);
    var asq = al * al;
    var cl = this.es * cosphi * cosphi / (1 - this.es);
    var ml = this.a * mlfn_default(this.e0, this.e1, this.e2, this.e3, phi);
    x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));
    y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);
  }
  p.x = x + this.x0;
  p.y = y + this.y0;
  return p;
}
function inverse12(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var x = p.x / this.a;
  var y = p.y / this.a;
  var phi, lam;
  if (this.sphere) {
    var dd = y + this.lat0;
    phi = Math.asin(Math.sin(dd) * Math.cos(x));
    lam = Math.atan2(Math.tan(x), Math.cos(dd));
  } else {
    var ml1 = this.ml0 / this.a + y;
    var phi1 = imlfn_default(ml1, this.e0, this.e1, this.e2, this.e3);
    if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {
      p.x = this.long0;
      p.y = HALF_PI;
      if (y < 0) {
        p.y *= -1;
      }
      return p;
    }
    var nl1 = gN_default(this.a, this.e, Math.sin(phi1));
    var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);
    var tl1 = Math.pow(Math.tan(phi1), 2);
    var dl = x * this.a / nl1;
    var dsq = dl * dl;
    phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);
    lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
  }
  p.x = adjust_lon_default(lam + this.long0);
  p.y = adjust_lat_default(phi);
  return p;
}
var names14 = ["Cassini", "Cassini_Soldner", "cass"];
var cass_default = {
  init: init13,
  forward: forward12,
  inverse: inverse12,
  names: names14
};

// node_modules/proj4/lib/common/qsfnz.js
function qsfnz_default(eccent, sinphi) {
  var con;
  if (eccent > 1e-7) {
    con = eccent * sinphi;
    return (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  } else {
    return 2 * sinphi;
  }
}

// node_modules/proj4/lib/projections/laea.js
var S_POLE = 1;
var N_POLE = 2;
var EQUIT = 3;
var OBLIQ = 4;
function init14() {
  var t = Math.abs(this.lat0);
  if (Math.abs(t - HALF_PI) < EPSLN) {
    this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;
  } else if (Math.abs(t) < EPSLN) {
    this.mode = this.EQUIT;
  } else {
    this.mode = this.OBLIQ;
  }
  if (this.es > 0) {
    var sinphi;
    this.qp = qsfnz_default(this.e, 1);
    this.mmf = 0.5 / (1 - this.es);
    this.apa = authset(this.es);
    switch (this.mode) {
      case this.N_POLE:
        this.dd = 1;
        break;
      case this.S_POLE:
        this.dd = 1;
        break;
      case this.EQUIT:
        this.rq = Math.sqrt(0.5 * this.qp);
        this.dd = 1 / this.rq;
        this.xmf = 1;
        this.ymf = 0.5 * this.qp;
        break;
      case this.OBLIQ:
        this.rq = Math.sqrt(0.5 * this.qp);
        sinphi = Math.sin(this.lat0);
        this.sinb1 = qsfnz_default(this.e, sinphi) / this.qp;
        this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);
        this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);
        this.ymf = (this.xmf = this.rq) / this.dd;
        this.xmf *= this.dd;
        break;
    }
  } else {
    if (this.mode === this.OBLIQ) {
      this.sinph0 = Math.sin(this.lat0);
      this.cosph0 = Math.cos(this.lat0);
    }
  }
}
function forward13(p) {
  var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
  var lam = p.x;
  var phi = p.y;
  lam = adjust_lon_default(lam - this.long0);
  if (this.sphere) {
    sinphi = Math.sin(phi);
    cosphi = Math.cos(phi);
    coslam = Math.cos(lam);
    if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      y = this.mode === this.EQUIT ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
      if (y <= EPSLN) {
        return null;
      }
      y = Math.sqrt(2 / y);
      x = y * cosphi * Math.sin(lam);
      y *= this.mode === this.EQUIT ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
    } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
      if (this.mode === this.N_POLE) {
        coslam = -coslam;
      }
      if (Math.abs(phi + this.phi0) < EPSLN) {
        return null;
      }
      y = FORTPI - phi * 0.5;
      y = 2 * (this.mode === this.S_POLE ? Math.cos(y) : Math.sin(y));
      x = y * Math.sin(lam);
      y *= coslam;
    }
  } else {
    sinb = 0;
    cosb = 0;
    b = 0;
    coslam = Math.cos(lam);
    sinlam = Math.sin(lam);
    sinphi = Math.sin(phi);
    q = qsfnz_default(this.e, sinphi);
    if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      sinb = q / this.qp;
      cosb = Math.sqrt(1 - sinb * sinb);
    }
    switch (this.mode) {
      case this.OBLIQ:
        b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
        break;
      case this.EQUIT:
        b = 1 + cosb * coslam;
        break;
      case this.N_POLE:
        b = HALF_PI + phi;
        q = this.qp - q;
        break;
      case this.S_POLE:
        b = phi - HALF_PI;
        q = this.qp + q;
        break;
    }
    if (Math.abs(b) < EPSLN) {
      return null;
    }
    switch (this.mode) {
      case this.OBLIQ:
      case this.EQUIT:
        b = Math.sqrt(2 / b);
        if (this.mode === this.OBLIQ) {
          y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
        } else {
          y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
        }
        x = this.xmf * b * cosb * sinlam;
        break;
      case this.N_POLE:
      case this.S_POLE:
        if (q >= 0) {
          x = (b = Math.sqrt(q)) * sinlam;
          y = coslam * (this.mode === this.S_POLE ? b : -b);
        } else {
          x = y = 0;
        }
        break;
    }
  }
  p.x = this.a * x + this.x0;
  p.y = this.a * y + this.y0;
  return p;
}
function inverse13(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var x = p.x / this.a;
  var y = p.y / this.a;
  var lam, phi, cCe, sCe, q, rho, ab;
  if (this.sphere) {
    var cosz = 0, rh, sinz = 0;
    rh = Math.sqrt(x * x + y * y);
    phi = rh * 0.5;
    if (phi > 1) {
      return null;
    }
    phi = 2 * Math.asin(phi);
    if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      sinz = Math.sin(phi);
      cosz = Math.cos(phi);
    }
    switch (this.mode) {
      case this.EQUIT:
        phi = Math.abs(rh) <= EPSLN ? 0 : Math.asin(y * sinz / rh);
        x *= sinz;
        y = cosz * rh;
        break;
      case this.OBLIQ:
        phi = Math.abs(rh) <= EPSLN ? this.phi0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);
        x *= sinz * this.cosph0;
        y = (cosz - Math.sin(phi) * this.sinph0) * rh;
        break;
      case this.N_POLE:
        y = -y;
        phi = HALF_PI - phi;
        break;
      case this.S_POLE:
        phi -= HALF_PI;
        break;
    }
    lam = y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(x, y);
  } else {
    ab = 0;
    if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
      x /= this.dd;
      y *= this.dd;
      rho = Math.sqrt(x * x + y * y);
      if (rho < EPSLN) {
        p.x = 0;
        p.y = this.phi0;
        return p;
      }
      sCe = 2 * Math.asin(0.5 * rho / this.rq);
      cCe = Math.cos(sCe);
      x *= sCe = Math.sin(sCe);
      if (this.mode === this.OBLIQ) {
        ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;
        q = this.qp * ab;
        y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;
      } else {
        ab = y * sCe / rho;
        q = this.qp * ab;
        y = rho * cCe;
      }
    } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
      if (this.mode === this.N_POLE) {
        y = -y;
      }
      q = x * x + y * y;
      if (!q) {
        p.x = 0;
        p.y = this.phi0;
        return p;
      }
      ab = 1 - q / this.qp;
      if (this.mode === this.S_POLE) {
        ab = -ab;
      }
    }
    lam = Math.atan2(x, y);
    phi = authlat(Math.asin(ab), this.apa);
  }
  p.x = adjust_lon_default(this.long0 + lam);
  p.y = phi;
  return p;
}
var P00 = 0.3333333333333333;
var P01 = 0.17222222222222222;
var P02 = 0.10257936507936508;
var P10 = 0.06388888888888888;
var P11 = 0.0664021164021164;
var P20 = 0.016415012942191543;
function authset(es) {
  var t;
  var APA = [];
  APA[0] = es * P00;
  t = es * es;
  APA[0] += t * P01;
  APA[1] = t * P10;
  t *= es;
  APA[0] += t * P02;
  APA[1] += t * P11;
  APA[2] = t * P20;
  return APA;
}
function authlat(beta, APA) {
  var t = beta + beta;
  return beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t);
}
var names15 = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
var laea_default = {
  init: init14,
  forward: forward13,
  inverse: inverse13,
  names: names15,
  S_POLE,
  N_POLE,
  EQUIT,
  OBLIQ
};

// node_modules/proj4/lib/common/asinz.js
function asinz_default(x) {
  if (Math.abs(x) > 1) {
    x = x > 1 ? 1 : -1;
  }
  return Math.asin(x);
}

// node_modules/proj4/lib/projections/aea.js
function init15() {
  if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
    return;
  }
  this.temp = this.b / this.a;
  this.es = 1 - Math.pow(this.temp, 2);
  this.e3 = Math.sqrt(this.es);
  this.sin_po = Math.sin(this.lat1);
  this.cos_po = Math.cos(this.lat1);
  this.t1 = this.sin_po;
  this.con = this.sin_po;
  this.ms1 = msfnz_default(this.e3, this.sin_po, this.cos_po);
  this.qs1 = qsfnz_default(this.e3, this.sin_po, this.cos_po);
  this.sin_po = Math.sin(this.lat2);
  this.cos_po = Math.cos(this.lat2);
  this.t2 = this.sin_po;
  this.ms2 = msfnz_default(this.e3, this.sin_po, this.cos_po);
  this.qs2 = qsfnz_default(this.e3, this.sin_po, this.cos_po);
  this.sin_po = Math.sin(this.lat0);
  this.cos_po = Math.cos(this.lat0);
  this.t3 = this.sin_po;
  this.qs0 = qsfnz_default(this.e3, this.sin_po, this.cos_po);
  if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
    this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);
  } else {
    this.ns0 = this.con;
  }
  this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;
  this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;
}
function forward14(p) {
  var lon = p.x;
  var lat = p.y;
  this.sin_phi = Math.sin(lat);
  this.cos_phi = Math.cos(lat);
  var qs = qsfnz_default(this.e3, this.sin_phi, this.cos_phi);
  var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
  var theta = this.ns0 * adjust_lon_default(lon - this.long0);
  var x = rh1 * Math.sin(theta) + this.x0;
  var y = this.rh - rh1 * Math.cos(theta) + this.y0;
  p.x = x;
  p.y = y;
  return p;
}
function inverse14(p) {
  var rh1, qs, con, theta, lon, lat;
  p.x -= this.x0;
  p.y = this.rh - p.y + this.y0;
  if (this.ns0 >= 0) {
    rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
    con = 1;
  } else {
    rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
    con = -1;
  }
  theta = 0;
  if (rh1 !== 0) {
    theta = Math.atan2(con * p.x, con * p.y);
  }
  con = rh1 * this.ns0 / this.a;
  if (this.sphere) {
    lat = Math.asin((this.c - con * con) / (2 * this.ns0));
  } else {
    qs = (this.c - con * con) / this.ns0;
    lat = this.phi1z(this.e3, qs);
  }
  lon = adjust_lon_default(theta / this.ns0 + this.long0);
  p.x = lon;
  p.y = lat;
  return p;
}
function phi1z(eccent, qs) {
  var sinphi, cosphi, con, com, dphi;
  var phi = asinz_default(0.5 * qs);
  if (eccent < EPSLN) {
    return phi;
  }
  var eccnts = eccent * eccent;
  for (var i2 = 1; i2 <= 25; i2++) {
    sinphi = Math.sin(phi);
    cosphi = Math.cos(phi);
    con = eccent * sinphi;
    com = 1 - con * con;
    dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
    phi = phi + dphi;
    if (Math.abs(dphi) <= 1e-7) {
      return phi;
    }
  }
  return null;
}
var names16 = ["Albers_Conic_Equal_Area", "Albers", "aea"];
var aea_default = {
  init: init15,
  forward: forward14,
  inverse: inverse14,
  names: names16,
  phi1z
};

// node_modules/proj4/lib/projections/gnom.js
function init16() {
  this.sin_p14 = Math.sin(this.lat0);
  this.cos_p14 = Math.cos(this.lat0);
  this.infinity_dist = 1e3 * this.a;
  this.rc = 1;
}
function forward15(p) {
  var sinphi, cosphi;
  var dlon;
  var coslon;
  var ksp;
  var g;
  var x, y;
  var lon = p.x;
  var lat = p.y;
  dlon = adjust_lon_default(lon - this.long0);
  sinphi = Math.sin(lat);
  cosphi = Math.cos(lat);
  coslon = Math.cos(dlon);
  g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  ksp = 1;
  if (g > 0 || Math.abs(g) <= EPSLN) {
    x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;
    y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;
  } else {
    x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);
    y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse15(p) {
  var rh;
  var sinc, cosc;
  var c;
  var lon, lat;
  p.x = (p.x - this.x0) / this.a;
  p.y = (p.y - this.y0) / this.a;
  p.x /= this.k0;
  p.y /= this.k0;
  if (rh = Math.sqrt(p.x * p.x + p.y * p.y)) {
    c = Math.atan2(rh, this.rc);
    sinc = Math.sin(c);
    cosc = Math.cos(c);
    lat = asinz_default(cosc * this.sin_p14 + p.y * sinc * this.cos_p14 / rh);
    lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
    lon = adjust_lon_default(this.long0 + lon);
  } else {
    lat = this.phic0;
    lon = 0;
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names17 = ["gnom"];
var gnom_default = {
  init: init16,
  forward: forward15,
  inverse: inverse15,
  names: names17
};

// node_modules/proj4/lib/common/iqsfnz.js
function iqsfnz_default(eccent, q) {
  var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));
  if (Math.abs(Math.abs(q) - temp) < 1e-6) {
    if (q < 0) {
      return -1 * HALF_PI;
    } else {
      return HALF_PI;
    }
  }
  var phi = Math.asin(0.5 * q);
  var dphi;
  var sin_phi;
  var cos_phi;
  var con;
  for (var i2 = 0; i2 < 30; i2++) {
    sin_phi = Math.sin(phi);
    cos_phi = Math.cos(phi);
    con = eccent * sin_phi;
    dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
    phi += dphi;
    if (Math.abs(dphi) <= 1e-10) {
      return phi;
    }
  }
  return NaN;
}

// node_modules/proj4/lib/projections/cea.js
function init17() {
  if (!this.sphere) {
    this.k0 = msfnz_default(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  }
}
function forward16(p) {
  var lon = p.x;
  var lat = p.y;
  var x, y;
  var dlon = adjust_lon_default(lon - this.long0);
  if (this.sphere) {
    x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
    y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
  } else {
    var qs = qsfnz_default(this.e, Math.sin(lat));
    x = this.x0 + this.a * this.k0 * dlon;
    y = this.y0 + this.a * qs * 0.5 / this.k0;
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse16(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var lon, lat;
  if (this.sphere) {
    lon = adjust_lon_default(this.long0 + p.x / this.a / Math.cos(this.lat_ts));
    lat = Math.asin(p.y / this.a * Math.cos(this.lat_ts));
  } else {
    lat = iqsfnz_default(this.e, 2 * p.y * this.k0 / this.a);
    lon = adjust_lon_default(this.long0 + p.x / (this.a * this.k0));
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names18 = ["cea"];
var cea_default = {
  init: init17,
  forward: forward16,
  inverse: inverse16,
  names: names18
};

// node_modules/proj4/lib/projections/eqc.js
function init18() {
  this.x0 = this.x0 || 0;
  this.y0 = this.y0 || 0;
  this.lat0 = this.lat0 || 0;
  this.long0 = this.long0 || 0;
  this.lat_ts = this.lat_ts || 0;
  this.title = this.title || "Equidistant Cylindrical (Plate Carre)";
  this.rc = Math.cos(this.lat_ts);
}
function forward17(p) {
  var lon = p.x;
  var lat = p.y;
  var dlon = adjust_lon_default(lon - this.long0);
  var dlat = adjust_lat_default(lat - this.lat0);
  p.x = this.x0 + this.a * dlon * this.rc;
  p.y = this.y0 + this.a * dlat;
  return p;
}
function inverse17(p) {
  var x = p.x;
  var y = p.y;
  p.x = adjust_lon_default(this.long0 + (x - this.x0) / (this.a * this.rc));
  p.y = adjust_lat_default(this.lat0 + (y - this.y0) / this.a);
  return p;
}
var names19 = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
var eqc_default = {
  init: init18,
  forward: forward17,
  inverse: inverse17,
  names: names19
};

// node_modules/proj4/lib/projections/poly.js
var MAX_ITER3 = 20;
function init19() {
  this.temp = this.b / this.a;
  this.es = 1 - Math.pow(this.temp, 2);
  this.e = Math.sqrt(this.es);
  this.e0 = e0fn_default(this.es);
  this.e1 = e1fn_default(this.es);
  this.e2 = e2fn_default(this.es);
  this.e3 = e3fn_default(this.es);
  this.ml0 = this.a * mlfn_default(this.e0, this.e1, this.e2, this.e3, this.lat0);
}
function forward18(p) {
  var lon = p.x;
  var lat = p.y;
  var x, y, el;
  var dlon = adjust_lon_default(lon - this.long0);
  el = dlon * Math.sin(lat);
  if (this.sphere) {
    if (Math.abs(lat) <= EPSLN) {
      x = this.a * dlon;
      y = -1 * this.a * this.lat0;
    } else {
      x = this.a * Math.sin(el) / Math.tan(lat);
      y = this.a * (adjust_lat_default(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));
    }
  } else {
    if (Math.abs(lat) <= EPSLN) {
      x = this.a * dlon;
      y = -1 * this.ml0;
    } else {
      var nl = gN_default(this.a, this.e, Math.sin(lat)) / Math.tan(lat);
      x = nl * Math.sin(el);
      y = this.a * mlfn_default(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));
    }
  }
  p.x = x + this.x0;
  p.y = y + this.y0;
  return p;
}
function inverse18(p) {
  var lon, lat, x, y, i2;
  var al, bl;
  var phi, dphi;
  x = p.x - this.x0;
  y = p.y - this.y0;
  if (this.sphere) {
    if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
      lon = adjust_lon_default(x / this.a + this.long0);
      lat = 0;
    } else {
      al = this.lat0 + y / this.a;
      bl = x * x / this.a / this.a + al * al;
      phi = al;
      var tanphi;
      for (i2 = MAX_ITER3; i2; --i2) {
        tanphi = Math.tan(phi);
        dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);
        phi += dphi;
        if (Math.abs(dphi) <= EPSLN) {
          lat = phi;
          break;
        }
      }
      lon = adjust_lon_default(this.long0 + Math.asin(x * Math.tan(phi) / this.a) / Math.sin(lat));
    }
  } else {
    if (Math.abs(y + this.ml0) <= EPSLN) {
      lat = 0;
      lon = adjust_lon_default(this.long0 + x / this.a);
    } else {
      al = (this.ml0 + y) / this.a;
      bl = x * x / this.a / this.a + al * al;
      phi = al;
      var cl, mln, mlnp, ma;
      var con;
      for (i2 = MAX_ITER3; i2; --i2) {
        con = this.e * Math.sin(phi);
        cl = Math.sqrt(1 - con * con) * Math.tan(phi);
        mln = this.a * mlfn_default(this.e0, this.e1, this.e2, this.e3, phi);
        mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);
        ma = mln / this.a;
        dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);
        phi -= dphi;
        if (Math.abs(dphi) <= EPSLN) {
          lat = phi;
          break;
        }
      }
      cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
      lon = adjust_lon_default(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
    }
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names20 = ["Polyconic", "poly"];
var poly_default = {
  init: init19,
  forward: forward18,
  inverse: inverse18,
  names: names20
};

// node_modules/proj4/lib/projections/nzmg.js
function init20() {
  this.A = [];
  this.A[1] = 0.6399175073;
  this.A[2] = -0.1358797613;
  this.A[3] = 0.063294409;
  this.A[4] = -0.02526853;
  this.A[5] = 0.0117879;
  this.A[6] = -55161e-7;
  this.A[7] = 26906e-7;
  this.A[8] = -1333e-6;
  this.A[9] = 67e-5;
  this.A[10] = -34e-5;
  this.B_re = [];
  this.B_im = [];
  this.B_re[1] = 0.7557853228;
  this.B_im[1] = 0;
  this.B_re[2] = 0.249204646;
  this.B_im[2] = 3371507e-9;
  this.B_re[3] = -1541739e-9;
  this.B_im[3] = 0.04105856;
  this.B_re[4] = -0.10162907;
  this.B_im[4] = 0.01727609;
  this.B_re[5] = -0.26623489;
  this.B_im[5] = -0.36249218;
  this.B_re[6] = -0.6870983;
  this.B_im[6] = -1.1651967;
  this.C_re = [];
  this.C_im = [];
  this.C_re[1] = 1.3231270439;
  this.C_im[1] = 0;
  this.C_re[2] = -0.577245789;
  this.C_im[2] = -7809598e-9;
  this.C_re[3] = 0.508307513;
  this.C_im[3] = -0.112208952;
  this.C_re[4] = -0.15094762;
  this.C_im[4] = 0.18200602;
  this.C_re[5] = 1.01418179;
  this.C_im[5] = 1.64497696;
  this.C_re[6] = 1.9660549;
  this.C_im[6] = 2.5127645;
  this.D = [];
  this.D[1] = 1.5627014243;
  this.D[2] = 0.5185406398;
  this.D[3] = -0.03333098;
  this.D[4] = -0.1052906;
  this.D[5] = -0.0368594;
  this.D[6] = 7317e-6;
  this.D[7] = 0.0122;
  this.D[8] = 394e-5;
  this.D[9] = -13e-4;
}
function forward19(p) {
  var n;
  var lon = p.x;
  var lat = p.y;
  var delta_lat = lat - this.lat0;
  var delta_lon = lon - this.long0;
  var d_phi = delta_lat / SEC_TO_RAD * 1e-5;
  var d_lambda = delta_lon;
  var d_phi_n = 1;
  var d_psi = 0;
  for (n = 1; n <= 10; n++) {
    d_phi_n = d_phi_n * d_phi;
    d_psi = d_psi + this.A[n] * d_phi_n;
  }
  var th_re = d_psi;
  var th_im = d_lambda;
  var th_n_re = 1;
  var th_n_im = 0;
  var th_n_re1;
  var th_n_im1;
  var z_re = 0;
  var z_im = 0;
  for (n = 1; n <= 6; n++) {
    th_n_re1 = th_n_re * th_re - th_n_im * th_im;
    th_n_im1 = th_n_im * th_re + th_n_re * th_im;
    th_n_re = th_n_re1;
    th_n_im = th_n_im1;
    z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;
    z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;
  }
  p.x = z_im * this.a + this.x0;
  p.y = z_re * this.a + this.y0;
  return p;
}
function inverse19(p) {
  var n;
  var x = p.x;
  var y = p.y;
  var delta_x = x - this.x0;
  var delta_y = y - this.y0;
  var z_re = delta_y / this.a;
  var z_im = delta_x / this.a;
  var z_n_re = 1;
  var z_n_im = 0;
  var z_n_re1;
  var z_n_im1;
  var th_re = 0;
  var th_im = 0;
  for (n = 1; n <= 6; n++) {
    z_n_re1 = z_n_re * z_re - z_n_im * z_im;
    z_n_im1 = z_n_im * z_re + z_n_re * z_im;
    z_n_re = z_n_re1;
    z_n_im = z_n_im1;
    th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;
    th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;
  }
  for (var i2 = 0; i2 < this.iterations; i2++) {
    var th_n_re = th_re;
    var th_n_im = th_im;
    var th_n_re1;
    var th_n_im1;
    var num_re = z_re;
    var num_im = z_im;
    for (n = 2; n <= 6; n++) {
      th_n_re1 = th_n_re * th_re - th_n_im * th_im;
      th_n_im1 = th_n_im * th_re + th_n_re * th_im;
      th_n_re = th_n_re1;
      th_n_im = th_n_im1;
      num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
      num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
    }
    th_n_re = 1;
    th_n_im = 0;
    var den_re = this.B_re[1];
    var den_im = this.B_im[1];
    for (n = 2; n <= 6; n++) {
      th_n_re1 = th_n_re * th_re - th_n_im * th_im;
      th_n_im1 = th_n_im * th_re + th_n_re * th_im;
      th_n_re = th_n_re1;
      th_n_im = th_n_im1;
      den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
      den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
    }
    var den2 = den_re * den_re + den_im * den_im;
    th_re = (num_re * den_re + num_im * den_im) / den2;
    th_im = (num_im * den_re - num_re * den_im) / den2;
  }
  var d_psi = th_re;
  var d_lambda = th_im;
  var d_psi_n = 1;
  var d_phi = 0;
  for (n = 1; n <= 9; n++) {
    d_psi_n = d_psi_n * d_psi;
    d_phi = d_phi + this.D[n] * d_psi_n;
  }
  var lat = this.lat0 + d_phi * SEC_TO_RAD * 1e5;
  var lon = this.long0 + d_lambda;
  p.x = lon;
  p.y = lat;
  return p;
}
var names21 = ["New_Zealand_Map_Grid", "nzmg"];
var nzmg_default = {
  init: init20,
  forward: forward19,
  inverse: inverse19,
  names: names21
};

// node_modules/proj4/lib/projections/mill.js
function init21() {
}
function forward20(p) {
  var lon = p.x;
  var lat = p.y;
  var dlon = adjust_lon_default(lon - this.long0);
  var x = this.x0 + this.a * dlon;
  var y = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + lat / 2.5)) * 1.25;
  p.x = x;
  p.y = y;
  return p;
}
function inverse20(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var lon = adjust_lon_default(this.long0 + p.x / this.a);
  var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
  p.x = lon;
  p.y = lat;
  return p;
}
var names22 = ["Miller_Cylindrical", "mill"];
var mill_default = {
  init: init21,
  forward: forward20,
  inverse: inverse20,
  names: names22
};

// node_modules/proj4/lib/projections/sinu.js
var MAX_ITER4 = 20;
function init22() {
  if (!this.sphere) {
    this.en = pj_enfn_default(this.es);
  } else {
    this.n = 1;
    this.m = 0;
    this.es = 0;
    this.C_y = Math.sqrt((this.m + 1) / this.n);
    this.C_x = this.C_y / (this.m + 1);
  }
}
function forward21(p) {
  var x, y;
  var lon = p.x;
  var lat = p.y;
  lon = adjust_lon_default(lon - this.long0);
  if (this.sphere) {
    if (!this.m) {
      lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;
    } else {
      var k = this.n * Math.sin(lat);
      for (var i2 = MAX_ITER4; i2; --i2) {
        var V2 = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));
        lat -= V2;
        if (Math.abs(V2) < EPSLN) {
          break;
        }
      }
    }
    x = this.a * this.C_x * lon * (this.m + Math.cos(lat));
    y = this.a * this.C_y * lat;
  } else {
    var s = Math.sin(lat);
    var c = Math.cos(lat);
    y = this.a * pj_mlfn_default(lat, s, c, this.en);
    x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse21(p) {
  var lat, temp, lon, s;
  p.x -= this.x0;
  lon = p.x / this.a;
  p.y -= this.y0;
  lat = p.y / this.a;
  if (this.sphere) {
    lat /= this.C_y;
    lon = lon / (this.C_x * (this.m + Math.cos(lat)));
    if (this.m) {
      lat = asinz_default((this.m * lat + Math.sin(lat)) / this.n);
    } else if (this.n !== 1) {
      lat = asinz_default(Math.sin(lat) / this.n);
    }
    lon = adjust_lon_default(lon + this.long0);
    lat = adjust_lat_default(lat);
  } else {
    lat = pj_inv_mlfn_default(p.y / this.a, this.es, this.en);
    s = Math.abs(lat);
    if (s < HALF_PI) {
      s = Math.sin(lat);
      temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));
      lon = adjust_lon_default(temp);
    } else if (s - EPSLN < HALF_PI) {
      lon = this.long0;
    }
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names23 = ["Sinusoidal", "sinu"];
var sinu_default = {
  init: init22,
  forward: forward21,
  inverse: inverse21,
  names: names23
};

// node_modules/proj4/lib/projections/moll.js
function init23() {
}
function forward22(p) {
  var lon = p.x;
  var lat = p.y;
  var delta_lon = adjust_lon_default(lon - this.long0);
  var theta = lat;
  var con = Math.PI * Math.sin(lat);
  while (true) {
    var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
    theta += delta_theta;
    if (Math.abs(delta_theta) < EPSLN) {
      break;
    }
  }
  theta /= 2;
  if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
    delta_lon = 0;
  }
  var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
  var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
  p.x = x;
  p.y = y;
  return p;
}
function inverse22(p) {
  var theta;
  var arg;
  p.x -= this.x0;
  p.y -= this.y0;
  arg = p.y / (1.4142135623731 * this.a);
  if (Math.abs(arg) > 0.999999999999) {
    arg = 0.999999999999;
  }
  theta = Math.asin(arg);
  var lon = adjust_lon_default(this.long0 + p.x / (0.900316316158 * this.a * Math.cos(theta)));
  if (lon < -Math.PI) {
    lon = -Math.PI;
  }
  if (lon > Math.PI) {
    lon = Math.PI;
  }
  arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;
  if (Math.abs(arg) > 1) {
    arg = 1;
  }
  var lat = Math.asin(arg);
  p.x = lon;
  p.y = lat;
  return p;
}
var names24 = ["Mollweide", "moll"];
var moll_default = {
  init: init23,
  forward: forward22,
  inverse: inverse22,
  names: names24
};

// node_modules/proj4/lib/projections/eqdc.js
function init24() {
  if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
    return;
  }
  this.lat2 = this.lat2 || this.lat1;
  this.temp = this.b / this.a;
  this.es = 1 - Math.pow(this.temp, 2);
  this.e = Math.sqrt(this.es);
  this.e0 = e0fn_default(this.es);
  this.e1 = e1fn_default(this.es);
  this.e2 = e2fn_default(this.es);
  this.e3 = e3fn_default(this.es);
  this.sinphi = Math.sin(this.lat1);
  this.cosphi = Math.cos(this.lat1);
  this.ms1 = msfnz_default(this.e, this.sinphi, this.cosphi);
  this.ml1 = mlfn_default(this.e0, this.e1, this.e2, this.e3, this.lat1);
  if (Math.abs(this.lat1 - this.lat2) < EPSLN) {
    this.ns = this.sinphi;
  } else {
    this.sinphi = Math.sin(this.lat2);
    this.cosphi = Math.cos(this.lat2);
    this.ms2 = msfnz_default(this.e, this.sinphi, this.cosphi);
    this.ml2 = mlfn_default(this.e0, this.e1, this.e2, this.e3, this.lat2);
    this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);
  }
  this.g = this.ml1 + this.ms1 / this.ns;
  this.ml0 = mlfn_default(this.e0, this.e1, this.e2, this.e3, this.lat0);
  this.rh = this.a * (this.g - this.ml0);
}
function forward23(p) {
  var lon = p.x;
  var lat = p.y;
  var rh1;
  if (this.sphere) {
    rh1 = this.a * (this.g - lat);
  } else {
    var ml = mlfn_default(this.e0, this.e1, this.e2, this.e3, lat);
    rh1 = this.a * (this.g - ml);
  }
  var theta = this.ns * adjust_lon_default(lon - this.long0);
  var x = this.x0 + rh1 * Math.sin(theta);
  var y = this.y0 + this.rh - rh1 * Math.cos(theta);
  p.x = x;
  p.y = y;
  return p;
}
function inverse23(p) {
  p.x -= this.x0;
  p.y = this.rh - p.y + this.y0;
  var con, rh1, lat, lon;
  if (this.ns >= 0) {
    rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
    con = 1;
  } else {
    rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
    con = -1;
  }
  var theta = 0;
  if (rh1 !== 0) {
    theta = Math.atan2(con * p.x, con * p.y);
  }
  if (this.sphere) {
    lon = adjust_lon_default(this.long0 + theta / this.ns);
    lat = adjust_lat_default(this.g - rh1 / this.a);
    p.x = lon;
    p.y = lat;
    return p;
  } else {
    var ml = this.g - rh1 / this.a;
    lat = imlfn_default(ml, this.e0, this.e1, this.e2, this.e3);
    lon = adjust_lon_default(this.long0 + theta / this.ns);
    p.x = lon;
    p.y = lat;
    return p;
  }
}
var names25 = ["Equidistant_Conic", "eqdc"];
var eqdc_default = {
  init: init24,
  forward: forward23,
  inverse: inverse23,
  names: names25
};

// node_modules/proj4/lib/projections/vandg.js
function init25() {
  this.R = this.a;
}
function forward24(p) {
  var lon = p.x;
  var lat = p.y;
  var dlon = adjust_lon_default(lon - this.long0);
  var x, y;
  if (Math.abs(lat) <= EPSLN) {
    x = this.x0 + this.R * dlon;
    y = this.y0;
  }
  var theta = asinz_default(2 * Math.abs(lat / Math.PI));
  if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
    x = this.x0;
    if (lat >= 0) {
      y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);
    } else {
      y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
    }
  }
  var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
  var asq = al * al;
  var sinth = Math.sin(theta);
  var costh = Math.cos(theta);
  var g = costh / (sinth + costh - 1);
  var gsq = g * g;
  var m = g * (2 / sinth - 1);
  var msq = m * m;
  var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);
  if (dlon < 0) {
    con = -con;
  }
  x = this.x0 + con;
  var q = asq + g;
  con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);
  if (lat >= 0) {
    y = this.y0 + con;
  } else {
    y = this.y0 - con;
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse24(p) {
  var lon, lat;
  var xx, yy, xys, c1, c2, c3;
  var a1;
  var m1;
  var con;
  var th1;
  var d;
  p.x -= this.x0;
  p.y -= this.y0;
  con = Math.PI * this.R;
  xx = p.x / con;
  yy = p.y / con;
  xys = xx * xx + yy * yy;
  c1 = -Math.abs(yy) * (1 + xys);
  c2 = c1 - 2 * yy * yy + xx * xx;
  c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;
  d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;
  a1 = (c1 - c2 * c2 / 3 / c3) / c3;
  m1 = 2 * Math.sqrt(-a1 / 3);
  con = 3 * d / a1 / m1;
  if (Math.abs(con) > 1) {
    if (con >= 0) {
      con = 1;
    } else {
      con = -1;
    }
  }
  th1 = Math.acos(con) / 3;
  if (p.y >= 0) {
    lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  } else {
    lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  }
  if (Math.abs(xx) < EPSLN) {
    lon = this.long0;
  } else {
    lon = adjust_lon_default(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
  }
  p.x = lon;
  p.y = lat;
  return p;
}
var names26 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
var vandg_default = {
  init: init25,
  forward: forward24,
  inverse: inverse24,
  names: names26
};

// node_modules/proj4/lib/projections/aeqd.js
function init26() {
  this.sin_p12 = Math.sin(this.lat0);
  this.cos_p12 = Math.cos(this.lat0);
}
function forward25(p) {
  var lon = p.x;
  var lat = p.y;
  var sinphi = Math.sin(p.y);
  var cosphi = Math.cos(p.y);
  var dlon = adjust_lon_default(lon - this.long0);
  var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;
  if (this.sphere) {
    if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
      p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);
      p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);
      return p;
    } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
      p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);
      p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);
      return p;
    } else {
      cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);
      c = Math.acos(cos_c);
      kp = c / Math.sin(c);
      p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);
      p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));
      return p;
    }
  } else {
    e0 = e0fn_default(this.es);
    e1 = e1fn_default(this.es);
    e2 = e2fn_default(this.es);
    e3 = e3fn_default(this.es);
    if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
      Mlp = this.a * mlfn_default(e0, e1, e2, e3, HALF_PI);
      Ml = this.a * mlfn_default(e0, e1, e2, e3, lat);
      p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);
      p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);
      return p;
    } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
      Mlp = this.a * mlfn_default(e0, e1, e2, e3, HALF_PI);
      Ml = this.a * mlfn_default(e0, e1, e2, e3, lat);
      p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);
      p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);
      return p;
    } else {
      tanphi = sinphi / cosphi;
      Nl1 = gN_default(this.a, this.e, this.sin_p12);
      Nl = gN_default(this.a, this.e, sinphi);
      psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));
      Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));
      if (Az === 0) {
        s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
      } else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {
        s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
      } else {
        s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));
      }
      G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);
      H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);
      GH = G * H;
      Hs = H * H;
      s2 = s * s;
      s3 = s2 * s;
      s4 = s3 * s;
      s5 = s4 * s;
      c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);
      p.x = this.x0 + c * Math.sin(Az);
      p.y = this.y0 + c * Math.cos(Az);
      return p;
    }
  }
}
function inverse25(p) {
  p.x -= this.x0;
  p.y -= this.y0;
  var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A3, B, D, Ee, F;
  if (this.sphere) {
    rh = Math.sqrt(p.x * p.x + p.y * p.y);
    if (rh > 2 * HALF_PI * this.a) {
      return;
    }
    z = rh / this.a;
    sinz = Math.sin(z);
    cosz = Math.cos(z);
    lon = this.long0;
    if (Math.abs(rh) <= EPSLN) {
      lat = this.lat0;
    } else {
      lat = asinz_default(cosz * this.sin_p12 + p.y * sinz * this.cos_p12 / rh);
      con = Math.abs(this.lat0) - HALF_PI;
      if (Math.abs(con) <= EPSLN) {
        if (this.lat0 >= 0) {
          lon = adjust_lon_default(this.long0 + Math.atan2(p.x, -p.y));
        } else {
          lon = adjust_lon_default(this.long0 - Math.atan2(-p.x, p.y));
        }
      } else {
        lon = adjust_lon_default(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
      }
    }
    p.x = lon;
    p.y = lat;
    return p;
  } else {
    e0 = e0fn_default(this.es);
    e1 = e1fn_default(this.es);
    e2 = e2fn_default(this.es);
    e3 = e3fn_default(this.es);
    if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
      Mlp = this.a * mlfn_default(e0, e1, e2, e3, HALF_PI);
      rh = Math.sqrt(p.x * p.x + p.y * p.y);
      M = Mlp - rh;
      lat = imlfn_default(M / this.a, e0, e1, e2, e3);
      lon = adjust_lon_default(this.long0 + Math.atan2(p.x, -1 * p.y));
      p.x = lon;
      p.y = lat;
      return p;
    } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
      Mlp = this.a * mlfn_default(e0, e1, e2, e3, HALF_PI);
      rh = Math.sqrt(p.x * p.x + p.y * p.y);
      M = rh - Mlp;
      lat = imlfn_default(M / this.a, e0, e1, e2, e3);
      lon = adjust_lon_default(this.long0 + Math.atan2(p.x, p.y));
      p.x = lon;
      p.y = lat;
      return p;
    } else {
      rh = Math.sqrt(p.x * p.x + p.y * p.y);
      Az = Math.atan2(p.x, p.y);
      N1 = gN_default(this.a, this.e, this.sin_p12);
      cosAz = Math.cos(Az);
      tmp = this.e * this.cos_p12 * cosAz;
      A3 = -tmp * tmp / (1 - this.es);
      B = 3 * this.es * (1 - A3) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);
      D = rh / N1;
      Ee = D - A3 * (1 + A3) * Math.pow(D, 3) / 6 - B * (1 + 3 * A3) * Math.pow(D, 4) / 24;
      F = 1 - A3 * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;
      psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);
      lon = adjust_lon_default(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));
      lat = Math.atan((1 - this.es * F * this.sin_p12 / Math.sin(psi)) * Math.tan(psi) / (1 - this.es));
      p.x = lon;
      p.y = lat;
      return p;
    }
  }
}
var names27 = ["Azimuthal_Equidistant", "aeqd"];
var aeqd_default = {
  init: init26,
  forward: forward25,
  inverse: inverse25,
  names: names27
};

// node_modules/proj4/lib/projections/ortho.js
function init27() {
  this.sin_p14 = Math.sin(this.lat0);
  this.cos_p14 = Math.cos(this.lat0);
}
function forward26(p) {
  var sinphi, cosphi;
  var dlon;
  var coslon;
  var ksp;
  var g, x, y;
  var lon = p.x;
  var lat = p.y;
  dlon = adjust_lon_default(lon - this.long0);
  sinphi = Math.sin(lat);
  cosphi = Math.cos(lat);
  coslon = Math.cos(dlon);
  g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  ksp = 1;
  if (g > 0 || Math.abs(g) <= EPSLN) {
    x = this.a * ksp * cosphi * Math.sin(dlon);
    y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  }
  p.x = x;
  p.y = y;
  return p;
}
function inverse26(p) {
  var rh;
  var z;
  var sinz, cosz;
  var con;
  var lon, lat;
  p.x -= this.x0;
  p.y -= this.y0;
  rh = Math.sqrt(p.x * p.x + p.y * p.y);
  z = asinz_default(rh / this.a);
  sinz = Math.sin(z);
  cosz = Math.cos(z);
  lon = this.long0;
  if (Math.abs(rh) <= EPSLN) {
    lat = this.lat0;
    p.x = lon;
    p.y = lat;
    return p;
  }
  lat = asinz_default(cosz * this.sin_p14 + p.y * sinz * this.cos_p14 / rh);
  con = Math.abs(this.lat0) - HALF_PI;
  if (Math.abs(con) <= EPSLN) {
    if (this.lat0 >= 0) {
      lon = adjust_lon_default(this.long0 + Math.atan2(p.x, -p.y));
    } else {
      lon = adjust_lon_default(this.long0 - Math.atan2(-p.x, p.y));
    }
    p.x = lon;
    p.y = lat;
    return p;
  }
  lon = adjust_lon_default(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
  p.x = lon;
  p.y = lat;
  return p;
}
var names28 = ["ortho"];
var ortho_default = {
  init: init27,
  forward: forward26,
  inverse: inverse26,
  names: names28
};

// node_modules/proj4/lib/projections/qsc.js
var FACE_ENUM = {
  FRONT: 1,
  RIGHT: 2,
  BACK: 3,
  LEFT: 4,
  TOP: 5,
  BOTTOM: 6
};
var AREA_ENUM = {
  AREA_0: 1,
  AREA_1: 2,
  AREA_2: 3,
  AREA_3: 4
};
function init28() {
  this.x0 = this.x0 || 0;
  this.y0 = this.y0 || 0;
  this.lat0 = this.lat0 || 0;
  this.long0 = this.long0 || 0;
  this.lat_ts = this.lat_ts || 0;
  this.title = this.title || "Quadrilateralized Spherical Cube";
  if (this.lat0 >= HALF_PI - FORTPI / 2) {
    this.face = FACE_ENUM.TOP;
  } else if (this.lat0 <= -(HALF_PI - FORTPI / 2)) {
    this.face = FACE_ENUM.BOTTOM;
  } else if (Math.abs(this.long0) <= FORTPI) {
    this.face = FACE_ENUM.FRONT;
  } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {
    this.face = this.long0 > 0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;
  } else {
    this.face = FACE_ENUM.BACK;
  }
  if (this.es !== 0) {
    this.one_minus_f = 1 - (this.a - this.b) / this.a;
    this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;
  }
}
function forward27(p) {
  var xy = { x: 0, y: 0 };
  var lat, lon;
  var theta, phi;
  var t, mu;
  var area = { value: 0 };
  p.x -= this.long0;
  if (this.es !== 0) {
    lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));
  } else {
    lat = p.y;
  }
  lon = p.x;
  if (this.face === FACE_ENUM.TOP) {
    phi = HALF_PI - lat;
    if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
      area.value = AREA_ENUM.AREA_0;
      theta = lon - HALF_PI;
    } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {
      area.value = AREA_ENUM.AREA_1;
      theta = lon > 0 ? lon - SPI : lon + SPI;
    } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {
      area.value = AREA_ENUM.AREA_2;
      theta = lon + HALF_PI;
    } else {
      area.value = AREA_ENUM.AREA_3;
      theta = lon;
    }
  } else if (this.face === FACE_ENUM.BOTTOM) {
    phi = HALF_PI + lat;
    if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
      area.value = AREA_ENUM.AREA_0;
      theta = -lon + HALF_PI;
    } else if (lon < FORTPI && lon >= -FORTPI) {
      area.value = AREA_ENUM.AREA_1;
      theta = -lon;
    } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {
      area.value = AREA_ENUM.AREA_2;
      theta = -lon - HALF_PI;
    } else {
      area.value = AREA_ENUM.AREA_3;
      theta = lon > 0 ? -lon + SPI : -lon - SPI;
    }
  } else {
    var q, r, s;
    var sinlat, coslat;
    var sinlon, coslon;
    if (this.face === FACE_ENUM.RIGHT) {
      lon = qsc_shift_lon_origin(lon, +HALF_PI);
    } else if (this.face === FACE_ENUM.BACK) {
      lon = qsc_shift_lon_origin(lon, +SPI);
    } else if (this.face === FACE_ENUM.LEFT) {
      lon = qsc_shift_lon_origin(lon, -HALF_PI);
    }
    sinlat = Math.sin(lat);
    coslat = Math.cos(lat);
    sinlon = Math.sin(lon);
    coslon = Math.cos(lon);
    q = coslat * coslon;
    r = coslat * sinlon;
    s = sinlat;
    if (this.face === FACE_ENUM.FRONT) {
      phi = Math.acos(q);
      theta = qsc_fwd_equat_face_theta(phi, s, r, area);
    } else if (this.face === FACE_ENUM.RIGHT) {
      phi = Math.acos(r);
      theta = qsc_fwd_equat_face_theta(phi, s, -q, area);
    } else if (this.face === FACE_ENUM.BACK) {
      phi = Math.acos(-q);
      theta = qsc_fwd_equat_face_theta(phi, s, -r, area);
    } else if (this.face === FACE_ENUM.LEFT) {
      phi = Math.acos(-r);
      theta = qsc_fwd_equat_face_theta(phi, s, q, area);
    } else {
      phi = theta = 0;
      area.value = AREA_ENUM.AREA_0;
    }
  }
  mu = Math.atan(12 / SPI * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));
  t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));
  if (area.value === AREA_ENUM.AREA_1) {
    mu += HALF_PI;
  } else if (area.value === AREA_ENUM.AREA_2) {
    mu += SPI;
  } else if (area.value === AREA_ENUM.AREA_3) {
    mu += 1.5 * SPI;
  }
  xy.x = t * Math.cos(mu);
  xy.y = t * Math.sin(mu);
  xy.x = xy.x * this.a + this.x0;
  xy.y = xy.y * this.a + this.y0;
  p.x = xy.x;
  p.y = xy.y;
  return p;
}
function inverse27(p) {
  var lp = { lam: 0, phi: 0 };
  var mu, nu, cosmu, tannu;
  var tantheta, theta, cosphi, phi;
  var t;
  var area = { value: 0 };
  p.x = (p.x - this.x0) / this.a;
  p.y = (p.y - this.y0) / this.a;
  nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));
  mu = Math.atan2(p.y, p.x);
  if (p.x >= 0 && p.x >= Math.abs(p.y)) {
    area.value = AREA_ENUM.AREA_0;
  } else if (p.y >= 0 && p.y >= Math.abs(p.x)) {
    area.value = AREA_ENUM.AREA_1;
    mu -= HALF_PI;
  } else if (p.x < 0 && -p.x >= Math.abs(p.y)) {
    area.value = AREA_ENUM.AREA_2;
    mu = mu < 0 ? mu + SPI : mu - SPI;
  } else {
    area.value = AREA_ENUM.AREA_3;
    mu += HALF_PI;
  }
  t = SPI / 12 * Math.tan(mu);
  tantheta = Math.sin(t) / (Math.cos(t) - 1 / Math.sqrt(2));
  theta = Math.atan(tantheta);
  cosmu = Math.cos(mu);
  tannu = Math.tan(nu);
  cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));
  if (cosphi < -1) {
    cosphi = -1;
  } else if (cosphi > 1) {
    cosphi = 1;
  }
  if (this.face === FACE_ENUM.TOP) {
    phi = Math.acos(cosphi);
    lp.phi = HALF_PI - phi;
    if (area.value === AREA_ENUM.AREA_0) {
      lp.lam = theta + HALF_PI;
    } else if (area.value === AREA_ENUM.AREA_1) {
      lp.lam = theta < 0 ? theta + SPI : theta - SPI;
    } else if (area.value === AREA_ENUM.AREA_2) {
      lp.lam = theta - HALF_PI;
    } else {
      lp.lam = theta;
    }
  } else if (this.face === FACE_ENUM.BOTTOM) {
    phi = Math.acos(cosphi);
    lp.phi = phi - HALF_PI;
    if (area.value === AREA_ENUM.AREA_0) {
      lp.lam = -theta + HALF_PI;
    } else if (area.value === AREA_ENUM.AREA_1) {
      lp.lam = -theta;
    } else if (area.value === AREA_ENUM.AREA_2) {
      lp.lam = -theta - HALF_PI;
    } else {
      lp.lam = theta < 0 ? -theta - SPI : -theta + SPI;
    }
  } else {
    var q, r, s;
    q = cosphi;
    t = q * q;
    if (t >= 1) {
      s = 0;
    } else {
      s = Math.sqrt(1 - t) * Math.sin(theta);
    }
    t += s * s;
    if (t >= 1) {
      r = 0;
    } else {
      r = Math.sqrt(1 - t);
    }
    if (area.value === AREA_ENUM.AREA_1) {
      t = r;
      r = -s;
      s = t;
    } else if (area.value === AREA_ENUM.AREA_2) {
      r = -r;
      s = -s;
    } else if (area.value === AREA_ENUM.AREA_3) {
      t = r;
      r = s;
      s = -t;
    }
    if (this.face === FACE_ENUM.RIGHT) {
      t = q;
      q = -r;
      r = t;
    } else if (this.face === FACE_ENUM.BACK) {
      q = -q;
      r = -r;
    } else if (this.face === FACE_ENUM.LEFT) {
      t = q;
      q = r;
      r = -t;
    }
    lp.phi = Math.acos(-s) - HALF_PI;
    lp.lam = Math.atan2(r, q);
    if (this.face === FACE_ENUM.RIGHT) {
      lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);
    } else if (this.face === FACE_ENUM.BACK) {
      lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);
    } else if (this.face === FACE_ENUM.LEFT) {
      lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);
    }
  }
  if (this.es !== 0) {
    var invert_sign;
    var tanphi, xa;
    invert_sign = lp.phi < 0 ? 1 : 0;
    tanphi = Math.tan(lp.phi);
    xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);
    lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));
    if (invert_sign) {
      lp.phi = -lp.phi;
    }
  }
  lp.lam += this.long0;
  p.x = lp.lam;
  p.y = lp.phi;
  return p;
}
function qsc_fwd_equat_face_theta(phi, y, x, area) {
  var theta;
  if (phi < EPSLN) {
    area.value = AREA_ENUM.AREA_0;
    theta = 0;
  } else {
    theta = Math.atan2(y, x);
    if (Math.abs(theta) <= FORTPI) {
      area.value = AREA_ENUM.AREA_0;
    } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {
      area.value = AREA_ENUM.AREA_1;
      theta -= HALF_PI;
    } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {
      area.value = AREA_ENUM.AREA_2;
      theta = theta >= 0 ? theta - SPI : theta + SPI;
    } else {
      area.value = AREA_ENUM.AREA_3;
      theta += HALF_PI;
    }
  }
  return theta;
}
function qsc_shift_lon_origin(lon, offset2) {
  var slon = lon + offset2;
  if (slon < -SPI) {
    slon += TWO_PI;
  } else if (slon > +SPI) {
    slon -= TWO_PI;
  }
  return slon;
}
var names29 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
var qsc_default = {
  init: init28,
  forward: forward27,
  inverse: inverse27,
  names: names29
};

// node_modules/proj4/lib/projections/robin.js
var COEFS_X = [
  [1, 22199e-21, -715515e-10, 31103e-10],
  [0.9986, -482243e-9, -24897e-9, -13309e-10],
  [0.9954, -83103e-8, -448605e-10, -986701e-12],
  [0.99, -135364e-8, -59661e-9, 36777e-10],
  [0.9822, -167442e-8, -449547e-11, -572411e-11],
  [0.973, -214868e-8, -903571e-10, 18736e-12],
  [0.96, -305085e-8, -900761e-10, 164917e-11],
  [0.9427, -382792e-8, -653386e-10, -26154e-10],
  [0.9216, -467746e-8, -10457e-8, 481243e-11],
  [0.8962, -536223e-8, -323831e-10, -543432e-11],
  [0.8679, -609363e-8, -113898e-9, 332484e-11],
  [0.835, -698325e-8, -640253e-10, 934959e-12],
  [0.7986, -755338e-8, -500009e-10, 935324e-12],
  [0.7597, -798324e-8, -35971e-9, -227626e-11],
  [0.7186, -851367e-8, -701149e-10, -86303e-10],
  [0.6732, -986209e-8, -199569e-9, 191974e-10],
  [0.6213, -0.010418, 883923e-10, 624051e-11],
  [0.5722, -906601e-8, 182e-6, 624051e-11],
  [0.5322, -677797e-8, 275608e-9, 624051e-11]
];
var COEFS_Y = [
  [-520417e-23, 0.0124, 121431e-23, -845284e-16],
  [0.062, 0.0124, -126793e-14, 422642e-15],
  [0.124, 0.0124, 507171e-14, -160604e-14],
  [0.186, 0.0123999, -190189e-13, 600152e-14],
  [0.248, 0.0124002, 710039e-13, -224e-10],
  [0.31, 0.0123992, -264997e-12, 835986e-13],
  [0.372, 0.0124029, 988983e-12, -311994e-12],
  [0.434, 0.0123893, -369093e-11, -435621e-12],
  [0.4958, 0.0123198, -102252e-10, -345523e-12],
  [0.5571, 0.0121916, -154081e-10, -582288e-12],
  [0.6176, 0.0119938, -241424e-10, -525327e-12],
  [0.6769, 0.011713, -320223e-10, -516405e-12],
  [0.7346, 0.0113541, -397684e-10, -609052e-12],
  [0.7903, 0.0109107, -489042e-10, -104739e-11],
  [0.8435, 0.0103431, -64615e-9, -140374e-14],
  [0.8936, 969686e-8, -64636e-9, -8547e-9],
  [0.9394, 840947e-8, -192841e-9, -42106e-10],
  [0.9761, 616527e-8, -256e-6, -42106e-10],
  [1, 328947e-8, -319159e-9, -42106e-10]
];
var FXC = 0.8487;
var FYC = 1.3523;
var C1 = R2D / 5;
var RC1 = 1 / C1;
var NODES = 18;
var poly3_val = function(coefs, x) {
  return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));
};
var poly3_der = function(coefs, x) {
  return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);
};
function newton_rapshon(f_df, start2, max_err, iters) {
  var x = start2;
  for (; iters; --iters) {
    var upd = f_df(x);
    x -= upd;
    if (Math.abs(upd) < max_err) {
      break;
    }
  }
  return x;
}
function init29() {
  this.x0 = this.x0 || 0;
  this.y0 = this.y0 || 0;
  this.long0 = this.long0 || 0;
  this.es = 0;
  this.title = this.title || "Robinson";
}
function forward28(ll) {
  var lon = adjust_lon_default(ll.x - this.long0);
  var dphi = Math.abs(ll.y);
  var i2 = Math.floor(dphi * C1);
  if (i2 < 0) {
    i2 = 0;
  } else if (i2 >= NODES) {
    i2 = NODES - 1;
  }
  dphi = R2D * (dphi - RC1 * i2);
  var xy = {
    x: poly3_val(COEFS_X[i2], dphi) * lon,
    y: poly3_val(COEFS_Y[i2], dphi)
  };
  if (ll.y < 0) {
    xy.y = -xy.y;
  }
  xy.x = xy.x * this.a * FXC + this.x0;
  xy.y = xy.y * this.a * FYC + this.y0;
  return xy;
}
function inverse28(xy) {
  var ll = {
    x: (xy.x - this.x0) / (this.a * FXC),
    y: Math.abs(xy.y - this.y0) / (this.a * FYC)
  };
  if (ll.y >= 1) {
    ll.x /= COEFS_X[NODES][0];
    ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;
  } else {
    var i2 = Math.floor(ll.y * NODES);
    if (i2 < 0) {
      i2 = 0;
    } else if (i2 >= NODES) {
      i2 = NODES - 1;
    }
    for (; ; ) {
      if (COEFS_Y[i2][0] > ll.y) {
        --i2;
      } else if (COEFS_Y[i2 + 1][0] <= ll.y) {
        ++i2;
      } else {
        break;
      }
    }
    var coefs = COEFS_Y[i2];
    var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i2 + 1][0] - coefs[0]);
    t = newton_rapshon(function(x) {
      return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);
    }, t, EPSLN, 100);
    ll.x /= poly3_val(COEFS_X[i2], t);
    ll.y = (5 * i2 + t) * D2R;
    if (xy.y < 0) {
      ll.y = -ll.y;
    }
  }
  ll.x = adjust_lon_default(ll.x + this.long0);
  return ll;
}
var names30 = ["Robinson", "robin"];
var robin_default = {
  init: init29,
  forward: forward28,
  inverse: inverse28,
  names: names30
};

// node_modules/proj4/lib/projections/geocent.js
function init30() {
  this.name = "geocent";
}
function forward29(p) {
  var point = geodeticToGeocentric(p, this.es, this.a);
  return point;
}
function inverse29(p) {
  var point = geocentricToGeodetic(p, this.es, this.a, this.b);
  return point;
}
var names31 = ["Geocentric", "geocentric", "geocent", "Geocent"];
var geocent_default = {
  init: init30,
  forward: forward29,
  inverse: inverse29,
  names: names31
};

// node_modules/proj4/projs.js
function projs_default(proj42) {
  proj42.Proj.projections.add(tmerc_default);
  proj42.Proj.projections.add(etmerc_default);
  proj42.Proj.projections.add(utm_default);
  proj42.Proj.projections.add(sterea_default);
  proj42.Proj.projections.add(stere_default);
  proj42.Proj.projections.add(somerc_default);
  proj42.Proj.projections.add(omerc_default);
  proj42.Proj.projections.add(lcc_default);
  proj42.Proj.projections.add(krovak_default);
  proj42.Proj.projections.add(cass_default);
  proj42.Proj.projections.add(laea_default);
  proj42.Proj.projections.add(aea_default);
  proj42.Proj.projections.add(gnom_default);
  proj42.Proj.projections.add(cea_default);
  proj42.Proj.projections.add(eqc_default);
  proj42.Proj.projections.add(poly_default);
  proj42.Proj.projections.add(nzmg_default);
  proj42.Proj.projections.add(mill_default);
  proj42.Proj.projections.add(sinu_default);
  proj42.Proj.projections.add(moll_default);
  proj42.Proj.projections.add(eqdc_default);
  proj42.Proj.projections.add(vandg_default);
  proj42.Proj.projections.add(aeqd_default);
  proj42.Proj.projections.add(ortho_default);
  proj42.Proj.projections.add(qsc_default);
  proj42.Proj.projections.add(robin_default);
  proj42.Proj.projections.add(geocent_default);
}

// node_modules/proj4/lib/index.js
core_default.defaultDatum = "WGS84";
core_default.Proj = Proj_default;
core_default.WGS84 = new core_default.Proj("WGS84");
core_default.Point = Point_default2;
core_default.toPoint = toPoint_default;
core_default.defs = defs_default;
core_default.transform = transform2;
core_default.mgrs = mgrs_default;
core_default.version = "__VERSION__";
projs_default(core_default);
var lib_default = core_default;

// projects/formbird-mapping/src/lib/scl-util-map.service.ts
var Handlebars3 = __toESM(require_handlebars());

// node_modules/@angular/elements/fesm2022/elements.mjs
var scheduler = {
  /**
   * Schedule a callback to be called after some delay.
   *
   * Returns a function that when executed will cancel the scheduled function.
   */
  schedule(taskFn, delay2) {
    const id2 = setTimeout(taskFn, delay2);
    return () => clearTimeout(id2);
  },
  /**
   * Schedule a callback to be called before the next render.
   * (If `window.requestAnimationFrame()` is not available, use `scheduler.schedule()` instead.)
   *
   * Returns a function that when executed will cancel the scheduled function.
   */
  scheduleBeforeRender(taskFn) {
    if (typeof window === "undefined") {
      return scheduler.schedule(taskFn, 0);
    }
    if (typeof window.requestAnimationFrame === "undefined") {
      const frameMs = 16;
      return scheduler.schedule(taskFn, frameMs);
    }
    const id2 = window.requestAnimationFrame(taskFn);
    return () => window.cancelAnimationFrame(id2);
  }
};
function camelToDashCase(input2) {
  return input2.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
}
function isElement(node) {
  return !!node && node.nodeType === Node.ELEMENT_NODE;
}
function isFunction3(value) {
  return typeof value === "function";
}
var _matches;
function matchesSelector(el, selector) {
  if (!_matches) {
    const elProto = Element.prototype;
    _matches = elProto.matches || elProto.matchesSelector || elProto.mozMatchesSelector || elProto.msMatchesSelector || elProto.oMatchesSelector || elProto.webkitMatchesSelector;
  }
  return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : false;
}
function strictEquals(value1, value2) {
  return value1 === value2 || value1 !== value1 && value2 !== value2;
}
function getDefaultAttributeToPropertyInputs(inputs) {
  const attributeToPropertyInputs = {};
  inputs.forEach(({ propName, templateName, transform: transform3 }) => {
    attributeToPropertyInputs[camelToDashCase(templateName)] = [propName, transform3];
  });
  return attributeToPropertyInputs;
}
function getComponentInputs(component, injector) {
  const componentFactoryResolver = injector.get(ComponentFactoryResolver$1);
  const componentFactory = componentFactoryResolver.resolveComponentFactory(component);
  return componentFactory.inputs;
}
function extractProjectableNodes(host, ngContentSelectors) {
  const nodes = host.childNodes;
  const projectableNodes = ngContentSelectors.map(() => []);
  let wildcardIndex = -1;
  ngContentSelectors.some((selector, i2) => {
    if (selector === "*") {
      wildcardIndex = i2;
      return true;
    }
    return false;
  });
  for (let i2 = 0, ii = nodes.length; i2 < ii; ++i2) {
    const node = nodes[i2];
    const ngContentIndex = findMatchingIndex(node, ngContentSelectors, wildcardIndex);
    if (ngContentIndex !== -1) {
      projectableNodes[ngContentIndex].push(node);
    }
  }
  return projectableNodes;
}
function findMatchingIndex(node, selectors, defaultIndex) {
  let matchingIndex = defaultIndex;
  if (isElement(node)) {
    selectors.some((selector, i2) => {
      if (selector !== "*" && matchesSelector(node, selector)) {
        matchingIndex = i2;
        return true;
      }
      return false;
    });
  }
  return matchingIndex;
}
var DESTROY_DELAY = 10;
var ComponentNgElementStrategyFactory = class {
  constructor(component, injector) {
    this.componentFactory = injector.get(ComponentFactoryResolver$1).resolveComponentFactory(component);
  }
  create(injector) {
    return new ComponentNgElementStrategy(this.componentFactory, injector);
  }
};
var ComponentNgElementStrategy = class {
  constructor(componentFactory, injector) {
    this.componentFactory = componentFactory;
    this.injector = injector;
    this.eventEmitters = new ReplaySubject(1);
    this.events = this.eventEmitters.pipe(switchMap((emitters) => merge(...emitters)));
    this.componentRef = null;
    this.viewChangeDetectorRef = null;
    this.inputChanges = null;
    this.hasInputChanges = false;
    this.implementsOnChanges = false;
    this.scheduledChangeDetectionFn = null;
    this.scheduledDestroyFn = null;
    this.initialInputValues = /* @__PURE__ */ new Map();
    this.unchangedInputs = new Set(this.componentFactory.inputs.map(({ propName }) => propName));
    this.ngZone = this.injector.get(NgZone);
    this.elementZone = typeof Zone === "undefined" ? null : this.ngZone.run(() => Zone.current);
  }
  /**
   * Initializes a new component if one has not yet been created and cancels any scheduled
   * destruction.
   */
  connect(element) {
    this.runInZone(() => {
      if (this.scheduledDestroyFn !== null) {
        this.scheduledDestroyFn();
        this.scheduledDestroyFn = null;
        return;
      }
      if (this.componentRef === null) {
        this.initializeComponent(element);
      }
    });
  }
  /**
   * Schedules the component to be destroyed after some small delay in case the element is just
   * being moved across the DOM.
   */
  disconnect() {
    this.runInZone(() => {
      if (this.componentRef === null || this.scheduledDestroyFn !== null) {
        return;
      }
      this.scheduledDestroyFn = scheduler.schedule(() => {
        if (this.componentRef !== null) {
          this.componentRef.destroy();
          this.componentRef = null;
          this.viewChangeDetectorRef = null;
        }
      }, DESTROY_DELAY);
    });
  }
  /**
   * Returns the component property value. If the component has not yet been created, the value is
   * retrieved from the cached initialization values.
   */
  getInputValue(property) {
    return this.runInZone(() => {
      if (this.componentRef === null) {
        return this.initialInputValues.get(property);
      }
      return this.componentRef.instance[property];
    });
  }
  /**
   * Sets the input value for the property. If the component has not yet been created, the value is
   * cached and set when the component is created.
   */
  setInputValue(property, value, transform3) {
    this.runInZone(() => {
      if (transform3) {
        value = transform3.call(this.componentRef?.instance, value);
      }
      if (this.componentRef === null) {
        this.initialInputValues.set(property, value);
        return;
      }
      if (strictEquals(value, this.getInputValue(property)) && !(value === void 0 && this.unchangedInputs.has(property))) {
        return;
      }
      this.recordInputChange(property, value);
      this.unchangedInputs.delete(property);
      this.hasInputChanges = true;
      this.componentRef.instance[property] = value;
      this.scheduleDetectChanges();
    });
  }
  /**
   * Creates a new component through the component factory with the provided element host and
   * sets up its initial inputs, listens for outputs changes, and runs an initial change detection.
   */
  initializeComponent(element) {
    const childInjector = Injector.create({ providers: [], parent: this.injector });
    const projectableNodes = extractProjectableNodes(element, this.componentFactory.ngContentSelectors);
    this.componentRef = this.componentFactory.create(childInjector, projectableNodes, element);
    this.viewChangeDetectorRef = this.componentRef.injector.get(ChangeDetectorRef);
    this.implementsOnChanges = isFunction3(this.componentRef.instance.ngOnChanges);
    this.initializeInputs();
    this.initializeOutputs(this.componentRef);
    this.detectChanges();
    const applicationRef = this.injector.get(ApplicationRef);
    applicationRef.attachView(this.componentRef.hostView);
  }
  /** Set any stored initial inputs on the component's properties. */
  initializeInputs() {
    this.componentFactory.inputs.forEach(({ propName, transform: transform3 }) => {
      if (this.initialInputValues.has(propName)) {
        this.setInputValue(propName, this.initialInputValues.get(propName), transform3);
      }
    });
    this.initialInputValues.clear();
  }
  /** Sets up listeners for the component's outputs so that the events stream emits the events. */
  initializeOutputs(componentRef) {
    const eventEmitters = this.componentFactory.outputs.map(({ propName, templateName }) => {
      const emitter = componentRef.instance[propName];
      return emitter.pipe(map((value) => ({ name: templateName, value })));
    });
    this.eventEmitters.next(eventEmitters);
  }
  /** Calls ngOnChanges with all the inputs that have changed since the last call. */
  callNgOnChanges(componentRef) {
    if (!this.implementsOnChanges || this.inputChanges === null) {
      return;
    }
    const inputChanges = this.inputChanges;
    this.inputChanges = null;
    componentRef.instance.ngOnChanges(inputChanges);
  }
  /**
   * Marks the component view for check, if necessary.
   * (NOTE: This is required when the `ChangeDetectionStrategy` is set to `OnPush`.)
   */
  markViewForCheck(viewChangeDetectorRef) {
    if (this.hasInputChanges) {
      this.hasInputChanges = false;
      viewChangeDetectorRef.markForCheck();
    }
  }
  /**
   * Schedules change detection to run on the component.
   * Ignores subsequent calls if already scheduled.
   */
  scheduleDetectChanges() {
    if (this.scheduledChangeDetectionFn) {
      return;
    }
    this.scheduledChangeDetectionFn = scheduler.scheduleBeforeRender(() => {
      this.scheduledChangeDetectionFn = null;
      this.detectChanges();
    });
  }
  /**
   * Records input changes so that the component receives SimpleChanges in its onChanges function.
   */
  recordInputChange(property, currentValue) {
    if (!this.implementsOnChanges) {
      return;
    }
    if (this.inputChanges === null) {
      this.inputChanges = {};
    }
    const pendingChange = this.inputChanges[property];
    if (pendingChange) {
      pendingChange.currentValue = currentValue;
      return;
    }
    const isFirstChange = this.unchangedInputs.has(property);
    const previousValue = isFirstChange ? void 0 : this.getInputValue(property);
    this.inputChanges[property] = new SimpleChange(previousValue, currentValue, isFirstChange);
  }
  /** Runs change detection on the component. */
  detectChanges() {
    if (this.componentRef === null) {
      return;
    }
    this.callNgOnChanges(this.componentRef);
    this.markViewForCheck(this.viewChangeDetectorRef);
    this.componentRef.changeDetectorRef.detectChanges();
  }
  /** Runs in the angular zone, if present. */
  runInZone(fn) {
    return this.elementZone && Zone.current !== this.elementZone ? this.ngZone.run(fn) : fn();
  }
};
var NgElement = class extends HTMLElement {
  constructor() {
    super(...arguments);
    this.ngElementEventsSubscription = null;
  }
};
function createCustomElement(component, config2) {
  const inputs = getComponentInputs(component, config2.injector);
  const strategyFactory = config2.strategyFactory || new ComponentNgElementStrategyFactory(component, config2.injector);
  const attributeToPropertyInputs = getDefaultAttributeToPropertyInputs(inputs);
  const _NgElementImpl = class _NgElementImpl extends NgElement {
    get ngElementStrategy() {
      if (!this._ngElementStrategy) {
        const strategy = this._ngElementStrategy = strategyFactory.create(this.injector || config2.injector);
        inputs.forEach(({ propName, transform: transform3 }) => {
          if (!this.hasOwnProperty(propName)) {
            return;
          }
          const value = this[propName];
          delete this[propName];
          strategy.setInputValue(propName, value, transform3);
        });
      }
      return this._ngElementStrategy;
    }
    constructor(injector) {
      super();
      this.injector = injector;
    }
    attributeChangedCallback(attrName, oldValue, newValue, namespace) {
      const [propName, transform3] = attributeToPropertyInputs[attrName];
      this.ngElementStrategy.setInputValue(propName, newValue, transform3);
    }
    connectedCallback() {
      let subscribedToEvents = false;
      if (this.ngElementStrategy.events) {
        this.subscribeToEvents();
        subscribedToEvents = true;
      }
      this.ngElementStrategy.connect(this);
      if (!subscribedToEvents) {
        this.subscribeToEvents();
      }
    }
    disconnectedCallback() {
      if (this._ngElementStrategy) {
        this._ngElementStrategy.disconnect();
      }
      if (this.ngElementEventsSubscription) {
        this.ngElementEventsSubscription.unsubscribe();
        this.ngElementEventsSubscription = null;
      }
    }
    subscribeToEvents() {
      this.ngElementEventsSubscription = this.ngElementStrategy.events.subscribe((e) => {
        const customEvent = new CustomEvent(e.name, { detail: e.value });
        this.dispatchEvent(customEvent);
      });
    }
  };
  _NgElementImpl["observedAttributes"] = Object.keys(attributeToPropertyInputs);
  let NgElementImpl = _NgElementImpl;
  inputs.forEach(({ propName, transform: transform3 }) => {
    Object.defineProperty(NgElementImpl.prototype, propName, {
      get() {
        return this.ngElementStrategy.getInputValue(propName);
      },
      set(newValue) {
        this.ngElementStrategy.setInputValue(propName, newValue, transform3);
      },
      configurable: true,
      enumerable: true
    });
  });
  return NgElementImpl;
}
var VERSION8 = new Version("18.0.0-rc.1");

// dist/formbird-services/fesm2022/formbird-services.mjs
var _a;
var FormbirdInjectorService = (_a = class {
  constructor() {
    this.injector = window.FormbirdServiceInjector;
    if (!this.injector) {
      const element = document.querySelectorAll("#bodyAngularJS div[ui-view]");
      this.injector = angular.element(element).injector();
      this.isAngularJS = true;
    }
  }
  get(serviceName) {
    return this.injector.get(serviceName);
  }
  isAngularJSCore() {
    return this.isAngularJS;
  }
}, _a.\u0275fac = function FormbirdInjectorService_Factory(t) {
  return new (t || _a)();
}, _a.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a, factory: _a.\u0275fac, providedIn: "root" }), _a);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormbirdInjectorService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a2;
var SearchService = (_a2 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.searchService = formbirdInjectorService2.get("SearchService");
  }
  /**
   * Do Elastic search on server side. If the browser is offline, do searching indexedDB.
   * @param options consists of text, filter query to search
   * @param searchContext an object consists of additional params
   * @returns Promise
   */
  search(options, searchContext) {
    return this.searchService.search(options, searchContext);
  }
  generatePit() {
    return this.searchService.generatePit().toPromise();
  }
}, _a2.\u0275fac = function SearchService_Factory(t) {
  return new (t || _a2)(\u0275\u0275inject(FormbirdInjectorService));
}, _a2.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a2, factory: _a2.\u0275fac, providedIn: "root" }), _a2);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SearchService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a3;
var ConfigService = (_a3 = class {
  constructor() {
  }
  clientConfig() {
    return window["ftClientConfig"];
  }
}, _a3.\u0275fac = function ConfigService_Factory(t) {
  return new (t || _a3)();
}, _a3.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a3, factory: _a3.\u0275fac, providedIn: "root" }), _a3);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ConfigService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a4;
var ModifiedFieldService = (_a4 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("ModifiedFieldService");
  }
  /**
   * Reset the current form to its un-interacted state.
   */
  resetFormDirty() {
    this.ajsService.resetFormDirty();
  }
  /**
   * Check if the current form is dirty, that make the save button appear and blink or display unsaved changes dialog
   */
  isDirty() {
    return this.ajsService.isDirty();
  }
  /*
   * This method is used to add modified field by document id.
   * Before adding should check whether the version of the document has changed from the original because
   * there is a case reset current document from the one returned from server once it is saved.
   * @returns: true if adding successfully, otherwise: false
   */
  addModifiedField(documentId, changedFieldName, documentListId, shouldCompareDocuments, overrideTemplateId) {
    return this.ajsService.addModifiedField(documentId, changedFieldName, documentListId, shouldCompareDocuments, overrideTemplateId);
  }
}, _a4.\u0275fac = function ModifiedFieldService_Factory(t) {
  return new (t || _a4)(\u0275\u0275inject(FormbirdInjectorService));
}, _a4.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a4, factory: _a4.\u0275fac, providedIn: "root" }), _a4);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ModifiedFieldService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a5;
var UnsavedDocumentService = (_a5 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("UnsavedDocumentService");
  }
  setDocument(unsavedDocumentListId, document2) {
    return this.ajsService.setDocument(unsavedDocumentListId, document2);
  }
  setTemplate(unsavedDocumentListId, documentId, template) {
    return this.ajsService.setTemplate(unsavedDocumentListId, documentId, template);
  }
  removeDocumentList(unsavedDocumentListId) {
    return this.ajsService.removeDocumentList(unsavedDocumentListId);
  }
  /**
   * create a new unsaved document list. The unsaved document list is a list of documents that will be saved in a single
   * operation. This allows saving of documents independently of the nav bar save button. Eg. If you open up a dialog with a
   * template with a child doc then you need to save several documents on dialog close without saving the main document loaded
   * in the form. We can't put parameters in the save function to handle special cases like whether the save is for a dialog
   * because we would have to keep adding more special cases for saving from different locations.
   */
  createUnsavedDocumentList(name, existingUnsavedDocumentListId) {
    return this.ajsService.createUnsavedDocumentList(name, existingUnsavedDocumentListId);
  }
  updateDocumentListInfo(documentInfo, unsavedDocumentListId) {
    this.ajsService.updateDocumentListInfo(documentInfo, unsavedDocumentListId);
  }
}, _a5.\u0275fac = function UnsavedDocumentService_Factory(t) {
  return new (t || _a5)(\u0275\u0275inject(FormbirdInjectorService));
}, _a5.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a5, factory: _a5.\u0275fac, providedIn: "root" }), _a5);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UnsavedDocumentService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a6;
var ClientRulesService = (_a6 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsClientRulesService = injector.get("ClientRulesService");
  }
  getSharedValue(key) {
    return this.ajsClientRulesService.getSharedValue(key);
  }
  setSharedValue(key, value) {
    return this.ajsClientRulesService.setSharedValue(key, value);
  }
}, _a6.\u0275fac = function ClientRulesService_Factory(t) {
  return new (t || _a6)(\u0275\u0275inject(FormbirdInjectorService));
}, _a6.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a6, factory: _a6.\u0275fac, providedIn: "root" }), _a6);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ClientRulesService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a7;
var OfflineUtilService = (_a7 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.ajsService = formbirdInjectorService2.get("OfflineUtilService");
  }
  getNextId() {
    return this.ajsService.getNextId();
  }
}, _a7.\u0275fac = function OfflineUtilService_Factory(t) {
  return new (t || _a7)(\u0275\u0275inject(FormbirdInjectorService));
}, _a7.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a7, factory: _a7.\u0275fac, providedIn: "root" }), _a7);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OfflineUtilService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a8;
var BroadcastService = (_a8 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("BroadcastService");
    this.rebroadcastAngularJSEvents();
  }
  /**
   * rebroadcast AngularJS events as observables so that Angular components can subscribe to them
   */
  rebroadcastAngularJSEvents() {
    if (typeof angular !== "undefined") {
      const element = document.querySelectorAll("div[ui-view]");
      const injector = angular.element(element).injector();
      if (injector) {
        const rootScope = injector.get("$rootScope");
        rootScope.$on("document:updated", (event, data) => {
          this.broadcast("document:updated", data);
        });
      }
    }
  }
  broadcast(key, data) {
    if (!this.ajsService) {
      console.log("No BroadcastService provided.");
    } else {
      this.ajsService.broadcast(key, data);
    }
  }
  on(key) {
    if (!this.ajsService) {
      console.log("No BroadcastService provided.");
    } else {
      return this.ajsService.on(key);
    }
  }
}, _a8.\u0275fac = function BroadcastService_Factory(t) {
  return new (t || _a8)(\u0275\u0275inject(FormbirdInjectorService));
}, _a8.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a8, factory: _a8.\u0275fac, providedIn: "root" }), _a8);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BroadcastService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a9;
var NotificationService = (_a9 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("NotificationService");
  }
  /**
   * Display toast messages
   */
  printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent) {
    return this.ajsService.printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent);
  }
  success(message, title, displayDesktopNotification) {
    return this.ajsService.success(message, title, displayDesktopNotification);
  }
  error(message, title, displayDesktopNotification) {
    return this.ajsService.error(message, title, displayDesktopNotification);
  }
  warning(message, title, displayDesktopNotification) {
    return this.ajsService.warning(message, title, displayDesktopNotification);
  }
}, _a9.\u0275fac = function NotificationService_Factory(t) {
  return new (t || _a9)(\u0275\u0275inject(FormbirdInjectorService));
}, _a9.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a9, factory: _a9.\u0275fac, providedIn: "root" }), _a9);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NotificationService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a10;
var LocationService = (_a10 = class {
  constructor() {
    if (window.angular) {
      const element = document.querySelectorAll("div[ui-view]");
      const injector = angular.element(element).injector();
      this.ajsService = injector.get("$location");
    }
  }
  /**
   * go to URL. This will need to call the Angular 2+ Location.go when upgraded
   */
  go(path) {
    return this.ajsService.path(path);
  }
}, _a10.\u0275fac = function LocationService_Factory(t) {
  return new (t || _a10)();
}, _a10.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a10, factory: _a10.\u0275fac, providedIn: "root" }), _a10);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a11;
var ModalService = (_a11 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.ajsService = formbirdInjectorService2.get("ModalService");
  }
  showDialog(message, errorType, succFunc, errorFunc, discardFunc) {
    this.ajsService.showDialog(message, errorType, succFunc, errorFunc, discardFunc);
  }
  openDialog(options) {
    this.ajsService.openDialog(options);
  }
}, _a11.\u0275fac = function ModalService_Factory(t) {
  return new (t || _a11)(\u0275\u0275inject(FormbirdInjectorService));
}, _a11.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a11, factory: _a11.\u0275fac, providedIn: "root" }), _a11);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ModalService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a12;
var DocumentListService = (_a12 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("DocumentListService");
  }
  setupDocumentListId() {
    return this.ajsService.setupDocumentListId();
  }
  save() {
    return this.ajsService.save();
  }
  clearDocuments(documentListId) {
    this.ajsService.clearDocuments(documentListId);
  }
}, _a12.\u0275fac = function DocumentListService_Factory(t) {
  return new (t || _a12)(\u0275\u0275inject(FormbirdInjectorService));
}, _a12.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a12, factory: _a12.\u0275fac, providedIn: "root" }), _a12);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DocumentListService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a13;
var ValidationService = (_a13 = class {
  constructor(injector) {
    this.injector = injector;
    this.validationCtrlValues = {};
    this.ajsService = injector.get("ValidationService");
    this.validationCtrlValues = this.ajsService.validationCtrlValues;
  }
  loadValidators(componentDef, fieldName) {
    return this.ajsService.loadValidators(componentDef, fieldName);
  }
}, _a13.\u0275fac = function ValidationService_Factory(t) {
  return new (t || _a13)(\u0275\u0275inject(FormbirdInjectorService));
}, _a13.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a13, factory: _a13.\u0275fac }), _a13);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ValidationService, [{
    type: Injectable
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a14;
var WebSocketService = (_a14 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("WebSocketService");
  }
  emit(eventName, data) {
    return this.ajsService.emit(eventName, data);
  }
  addEventListener(eventName, eventHandlerFunc) {
    return this.ajsService.addEventListener(eventName, eventHandlerFunc);
  }
  removeEventListener(eventName) {
    return this.ajsService.removeEventListener(eventName);
  }
}, _a14.\u0275fac = function WebSocketService_Factory(t) {
  return new (t || _a14)(\u0275\u0275inject(FormbirdInjectorService));
}, _a14.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a14, factory: _a14.\u0275fac, providedIn: "root" }), _a14);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(WebSocketService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a15;
var ChangedDocumentService = (_a15 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("ChangedDocumentService");
  }
  /**
   * Listen value changes on a specified document field
   * @param fieldName the field name of document
   * @param documentId the document id
   * @param controlName the registered control that holds the field value in this component. It is used to check on the source of change
   * to avoid applying changes itself and also applying the value from the components that share the field name.
   * @param options provides more information for the watch.
   */
  watch(fieldName, documentId, controlName, options) {
    return this.ajsService.watch(fieldName, documentId, controlName, options);
  }
  /**
   * Provide the change information for the specified document field that the component binds to
   * @param component the component binds to the field
   * @param newValue the changed/new value
   * @param controlName the registered control manages the field value
   * @param options the options
   */
  valueChanged(component, value, controlName, options) {
    this.ajsService.valueChanged(component, value, controlName, options);
  }
  dispatchChanged(documentChangedInfo) {
    this.ajsService.dispatchChanged(documentChangedInfo);
  }
  executeOnFieldChangeWithNoChanges(component) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
    } else {
      this.ajsService.executeOnFieldChangeWithNoChanges(component);
    }
  }
  watchDocument(documentId) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
      return null;
    } else {
      return this.ajsService.watchDocument(documentId);
    }
  }
  watchStoreChanges() {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
      return null;
    } else {
      return this.ajsService.watchStoreChanges();
    }
  }
  dispatchAction(action) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
    } else {
      this.ajsService.dispatchAction(action);
    }
  }
  watchComponentTemplate(templateId) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
    } else {
      return this.ajsService.watchComponentTemplate(templateId);
    }
  }
  watchComponentDef(fieldName, templateId) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This feature is not supported on AngularJS Core.");
    } else {
      return this.ajsService.watchComponentDef(fieldName, templateId);
    }
  }
  notifyIntializedField(component, shouldDispatchEmptyFieldValue) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.notifyIntializedField(component, shouldDispatchEmptyFieldValue);
    }
  }
  notifyDocumentChanged(documentChangedInfo) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.notifyDocumentChanged(documentChangedInfo);
    }
  }
  notifyComponentDefinitionUpdated(templateId, fieldName, key, componentDefinition) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.notifyComponentDefinitionUpdated(templateId, fieldName, key, componentDefinition);
    }
  }
  setOrgDocument(document2) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.setOrgDocument(document2);
    }
  }
  setDocumentInfo(unsavedDocumentListId, docInfo) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.setDocumentInfo(unsavedDocumentListId, docInfo);
    }
  }
  setDocument(document2) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.setDocument(document2);
    }
  }
  setComponentFlagTemplate(templateId, fieldName, flagName, flagValue) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.setComponentFlagTemplate(templateId, fieldName, flagName, flagValue);
    }
  }
  isLoadedDocument(documentId, unsavedDocumentListId) {
    if (this.injector.isAngularJSCore()) {
      console.warn("This function is not supported on AngularJS Core.");
    } else {
      return this.ajsService.isLoadedDocument(documentId, unsavedDocumentListId);
    }
  }
}, _a15.\u0275fac = function ChangedDocumentService_Factory(t) {
  return new (t || _a15)(\u0275\u0275inject(FormbirdInjectorService));
}, _a15.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a15, factory: _a15.\u0275fac, providedIn: "root" }), _a15);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChangedDocumentService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a16;
var FinaliseValueFieldService = (_a16 = class {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("FinaliseValueFieldService");
  }
  addFinaliseValueFunction(templateId, fieldName, func) {
    this.ajsService.addFinaliseValueFunction(templateId, fieldName, func);
  }
  getFinaliseValueFunction(templateId, fieldName) {
    return this.ajsService.getFinaliseValueFunction(templateId, fieldName);
  }
  finaliseFieldValues(document2, template) {
    this.ajsService.finaliseFieldValues(document2, template);
  }
}, _a16.\u0275fac = function FinaliseValueFieldService_Factory(t) {
  return new (t || _a16)(\u0275\u0275inject(FormbirdInjectorService));
}, _a16.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a16, factory: _a16.\u0275fac, providedIn: "root" }), _a16);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FinaliseValueFieldService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a17;
var OfflineStatusService = (_a17 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.offlineStatusService = formbirdInjectorService2.get("OfflineStatusService");
    this.offlineStatus$ = this.offlineStatusService.offlineStatus$;
    this.offlineStatus = this.offlineStatusService.offlineStatus;
    this.pageDownloadProgress = this.offlineStatusService.pageDownloadProgress;
  }
}, _a17.\u0275fac = function OfflineStatusService_Factory(t) {
  return new (t || _a17)(\u0275\u0275inject(FormbirdInjectorService));
}, _a17.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a17, factory: _a17.\u0275fac, providedIn: "root" }), _a17);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(OfflineStatusService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a18;
var RouterService = (_a18 = class {
  constructor(injector) {
    this.injector = injector;
    this.service = injector.get("RouterService");
  }
  getActivatedRouteSnapshot() {
    return this.service.getActivatedRouteSnapshot();
  }
  navigate(params) {
    return this.service.navigate(params);
  }
  navigateByUrl(url, target) {
    return this.service.navigateByUrl(url, target);
  }
}, _a18.\u0275fac = function RouterService_Factory(t) {
  return new (t || _a18)(\u0275\u0275inject(FormbirdInjectorService));
}, _a18.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a18, factory: _a18.\u0275fac, providedIn: "root" }), _a18);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(RouterService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a19;
var FormbirdServicesModule = (_a19 = class {
  constructor() {
  }
}, _a19.\u0275fac = function FormbirdServicesModule_Factory(t) {
  return new (t || _a19)();
}, _a19.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _a19 }), _a19.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ providers: [
  ConfigService,
  BroadcastService,
  ClientRulesService,
  ModifiedFieldService,
  OfflineUtilService,
  OfflineStatusService,
  SearchService,
  UnsavedDocumentService,
  NotificationService,
  ModalService,
  LocationService,
  DocumentListService,
  ValidationService,
  WebSocketService,
  ChangedDocumentService,
  FinaliseValueFieldService,
  RouterService
] }), _a19);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormbirdServicesModule, [{
    type: NgModule,
    args: [{
      declarations: [],
      imports: [],
      providers: [
        ConfigService,
        BroadcastService,
        ClientRulesService,
        ModifiedFieldService,
        OfflineUtilService,
        OfflineStatusService,
        SearchService,
        UnsavedDocumentService,
        NotificationService,
        ModalService,
        LocationService,
        DocumentListService,
        ValidationService,
        WebSocketService,
        ChangedDocumentService,
        FinaliseValueFieldService,
        RouterService
      ],
      exports: []
    }]
  }], () => [], null);
})();
var _a20;
var DataService = (_a20 = class {
  constructor(injector) {
    this.injector = injector;
    this.dataService = injector.get("DataService");
  }
  printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent) {
    return this.dataService.printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent);
  }
  /*
   insert function
   parameters:
   bean - the bean to insert
   successFunction - a function to execute on success to do post save steps
   cachingRequired - whether to save the record to the local database. Records that never need
   to be loaded in the app on their own, such as events, can have this set to false
   */
  insert(bean, cachingRequired) {
    return __async(this, null, function* () {
      return this.dataService.insert(bean, cachingRequired);
    });
  }
  /**
   * get a document
   */
  getDocument(id2) {
    return __async(this, null, function* () {
      return this.dataService.getDocument(id2);
    });
  }
  /*
   execute component function
   parameters:
   options - object, should contin functionName, componentWebServiceName and functionParameters
   */
  executeComponentFunction(options) {
    return __async(this, null, function* () {
      return this.dataService.executeComponentFunction(options);
    });
  }
}, _a20.\u0275fac = function DataService_Factory(t) {
  return new (t || _a20)(\u0275\u0275inject(FormbirdInjectorService));
}, _a20.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a20, factory: _a20.\u0275fac, providedIn: "root" }), _a20);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DataService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a21;
var MainDocumentListService = (_a21 = class {
  constructor() {
    const element = document.querySelectorAll("div[ui-view]");
    const injector = angular.element(element).injector();
    this.ajsService = injector.get("MainDocumentListService");
  }
  /**
   * get the main document info
   */
  getMainDocumentListId() {
    return this.ajsService.getMainDocumentInfo().documentListId;
  }
}, _a21.\u0275fac = function MainDocumentListService_Factory(t) {
  return new (t || _a21)();
}, _a21.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a21, factory: _a21.\u0275fac, providedIn: "root" }), _a21);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MainDocumentListService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a22;
var DocumentService = (_a22 = class {
  constructor() {
  }
}, _a22.\u0275fac = function DocumentService_Factory(t) {
  return new (t || _a22)();
}, _a22.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a22, factory: _a22.\u0275fac, providedIn: "root" }), _a22);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DocumentService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a23;
var CurrentDocumentService = (_a23 = class {
  constructor() {
    const element = document.querySelectorAll("div[ui-view]");
    const injector = angular.element(element).injector();
    this.ajsService = injector.get("CurrentDocumentService");
    const rootScope = injector.get("$rootScope");
    const observeOnScope = injector.get("observeOnScope");
    this.documentData$ = observeOnScope(rootScope, () => {
      return this.ajsService.documentData;
    });
  }
  /**
   * get the template from the main document - which is the document that the object nav bar is linked to
   */
  getTemplate() {
    return this.ajsService.getTemplate();
  }
  setTemplate(template) {
    return this.ajsService.setTemplate(template);
  }
  /**
   * get the document from the main document - which is the document that the object nav bar is linked to
   */
  getDocument() {
    return this.ajsService.getDocument();
  }
  setDocument(document2) {
    return this.ajsService.setDocument(document2);
  }
  /**
   * set showFormAfterCreated. If false, the form will not be navigated to on save
   */
  setShowFormAfterCreated(showFormAfterCreated) {
    return this.ajsService.documentData.showFormAfterCreated = showFormAfterCreated;
  }
}, _a23.\u0275fac = function CurrentDocumentService_Factory(t) {
  return new (t || _a23)();
}, _a23.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _a23, factory: _a23.\u0275fac, providedIn: "root" }), _a23);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrentDocumentService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var ClientConstants = {
  // Used for the search filter
  FILTER: "filter",
  FILTERED_QUERY: "queryToBeFiltered",
  HTTP_STATUS_LOGIN_REJECTED: 401,
  OPERATION_TYPE_POST: "POST",
  // HTTP Post (insert) operation
  OPERATION_TYPE_PUT: "PUT",
  // HTTP Put (update) operation
  OPERATION_TYPE_DELETE: "DELETE",
  // HTTP Delete operation
  LAST_ENTERED_STATE_URL: "LastEnteredStateUrl",
  URL_EQUAL_REPLACEMENT_STRING: "fttf",
  // element ids
  TOGGLE_ID_LEFT: "left_close",
  // broadcasts
  DOCUMENT_NEW: "document:new",
  DOCUMENT_LOADED: "document:loaded",
  DOCUMENT_LOAD_ERROR: "document:loadError",
  VALIDATE_FORM_FIELDS: "document:validateFormFields",
  DOCUMENT_FORM_UPDATED: "document:formUpdated",
  PRESAVE_DOCUMENT_FORM_RESET: "document:preSaveDocumentReset",
  URL_CLICKED: "url:clicked",
  FORM_DIRTY_UPDATED: "formDirty",
  SPINNER_UPDATED: "showSpinner",
  // validation
  VALIDATION_INTERVAL_TIME: 500,
  // 500 milliseconds
  VALIDATION_REQUIRED_KEY: "required",
  VALIDATION_REQUIRED_MESSAGE: "This field is required.",
  VALIDATION_MIN_LENGTH_KEY: "hasMinLength",
  VALIDATION_MIN_LENGTH_MESSAGE: "This field is required at least %s characters long.",
  VALIDATION_MAX_LENGTH_KEY: "hasMaxLength",
  VALIDATION_MAX_LENGTH_MESSAGE: "This field is required max %s characters long.",
  CHANGED_DOCUMENT_LIST_ID_KEY: "___DOCUMENT_LIST_ID___",
  FILE_SENT_EVENT_NAME: "FileSentEventName",
  LOCAL_STORAGE_OFFLINE_STATUS_KEY: "OfflineStatus",
  ANGULAR_COMPONENT_SUFFIX: "-ng"
};

// dist/formbird-sc-shared/fesm2022/formbird-sc-shared.mjs
var Handlebars = __toESM(require_handlebars(), 1);
var Handlebars2 = __toESM(require_handlebars(), 1);
var uuid = __toESM(require_uuid(), 1);
var moment = __toESM(require_moment(), 1);

// node_modules/@angular/material/fesm2022/icon.mjs
var _c07 = ["*"];
var policy2;
function getPolicy2() {
  if (policy2 === void 0) {
    policy2 = null;
    if (typeof window !== "undefined") {
      const ttWindow = window;
      if (ttWindow.trustedTypes !== void 0) {
        policy2 = ttWindow.trustedTypes.createPolicy("angular#components", {
          createHTML: (s) => s
        });
      }
    }
  }
  return policy2;
}
function trustedHTMLFromString2(html) {
  return getPolicy2()?.createHTML(html) || html;
}
function getMatIconNameNotFoundError(iconName) {
  return Error(`Unable to find icon with the name "${iconName}"`);
}
function getMatIconNoHttpProviderError() {
  return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.");
}
function getMatIconFailedToSanitizeUrlError(url) {
  return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${url}".`);
}
function getMatIconFailedToSanitizeLiteralError(literal) {
  return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${literal}".`);
}
var SvgIconConfig = class {
  constructor(url, svgText, options) {
    this.url = url;
    this.svgText = svgText;
    this.options = options;
  }
};
var _MatIconRegistry = class _MatIconRegistry {
  constructor(_httpClient, _sanitizer, document2, _errorHandler) {
    this._httpClient = _httpClient;
    this._sanitizer = _sanitizer;
    this._errorHandler = _errorHandler;
    this._svgIconConfigs = /* @__PURE__ */ new Map();
    this._iconSetConfigs = /* @__PURE__ */ new Map();
    this._cachedIconsByUrl = /* @__PURE__ */ new Map();
    this._inProgressUrlFetches = /* @__PURE__ */ new Map();
    this._fontCssClassesByAlias = /* @__PURE__ */ new Map();
    this._resolvers = [];
    this._defaultFontSetClass = ["material-icons", "mat-ligature-font"];
    this._document = document2;
  }
  /**
   * Registers an icon by URL in the default namespace.
   * @param iconName Name under which the icon should be registered.
   * @param url
   */
  addSvgIcon(iconName, url, options) {
    return this.addSvgIconInNamespace("", iconName, url, options);
  }
  /**
   * Registers an icon using an HTML string in the default namespace.
   * @param iconName Name under which the icon should be registered.
   * @param literal SVG source of the icon.
   */
  addSvgIconLiteral(iconName, literal, options) {
    return this.addSvgIconLiteralInNamespace("", iconName, literal, options);
  }
  /**
   * Registers an icon by URL in the specified namespace.
   * @param namespace Namespace in which the icon should be registered.
   * @param iconName Name under which the icon should be registered.
   * @param url
   */
  addSvgIconInNamespace(namespace, iconName, url, options) {
    return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, null, options));
  }
  /**
   * Registers an icon resolver function with the registry. The function will be invoked with the
   * name and namespace of an icon when the registry tries to resolve the URL from which to fetch
   * the icon. The resolver is expected to return a `SafeResourceUrl` that points to the icon,
   * an object with the icon URL and icon options, or `null` if the icon is not supported. Resolvers
   * will be invoked in the order in which they have been registered.
   * @param resolver Resolver function to be registered.
   */
  addSvgIconResolver(resolver) {
    this._resolvers.push(resolver);
    return this;
  }
  /**
   * Registers an icon using an HTML string in the specified namespace.
   * @param namespace Namespace in which the icon should be registered.
   * @param iconName Name under which the icon should be registered.
   * @param literal SVG source of the icon.
   */
  addSvgIconLiteralInNamespace(namespace, iconName, literal, options) {
    const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
    if (!cleanLiteral) {
      throw getMatIconFailedToSanitizeLiteralError(literal);
    }
    const trustedLiteral = trustedHTMLFromString2(cleanLiteral);
    return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig("", trustedLiteral, options));
  }
  /**
   * Registers an icon set by URL in the default namespace.
   * @param url
   */
  addSvgIconSet(url, options) {
    return this.addSvgIconSetInNamespace("", url, options);
  }
  /**
   * Registers an icon set using an HTML string in the default namespace.
   * @param literal SVG source of the icon set.
   */
  addSvgIconSetLiteral(literal, options) {
    return this.addSvgIconSetLiteralInNamespace("", literal, options);
  }
  /**
   * Registers an icon set by URL in the specified namespace.
   * @param namespace Namespace in which to register the icon set.
   * @param url
   */
  addSvgIconSetInNamespace(namespace, url, options) {
    return this._addSvgIconSetConfig(namespace, new SvgIconConfig(url, null, options));
  }
  /**
   * Registers an icon set using an HTML string in the specified namespace.
   * @param namespace Namespace in which to register the icon set.
   * @param literal SVG source of the icon set.
   */
  addSvgIconSetLiteralInNamespace(namespace, literal, options) {
    const cleanLiteral = this._sanitizer.sanitize(SecurityContext.HTML, literal);
    if (!cleanLiteral) {
      throw getMatIconFailedToSanitizeLiteralError(literal);
    }
    const trustedLiteral = trustedHTMLFromString2(cleanLiteral);
    return this._addSvgIconSetConfig(namespace, new SvgIconConfig("", trustedLiteral, options));
  }
  /**
   * Defines an alias for CSS class names to be used for icon fonts. Creating an matIcon
   * component with the alias as the fontSet input will cause the class name to be applied
   * to the `<mat-icon>` element.
   *
   * If the registered font is a ligature font, then don't forget to also include the special
   * class `mat-ligature-font` to allow the usage via attribute. So register like this:
   *
   * ```ts
   * iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
   * ```
   *
   * And use like this:
   *
   * ```html
   * <mat-icon fontSet="f1" fontIcon="home"></mat-icon>
   * ```
   *
   * @param alias Alias for the font.
   * @param classNames Class names override to be used instead of the alias.
   */
  registerFontClassAlias(alias, classNames = alias) {
    this._fontCssClassesByAlias.set(alias, classNames);
    return this;
  }
  /**
   * Returns the CSS class name associated with the alias by a previous call to
   * registerFontClassAlias. If no CSS class has been associated, returns the alias unmodified.
   */
  classNameForFontAlias(alias) {
    return this._fontCssClassesByAlias.get(alias) || alias;
  }
  /**
   * Sets the CSS classes to be used for icon fonts when an `<mat-icon>` component does not
   * have a fontSet input value, and is not loading an icon by name or URL.
   */
  setDefaultFontSetClass(...classNames) {
    this._defaultFontSetClass = classNames;
    return this;
  }
  /**
   * Returns the CSS classes to be used for icon fonts when an `<mat-icon>` component does not
   * have a fontSet input value, and is not loading an icon by name or URL.
   */
  getDefaultFontSetClass() {
    return this._defaultFontSetClass;
  }
  /**
   * Returns an Observable that produces the icon (as an `<svg>` DOM element) from the given URL.
   * The response from the URL may be cached so this will not always cause an HTTP request, but
   * the produced element will always be a new copy of the originally fetched icon. (That is,
   * it will not contain any modifications made to elements previously returned).
   *
   * @param safeUrl URL from which to fetch the SVG icon.
   */
  getSvgIconFromUrl(safeUrl) {
    const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);
    if (!url) {
      throw getMatIconFailedToSanitizeUrlError(safeUrl);
    }
    const cachedIcon = this._cachedIconsByUrl.get(url);
    if (cachedIcon) {
      return of(cloneSvg(cachedIcon));
    }
    return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl, null)).pipe(tap((svg) => this._cachedIconsByUrl.set(url, svg)), map((svg) => cloneSvg(svg)));
  }
  /**
   * Returns an Observable that produces the icon (as an `<svg>` DOM element) with the given name
   * and namespace. The icon must have been previously registered with addIcon or addIconSet;
   * if not, the Observable will throw an error.
   *
   * @param name Name of the icon to be retrieved.
   * @param namespace Namespace in which to look for the icon.
   */
  getNamedSvgIcon(name, namespace = "") {
    const key = iconKey(namespace, name);
    let config2 = this._svgIconConfigs.get(key);
    if (config2) {
      return this._getSvgFromConfig(config2);
    }
    config2 = this._getIconConfigFromResolvers(namespace, name);
    if (config2) {
      this._svgIconConfigs.set(key, config2);
      return this._getSvgFromConfig(config2);
    }
    const iconSetConfigs = this._iconSetConfigs.get(namespace);
    if (iconSetConfigs) {
      return this._getSvgFromIconSetConfigs(name, iconSetConfigs);
    }
    return throwError(getMatIconNameNotFoundError(key));
  }
  ngOnDestroy() {
    this._resolvers = [];
    this._svgIconConfigs.clear();
    this._iconSetConfigs.clear();
    this._cachedIconsByUrl.clear();
  }
  /**
   * Returns the cached icon for a SvgIconConfig if available, or fetches it from its URL if not.
   */
  _getSvgFromConfig(config2) {
    if (config2.svgText) {
      return of(cloneSvg(this._svgElementFromConfig(config2)));
    } else {
      return this._loadSvgIconFromConfig(config2).pipe(map((svg) => cloneSvg(svg)));
    }
  }
  /**
   * Attempts to find an icon with the specified name in any of the SVG icon sets.
   * First searches the available cached icons for a nested element with a matching name, and
   * if found copies the element to a new `<svg>` element. If not found, fetches all icon sets
   * that have not been cached, and searches again after all fetches are completed.
   * The returned Observable produces the SVG element if possible, and throws
   * an error if no icon with the specified name can be found.
   */
  _getSvgFromIconSetConfigs(name, iconSetConfigs) {
    const namedIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
    if (namedIcon) {
      return of(namedIcon);
    }
    const iconSetFetchRequests = iconSetConfigs.filter((iconSetConfig) => !iconSetConfig.svgText).map((iconSetConfig) => {
      return this._loadSvgIconSetFromConfig(iconSetConfig).pipe(catchError((err) => {
        const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconSetConfig.url);
        const errorMessage = `Loading icon set URL: ${url} failed: ${err.message}`;
        this._errorHandler.handleError(new Error(errorMessage));
        return of(null);
      }));
    });
    return forkJoin(iconSetFetchRequests).pipe(map(() => {
      const foundIcon = this._extractIconWithNameFromAnySet(name, iconSetConfigs);
      if (!foundIcon) {
        throw getMatIconNameNotFoundError(name);
      }
      return foundIcon;
    }));
  }
  /**
   * Searches the cached SVG elements for the given icon sets for a nested icon element whose "id"
   * tag matches the specified name. If found, copies the nested element to a new SVG element and
   * returns it. Returns null if no matching element is found.
   */
  _extractIconWithNameFromAnySet(iconName, iconSetConfigs) {
    for (let i2 = iconSetConfigs.length - 1; i2 >= 0; i2--) {
      const config2 = iconSetConfigs[i2];
      if (config2.svgText && config2.svgText.toString().indexOf(iconName) > -1) {
        const svg = this._svgElementFromConfig(config2);
        const foundIcon = this._extractSvgIconFromSet(svg, iconName, config2.options);
        if (foundIcon) {
          return foundIcon;
        }
      }
    }
    return null;
  }
  /**
   * Loads the content of the icon URL specified in the SvgIconConfig and creates an SVG element
   * from it.
   */
  _loadSvgIconFromConfig(config2) {
    return this._fetchIcon(config2).pipe(tap((svgText) => config2.svgText = svgText), map(() => this._svgElementFromConfig(config2)));
  }
  /**
   * Loads the content of the icon set URL specified in the
   * SvgIconConfig and attaches it to the config.
   */
  _loadSvgIconSetFromConfig(config2) {
    if (config2.svgText) {
      return of(null);
    }
    return this._fetchIcon(config2).pipe(tap((svgText) => config2.svgText = svgText));
  }
  /**
   * Searches the cached element of the given SvgIconConfig for a nested icon element whose "id"
   * tag matches the specified name. If found, copies the nested element to a new SVG element and
   * returns it. Returns null if no matching element is found.
   */
  _extractSvgIconFromSet(iconSet, iconName, options) {
    const iconSource = iconSet.querySelector(`[id="${iconName}"]`);
    if (!iconSource) {
      return null;
    }
    const iconElement = iconSource.cloneNode(true);
    iconElement.removeAttribute("id");
    if (iconElement.nodeName.toLowerCase() === "svg") {
      return this._setSvgAttributes(iconElement, options);
    }
    if (iconElement.nodeName.toLowerCase() === "symbol") {
      return this._setSvgAttributes(this._toSvgElement(iconElement), options);
    }
    const svg = this._svgElementFromString(trustedHTMLFromString2("<svg></svg>"));
    svg.appendChild(iconElement);
    return this._setSvgAttributes(svg, options);
  }
  /**
   * Creates a DOM element from the given SVG string.
   */
  _svgElementFromString(str2) {
    const div = this._document.createElement("DIV");
    div.innerHTML = str2;
    const svg = div.querySelector("svg");
    if (!svg) {
      throw Error("<svg> tag not found");
    }
    return svg;
  }
  /**
   * Converts an element into an SVG node by cloning all of its children.
   */
  _toSvgElement(element) {
    const svg = this._svgElementFromString(trustedHTMLFromString2("<svg></svg>"));
    const attributes = element.attributes;
    for (let i2 = 0; i2 < attributes.length; i2++) {
      const {
        name,
        value
      } = attributes[i2];
      if (name !== "id") {
        svg.setAttribute(name, value);
      }
    }
    for (let i2 = 0; i2 < element.childNodes.length; i2++) {
      if (element.childNodes[i2].nodeType === this._document.ELEMENT_NODE) {
        svg.appendChild(element.childNodes[i2].cloneNode(true));
      }
    }
    return svg;
  }
  /**
   * Sets the default attributes for an SVG element to be used as an icon.
   */
  _setSvgAttributes(svg, options) {
    svg.setAttribute("fit", "");
    svg.setAttribute("height", "100%");
    svg.setAttribute("width", "100%");
    svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
    svg.setAttribute("focusable", "false");
    if (options && options.viewBox) {
      svg.setAttribute("viewBox", options.viewBox);
    }
    return svg;
  }
  /**
   * Returns an Observable which produces the string contents of the given icon. Results may be
   * cached, so future calls with the same URL may not cause another HTTP request.
   */
  _fetchIcon(iconConfig) {
    const {
      url: safeUrl,
      options
    } = iconConfig;
    const withCredentials2 = options?.withCredentials ?? false;
    if (!this._httpClient) {
      throw getMatIconNoHttpProviderError();
    }
    if (safeUrl == null) {
      throw Error(`Cannot fetch icon from URL "${safeUrl}".`);
    }
    const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);
    if (!url) {
      throw getMatIconFailedToSanitizeUrlError(safeUrl);
    }
    const inProgressFetch = this._inProgressUrlFetches.get(url);
    if (inProgressFetch) {
      return inProgressFetch;
    }
    const req = this._httpClient.get(url, {
      responseType: "text",
      withCredentials: withCredentials2
    }).pipe(map((svg) => {
      return trustedHTMLFromString2(svg);
    }), finalize(() => this._inProgressUrlFetches.delete(url)), share());
    this._inProgressUrlFetches.set(url, req);
    return req;
  }
  /**
   * Registers an icon config by name in the specified namespace.
   * @param namespace Namespace in which to register the icon config.
   * @param iconName Name under which to register the config.
   * @param config Config to be registered.
   */
  _addSvgIconConfig(namespace, iconName, config2) {
    this._svgIconConfigs.set(iconKey(namespace, iconName), config2);
    return this;
  }
  /**
   * Registers an icon set config in the specified namespace.
   * @param namespace Namespace in which to register the icon config.
   * @param config Config to be registered.
   */
  _addSvgIconSetConfig(namespace, config2) {
    const configNamespace = this._iconSetConfigs.get(namespace);
    if (configNamespace) {
      configNamespace.push(config2);
    } else {
      this._iconSetConfigs.set(namespace, [config2]);
    }
    return this;
  }
  /** Parses a config's text into an SVG element. */
  _svgElementFromConfig(config2) {
    if (!config2.svgElement) {
      const svg = this._svgElementFromString(config2.svgText);
      this._setSvgAttributes(svg, config2.options);
      config2.svgElement = svg;
    }
    return config2.svgElement;
  }
  /** Tries to create an icon config through the registered resolver functions. */
  _getIconConfigFromResolvers(namespace, name) {
    for (let i2 = 0; i2 < this._resolvers.length; i2++) {
      const result = this._resolvers[i2](name, namespace);
      if (result) {
        return isSafeUrlWithOptions(result) ? new SvgIconConfig(result.url, null, result.options) : new SvgIconConfig(result, null);
      }
    }
    return void 0;
  }
};
_MatIconRegistry.\u0275fac = function MatIconRegistry_Factory(t) {
  return new (t || _MatIconRegistry)(\u0275\u0275inject(HttpClient, 8), \u0275\u0275inject(DomSanitizer), \u0275\u0275inject(DOCUMENT2, 8), \u0275\u0275inject(ErrorHandler));
};
_MatIconRegistry.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _MatIconRegistry,
  factory: _MatIconRegistry.\u0275fac,
  providedIn: "root"
});
var MatIconRegistry = _MatIconRegistry;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconRegistry, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{
    type: HttpClient,
    decorators: [{
      type: Optional
    }]
  }, {
    type: DomSanitizer
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: ErrorHandler
  }], null);
})();
function ICON_REGISTRY_PROVIDER_FACTORY(parentRegistry, httpClient, sanitizer, errorHandler2, document2) {
  return parentRegistry || new MatIconRegistry(httpClient, sanitizer, document2, errorHandler2);
}
var ICON_REGISTRY_PROVIDER = {
  // If there is already an MatIconRegistry available, use that. Otherwise, provide a new one.
  provide: MatIconRegistry,
  deps: [[new Optional(), new SkipSelf(), MatIconRegistry], [new Optional(), HttpClient], DomSanitizer, ErrorHandler, [new Optional(), DOCUMENT2]],
  useFactory: ICON_REGISTRY_PROVIDER_FACTORY
};
function cloneSvg(svg) {
  return svg.cloneNode(true);
}
function iconKey(namespace, name) {
  return namespace + ":" + name;
}
function isSafeUrlWithOptions(value) {
  return !!(value.url && value.options);
}
var MAT_ICON_DEFAULT_OPTIONS = new InjectionToken("MAT_ICON_DEFAULT_OPTIONS");
var MAT_ICON_LOCATION = new InjectionToken("mat-icon-location", {
  providedIn: "root",
  factory: MAT_ICON_LOCATION_FACTORY
});
function MAT_ICON_LOCATION_FACTORY() {
  const _document2 = inject(DOCUMENT2);
  const _location = _document2 ? _document2.location : null;
  return {
    // Note that this needs to be a function, rather than a property, because Angular
    // will only resolve it once, but we want the current path on each call.
    getPathname: () => _location ? _location.pathname + _location.search : ""
  };
}
var funcIriAttributes = ["clip-path", "color-profile", "src", "cursor", "fill", "filter", "marker", "marker-start", "marker-mid", "marker-end", "mask", "stroke"];
var funcIriAttributeSelector = funcIriAttributes.map((attr) => `[${attr}]`).join(", ");
var funcIriPattern = /^url\(['"]?#(.*?)['"]?\)$/;
var _MatIcon = class _MatIcon {
  /** Theme palette color of the icon. */
  get color() {
    return this._color || this._defaultColor;
  }
  set color(value) {
    this._color = value;
  }
  /** Name of the icon in the SVG icon set. */
  get svgIcon() {
    return this._svgIcon;
  }
  set svgIcon(value) {
    if (value !== this._svgIcon) {
      if (value) {
        this._updateSvgIcon(value);
      } else if (this._svgIcon) {
        this._clearSvgElement();
      }
      this._svgIcon = value;
    }
  }
  /** Font set that the icon is a part of. */
  get fontSet() {
    return this._fontSet;
  }
  set fontSet(value) {
    const newValue = this._cleanupFontValue(value);
    if (newValue !== this._fontSet) {
      this._fontSet = newValue;
      this._updateFontIconClasses();
    }
  }
  /** Name of an icon within a font set. */
  get fontIcon() {
    return this._fontIcon;
  }
  set fontIcon(value) {
    const newValue = this._cleanupFontValue(value);
    if (newValue !== this._fontIcon) {
      this._fontIcon = newValue;
      this._updateFontIconClasses();
    }
  }
  constructor(_elementRef, _iconRegistry, ariaHidden, _location, _errorHandler, defaults4) {
    this._elementRef = _elementRef;
    this._iconRegistry = _iconRegistry;
    this._location = _location;
    this._errorHandler = _errorHandler;
    this.inline = false;
    this._previousFontSetClass = [];
    this._currentIconFetch = Subscription.EMPTY;
    if (defaults4) {
      if (defaults4.color) {
        this.color = this._defaultColor = defaults4.color;
      }
      if (defaults4.fontSet) {
        this.fontSet = defaults4.fontSet;
      }
    }
    if (!ariaHidden) {
      _elementRef.nativeElement.setAttribute("aria-hidden", "true");
    }
  }
  /**
   * Splits an svgIcon binding value into its icon set and icon name components.
   * Returns a 2-element array of [(icon set), (icon name)].
   * The separator for the two fields is ':'. If there is no separator, an empty
   * string is returned for the icon set and the entire value is returned for
   * the icon name. If the argument is falsy, returns an array of two empty strings.
   * Throws an error if the name contains two or more ':' separators.
   * Examples:
   *   `'social:cake' -> ['social', 'cake']
   *   'penguin' -> ['', 'penguin']
   *   null -> ['', '']
   *   'a:b:c' -> (throws Error)`
   */
  _splitIconName(iconName) {
    if (!iconName) {
      return ["", ""];
    }
    const parts = iconName.split(":");
    switch (parts.length) {
      case 1:
        return ["", parts[0]];
      case 2:
        return parts;
      default:
        throw Error(`Invalid icon name: "${iconName}"`);
    }
  }
  ngOnInit() {
    this._updateFontIconClasses();
  }
  ngAfterViewChecked() {
    const cachedElements = this._elementsWithExternalReferences;
    if (cachedElements && cachedElements.size) {
      const newPath = this._location.getPathname();
      if (newPath !== this._previousPath) {
        this._previousPath = newPath;
        this._prependPathToReferences(newPath);
      }
    }
  }
  ngOnDestroy() {
    this._currentIconFetch.unsubscribe();
    if (this._elementsWithExternalReferences) {
      this._elementsWithExternalReferences.clear();
    }
  }
  _usingFontIcon() {
    return !this.svgIcon;
  }
  _setSvgElement(svg) {
    this._clearSvgElement();
    const path = this._location.getPathname();
    this._previousPath = path;
    this._cacheChildrenWithExternalReferences(svg);
    this._prependPathToReferences(path);
    this._elementRef.nativeElement.appendChild(svg);
  }
  _clearSvgElement() {
    const layoutElement = this._elementRef.nativeElement;
    let childCount = layoutElement.childNodes.length;
    if (this._elementsWithExternalReferences) {
      this._elementsWithExternalReferences.clear();
    }
    while (childCount--) {
      const child = layoutElement.childNodes[childCount];
      if (child.nodeType !== 1 || child.nodeName.toLowerCase() === "svg") {
        child.remove();
      }
    }
  }
  _updateFontIconClasses() {
    if (!this._usingFontIcon()) {
      return;
    }
    const elem = this._elementRef.nativeElement;
    const fontSetClasses = (this.fontSet ? this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/) : this._iconRegistry.getDefaultFontSetClass()).filter((className) => className.length > 0);
    this._previousFontSetClass.forEach((className) => elem.classList.remove(className));
    fontSetClasses.forEach((className) => elem.classList.add(className));
    this._previousFontSetClass = fontSetClasses;
    if (this.fontIcon !== this._previousFontIconClass && !fontSetClasses.includes("mat-ligature-font")) {
      if (this._previousFontIconClass) {
        elem.classList.remove(this._previousFontIconClass);
      }
      if (this.fontIcon) {
        elem.classList.add(this.fontIcon);
      }
      this._previousFontIconClass = this.fontIcon;
    }
  }
  /**
   * Cleans up a value to be used as a fontIcon or fontSet.
   * Since the value ends up being assigned as a CSS class, we
   * have to trim the value and omit space-separated values.
   */
  _cleanupFontValue(value) {
    return typeof value === "string" ? value.trim().split(" ")[0] : value;
  }
  /**
   * Prepends the current path to all elements that have an attribute pointing to a `FuncIRI`
   * reference. This is required because WebKit browsers require references to be prefixed with
   * the current path, if the page has a `base` tag.
   */
  _prependPathToReferences(path) {
    const elements = this._elementsWithExternalReferences;
    if (elements) {
      elements.forEach((attrs, element) => {
        attrs.forEach((attr) => {
          element.setAttribute(attr.name, `url('${path}#${attr.value}')`);
        });
      });
    }
  }
  /**
   * Caches the children of an SVG element that have `url()`
   * references that we need to prefix with the current path.
   */
  _cacheChildrenWithExternalReferences(element) {
    const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);
    const elements = this._elementsWithExternalReferences = this._elementsWithExternalReferences || /* @__PURE__ */ new Map();
    for (let i2 = 0; i2 < elementsWithFuncIri.length; i2++) {
      funcIriAttributes.forEach((attr) => {
        const elementWithReference = elementsWithFuncIri[i2];
        const value = elementWithReference.getAttribute(attr);
        const match2 = value ? value.match(funcIriPattern) : null;
        if (match2) {
          let attributes = elements.get(elementWithReference);
          if (!attributes) {
            attributes = [];
            elements.set(elementWithReference, attributes);
          }
          attributes.push({
            name: attr,
            value: match2[1]
          });
        }
      });
    }
  }
  /** Sets a new SVG icon with a particular name. */
  _updateSvgIcon(rawName) {
    this._svgNamespace = null;
    this._svgName = null;
    this._currentIconFetch.unsubscribe();
    if (rawName) {
      const [namespace, iconName] = this._splitIconName(rawName);
      if (namespace) {
        this._svgNamespace = namespace;
      }
      if (iconName) {
        this._svgName = iconName;
      }
      this._currentIconFetch = this._iconRegistry.getNamedSvgIcon(iconName, namespace).pipe(take(1)).subscribe((svg) => this._setSvgElement(svg), (err) => {
        const errorMessage = `Error retrieving icon ${namespace}:${iconName}! ${err.message}`;
        this._errorHandler.handleError(new Error(errorMessage));
      });
    }
  }
};
_MatIcon.\u0275fac = function MatIcon_Factory(t) {
  return new (t || _MatIcon)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(MatIconRegistry), \u0275\u0275injectAttribute("aria-hidden"), \u0275\u0275directiveInject(MAT_ICON_LOCATION), \u0275\u0275directiveInject(ErrorHandler), \u0275\u0275directiveInject(MAT_ICON_DEFAULT_OPTIONS, 8));
};
_MatIcon.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _MatIcon,
  selectors: [["mat-icon"]],
  hostAttrs: ["role", "img", 1, "mat-icon", "notranslate"],
  hostVars: 10,
  hostBindings: function MatIcon_HostBindings(rf, ctx) {
    if (rf & 2) {
      \u0275\u0275attribute("data-mat-icon-type", ctx._usingFontIcon() ? "font" : "svg")("data-mat-icon-name", ctx._svgName || ctx.fontIcon)("data-mat-icon-namespace", ctx._svgNamespace || ctx.fontSet)("fontIcon", ctx._usingFontIcon() ? ctx.fontIcon : null);
      \u0275\u0275classMap(ctx.color ? "mat-" + ctx.color : "");
      \u0275\u0275classProp("mat-icon-inline", ctx.inline)("mat-icon-no-color", ctx.color !== "primary" && ctx.color !== "accent" && ctx.color !== "warn");
    }
  },
  inputs: {
    color: "color",
    inline: [2, "inline", "inline", booleanAttribute],
    svgIcon: "svgIcon",
    fontSet: "fontSet",
    fontIcon: "fontIcon"
  },
  exportAs: ["matIcon"],
  standalone: true,
  features: [\u0275\u0275InputTransformsFeature, \u0275\u0275StandaloneFeature],
  ngContentSelectors: _c07,
  decls: 1,
  vars: 0,
  template: function MatIcon_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275projection(0);
    }
  },
  styles: ["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],
  encapsulation: 2,
  changeDetection: 0
});
var MatIcon = _MatIcon;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIcon, [{
    type: Component,
    args: [{
      template: "<ng-content></ng-content>",
      selector: "mat-icon",
      exportAs: "matIcon",
      host: {
        "role": "img",
        "class": "mat-icon notranslate",
        "[class]": 'color ? "mat-" + color : ""',
        "[attr.data-mat-icon-type]": '_usingFontIcon() ? "font" : "svg"',
        "[attr.data-mat-icon-name]": "_svgName || fontIcon",
        "[attr.data-mat-icon-namespace]": "_svgNamespace || fontSet",
        "[attr.fontIcon]": "_usingFontIcon() ? fontIcon : null",
        "[class.mat-icon-inline]": "inline",
        "[class.mat-icon-no-color]": 'color !== "primary" && color !== "accent" && color !== "warn"'
      },
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      standalone: true,
      styles: ["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"]
    }]
  }], () => [{
    type: ElementRef
  }, {
    type: MatIconRegistry
  }, {
    type: void 0,
    decorators: [{
      type: Attribute,
      args: ["aria-hidden"]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [MAT_ICON_LOCATION]
    }]
  }, {
    type: ErrorHandler
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [MAT_ICON_DEFAULT_OPTIONS]
    }]
  }], {
    color: [{
      type: Input
    }],
    inline: [{
      type: Input,
      args: [{
        transform: booleanAttribute
      }]
    }],
    svgIcon: [{
      type: Input
    }],
    fontSet: [{
      type: Input
    }],
    fontIcon: [{
      type: Input
    }]
  });
})();
var _MatIconModule = class _MatIconModule {
};
_MatIconModule.\u0275fac = function MatIconModule_Factory(t) {
  return new (t || _MatIconModule)();
};
_MatIconModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _MatIconModule
});
_MatIconModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  imports: [MatCommonModule, MatCommonModule]
});
var MatIconModule = _MatIconModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatIconModule, [{
    type: NgModule,
    args: [{
      imports: [MatCommonModule, MatIcon],
      exports: [MatIcon, MatCommonModule]
    }]
  }], null, null);
})();

// dist/formbird-sc-shared/fesm2022/formbird-sc-shared.mjs
var _a24;
var CustomElementService = (_a24 = class {
  constructor(fbInjectorService) {
    this.fbInjectorService = fbInjectorService;
    this.convertToCustomElement = (component, selector, injector, angularSuffix, version, options) => {
      if (angularSuffix && this.fbInjectorService.isAngularJSCore()) {
        selector += angularSuffix;
      }
      if (!version) {
        version = "NOT-SET";
      }
      if (!customElements.get(selector)) {
        const scComponent = createCustomElement(component, { injector });
        const connectedCallback = scComponent.prototype.connectedCallback || function() {
        };
        scComponent.prototype.connectedCallback = function() {
          this.setAttribute("fb-component-version", version);
          if (options) {
            this.setAttribute("is-static-panel", options.isStaticPanel);
          }
          connectedCallback.call(this);
        };
        customElements.define(selector, scComponent);
      }
    };
  }
}, _a24.\u0275fac = function CustomElementService_Factory(t) {
  return new (t || _a24)(\u0275\u0275inject(FormbirdInjectorService));
}, _a24.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a24, factory: _a24.\u0275fac, providedIn: "root" }), _a24);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CustomElementService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a25;
var UtilSharingService = (_a25 = class {
  constructor(clientRulesService) {
    this.clientRulesService = clientRulesService;
  }
  // Function that would trigger/call functions from one component to other components/ rules
  //  componentFieldName=>name of component that contains the function;functionName=> name of the function declared in componentFieldName
  // e.g component function call:scope.sclUtilSharing.fnCallFunction(scope.fieldName,'eventReloadDatatable');
  // e.g rules calling: UtilSharingLibrary.fnCallFunction('scDatatablesTest','eventReloadDatatable');
  fnCallFunction(componentFieldName, functionName, param1, param2) {
    this.clientRulesService.setSharedValue(functionName, { fieldName: componentFieldName, param1, param2, time: /* @__PURE__ */ new Date() });
    if (/get/.test(functionName.slice(0, 3))) {
      const objectData = this.clientRulesService.getSharedValue(functionName.replace(/^get/, "set"));
      let objectDataReturn = [];
      if (objectData) {
        if (objectData.param1 && objectData.param2) {
          objectDataReturn.push(objectData.param1, objectData.param2);
        } else if (objectData.param1) {
          objectDataReturn = objectData.param1;
        } else {
          objectDataReturn = objectData;
        }
        return objectDataReturn;
      }
    }
  }
  // Function that would register a list of function to call in fnCallFunction
  // listOfFunctions=>['eventReloadDatatable','eventReloadTable','function1','...']
  // list of functions that will be available  in fnCallFunction to be called.
  fnRegisterFunctions(listOfFunctions) {
    for (let i4 = 0, n = listOfFunctions.length; i4 < n; i4++) {
      this.fnCreateWatchForFunctionCall(listOfFunctions[i4]);
    }
  }
  fnCreateWatchForFunctionCall(functionName) {
    console.log("--------TODO implment watch in UtilSharingService");
  }
  fnPassedDataObject(fieldName, objectName, objectDataValue) {
    this.clientRulesService.setSharedValue(objectName, { fieldName, objectDataValue, time: (/* @__PURE__ */ new Date()).getTime() });
  }
  fnGetDataObject(fieldName, objectName) {
    const objectData = this.clientRulesService.getSharedValue(objectName);
    return objectData.fieldName === fieldName ? objectData : null;
  }
}, _a25.\u0275fac = function UtilSharingService_Factory(t) {
  return new (t || _a25)(\u0275\u0275inject(ClientRulesService));
}, _a25.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a25, factory: _a25.\u0275fac, providedIn: "root" }), _a25);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UtilSharingService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: ClientRulesService }], null);
})();
var __SclHandlebarsService;
var SclHandlebarsService = (__SclHandlebarsService = class {
  constructor() {
  }
  /////////
  initHandlebars(helpers) {
    Handlebars.registerHelper("ifEquals", function(arg1, arg2, options) {
      return arg1 == arg2 ? options.fn(this) : options.inverse(this);
    });
    Handlebars.registerHelper("ifNotEquals", function(arg1, arg2, options) {
      return arg1 != arg2 ? options.fn(this) : options.inverse(this);
    });
    Handlebars.registerHelper("switch", function(value, options) {
      this.switch_value = value;
      this.switch_break = false;
      return options.fn(this);
    });
    Handlebars.registerHelper("case", function(value, options) {
      if (value == this.switch_value) {
        this.switch_break = true;
        return options.fn(this);
      }
    });
    Handlebars.registerHelper("default", function(value, options) {
      if (this.switch_break == false) {
        return value;
      }
    });
    if (typeof helpers !== "undefined" && helpers !== null) {
      for (let i = 0; i < helpers.length; i++) {
        if (typeof helpers[i].name === "string" && typeof helpers[i].function === "string") {
          let helpFunc;
          eval("helpFunc = " + helpers[i].function);
          Handlebars.registerHelper(helpers[i].name, helpFunc);
        }
      }
    }
  }
  checkRegistedHelpers(helpers42) {
    if (!helpers42) {
      return;
    }
    let isRegistered = true;
    for (let i4 = 0; i4 < helpers42.length; i4++) {
      if (typeof helpers42[i4].name === "string" && typeof helpers42[i4].function === "string") {
        if (!(helpers42[i4].name in Handlebars.helpers)) {
          isRegistered = false;
          break;
        }
      }
    }
    if (!isRegistered) {
      this.initHandlebars(helpers42);
    }
  }
  processHandlebars(handlebarsString, data, helpers42) {
    return;
  }
  processIntHandlebars(handlebarsString, data, helpers42) {
  }
  processFloatHandlebars(handlebarsString, data, helpers42) {
  }
  processBooleanHandlebars(handlebarsString, data, helpers42) {
  }
  processArrayHandlebars(handlebarsString, data, helpers42) {
  }
}, __SclHandlebarsService.\u0275fac = function SclHandlebarsService_Factory(t) {
  return new (t || __SclHandlebarsService)();
}, __SclHandlebarsService.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: __SclHandlebarsService, factory: __SclHandlebarsService.\u0275fac, providedIn: "root" }), __SclHandlebarsService);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclHandlebarsService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var compiledHandlebarsTemplates = {};
var defaultHelpers = [
  {
    name: "ifEquals",
    function: `function(arg1, arg2, options) {return (arg1 === arg2) ? options.fn(this) : options.inverse(this);}`
  },
  {
    name: "ifNotEquals",
    function: `function(arg1, arg2, options) {return (arg1 !== arg2) ? options.fn(this) : options.inverse(this);}`
  },
  {
    name: "switch",
    function: `function(value, options) {this.switch_value = value;this.switch_break = false; return options.fn(this);}`
  },
  {
    name: "case",
    function: `function(value, options) {if (value === this.switch_value) {this.switch_break = true;return options.fn(this);}}`
  },
  {
    name: "default",
    function: `function(value, options) {if (this.switch_break === false) {return value;}}`
  },
  {
    name: "dateFormat",
    function: `function(date, format, options) { return moment(date).format(format); }`
  },
  {
    name: "dateAdd",
    function: `function(date, amount, what, options) { return moment(date).add(amount, what).format(); }`
  },
  {
    name: "dateFromNow",
    function: `function(date, options) { return moment(date).fromNow(); }`
  },
  {
    name: "dateToNow",
    function: `function(date, options) { return moment(date).toNow(); }`
  },
  {
    name: "dateCalendar",
    function: `function(date, options) { return moment(date).calendar(); }`
  }
];
var sclHandlebars = /* @__PURE__ */ (() => {
  return {
    initHandlebars(helpers42) {
      for (let i4 = 0; i4 < defaultHelpers.length; i4++) {
        if (typeof defaultHelpers[i4].name === "string" && typeof defaultHelpers[i4].function === "string") {
          let defaultHelps = new Function("return " + defaultHelpers[i4].function)();
          Handlebars2.registerHelper(defaultHelpers[i4].name, defaultHelps);
        }
      }
      if (typeof helpers42 !== "undefined" && helpers42 !== null) {
        for (const helper of helpers42) {
          if (typeof helper.name === "string" && typeof helper.function === "string") {
            let helpFunc2 = helper.function;
            if (typeof helpFunc2 === "string") {
              helpFunc2 = new Function("return " + helpFunc2)();
            }
            Handlebars2.registerHelper(helper.name, helpFunc2);
          }
        }
      }
    },
    defaultHelpers() {
      return defaultHelpers;
    },
    checkRegistedHelpers(helpers42) {
      if (!helpers42) {
        return;
      }
      let isRegistered = true;
      for (let i4 = 0; i4 < helpers42.length; i4++) {
        if (typeof helpers42[i4].name === "string" && typeof helpers42[i4].function === "string") {
          if (!(helpers42[i4].name in Handlebars2.helpers)) {
            isRegistered = false;
            break;
          }
        }
      }
      if (!isRegistered) {
        sclHandlebars.initHandlebars(helpers42);
      }
    },
    // throws an error instead of returning null
    processHandlebarsV2(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      if (handlebarsString == null || typeof handlebarsString === "undefined") {
        return "";
      }
      if ((typeof handlebarsString === "string" || handlebarsString instanceof String) && handlebarsString.indexOf("{{") < 0) {
        return handlebarsString;
      }
      sclHandlebars.checkRegistedHelpers(helpers42);
      let hStr;
      if (typeof handlebarsString === "string") {
        hStr = handlebarsString;
      } else {
        hStr = JSON.stringify(handlebarsString);
      }
      if (!handlebarsContext) {
        handlebarsContext = {};
      }
      const invalidField = [
        "document",
        "doc",
        "account",
        "tpl",
        "componentDefinition",
        "results",
        "resultsCount",
        "resultsIndex",
        "result",
        "row"
      ];
      if (data) {
        if (Object(data) === data) {
          for (const f in data) {
            if (f === "queryResultDocument") {
              handlebarsContext.row = data[f];
              handlebarsContext.result = data[f];
              for (const j in data[f]) {
                if (data[f].hasOwnProperty(j)) {
                  if (invalidField.indexOf(j) > -1) {
                    console.log("Handlebars Context Error: the field " + j + " is already present in document documentId so could not be set. It's values will NOT be available to handlebars expressions. Please advise your Application Developer to not use this field name if possible");
                    continue;
                  }
                  handlebarsContext[j] = data[f][j];
                }
              }
            } else {
              if (handlebarsContext.hasOwnProperty(f)) {
                console.log("error : handlebarsString = " + handlebarsString + "\n	 data = " + JSON.stringify(data) + "\n	 handlebarsContext = " + JSON.stringify(handlebarsContext) + "\n	 helpers = " + JSON.stringify(helpers42));
                continue;
              }
              handlebarsContext[f] = data[f];
            }
          }
        } else {
          console.log("Handlebars Context Error: object " + data + " wasn't passed in and the parameters is being ignored");
        }
      }
      let result = null;
      try {
        let template;
        if (options?.handlebarsTemplateName && contextParams) {
          const templateKey = `${contextParams?.tpl?.documentId}_${contextParams?.tplItem?.name}_${options.handlebarsTemplateName}`;
          if (compiledHandlebarsTemplates[templateKey]) {
            template = compiledHandlebarsTemplates[templateKey];
          } else {
            template = Handlebars2.compile(hStr);
            compiledHandlebarsTemplates[templateKey] = template;
          }
        } else {
          template = Handlebars2.compile(hStr);
        }
        result = template(handlebarsContext);
      } catch (err) {
        err.hStr = hStr;
        throw err;
      }
      return result;
    },
    // backward compatibility purposes because it's still used in a lot of areas: returns an null object
    processHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      let result = null;
      try {
        if (contextParams) {
          if (!handlebarsContext) {
            handlebarsContext = {};
          }
          handlebarsContext.document = contextParams.doc;
          handlebarsContext.doc = contextParams.doc;
          handlebarsContext.account = contextParams.account;
          handlebarsContext.tpl = contextParams.tpl;
          handlebarsContext.tplItem = contextParams.tplItem;
        }
        result = sclHandlebars.processHandlebarsV2(handlebarsString, data, handlebarsContext, helpers42, contextParams, options);
      } catch (err) {
        console.error(err);
      }
      return result;
    },
    processIntHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      const hStr = sclHandlebars.processHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options);
      if (hStr) {
        return parseInt(hStr, 0);
      } else {
        return 0;
      }
    },
    processFloatHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      const hStr = sclHandlebars.processHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options);
      if (hStr) {
        return parseFloat(hStr);
      } else {
        return 0;
      }
    },
    processBooleanHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      return sclHandlebars.processHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) === "true";
    },
    processArrayHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options) {
      let hStr = sclHandlebars.processHandlebars(handlebarsString, data, handlebarsContext, helpers42, contextParams, options);
      if (hStr) {
        try {
          let arr = [];
          if (typeof hStr === "string" && hStr.indexOf(",") > -1) {
            if (hStr.indexOf("[") > -1) {
              hStr = hStr.replace("[", "");
            }
            if (hStr.indexOf("]") > -1) {
              hStr = hStr.replace("]", "");
            }
            const s = hStr.split(",");
            if (s?.length == 2 && (!isNaN(Number(s[0].trim())) && !isNaN(parseFloat(s[0].trim()))) && (!isNaN(Number(s[1].trim())) && !isNaN(parseFloat(s[1].trim())))) {
              arr = [parseFloat(s[0].trim()), parseFloat(s[1].trim())];
            }
          } else {
            const obj = JSON.parse(hStr);
            for (const i4 in obj) {
              if (obj.hasOwnProperty(i4)) {
                arr.push(obj[i4]);
              }
            }
          }
          return arr;
        } catch (err) {
          return null;
        }
      } else {
        return null;
      }
    }
  };
})();
var _a26;
var SclAceEditorService = (_a26 = class {
  constructor() {
  }
  /////////
  enableFullscreen(aceEditor, fieldName) {
    const aced = document.getElementById(fieldName);
    const matIcon = document.createElement("mat-icon");
    const btn = document.createElement("button");
    matIcon.className = "editor-resize-fullscreen-icon mat-icon notranslate material-icons mat-icon-no-color";
    matIcon.innerText = "fullscreen";
    matIcon.title = "Enter fullscreen";
    matIcon.id = "editorFullScreenIcon";
    btn.appendChild(matIcon);
    if (this.hasClass(aced, "fullScreen")) {
      matIcon.innerText = "fullscreen_exit";
      matIcon.title = "Exit fullscreen";
    }
    this.editorStyle(aced);
    btn.className = "gbl-fse-btn";
    btn.style.position = "absolute";
    btn.style.top = "0px";
    btn.style.right = "0px";
    btn.style.opacity = "0.3";
    btn.style.zIndex = "1";
    btn.style.cursor = "pointer";
    btn.style.color = "initial";
    btn.addEventListener("click", (function(e) {
      const scrollBar = aced.getElementsByClassName("ace_scrollbar-v")[0];
      const editorFullScreenIcon = document.getElementById("editorFullScreenIcon");
      if (this.hasClass(aced, "fullScreen")) {
        this.removeClass(aced, "fullScreen");
        editorFullScreenIcon.innerText = "fullscreen";
        editorFullScreenIcon.title = "Enter fullscreen";
        if (scrollBar) {
          scrollBar.style.display = "none";
        }
        aceEditor.setAutoScrollEditorIntoView(true);
        aceEditor.setOptions({
          maxLines: Infinity
        });
        btn.style.top = "0px";
        btn.style.right = "0px";
      } else {
        this.addClass(aced, "fullScreen");
        editorFullScreenIcon.innerText = "fullscreen_exit";
        editorFullScreenIcon.title = "Exit fullscreen";
        if (scrollBar) {
          scrollBar.style.display = null;
        }
        const lineGroup = aced.getElementsByClassName("ace_line_group")[0];
        let lineHeight;
        if (lineGroup) {
          lineHeight = lineGroup.style.height;
        }
        const editorHeight = aced.offsetHeight;
        const maxLine = isNaN(Math.ceil(editorHeight / lineHeight)) ? 0 : Math.ceil(editorHeight / lineHeight);
        aced.style.height = editorHeight + "px";
        aceEditor.setOptions({
          maxLines: 0
        });
        aceEditor.setAutoScrollEditorIntoView(false);
        btn.style.top = "1px";
        btn.style.right = "20px";
      }
      aceEditor.resize();
      aceEditor.focus();
    }).bind(this));
    aced.appendChild(btn);
  }
  editorStyle(aced) {
    const styleNode = document.createElement("style");
    styleNode.type = "text/css";
    let css = ".ace_editor.fullScreen { overflow-y:auto;height: auto!important;width: auto;border: 0;margin: 0;position: fixed !important;top: 0;bottom: 0;left: 0;right: 0;z-index: 9999;}";
    css += ".ace_editor .gbl-fse-btn:hover{ opacity: 0.9!important; }";
    css += ".fullScreen{ overflow: hidden }";
    if (!!(window.attachEvent && !window.opera)) {
    } else {
      const styleText = document.createTextNode(css);
      styleNode.appendChild(styleText);
    }
    aced.parentNode.appendChild(styleNode);
  }
  hasClass(el, clsname) {
    const classNames = el.className.split(" ");
    for (let i4 = 0; i4 < classNames.length; i4++) {
      if (clsname === classNames[i4]) {
        return true;
      }
    }
    return false;
  }
  addClass(el, clsname) {
    if (!this.hasClass(el, clsname)) {
      el.className = el.className + " " + clsname;
    }
  }
  removeClass(el, clsname) {
    const classNames = el.className.split(" ");
    const newClasses = [];
    for (let i4 = 0; i4 < classNames.length; i4++) {
      if (clsname !== classNames[i4]) {
        newClasses.push(classNames[i4]);
      }
    }
    el.className = newClasses.join(" ");
  }
}, _a26.\u0275fac = function SclAceEditorService_Factory(t) {
  return new (t || _a26)();
}, _a26.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a26, factory: _a26.\u0275fac, providedIn: "root" }), _a26);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclAceEditorService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a27;
var SclAceTextRulesInterfaceService = (_a27 = class {
  constructor() {
  }
  /////////
  syncEditBuffer(doc, fieldName, componentDefinition, _editor) {
    let content = doc[fieldName];
    if (componentDefinition.textFormat === "raw-json") {
      try {
        content = JSON.parse(_editor.value);
      } catch (e) {
      }
    } else {
      content = _editor.value;
    }
    doc[fieldName] = content;
  }
  extractValuesToDoc(doc, fieldName, componentDefinition, _editor, tempKeys) {
    let text = _editor.value;
    if (componentDefinition.textFormat === "json") {
      const editor = _editor.getEditor();
      const session = editor.session;
      const textValue = session.getValue();
      if (componentDefinition.storeToRoot) {
        if (textValue && textValue.length >= 6) {
          try {
            const json = JSON.parse(textValue);
            for (let i4 = 0; i4 < tempKeys.length; i4++) {
              if (doc[tempKeys[i4]]) {
                delete doc[tempKeys[i4]];
              }
            }
            Object.keys(json).forEach(function(k) {
              this.tempKeys.push(k);
              this.doc[k] = json[k];
            });
          } catch (err) {
          }
        }
      }
      if (textValue) {
        text = JSON.stringify(textValue, void 0, 2);
      }
    } else if (componentDefinition.textFormat === "raw-json") {
      doc[fieldName] = {};
      try {
        text = JSON.parse(text);
      } catch (err) {
      }
    }
    if (text !== "") {
      doc[fieldName] = text;
    }
  }
}, _a27.\u0275fac = function SclAceTextRulesInterfaceService_Factory(t) {
  return new (t || _a27)();
}, _a27.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a27, factory: _a27.\u0275fac, providedIn: "root" }), _a27);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclAceTextRulesInterfaceService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a28;
var SclUtilUrlService = (_a28 = class {
  constructor(formbirdInjectorService2, routerService) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.routerService = routerService;
    this.documentModalService = this.formbirdInjectorService.get("DocumentModalService");
  }
  openLink(link, mode, componentScope) {
    const openMode = mode ? mode : "currentWindow";
    switch (openMode) {
      case "currentWindow":
        this.routerService.navigateByUrl(link);
        break;
      case "newWindow":
        window.open(link, "_blank");
        break;
      case "popup":
        window.open(link, void 0, "height=300,width=600");
        break;
      case "overlay":
        const documentId = this.getDocIdFromLink(link);
        componentScope.selectedDocumentId = documentId;
        this.documentModalService.openDocumentInModal(documentId, componentScope);
        break;
      case "noDisplay":
        break;
      default:
        this.routerService.navigateByUrl(link);
        break;
    }
  }
  getDocIdFromLink(link) {
    const lstIdx = link.lastIndexOf("/");
    if (!link || lstIdx === -1) {
      return null;
    } else {
      return link.substr(lstIdx + 1, link.length);
    }
  }
}, _a28.\u0275fac = function SclUtilUrlService_Factory(t) {
  return new (t || _a28)(\u0275\u0275inject(FormbirdInjectorService), \u0275\u0275inject(RouterService));
}, _a28.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a28, factory: _a28.\u0275fac, providedIn: "root" }), _a28);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilUrlService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }, { type: RouterService }], null);
})();
var _a29;
var SclUtilFilterService = (_a29 = class {
  constructor() {
  }
  arrayFilter(obj, arg1) {
    if (obj && Array.isArray(obj) && String(arg1) !== "undefined") {
      const newArray2 = obj.map((el) => {
        return el[arg1];
      });
      return newArray2.toString();
    } else {
      if (Array.isArray(obj)) {
        return obj.toString();
      } else {
        return obj;
      }
    }
  }
}, _a29.\u0275fac = function SclUtilFilterService_Factory(t) {
  return new (t || _a29)();
}, _a29.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a29, factory: _a29.\u0275fac, providedIn: "root" }), _a29);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilFilterService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a30;
var SclDatatableResponsiveService = (_a30 = class {
  constructor() {
  }
  responsiveInit(fieldName) {
    this.checkColHidden(fieldName);
  }
  changeMediaScreen(fieldName) {
    const doc = document.getElementById(fieldName).childNodes[1];
    doc.childNodes.forEach((val, i4) => {
      if (doc.childNodes[i4].className === "child") {
        const el = doc.childNodes[i4];
        el.parentNode.removeChild(el);
      }
    });
    doc.childNodes.forEach((val, i4) => {
      if (doc.childNodes[i4].classList.contains("parent")) {
        doc.childNodes[i4].classList.remove("parent");
      }
    });
  }
  columnWidthHandler(device) {
  }
  getMaxWidth(device) {
  }
  calculateWidth(fieldName) {
    if (fieldName) {
      const componentElement = document.getElementById(fieldName);
      if (componentElement && componentElement.rows && componentElement.rows[1] && componentElement.rows[1]) {
        const ths = componentElement.rows[0].children;
        const tblWidth = window.innerWidth - 168;
        let maxWidth = 0;
        for (let i4 = 0; i4 < ths.length; i4++) {
          const th = ths[i4];
          if (this.isVisible(th)) {
            let width = 1;
            const colW = th.className.match(/colWidth-([0-9])/);
            if (colW) {
              width = colW.pop();
            }
            maxWidth += width * 1;
          }
        }
        for (let i4 = 0; i4 < ths.length; i4++) {
          const th = ths[i4];
          if (this.isVisible(th)) {
            let width = 1;
            const colW = th.className.match(/colWidth-([0-9])/);
            if (colW) {
              width = colW.pop();
            }
            const colWidth = width / maxWidth * tblWidth;
            th.style.width = colWidth + "px";
          }
        }
      }
    } else {
      console.error("fieldName is not set.");
    }
  }
  isVisible(e) {
    return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
  }
  expandHandler(fieldName) {
    if (fieldName) {
      const componentElement = document.getElementById(fieldName);
      if (componentElement) {
        const tds = componentElement.querySelectorAll(".dataTable.hasHidden tbody td:first-child .handler");
        for (let i4 = 0; i4 < tds.length; i4++) {
          const td = tds[i4];
          td.onclick = (e) => {
            e.stopPropagation();
            if (document.getElementById(fieldName).classList.contains("hasHidden")) {
              const headings = document.querySelector("#" + fieldName + " thead tr").children;
              const newElement = document.createElement("tr");
              newElement.className = "child";
              const newElementTd = document.createElement("td");
              let tr = td.parentNode.parentNode;
              let tbl = tr.parentNode;
              let tds_child = tr.children;
              let ul = document.createElement("ul");
              ul.className = "dtr-details";
              if (!tr.classList.contains("scl-dt-parent")) {
                tr.classList.add("scl-dt-parent");
                let colSize = 0;
                for (let k = 0; k < tds_child.length; k++) {
                  let td2 = tds_child[k];
                  if (window.getComputedStyle(td2, null).getPropertyValue("display") === "none") {
                    let li = document.createElement("li");
                    let spanTitle = document.createElement("span");
                    let spanData = document.createElement("span");
                    spanTitle.classList.add("dtr-title");
                    spanTitle.innerHTML = headings[k].innerHTML;
                    li.appendChild(spanTitle);
                    spanData.classList.add("dtr-data");
                    spanData.innerHTML = td2.innerHTML;
                    li.appendChild(spanData);
                    ul.appendChild(li);
                  } else {
                    colSize++;
                  }
                }
                newElementTd.colSpan = colSize;
                newElementTd.appendChild(ul);
                newElement.appendChild(newElementTd);
                tbl.insertBefore(newElement, tr.nextSibling);
              } else {
                tr.classList.remove("scl-dt-parent");
                let el = tr.nextSibling;
                el.parentNode.removeChild(el);
              }
            }
            e.preventDefault();
          };
        }
      }
    } else {
      console.log("fieldName is not set.");
    }
  }
  checkColHidden(fieldName) {
    if (fieldName) {
      const componentElement = document.getElementById(fieldName);
      if (componentElement && componentElement.rows && componentElement.rows[0] && componentElement.rows[0]) {
        let tds = componentElement.rows[0].children;
        let foundHidden = false;
        for (let i4 = 0; i4 < tds.length; i4++) {
          let td = tds[i4];
          if (window.getComputedStyle(td, null).getPropertyValue("display") === "none") {
            foundHidden = true;
            document.getElementById(fieldName).classList.add("hasHidden");
            break;
          }
        }
        if (foundHidden) {
          document.getElementById(fieldName).classList.add("hasHidden");
        } else {
          document.getElementById(fieldName).classList.remove("hasHidden");
        }
        let isLastElm = false;
        for (let i4 = tds.length - 1; i4 >= 0; i4--) {
          if (window.getComputedStyle(tds[i4], null).getPropertyValue("display") === "none") {
            tds[i4].classList.remove("last-child-th");
          } else {
            if (!isLastElm) {
              tds[i4].classList.add("last-child-th");
              isLastElm = true;
            } else {
              tds[i4].classList.remove("last-child-th");
            }
          }
        }
      }
    } else {
      console.error("fieldName is not set.");
    }
  }
}, _a30.\u0275fac = function SclDatatableResponsiveService_Factory(t) {
  return new (t || _a30)();
}, _a30.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a30, factory: _a30.\u0275fac, providedIn: "root" }), _a30);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclDatatableResponsiveService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a31;
var SclDatatableResizeService = (_a31 = class {
  constructor() {
  }
  initResize(excludeResizeCol) {
    let ths = document.querySelectorAll(".dataTable th");
    let tbl = document.querySelector(".dataTable");
    let startOffset = 0;
    let nextOffset = 0;
    let totWidth = 0;
    let currWidth = 0;
    let nextWidth = 0;
    let thElm;
    const padding = 56;
    let mDown = 0;
    let mDrag = 0;
    let minWidth = 20;
    for (let i4 = 0; i4 < ths.length; i4++) {
      let th = ths[i4];
      let tempSpan = document.createElement("span");
      tempSpan.style.height = "100%";
      tempSpan.style.width = "9px";
      tempSpan.style.padding = "22px 0";
      tempSpan.style.position = "absolute";
      tempSpan.style.right = "-5px";
      tempSpan.style.top = "-6px";
      tempSpan.style.zIndex = "9999";
      th.appendChild(tempSpan);
      if (excludeResizeCol.indexOf(i4) === -1) {
        tempSpan.style.cursor = "col-resize";
        tempSpan.addEventListener("mousedown", (e) => {
          tbl.addClass("sc-dt-mousedown");
          thElm = th;
          const thElmNexSibling = this.nextDisplaySibling(thElm);
          totWidth = parseFloat(thElm.style.width) + parseFloat(thElmNexSibling.style.width);
          th.classList.add("disable");
          startOffset = Number(window.getComputedStyle(th, null).getPropertyValue("width")) - e.pageX;
          const nextSiblingTh = this.nextDisplaySibling(th);
          nextOffset = Number(window.getComputedStyle(nextSiblingTh, null).getPropertyValue("width")) + e.pageX;
          mDown = e.pageX;
          pauseEvent(e);
        });
      } else {
        tempSpan.style.cursor = "pointer";
      }
    }
    document.addEventListener("mousemove", (e) => {
      if (thElm) {
        pauseEvent(e);
        const thElmNexSibling = this.nextDisplaySibling(thElm);
        if (nextOffset - e.pageX > 0 && startOffset + e.pageX > 0 && Math.abs(mDown - e.pageX) >= 1) {
          currWidth = startOffset + e.pageX;
          nextWidth = totWidth - currWidth;
          if (currWidth < minWidth) {
            currWidth = minWidth;
            nextWidth = totWidth - minWidth;
          } else if (nextWidth < minWidth) {
            currWidth = totWidth - minWidth;
            nextWidth = minWidth;
          }
          thElm.style.width = currWidth + "px";
          thElmNexSibling.style.width = nextWidth + "px";
        }
      }
    });
    const pauseEvent = (e) => {
      if (e.stopPropagation) {
        e.stopPropagation();
      }
      if (e.preventDefault) {
        e.preventDefault();
      }
      e.cancelBubble = true;
      e.returnValue = false;
      return false;
    };
    document.addEventListener("mouseup", (e) => {
      if (thElm) {
        thElm.classList.remove("disable");
      }
      if (currWidth < minWidth) {
        currWidth = minWidth;
        nextWidth = totWidth - minWidth;
      } else if (nextWidth < minWidth) {
        currWidth = totWidth - minWidth;
        nextWidth = minWidth;
      }
      if (thElm) {
        thElm.style.width = currWidth + "px";
        thElm.nextSibling.style.width = nextWidth + "px";
      }
      thElm = void 0;
      mDown = 0;
      tbl.classList.remove("sc-dt-mousedown");
    });
  }
  nextDisplaySibling(elem) {
    let ns = elem.nextSibling;
    while (ns) {
      if (window.getComputedStyle(ns, null).getPropertyValue("display") !== "none") {
        break;
      }
      ns = ns.nextSibling;
    }
    return ns;
  }
  calculateWidth(fieldName) {
    const componentElement = document.getElementById(fieldName);
    if (componentElement && componentElement.rows && componentElement.rows[1] && componentElement.rows[1]) {
      const ths = document.getElementById(fieldName).rows[0].children;
      for (let i4 = 0; i4 < ths.length; i4++) {
        const th = ths[i4];
        th.style.width = Number(window.getComputedStyle(th, null).getPropertyValue("width")) + 1 + "px";
      }
    }
  }
}, _a31.\u0275fac = function SclDatatableResizeService_Factory(t) {
  return new (t || _a31)();
}, _a31.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a31, factory: _a31.\u0275fac, providedIn: "root" }), _a31);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclDatatableResizeService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a32;
var UtilDocumentIdService = (_a32 = class {
  constructor() {
    this.uuidLength = 36;
  }
  generateId() {
    return uuid.v1();
  }
  isValid(id2) {
    return id2 && id2.length === this.uuidLength;
  }
}, _a32.\u0275fac = function UtilDocumentIdService_Factory(t) {
  return new (t || _a32)();
}, _a32.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a32, factory: _a32.\u0275fac, providedIn: "root" }), _a32);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UtilDocumentIdService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a33;
var SclUtilDocumentService = (_a33 = class {
  constructor(utilDocumentIdService) {
    this.utilDocumentIdService = utilDocumentIdService;
  }
  isNew(doc) {
    return !doc.systemHeader || !doc.systemHeader.createdDate;
  }
  getValidId(value) {
    let validValue;
    if (!value) {
      validValue = this.utilDocumentIdService.generateId();
    } else {
      validValue = value;
    }
    return validValue;
  }
}, _a33.\u0275fac = function SclUtilDocumentService_Factory(t) {
  return new (t || _a33)(\u0275\u0275inject(UtilDocumentIdService));
}, _a33.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a33, factory: _a33.\u0275fac, providedIn: "root" }), _a33);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilDocumentService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: UtilDocumentIdService }], null);
})();
var _a34;
var SclExportService = (_a34 = class {
  constructor(httpClient) {
    this.httpClient = httpClient;
    this.format = "csv";
    this.headers = [];
  }
  export(qry, filename, settings, handlebarsHelpers, contextParamsDocument) {
    const type = this.format;
    filename = filename + "." + type;
    if (!this.headers) {
      this.headers = [{ title: "ID", field: "documentId" }, { title: "name", field: "systemHeader.summaryName" }];
    }
    const body = {
      headers: this.headers,
      query: qry,
      fileName: filename,
      type,
      size: settings?.size || "A4",
      layout: settings?.layout || "landscape",
      fontSize: settings?.fontSize || 10,
      margin: settings?.margin || 25,
      headerFontSize: settings?.headerFontSize || 8,
      columnSpacing: settings?.columnSpacing || 5,
      urlExportMode: settings?.urlExportMode || "linkObject",
      handlebarsHelpers: handlebarsHelpers || [],
      stripHTML: settings?.stripHTML ?? true,
      document: contextParamsDocument
    };
    const options = {
      headers: new HttpHeaders({ "Content-Type": "application/json" }),
      responseType: "blob"
    };
    return this.httpClient.post("/api/searchExport", body, options);
  }
}, _a34.\u0275fac = function SclExportService_Factory(t) {
  return new (t || _a34)(\u0275\u0275inject(HttpClient));
}, _a34.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a34, factory: _a34.\u0275fac, providedIn: "root" }), _a34);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclExportService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: HttpClient }], null);
})();
var _a35;
var SclUtilDateService = (_a35 = class {
  constructor() {
  }
  getLocalFromUTCString(UTCTime) {
    return new Date(UTCTime);
  }
  // LocalTime must be formatted at ISOString i.e 2015-04-08T12:12:12.000Z
  getUTCFromLocalString(localTime) {
    let dateTime = localTime.replace("T", " ").replace("Z", "");
    dateTime = new Date(dateTime);
    return dateTime.toISOString();
  }
  parseDate(date, format) {
    return moment(date).format(format);
  }
  isDate(dateObject) {
    if (Object.prototype.toString.call(dateObject) === "[object Date]") {
      if (isNaN(dateObject.getTime()) === false) {
        return true;
      }
    }
    return false;
  }
  isValidDate(date) {
    return date.getTime() === date.getTime();
  }
  formatDate(time) {
    return moment(time).fromNow();
  }
  getValidDate(value) {
    let validValue;
    if (!value) {
      validValue = /* @__PURE__ */ new Date();
    } else {
      if (this.isValidDate(value)) {
        validValue = value;
      } else {
        const date = moment(value, ["DD/MM/YYYY hh:mm a", "DD/MM/YYYY", "hh:mm a", moment.ISO_8601], true);
        if (date.isValid()) {
          validValue = date.toDate();
        } else {
          validValue = /* @__PURE__ */ new Date();
        }
      }
    }
    return validValue;
  }
  getFormattedDate(dateValue) {
    if (!dateValue) {
      return dateValue;
    }
    let formattedDate;
    let d;
    d = new Date(dateValue);
    const defaultYear = /* @__PURE__ */ new Date();
    if (d.getFullYear() < 1) {
      d.setYear(defaultYear.getFullYear());
      formattedDate = d;
    } else {
      formattedDate = d;
    }
    return formattedDate;
  }
}, _a35.\u0275fac = function SclUtilDateService_Factory(t) {
  return new (t || _a35)();
}, _a35.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a35, factory: _a35.\u0275fac, providedIn: "root" }), _a35);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilDateService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a36;
var DeviceDetectService = (_a36 = class {
  constructor() {
  }
  detectBrowser() {
    const ua2 = window.navigator.userAgent;
    let device;
    let browser;
    let data = {};
    if (ua2.match(/(iPhone)/)) {
      device = "iPhone";
    } else if (ua2.match(/(iPad)/)) {
      device = "iPad";
    } else if (ua2.match(/(iPod)/)) {
      device = "iPod";
    } else if (ua2.match(/(BlackBerry|BB10)/)) {
      device = "BlackBerry";
    } else if (ua2.match(/(IEMobile)/)) {
      device = "WindowsMobile";
    } else if (ua2.match(/(Android)/)) {
      device = "Android";
    } else if (ua2.match(/(Macintosh)/)) {
      device = "Macintosh";
    } else if (ua2.match(/(Windows)/)) {
      device = "Windows";
    } else if (ua2.match(/(Linux)/)) {
      device = "Linux";
    } else if (ua2.match(/(Opera Mini)/)) {
      device = "OperaMini";
    } else if (ua2.match(/(Mobi)/)) {
      device = "Mobi";
    } else if (ua2.match(/(IEMobi)/)) {
      device = "Mobi";
    }
    if (ua2.indexOf("OPR") > 0 || ua2.indexOf("Opera") > 0) {
      browser = "Opera";
    } else if (ua2.indexOf("Chrome") > 0 && ua2.indexOf("Edge") === -1) {
      browser = "Chrome";
    } else if (ua2.indexOf("Firefox") > 0) {
      browser = "Firefox";
    } else if (ua2.indexOf("Safari") > 0 && ua2.indexOf("Edge") === -1) {
      browser = "Safari";
    } else if (ua2.indexOf("MSIE") > 0) {
      browser = "IE";
    } else if (ua2.indexOf("Edge") > 0) {
      browser = "Edge";
    }
    data = {
      device,
      browser
    };
    return data;
  }
  detectMobile() {
    const toMatch = [
      /Android/i,
      /webOS/i,
      /iPhone/i,
      /iPad/i,
      /iPod/i,
      /BlackBerry/i,
      /Windows Phone/i
    ];
    return toMatch.some((toMatchItem) => {
      return window.navigator.userAgent.match(toMatchItem);
    });
  }
}, _a36.\u0275fac = function DeviceDetectService_Factory(t) {
  return new (t || _a36)();
}, _a36.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a36, factory: _a36.\u0275fac, providedIn: "root" }), _a36);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DeviceDetectService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a37;
var SclCsvParserService = (_a37 = class {
  constructor() {
  }
  getBaby() {
    const Baby = {
      BAD_DELIMITERS: void 0,
      BYTE_ORDER_MARK: void 0,
      DefaultDelimiter: void 0,
      RECORD_SEP: void 0,
      UNIT_SEP: void 0
    };
    Baby.BAD_DELIMITERS = ["\r", "\n", '"', Baby.BYTE_ORDER_MARK];
    return Baby;
  }
  Parser(config2) {
    const Baby = this.getBaby();
    config2 = config2 || {};
    let delim = config2.delimiter;
    let newline = config2.newline;
    let comments = config2.comments;
    const step = config2.step;
    const preview = config2.preview;
    const fastMode = config2.fastMode;
    if (typeof delim !== "string" || delim.length !== 1 || Baby.BAD_DELIMITERS.indexOf(delim) > -1) {
      delim = ",";
    }
    if (comments === delim) {
      throw new Error("Comment character same as delimiter");
    } else if (comments === true) {
      comments = "#";
    } else if (typeof comments !== "string" || Baby.BAD_DELIMITERS.indexOf(comments) > -1) {
      comments = false;
    }
    if (newline !== "\n" && newline !== "\r" && newline !== "\r\n") {
      newline = "\n";
    }
    let cursor = 0;
    let aborted = false;
    function parse25(input2) {
      if (typeof input2 !== "string") {
        throw new Error("Input must be a string");
      }
      const inputLen = input2.length;
      const delimLen = delim.length;
      const newlineLen = newline.length;
      const commentsLen = comments.length;
      const stepIsFunction = typeof step === "function";
      cursor = 0;
      let data = [];
      let errors = [];
      let row = [];
      if (!input2) {
        return returnable();
      }
      if (fastMode) {
        const rows = input2.split(newline);
        for (let i4 = 0; i4 < rows.length; i4++) {
          if (comments && rows[i4].substr(0, commentsLen) === comments) {
            continue;
          }
          if (stepIsFunction) {
            data = [rows[i4].split(delim)];
            doStep();
            if (aborted) {
              return returnable();
            }
          } else {
            data.push(rows[i4].split(delim));
          }
          if (preview && i4 >= preview) {
            data = data.slice(0, preview);
            return returnable(true);
          }
        }
        return this.returnable();
      }
      let nextDelim = input2.indexOf(delim, cursor);
      let nextNewline = input2.indexOf(newline, cursor);
      for (; ; ) {
        if (input2[cursor] === '"') {
          let quoteSearch = cursor;
          cursor++;
          for (; ; ) {
            quoteSearch = input2.indexOf('"', quoteSearch + 1);
            if (quoteSearch === -1) {
              errors.push({
                type: "Quotes",
                code: "MissingQuotes",
                message: "Quoted field unterminated",
                row: data.length,
                // row has yet to be inserted
                index: cursor
              });
              return finish();
            }
            if (quoteSearch === inputLen - 1) {
              row.push(input2.substring(cursor, quoteSearch).replace(/""/g, '"'));
              data.push(row);
              if (stepIsFunction) {
                doStep();
              }
              return this.returnable();
            }
            if (input2[quoteSearch + 1] == '"') {
              quoteSearch++;
              continue;
            }
            if (input2[quoteSearch + 1] === delim) {
              row.push(input2.substring(cursor, quoteSearch).replace(/""/g, '"'));
              cursor = quoteSearch + 1 + delimLen;
              nextDelim = input2.indexOf(delim, cursor);
              nextNewline = input2.indexOf(newline, cursor);
              break;
            }
            if (input2.substr(quoteSearch + 1, newlineLen) === newline) {
              row.push(input2.substring(cursor, quoteSearch).replace(/""/g, '"'));
              saveRow(quoteSearch + 1 + newlineLen);
              nextDelim = input2.indexOf(delim, cursor);
              if (stepIsFunction) {
                doStep();
                if (aborted) {
                  return this.returnable();
                }
              }
              if (preview && data.length >= preview) {
                return returnable(true);
              }
              break;
            }
          }
          continue;
        }
        if (comments && row.length === 0 && input2.substr(cursor, commentsLen) === comments) {
          if (nextNewline === -1) {
            return this.returnable();
          }
          cursor = nextNewline + newlineLen;
          nextNewline = input2.indexOf(newline, cursor);
          nextDelim = input2.indexOf(delim, cursor);
          continue;
        }
        if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1)) {
          row.push(input2.substring(cursor, nextDelim));
          cursor = nextDelim + delimLen;
          nextDelim = input2.indexOf(delim, cursor);
          continue;
        }
        if (nextNewline !== -1) {
          row.push(input2.substring(cursor, nextNewline));
          saveRow(nextNewline + newlineLen);
          if (stepIsFunction) {
            doStep();
            if (aborted) {
              return this.returnable();
            }
          }
          if (preview && data.length >= preview) {
            return returnable(true);
          }
          continue;
        }
        break;
      }
      return finish();
      function finish() {
        row.push(input2.substr(cursor));
        data.push(row);
        cursor = inputLen;
        if (stepIsFunction) {
          doStep();
        }
        return returnable();
      }
      function saveRow(newCursor) {
        data.push(row);
        row = [];
        cursor = newCursor;
        nextNewline = input2.indexOf(newline, cursor);
      }
      function returnable(stopped) {
        return {
          data,
          errors,
          meta: {
            delimiter: delim,
            linebreak: newline,
            aborted,
            truncated: !!stopped
          }
        };
      }
      function doStep() {
        step(returnable());
        data = [], errors = [];
      }
    }
    function abort() {
      aborted = true;
    }
    function getCharIndex() {
      return cursor;
    }
  }
}, _a37.\u0275fac = function SclCsvParserService_Factory(t) {
  return new (t || _a37)();
}, _a37.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a37, factory: _a37.\u0275fac, providedIn: "root" }), _a37);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclCsvParserService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var sclCsvParser = new SclCsvParserService();
var _a38;
var SclCsvParserHandlerService = (_a38 = class {
  constructor() {
  }
  ParserHandle(_CONFIG) {
    const Baby = sclCsvParser.getBaby();
    const FLOAT2 = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
    const self2 = this;
    let stepCounter = 0;
    let _INPUT = null;
    let parser = null;
    let paused = false;
    let delimiterError = false;
    const fields = [];
    let _RESULTS = {
      data: [],
      errors: [],
      meta: {
        fields: void 0,
        delimiter: void 0
      }
    };
    const isFunction5 = (func) => {
      return typeof func === "function";
    };
    const copy = (obj) => {
      if (typeof obj !== "object") {
        return obj;
      }
      const cpy = obj instanceof Array ? [] : {};
      for (const key in obj) {
        if (obj[key]) {
          cpy[key] = copy(obj[key]);
        }
      }
      return cpy;
    };
    if (isFunction5(_CONFIG.step)) {
      const userStep = _CONFIG.step;
      _CONFIG.step = (results) => {
        _RESULTS = results;
        if (needsHeaderRow()) {
          processResults();
        } else {
          processResults();
          if (_RESULTS.data.length === 0) {
            return;
          }
          stepCounter += results.data.length;
          if (_CONFIG.preview && stepCounter > _CONFIG.preview) {
            parser.abort();
          } else {
            userStep(_RESULTS, self2);
          }
        }
      };
    }
    function parse25(input2) {
      if (!_CONFIG.newline) {
        _CONFIG.newline = guessLineEndings(input2);
      }
      delimiterError = false;
      if (!_CONFIG.delimiter) {
        const delimGuess = guessDelimiter(input2);
        if (delimGuess.successful) {
          _CONFIG.delimiter = delimGuess.bestDelimiter;
        } else {
          delimiterError = true;
          _CONFIG.delimiter = Baby.DefaultDelimiter;
        }
        _RESULTS.meta.delimiter = _CONFIG.delimiter;
      }
      const parserConfig = copy(_CONFIG);
      if (_CONFIG.preview && _CONFIG.header) {
        parserConfig.preview++;
      }
      _INPUT = input2;
      parser = new sclCsvParser.Parser(parserConfig);
      _RESULTS = parser.parse(_INPUT);
      processResults();
      if (isFunction5(_CONFIG.complete) && !paused && (!self2.streamer || self2.streamer.finished())) {
        _CONFIG.complete(_RESULTS);
      }
      return paused ? { meta: { paused: true } } : _RESULTS || { meta: { paused: false } };
    }
    function pause() {
      paused = true;
      parser.abort();
      _INPUT = _INPUT.substr(parser.getCharIndex());
    }
    function resume() {
      paused = false;
      parser = new sclCsvParser.Parser(_CONFIG);
      parser.parse(_INPUT);
      if (!paused) {
        if (self2.streamer && !self2.streamer.finished()) {
          self2.streamer.resume();
        } else if (isFunction5(_CONFIG.complete)) {
          _CONFIG.complete(_RESULTS);
        }
      }
    }
    function abort() {
      parser.abort();
      if (isFunction5(_CONFIG.complete)) {
        _CONFIG.complete(_RESULTS);
      }
      _INPUT = "";
    }
    function processResults() {
      if (_RESULTS && delimiterError) {
        addError("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + Baby.DefaultDelimiter + "'");
        delimiterError = false;
      }
      if (_CONFIG.skipEmptyLines) {
        for (let i4 = 0; i4 < _RESULTS.data.length; i4++) {
          if (_RESULTS.data[i4].length === 1 && _RESULTS.data[i4][0] === "") {
            _RESULTS.data.splice(i4--, 1);
          }
        }
      }
      if (needsHeaderRow()) {
        fillHeaderFields();
      }
      return applyHeaderAndDynamicTyping();
    }
    function needsHeaderRow() {
      return _CONFIG.header && fields.length === 0;
    }
    function fillHeaderFields() {
      if (!_RESULTS) {
        return;
      }
      for (let i4 = 0; needsHeaderRow() && i4 < _RESULTS.data.length; i4++) {
        for (let j = 0; j < _RESULTS.data[i4].length; j++) {
          fields.push(_RESULTS.data[i4][j]);
        }
      }
      _RESULTS.data.splice(0, 1);
    }
    function applyHeaderAndDynamicTyping() {
      if (!_RESULTS || !_CONFIG.header && !_CONFIG.dynamicTyping) {
        return _RESULTS;
      }
      for (let i4 = 0; i4 < _RESULTS.data.length; i4++) {
        const row = {};
        for (let j = 0; j < _RESULTS.data[i4].length; j++) {
          if (_CONFIG.dynamicTyping) {
            const value = _RESULTS.data[i4][j];
            if (value === "true" || value === "TRUE") {
              _RESULTS.data[i4][j] = true;
            } else if (value === "false" || value === "FALSE") {
              _RESULTS.data[i4][j] = false;
            } else {
              _RESULTS.data[i4][j] = tryParseFloat(value);
            }
          }
          if (_CONFIG.header) {
            if (j >= fields.length) {
              if (!row.__parsed_extra) {
                row.__parsed_extra = [];
              }
              row.__parsed_extra.push(_RESULTS.data[i4][j]);
            } else {
              row[fields[j]] = _RESULTS.data[i4][j];
            }
          }
          if (_CONFIG.header) {
            _RESULTS.data[i4] = row;
            if (j > fields.length) {
              addError("FieldMismatch", "TooManyFields", "Too many fields: expected " + fields.length + " fields but parsed " + j, i4);
            } else if (j < fields.length) {
              addError("FieldMismatch", "TooFewFields", "Too few fields: expected " + fields.length + " fields but parsed " + j, i4);
            }
          }
        }
      }
      if (_CONFIG.header && _RESULTS.meta) {
        _RESULTS.meta.fields = fields;
      }
      return _RESULTS;
    }
    function guessDelimiter(input2) {
      const delimChoices = [",", "	", "|", ";", Baby.RECORD_SEP, Baby.UNIT_SEP];
      let bestDelim;
      let bestDelta;
      let fieldCountPrevRow;
      for (let i4 = 0; i4 < delimChoices.length; i4++) {
        const delim = delimChoices[i4];
        let delta = 0;
        let avgFieldCount = 0;
        fieldCountPrevRow = void 0;
        const preview = new sclCsvParser.Parser({
          delimiter: delim,
          preview: 10
        }).parse(input2);
        for (let j = 0; j < preview.data.length; j++) {
          const fieldCount = preview.data[j].length;
          avgFieldCount += fieldCount;
          if (typeof fieldCountPrevRow === "undefined") {
            fieldCountPrevRow = fieldCount;
            continue;
          } else if (fieldCount > 1) {
            delta += Math.abs(fieldCount - fieldCountPrevRow);
            fieldCountPrevRow = fieldCount;
          }
        }
        avgFieldCount /= preview.data.length;
        if ((typeof bestDelta === "undefined" || delta < bestDelta) && avgFieldCount > 1.99) {
          bestDelta = delta;
          bestDelim = delim;
        }
      }
      _CONFIG.delimiter = bestDelim;
      return {
        successful: !!bestDelim,
        bestDelimiter: bestDelim
      };
    }
    function guessLineEndings(input2) {
      input2 = input2.substr(0, 1024 * 1024);
      const r = input2.split("\r");
      if (r.length === 1) {
        return "\n";
      }
      let numWithN = 0;
      for (let i4 = 0; i4 < r.length; i4++) {
        if (r[i4][0] === "\n") {
          numWithN++;
        }
      }
      return numWithN >= r.length / 2 ? "\r\n" : "\r";
    }
    function tryParseFloat(val) {
      const isNumber6 = FLOAT2.test(val);
      return isNumber6 ? parseFloat(val) : val;
    }
    function addError(type, code, msg, row) {
      _RESULTS.errors.push({
        type,
        code,
        message: msg,
        row
      });
    }
  }
}, _a38.\u0275fac = function SclCsvParserHandlerService_Factory(t) {
  return new (t || _a38)();
}, _a38.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a38, factory: _a38.\u0275fac, providedIn: "root" }), _a38);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclCsvParserHandlerService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var sclCsvParserHandler = new SclCsvParserHandlerService();
var sclCsvParser2 = new SclCsvParserService();
var _a39;
var SclUtilImporterService = (_a39 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.DEFAULTS = {
      delimiter: "",
      // empty: auto-detect
      newline: "",
      // empty: auto-detect
      header: false,
      dynamicTyping: false,
      preview: 0,
      step: void 0,
      comments: false,
      complete: void 0,
      skipEmptyLines: false,
      fastMode: false
    };
    this.reIsHostCtor = /^\[object .+?Constructor\]$/;
    this.reIsUint = /^\d+$/;
    this.MAX_SAFE_INTEGER = 9007199254740991;
    this.reIsNative = RegExp("^" + Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/Object.prototype.hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
    this.arrayTag = "[object Array]";
    this.rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
    this.reEscapeChar = /\\(\\)?/g;
    this.reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/;
    this.reIsPlainProp = /^\w*$/;
    this.docIdMatch = "";
    this.docIdNoMatch = "";
    this.notificationService = this.formbirdInjectorService.get("NotificationService");
    this.dataService = this.formbirdInjectorService.get("DataService");
  }
  isObjectLike(value) {
    return !!value && typeof value === "object";
  }
  isLength(value) {
    return typeof value === "number" && value > -1 && value % 1 === 0 && value <= this.MAX_SAFE_INTEGER;
  }
  isFunction(func) {
    return typeof func === "function";
  }
  isNative(value) {
    const fnToString = Function.prototype.toString;
    if (value == null) {
      return false;
    }
    if (this.isFunction(value)) {
      return this.reIsNative.test(fnToString.call(value));
    }
    return this.isObjectLike(value) && this.reIsHostCtor.test(value);
  }
  getNative(object, key) {
    const value = object == null ? void 0 : object[key];
    return this.isNative(value) ? value : void 0;
  }
  isArray(value) {
    const nativeIsArray = this.getNative(Array, "isArray");
    const objToString = Object.prototype.toString;
    if (!value) {
      return nativeIsArray;
    }
    return this.isObjectLike(value) && this.isLength(value.length) && objToString.call(value) === this.arrayTag;
  }
  isObject(value) {
    const type = typeof value;
    return !!value && (type === "object" || type === "function");
  }
  isIndex(value, length) {
    value = typeof value === "number" || this.reIsUint.test(value) ? +value : -1;
    length = length == null ? this.MAX_SAFE_INTEGER : length;
    return value > -1 && value % 1 === 0 && value < length;
  }
  baseToString(value) {
    return value == null ? "" : value + "";
  }
  toPath(value) {
    if (this.isArray(value)) {
      return value;
    }
    const result = [];
    this.baseToString(value).replace(this.rePropName, function(match2, number2, quote, string) {
      result.push(quote ? string.replace(this.reEscapeChar, "$1") : number2 || match2);
    });
    return result;
  }
  toObject(value) {
    return this.isObject(value) ? value : Object(value);
  }
  isKey(value, object) {
    const type = typeof value;
    if (type === "string" && this.reIsPlainProp.test(value) || type === "number") {
      return true;
    }
    if (this.isArray(value)) {
      return false;
    }
    const result = !this.reIsDeepProp.test(value);
    return result || object != null && value in this.toObject(object);
  }
  set(object, path, value) {
    if (object == null) {
      return object;
    }
    if (path === "date" && value === "") {
    }
    const pathKey = path + "";
    path = object[pathKey] != null || this.isKey(path, object) ? [pathKey] : this.toPath(path);
    let index = -1;
    const length = path.length;
    const lastIndex = length - 1;
    let nested = object;
    while (nested != null && ++index < length) {
      const key = path[index];
      if (this.isObject(nested)) {
        if (index === lastIndex) {
          nested[key] = value;
        } else if (nested[key] == null) {
          nested[key] = this.isIndex(path[index + 1]) ? [] : {};
        }
      }
      nested = nested[key];
    }
    return object;
  }
  validateColumnHeader(dataObject, columnsLabels) {
    let isHeader = true;
    if (dataObject.length > 0 && columnsLabels && dataObject[0].length === columnsLabels.length) {
      for (let i4 = 0; i4 < dataObject[0].length; i4++) {
        if (dataObject[0][i4] !== columnsLabels[i4]) {
          isHeader = false;
          break;
        }
      }
    } else {
      isHeader = false;
    }
    return isHeader;
  }
  processDocumentIdMatch(newDoc, oldDoc, docIdMatch) {
    if (docIdMatch === "merge") {
      for (const key in newDoc) {
        if (key !== "documentId" && key !== "systemHeader" && newDoc.hasOwnProperty(key)) {
          if (oldDoc[key] instanceof Array && newDoc[key] instanceof Array) {
            let dataObj = [];
            dataObj = dataObj.concat(oldDoc[key]);
            dataObj = dataObj.concat(newDoc[key]);
            oldDoc[key] = dataObj;
          } else if (oldDoc[key] instanceof Object && newDoc[key] instanceof Object) {
            const dataObj = {};
            for (const attr in oldDoc[key]) {
              if (oldDoc[key][attr]) {
                dataObj[attr] = oldDoc[key][attr];
              }
            }
            for (const attr in newDoc[key]) {
              if (newDoc[key][attr]) {
                dataObj[attr] = newDoc[key][attr];
              }
            }
            oldDoc[key] = dataObj;
          } else {
            oldDoc[key] = newDoc[key];
          }
        }
      }
      return oldDoc;
    } else if (docIdMatch === "replace") {
      newDoc.systemHeader = oldDoc.systemHeader;
      return __spreadValues(__spreadValues({}, oldDoc), newDoc);
    } else {
      return newDoc;
    }
  }
  processDocumentIdNoMatch(newDoc, docIdNoMatch) {
    if (docIdNoMatch === "add") {
      return newDoc;
    } else if (this.docIdNoMatch === "error") {
      newDoc.errMsg = "documentId '" + newDoc.documentId + "' is not in database and adding is not enabled";
      return newDoc;
    }
  }
  setComponentScopeData(compScope) {
    this.componentScope = compScope;
  }
  getComponentScope() {
    return this.componentScope;
  }
  processInsertDocIdNoMatch(document2, csvIndex, docIdNoMatch) {
    const self2 = this;
    if (docIdNoMatch === "add") {
      this.dataService.insert(document2).then(function successFunc(data) {
        console.log(data, "return");
        self2.insertSuccess(data, csvIndex);
      }, function errorFunc(err) {
        self2.insertFail(err, csvIndex);
      });
    } else if (docIdNoMatch === "error") {
      const dataItemsMatTableData = this.componentScope.cloneDeepFunction(this.componentScope.itemsMatTableData);
      dataItemsMatTableData.map((element, index) => {
        if (csvIndex === index) {
          document2.documentId = element["colData" + (this.componentScope.getIndexOfDocumentIdInColumnLabels() + 1)];
        }
      });
      document2.errMsg = "documentId '" + document2.documentId + "' is not in database and adding is not enabled";
      this.insertFail(document2.errMsg, csvIndex);
    }
  }
  insertSuccess(data, csvIdx, actionName) {
    actionName = actionName ? actionName : "Imported";
    this.notificationService.success(data.documentId + " " + actionName + "!");
    const dataItems = this.componentScope.cloneDeepFunction(this.componentScope.items);
    const dataItemsMatTableData = this.componentScope.cloneDeepFunction(this.componentScope.itemsMatTableData);
    const csvPrefix = this.componentScope.csvFieldNamePrefix ? this.componentScope.csvFieldNamePrefix : "";
    dataItems.map((element, index) => {
      if (csvIdx === index) {
        element[csvPrefix + "0"] = actionName + " - " + data.documentId;
        element.documentId = data.documentId;
        element[csvPrefix + (this.componentScope.getIndexOfDocumentIdInColumnLabels() + 1)] = data.documentId;
      }
    });
    dataItemsMatTableData.map((element, index) => {
      if (csvIdx === index) {
        element.colData0 = actionName + " - " + data.documentId;
        element.documentId = data.documentId;
        element["colData" + (this.componentScope.getIndexOfDocumentIdInColumnLabels() + 1)] = data.documentId;
      }
    });
    this.componentScope.tempDocId = data.documentId;
    this.componentScope.documentCreated++;
    this.componentScope.items = dataItems;
    this.componentScope.itemsMatTableData = dataItemsMatTableData;
    this.componentScope.loadItemsToDataTable(this.componentScope.itemsMatTableData);
    this.componentScope.valueChanged(this.componentScope.items);
    this.componentScope.document[this.componentScope.fieldName] = this.componentScope.items;
    this.componentScope.detectChanges();
  }
  insertFail(err, csvIdx, actionName) {
    let errMsg = "";
    if (actionName) {
      actionName = actionName === "Updated" ? "updating" : "replacing";
      errMsg = "Failed - " + err.message.replace("updating", actionName);
    } else {
      errMsg = "Failed - " + err.message;
    }
    if (!err.message) {
      errMsg = "Failed - " + err;
    }
    this.notificationService.error(errMsg);
    const dataItems = this.componentScope.cloneDeepFunction(this.componentScope.items);
    const dataItemsMatTableData = this.componentScope.cloneDeepFunction(this.componentScope.itemsMatTableData);
    const csvPrefix = this.componentScope.csvFieldNamePrefix ? this.componentScope.csvFieldNamePrefix : "";
    dataItems.map((element, index) => {
      if (csvIdx === index) {
        element[csvPrefix + "0"] = errMsg;
      }
    });
    dataItemsMatTableData.map((element, index) => {
      if (csvIdx === index) {
        element.colData0 = errMsg;
      }
    });
    this.componentScope.errors++;
    this.componentScope.items = dataItems;
    this.componentScope.itemsMatTableData = dataItemsMatTableData;
    this.componentScope.loadItemsToDataTable(this.componentScope.itemsMatTableData);
    this.componentScope.valueChanged(this.componentScope.items);
    this.componentScope.document[this.componentScope.fieldName] = this.componentScope.items;
    this.componentScope.detectChanges();
  }
  isRowData(rowData) {
    let hasData = false;
    for (let i4 = 0; i4 < rowData.length; i4++) {
      if (rowData[i4] !== "") {
        hasData = true;
        break;
      }
    }
    return hasData;
  }
  isRowDataObj(rowData) {
    let hasData = false;
    for (const key in rowData) {
      if (rowData[key] !== "") {
        hasData = true;
        break;
      }
    }
    return hasData;
  }
  copy(obj) {
    if (typeof obj !== "object") {
      return obj;
    }
    const cpy = obj instanceof Array ? [] : {};
    for (const key in obj) {
      if (obj[key]) {
        cpy[key] = this.copy(obj[key]);
      }
    }
    return cpy;
  }
  copyAndValidateConfig(origConfig) {
    const Baby = sclCsvParser2.getBaby();
    if (typeof origConfig !== "object") {
      origConfig = {};
    }
    const config2 = this.copy(origConfig);
    if (typeof config2.delimiter !== "string" || config2.delimiter.length !== 1 || Baby.BAD_DELIMITERS.indexOf(config2.delimiter) > -1) {
      config2.delimiter = this.DEFAULTS.delimiter;
    }
    if (config2.newline !== "\n" && config2.newline !== "\r" && config2.newline !== "\r\n") {
      config2.newline = this.DEFAULTS.newline;
    }
    if (typeof config2.header !== "boolean") {
      config2.header = this.DEFAULTS.header;
    }
    if (typeof config2.dynamicTyping !== "boolean") {
      config2.dynamicTyping = this.DEFAULTS.dynamicTyping;
    }
    if (typeof config2.preview !== "number") {
      config2.preview = this.DEFAULTS.preview;
    }
    if (typeof config2.step !== "function") {
      config2.step = this.DEFAULTS.step;
    }
    if (typeof config2.complete !== "function") {
      config2.complete = this.DEFAULTS.complete;
    }
    if (typeof config2.skipEmptyLines !== "boolean") {
      config2.skipEmptyLines = this.DEFAULTS.skipEmptyLines;
    }
    if (typeof config2.fastMode !== "boolean") {
      config2.fastMode = this.DEFAULTS.fastMode;
    }
    return config2;
  }
  CsvToJson(_INPUT, _CONFIG) {
    const config2 = this.copyAndValidateConfig(_CONFIG);
    const ph = new sclCsvParserHandler.ParserHandle(config2);
    const results = ph.parse(_INPUT);
    if (this.isFunction(config2.complete)) {
      config2.complete(results);
    }
    return results;
  }
}, _a39.\u0275fac = function SclUtilImporterService_Factory(t) {
  return new (t || _a39)(\u0275\u0275inject(FormbirdInjectorService));
}, _a39.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a39, factory: _a39.\u0275fac, providedIn: "root" }), _a39);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilImporterService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a40;
var SclAddressUtilService = (_a40 = class {
  constructor() {
  }
  resetAddressData(streetData) {
    streetData.properties.unitNo = "";
    streetData.properties.streetNo = "";
    streetData.properties.street = "";
    streetData.properties.suburb = "";
    streetData.properties.state = "";
    streetData.properties.country = "";
    streetData.properties.postcode = "";
    streetData.properties.locationDescription = "";
    streetData.geometry.coordinates[0] = "";
    streetData.geometry.coordinates[1] = "";
  }
  setAddressData(address, coordinates2, resultObj) {
    if (address.unitNo) {
      resultObj.properties.unitNo = address.unitNo;
    }
    resultObj.properties.streetNo = address.street_number;
    resultObj.properties.street = address.street_name;
    resultObj.properties.suburb = address.locality;
    resultObj.properties.postcode = address.postal_code;
    resultObj.properties.country = address.country;
    resultObj.properties.state = address.admin_1;
    const lat = parseFloat(coordinates2.latitude);
    const lon = parseFloat(coordinates2.longitude);
    resultObj.geometry.coordinates[0] = lon;
    resultObj.geometry.coordinates[1] = lat;
    return { obj: resultObj, lat, lon };
  }
}, _a40.\u0275fac = function SclAddressUtilService_Factory(t) {
  return new (t || _a40)();
}, _a40.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a40, factory: _a40.\u0275fac, providedIn: "root" }), _a40);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclAddressUtilService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a41;
var ComponentSetupService = (_a41 = class {
  constructor() {
    this.formGroups = {};
  }
  setupStandardProperties(component) {
    const compDef = component.componentDefinition;
    if (compDef) {
      component.disabled = compDef.enabled === false;
    }
    component.elementName = component.fieldName;
    component.registeredControlName = component.fieldName + component.key;
  }
  /**
   * setup standard component variables. This can be called from the ngOnInit function of a component with:
   * this.componentService.setupStandardComponent(this);
   * @return the responsible control that holds the component value
   */
  setupStandardComponent(component, validators) {
    this.setupStandardProperties(component);
    const documentId = component.document.documentId;
    const formGroup = this.ensureFormGroupExisted(documentId);
    const compDef = component.componentDefinition;
    this.setupDefaultValidator(compDef, validators);
    const control = new UntypedFormControl({ value: component.fieldValue, disabled: this.isComponentDisabled(compDef) }, validators);
    return formGroup.registerControl(compDef.name + component.key, control);
  }
  setupControl(component, fieldName, fieldValue, validators) {
    const formGroup = this.ensureFormGroupExisted(component.document.documentId);
    const control = new UntypedFormControl(fieldValue, validators);
    return formGroup.registerControl(fieldName + component.key, control);
  }
  enableField(tplItem, formControl) {
    if (formControl) {
      if (tplItem.enabled === false) {
        formControl.disable({ emitEvent: false });
      } else {
        formControl.enable({ emitEvent: false });
      }
    }
  }
  enableFieldByFlag(enabled, formControl) {
    if (formControl) {
      if (enabled === false) {
        formControl.disable({ emitEvent: false });
      } else {
        formControl.enable({ emitEvent: false });
      }
    }
  }
  setupDefaultValidator(componentDefinition, validatorOpts) {
    validatorOpts = validatorOpts ? validatorOpts : [];
    if (componentDefinition.mandatory) {
      validatorOpts.push(Validators.required);
    }
  }
  isComponentDisabled(compDef) {
    return compDef.enabled === false;
  }
  ensureFormGroupExisted(documentId) {
    if (!this.formGroups[documentId]) {
      this.formGroups[documentId] = new UntypedFormGroup({});
    }
    return this.formGroups[documentId];
  }
  getControl(documentId, path) {
    if (this.formGroups[documentId]) {
      const formGroup = this.formGroups[documentId];
      return formGroup.get(path);
    }
    return null;
  }
}, _a41.\u0275fac = function ComponentSetupService_Factory(t) {
  return new (t || _a41)();
}, _a41.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a41, factory: _a41.\u0275fac, providedIn: "root" }), _a41);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ComponentSetupService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a42;
var FormbirdScSharedModule = (_a42 = class {
}, _a42.\u0275fac = function FormbirdScSharedModule_Factory(t) {
  return new (t || _a42)();
}, _a42.\u0275mod = /** @pureOrBreakMyCode */
\u0275\u0275defineNgModule({ type: _a42 }), _a42.\u0275inj = /** @pureOrBreakMyCode */
\u0275\u0275defineInjector({ providers: [ComponentSetupService], imports: [CommonModule, FormbirdServicesModule] }), _a42);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(FormbirdScSharedModule, [{
    type: NgModule,
    args: [{
      declarations: [],
      imports: [CommonModule, FormbirdServicesModule],
      exports: [],
      providers: [ComponentSetupService]
    }]
  }], null, null);
})();
var _a43;
var SclUtilGmapService = (_a43 = class {
  constructor() {
  }
  initMapLabel(google2) {
    function MapLabel(optOptions) {
      this.set("fontFamily", "sans-serif");
      this.set("fontSize", 12);
      this.set("fontColor", "#000000");
      this.set("strokeWeight", 4);
      this.set("strokeColor", "#ffffff");
      this.set("align", "center");
      this.set("zIndex", 1e3);
      this.setValues(optOptions);
    }
    MapLabel.prototype = new google2.maps.OverlayView();
    window["MapLabel"] = MapLabel;
    MapLabel.prototype.changed = function(prop) {
      switch (prop) {
        case "fontFamily":
        case "fontSize":
        case "fontColor":
        case "strokeWeight":
        case "strokeColor":
        case "align":
        case "text":
          return this.drawCanvas_();
        case "maxZoom":
        case "minZoom":
        case "position":
          return this.draw();
      }
    };
    MapLabel.prototype.drawCanvas_ = function() {
      const canvas = this.canvas_;
      if (!canvas) {
        return;
      }
      const style2 = canvas.style;
      style2.zIndex = /** @type number */
      this.get("zIndex");
      const ctx = canvas.getContext("2d");
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      ctx.strokeStyle = this.get("strokeColor");
      ctx.fillStyle = this.get("fontColor");
      ctx.font = this.get("fontSize") + "px " + this.get("fontFamily");
      const strokeWeight = Number(this.get("strokeWeight"));
      const text = this.get("text");
      if (text) {
        if (strokeWeight) {
          ctx.lineWidth = strokeWeight;
          ctx.strokeText(text, strokeWeight, strokeWeight);
        }
        ctx.fillText(text, strokeWeight, strokeWeight);
        const textMeasure = ctx.measureText(text);
        const textWidth = textMeasure.width + strokeWeight;
        style2.marginLeft = this.getMarginLeft_(textWidth) + "px";
        style2.marginTop = "-1em";
      }
    };
    MapLabel.prototype.onAdd = function() {
      const canvas = this.canvas_ = document.createElement("canvas");
      const style2 = canvas.style;
      style2.position = "absolute";
      const ctx = canvas.getContext("2d");
      ctx.lineJoin = "round";
      ctx.textBaseline = "top";
      this.drawCanvas_();
      const panes = this.getPanes();
      if (panes) {
        panes.mapPane.appendChild(canvas);
      }
    };
    MapLabel.prototype["onAdd"] = MapLabel.prototype.onAdd;
    MapLabel.prototype.getMarginLeft_ = function(textWidth) {
      switch (this.get("align")) {
        case "left":
          return 0;
        case "right":
          return -textWidth;
      }
      return textWidth / -2;
    };
    MapLabel.prototype.draw = function() {
      const projection = this.getProjection();
      if (!projection) {
        return;
      }
      if (!this.canvas_) {
        return;
      }
      const latLng = (
        /** @type {google.maps.LatLng} */
        this.get("position")
      );
      if (!latLng) {
        return;
      }
      const pos = projection.fromLatLngToDivPixel(latLng);
      const style2 = this.canvas_.style;
      style2["top"] = pos.y + "px";
      style2["left"] = pos.x + "px";
      style2["visibility"] = this.getVisible_();
    };
    MapLabel.prototype["draw"] = MapLabel.prototype.draw;
    MapLabel.prototype.getVisible_ = function() {
      const minZoom = (
        /** @type number */
        this.get("minZoom")
      );
      const maxZoom = (
        /** @type number */
        this.get("maxZoom")
      );
      if (minZoom === void 0 && maxZoom === void 0) {
        return "";
      }
      const map2 = this.getMap();
      if (!map2) {
        return "";
      }
      const mapZoom = map2.getZoom();
      if (mapZoom < minZoom || mapZoom > maxZoom) {
        return "hidden";
      }
      return "";
    };
    MapLabel.prototype.onRemove = function() {
      const canvas = this.canvas_;
      if (canvas && canvas.parentNode) {
        canvas.parentNode.removeChild(canvas);
      }
    };
    MapLabel.prototype["onRemove"] = MapLabel.prototype.onRemove;
    return MapLabel;
  }
  convertGPSToAddress(lat, lon, key, $q, $http) {
    const deferrer = $q.defer();
    const link = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + lat + "," + lon + "&key=" + key;
    $http.get(link).then(function(data) {
      if (data.data.status === "OK") {
        deferrer.resolve(data);
      } else {
        deferrer.reject("Error: " + data.data.error_message);
      }
    }).catch(function(error3) {
      console.log("Error : " + error3);
      deferrer.reject(error3);
    });
    return deferrer.promise;
  }
  getGeoCoors(SearchResultsProcessor, results, geozonesData, geozonesName, google2, cb) {
    const finalData = [];
    SearchResultsProcessor.processSearchResults(results, (itemData) => {
      if (!itemData) {
        return;
      }
      const gCoors = [];
      const imeiGeoData = itemData[geozonesData];
      for (let j = 0; j < imeiGeoData.features.length; j++) {
        const geometry2 = imeiGeoData.features[j].geometry;
        const coordinates2 = geometry2.coordinates;
        if (geometry2.type === "LineString") {
          for (const key in coordinates2) {
            if (coordinates2.hasOwnProperty(key)) {
              const gCoor = new google2.maps.LatLng(coordinates2[key][1], coordinates2[key][0]);
              gCoors.push(gCoor);
            }
          }
          finalData.push({
            name: itemData[geozonesName],
            coors: gCoors,
            shape: "Line"
          });
        } else if (geometry2.type === "Polygon") {
          for (const key in coordinates2[0]) {
            if (coordinates2[0].hasOwnProperty(key)) {
              const gCoor = new google2.maps.LatLng(coordinates2[0][key][1], coordinates2[0][key][0]);
              gCoors.push(gCoor);
            }
          }
          finalData.push({
            name: itemData[geozonesName],
            coors: gCoors,
            shape: "Polygon"
          });
        } else if (geometry2.type === "Point") {
          const gCoor = new google2.maps.LatLng(coordinates2[1], coordinates2[0]);
          gCoors.push(gCoor);
          finalData.push({
            name: itemData[geozonesName],
            coors: gCoors,
            shape: "Point"
          });
        } else if (geometry2.type === "MultiPolygon") {
          for (let h = 0; h < coordinates2.length; h++) {
            for (const key in coordinates2[h]) {
              if (coordinates2[h].hasOwnProperty(key)) {
                const gCoor = new google2.maps.LatLng(coordinates2[h][key][1], coordinates2[h][key][0]);
                gCoors.push(gCoor);
              }
            }
            finalData.push({
              name: itemData[geozonesName],
              coors: gCoors,
              shape: "Polygon"
            });
          }
        } else {
          console.log(geometry2.type + " is not handle yet");
        }
      }
    }, () => {
      console.log('the "processSearchResults" is complete');
    });
    if (cb && typeof cb === "function") {
      cb(finalData);
    }
  }
}, _a43.\u0275fac = function SclUtilGmapService_Factory(t) {
  return new (t || _a43)();
}, _a43.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a43, factory: _a43.\u0275fac, providedIn: "root" }), _a43);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilGmapService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a44;
var SclUtilAvlService = (_a44 = class {
  constructor() {
  }
  getRelatedDocument(data, kind) {
    let retVal = {};
    if (data && data.imeiDocumentsRel && data.imeiDocumentsRel.length > 0 && kind) {
      retVal = data.imeiDocumentsRel.find(function(x) {
        if (!x || !x.imeiDocumentType) {
          return false;
        }
        if (Array.isArray(x.imeiDocumentType)) {
          const temp = x.imeiDocumentType.find((y) => y === kind);
          if (temp) {
            return true;
          } else {
            return false;
          }
        } else {
          return x.imeiDocumentType === kind;
        }
      });
    }
    return retVal;
  }
}, _a44.\u0275fac = function SclUtilAvlService_Factory(t) {
  return new (t || _a44)();
}, _a44.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a44, factory: _a44.\u0275fac, providedIn: "root" }), _a44);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilAvlService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a45;
var CompressorBase30Service = (_a45 = class {
  constructor() {
    this.chunkSeparator = "_";
    this.charmap = {};
    this.charmapReverse = {};
    this.minus = "Z";
    this.plus = "Y";
    this.acceptedformat = "image/jsignature;base30";
    this.allchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX".split("");
    this.bitness = this.allchars.length / 2;
    for (let i4 = this.bitness - 1; i4 > -1; i4--) {
      this.charmap[this.allchars[i4]] = this.allchars[i4 + this.bitness];
      this.charmapReverse[this.allchars[i4 + this.bitness]] = this.allchars[i4];
    }
  }
  remapTailChars(number2) {
    const chars = number2.split("");
    const l = chars.length;
    for (let i4 = 1; i4 < l; i4++) {
      chars[i4] = this.charmap[chars[i4]];
    }
    return chars.join("");
  }
  compressstrokeleg(data) {
    const answer = [];
    let lastwhole = 0;
    const last2 = 0;
    let lastpolarity = 1;
    const l = data.length;
    let nwhole;
    let n;
    let absn;
    for (let i4 = 0; i4 < l; i4++) {
      nwhole = Math.round(data[i4]);
      n = nwhole - lastwhole;
      lastwhole = nwhole;
      if (n < 0 && lastpolarity > 0) {
        lastpolarity = -1;
        answer.push(this.minus);
      } else if (n > 0 && lastpolarity < 0) {
        lastpolarity = 1;
        answer.push(this.plus);
      }
      absn = Math.abs(n);
      if (absn >= this.bitness) {
        answer.push(this.remapTailChars(absn.toString(this.bitness)));
      } else {
        answer.push(absn.toString(this.bitness));
      }
    }
    return answer.join("");
  }
  uncompressstrokeleg(datastring) {
    const answer = [];
    const chars = datastring.split("");
    const l = chars.length;
    let ch;
    let polarity = 1;
    let partial = [];
    let preprewhole = 0;
    let prewhole;
    for (let i4 = 0; i4 < l; i4++) {
      ch = chars[i4];
      if (ch in this.charmap || ch === this.minus || ch === this.plus) {
        if (partial.length !== 0) {
          prewhole = parseInt(partial.join(""), this.bitness) * polarity + preprewhole;
          answer.push(prewhole);
          preprewhole = prewhole;
        }
        if (ch === this.minus) {
          polarity = -1;
          partial = [];
        } else if (ch === this.plus) {
          polarity = 1;
          partial = [];
        } else {
          partial = [ch];
        }
      } else {
        partial.push(this.charmapReverse[ch]);
      }
    }
    answer.push(parseInt(partial.join(""), this.bitness) * polarity + preprewhole);
    return answer;
  }
  compressstrokes(data) {
    const answer = [];
    const l = data.length;
    let stroke;
    for (let i4 = 0; i4 < l; i4++) {
      stroke = data[i4];
      answer.push(this.compressstrokeleg(stroke.x));
      answer.push(this.compressstrokeleg(stroke.y));
    }
    return answer.join(this.chunkSeparator);
  }
  uncompressstrokes(datastring) {
    const data = [];
    const chunks = datastring.split(this.chunkSeparator);
    const l = chunks.length / 2;
    for (let i4 = 0; i4 < l; i4++) {
      data.push({
        x: this.uncompressstrokeleg(chunks[i4 * 2]),
        y: this.uncompressstrokeleg(chunks[i4 * 2 + 1])
      });
    }
    return data;
  }
  pluginCompressor(data) {
    return [this.acceptedformat, this.compressstrokes(data)];
  }
  pluginDecompressor(data, formattype, importcallable) {
    if (typeof data !== "string") {
      return;
    }
    if (data.substring(0, this.acceptedformat.length).toLowerCase() === this.acceptedformat) {
      data = data.substring(this.acceptedformat.length + 1);
    }
    importcallable(this.uncompressstrokes(data));
  }
}, _a45.\u0275fac = function CompressorBase30Service_Factory(t) {
  return new (t || _a45)();
}, _a45.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a45, factory: _a45.\u0275fac, providedIn: "root" }), _a45);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CompressorBase30Service, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a46;
var SclUtilAuditService = (_a46 = class {
  constructor() {
  }
  // Split string and then return to object array.(used in sc-audit-table)
  getObjectSplit(object, type) {
    let returnObject = object;
    if (type === "doubleEquals") {
      returnObject = returnObject.split(":==:");
    } else if (type === "equalWithArrow") {
      returnObject = returnObject.split("=:>");
    }
    return returnObject;
  }
  // Get list of object that has changes/ has an update .(used in sc-audit-table)
  getUpdatedObject(obj) {
    const objectChangesSring = "";
    const objectStrHoldter = [];
    for (const key in obj) {
      if (!(key === "_id" || key === "systemHeader")) {
        if (this.getDataType(obj[key]) === "array" || this.getDataType(obj[key]) === "object") {
          const objInside1 = obj[key];
          for (const insideKey1 in objInside1) {
            if (this.getDataType(objInside1[insideKey1]) === "array" || this.getDataType(objInside1[insideKey1]) === "object") {
              const objInside2 = objInside1[insideKey1];
              for (const insideKey2 in objInside2) {
                if (this.getDataType(objInside2[insideKey2]) === "array" || this.getDataType(objInside2[insideKey2]) === "object") {
                  const objInside3 = objInside2[insideKey2];
                  for (const insideKey3 in objInside3) {
                    if (this.getDataType(objInside3[insideKey3]) === "array" || this.getDataType(objInside3[insideKey3]) === "object") {
                    } else {
                      if (objInside3[insideKey3] === "unchanged") {
                        break;
                      }
                      objectStrHoldter.push(key + "=>" + insideKey1 + "=>" + insideKey2 + ":==:" + insideKey3 + "=:>" + objInside3[insideKey3]);
                    }
                  }
                } else {
                  if (objInside2[insideKey2] === "unchanged") {
                    break;
                  }
                  objectStrHoldter.push(key + "=>" + insideKey1 + ":==:" + insideKey2 + "=:>" + objInside2[insideKey2]);
                }
              }
            } else {
              if (objInside1[insideKey1] === "unchanged") {
                break;
              }
              objectStrHoldter.push(key + ":==:" + insideKey1 + "=:>" + objInside1[insideKey1]);
            }
          }
        } else {
          objectStrHoldter.push(key + "=:>" + obj[key]);
        }
      }
    }
    return objectStrHoldter;
  }
  // Split that return data type.(used in sc-audit-table)
  getDataType(data) {
    if (data === void 0 || data === null) {
      return "undefined";
    }
    if (data.constructor === String) {
      return "string";
    }
    if (data.constructor === Array) {
      return "array";
    }
    if (data.constructor === Object) {
      return "object";
    }
    if (data.constructor === Number) {
      return "number";
    }
    if (data.constructor === Boolean) {
      return "boolean";
    }
    if (data.constructor === Function) {
      return "function";
    }
    if (data.constructor === Date) {
      return "date";
    }
    if (data.constructor === RegExp) {
      return "regex";
    }
    return "unknown";
  }
  // funtion return the difference of two object versions.(used in sc-audit-table)
  getObjectDifference(obj1, obj2) {
    if (this.getDataType(obj1) !== "array" && this.getDataType(obj1) !== "object" || this.getDataType(obj2) !== "array" && this.getDataType(obj2) !== "object") {
      let type1 = "";
      if (obj1 === obj2 || this.getDataType(obj1) === "date" && this.getDataType(obj2) === "date" && obj1.getTime() === obj2.getTime()) {
        type1 = "unchanged";
      } else if (this.getDataType(obj1) === "undefined") {
        type1 = "created";
      }
      if (this.getDataType(obj2) === "undefined") {
        type1 = "deleted";
      } else if (type1 === "") {
        type1 = "updated";
      }
      return {
        type: type1,
        data: obj1 === void 0 ? obj2 : obj1
      };
    }
    let diff;
    if (this.getDataType(obj1) === "array" && this.getDataType(obj2) === "array") {
      diff = [];
      obj1.sort();
      obj2.sort();
      for (let i112 = 0; i112 < obj2.length; i112++) {
        const type2 = obj1.indexOf(obj2[i112]) === -1 ? "created" : "unchanged";
        if (type2 === "created" && (this.getDataType(obj2[i112]) === "array" || this.getDataType(obj2[i112]) === "object")) {
          diff.push(this.getObjectDifference(obj1[i112], obj2[i112]));
          continue;
        }
        diff.push({
          type: type2,
          data: obj2[i112]
        });
      }
      for (let i22 = 0; i22 < obj1.length; i22++) {
        if (obj2.indexOf(obj1[i22]) !== -1 || this.getDataType(obj1[i22]) === "array" || this.getDataType(obj1[i22]) === "object") {
          continue;
        }
        diff.push({
          type: "deleted",
          data: obj1[i22]
        });
      }
    } else {
      diff = {};
      let key = Object.keys(obj1);
      for (let i32 = 0; i32 < key.length; i32++) {
        let value2;
        if (this.getDataType(obj2[key[i32]]) !== "undefined") {
          value2 = obj2[key[i32]];
        }
        diff[key[i32]] = this.getObjectDifference(obj1[key[i32]], value2);
      }
      key = Object.keys(obj2);
      for (let i4 = 0; i4 < key.length; i4++) {
        if (this.getDataType(diff[key[i4]]) !== "undefined") {
          continue;
        }
        diff[key[i4]] = this.getObjectDifference(void 0, obj2[key[i4]]);
      }
    }
    return diff;
  }
  // function to get list of changes in all versions.(used in sc-audit-table)
  getObjectVersionData(objectDocVersionData, getUserFn, formatTimeFn, getLabelsFromTemplateFn, resultUserDataObj, currentTemplateComponentsObj, isHasTargetTableComponent) {
    const dataResult = objectDocVersionData;
    const objectDataSet = [];
    let dataChangesObj = [];
    const objectRecordChanges = [];
    const dataResultLength = dataResult.length - 1;
    for (let index = 0; index < dataResult.length; index++) {
      const insideDataSetObject = [];
      const stringType = "";
      const stringKey = "";
      const inc = 0;
      let varWho = "";
      let varWhen = "";
      let varInitialValue = "";
      let varNewValue = "";
      const objectVersion1 = dataResult[index];
      const nextIndex = index + 1;
      const objectVersion2 = dataResult[nextIndex];
      if (index === dataResultLength) {
        const createByEmailName1 = getUserFn(objectVersion1.systemHeader.createdBy, resultUserDataObj);
        varWho = createByEmailName1 && createByEmailName1.systemHeader ? createByEmailName1.systemHeader.summaryName : objectVersion1.systemHeader.createdBy;
        varWhen = isHasTargetTableComponent ? objectVersion1.systemHeader.createdDate : formatTimeFn(objectVersion1.systemHeader.createdDate);
        varInitialValue = "Created";
        varNewValue = "Created";
        insideDataSetObject.push(index + 1);
        insideDataSetObject.push(varWho);
        insideDataSetObject.push(varWhen);
        insideDataSetObject.push(varInitialValue);
        insideDataSetObject.push(varNewValue);
        insideDataSetObject.push(objectVersion1);
      } else {
        dataChangesObj = this.getObjectDifference(objectVersion2, objectVersion1);
        let objectUpdated = this.getUpdatedObject(dataChangesObj);
        objectRecordChanges.push(objectUpdated);
        const newObjectUpdated = [];
        for (const keyObjUpdated1 in objectUpdated) {
          if (!(objectUpdated[keyObjUpdated1].toString().indexOf("data=") >= 0)) {
            newObjectUpdated.push(objectUpdated[keyObjUpdated1]);
          }
        }
        objectUpdated = newObjectUpdated;
        let strNewValue = "";
        let strOldValue = "";
        let thisTypeValue;
        for (const keyObjUpdated in objectUpdated) {
          if (objectUpdated.length > 0) {
            const keyNames = objectUpdated[keyObjUpdated].split(":==:")[0].split("=>");
            strOldValue = strOldValue.trim() === "" ? "" : strOldValue + "\n";
            strNewValue = strNewValue.trim() === "" ? "" : strNewValue + "\n";
            if (keyNames.length === 1) {
              thisTypeValue = dataChangesObj[keyNames[0]].type;
              if (thisTypeValue === "created") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + ":No initial value";
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + ":" + JSON.stringify(dataChangesObj[keyNames[0]].data) + " (New)";
              } else if (thisTypeValue === "deleted") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + ":" + JSON.stringify(objectVersion2[keyNames[0]]);
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + " (Deleted)";
              } else if (thisTypeValue === "updated") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + ":" + JSON.stringify(objectVersion2[keyNames[0]]);
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + ":" + JSON.stringify(objectVersion1[keyNames[0]]) + " (Updated)";
              }
            } else if (keyNames.length === 2) {
              thisTypeValue = dataChangesObj[keyNames[0]][keyNames[1]].type;
              if (thisTypeValue === "created") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + ":No initial value";
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + ":" + JSON.stringify(objectVersion1[keyNames[0]][keyNames[1]]) + " (New)";
              } else if (thisTypeValue === "deleted") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + ":" + JSON.stringify(objectVersion2[keyNames[0]][keyNames[1]]);
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + " (Deleted)";
              } else if (thisTypeValue === "updated") {
                strOldValue = strOldValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + ":" + JSON.stringify(objectVersion2[keyNames[0]][keyNames[1]]);
                strNewValue = strNewValue + getLabelsFromTemplateFn(keyNames[0], currentTemplateComponentsObj) + "." + keyNames[1] + ":" + JSON.stringify(objectVersion1[keyNames[0]][keyNames[1]]) + " (Updated)";
              }
            } else if (keyNames.length === 3) {
              thisTypeValue = dataChangesObj[keyNames[0]][keyNames[1]][keyNames[2]].type;
              if (thisTypeValue === "created") {
                strOldValue = strOldValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + ":No initial value";
                strNewValue = strNewValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + ":" + JSON.stringify(objectVersion1[keyNames[0]][keyNames[1]][keyNames[2]]) + " (New)";
              } else if (thisTypeValue === "deleted") {
                strOldValue = strOldValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + ":" + JSON.stringify(objectVersion2[keyNames[0]][keyNames[1]][keyNames[2]]);
                strNewValue = strNewValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + " (Deleted)";
              } else if (thisTypeValue === "updated") {
                strOldValue = strOldValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + ":" + JSON.stringify(objectVersion2[keyNames[0]][keyNames[1]][keyNames[2]]);
                strNewValue = strNewValue + keyNames[0] + "." + keyNames[1] + "." + keyNames[2] + ":" + JSON.stringify(objectVersion1[keyNames[0]][keyNames[1]][keyNames[2]]) + " (Updated)";
              }
            }
          }
        }
        const createByEmailName1 = getUserFn(objectVersion1.systemHeader.createdBy, resultUserDataObj);
        varWho = createByEmailName1 && createByEmailName1.systemHeader ? createByEmailName1.systemHeader.summaryName : objectVersion1.systemHeader.createdBy;
        varWhen = isHasTargetTableComponent ? objectVersion1.systemHeader.createdDate : formatTimeFn(objectVersion1.systemHeader.createdDate);
        varInitialValue = strOldValue;
        varNewValue = strNewValue;
        insideDataSetObject.push(index + 1);
        insideDataSetObject.push(varWho);
        insideDataSetObject.push(varWhen);
        insideDataSetObject.push(varInitialValue + '\nlastUpdated:"' + objectVersion2.systemHeader.createdDate + '"');
        insideDataSetObject.push(varNewValue + '\nlastUpdated:"' + objectVersion1.systemHeader.createdDate + '"');
        insideDataSetObject.push(objectVersion1);
      }
      objectDataSet.push(insideDataSetObject);
    }
    return objectDataSet;
  }
}, _a46.\u0275fac = function SclUtilAuditService_Factory(t) {
  return new (t || _a46)();
}, _a46.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a46, factory: _a46.\u0275fac, providedIn: "root" }), _a46);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclUtilAuditService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
var _a47;
var UtilSharingNgService = (_a47 = class {
  constructor(clientRulesService, broadcastService) {
    this.clientRulesService = clientRulesService;
    this.broadcastService = broadcastService;
  }
  // Function that would trigger/call functions from one component to other components/ rules
  //  componentFieldName=>name of component that contains the function;functionName=> name of the function declared in componentFieldName
  // e.g component function call:scope.sclUtilSharing.fnCallFunction(scope.fieldName,'eventReloadDatatable');
  // e.g rules calling: UtilSharingLibrary.fnCallFunction('scDatatablesTest','eventReloadDatatable');
  fnCallFunction(componentFieldName, functionName, param1, param2) {
    const value = { fieldName: componentFieldName, param1, param2, time: /* @__PURE__ */ new Date() };
    this.broadcastService.broadcast(functionName, value);
    this.clientRulesService.setSharedValue(functionName, value);
    if (/get/.test(functionName.slice(0, 3))) {
      const objectData = this.clientRulesService.getSharedValue(functionName.replace(/^get/, "set"));
      let objectDataReturn = [];
      if (objectData) {
        if (objectData.param1 && objectData.param2) {
          objectDataReturn.push(objectData.param1, objectData.param2);
        } else if (objectData.param1) {
          objectDataReturn = objectData.param1;
        } else {
          objectDataReturn = objectData;
        }
        return objectDataReturn;
      }
    }
  }
  // Function that would register a list of function to call in fnCallFunction
  // listOfFunctions=>['eventReloadDatatable','eventReloadTable','function1','...']
  // list of functions that will be available  in fnCallFunction to be called.
  // listOfFunctions = [{functionName, function}, ...];
  fnRegisterFunctions(listOfFunctions, fieldName, documentId) {
    for (let i4 = 0, n = listOfFunctions.length; i4 < n; i4++) {
      this.fnCreateWatchForFunctionCall(listOfFunctions[i4].name, listOfFunctions[i4].fn, fieldName, documentId);
    }
  }
  fnCreateWatchForFunctionCall(functionName, fn, fieldName, documentId) {
    this.broadcastService.on(functionName).subscribe((objValue) => {
      if (objValue) {
        if (fieldName === objValue.fieldName) {
          if (objValue.param1 && objValue.param2) {
            fn(objValue.param1, objValue.param2);
          } else if (objValue.param1) {
            fn(objValue.param1);
          } else {
            fn();
          }
        }
      }
    });
  }
  fnPassedDataObject(fieldName, objectName, objectDataValue) {
    this.clientRulesService.setSharedValue(objectName, { fieldName, objectDataValue, time: (/* @__PURE__ */ new Date()).getTime() });
  }
  fnGetDataObject(fieldName, objectName) {
    const objectData = this.clientRulesService.getSharedValue(objectName);
    return objectData.fieldName === fieldName ? objectData : null;
  }
}, _a47.\u0275fac = function UtilSharingNgService_Factory(t) {
  return new (t || _a47)(\u0275\u0275inject(ClientRulesService), \u0275\u0275inject(BroadcastService));
}, _a47.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a47, factory: _a47.\u0275fac, providedIn: "root" }), _a47);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UtilSharingNgService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: ClientRulesService }, { type: BroadcastService }], null);
})();
var logger = console;
var _a48;
var SclSearchClientService = (_a48 = class {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.executeComponentFunction = (options, resolve, reject) => __async(this, null, function* () {
      if (!options?.processHandlebars) {
        sclHandlebars.initHandlebars(this.contextParams.componentDefinition.handlebarsHelpers);
        options.processHandlebars = sclHandlebars.processHandlebars;
        options.handlebarsParams = this.contextParams;
      }
      this.searchClientService.executeComponentFunction(options, resolve, reject);
    });
    this.searchClientService = this.formbirdInjectorService.get("SearchClientService");
  }
  search(options) {
    if (!options?.processHandlebars && this.contextParams?.componentDefinition?.handlebarsHelpers) {
      sclHandlebars.initHandlebars(this.contextParams.componentDefinition.handlebarsHelpers);
      options.processHandlebars = sclHandlebars.processHandlebars;
      options.handlebarsParams = this.contextParams;
    }
    return this.searchClientService.search(options);
  }
  getDexieSearchFunction(options) {
    options.processHandlebars = sclHandlebars.processHandlebars;
    options.handlebarsParams = this.contextParams;
    return this.searchClientService.getDexieSearchFunction(options);
  }
  getDefaultSearchProvider(context2) {
    this.contextParams = {
      document: context2.document,
      doc: context2.document,
      account: context2.account,
      // the account document from scope
      tpl: context2.template,
      template: context2.template,
      tplItem: context2.componentDefinition,
      // For BackCompatibility
      componentDefinition: context2.componentDefinition
      // the current components configuration details
    };
    return this.searchClientService.getDefaultSearchProvider(context2);
  }
  isDexieQuery(context2, queryName) {
    return this.searchClientService.isDexieQuery(context2, queryName);
  }
}, _a48.\u0275fac = function SclSearchClientService_Factory(t) {
  return new (t || _a48)(\u0275\u0275inject(FormbirdInjectorService));
}, _a48.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a48, factory: _a48.\u0275fac, providedIn: "root" }), _a48);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclSearchClientService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: FormbirdInjectorService }], null);
})();
var _a49;
var DropDownConfigService = (_a49 = class {
  constructor(searchService) {
    this.searchService = searchService;
  }
  searchConfigList(configName, fieldName, templateId) {
    return __async(this, null, function* () {
      let searchOptions = {
        page: 0,
        pageSize: 1e4,
        filter: {
          "query": {
            "bool": {
              "filter": [
                { "term": { "relatedTemplateRel.documentId": templateId } },
                { "term": { "appTags": "componentConfiguration" } }
              ]
            }
          }
        }
      };
      try {
        const response = yield this.searchService.search(searchOptions);
        let result;
        if (response?.data?.hits?.hits?.length) {
          const conf = response.data.hits.hits.map((f) => JSON.parse(f._source[configName])).filter((f) => Object.keys(f).includes(fieldName));
          if (conf.length)
            result = conf[0][fieldName];
        }
        if (!result) {
          throw new Error("Error on searching config: Empty result.");
        }
        return result;
      } catch (err) {
        throw new Error("Error on searching config: " + err.message);
      }
    });
  }
}, _a49.\u0275fac = function DropDownConfigService_Factory(t) {
  return new (t || _a49)(\u0275\u0275inject(SearchService));
}, _a49.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a49, factory: _a49.\u0275fac, providedIn: "root" }), _a49);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DropDownConfigService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [{ type: SearchService }], null);
})();
var _a50;
var SclWrappingService = (_a50 = class {
  constructor() {
  }
  processWrappingOpen(intervalObj, wrapActionDefinition, parent, elemOpenId, key, title, bgColor, fgColor, borderColor, enableMatFormFix, wrapHeading, wrapClass, iconClass, iconStyle, fullwidth, parentNode, wrappingCloseFn, updateUIFn) {
    let wrapAction = "";
    if (!(typeof wrapActionDefinition === "undefined" || wrapActionDefinition == null)) {
      wrapAction = wrapActionDefinition;
    }
    if (wrapAction === "open") {
      if (intervalObj == null) {
        if (parent != null) {
          clearInterval(intervalObj);
          intervalObj = null;
          const parentId = parent.getAttribute("id");
          if (parentId) {
            parent.setAttribute("id", elemOpenId);
            parent.classList.add(parentId);
          }
          parent.setAttribute("key", key);
          parent.setAttribute("static-html-wrap", elemOpenId);
          parent.setAttribute("static-html-wrap-heading-title", title ? title : "");
          parent.setAttribute("static-html-wrap-heading-bg", bgColor);
          parent.setAttribute("static-html-wrap-heading-fg", fgColor);
          parent.setAttribute("static-html-wrap-border", borderColor);
          if (enableMatFormFix) {
            parent.classList.add("enable-mat-form-fix");
          }
          let isWrapHeading = true;
          if (!(wrapHeading == null)) {
            isWrapHeading = wrapHeading;
          }
          parent.setAttribute("static-html-wrap-heading", isWrapHeading);
          parent.setAttribute("static-html-wrap-class", wrapClass);
          parent.setAttribute("static-html-icon-class", iconClass);
          parent.setAttribute("static-html-icon-style", iconStyle);
          parent.setAttribute("static-html-wrap-fullwidth", fullwidth);
          if (updateUIFn && typeof updateUIFn === "function") {
            updateUIFn();
          }
          if (wrappingCloseFn && typeof wrappingCloseFn === "function") {
            wrappingCloseFn();
          }
        } else {
          parent = parentNode;
        }
      }
    }
    return { wrapAction, intervalObj };
  }
  handlePanelIcon(open, panel) {
    const wrapId = open.getAttribute("id");
    const iconClass = open.getAttribute("static-html-icon-class");
    const hasIconClass = iconClass && iconClass !== "undefined";
    const iconStyle = open.getAttribute("static-html-icon-style");
    const hasIconStyle = iconStyle && iconStyle !== "undefined";
    if (hasIconClass || hasIconStyle) {
      const icon = document.createElement("div");
      const iconDiv = document.createElement("div");
      iconDiv.setAttribute("id", `circled${wrapId}`);
      iconDiv.className = "fbPanelBackgroundCircle";
      const iWrap = document.createElement("i");
      if (hasIconClass) {
        iWrap.classList.add("ico");
        iWrap.classList.add(...iconClass.split(" "));
        iWrap.classList.add("fa-fw", "defaultIconClass");
        panel.classList.add("hasIcon");
      }
      if (hasIconStyle) {
        iWrap.style.cssText = iconStyle;
      }
      iconDiv.appendChild(iWrap);
      icon.appendChild(iconDiv);
      panel.appendChild(icon);
    }
  }
  handlePanelHead(open, panel, className) {
    const wrapId = open.getAttribute("id");
    const wrapHeading = open.getAttribute("static-html-wrap-heading");
    const headingHtml = open.getAttribute("static-html-wrap-heading-title");
    const bg = open.getAttribute("static-html-wrap-heading-bg");
    const fg = open.getAttribute("static-html-wrap-heading-fg");
    const border = open.getAttribute("static-html-wrap-border");
    const head = document.createElement("div");
    head.className = className;
    head.setAttribute("id", wrapId + "head");
    head.innerHTML = headingHtml;
    if (bg !== "") {
      head.style.background = bg;
    }
    if (fg !== "") {
      head.style.color = fg;
    }
    if (border !== "") {
      panel.style.borderColor = border;
      head.style.borderColor = border;
    }
    if (wrapHeading === "true") {
      panel.appendChild(head);
    }
  }
  handlePanelBody(open, panel, className, isStaticHtmlComp) {
    const wrapId = open.getAttribute("id");
    const body = document.createElement("div");
    body.className = className;
    body.setAttribute("id", wrapId + "collapsable");
    panel.appendChild(body);
  }
  handlePanel(parent, open, close, classNames, isStaticHtmlComp) {
    const wrapId = open.getAttribute("id");
    const panel = document.createElement("div");
    panel.setAttribute("id", `${wrapId}panel`);
    panel.setAttribute("close-class", close.className);
    const wrap_class = open.getAttribute("static-html-wrap-class") !== "undefined" ? open.getAttribute("static-html-wrap-class") : classNames.wrapClassDefault;
    let panelClass = "panel ft-panel-wrap " + wrap_class + " " + open.className.replace("ng-hide", "");
    if (isStaticHtmlComp) {
      panelClass = panelClass.replace(/ft-grid-col-[0-9]/g, "ft-grid-col-12");
    }
    panel.className = panelClass;
    this.handlePanelIcon(open, panel);
    this.handlePanelHead(open, panel, classNames.head);
    this.handlePanelBody(open, panel, classNames.collapsable, isStaticHtmlComp);
    parent.firstChild.appendChild(panel);
  }
  processWrappingClose(isStaticHtmlComp, elemOpenId, parent, siblings, siblingsGrid, classNames) {
    let success2 = false;
    let headId = `${elemOpenId}head`;
    try {
      const open = document.getElementById(elemOpenId);
      const close = parent;
      let wrapElement = open;
      while (wrapElement) {
        if (wrapElement.nextSibling === close) {
          break;
        }
        wrapElement = wrapElement.nextSibling;
        if (wrapElement == null) {
          continue;
        }
        siblings.push(wrapElement);
        if (wrapElement && wrapElement.className) {
          if (wrapElement.className.match(/ft-grid-col-[0-9]/g)) {
            siblingsGrid += parseInt(wrapElement.className.match(/ft-grid-col-[0-9]/g)[0].split("-")[3], 10);
          } else if (wrapElement.className === "ft-component-wrap ng-untouched ng-pristine ng-valid ng-star-inserted") {
            siblingsGrid += 3;
          }
        } else {
        }
      }
      const openFullwidth = open.getAttribute("static-html-wrap-fullwidth").toLowerCase();
      let newFtGrid = openFullwidth === "false" ? siblingsGrid >= 12 ? 12 : siblingsGrid : 12;
      if (!isStaticHtmlComp) {
        open.className = open.className.replace(/ft-grid-col-[0-9]/g, "ft-grid-col-" + newFtGrid);
      }
      open.className = open.className.replace(/col-lg-[0-9]/g, "col-lg-12");
      this.handlePanel(parent, open, close, classNames, isStaticHtmlComp);
      success2 = true;
    } catch (err) {
      console.log("Encounter error. Going back to start wrapp ing");
      siblings = [];
    }
    return { siblings, siblingsGrid, success: success2, headId };
  }
}, _a50.\u0275fac = function SclWrappingService_Factory(t) {
  return new (t || _a50)();
}, _a50.\u0275prov = /** @pureOrBreakMyCode */
\u0275\u0275defineInjectable({ token: _a50, factory: _a50.\u0275fac, providedIn: "root" }), _a50);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SclWrappingService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], () => [], null);
})();
function ValidationMessageComponent_div_0_span_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "span", 4);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = \u0275\u0275nextContext().$implicit;
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", validator_r1.text, " ");
  }
}
function ValidationMessageComponent_div_0_mat_icon_2_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "mat-icon", 5);
    \u0275\u0275text(1, "error");
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = \u0275\u0275nextContext().$implicit;
    \u0275\u0275attribute("aria-label", validator_r1.text);
  }
}
function ValidationMessageComponent_div_0_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 1);
    \u0275\u0275template(1, ValidationMessageComponent_div_0_span_1_Template, 2, 1, "span", 2)(2, ValidationMessageComponent_div_0_mat_icon_2_Template, 2, 1, "mat-icon", 3);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = ctx.$implicit;
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r1.validatorValue[ctx_r1.documentId] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName][validator_r1.name]);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r1.validatorValue[ctx_r1.documentId] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName][validator_r1.name]);
  }
}
var _a51;
var ValidationMessageComponent = (_a51 = class {
  constructor(validationService, broadcastService, cdr) {
    this.validationService = validationService;
    this.broadcastService = broadcastService;
    this.cdr = cdr;
    this.subscriptions = new Subscription();
  }
  loadData() {
    const self2 = this;
    if (!self2.model || !self2.componentDefinition) {
      console.warn("No model or template item provided for component.");
      return;
    }
    self2.fieldName = self2.componentDefinition.name;
    self2.documentId = self2.model.documentId;
    self2.validators = self2.validationService.loadValidators(self2.componentDefinition, self2.fieldName);
    self2.validatorValue = self2.validationService.validationCtrlValues;
    const subscription = self2.broadcastService.on(ClientConstants.VALIDATE_FORM_FIELDS).subscribe((value) => {
      if (value && value.documentId === self2.documentId && value.fieldName === self2.fieldName) {
        this.cdr.detectChanges();
      }
    });
    self2.subscriptions.add(subscription);
  }
  ngOnInit() {
    this.loadData();
  }
  ngOnDestroy() {
    this.subscriptions.unsubscribe();
  }
}, _a51.\u0275fac = function ValidationMessageComponent_Factory(t) {
  return new (t || _a51)(\u0275\u0275directiveInject(ValidationService), \u0275\u0275directiveInject(BroadcastService), \u0275\u0275directiveInject(ChangeDetectorRef));
}, _a51.\u0275cmp = /** @pureOrBreakMyCode */
\u0275\u0275defineComponent({ type: _a51, selectors: [["ft-validation-display"]], inputs: { model: "model", componentDefinition: "componentDefinition" }, decls: 1, vars: 1, consts: [["class", "validator", 4, "ngFor", "ngForOf"], [1, "validator"], ["class", "mat-error", "role", "alert", 4, "ngIf"], ["class", "ft-validation-icon-error mat-error", "attr.aria-hidden", "false", 4, "ngIf"], ["role", "alert", 1, "mat-error"], ["attr.aria-hidden", "false", 1, "ft-validation-icon-error", "mat-error"]], template: function ValidationMessageComponent_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, ValidationMessageComponent_div_0_Template, 3, 2, "div", 0);
  }
  if (rf & 2) {
    \u0275\u0275property("ngForOf", ctx.validators);
  }
}, dependencies: [NgForOf, NgIf, MatIcon], styles: ["@media screen and (max-width: 520.98px){.ft-component-wrap .mat-mdc-form-field{margin-bottom:0}.ft-component-wrap .mat-mdc-form-field .mat-mdc-text-field-wrapper{padding-bottom:1.25em}.ft-component-wrap .mat-mdc-form-field .mdc-line-ripple{bottom:1.25em}.ft-component-wrap .mat-mdc-form-field-subscript-wrapper{display:block}}@media screen and (max-width: 600.98px){#ft-wrapper{margin:0!important}}.validator{position:relative;display:block}.validator>.mat-error:not(.ft-validation-icon-error){font-size:75%;padding-top:10px;color:#f24133}.validator>.mat-error:not(.ft-validation-icon-error)+.ft-validation-icon-error{color:#f24133;position:absolute;right:0;bottom:38px}@media col-xs{.validator{margin-top:-15px;margin-bottom:15px}.validator>.mat-error:not(.ft-validation-icon-error){font-size:75%;padding-top:0}}\n"], encapsulation: 3, changeDetection: 0 }), _a51);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ValidationMessageComponent, [{
    type: Component,
    args: [{ selector: "ft-validation-display", encapsulation: ViewEncapsulation$1.ShadowDom, changeDetection: ChangeDetectionStrategy.OnPush, template: '<div *ngFor="let validator of validators" class="validator">\n\n    <span class="mat-error" role="alert" *ngIf="validatorValue[documentId] &&\n\n                validatorValue[documentId][fieldName] &&\n                validatorValue[documentId][fieldName][validator.name]">\n                {{ validator.text }}\n    </span>\n\n    <mat-icon class="ft-validation-icon-error mat-error"\n    *ngIf="validatorValue[documentId] &&\n    validatorValue[documentId][fieldName] &&\n    validatorValue[documentId][fieldName][validator.name]"\n    attr.aria-hidden="false" [attr.aria-label]="validator.text">error</mat-icon>\n</div>\n', styles: ["@media screen and (max-width: 520.98px){.ft-component-wrap .mat-mdc-form-field{margin-bottom:0}.ft-component-wrap .mat-mdc-form-field .mat-mdc-text-field-wrapper{padding-bottom:1.25em}.ft-component-wrap .mat-mdc-form-field .mdc-line-ripple{bottom:1.25em}.ft-component-wrap .mat-mdc-form-field-subscript-wrapper{display:block}}@media screen and (max-width: 600.98px){#ft-wrapper{margin:0!important}}.validator{position:relative;display:block}.validator>.mat-error:not(.ft-validation-icon-error){font-size:75%;padding-top:10px;color:#f24133}.validator>.mat-error:not(.ft-validation-icon-error)+.ft-validation-icon-error{color:#f24133;position:absolute;right:0;bottom:38px}@media col-xs{.validator{margin-top:-15px;margin-bottom:15px}.validator>.mat-error:not(.ft-validation-icon-error){font-size:75%;padding-top:0}}\n"] }]
  }], () => [{ type: ValidationService }, { type: BroadcastService }, { type: ChangeDetectorRef }], { model: [{
    type: Input
  }], componentDefinition: [{
    type: Input
  }] });
})();
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ValidationMessageComponent, { className: "ValidationMessageComponent" });
})();
var MyErrorStateMatcher = class {
  isErrorState(control, form) {
    const isSubmitted = form && form.submitted;
    return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
  }
};
var _a52;
var AbstractComponent = (_a52 = class {
  constructor(formbirdInjectorService2, changedDocumentService, componentSetupService, cdr) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.changedDocumentService = changedDocumentService;
    this.componentSetupService = componentSetupService;
    this.cdr = cdr;
    this.shouldNotifyCompInitializedInSuper = true;
    this.shouldDispatchEmptyFieldValue = true;
    this.subs = new Subscription();
    this.matcher = new MyErrorStateMatcher();
    this.broadcastService = formbirdInjectorService2.get("BroadcastService");
  }
  ngOnInit() {
    this.setupComponent();
    this.initializeFieldValue();
    this.setupChangeDetection();
    if (this.shouldNotifyCompInitializedInSuper) {
      this.notifyComponentIntialized();
    }
  }
  ngOnDestroy() {
    this.subs.unsubscribe();
  }
  setupComponent() {
    this.formControl = this.componentSetupService.setupStandardComponent(this, this.validators);
    this.setFieldActivation(false);
  }
  setupChangeDetection(avoidDebounceTime) {
    if (this.fieldName) {
      const docSub = this.changedDocumentService.watch(this.fieldName, this.document.documentId, this.registeredControlName).subscribe((fieldValue) => {
        this.onFieldValueChanged(fieldValue);
      });
      this.subs.add(docSub);
    }
    const compSub = this.changedDocumentService.watchComponentDef(this.fieldName, this.template.documentId).subscribe((compDef) => {
      this.onComponentDefChanged(compDef);
    });
    this.subs.add(compSub);
    if (this.formControl) {
      let changeSub;
      if (avoidDebounceTime) {
        changeSub = this.formControl.valueChanges.subscribe((value) => {
          this.onControlValueChanged(value);
        });
      } else {
        changeSub = this.formControl.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
          this.onControlValueChanged(value);
        });
      }
      this.subs.add(changeSub);
    }
    this.setupDocumentCreatedDetection();
  }
  setFieldActivation(shouldDetectChanges) {
    this.componentSetupService.enableField(this.componentDefinition, this.formControl);
    this.detectChanges(shouldDetectChanges);
  }
  /**
   * Call this function to dispatch the field value change action to store
   */
  valueChanged(value) {
    this.fieldValue = value;
    this.changedDocumentService.valueChanged(this, value, this.registeredControlName);
  }
  /**
   * Call this function to set the field value into store. Param isInitValue is for initializing value and does not trigger undo/redo
   */
  dispatchChanged(isInitValue) {
    const documentId = this.document.documentId;
    const documentChangedInfo = {
      documentId,
      fieldName: this.fieldName,
      newValue: this.fieldValue,
      isInitValue
    };
    this.changedDocumentService.notifyDocumentChanged(documentChangedInfo);
  }
  detectChanges(shouldDetectChange) {
    if (shouldDetectChange !== false && !this.cdr.destroyed) {
      this.cdr.detectChanges();
    }
  }
  updateComponentDefChange(componentDefinition) {
    this.componentDefinition = componentDefinition;
  }
  /**
   * This function will be called once user interacts with the control that manages the field value in the component.
   */
  onControlValueChanged(value) {
    this.valueChanged(value);
  }
  /**
   * This function will be called once the template component definition in store gets changed.
   */
  onComponentDefChanged(componentDefinition) {
    console.log("Change detection on template: ", componentDefinition.name);
    this.updateComponentDefChange(componentDefinition);
    const disabled = componentDefinition.enabled === false;
    if (this.disabled !== disabled) {
      this.disabled = disabled;
      this.setFieldActivation();
    } else {
      this.detectChanges();
    }
  }
  /**
   * This function is used to compare the newValue to the component fieldValue to check if they are the same.
   * For most components, the field value is primary types (string, number, boolean...) but some complex ones the field value type is object so the component needs to override this function to check correctly.
   * @param newValue
   * @returns true if newValue equals to the component fieldValue
   */
  isEqualFieldValue(newValue) {
    return this.fieldValue === newValue;
  }
  /**
   * This function will be called once the field value in store gets changed.
   */
  onFieldValueChanged(fieldValue, shouldDetectChanges = true) {
    if (this.isEqualFieldValue(fieldValue)) {
      return;
    }
    console.log(`On field value changed for component: ${this.registeredControlName} - has label: ${this.componentDefinition["label"]}`);
    this.fieldValue = fieldValue;
    if (this.formControl) {
      this.formControl.patchValue(this.fieldValue, { emitEvent: false, onlySelf: true });
    }
    if (shouldDetectChanges) {
      this.detectChanges();
    }
  }
  setupDocumentCreatedDetection() {
    const docCreatedSub = this.broadcastService.on(ClientConstants.DOCUMENT_NEW).subscribe((documentInfo) => {
      this.onDocumentCreated(documentInfo);
      this.detectChanges();
    });
    this.subs.add(docCreatedSub);
  }
  /**
   * This function will be called to initialize field value such as: default value... once the New Document button's clicked to create a new document.
   * @param documentInfo includes documentId and unsavedDocumentListId
   */
  onDocumentCreated(documentInfo) {
    const document2 = documentInfo?.document;
    if (document2) {
      const unsavedDocumentListId = documentInfo?.unsavedDocumentListId;
      const documentId = document2.documentId;
      if (unsavedDocumentListId === this.formParameters.unsavedDocumentListId && this.document.documentId === documentId) {
        this.fieldValue = document2[this.fieldName];
        this.initializeFieldValue();
        this.notifyComponentIntialized();
      }
    }
  }
  /**
   * This function will initialize the field value including default value if needed
   */
  initializeFieldValue() {
  }
  /**
   * notify store the component has been initialized
   */
  notifyComponentIntialized() {
    this.changedDocumentService.notifyIntializedField(this, this.shouldDispatchEmptyFieldValue);
  }
  /**
   * Notify the component definition changes to store
   */
  notifyComponentDefChanged() {
  }
}, _a52.\u0275fac = function AbstractComponent_Factory(t) {
  return new (t || _a52)(\u0275\u0275directiveInject(FormbirdInjectorService), \u0275\u0275directiveInject(ChangedDocumentService), \u0275\u0275directiveInject(ComponentSetupService), \u0275\u0275directiveInject(ChangeDetectorRef));
}, _a52.\u0275cmp = /** @pureOrBreakMyCode */
\u0275\u0275defineComponent({ type: _a52, selectors: [["ng-component"]], inputs: { document: "document", fieldValue: "fieldValue", template: "template", fieldName: "fieldName", formParameters: "formParameters", key: "key", responsiveLayouts: "responsiveLayouts", message: "message", componentDefinition: "componentDefinition" }, decls: 0, vars: 0, template: function AbstractComponent_Template(rf, ctx) {
}, encapsulation: 2 }), _a52);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractComponent, [{
    type: Component,
    args: [{
      template: ""
      // template will be overridden in child component
    }]
  }], () => [{ type: FormbirdInjectorService }, { type: ChangedDocumentService }, { type: ComponentSetupService }, { type: ChangeDetectorRef }], { document: [{
    type: Input
  }], fieldValue: [{
    type: Input
  }], template: [{
    type: Input
  }], fieldName: [{
    type: Input
  }], formParameters: [{
    type: Input
  }], key: [{
    type: Input
  }], responsiveLayouts: [{
    type: Input
  }], message: [{
    type: Input
  }], componentDefinition: [{
    type: Input
  }] });
})();
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(AbstractComponent, { className: "AbstractComponent" });
})();
var _a53;
var AbstractDocumentComponent = (_a53 = class extends AbstractComponent {
  constructor(formbirdInjectorService2, changedDocumentService, componentSetupService, cdr) {
    super(formbirdInjectorService2, changedDocumentService, componentSetupService, cdr);
    this.formbirdInjectorService = formbirdInjectorService2;
    this.changedDocumentService = changedDocumentService;
    this.componentSetupService = componentSetupService;
    this.cdr = cdr;
    this.subs = new Subscription();
  }
  ngOnInit() {
    super.ngOnInit();
    const docSub = this.changedDocumentService.watchDocument(this.document.documentId).subscribe((doc) => {
      this.document = doc;
    });
    this.subs.add(docSub);
  }
}, _a53.\u0275fac = function AbstractDocumentComponent_Factory(t) {
  return new (t || _a53)(\u0275\u0275directiveInject(FormbirdInjectorService), \u0275\u0275directiveInject(ChangedDocumentService), \u0275\u0275directiveInject(ComponentSetupService), \u0275\u0275directiveInject(ChangeDetectorRef));
}, _a53.\u0275cmp = /** @pureOrBreakMyCode */
\u0275\u0275defineComponent({ type: _a53, selectors: [["ng-component"]], features: [\u0275\u0275InheritDefinitionFeature], decls: 0, vars: 0, template: function AbstractDocumentComponent_Template(rf, ctx) {
}, encapsulation: 2 }), _a53);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AbstractDocumentComponent, [{
    type: Component,
    args: [{
      template: ""
      // template will be overridden in child component
    }]
  }], () => [{ type: FormbirdInjectorService }, { type: ChangedDocumentService }, { type: ComponentSetupService }, { type: ChangeDetectorRef }], null);
})();
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(AbstractDocumentComponent, { className: "AbstractDocumentComponent" });
})();
var _a54;
var ComponentSetupModule = (_a54 = class {
}, _a54.\u0275fac = function ComponentSetupModule_Factory(t) {
  return new (t || _a54)();
}, _a54.\u0275mod = /** @pureOrBreakMyCode */
\u0275\u0275defineNgModule({ type: _a54 }), _a54.\u0275inj = /** @pureOrBreakMyCode */
\u0275\u0275defineInjector({ providers: [ComponentSetupService], imports: [CommonModule, FormbirdServicesModule] }), _a54);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ComponentSetupModule, [{
    type: NgModule,
    args: [{
      declarations: [],
      imports: [CommonModule, FormbirdServicesModule],
      exports: [],
      providers: [ComponentSetupService]
    }]
  }], null, null);
})();
var _a55;
var ValidationMessageModule = (_a55 = class {
}, _a55.\u0275fac = function ValidationMessageModule_Factory(t) {
  return new (t || _a55)();
}, _a55.\u0275mod = /** @pureOrBreakMyCode */
\u0275\u0275defineNgModule({ type: _a55 }), _a55.\u0275inj = /** @pureOrBreakMyCode */
\u0275\u0275defineInjector({ imports: [CommonModule, MatIconModule, MatAutocompleteModule] }), _a55);
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ValidationMessageModule, [{
    type: NgModule,
    args: [{
      declarations: [ValidationMessageComponent],
      imports: [CommonModule, MatIconModule, MatAutocompleteModule],
      exports: [ValidationMessageComponent],
      providers: []
    }]
  }], null, null);
})();

// projects/formbird-mapping/src/lib/scl-util-map.service.ts
var import_lodash = __toESM(require_lodash());

// node_modules/@formbird/types/dist/lib/types/change-source.type.js
var ChangeSourceType;
(function(ChangeSourceType2) {
  ChangeSourceType2[ChangeSourceType2["COMPONENT"] = 0] = "COMPONENT";
  ChangeSourceType2[ChangeSourceType2["RULESET"] = 1] = "RULESET";
  ChangeSourceType2[ChangeSourceType2["DOCUMENT_PUSH"] = 2] = "DOCUMENT_PUSH";
})(ChangeSourceType || (ChangeSourceType = {}));

// node_modules/@formbird/types/dist/lib/constants/SharedConstants.js
var SharedConstants = class {
};
SharedConstants.APP_NAME = "Formbird";
SharedConstants.SYSTEM_TYPE_DOCUMENT = "document";
SharedConstants.SYSTEM_TYPE_VERSION = "version";
SharedConstants.SYSTEM_TYPE_TEMPLATE = "template";
SharedConstants.SYSTEM_TYPE_ACCOUNT = "account";
SharedConstants.SYSTEM_TYPE_LOGIN = "login";
SharedConstants.SYSTEM_TYPE_RULESET_DOCUMENT = "rulesetdocument";
SharedConstants.SYSTEM_TYPE_SYSTEM_ACTION = "systemaction";
SharedConstants.SYSTEM_TYPE_SCHEDULE = "schedule";
SharedConstants.SYSTEM_TYPE_FILE_REFERENCE = "fileReference";
SharedConstants.SYSTEM_TYPE_CONFIGURATION = "configuration";
SharedConstants.SYSTEM_TYPE_COMPONENT = "component";
SharedConstants.SYSTEM_TYPE_COUNTER = "counter";
SharedConstants.SYSTEM_TYPE_PASSWORD_RESET = "passwordReset";
SharedConstants.SYSTEM_TYPE_ACCOUNT_SECURITY = "accountSecurity";
SharedConstants.SYSTEM_TYPE_ACCOUNT_CONTROL = "accountControl";
SharedConstants.SYSTEM_TYPE_ACCOUNT_GROUP_CONFIG = "accountGroupConfig";
SharedConstants.SYSTEM_TYPE_PASSWORD = "password";
SharedConstants.SYSTEM_TYPE_RULESET = "ruleset";
SharedConstants.SYSTEM_TYPE_RULESET_INCLUDE = "rulesetInclude";
SharedConstants.SYSTEM_TYPE_APPLICATION = "application";
SharedConstants.SYSTEM_TYPE_VENDOR_LIBRARY = "vendorLibrary";
SharedConstants.STATUS_PENDING = "pending";
SharedConstants.STATUS_PROCESSING = "processing";
SharedConstants.STATUS_PROCESSED = "processed";
SharedConstants.STATUS_ERROR = "error";
SharedConstants.STATUS_SUCCESS = "success";
SharedConstants.STATUS_WARNING = "warning";
SharedConstants.STATUS_INFO = "info";
SharedConstants.STATUS_FORBIDDEN = "forbidden";
SharedConstants.METHOD_POST = "POST";
SharedConstants.METHOD_GET = "GET";
SharedConstants.METHOD_DELETE = "DELETE";
SharedConstants.METHOD_PUT = "PUT";
SharedConstants.DEFAULT_PAGE = 0;
SharedConstants.DEFAULT_PAGE_SIZE = 50;
SharedConstants.DEFAULT_TOTAL_ITEM = 1e4;
SharedConstants.DEFAULT_SEARCH_DELAY = 500;
SharedConstants.DEFAULT_MAX_SEARCH_QUERY_LENGTH = 2048;
SharedConstants.DEFAULT_SEARCH_SELECT_PAGE_SIZE = 5;
SharedConstants.DEFAULT_SEARCH_SELECT_PAGE = 0;
SharedConstants.FIELD_TYPE_RELATED = "Related";
SharedConstants.FIELD_TYPE_HTML = "html";
SharedConstants.FIELD_TYPE_CUSTOM = "Custom";
SharedConstants.ELASTIC_DOCUMENT_TYPE = "documents";
SharedConstants.ELASTIC_DOCUMENT_PREFIXES = {
  "mongodb": "_source"
};
SharedConstants.DEFAULT_DB_PROVIDER = "mongodb";
SharedConstants.DEFAULT_DB_CONNECTION = "default";
SharedConstants.RULESET_EVENT_NAME = "EventName";
SharedConstants.RULESET_RELATIONSHIPS = {
  PRERENDER_EVENT_NAME: {
    name: "PreRender",
    relName: "preRenderClientRuleRel"
  },
  ONLOAD_EVENT_NAME: {
    name: "OnLoad",
    relName: "onLoadClientRuleRel"
  },
  ON_RECEIVE_EVENT_NAME: {
    name: "OnReceive",
    relName: "onReceiveClientRuleRel"
  },
  ON_FIELD_CHANGE_EVENT_NAME: {
    name: "OnFieldChange",
    relName: "onFieldChangeClientRuleRel"
  },
  PRESAVE_EVENT_NAME: {
    name: "PreSave",
    relName: "preSaveClientRuleRel"
  },
  POSTSAVE_CLIENT_EVENT_NAME: {
    name: "PostSaveClient",
    relName: "postSaveClientRuleRel"
  },
  PRESAVE_SERVER_EVENT_NAME: {
    name: "PreSaveServer",
    relName: "preSaveServerRuleRel"
  },
  POSTSAVE_EVENT_NAME: {
    name: "PostSave",
    relName: "postSaveServerRuleRel"
  },
  POSTLOGIN_CLIENT_EVENT_NAME: {
    name: "PostLoginClient",
    relName: "postLoginClientRuleRel"
  },
  PRELOGOUT_CLIENT_EVENT_NAME: {
    name: "PreLogoutClient",
    relName: "preLogoutClientRuleRel"
  },
  PRELOGIN_SERVER_EVENT_NAME: {
    name: "PreLoginServerName",
    relName: "preLoginServerRuleRel"
  },
  POSTLOGIN_SERVER_EVENT_NAME: {
    name: "PostLoginServerName",
    relName: "postLoginServerRuleRel"
  },
  PRELOGOUT_SERVER_EVENT_NAME: {
    name: "PreLogoutServerName",
    relName: "preLogoutServerRuleRel"
  },
  POSTLOGOUT_SERVER_EVENT_NAME: {
    name: "PostLogoutServerName",
    relName: "postLogoutServerRuleRel"
  },
  PREDELETE_CLIENT_EVENT_NAME: {
    name: "PreDeleteClient",
    relName: "preDeleteClientRuleRel"
  }
};
SharedConstants.ONLOAD_DONE_RULES_EVENT_NAME = "OnLoadDone";
SharedConstants.ON_CHANGE_FILTER_EVENT_NAME = "OnChangeFilter";
SharedConstants.LOCATION_CHANGE_STATE_EVENT = "$locationChangeStart";
SharedConstants.UPDATE_SHOW_VALUE_EVENT = "updateShowValue";
SharedConstants.EVENT_LIST_NAME = "eventList";
SharedConstants.EVENT_VALIDATION_VALUES_NAME = "validationValues";
SharedConstants.EVENT_REFRESH_COMPONENT_NAME = "refreshComponentData";
SharedConstants.INSERT_OPERATION_TYPE = "Insert";
SharedConstants.UPDATE_OPERATION_TYPE = "Update";
SharedConstants.CSV_DOC_ID_MATCH_MERGE = "merge";
SharedConstants.CSV_DOC_ID_MATCH_REPLACE = "replace";
SharedConstants.CSV_DOC_ID_NO_MATCH_ADD = "add";
SharedConstants.CSV_DOC_ID_NO_MATCH_ERR = "error";
SharedConstants.SAVE_CLICK_OPERATION_TYPE = "SaveClick";
SharedConstants.NEW_CLICK_OPERATION_TYPE = "NewClick";
SharedConstants.PRINT_CLICK_OPERATION_TYPE = "PrintClick";
SharedConstants.MAP_CLICK_OPERATION_TYPE = "MapClick";
SharedConstants.OPERATION_TYPE_READ = "Read";
SharedConstants.OPERATION_TYPE_CREATE = "Create";
SharedConstants.OPERATION_TYPE_UPDATE = "Update";
SharedConstants.OPERATION_TYPE_DELETE = "Delete";
SharedConstants.OPERATION_TYPE_EXECUTE = "Execute";
SharedConstants.OPERATION_TYPE_OFFLINE = "Offline";
SharedConstants.ERROR_TYPE_NOACCESS = "No Access";
SharedConstants.ERROR_TYPE_NOTFOUND = "Not Found";
SharedConstants.ERROR_TYPE_INTERNAL = "Internal";
SharedConstants.ERROR_TYPE_GONE = "Gone";
SharedConstants.WEB_SOCKET_MESSAGE_TEMPLATE_DRAFT_SAVED = "template_draft_saved";
SharedConstants.WEB_SOCKET_MESSAGE_UPDATE_PREVIEW = "update_preview";
SharedConstants.WEB_SOCKET_MESSAGE_SAVE_DOCUMENT = "save_document";
SharedConstants.WEB_SOCKET_MESSAGE_PASSWORD_RESET = "password_reset";
SharedConstants.WEB_SOCKET_MESSAGE_SIGN_OUT_ALL_DEVICE = "sign_out_all_device";
SharedConstants.DIALOG_OK_OPTION = "OK";
SharedConstants.DIALOG_CANCEL_OPTION = "CANCEL";
SharedConstants.RULESET_AFFECTED_DOCUMENT_ID = "affectedDocId";
SharedConstants.RULESET_AFFECTED_TEMPLATE_ID = "affectedTplId";
SharedConstants.RULESET_AFFECTED_FIELD_NAME = "affectedFieldName";
SharedConstants.RULESET_NEW_FILTER = "newFilter";
SharedConstants.RULESET_RESULT_FLAG = "flag";
SharedConstants.RULESET_PARENT_DOCUMENT = "parentDoc";
SharedConstants.RULESET_CHILD_DOCUMENT = "childDoc";
SharedConstants.checkListSeparator = "^";
SharedConstants.DEFAULT_MESSAGE_LENGTH = 200;
SharedConstants.DEFAULT_EXPIRY_DURATION_MINUTES = 60;
SharedConstants.MAKE_CURRENT_VERSION_KEY = "makeCurrentVersion";
SharedConstants.IMPORT_PREVIOUS_VERSION = "importPreviousVersion";
SharedConstants.SEARCH_PROVIDERS = {
  ELASTIC: "elastic",
  MONGODB: "mongodb"
};
SharedConstants.DOCUMENT_FIELD_NAME_UPLOAD_FILE = "imageFileNo96";
SharedConstants.PASSWORD_RESET = "password:reset";
SharedConstants.DEFAULT_MAX_UPLOAD_SIZE = 50;
SharedConstants.SYSTEM_TYPE_QUERY = "query";

// node_modules/@formbird/shared/dist/formbird-shared.mjs
var ZI;
var Hn;
var Kn;
var RI;
var qn;
var gI;
var JQ;
var AE;
var Tn;
var On;
var YQ;
var bn;
var xg;
var IE;
var xn;
var _n;
var HA;
var Pn;
var Wn;
var jn;
var gE;
var rI;
var Zn2;
var Vn;
var Xn2;
var IA;
var zn;
var $n;
var Ao;
var mQ;
var Io;
var vQ;
var _g;
var kg;
var go;
var Hw = (() => __async(void 0, null, function* () {
  const cA = "api/", P = {};
  P.appHome = "/", P.appLogin = "/", P.appForgotPass = "forgotpass", P.appForgotPassAction = "auth/forgotpass", P.appResetPass = "resetpass", P.appResetpassAction = "auth/resetpass", P.appActivateAccount = "activateAccount", P.appActivateAccountAction = "auth/activateAccount", P.appDefault = "default", P.logout = "auth/logout", P.logoutAllDevices = "auth/logoutAllDevices", P.login = "auth/login/local", P.loginSaml = "auth/login/saml", P.loginGoogle = "auth/login/google", P.loginGoogleCallback = "auth/login/google/callback", P.loginFacebook = "auth/login/facebook", P.loginFacebookCallback = "auth/login/facebook/callback", P.loggedUser = "api/loggedUser", P.loggedUserData = "api/loggedUserData", P.loggedUserAccountControlDocument = P.loggedUser + "/accountControlDocument", P.loggedUserAccountGroupConfigDocument = P.loggedUser + "/accountGroupConfigDocument", P.testPassword = "password/test", P.publicLogin = "/auth/login/public", P.uploadFiles = cA + "uploadFiles", P.deleteFile = cA + "deleteFile", P.loadFile = cA + "getFile", P.getFile = cA + "getFile/:fileNo", P.getFileWithName = cA + "getFile/:fileNo/:fileName", P.packageImport = cA + "uploadPackage", P.packageExport = cA + "packageExport/:id", P.packageCleanUp = cA + "packageCleanUp/:type/:id", P.document = cA + "document", P.documentWithUser = cA + "document/:userId", P.documentWithUserBase = cA + "documentWithUser", P.templateAndDocument = cA + "templateAndDocument", P.templateAndDocumentId = P.templateAndDocument + "/:id", P.templateAndDocumentWithTemplateId = P.templateAndDocument + "/:id/:templateId", P.documentDeepDiffUpdate = P.document + "/deepDiffUpdate", P.documentDeepDiffUpdateSingle = P.documentDeepDiffUpdate + "/:id", P.documentExists = P.document + "/exists", P.documentExistsFull = P.documentExists + "/:id", P.documentExistsIncludeDeleted = P.documentExists + "/:id/:includeDeleted", P.documentSingle = P.document + "/:id", P.documentSingleWithUser = P.documentWithUserBase + "/:id/:userId", P.aggregate = cA + "aggregate", P.documentDestroy = P.document + "/:id", P.documentDestroyWithTemplateIdAndPreviousVersionId = P.document + "/:id/:templateId/:previousVersionId", P.documentSingleOverrideTpl = P.documentDeepDiffUpdate + "/:id/:template", P.documentDeepDiffUpdateWithUser = P.document + "/deepDiffUpdateWithUser", P.documentDeepDiffUpdateSingleWithUser = P.documentDeepDiffUpdateWithUser + "/:id/:userId", P.syncDocuments = cA + "syncDocuments", P.syncRecordsByServerUpdatedDateWithPagination = P.syncDocuments + "/:startTime/:pageNumber", P.syncDocumentsCountURL = cA + "syncDocumentsCount", P.syncDocumentsCountByDateRoute = P.syncDocumentsCountURL + "/:startTime", P.undeleteDocument = cA + "undelete/:id", P.bulkUploadDocuments = cA + "bulkUploadDocuments", P.documentAudit = cA + "documentAudit", P.indexHtml = "/index.html", P.documentSearch = cA + "documentSearch", P.documentFind = cA + "documentFind/:query", P.documentsBaseUrl = cA + "documents", P.documentsUrl = P.documentsBaseUrl + "/:query", P.documentFetch = cA + "documentFetch", P.versionFetch = cA + "versionFetch", P.loadDocsForRulesBaseUrl = cA + "documents/loadDocsForRules", P.loadDocsForRulesUrl = P.loadDocsForRulesBaseUrl + "/:userId", P.loadIncludeDocs = cA + "loadIncludeDocs", P.template = cA + "template", P.templateSingle = P.template + "/:id", P.sessionTest = cA + "sessionTest", P.serverTime = cA + "time/current", P.executeFunction = cA + "execute", P.loadComponentDoc = cA + "loadComponentDoc/:componentName", P.loadVendorLibrary = cA + "loadVendorLibrary/:name", P.loadVendorLibraries = cA + "loadVendorLibraries", P.loadClientConfig = "clientConfig", P.clientResources = cA + "clientResources", P.appVersion = cA + "getAppVersion", bn = { REST_API_WEB_BASE_PATH: cA, serverRoutes: P };
  var yI = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
  function Bo(g) {
    if (g.__esModule) return g;
    var B = g.default;
    if (typeof B == "function") {
      var Q = function t() {
        return this instanceof t ? Reflect.construct(B, arguments, this.constructor) : B.apply(this, arguments);
      };
      Q.prototype = B.prototype;
    } else Q = {};
    return Object.defineProperty(Q, "__esModule", { value: true }), Object.keys(g).forEach(function(t) {
      var n = Object.getOwnPropertyDescriptor(g, t);
      Object.defineProperty(Q, t, n.get ? n : { enumerable: true, get: function() {
        return g[t];
      } });
    }), Q;
  }
  var DB = { exports: {} };
  DB.exports, function(g, B) {
    (function() {
      var Q, t = "4.17.21", n = 200, e = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", a = "Expected a function", o = "Invalid `variable` option passed into `_.template`", u2 = "__lodash_hash_undefined__", s = 500, p = "__lodash_placeholder__", c = 1, l = 2, i2 = 4, f = 1, G = 2, F = 1, L = 2, U = 4, b = 8, S = 16, Y = 32, Z3 = 64, x = 128, iA = 256, uA = 512, RA = 30, JA = "...", BI = 800, IB = 16, sg = 1, gB = 2, Mg = 3, NI = 1 / 0, _A = 9007199254740991, BB = 17976931348623157e292, zI = 0 / 0, QI = 4294967295, bB = QI - 1, xB = QI >>> 1, _B = [["ary", x], ["bind", F], ["bindKey", L], ["curry", b], ["curryRight", S], ["flip", uA], ["partial", Y], ["partialRight", Z3], ["rearg", iA]], KI = "[object Arguments]", $I = "[object Array]", N = "[object AsyncFunction]", M = "[object Boolean]", R = "[object Date]", m = "[object DOMException]", q = "[object Error]", W = "[object Function]", H = "[object GeneratorFunction]", j = "[object Map]", $4 = "[object Number]", gA = "[object Null]", tA = "[object Object]", wA = "[object Promise]", sI = "[object Proxy]", FI = "[object RegExp]", KA = "[object Set]", CI = "[object String]", OA = "[object Symbol]", Ag = "[object Undefined]", PA = "[object WeakMap]", cg = "[object WeakSet]", ug = "[object ArrayBuffer]", Ig = "[object DataView]", UC = "[object Float32Array]", JC = "[object Float64Array]", YC = "[object Int8Array]", mC = "[object Int16Array]", vC = "[object Int32Array]", HC = "[object Uint8Array]", KC = "[object Uint8ClampedArray]", qC = "[object Uint16Array]", TC = "[object Uint32Array]", Cs = /\b__p \+= '';/g, ts = /\b(__p \+=) '' \+/g, Es = /(__e\(.*?\)|\b__t\)) \+\n'';/g, ee = /&(?:amp|lt|gt|quot|#39);/g, ie = /[&<>"']/g, es = RegExp(ee.source), is = RegExp(ie.source), ns = /<%-([\s\S]+?)%>/g, os = /<%([\s\S]+?)%>/g, ne = /<%=([\s\S]+?)%>/g, rs = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, as = /^\w*$/, ss = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, OC = /[\\^$.*+?()[\]{}|]/g, cs = RegExp(OC.source), bC = /^\s+/, us = /\s/, hs = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, ls = /\{\n\/\* \[wrapped with (.+)\] \*/, Ds = /,? & /, ps = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ws = /[()=,{}\[\]\/\s]/, fs = /\\(\\)?/g, ys = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, oe = /\w*$/, Gs = /^[-+]0x[0-9a-f]+$/i, Ns = /^0b[01]+$/i, ks = /^\[object .+?Constructor\]$/, ds = /^0o[0-7]+$/i, Ss = /^(?:0|[1-9]\d*)$/, Ms = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, PB = /($^)/, Rs = /['\n\r\u2028\u2029\\]/g, WB = "\uD800-\uDFFF", Fs = "\\u0300-\\u036f", Ls = "\\ufe20-\\ufe2f", Us = "\\u20d0-\\u20ff", re = Fs + Ls + Us, ae = "\\u2700-\\u27bf", se = "a-z\\xdf-\\xf6\\xf8-\\xff", Js = "\\xac\\xb1\\xd7\\xf7", Ys = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", ms = "\\u2000-\\u206f", vs = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", ce = "A-Z\\xc0-\\xd6\\xd8-\\xde", ue = "\\ufe0e\\ufe0f", he = Js + Ys + ms + vs, xC = "['\u2019]", Hs = "[" + WB + "]", le = "[" + he + "]", jB = "[" + re + "]", De = "\\d+", Ks = "[" + ae + "]", pe = "[" + se + "]", we = "[^" + WB + he + De + ae + se + ce + "]", _C = "\uD83C[\uDFFB-\uDFFF]", qs = "(?:" + jB + "|" + _C + ")", fe = "[^" + WB + "]", PC = "(?:\uD83C[\uDDE6-\uDDFF]){2}", WC = "[\uD800-\uDBFF][\uDC00-\uDFFF]", Rg = "[" + ce + "]", ye = "\\u200d", Ge = "(?:" + pe + "|" + we + ")", Ts = "(?:" + Rg + "|" + we + ")", Ne = "(?:" + xC + "(?:d|ll|m|re|s|t|ve))?", ke = "(?:" + xC + "(?:D|LL|M|RE|S|T|VE))?", de = qs + "?", Se = "[" + ue + "]?", Os = "(?:" + ye + "(?:" + [fe, PC, WC].join("|") + ")" + Se + de + ")*", bs = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", xs = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Me = Se + de + Os, _s = "(?:" + [Ks, PC, WC].join("|") + ")" + Me, Ps = "(?:" + [fe + jB + "?", jB, PC, WC, Hs].join("|") + ")", Ws = RegExp(xC, "g"), js = RegExp(jB, "g"), jC = RegExp(_C + "(?=" + _C + ")|" + Ps + Me, "g"), Zs = RegExp([Rg + "?" + pe + "+" + Ne + "(?=" + [le, Rg, "$"].join("|") + ")", Ts + "+" + ke + "(?=" + [le, Rg + Ge, "$"].join("|") + ")", Rg + "?" + Ge + "+" + Ne, Rg + "+" + ke, xs, bs, De, _s].join("|"), "g"), Vs = RegExp("[" + ye + WB + re + ue + "]"), Xs = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, zs = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], $s = -1, NA = {};
      NA[UC] = NA[JC] = NA[YC] = NA[mC] = NA[vC] = NA[HC] = NA[KC] = NA[qC] = NA[TC] = true, NA[KI] = NA[$I] = NA[ug] = NA[M] = NA[Ig] = NA[R] = NA[q] = NA[W] = NA[j] = NA[$4] = NA[tA] = NA[FI] = NA[KA] = NA[CI] = NA[PA] = false;
      var yA = {};
      yA[KI] = yA[$I] = yA[ug] = yA[Ig] = yA[M] = yA[R] = yA[UC] = yA[JC] = yA[YC] = yA[mC] = yA[vC] = yA[j] = yA[$4] = yA[tA] = yA[FI] = yA[KA] = yA[CI] = yA[OA] = yA[HC] = yA[KC] = yA[qC] = yA[TC] = true, yA[q] = yA[W] = yA[PA] = false;
      var Ac = { \u00C0: "A", \u00C1: "A", \u00C2: "A", \u00C3: "A", \u00C4: "A", \u00C5: "A", \u00E0: "a", \u00E1: "a", \u00E2: "a", \u00E3: "a", \u00E4: "a", \u00E5: "a", \u00C7: "C", \u00E7: "c", \u00D0: "D", \u00F0: "d", \u00C8: "E", \u00C9: "E", \u00CA: "E", \u00CB: "E", \u00E8: "e", \u00E9: "e", \u00EA: "e", \u00EB: "e", \u00CC: "I", \u00CD: "I", \u00CE: "I", \u00CF: "I", \u00EC: "i", \u00ED: "i", \u00EE: "i", \u00EF: "i", \u00D1: "N", \u00F1: "n", \u00D2: "O", \u00D3: "O", \u00D4: "O", \u00D5: "O", \u00D6: "O", \u00D8: "O", \u00F2: "o", \u00F3: "o", \u00F4: "o", \u00F5: "o", \u00F6: "o", \u00F8: "o", \u00D9: "U", \u00DA: "U", \u00DB: "U", \u00DC: "U", \u00F9: "u", \u00FA: "u", \u00FB: "u", \u00FC: "u", \u00DD: "Y", \u00FD: "y", \u00FF: "y", \u00C6: "Ae", \u00E6: "ae", \u00DE: "Th", \u00FE: "th", \u00DF: "ss", \u0100: "A", \u0102: "A", \u0104: "A", \u0101: "a", \u0103: "a", \u0105: "a", \u0106: "C", \u0108: "C", \u010A: "C", \u010C: "C", \u0107: "c", \u0109: "c", \u010B: "c", \u010D: "c", \u010E: "D", \u0110: "D", \u010F: "d", \u0111: "d", \u0112: "E", \u0114: "E", \u0116: "E", \u0118: "E", \u011A: "E", \u0113: "e", \u0115: "e", \u0117: "e", \u0119: "e", \u011B: "e", \u011C: "G", \u011E: "G", \u0120: "G", \u0122: "G", \u011D: "g", \u011F: "g", \u0121: "g", \u0123: "g", \u0124: "H", \u0126: "H", \u0125: "h", \u0127: "h", \u0128: "I", \u012A: "I", \u012C: "I", \u012E: "I", \u0130: "I", \u0129: "i", \u012B: "i", \u012D: "i", \u012F: "i", \u0131: "i", \u0134: "J", \u0135: "j", \u0136: "K", \u0137: "k", \u0138: "k", \u0139: "L", \u013B: "L", \u013D: "L", \u013F: "L", \u0141: "L", \u013A: "l", \u013C: "l", \u013E: "l", \u0140: "l", \u0142: "l", \u0143: "N", \u0145: "N", \u0147: "N", \u014A: "N", \u0144: "n", \u0146: "n", \u0148: "n", \u014B: "n", \u014C: "O", \u014E: "O", \u0150: "O", \u014D: "o", \u014F: "o", \u0151: "o", \u0154: "R", \u0156: "R", \u0158: "R", \u0155: "r", \u0157: "r", \u0159: "r", \u015A: "S", \u015C: "S", \u015E: "S", \u0160: "S", \u015B: "s", \u015D: "s", \u015F: "s", \u0161: "s", \u0162: "T", \u0164: "T", \u0166: "T", \u0163: "t", \u0165: "t", \u0167: "t", \u0168: "U", \u016A: "U", \u016C: "U", \u016E: "U", \u0170: "U", \u0172: "U", \u0169: "u", \u016B: "u", \u016D: "u", \u016F: "u", \u0171: "u", \u0173: "u", \u0174: "W", \u0175: "w", \u0176: "Y", \u0177: "y", \u0178: "Y", \u0179: "Z", \u017B: "Z", \u017D: "Z", \u017A: "z", \u017C: "z", \u017E: "z", \u0132: "IJ", \u0133: "ij", \u0152: "Oe", \u0153: "oe", \u0149: "'n", \u017F: "s" }, Ic = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, gc = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'" }, Bc = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Qc = parseFloat, Cc = parseInt, Re = typeof yI == "object" && yI && yI.Object === Object && yI, tc = typeof self == "object" && self && self.Object === Object && self, bA = Re || tc || Function("return this")(), ZC = B && !B.nodeType && B, hg = ZC && true && g && !g.nodeType && g, Fe = hg && hg.exports === ZC, VC = Fe && Re.process, cI = function() {
        try {
          var k = hg && hg.require && hg.require("util").types;
          return k || VC && VC.binding && VC.binding("util");
        } catch {
        }
      }(), Le = cI && cI.isArrayBuffer, Ue = cI && cI.isDate, Je = cI && cI.isMap, Ye = cI && cI.isRegExp, me = cI && cI.isSet, ve = cI && cI.isTypedArray;
      function tI(k, v, J) {
        switch (J.length) {
          case 0:
            return k.call(v);
          case 1:
            return k.call(v, J[0]);
          case 2:
            return k.call(v, J[0], J[1]);
          case 3:
            return k.call(v, J[0], J[1], J[2]);
        }
        return k.apply(v, J);
      }
      function Ec(k, v, J, X) {
        for (var EA = -1, lA = k == null ? 0 : k.length; ++EA < lA; ) {
          var mA = k[EA];
          v(X, mA, J(mA), k);
        }
        return X;
      }
      function uI(k, v) {
        for (var J = -1, X = k == null ? 0 : k.length; ++J < X && v(k[J], J, k) !== false; ) ;
        return k;
      }
      function ec(k, v) {
        for (var J = k == null ? 0 : k.length; J-- && v(k[J], J, k) !== false; ) ;
        return k;
      }
      function He(k, v) {
        for (var J = -1, X = k == null ? 0 : k.length; ++J < X; ) if (!v(k[J], J, k)) return false;
        return true;
      }
      function gg(k, v) {
        for (var J = -1, X = k == null ? 0 : k.length, EA = 0, lA = []; ++J < X; ) {
          var mA = k[J];
          v(mA, J, k) && (lA[EA++] = mA);
        }
        return lA;
      }
      function ZB(k, v) {
        var J = k == null ? 0 : k.length;
        return !!J && Fg(k, v, 0) > -1;
      }
      function XC(k, v, J) {
        for (var X = -1, EA = k == null ? 0 : k.length; ++X < EA; ) if (J(v, k[X])) return true;
        return false;
      }
      function kA(k, v) {
        for (var J = -1, X = k == null ? 0 : k.length, EA = Array(X); ++J < X; ) EA[J] = v(k[J], J, k);
        return EA;
      }
      function Bg(k, v) {
        for (var J = -1, X = v.length, EA = k.length; ++J < X; ) k[EA + J] = v[J];
        return k;
      }
      function zC(k, v, J, X) {
        var EA = -1, lA = k == null ? 0 : k.length;
        for (X && lA && (J = k[++EA]); ++EA < lA; ) J = v(J, k[EA], EA, k);
        return J;
      }
      function ic(k, v, J, X) {
        var EA = k == null ? 0 : k.length;
        for (X && EA && (J = k[--EA]); EA--; ) J = v(J, k[EA], EA, k);
        return J;
      }
      function $C(k, v) {
        for (var J = -1, X = k == null ? 0 : k.length; ++J < X; ) if (v(k[J], J, k)) return true;
        return false;
      }
      var nc = At3("length");
      function oc(k) {
        return k.split("");
      }
      function rc(k) {
        return k.match(ps) || [];
      }
      function Ke(k, v, J) {
        var X;
        return J(k, function(EA, lA, mA) {
          if (v(EA, lA, mA)) return X = lA, false;
        }), X;
      }
      function VB(k, v, J, X) {
        for (var EA = k.length, lA = J + (X ? 1 : -1); X ? lA-- : ++lA < EA; ) if (v(k[lA], lA, k)) return lA;
        return -1;
      }
      function Fg(k, v, J) {
        return v === v ? Gc(k, v, J) : VB(k, qe, J);
      }
      function ac(k, v, J, X) {
        for (var EA = J - 1, lA = k.length; ++EA < lA; ) if (X(k[EA], v)) return EA;
        return -1;
      }
      function qe(k) {
        return k !== k;
      }
      function Te(k, v) {
        var J = k == null ? 0 : k.length;
        return J ? gt2(k, v) / J : zI;
      }
      function At3(k) {
        return function(v) {
          return v == null ? Q : v[k];
        };
      }
      function It(k) {
        return function(v) {
          return k == null ? Q : k[v];
        };
      }
      function Oe(k, v, J, X, EA) {
        return EA(k, function(lA, mA, fA) {
          J = X ? (X = false, lA) : v(J, lA, mA, fA);
        }), J;
      }
      function sc(k, v) {
        var J = k.length;
        for (k.sort(v); J--; ) k[J] = k[J].value;
        return k;
      }
      function gt2(k, v) {
        for (var J, X = -1, EA = k.length; ++X < EA; ) {
          var lA = v(k[X]);
          lA !== Q && (J = J === Q ? lA : J + lA);
        }
        return J;
      }
      function Bt(k, v) {
        for (var J = -1, X = Array(k); ++J < k; ) X[J] = v(J);
        return X;
      }
      function cc(k, v) {
        return kA(v, function(J) {
          return [J, k[J]];
        });
      }
      function be(k) {
        return k && k.slice(0, We(k) + 1).replace(bC, "");
      }
      function EI(k) {
        return function(v) {
          return k(v);
        };
      }
      function Qt(k, v) {
        return kA(v, function(J) {
          return k[J];
        });
      }
      function QB(k, v) {
        return k.has(v);
      }
      function xe(k, v) {
        for (var J = -1, X = k.length; ++J < X && Fg(v, k[J], 0) > -1; ) ;
        return J;
      }
      function _e(k, v) {
        for (var J = k.length; J-- && Fg(v, k[J], 0) > -1; ) ;
        return J;
      }
      function uc(k, v) {
        for (var J = k.length, X = 0; J--; ) k[J] === v && ++X;
        return X;
      }
      var hc = It(Ac), lc = It(Ic);
      function Dc(k) {
        return "\\" + Bc[k];
      }
      function pc(k, v) {
        return k == null ? Q : k[v];
      }
      function Lg(k) {
        return Vs.test(k);
      }
      function wc(k) {
        return Xs.test(k);
      }
      function fc(k) {
        for (var v, J = []; !(v = k.next()).done; ) J.push(v.value);
        return J;
      }
      function Ct(k) {
        var v = -1, J = Array(k.size);
        return k.forEach(function(X, EA) {
          J[++v] = [EA, X];
        }), J;
      }
      function Pe(k, v) {
        return function(J) {
          return k(v(J));
        };
      }
      function Qg(k, v) {
        for (var J = -1, X = k.length, EA = 0, lA = []; ++J < X; ) {
          var mA = k[J];
          (mA === v || mA === p) && (k[J] = p, lA[EA++] = J);
        }
        return lA;
      }
      function XB(k) {
        var v = -1, J = Array(k.size);
        return k.forEach(function(X) {
          J[++v] = X;
        }), J;
      }
      function yc(k) {
        var v = -1, J = Array(k.size);
        return k.forEach(function(X) {
          J[++v] = [X, X];
        }), J;
      }
      function Gc(k, v, J) {
        for (var X = J - 1, EA = k.length; ++X < EA; ) if (k[X] === v) return X;
        return -1;
      }
      function Nc(k, v, J) {
        for (var X = J + 1; X--; ) if (k[X] === v) return X;
        return X;
      }
      function Ug(k) {
        return Lg(k) ? dc(k) : nc(k);
      }
      function kI(k) {
        return Lg(k) ? Sc(k) : oc(k);
      }
      function We(k) {
        for (var v = k.length; v-- && us.test(k.charAt(v)); ) ;
        return v;
      }
      var kc = It(gc);
      function dc(k) {
        for (var v = jC.lastIndex = 0; jC.test(k); ) ++v;
        return v;
      }
      function Sc(k) {
        return k.match(jC) || [];
      }
      function Mc(k) {
        return k.match(Zs) || [];
      }
      var Rc = function k(v) {
        v = v == null ? bA : Jg.defaults(bA.Object(), v, Jg.pick(bA, zs));
        var J = v.Array, X = v.Date, EA = v.Error, lA = v.Function, mA = v.Math, fA = v.Object, tt = v.RegExp, Fc = v.String, hI = v.TypeError, zB = J.prototype, Lc = lA.prototype, Yg = fA.prototype, $B = v["__core-js_shared__"], AQ = Lc.toString, pA = Yg.hasOwnProperty, Uc = 0, je = function() {
          var A3 = /[^.]+$/.exec($B && $B.keys && $B.keys.IE_PROTO || "");
          return A3 ? "Symbol(src)_1." + A3 : "";
        }(), IQ = Yg.toString, Jc = AQ.call(fA), Yc = bA._, mc = tt("^" + AQ.call(pA).replace(OC, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), gQ = Fe ? v.Buffer : Q, Cg = v.Symbol, BQ = v.Uint8Array, Ze = gQ ? gQ.allocUnsafe : Q, QQ = Pe(fA.getPrototypeOf, fA), Ve = fA.create, Xe = Yg.propertyIsEnumerable, CQ = zB.splice, ze = Cg ? Cg.isConcatSpreadable : Q, CB = Cg ? Cg.iterator : Q, lg = Cg ? Cg.toStringTag : Q, tQ = function() {
          try {
            var A3 = yg(fA, "defineProperty");
            return A3({}, "", {}), A3;
          } catch {
          }
        }(), vc = v.clearTimeout !== bA.clearTimeout && v.clearTimeout, Hc = X && X.now !== bA.Date.now && X.now, Kc = v.setTimeout !== bA.setTimeout && v.setTimeout, EQ = mA.ceil, eQ = mA.floor, Et = fA.getOwnPropertySymbols, qc = gQ ? gQ.isBuffer : Q, $e = v.isFinite, Tc = zB.join, Oc = Pe(fA.keys, fA), vA = mA.max, WA = mA.min, bc = X.now, xc = v.parseInt, Ai = mA.random, _c = zB.reverse, et = yg(v, "DataView"), tB = yg(v, "Map"), it = yg(v, "Promise"), mg = yg(v, "Set"), EB = yg(v, "WeakMap"), eB = yg(fA, "create"), iQ = EB && new EB(), vg = {}, Pc = Gg(et), Wc = Gg(tB), jc = Gg(it), Zc = Gg(mg), Vc = Gg(EB), nQ = Cg ? Cg.prototype : Q, iB = nQ ? nQ.valueOf : Q, Ii = nQ ? nQ.toString : Q;
        function h(A3) {
          if (FA(A3) && !eA(A3) && !(A3 instanceof sA)) {
            if (A3 instanceof lI) return A3;
            if (pA.call(A3, "__wrapped__")) return gn(A3);
          }
          return new lI(A3);
        }
        var Hg = /* @__PURE__ */ function() {
          function A3() {
          }
          return function(I2) {
            if (!SA(I2)) return {};
            if (Ve) return Ve(I2);
            A3.prototype = I2;
            var C = new A3();
            return A3.prototype = Q, C;
          };
        }();
        function oQ() {
        }
        function lI(A3, I2) {
          this.__wrapped__ = A3, this.__actions__ = [], this.__chain__ = !!I2, this.__index__ = 0, this.__values__ = Q;
        }
        h.templateSettings = { escape: ns, evaluate: os, interpolate: ne, variable: "", imports: { _: h } }, h.prototype = oQ.prototype, h.prototype.constructor = h, lI.prototype = Hg(oQ.prototype), lI.prototype.constructor = lI;
        function sA(A3) {
          this.__wrapped__ = A3, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = QI, this.__views__ = [];
        }
        function Xc() {
          var A3 = new sA(this.__wrapped__);
          return A3.__actions__ = zA(this.__actions__), A3.__dir__ = this.__dir__, A3.__filtered__ = this.__filtered__, A3.__iteratees__ = zA(this.__iteratees__), A3.__takeCount__ = this.__takeCount__, A3.__views__ = zA(this.__views__), A3;
        }
        function zc() {
          if (this.__filtered__) {
            var A3 = new sA(this);
            A3.__dir__ = -1, A3.__filtered__ = true;
          } else A3 = this.clone(), A3.__dir__ *= -1;
          return A3;
        }
        function $c() {
          var A3 = this.__wrapped__.value(), I2 = this.__dir__, C = eA(A3), E = I2 < 0, r = C ? A3.length : 0, D = oh(0, r, this.__views__), w = D.start, y = D.end, d = y - w, T = E ? y : w - 1, O2 = this.__iteratees__, _ = O2.length, V2 = 0, z = WA(d, this.__takeCount__);
          if (!C || !E && r == d && z == d) return Ni(A3, this.__actions__);
          var QA = [];
          A: for (; d-- && V2 < z; ) {
            T += I2;
            for (var oA = -1, CA = A3[T]; ++oA < _; ) {
              var aA = O2[oA], hA = aA.iteratee, nI = aA.type, XA = hA(CA);
              if (nI == gB) CA = XA;
              else if (!XA) {
                if (nI == sg) continue A;
                break A;
              }
            }
            QA[V2++] = CA;
          }
          return QA;
        }
        sA.prototype = Hg(oQ.prototype), sA.prototype.constructor = sA;
        function Dg(A3) {
          var I2 = -1, C = A3 == null ? 0 : A3.length;
          for (this.clear(); ++I2 < C; ) {
            var E = A3[I2];
            this.set(E[0], E[1]);
          }
        }
        function Au() {
          this.__data__ = eB ? eB(null) : {}, this.size = 0;
        }
        function Iu(A3) {
          var I2 = this.has(A3) && delete this.__data__[A3];
          return this.size -= I2 ? 1 : 0, I2;
        }
        function gu(A3) {
          var I2 = this.__data__;
          if (eB) {
            var C = I2[A3];
            return C === u2 ? Q : C;
          }
          return pA.call(I2, A3) ? I2[A3] : Q;
        }
        function Bu(A3) {
          var I2 = this.__data__;
          return eB ? I2[A3] !== Q : pA.call(I2, A3);
        }
        function Qu(A3, I2) {
          var C = this.__data__;
          return this.size += this.has(A3) ? 0 : 1, C[A3] = eB && I2 === Q ? u2 : I2, this;
        }
        Dg.prototype.clear = Au, Dg.prototype.delete = Iu, Dg.prototype.get = gu, Dg.prototype.has = Bu, Dg.prototype.set = Qu;
        function qI(A3) {
          var I2 = -1, C = A3 == null ? 0 : A3.length;
          for (this.clear(); ++I2 < C; ) {
            var E = A3[I2];
            this.set(E[0], E[1]);
          }
        }
        function Cu() {
          this.__data__ = [], this.size = 0;
        }
        function tu(A3) {
          var I2 = this.__data__, C = rQ(I2, A3);
          if (C < 0) return false;
          var E = I2.length - 1;
          return C == E ? I2.pop() : CQ.call(I2, C, 1), --this.size, true;
        }
        function Eu(A3) {
          var I2 = this.__data__, C = rQ(I2, A3);
          return C < 0 ? Q : I2[C][1];
        }
        function eu(A3) {
          return rQ(this.__data__, A3) > -1;
        }
        function iu(A3, I2) {
          var C = this.__data__, E = rQ(C, A3);
          return E < 0 ? (++this.size, C.push([A3, I2])) : C[E][1] = I2, this;
        }
        qI.prototype.clear = Cu, qI.prototype.delete = tu, qI.prototype.get = Eu, qI.prototype.has = eu, qI.prototype.set = iu;
        function TI(A3) {
          var I2 = -1, C = A3 == null ? 0 : A3.length;
          for (this.clear(); ++I2 < C; ) {
            var E = A3[I2];
            this.set(E[0], E[1]);
          }
        }
        function nu() {
          this.size = 0, this.__data__ = { hash: new Dg(), map: new (tB || qI)(), string: new Dg() };
        }
        function ou(A3) {
          var I2 = GQ(this, A3).delete(A3);
          return this.size -= I2 ? 1 : 0, I2;
        }
        function ru(A3) {
          return GQ(this, A3).get(A3);
        }
        function au(A3) {
          return GQ(this, A3).has(A3);
        }
        function su(A3, I2) {
          var C = GQ(this, A3), E = C.size;
          return C.set(A3, I2), this.size += C.size == E ? 0 : 1, this;
        }
        TI.prototype.clear = nu, TI.prototype.delete = ou, TI.prototype.get = ru, TI.prototype.has = au, TI.prototype.set = su;
        function pg(A3) {
          var I2 = -1, C = A3 == null ? 0 : A3.length;
          for (this.__data__ = new TI(); ++I2 < C; ) this.add(A3[I2]);
        }
        function cu(A3) {
          return this.__data__.set(A3, u2), this;
        }
        function uu(A3) {
          return this.__data__.has(A3);
        }
        pg.prototype.add = pg.prototype.push = cu, pg.prototype.has = uu;
        function dI(A3) {
          var I2 = this.__data__ = new qI(A3);
          this.size = I2.size;
        }
        function hu() {
          this.__data__ = new qI(), this.size = 0;
        }
        function lu(A3) {
          var I2 = this.__data__, C = I2.delete(A3);
          return this.size = I2.size, C;
        }
        function Du(A3) {
          return this.__data__.get(A3);
        }
        function pu(A3) {
          return this.__data__.has(A3);
        }
        function wu(A3, I2) {
          var C = this.__data__;
          if (C instanceof qI) {
            var E = C.__data__;
            if (!tB || E.length < n - 1) return E.push([A3, I2]), this.size = ++C.size, this;
            C = this.__data__ = new TI(E);
          }
          return C.set(A3, I2), this.size = C.size, this;
        }
        dI.prototype.clear = hu, dI.prototype.delete = lu, dI.prototype.get = Du, dI.prototype.has = pu, dI.prototype.set = wu;
        function gi(A3, I2) {
          var C = eA(A3), E = !C && Ng(A3), r = !C && !E && ng(A3), D = !C && !E && !r && Og(A3), w = C || E || r || D, y = w ? Bt(A3.length, Fc) : [], d = y.length;
          for (var T in A3) (I2 || pA.call(A3, T)) && !(w && (T == "length" || r && (T == "offset" || T == "parent") || D && (T == "buffer" || T == "byteLength" || T == "byteOffset") || _I(T, d))) && y.push(T);
          return y;
        }
        function Bi(A3) {
          var I2 = A3.length;
          return I2 ? A3[pt(0, I2 - 1)] : Q;
        }
        function fu(A3, I2) {
          return NQ(zA(A3), wg(I2, 0, A3.length));
        }
        function yu(A3) {
          return NQ(zA(A3));
        }
        function nt(A3, I2, C) {
          (C !== Q && !SI(A3[I2], C) || C === Q && !(I2 in A3)) && OI(A3, I2, C);
        }
        function nB(A3, I2, C) {
          var E = A3[I2];
          (!(pA.call(A3, I2) && SI(E, C)) || C === Q && !(I2 in A3)) && OI(A3, I2, C);
        }
        function rQ(A3, I2) {
          for (var C = A3.length; C--; ) if (SI(A3[C][0], I2)) return C;
          return -1;
        }
        function Gu(A3, I2, C, E) {
          return tg(A3, function(r, D, w) {
            I2(E, r, C(r), w);
          }), E;
        }
        function Qi(A3, I2) {
          return A3 && UI(I2, qA(I2), A3);
        }
        function Nu(A3, I2) {
          return A3 && UI(I2, AI(I2), A3);
        }
        function OI(A3, I2, C) {
          I2 == "__proto__" && tQ ? tQ(A3, I2, { configurable: true, enumerable: true, value: C, writable: true }) : A3[I2] = C;
        }
        function ot(A3, I2) {
          for (var C = -1, E = I2.length, r = J(E), D = A3 == null; ++C < E; ) r[C] = D ? Q : _t(A3, I2[C]);
          return r;
        }
        function wg(A3, I2, C) {
          return A3 === A3 && (C !== Q && (A3 = A3 <= C ? A3 : C), I2 !== Q && (A3 = A3 >= I2 ? A3 : I2)), A3;
        }
        function DI(A3, I2, C, E, r, D) {
          var w, y = I2 & c, d = I2 & l, T = I2 & i2;
          if (C && (w = r ? C(A3, E, r, D) : C(A3)), w !== Q) return w;
          if (!SA(A3)) return A3;
          var O2 = eA(A3);
          if (O2) {
            if (w = ah(A3), !y) return zA(A3, w);
          } else {
            var _ = jA(A3), V2 = _ == W || _ == H;
            if (ng(A3)) return Si(A3, y);
            if (_ == tA || _ == KI || V2 && !r) {
              if (w = d || V2 ? {} : Wi(A3), !y) return d ? gh(A3, Nu(w, A3)) : Ih(A3, Qi(w, A3));
            } else {
              if (!yA[_]) return r ? A3 : {};
              w = sh(A3, _, y);
            }
          }
          D || (D = new dI());
          var z = D.get(A3);
          if (z) return z;
          D.set(A3, w), yn(A3) ? A3.forEach(function(CA) {
            w.add(DI(CA, I2, C, CA, A3, D));
          }) : wn(A3) && A3.forEach(function(CA, aA) {
            w.set(aA, DI(CA, I2, C, aA, A3, D));
          });
          var QA = T ? d ? Ft : Rt : d ? AI : qA, oA = O2 ? Q : QA(A3);
          return uI(oA || A3, function(CA, aA) {
            oA && (aA = CA, CA = A3[aA]), nB(w, aA, DI(CA, I2, C, aA, A3, D));
          }), w;
        }
        function ku(A3) {
          var I2 = qA(A3);
          return function(C) {
            return Ci(C, A3, I2);
          };
        }
        function Ci(A3, I2, C) {
          var E = C.length;
          if (A3 == null) return !E;
          for (A3 = fA(A3); E--; ) {
            var r = C[E], D = I2[r], w = A3[r];
            if (w === Q && !(r in A3) || !D(w)) return false;
          }
          return true;
        }
        function ti(A3, I2, C) {
          if (typeof A3 != "function") throw new hI(a);
          return hB(function() {
            A3.apply(Q, C);
          }, I2);
        }
        function oB(A3, I2, C, E) {
          var r = -1, D = ZB, w = true, y = A3.length, d = [], T = I2.length;
          if (!y) return d;
          C && (I2 = kA(I2, EI(C))), E ? (D = XC, w = false) : I2.length >= n && (D = QB, w = false, I2 = new pg(I2));
          A: for (; ++r < y; ) {
            var O2 = A3[r], _ = C == null ? O2 : C(O2);
            if (O2 = E || O2 !== 0 ? O2 : 0, w && _ === _) {
              for (var V2 = T; V2--; ) if (I2[V2] === _) continue A;
              d.push(O2);
            } else D(I2, _, E) || d.push(O2);
          }
          return d;
        }
        var tg = Ui(LI), Ei = Ui(at, true);
        function du(A3, I2) {
          var C = true;
          return tg(A3, function(E, r, D) {
            return C = !!I2(E, r, D), C;
          }), C;
        }
        function aQ(A3, I2, C) {
          for (var E = -1, r = A3.length; ++E < r; ) {
            var D = A3[E], w = I2(D);
            if (w != null && (y === Q ? w === w && !iI(w) : C(w, y))) var y = w, d = D;
          }
          return d;
        }
        function Su(A3, I2, C, E) {
          var r = A3.length;
          for (C = nA(C), C < 0 && (C = -C > r ? 0 : r + C), E = E === Q || E > r ? r : nA(E), E < 0 && (E += r), E = C > E ? 0 : Nn(E); C < E; ) A3[C++] = I2;
          return A3;
        }
        function ei(A3, I2) {
          var C = [];
          return tg(A3, function(E, r, D) {
            I2(E, r, D) && C.push(E);
          }), C;
        }
        function xA(A3, I2, C, E, r) {
          var D = -1, w = A3.length;
          for (C || (C = uh), r || (r = []); ++D < w; ) {
            var y = A3[D];
            I2 > 0 && C(y) ? I2 > 1 ? xA(y, I2 - 1, C, E, r) : Bg(r, y) : E || (r[r.length] = y);
          }
          return r;
        }
        var rt = Ji(), ii = Ji(true);
        function LI(A3, I2) {
          return A3 && rt(A3, I2, qA);
        }
        function at(A3, I2) {
          return A3 && ii(A3, I2, qA);
        }
        function sQ(A3, I2) {
          return gg(I2, function(C) {
            return PI(A3[C]);
          });
        }
        function fg(A3, I2) {
          I2 = eg(I2, A3);
          for (var C = 0, E = I2.length; A3 != null && C < E; ) A3 = A3[JI(I2[C++])];
          return C && C == E ? A3 : Q;
        }
        function ni(A3, I2, C) {
          var E = I2(A3);
          return eA(A3) ? E : Bg(E, C(A3));
        }
        function ZA(A3) {
          return A3 == null ? A3 === Q ? Ag : gA : lg && lg in fA(A3) ? nh(A3) : yh(A3);
        }
        function st(A3, I2) {
          return A3 > I2;
        }
        function Mu(A3, I2) {
          return A3 != null && pA.call(A3, I2);
        }
        function Ru(A3, I2) {
          return A3 != null && I2 in fA(A3);
        }
        function Fu(A3, I2, C) {
          return A3 >= WA(I2, C) && A3 < vA(I2, C);
        }
        function ct(A3, I2, C) {
          for (var E = C ? XC : ZB, r = A3[0].length, D = A3.length, w = D, y = J(D), d = 1 / 0, T = []; w--; ) {
            var O2 = A3[w];
            w && I2 && (O2 = kA(O2, EI(I2))), d = WA(O2.length, d), y[w] = !C && (I2 || r >= 120 && O2.length >= 120) ? new pg(w && O2) : Q;
          }
          O2 = A3[0];
          var _ = -1, V2 = y[0];
          A: for (; ++_ < r && T.length < d; ) {
            var z = O2[_], QA = I2 ? I2(z) : z;
            if (z = C || z !== 0 ? z : 0, !(V2 ? QB(V2, QA) : E(T, QA, C))) {
              for (w = D; --w; ) {
                var oA = y[w];
                if (!(oA ? QB(oA, QA) : E(A3[w], QA, C))) continue A;
              }
              V2 && V2.push(QA), T.push(z);
            }
          }
          return T;
        }
        function Lu(A3, I2, C, E) {
          return LI(A3, function(r, D, w) {
            I2(E, C(r), D, w);
          }), E;
        }
        function rB(A3, I2, C) {
          I2 = eg(I2, A3), A3 = Xi(A3, I2);
          var E = A3 == null ? A3 : A3[JI(wI(I2))];
          return E == null ? Q : tI(E, A3, C);
        }
        function oi(A3) {
          return FA(A3) && ZA(A3) == KI;
        }
        function Uu(A3) {
          return FA(A3) && ZA(A3) == ug;
        }
        function Ju(A3) {
          return FA(A3) && ZA(A3) == R;
        }
        function aB(A3, I2, C, E, r) {
          return A3 === I2 ? true : A3 == null || I2 == null || !FA(A3) && !FA(I2) ? A3 !== A3 && I2 !== I2 : Yu(A3, I2, C, E, aB, r);
        }
        function Yu(A3, I2, C, E, r, D) {
          var w = eA(A3), y = eA(I2), d = w ? $I : jA(A3), T = y ? $I : jA(I2);
          d = d == KI ? tA : d, T = T == KI ? tA : T;
          var O2 = d == tA, _ = T == tA, V2 = d == T;
          if (V2 && ng(A3)) {
            if (!ng(I2)) return false;
            w = true, O2 = false;
          }
          if (V2 && !O2) return D || (D = new dI()), w || Og(A3) ? xi(A3, I2, C, E, r, D) : eh(A3, I2, d, C, E, r, D);
          if (!(C & f)) {
            var z = O2 && pA.call(A3, "__wrapped__"), QA = _ && pA.call(I2, "__wrapped__");
            if (z || QA) {
              var oA = z ? A3.value() : A3, CA = QA ? I2.value() : I2;
              return D || (D = new dI()), r(oA, CA, C, E, D);
            }
          }
          return V2 ? (D || (D = new dI()), ih(A3, I2, C, E, r, D)) : false;
        }
        function mu(A3) {
          return FA(A3) && jA(A3) == j;
        }
        function ut(A3, I2, C, E) {
          var r = C.length, D = r, w = !E;
          if (A3 == null) return !D;
          for (A3 = fA(A3); r--; ) {
            var y = C[r];
            if (w && y[2] ? y[1] !== A3[y[0]] : !(y[0] in A3)) return false;
          }
          for (; ++r < D; ) {
            y = C[r];
            var d = y[0], T = A3[d], O2 = y[1];
            if (w && y[2]) {
              if (T === Q && !(d in A3)) return false;
            } else {
              var _ = new dI();
              if (E) var V2 = E(T, O2, d, A3, I2, _);
              if (!(V2 === Q ? aB(O2, T, f | G, E, _) : V2)) return false;
            }
          }
          return true;
        }
        function ri(A3) {
          if (!SA(A3) || lh(A3)) return false;
          var I2 = PI(A3) ? mc : ks;
          return I2.test(Gg(A3));
        }
        function vu(A3) {
          return FA(A3) && ZA(A3) == FI;
        }
        function Hu(A3) {
          return FA(A3) && jA(A3) == KA;
        }
        function Ku(A3) {
          return FA(A3) && FQ(A3.length) && !!NA[ZA(A3)];
        }
        function ai(A3) {
          return typeof A3 == "function" ? A3 : A3 == null ? II : typeof A3 == "object" ? eA(A3) ? ui(A3[0], A3[1]) : ci(A3) : mn(A3);
        }
        function ht(A3) {
          if (!uB(A3)) return Oc(A3);
          var I2 = [];
          for (var C in fA(A3)) pA.call(A3, C) && C != "constructor" && I2.push(C);
          return I2;
        }
        function qu(A3) {
          if (!SA(A3)) return fh(A3);
          var I2 = uB(A3), C = [];
          for (var E in A3) E == "constructor" && (I2 || !pA.call(A3, E)) || C.push(E);
          return C;
        }
        function lt2(A3, I2) {
          return A3 < I2;
        }
        function si(A3, I2) {
          var C = -1, E = $A(A3) ? J(A3.length) : [];
          return tg(A3, function(r, D, w) {
            E[++C] = I2(r, D, w);
          }), E;
        }
        function ci(A3) {
          var I2 = Ut(A3);
          return I2.length == 1 && I2[0][2] ? Zi(I2[0][0], I2[0][1]) : function(C) {
            return C === A3 || ut(C, A3, I2);
          };
        }
        function ui(A3, I2) {
          return Yt(A3) && ji(I2) ? Zi(JI(A3), I2) : function(C) {
            var E = _t(C, A3);
            return E === Q && E === I2 ? Pt(C, A3) : aB(I2, E, f | G);
          };
        }
        function cQ(A3, I2, C, E, r) {
          A3 !== I2 && rt(I2, function(D, w) {
            if (r || (r = new dI()), SA(D)) Tu(A3, I2, w, C, cQ, E, r);
            else {
              var y = E ? E(vt(A3, w), D, w + "", A3, I2, r) : Q;
              y === Q && (y = D), nt(A3, w, y);
            }
          }, AI);
        }
        function Tu(A3, I2, C, E, r, D, w) {
          var y = vt(A3, C), d = vt(I2, C), T = w.get(d);
          if (T) {
            nt(A3, C, T);
            return;
          }
          var O2 = D ? D(y, d, C + "", A3, I2, w) : Q, _ = O2 === Q;
          if (_) {
            var V2 = eA(d), z = !V2 && ng(d), QA = !V2 && !z && Og(d);
            O2 = d, V2 || z || QA ? eA(y) ? O2 = y : LA(y) ? O2 = zA(y) : z ? (_ = false, O2 = Si(d, true)) : QA ? (_ = false, O2 = Mi(d, true)) : O2 = [] : lB(d) || Ng(d) ? (O2 = y, Ng(y) ? O2 = kn(y) : (!SA(y) || PI(y)) && (O2 = Wi(d))) : _ = false;
          }
          _ && (w.set(d, O2), r(O2, d, E, D, w), w.delete(d)), nt(A3, C, O2);
        }
        function hi(A3, I2) {
          var C = A3.length;
          if (C) return I2 += I2 < 0 ? C : 0, _I(I2, C) ? A3[I2] : Q;
        }
        function li(A3, I2, C) {
          I2.length ? I2 = kA(I2, function(D) {
            return eA(D) ? function(w) {
              return fg(w, D.length === 1 ? D[0] : D);
            } : D;
          }) : I2 = [II];
          var E = -1;
          I2 = kA(I2, EI(BA()));
          var r = si(A3, function(D, w, y) {
            var d = kA(I2, function(T) {
              return T(D);
            });
            return { criteria: d, index: ++E, value: D };
          });
          return sc(r, function(D, w) {
            return Ah(D, w, C);
          });
        }
        function Ou(A3, I2) {
          return Di(A3, I2, function(C, E) {
            return Pt(A3, E);
          });
        }
        function Di(A3, I2, C) {
          for (var E = -1, r = I2.length, D = {}; ++E < r; ) {
            var w = I2[E], y = fg(A3, w);
            C(y, w) && sB(D, eg(w, A3), y);
          }
          return D;
        }
        function bu(A3) {
          return function(I2) {
            return fg(I2, A3);
          };
        }
        function Dt(A3, I2, C, E) {
          var r = E ? ac : Fg, D = -1, w = I2.length, y = A3;
          for (A3 === I2 && (I2 = zA(I2)), C && (y = kA(A3, EI(C))); ++D < w; ) for (var d = 0, T = I2[D], O2 = C ? C(T) : T; (d = r(y, O2, d, E)) > -1; ) y !== A3 && CQ.call(y, d, 1), CQ.call(A3, d, 1);
          return A3;
        }
        function pi(A3, I2) {
          for (var C = A3 ? I2.length : 0, E = C - 1; C--; ) {
            var r = I2[C];
            if (C == E || r !== D) {
              var D = r;
              _I(r) ? CQ.call(A3, r, 1) : yt(A3, r);
            }
          }
          return A3;
        }
        function pt(A3, I2) {
          return A3 + eQ(Ai() * (I2 - A3 + 1));
        }
        function xu(A3, I2, C, E) {
          for (var r = -1, D = vA(EQ((I2 - A3) / (C || 1)), 0), w = J(D); D--; ) w[E ? D : ++r] = A3, A3 += C;
          return w;
        }
        function wt(A3, I2) {
          var C = "";
          if (!A3 || I2 < 1 || I2 > _A) return C;
          do
            I2 % 2 && (C += A3), I2 = eQ(I2 / 2), I2 && (A3 += A3);
          while (I2);
          return C;
        }
        function rA(A3, I2) {
          return Ht(Vi(A3, I2, II), A3 + "");
        }
        function _u(A3) {
          return Bi(bg(A3));
        }
        function Pu(A3, I2) {
          var C = bg(A3);
          return NQ(C, wg(I2, 0, C.length));
        }
        function sB(A3, I2, C, E) {
          if (!SA(A3)) return A3;
          I2 = eg(I2, A3);
          for (var r = -1, D = I2.length, w = D - 1, y = A3; y != null && ++r < D; ) {
            var d = JI(I2[r]), T = C;
            if (d === "__proto__" || d === "constructor" || d === "prototype") return A3;
            if (r != w) {
              var O2 = y[d];
              T = E ? E(O2, d, y) : Q, T === Q && (T = SA(O2) ? O2 : _I(I2[r + 1]) ? [] : {});
            }
            nB(y, d, T), y = y[d];
          }
          return A3;
        }
        var wi = iQ ? function(A3, I2) {
          return iQ.set(A3, I2), A3;
        } : II, Wu = tQ ? function(A3, I2) {
          return tQ(A3, "toString", { configurable: true, enumerable: false, value: jt(I2), writable: true });
        } : II;
        function ju(A3) {
          return NQ(bg(A3));
        }
        function pI(A3, I2, C) {
          var E = -1, r = A3.length;
          I2 < 0 && (I2 = -I2 > r ? 0 : r + I2), C = C > r ? r : C, C < 0 && (C += r), r = I2 > C ? 0 : C - I2 >>> 0, I2 >>>= 0;
          for (var D = J(r); ++E < r; ) D[E] = A3[E + I2];
          return D;
        }
        function Zu(A3, I2) {
          var C;
          return tg(A3, function(E, r, D) {
            return C = I2(E, r, D), !C;
          }), !!C;
        }
        function uQ(A3, I2, C) {
          var E = 0, r = A3 == null ? E : A3.length;
          if (typeof I2 == "number" && I2 === I2 && r <= xB) {
            for (; E < r; ) {
              var D = E + r >>> 1, w = A3[D];
              w !== null && !iI(w) && (C ? w <= I2 : w < I2) ? E = D + 1 : r = D;
            }
            return r;
          }
          return ft(A3, I2, II, C);
        }
        function ft(A3, I2, C, E) {
          var r = 0, D = A3 == null ? 0 : A3.length;
          if (D === 0) return 0;
          I2 = C(I2);
          for (var w = I2 !== I2, y = I2 === null, d = iI(I2), T = I2 === Q; r < D; ) {
            var O2 = eQ((r + D) / 2), _ = C(A3[O2]), V2 = _ !== Q, z = _ === null, QA = _ === _, oA = iI(_);
            if (w) var CA = E || QA;
            else T ? CA = QA && (E || V2) : y ? CA = QA && V2 && (E || !z) : d ? CA = QA && V2 && !z && (E || !oA) : z || oA ? CA = false : CA = E ? _ <= I2 : _ < I2;
            CA ? r = O2 + 1 : D = O2;
          }
          return WA(D, bB);
        }
        function fi(A3, I2) {
          for (var C = -1, E = A3.length, r = 0, D = []; ++C < E; ) {
            var w = A3[C], y = I2 ? I2(w) : w;
            if (!C || !SI(y, d)) {
              var d = y;
              D[r++] = w === 0 ? 0 : w;
            }
          }
          return D;
        }
        function yi(A3) {
          return typeof A3 == "number" ? A3 : iI(A3) ? zI : +A3;
        }
        function eI(A3) {
          if (typeof A3 == "string") return A3;
          if (eA(A3)) return kA(A3, eI) + "";
          if (iI(A3)) return Ii ? Ii.call(A3) : "";
          var I2 = A3 + "";
          return I2 == "0" && 1 / A3 == -NI ? "-0" : I2;
        }
        function Eg(A3, I2, C) {
          var E = -1, r = ZB, D = A3.length, w = true, y = [], d = y;
          if (C) w = false, r = XC;
          else if (D >= n) {
            var T = I2 ? null : th(A3);
            if (T) return XB(T);
            w = false, r = QB, d = new pg();
          } else d = I2 ? [] : y;
          A: for (; ++E < D; ) {
            var O2 = A3[E], _ = I2 ? I2(O2) : O2;
            if (O2 = C || O2 !== 0 ? O2 : 0, w && _ === _) {
              for (var V2 = d.length; V2--; ) if (d[V2] === _) continue A;
              I2 && d.push(_), y.push(O2);
            } else r(d, _, C) || (d !== y && d.push(_), y.push(O2));
          }
          return y;
        }
        function yt(A3, I2) {
          return I2 = eg(I2, A3), A3 = Xi(A3, I2), A3 == null || delete A3[JI(wI(I2))];
        }
        function Gi(A3, I2, C, E) {
          return sB(A3, I2, C(fg(A3, I2)), E);
        }
        function hQ(A3, I2, C, E) {
          for (var r = A3.length, D = E ? r : -1; (E ? D-- : ++D < r) && I2(A3[D], D, A3); ) ;
          return C ? pI(A3, E ? 0 : D, E ? D + 1 : r) : pI(A3, E ? D + 1 : 0, E ? r : D);
        }
        function Ni(A3, I2) {
          var C = A3;
          return C instanceof sA && (C = C.value()), zC(I2, function(E, r) {
            return r.func.apply(r.thisArg, Bg([E], r.args));
          }, C);
        }
        function Gt(A3, I2, C) {
          var E = A3.length;
          if (E < 2) return E ? Eg(A3[0]) : [];
          for (var r = -1, D = J(E); ++r < E; ) for (var w = A3[r], y = -1; ++y < E; ) y != r && (D[r] = oB(D[r] || w, A3[y], I2, C));
          return Eg(xA(D, 1), I2, C);
        }
        function ki(A3, I2, C) {
          for (var E = -1, r = A3.length, D = I2.length, w = {}; ++E < r; ) {
            var y = E < D ? I2[E] : Q;
            C(w, A3[E], y);
          }
          return w;
        }
        function Nt(A3) {
          return LA(A3) ? A3 : [];
        }
        function kt(A3) {
          return typeof A3 == "function" ? A3 : II;
        }
        function eg(A3, I2) {
          return eA(A3) ? A3 : Yt(A3, I2) ? [A3] : In3(DA(A3));
        }
        var Vu = rA;
        function ig(A3, I2, C) {
          var E = A3.length;
          return C = C === Q ? E : C, !I2 && C >= E ? A3 : pI(A3, I2, C);
        }
        var di = vc || function(A3) {
          return bA.clearTimeout(A3);
        };
        function Si(A3, I2) {
          if (I2) return A3.slice();
          var C = A3.length, E = Ze ? Ze(C) : new A3.constructor(C);
          return A3.copy(E), E;
        }
        function dt(A3) {
          var I2 = new A3.constructor(A3.byteLength);
          return new BQ(I2).set(new BQ(A3)), I2;
        }
        function Xu(A3, I2) {
          var C = I2 ? dt(A3.buffer) : A3.buffer;
          return new A3.constructor(C, A3.byteOffset, A3.byteLength);
        }
        function zu(A3) {
          var I2 = new A3.constructor(A3.source, oe.exec(A3));
          return I2.lastIndex = A3.lastIndex, I2;
        }
        function $u(A3) {
          return iB ? fA(iB.call(A3)) : {};
        }
        function Mi(A3, I2) {
          var C = I2 ? dt(A3.buffer) : A3.buffer;
          return new A3.constructor(C, A3.byteOffset, A3.length);
        }
        function Ri(A3, I2) {
          if (A3 !== I2) {
            var C = A3 !== Q, E = A3 === null, r = A3 === A3, D = iI(A3), w = I2 !== Q, y = I2 === null, d = I2 === I2, T = iI(I2);
            if (!y && !T && !D && A3 > I2 || D && w && d && !y && !T || E && w && d || !C && d || !r) return 1;
            if (!E && !D && !T && A3 < I2 || T && C && r && !E && !D || y && C && r || !w && r || !d) return -1;
          }
          return 0;
        }
        function Ah(A3, I2, C) {
          for (var E = -1, r = A3.criteria, D = I2.criteria, w = r.length, y = C.length; ++E < w; ) {
            var d = Ri(r[E], D[E]);
            if (d) {
              if (E >= y) return d;
              var T = C[E];
              return d * (T == "desc" ? -1 : 1);
            }
          }
          return A3.index - I2.index;
        }
        function Fi(A3, I2, C, E) {
          for (var r = -1, D = A3.length, w = C.length, y = -1, d = I2.length, T = vA(D - w, 0), O2 = J(d + T), _ = !E; ++y < d; ) O2[y] = I2[y];
          for (; ++r < w; ) (_ || r < D) && (O2[C[r]] = A3[r]);
          for (; T--; ) O2[y++] = A3[r++];
          return O2;
        }
        function Li(A3, I2, C, E) {
          for (var r = -1, D = A3.length, w = -1, y = C.length, d = -1, T = I2.length, O2 = vA(D - y, 0), _ = J(O2 + T), V2 = !E; ++r < O2; ) _[r] = A3[r];
          for (var z = r; ++d < T; ) _[z + d] = I2[d];
          for (; ++w < y; ) (V2 || r < D) && (_[z + C[w]] = A3[r++]);
          return _;
        }
        function zA(A3, I2) {
          var C = -1, E = A3.length;
          for (I2 || (I2 = J(E)); ++C < E; ) I2[C] = A3[C];
          return I2;
        }
        function UI(A3, I2, C, E) {
          var r = !C;
          C || (C = {});
          for (var D = -1, w = I2.length; ++D < w; ) {
            var y = I2[D], d = E ? E(C[y], A3[y], y, C, A3) : Q;
            d === Q && (d = A3[y]), r ? OI(C, y, d) : nB(C, y, d);
          }
          return C;
        }
        function Ih(A3, I2) {
          return UI(A3, Jt(A3), I2);
        }
        function gh(A3, I2) {
          return UI(A3, _i(A3), I2);
        }
        function lQ(A3, I2) {
          return function(C, E) {
            var r = eA(C) ? Ec : Gu, D = I2 ? I2() : {};
            return r(C, A3, BA(E, 2), D);
          };
        }
        function Kg(A3) {
          return rA(function(I2, C) {
            var E = -1, r = C.length, D = r > 1 ? C[r - 1] : Q, w = r > 2 ? C[2] : Q;
            for (D = A3.length > 3 && typeof D == "function" ? (r--, D) : Q, w && VA(C[0], C[1], w) && (D = r < 3 ? Q : D, r = 1), I2 = fA(I2); ++E < r; ) {
              var y = C[E];
              y && A3(I2, y, E, D);
            }
            return I2;
          });
        }
        function Ui(A3, I2) {
          return function(C, E) {
            if (C == null) return C;
            if (!$A(C)) return A3(C, E);
            for (var r = C.length, D = I2 ? r : -1, w = fA(C); (I2 ? D-- : ++D < r) && E(w[D], D, w) !== false; ) ;
            return C;
          };
        }
        function Ji(A3) {
          return function(I2, C, E) {
            for (var r = -1, D = fA(I2), w = E(I2), y = w.length; y--; ) {
              var d = w[A3 ? y : ++r];
              if (C(D[d], d, D) === false) break;
            }
            return I2;
          };
        }
        function Bh(A3, I2, C) {
          var E = I2 & F, r = cB(A3);
          function D() {
            var w = this && this !== bA && this instanceof D ? r : A3;
            return w.apply(E ? C : this, arguments);
          }
          return D;
        }
        function Yi(A3) {
          return function(I2) {
            I2 = DA(I2);
            var C = Lg(I2) ? kI(I2) : Q, E = C ? C[0] : I2.charAt(0), r = C ? ig(C, 1).join("") : I2.slice(1);
            return E[A3]() + r;
          };
        }
        function qg(A3) {
          return function(I2) {
            return zC(Jn(Un(I2).replace(Ws, "")), A3, "");
          };
        }
        function cB(A3) {
          return function() {
            var I2 = arguments;
            switch (I2.length) {
              case 0:
                return new A3();
              case 1:
                return new A3(I2[0]);
              case 2:
                return new A3(I2[0], I2[1]);
              case 3:
                return new A3(I2[0], I2[1], I2[2]);
              case 4:
                return new A3(I2[0], I2[1], I2[2], I2[3]);
              case 5:
                return new A3(I2[0], I2[1], I2[2], I2[3], I2[4]);
              case 6:
                return new A3(I2[0], I2[1], I2[2], I2[3], I2[4], I2[5]);
              case 7:
                return new A3(I2[0], I2[1], I2[2], I2[3], I2[4], I2[5], I2[6]);
            }
            var C = Hg(A3.prototype), E = A3.apply(C, I2);
            return SA(E) ? E : C;
          };
        }
        function Qh(A3, I2, C) {
          var E = cB(A3);
          function r() {
            for (var D = arguments.length, w = J(D), y = D, d = Tg(r); y--; ) w[y] = arguments[y];
            var T = D < 3 && w[0] !== d && w[D - 1] !== d ? [] : Qg(w, d);
            if (D -= T.length, D < C) return qi(A3, I2, DQ, r.placeholder, Q, w, T, Q, Q, C - D);
            var O2 = this && this !== bA && this instanceof r ? E : A3;
            return tI(O2, this, w);
          }
          return r;
        }
        function mi(A3) {
          return function(I2, C, E) {
            var r = fA(I2);
            if (!$A(I2)) {
              var D = BA(C, 3);
              I2 = qA(I2), C = function(y) {
                return D(r[y], y, r);
              };
            }
            var w = A3(I2, C, E);
            return w > -1 ? r[D ? I2[w] : w] : Q;
          };
        }
        function vi(A3) {
          return xI(function(I2) {
            var C = I2.length, E = C, r = lI.prototype.thru;
            for (A3 && I2.reverse(); E--; ) {
              var D = I2[E];
              if (typeof D != "function") throw new hI(a);
              if (r && !w && yQ(D) == "wrapper") var w = new lI([], true);
            }
            for (E = w ? E : C; ++E < C; ) {
              D = I2[E];
              var y = yQ(D), d = y == "wrapper" ? Lt(D) : Q;
              d && mt(d[0]) && d[1] == (x | b | Y | iA) && !d[4].length && d[9] == 1 ? w = w[yQ(d[0])].apply(w, d[3]) : w = D.length == 1 && mt(D) ? w[y]() : w.thru(D);
            }
            return function() {
              var T = arguments, O2 = T[0];
              if (w && T.length == 1 && eA(O2)) return w.plant(O2).value();
              for (var _ = 0, V2 = C ? I2[_].apply(this, T) : O2; ++_ < C; ) V2 = I2[_].call(this, V2);
              return V2;
            };
          });
        }
        function DQ(A3, I2, C, E, r, D, w, y, d, T) {
          var O2 = I2 & x, _ = I2 & F, V2 = I2 & L, z = I2 & (b | S), QA = I2 & uA, oA = V2 ? Q : cB(A3);
          function CA() {
            for (var aA = arguments.length, hA = J(aA), nI = aA; nI--; ) hA[nI] = arguments[nI];
            if (z) var XA = Tg(CA), oI = uc(hA, XA);
            if (E && (hA = Fi(hA, E, r, z)), D && (hA = Li(hA, D, w, z)), aA -= oI, z && aA < T) {
              var UA = Qg(hA, XA);
              return qi(A3, I2, DQ, CA.placeholder, C, hA, UA, y, d, T - aA);
            }
            var MI = _ ? C : this, jI = V2 ? MI[A3] : A3;
            return aA = hA.length, y ? hA = Gh(hA, y) : QA && aA > 1 && hA.reverse(), O2 && d < aA && (hA.length = d), this && this !== bA && this instanceof CA && (jI = oA || cB(jI)), jI.apply(MI, hA);
          }
          return CA;
        }
        function Hi(A3, I2) {
          return function(C, E) {
            return Lu(C, A3, I2(E), {});
          };
        }
        function pQ(A3, I2) {
          return function(C, E) {
            var r;
            if (C === Q && E === Q) return I2;
            if (C !== Q && (r = C), E !== Q) {
              if (r === Q) return E;
              typeof C == "string" || typeof E == "string" ? (C = eI(C), E = eI(E)) : (C = yi(C), E = yi(E)), r = A3(C, E);
            }
            return r;
          };
        }
        function St(A3) {
          return xI(function(I2) {
            return I2 = kA(I2, EI(BA())), rA(function(C) {
              var E = this;
              return A3(I2, function(r) {
                return tI(r, E, C);
              });
            });
          });
        }
        function wQ(A3, I2) {
          I2 = I2 === Q ? " " : eI(I2);
          var C = I2.length;
          if (C < 2) return C ? wt(I2, A3) : I2;
          var E = wt(I2, EQ(A3 / Ug(I2)));
          return Lg(I2) ? ig(kI(E), 0, A3).join("") : E.slice(0, A3);
        }
        function Ch(A3, I2, C, E) {
          var r = I2 & F, D = cB(A3);
          function w() {
            for (var y = -1, d = arguments.length, T = -1, O2 = E.length, _ = J(O2 + d), V2 = this && this !== bA && this instanceof w ? D : A3; ++T < O2; ) _[T] = E[T];
            for (; d--; ) _[T++] = arguments[++y];
            return tI(V2, r ? C : this, _);
          }
          return w;
        }
        function Ki(A3) {
          return function(I2, C, E) {
            return E && typeof E != "number" && VA(I2, C, E) && (C = E = Q), I2 = WI(I2), C === Q ? (C = I2, I2 = 0) : C = WI(C), E = E === Q ? I2 < C ? 1 : -1 : WI(E), xu(I2, C, E, A3);
          };
        }
        function fQ(A3) {
          return function(I2, C) {
            return typeof I2 == "string" && typeof C == "string" || (I2 = fI(I2), C = fI(C)), A3(I2, C);
          };
        }
        function qi(A3, I2, C, E, r, D, w, y, d, T) {
          var O2 = I2 & b, _ = O2 ? w : Q, V2 = O2 ? Q : w, z = O2 ? D : Q, QA = O2 ? Q : D;
          I2 |= O2 ? Y : Z3, I2 &= ~(O2 ? Z3 : Y), I2 & U || (I2 &= ~(F | L));
          var oA = [A3, I2, r, z, _, QA, V2, y, d, T], CA = C.apply(Q, oA);
          return mt(A3) && zi(CA, oA), CA.placeholder = E, $i(CA, A3, I2);
        }
        function Mt(A3) {
          var I2 = mA[A3];
          return function(C, E) {
            if (C = fI(C), E = E == null ? 0 : WA(nA(E), 292), E && $e(C)) {
              var r = (DA(C) + "e").split("e"), D = I2(r[0] + "e" + (+r[1] + E));
              return r = (DA(D) + "e").split("e"), +(r[0] + "e" + (+r[1] - E));
            }
            return I2(C);
          };
        }
        var th = mg && 1 / XB(new mg([, -0]))[1] == NI ? function(A3) {
          return new mg(A3);
        } : Xt;
        function Ti(A3) {
          return function(I2) {
            var C = jA(I2);
            return C == j ? Ct(I2) : C == KA ? yc(I2) : cc(I2, A3(I2));
          };
        }
        function bI(A3, I2, C, E, r, D, w, y) {
          var d = I2 & L;
          if (!d && typeof A3 != "function") throw new hI(a);
          var T = E ? E.length : 0;
          if (T || (I2 &= ~(Y | Z3), E = r = Q), w = w === Q ? w : vA(nA(w), 0), y = y === Q ? y : nA(y), T -= r ? r.length : 0, I2 & Z3) {
            var O2 = E, _ = r;
            E = r = Q;
          }
          var V2 = d ? Q : Lt(A3), z = [A3, I2, C, E, r, O2, _, D, w, y];
          if (V2 && wh(z, V2), A3 = z[0], I2 = z[1], C = z[2], E = z[3], r = z[4], y = z[9] = z[9] === Q ? d ? 0 : A3.length : vA(z[9] - T, 0), !y && I2 & (b | S) && (I2 &= ~(b | S)), !I2 || I2 == F) var QA = Bh(A3, I2, C);
          else I2 == b || I2 == S ? QA = Qh(A3, I2, y) : (I2 == Y || I2 == (F | Y)) && !r.length ? QA = Ch(A3, I2, C, E) : QA = DQ.apply(Q, z);
          var oA = V2 ? wi : zi;
          return $i(oA(QA, z), A3, I2);
        }
        function Oi(A3, I2, C, E) {
          return A3 === Q || SI(A3, Yg[C]) && !pA.call(E, C) ? I2 : A3;
        }
        function bi(A3, I2, C, E, r, D) {
          return SA(A3) && SA(I2) && (D.set(I2, A3), cQ(A3, I2, Q, bi, D), D.delete(I2)), A3;
        }
        function Eh(A3) {
          return lB(A3) ? Q : A3;
        }
        function xi(A3, I2, C, E, r, D) {
          var w = C & f, y = A3.length, d = I2.length;
          if (y != d && !(w && d > y)) return false;
          var T = D.get(A3), O2 = D.get(I2);
          if (T && O2) return T == I2 && O2 == A3;
          var _ = -1, V2 = true, z = C & G ? new pg() : Q;
          for (D.set(A3, I2), D.set(I2, A3); ++_ < y; ) {
            var QA = A3[_], oA = I2[_];
            if (E) var CA = w ? E(oA, QA, _, I2, A3, D) : E(QA, oA, _, A3, I2, D);
            if (CA !== Q) {
              if (CA) continue;
              V2 = false;
              break;
            }
            if (z) {
              if (!$C(I2, function(aA, hA) {
                if (!QB(z, hA) && (QA === aA || r(QA, aA, C, E, D))) return z.push(hA);
              })) {
                V2 = false;
                break;
              }
            } else if (!(QA === oA || r(QA, oA, C, E, D))) {
              V2 = false;
              break;
            }
          }
          return D.delete(A3), D.delete(I2), V2;
        }
        function eh(A3, I2, C, E, r, D, w) {
          switch (C) {
            case Ig:
              if (A3.byteLength != I2.byteLength || A3.byteOffset != I2.byteOffset) return false;
              A3 = A3.buffer, I2 = I2.buffer;
            case ug:
              return !(A3.byteLength != I2.byteLength || !D(new BQ(A3), new BQ(I2)));
            case M:
            case R:
            case $4:
              return SI(+A3, +I2);
            case q:
              return A3.name == I2.name && A3.message == I2.message;
            case FI:
            case CI:
              return A3 == I2 + "";
            case j:
              var y = Ct;
            case KA:
              var d = E & f;
              if (y || (y = XB), A3.size != I2.size && !d) return false;
              var T = w.get(A3);
              if (T) return T == I2;
              E |= G, w.set(A3, I2);
              var O2 = xi(y(A3), y(I2), E, r, D, w);
              return w.delete(A3), O2;
            case OA:
              if (iB) return iB.call(A3) == iB.call(I2);
          }
          return false;
        }
        function ih(A3, I2, C, E, r, D) {
          var w = C & f, y = Rt(A3), d = y.length, T = Rt(I2), O2 = T.length;
          if (d != O2 && !w) return false;
          for (var _ = d; _--; ) {
            var V2 = y[_];
            if (!(w ? V2 in I2 : pA.call(I2, V2))) return false;
          }
          var z = D.get(A3), QA = D.get(I2);
          if (z && QA) return z == I2 && QA == A3;
          var oA = true;
          D.set(A3, I2), D.set(I2, A3);
          for (var CA = w; ++_ < d; ) {
            V2 = y[_];
            var aA = A3[V2], hA = I2[V2];
            if (E) var nI = w ? E(hA, aA, V2, I2, A3, D) : E(aA, hA, V2, A3, I2, D);
            if (!(nI === Q ? aA === hA || r(aA, hA, C, E, D) : nI)) {
              oA = false;
              break;
            }
            CA || (CA = V2 == "constructor");
          }
          if (oA && !CA) {
            var XA = A3.constructor, oI = I2.constructor;
            XA != oI && "constructor" in A3 && "constructor" in I2 && !(typeof XA == "function" && XA instanceof XA && typeof oI == "function" && oI instanceof oI) && (oA = false);
          }
          return D.delete(A3), D.delete(I2), oA;
        }
        function xI(A3) {
          return Ht(Vi(A3, Q, Cn), A3 + "");
        }
        function Rt(A3) {
          return ni(A3, qA, Jt);
        }
        function Ft(A3) {
          return ni(A3, AI, _i);
        }
        var Lt = iQ ? function(A3) {
          return iQ.get(A3);
        } : Xt;
        function yQ(A3) {
          for (var I2 = A3.name + "", C = vg[I2], E = pA.call(vg, I2) ? C.length : 0; E--; ) {
            var r = C[E], D = r.func;
            if (D == null || D == A3) return r.name;
          }
          return I2;
        }
        function Tg(A3) {
          var I2 = pA.call(h, "placeholder") ? h : A3;
          return I2.placeholder;
        }
        function BA() {
          var A3 = h.iteratee || Zt;
          return A3 = A3 === Zt ? ai : A3, arguments.length ? A3(arguments[0], arguments[1]) : A3;
        }
        function GQ(A3, I2) {
          var C = A3.__data__;
          return hh(I2) ? C[typeof I2 == "string" ? "string" : "hash"] : C.map;
        }
        function Ut(A3) {
          for (var I2 = qA(A3), C = I2.length; C--; ) {
            var E = I2[C], r = A3[E];
            I2[C] = [E, r, ji(r)];
          }
          return I2;
        }
        function yg(A3, I2) {
          var C = pc(A3, I2);
          return ri(C) ? C : Q;
        }
        function nh(A3) {
          var I2 = pA.call(A3, lg), C = A3[lg];
          try {
            A3[lg] = Q;
            var E = true;
          } catch {
          }
          var r = IQ.call(A3);
          return E && (I2 ? A3[lg] = C : delete A3[lg]), r;
        }
        var Jt = Et ? function(A3) {
          return A3 == null ? [] : (A3 = fA(A3), gg(Et(A3), function(I2) {
            return Xe.call(A3, I2);
          }));
        } : zt, _i = Et ? function(A3) {
          for (var I2 = []; A3; ) Bg(I2, Jt(A3)), A3 = QQ(A3);
          return I2;
        } : zt, jA = ZA;
        (et && jA(new et(new ArrayBuffer(1))) != Ig || tB && jA(new tB()) != j || it && jA(it.resolve()) != wA || mg && jA(new mg()) != KA || EB && jA(new EB()) != PA) && (jA = function(A3) {
          var I2 = ZA(A3), C = I2 == tA ? A3.constructor : Q, E = C ? Gg(C) : "";
          if (E) switch (E) {
            case Pc:
              return Ig;
            case Wc:
              return j;
            case jc:
              return wA;
            case Zc:
              return KA;
            case Vc:
              return PA;
          }
          return I2;
        });
        function oh(A3, I2, C) {
          for (var E = -1, r = C.length; ++E < r; ) {
            var D = C[E], w = D.size;
            switch (D.type) {
              case "drop":
                A3 += w;
                break;
              case "dropRight":
                I2 -= w;
                break;
              case "take":
                I2 = WA(I2, A3 + w);
                break;
              case "takeRight":
                A3 = vA(A3, I2 - w);
                break;
            }
          }
          return { start: A3, end: I2 };
        }
        function rh(A3) {
          var I2 = A3.match(ls);
          return I2 ? I2[1].split(Ds) : [];
        }
        function Pi(A3, I2, C) {
          I2 = eg(I2, A3);
          for (var E = -1, r = I2.length, D = false; ++E < r; ) {
            var w = JI(I2[E]);
            if (!(D = A3 != null && C(A3, w))) break;
            A3 = A3[w];
          }
          return D || ++E != r ? D : (r = A3 == null ? 0 : A3.length, !!r && FQ(r) && _I(w, r) && (eA(A3) || Ng(A3)));
        }
        function ah(A3) {
          var I2 = A3.length, C = new A3.constructor(I2);
          return I2 && typeof A3[0] == "string" && pA.call(A3, "index") && (C.index = A3.index, C.input = A3.input), C;
        }
        function Wi(A3) {
          return typeof A3.constructor == "function" && !uB(A3) ? Hg(QQ(A3)) : {};
        }
        function sh(A3, I2, C) {
          var E = A3.constructor;
          switch (I2) {
            case ug:
              return dt(A3);
            case M:
            case R:
              return new E(+A3);
            case Ig:
              return Xu(A3, C);
            case UC:
            case JC:
            case YC:
            case mC:
            case vC:
            case HC:
            case KC:
            case qC:
            case TC:
              return Mi(A3, C);
            case j:
              return new E();
            case $4:
            case CI:
              return new E(A3);
            case FI:
              return zu(A3);
            case KA:
              return new E();
            case OA:
              return $u(A3);
          }
        }
        function ch(A3, I2) {
          var C = I2.length;
          if (!C) return A3;
          var E = C - 1;
          return I2[E] = (C > 1 ? "& " : "") + I2[E], I2 = I2.join(C > 2 ? ", " : " "), A3.replace(hs, `{
/* [wrapped with ` + I2 + `] */
`);
        }
        function uh(A3) {
          return eA(A3) || Ng(A3) || !!(ze && A3 && A3[ze]);
        }
        function _I(A3, I2) {
          var C = typeof A3;
          return I2 = I2 ?? _A, !!I2 && (C == "number" || C != "symbol" && Ss.test(A3)) && A3 > -1 && A3 % 1 == 0 && A3 < I2;
        }
        function VA(A3, I2, C) {
          if (!SA(C)) return false;
          var E = typeof I2;
          return (E == "number" ? $A(C) && _I(I2, C.length) : E == "string" && I2 in C) ? SI(C[I2], A3) : false;
        }
        function Yt(A3, I2) {
          if (eA(A3)) return false;
          var C = typeof A3;
          return C == "number" || C == "symbol" || C == "boolean" || A3 == null || iI(A3) ? true : as.test(A3) || !rs.test(A3) || I2 != null && A3 in fA(I2);
        }
        function hh(A3) {
          var I2 = typeof A3;
          return I2 == "string" || I2 == "number" || I2 == "symbol" || I2 == "boolean" ? A3 !== "__proto__" : A3 === null;
        }
        function mt(A3) {
          var I2 = yQ(A3), C = h[I2];
          if (typeof C != "function" || !(I2 in sA.prototype)) return false;
          if (A3 === C) return true;
          var E = Lt(C);
          return !!E && A3 === E[0];
        }
        function lh(A3) {
          return !!je && je in A3;
        }
        var Dh = $B ? PI : $t;
        function uB(A3) {
          var I2 = A3 && A3.constructor, C = typeof I2 == "function" && I2.prototype || Yg;
          return A3 === C;
        }
        function ji(A3) {
          return A3 === A3 && !SA(A3);
        }
        function Zi(A3, I2) {
          return function(C) {
            return C == null ? false : C[A3] === I2 && (I2 !== Q || A3 in fA(C));
          };
        }
        function ph(A3) {
          var I2 = MQ(A3, function(E) {
            return C.size === s && C.clear(), E;
          }), C = I2.cache;
          return I2;
        }
        function wh(A3, I2) {
          var C = A3[1], E = I2[1], r = C | E, D = r < (F | L | x), w = E == x && C == b || E == x && C == iA && A3[7].length <= I2[8] || E == (x | iA) && I2[7].length <= I2[8] && C == b;
          if (!(D || w)) return A3;
          E & F && (A3[2] = I2[2], r |= C & F ? 0 : U);
          var y = I2[3];
          if (y) {
            var d = A3[3];
            A3[3] = d ? Fi(d, y, I2[4]) : y, A3[4] = d ? Qg(A3[3], p) : I2[4];
          }
          return y = I2[5], y && (d = A3[5], A3[5] = d ? Li(d, y, I2[6]) : y, A3[6] = d ? Qg(A3[5], p) : I2[6]), y = I2[7], y && (A3[7] = y), E & x && (A3[8] = A3[8] == null ? I2[8] : WA(A3[8], I2[8])), A3[9] == null && (A3[9] = I2[9]), A3[0] = I2[0], A3[1] = r, A3;
        }
        function fh(A3) {
          var I2 = [];
          if (A3 != null) for (var C in fA(A3)) I2.push(C);
          return I2;
        }
        function yh(A3) {
          return IQ.call(A3);
        }
        function Vi(A3, I2, C) {
          return I2 = vA(I2 === Q ? A3.length - 1 : I2, 0), function() {
            for (var E = arguments, r = -1, D = vA(E.length - I2, 0), w = J(D); ++r < D; ) w[r] = E[I2 + r];
            r = -1;
            for (var y = J(I2 + 1); ++r < I2; ) y[r] = E[r];
            return y[I2] = C(w), tI(A3, this, y);
          };
        }
        function Xi(A3, I2) {
          return I2.length < 2 ? A3 : fg(A3, pI(I2, 0, -1));
        }
        function Gh(A3, I2) {
          for (var C = A3.length, E = WA(I2.length, C), r = zA(A3); E--; ) {
            var D = I2[E];
            A3[E] = _I(D, C) ? r[D] : Q;
          }
          return A3;
        }
        function vt(A3, I2) {
          if (!(I2 === "constructor" && typeof A3[I2] == "function") && I2 != "__proto__") return A3[I2];
        }
        var zi = An(wi), hB = Kc || function(A3, I2) {
          return bA.setTimeout(A3, I2);
        }, Ht = An(Wu);
        function $i(A3, I2, C) {
          var E = I2 + "";
          return Ht(A3, ch(E, Nh(rh(E), C)));
        }
        function An(A3) {
          var I2 = 0, C = 0;
          return function() {
            var E = bc(), r = IB - (E - C);
            if (C = E, r > 0) {
              if (++I2 >= BI) return arguments[0];
            } else I2 = 0;
            return A3.apply(Q, arguments);
          };
        }
        function NQ(A3, I2) {
          var C = -1, E = A3.length, r = E - 1;
          for (I2 = I2 === Q ? E : I2; ++C < I2; ) {
            var D = pt(C, r), w = A3[D];
            A3[D] = A3[C], A3[C] = w;
          }
          return A3.length = I2, A3;
        }
        var In3 = ph(function(A3) {
          var I2 = [];
          return A3.charCodeAt(0) === 46 && I2.push(""), A3.replace(ss, function(C, E, r, D) {
            I2.push(r ? D.replace(fs, "$1") : E || C);
          }), I2;
        });
        function JI(A3) {
          if (typeof A3 == "string" || iI(A3)) return A3;
          var I2 = A3 + "";
          return I2 == "0" && 1 / A3 == -NI ? "-0" : I2;
        }
        function Gg(A3) {
          if (A3 != null) {
            try {
              return AQ.call(A3);
            } catch {
            }
            try {
              return A3 + "";
            } catch {
            }
          }
          return "";
        }
        function Nh(A3, I2) {
          return uI(_B, function(C) {
            var E = "_." + C[0];
            I2 & C[1] && !ZB(A3, E) && A3.push(E);
          }), A3.sort();
        }
        function gn(A3) {
          if (A3 instanceof sA) return A3.clone();
          var I2 = new lI(A3.__wrapped__, A3.__chain__);
          return I2.__actions__ = zA(A3.__actions__), I2.__index__ = A3.__index__, I2.__values__ = A3.__values__, I2;
        }
        function kh(A3, I2, C) {
          (C ? VA(A3, I2, C) : I2 === Q) ? I2 = 1 : I2 = vA(nA(I2), 0);
          var E = A3 == null ? 0 : A3.length;
          if (!E || I2 < 1) return [];
          for (var r = 0, D = 0, w = J(EQ(E / I2)); r < E; ) w[D++] = pI(A3, r, r += I2);
          return w;
        }
        function dh(A3) {
          for (var I2 = -1, C = A3 == null ? 0 : A3.length, E = 0, r = []; ++I2 < C; ) {
            var D = A3[I2];
            D && (r[E++] = D);
          }
          return r;
        }
        function Sh() {
          var A3 = arguments.length;
          if (!A3) return [];
          for (var I2 = J(A3 - 1), C = arguments[0], E = A3; E--; ) I2[E - 1] = arguments[E];
          return Bg(eA(C) ? zA(C) : [C], xA(I2, 1));
        }
        var Mh = rA(function(A3, I2) {
          return LA(A3) ? oB(A3, xA(I2, 1, LA, true)) : [];
        }), Rh = rA(function(A3, I2) {
          var C = wI(I2);
          return LA(C) && (C = Q), LA(A3) ? oB(A3, xA(I2, 1, LA, true), BA(C, 2)) : [];
        }), Fh = rA(function(A3, I2) {
          var C = wI(I2);
          return LA(C) && (C = Q), LA(A3) ? oB(A3, xA(I2, 1, LA, true), Q, C) : [];
        });
        function Lh(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          return E ? (I2 = C || I2 === Q ? 1 : nA(I2), pI(A3, I2 < 0 ? 0 : I2, E)) : [];
        }
        function Uh(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          return E ? (I2 = C || I2 === Q ? 1 : nA(I2), I2 = E - I2, pI(A3, 0, I2 < 0 ? 0 : I2)) : [];
        }
        function Jh(A3, I2) {
          return A3 && A3.length ? hQ(A3, BA(I2, 3), true, true) : [];
        }
        function Yh(A3, I2) {
          return A3 && A3.length ? hQ(A3, BA(I2, 3), true) : [];
        }
        function mh(A3, I2, C, E) {
          var r = A3 == null ? 0 : A3.length;
          return r ? (C && typeof C != "number" && VA(A3, I2, C) && (C = 0, E = r), Su(A3, I2, C, E)) : [];
        }
        function Bn(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          if (!E) return -1;
          var r = C == null ? 0 : nA(C);
          return r < 0 && (r = vA(E + r, 0)), VB(A3, BA(I2, 3), r);
        }
        function Qn(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          if (!E) return -1;
          var r = E - 1;
          return C !== Q && (r = nA(C), r = C < 0 ? vA(E + r, 0) : WA(r, E - 1)), VB(A3, BA(I2, 3), r, true);
        }
        function Cn(A3) {
          var I2 = A3 == null ? 0 : A3.length;
          return I2 ? xA(A3, 1) : [];
        }
        function vh(A3) {
          var I2 = A3 == null ? 0 : A3.length;
          return I2 ? xA(A3, NI) : [];
        }
        function Hh(A3, I2) {
          var C = A3 == null ? 0 : A3.length;
          return C ? (I2 = I2 === Q ? 1 : nA(I2), xA(A3, I2)) : [];
        }
        function Kh(A3) {
          for (var I2 = -1, C = A3 == null ? 0 : A3.length, E = {}; ++I2 < C; ) {
            var r = A3[I2];
            E[r[0]] = r[1];
          }
          return E;
        }
        function tn(A3) {
          return A3 && A3.length ? A3[0] : Q;
        }
        function qh(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          if (!E) return -1;
          var r = C == null ? 0 : nA(C);
          return r < 0 && (r = vA(E + r, 0)), Fg(A3, I2, r);
        }
        function Th(A3) {
          var I2 = A3 == null ? 0 : A3.length;
          return I2 ? pI(A3, 0, -1) : [];
        }
        var Oh = rA(function(A3) {
          var I2 = kA(A3, Nt);
          return I2.length && I2[0] === A3[0] ? ct(I2) : [];
        }), bh = rA(function(A3) {
          var I2 = wI(A3), C = kA(A3, Nt);
          return I2 === wI(C) ? I2 = Q : C.pop(), C.length && C[0] === A3[0] ? ct(C, BA(I2, 2)) : [];
        }), xh = rA(function(A3) {
          var I2 = wI(A3), C = kA(A3, Nt);
          return I2 = typeof I2 == "function" ? I2 : Q, I2 && C.pop(), C.length && C[0] === A3[0] ? ct(C, Q, I2) : [];
        });
        function _h(A3, I2) {
          return A3 == null ? "" : Tc.call(A3, I2);
        }
        function wI(A3) {
          var I2 = A3 == null ? 0 : A3.length;
          return I2 ? A3[I2 - 1] : Q;
        }
        function Ph(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          if (!E) return -1;
          var r = E;
          return C !== Q && (r = nA(C), r = r < 0 ? vA(E + r, 0) : WA(r, E - 1)), I2 === I2 ? Nc(A3, I2, r) : VB(A3, qe, r, true);
        }
        function Wh(A3, I2) {
          return A3 && A3.length ? hi(A3, nA(I2)) : Q;
        }
        var jh = rA(En);
        function En(A3, I2) {
          return A3 && A3.length && I2 && I2.length ? Dt(A3, I2) : A3;
        }
        function Zh(A3, I2, C) {
          return A3 && A3.length && I2 && I2.length ? Dt(A3, I2, BA(C, 2)) : A3;
        }
        function Vh(A3, I2, C) {
          return A3 && A3.length && I2 && I2.length ? Dt(A3, I2, Q, C) : A3;
        }
        var Xh = xI(function(A3, I2) {
          var C = A3 == null ? 0 : A3.length, E = ot(A3, I2);
          return pi(A3, kA(I2, function(r) {
            return _I(r, C) ? +r : r;
          }).sort(Ri)), E;
        });
        function zh(A3, I2) {
          var C = [];
          if (!(A3 && A3.length)) return C;
          var E = -1, r = [], D = A3.length;
          for (I2 = BA(I2, 3); ++E < D; ) {
            var w = A3[E];
            I2(w, E, A3) && (C.push(w), r.push(E));
          }
          return pi(A3, r), C;
        }
        function Kt(A3) {
          return A3 == null ? A3 : _c.call(A3);
        }
        function $h(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          return E ? (C && typeof C != "number" && VA(A3, I2, C) ? (I2 = 0, C = E) : (I2 = I2 == null ? 0 : nA(I2), C = C === Q ? E : nA(C)), pI(A3, I2, C)) : [];
        }
        function Al(A3, I2) {
          return uQ(A3, I2);
        }
        function Il(A3, I2, C) {
          return ft(A3, I2, BA(C, 2));
        }
        function gl(A3, I2) {
          var C = A3 == null ? 0 : A3.length;
          if (C) {
            var E = uQ(A3, I2);
            if (E < C && SI(A3[E], I2)) return E;
          }
          return -1;
        }
        function Bl(A3, I2) {
          return uQ(A3, I2, true);
        }
        function Ql(A3, I2, C) {
          return ft(A3, I2, BA(C, 2), true);
        }
        function Cl(A3, I2) {
          var C = A3 == null ? 0 : A3.length;
          if (C) {
            var E = uQ(A3, I2, true) - 1;
            if (SI(A3[E], I2)) return E;
          }
          return -1;
        }
        function tl(A3) {
          return A3 && A3.length ? fi(A3) : [];
        }
        function El(A3, I2) {
          return A3 && A3.length ? fi(A3, BA(I2, 2)) : [];
        }
        function el(A3) {
          var I2 = A3 == null ? 0 : A3.length;
          return I2 ? pI(A3, 1, I2) : [];
        }
        function il(A3, I2, C) {
          return A3 && A3.length ? (I2 = C || I2 === Q ? 1 : nA(I2), pI(A3, 0, I2 < 0 ? 0 : I2)) : [];
        }
        function nl(A3, I2, C) {
          var E = A3 == null ? 0 : A3.length;
          return E ? (I2 = C || I2 === Q ? 1 : nA(I2), I2 = E - I2, pI(A3, I2 < 0 ? 0 : I2, E)) : [];
        }
        function ol(A3, I2) {
          return A3 && A3.length ? hQ(A3, BA(I2, 3), false, true) : [];
        }
        function rl(A3, I2) {
          return A3 && A3.length ? hQ(A3, BA(I2, 3)) : [];
        }
        var al = rA(function(A3) {
          return Eg(xA(A3, 1, LA, true));
        }), sl = rA(function(A3) {
          var I2 = wI(A3);
          return LA(I2) && (I2 = Q), Eg(xA(A3, 1, LA, true), BA(I2, 2));
        }), cl = rA(function(A3) {
          var I2 = wI(A3);
          return I2 = typeof I2 == "function" ? I2 : Q, Eg(xA(A3, 1, LA, true), Q, I2);
        });
        function ul(A3) {
          return A3 && A3.length ? Eg(A3) : [];
        }
        function hl(A3, I2) {
          return A3 && A3.length ? Eg(A3, BA(I2, 2)) : [];
        }
        function ll(A3, I2) {
          return I2 = typeof I2 == "function" ? I2 : Q, A3 && A3.length ? Eg(A3, Q, I2) : [];
        }
        function qt(A3) {
          if (!(A3 && A3.length)) return [];
          var I2 = 0;
          return A3 = gg(A3, function(C) {
            if (LA(C)) return I2 = vA(C.length, I2), true;
          }), Bt(I2, function(C) {
            return kA(A3, At3(C));
          });
        }
        function en(A3, I2) {
          if (!(A3 && A3.length)) return [];
          var C = qt(A3);
          return I2 == null ? C : kA(C, function(E) {
            return tI(I2, Q, E);
          });
        }
        var Dl = rA(function(A3, I2) {
          return LA(A3) ? oB(A3, I2) : [];
        }), pl = rA(function(A3) {
          return Gt(gg(A3, LA));
        }), wl = rA(function(A3) {
          var I2 = wI(A3);
          return LA(I2) && (I2 = Q), Gt(gg(A3, LA), BA(I2, 2));
        }), fl = rA(function(A3) {
          var I2 = wI(A3);
          return I2 = typeof I2 == "function" ? I2 : Q, Gt(gg(A3, LA), Q, I2);
        }), yl = rA(qt);
        function Gl(A3, I2) {
          return ki(A3 || [], I2 || [], nB);
        }
        function Nl(A3, I2) {
          return ki(A3 || [], I2 || [], sB);
        }
        var kl = rA(function(A3) {
          var I2 = A3.length, C = I2 > 1 ? A3[I2 - 1] : Q;
          return C = typeof C == "function" ? (A3.pop(), C) : Q, en(A3, C);
        });
        function nn(A3) {
          var I2 = h(A3);
          return I2.__chain__ = true, I2;
        }
        function dl(A3, I2) {
          return I2(A3), A3;
        }
        function kQ(A3, I2) {
          return I2(A3);
        }
        var Sl = xI(function(A3) {
          var I2 = A3.length, C = I2 ? A3[0] : 0, E = this.__wrapped__, r = function(D) {
            return ot(D, A3);
          };
          return I2 > 1 || this.__actions__.length || !(E instanceof sA) || !_I(C) ? this.thru(r) : (E = E.slice(C, +C + (I2 ? 1 : 0)), E.__actions__.push({ func: kQ, args: [r], thisArg: Q }), new lI(E, this.__chain__).thru(function(D) {
            return I2 && !D.length && D.push(Q), D;
          }));
        });
        function Ml() {
          return nn(this);
        }
        function Rl() {
          return new lI(this.value(), this.__chain__);
        }
        function Fl() {
          this.__values__ === Q && (this.__values__ = Gn(this.value()));
          var A3 = this.__index__ >= this.__values__.length, I2 = A3 ? Q : this.__values__[this.__index__++];
          return { done: A3, value: I2 };
        }
        function Ll() {
          return this;
        }
        function Ul(A3) {
          for (var I2, C = this; C instanceof oQ; ) {
            var E = gn(C);
            E.__index__ = 0, E.__values__ = Q, I2 ? r.__wrapped__ = E : I2 = E;
            var r = E;
            C = C.__wrapped__;
          }
          return r.__wrapped__ = A3, I2;
        }
        function Jl() {
          var A3 = this.__wrapped__;
          if (A3 instanceof sA) {
            var I2 = A3;
            return this.__actions__.length && (I2 = new sA(this)), I2 = I2.reverse(), I2.__actions__.push({ func: kQ, args: [Kt], thisArg: Q }), new lI(I2, this.__chain__);
          }
          return this.thru(Kt);
        }
        function Yl() {
          return Ni(this.__wrapped__, this.__actions__);
        }
        var ml = lQ(function(A3, I2, C) {
          pA.call(A3, C) ? ++A3[C] : OI(A3, C, 1);
        });
        function vl(A3, I2, C) {
          var E = eA(A3) ? He : du;
          return C && VA(A3, I2, C) && (I2 = Q), E(A3, BA(I2, 3));
        }
        function Hl(A3, I2) {
          var C = eA(A3) ? gg : ei;
          return C(A3, BA(I2, 3));
        }
        var Kl = mi(Bn), ql = mi(Qn);
        function Tl(A3, I2) {
          return xA(dQ(A3, I2), 1);
        }
        function Ol(A3, I2) {
          return xA(dQ(A3, I2), NI);
        }
        function bl(A3, I2, C) {
          return C = C === Q ? 1 : nA(C), xA(dQ(A3, I2), C);
        }
        function on(A3, I2) {
          var C = eA(A3) ? uI : tg;
          return C(A3, BA(I2, 3));
        }
        function rn(A3, I2) {
          var C = eA(A3) ? ec : Ei;
          return C(A3, BA(I2, 3));
        }
        var xl = lQ(function(A3, I2, C) {
          pA.call(A3, C) ? A3[C].push(I2) : OI(A3, C, [I2]);
        });
        function _l(A3, I2, C, E) {
          A3 = $A(A3) ? A3 : bg(A3), C = C && !E ? nA(C) : 0;
          var r = A3.length;
          return C < 0 && (C = vA(r + C, 0)), LQ(A3) ? C <= r && A3.indexOf(I2, C) > -1 : !!r && Fg(A3, I2, C) > -1;
        }
        var Pl = rA(function(A3, I2, C) {
          var E = -1, r = typeof I2 == "function", D = $A(A3) ? J(A3.length) : [];
          return tg(A3, function(w) {
            D[++E] = r ? tI(I2, w, C) : rB(w, I2, C);
          }), D;
        }), Wl = lQ(function(A3, I2, C) {
          OI(A3, C, I2);
        });
        function dQ(A3, I2) {
          var C = eA(A3) ? kA : si;
          return C(A3, BA(I2, 3));
        }
        function jl(A3, I2, C, E) {
          return A3 == null ? [] : (eA(I2) || (I2 = I2 == null ? [] : [I2]), C = E ? Q : C, eA(C) || (C = C == null ? [] : [C]), li(A3, I2, C));
        }
        var Zl = lQ(function(A3, I2, C) {
          A3[C ? 0 : 1].push(I2);
        }, function() {
          return [[], []];
        });
        function Vl(A3, I2, C) {
          var E = eA(A3) ? zC : Oe, r = arguments.length < 3;
          return E(A3, BA(I2, 4), C, r, tg);
        }
        function Xl(A3, I2, C) {
          var E = eA(A3) ? ic : Oe, r = arguments.length < 3;
          return E(A3, BA(I2, 4), C, r, Ei);
        }
        function zl(A3, I2) {
          var C = eA(A3) ? gg : ei;
          return C(A3, RQ(BA(I2, 3)));
        }
        function $l(A3) {
          var I2 = eA(A3) ? Bi : _u;
          return I2(A3);
        }
        function AD(A3, I2, C) {
          (C ? VA(A3, I2, C) : I2 === Q) ? I2 = 1 : I2 = nA(I2);
          var E = eA(A3) ? fu : Pu;
          return E(A3, I2);
        }
        function ID2(A3) {
          var I2 = eA(A3) ? yu : ju;
          return I2(A3);
        }
        function gD(A3) {
          if (A3 == null) return 0;
          if ($A(A3)) return LQ(A3) ? Ug(A3) : A3.length;
          var I2 = jA(A3);
          return I2 == j || I2 == KA ? A3.size : ht(A3).length;
        }
        function BD(A3, I2, C) {
          var E = eA(A3) ? $C : Zu;
          return C && VA(A3, I2, C) && (I2 = Q), E(A3, BA(I2, 3));
        }
        var QD = rA(function(A3, I2) {
          if (A3 == null) return [];
          var C = I2.length;
          return C > 1 && VA(A3, I2[0], I2[1]) ? I2 = [] : C > 2 && VA(I2[0], I2[1], I2[2]) && (I2 = [I2[0]]), li(A3, xA(I2, 1), []);
        }), SQ = Hc || function() {
          return bA.Date.now();
        };
        function CD(A3, I2) {
          if (typeof I2 != "function") throw new hI(a);
          return A3 = nA(A3), function() {
            if (--A3 < 1) return I2.apply(this, arguments);
          };
        }
        function an(A3, I2, C) {
          return I2 = C ? Q : I2, I2 = A3 && I2 == null ? A3.length : I2, bI(A3, x, Q, Q, Q, Q, I2);
        }
        function sn(A3, I2) {
          var C;
          if (typeof I2 != "function") throw new hI(a);
          return A3 = nA(A3), function() {
            return --A3 > 0 && (C = I2.apply(this, arguments)), A3 <= 1 && (I2 = Q), C;
          };
        }
        var Tt = rA(function(A3, I2, C) {
          var E = F;
          if (C.length) {
            var r = Qg(C, Tg(Tt));
            E |= Y;
          }
          return bI(A3, E, I2, C, r);
        }), cn = rA(function(A3, I2, C) {
          var E = F | L;
          if (C.length) {
            var r = Qg(C, Tg(cn));
            E |= Y;
          }
          return bI(I2, E, A3, C, r);
        });
        function un(A3, I2, C) {
          I2 = C ? Q : I2;
          var E = bI(A3, b, Q, Q, Q, Q, Q, I2);
          return E.placeholder = un.placeholder, E;
        }
        function hn(A3, I2, C) {
          I2 = C ? Q : I2;
          var E = bI(A3, S, Q, Q, Q, Q, Q, I2);
          return E.placeholder = hn.placeholder, E;
        }
        function ln(A3, I2, C) {
          var E, r, D, w, y, d, T = 0, O2 = false, _ = false, V2 = true;
          if (typeof A3 != "function") throw new hI(a);
          I2 = fI(I2) || 0, SA(C) && (O2 = !!C.leading, _ = "maxWait" in C, D = _ ? vA(fI(C.maxWait) || 0, I2) : D, V2 = "trailing" in C ? !!C.trailing : V2);
          function z(UA) {
            var MI = E, jI = r;
            return E = r = Q, T = UA, w = A3.apply(jI, MI), w;
          }
          function QA(UA) {
            return T = UA, y = hB(aA, I2), O2 ? z(UA) : w;
          }
          function oA(UA) {
            var MI = UA - d, jI = UA - T, vn = I2 - MI;
            return _ ? WA(vn, D - jI) : vn;
          }
          function CA(UA) {
            var MI = UA - d, jI = UA - T;
            return d === Q || MI >= I2 || MI < 0 || _ && jI >= D;
          }
          function aA() {
            var UA = SQ();
            if (CA(UA)) return hA(UA);
            y = hB(aA, oA(UA));
          }
          function hA(UA) {
            return y = Q, V2 && E ? z(UA) : (E = r = Q, w);
          }
          function nI() {
            y !== Q && di(y), T = 0, E = d = r = y = Q;
          }
          function XA() {
            return y === Q ? w : hA(SQ());
          }
          function oI() {
            var UA = SQ(), MI = CA(UA);
            if (E = arguments, r = this, d = UA, MI) {
              if (y === Q) return QA(d);
              if (_) return di(y), y = hB(aA, I2), z(d);
            }
            return y === Q && (y = hB(aA, I2)), w;
          }
          return oI.cancel = nI, oI.flush = XA, oI;
        }
        var tD = rA(function(A3, I2) {
          return ti(A3, 1, I2);
        }), ED = rA(function(A3, I2, C) {
          return ti(A3, fI(I2) || 0, C);
        });
        function eD(A3) {
          return bI(A3, uA);
        }
        function MQ(A3, I2) {
          if (typeof A3 != "function" || I2 != null && typeof I2 != "function") throw new hI(a);
          var C = function() {
            var E = arguments, r = I2 ? I2.apply(this, E) : E[0], D = C.cache;
            if (D.has(r)) return D.get(r);
            var w = A3.apply(this, E);
            return C.cache = D.set(r, w) || D, w;
          };
          return C.cache = new (MQ.Cache || TI)(), C;
        }
        MQ.Cache = TI;
        function RQ(A3) {
          if (typeof A3 != "function") throw new hI(a);
          return function() {
            var I2 = arguments;
            switch (I2.length) {
              case 0:
                return !A3.call(this);
              case 1:
                return !A3.call(this, I2[0]);
              case 2:
                return !A3.call(this, I2[0], I2[1]);
              case 3:
                return !A3.call(this, I2[0], I2[1], I2[2]);
            }
            return !A3.apply(this, I2);
          };
        }
        function iD(A3) {
          return sn(2, A3);
        }
        var nD = Vu(function(A3, I2) {
          I2 = I2.length == 1 && eA(I2[0]) ? kA(I2[0], EI(BA())) : kA(xA(I2, 1), EI(BA()));
          var C = I2.length;
          return rA(function(E) {
            for (var r = -1, D = WA(E.length, C); ++r < D; ) E[r] = I2[r].call(this, E[r]);
            return tI(A3, this, E);
          });
        }), Ot = rA(function(A3, I2) {
          var C = Qg(I2, Tg(Ot));
          return bI(A3, Y, Q, I2, C);
        }), Dn = rA(function(A3, I2) {
          var C = Qg(I2, Tg(Dn));
          return bI(A3, Z3, Q, I2, C);
        }), oD = xI(function(A3, I2) {
          return bI(A3, iA, Q, Q, Q, I2);
        });
        function rD(A3, I2) {
          if (typeof A3 != "function") throw new hI(a);
          return I2 = I2 === Q ? I2 : nA(I2), rA(A3, I2);
        }
        function aD(A3, I2) {
          if (typeof A3 != "function") throw new hI(a);
          return I2 = I2 == null ? 0 : vA(nA(I2), 0), rA(function(C) {
            var E = C[I2], r = ig(C, 0, I2);
            return E && Bg(r, E), tI(A3, this, r);
          });
        }
        function sD(A3, I2, C) {
          var E = true, r = true;
          if (typeof A3 != "function") throw new hI(a);
          return SA(C) && (E = "leading" in C ? !!C.leading : E, r = "trailing" in C ? !!C.trailing : r), ln(A3, I2, { leading: E, maxWait: I2, trailing: r });
        }
        function cD(A3) {
          return an(A3, 1);
        }
        function uD(A3, I2) {
          return Ot(kt(I2), A3);
        }
        function hD() {
          if (!arguments.length) return [];
          var A3 = arguments[0];
          return eA(A3) ? A3 : [A3];
        }
        function lD(A3) {
          return DI(A3, i2);
        }
        function DD(A3, I2) {
          return I2 = typeof I2 == "function" ? I2 : Q, DI(A3, i2, I2);
        }
        function pD(A3) {
          return DI(A3, c | i2);
        }
        function wD(A3, I2) {
          return I2 = typeof I2 == "function" ? I2 : Q, DI(A3, c | i2, I2);
        }
        function fD(A3, I2) {
          return I2 == null || Ci(A3, I2, qA(I2));
        }
        function SI(A3, I2) {
          return A3 === I2 || A3 !== A3 && I2 !== I2;
        }
        var yD = fQ(st), GD = fQ(function(A3, I2) {
          return A3 >= I2;
        }), Ng = oi(/* @__PURE__ */ function() {
          return arguments;
        }()) ? oi : function(A3) {
          return FA(A3) && pA.call(A3, "callee") && !Xe.call(A3, "callee");
        }, eA = J.isArray, ND = Le ? EI(Le) : Uu;
        function $A(A3) {
          return A3 != null && FQ(A3.length) && !PI(A3);
        }
        function LA(A3) {
          return FA(A3) && $A(A3);
        }
        function kD(A3) {
          return A3 === true || A3 === false || FA(A3) && ZA(A3) == M;
        }
        var ng = qc || $t, dD = Ue ? EI(Ue) : Ju;
        function SD(A3) {
          return FA(A3) && A3.nodeType === 1 && !lB(A3);
        }
        function MD(A3) {
          if (A3 == null) return true;
          if ($A(A3) && (eA(A3) || typeof A3 == "string" || typeof A3.splice == "function" || ng(A3) || Og(A3) || Ng(A3))) return !A3.length;
          var I2 = jA(A3);
          if (I2 == j || I2 == KA) return !A3.size;
          if (uB(A3)) return !ht(A3).length;
          for (var C in A3) if (pA.call(A3, C)) return false;
          return true;
        }
        function RD(A3, I2) {
          return aB(A3, I2);
        }
        function FD(A3, I2, C) {
          C = typeof C == "function" ? C : Q;
          var E = C ? C(A3, I2) : Q;
          return E === Q ? aB(A3, I2, Q, C) : !!E;
        }
        function bt(A3) {
          if (!FA(A3)) return false;
          var I2 = ZA(A3);
          return I2 == q || I2 == m || typeof A3.message == "string" && typeof A3.name == "string" && !lB(A3);
        }
        function LD(A3) {
          return typeof A3 == "number" && $e(A3);
        }
        function PI(A3) {
          if (!SA(A3)) return false;
          var I2 = ZA(A3);
          return I2 == W || I2 == H || I2 == N || I2 == sI;
        }
        function pn(A3) {
          return typeof A3 == "number" && A3 == nA(A3);
        }
        function FQ(A3) {
          return typeof A3 == "number" && A3 > -1 && A3 % 1 == 0 && A3 <= _A;
        }
        function SA(A3) {
          var I2 = typeof A3;
          return A3 != null && (I2 == "object" || I2 == "function");
        }
        function FA(A3) {
          return A3 != null && typeof A3 == "object";
        }
        var wn = Je ? EI(Je) : mu;
        function UD(A3, I2) {
          return A3 === I2 || ut(A3, I2, Ut(I2));
        }
        function JD(A3, I2, C) {
          return C = typeof C == "function" ? C : Q, ut(A3, I2, Ut(I2), C);
        }
        function YD(A3) {
          return fn(A3) && A3 != +A3;
        }
        function mD(A3) {
          if (Dh(A3)) throw new EA(e);
          return ri(A3);
        }
        function vD(A3) {
          return A3 === null;
        }
        function HD(A3) {
          return A3 == null;
        }
        function fn(A3) {
          return typeof A3 == "number" || FA(A3) && ZA(A3) == $4;
        }
        function lB(A3) {
          if (!FA(A3) || ZA(A3) != tA) return false;
          var I2 = QQ(A3);
          if (I2 === null) return true;
          var C = pA.call(I2, "constructor") && I2.constructor;
          return typeof C == "function" && C instanceof C && AQ.call(C) == Jc;
        }
        var xt = Ye ? EI(Ye) : vu;
        function KD(A3) {
          return pn(A3) && A3 >= -_A && A3 <= _A;
        }
        var yn = me ? EI(me) : Hu;
        function LQ(A3) {
          return typeof A3 == "string" || !eA(A3) && FA(A3) && ZA(A3) == CI;
        }
        function iI(A3) {
          return typeof A3 == "symbol" || FA(A3) && ZA(A3) == OA;
        }
        var Og = ve ? EI(ve) : Ku;
        function qD(A3) {
          return A3 === Q;
        }
        function TD(A3) {
          return FA(A3) && jA(A3) == PA;
        }
        function OD(A3) {
          return FA(A3) && ZA(A3) == cg;
        }
        var bD = fQ(lt2), xD = fQ(function(A3, I2) {
          return A3 <= I2;
        });
        function Gn(A3) {
          if (!A3) return [];
          if ($A(A3)) return LQ(A3) ? kI(A3) : zA(A3);
          if (CB && A3[CB]) return fc(A3[CB]());
          var I2 = jA(A3), C = I2 == j ? Ct : I2 == KA ? XB : bg;
          return C(A3);
        }
        function WI(A3) {
          if (!A3) return A3 === 0 ? A3 : 0;
          if (A3 = fI(A3), A3 === NI || A3 === -NI) {
            var I2 = A3 < 0 ? -1 : 1;
            return I2 * BB;
          }
          return A3 === A3 ? A3 : 0;
        }
        function nA(A3) {
          var I2 = WI(A3), C = I2 % 1;
          return I2 === I2 ? C ? I2 - C : I2 : 0;
        }
        function Nn(A3) {
          return A3 ? wg(nA(A3), 0, QI) : 0;
        }
        function fI(A3) {
          if (typeof A3 == "number") return A3;
          if (iI(A3)) return zI;
          if (SA(A3)) {
            var I2 = typeof A3.valueOf == "function" ? A3.valueOf() : A3;
            A3 = SA(I2) ? I2 + "" : I2;
          }
          if (typeof A3 != "string") return A3 === 0 ? A3 : +A3;
          A3 = be(A3);
          var C = Ns.test(A3);
          return C || ds.test(A3) ? Cc(A3.slice(2), C ? 2 : 8) : Gs.test(A3) ? zI : +A3;
        }
        function kn(A3) {
          return UI(A3, AI(A3));
        }
        function _D(A3) {
          return A3 ? wg(nA(A3), -_A, _A) : A3 === 0 ? A3 : 0;
        }
        function DA(A3) {
          return A3 == null ? "" : eI(A3);
        }
        var PD = Kg(function(A3, I2) {
          if (uB(I2) || $A(I2)) {
            UI(I2, qA(I2), A3);
            return;
          }
          for (var C in I2) pA.call(I2, C) && nB(A3, C, I2[C]);
        }), dn = Kg(function(A3, I2) {
          UI(I2, AI(I2), A3);
        }), UQ = Kg(function(A3, I2, C, E) {
          UI(I2, AI(I2), A3, E);
        }), WD = Kg(function(A3, I2, C, E) {
          UI(I2, qA(I2), A3, E);
        }), jD = xI(ot);
        function ZD(A3, I2) {
          var C = Hg(A3);
          return I2 == null ? C : Qi(C, I2);
        }
        var VD = rA(function(A3, I2) {
          A3 = fA(A3);
          var C = -1, E = I2.length, r = E > 2 ? I2[2] : Q;
          for (r && VA(I2[0], I2[1], r) && (E = 1); ++C < E; ) for (var D = I2[C], w = AI(D), y = -1, d = w.length; ++y < d; ) {
            var T = w[y], O2 = A3[T];
            (O2 === Q || SI(O2, Yg[T]) && !pA.call(A3, T)) && (A3[T] = D[T]);
          }
          return A3;
        }), XD = rA(function(A3) {
          return A3.push(Q, bi), tI(Sn, Q, A3);
        });
        function zD(A3, I2) {
          return Ke(A3, BA(I2, 3), LI);
        }
        function $D(A3, I2) {
          return Ke(A3, BA(I2, 3), at);
        }
        function Ap(A3, I2) {
          return A3 == null ? A3 : rt(A3, BA(I2, 3), AI);
        }
        function Ip(A3, I2) {
          return A3 == null ? A3 : ii(A3, BA(I2, 3), AI);
        }
        function gp(A3, I2) {
          return A3 && LI(A3, BA(I2, 3));
        }
        function Bp(A3, I2) {
          return A3 && at(A3, BA(I2, 3));
        }
        function Qp(A3) {
          return A3 == null ? [] : sQ(A3, qA(A3));
        }
        function Cp(A3) {
          return A3 == null ? [] : sQ(A3, AI(A3));
        }
        function _t(A3, I2, C) {
          var E = A3 == null ? Q : fg(A3, I2);
          return E === Q ? C : E;
        }
        function tp(A3, I2) {
          return A3 != null && Pi(A3, I2, Mu);
        }
        function Pt(A3, I2) {
          return A3 != null && Pi(A3, I2, Ru);
        }
        var Ep = Hi(function(A3, I2, C) {
          I2 != null && typeof I2.toString != "function" && (I2 = IQ.call(I2)), A3[I2] = C;
        }, jt(II)), ep = Hi(function(A3, I2, C) {
          I2 != null && typeof I2.toString != "function" && (I2 = IQ.call(I2)), pA.call(A3, I2) ? A3[I2].push(C) : A3[I2] = [C];
        }, BA), ip = rA(rB);
        function qA(A3) {
          return $A(A3) ? gi(A3) : ht(A3);
        }
        function AI(A3) {
          return $A(A3) ? gi(A3, true) : qu(A3);
        }
        function np(A3, I2) {
          var C = {};
          return I2 = BA(I2, 3), LI(A3, function(E, r, D) {
            OI(C, I2(E, r, D), E);
          }), C;
        }
        function op(A3, I2) {
          var C = {};
          return I2 = BA(I2, 3), LI(A3, function(E, r, D) {
            OI(C, r, I2(E, r, D));
          }), C;
        }
        var rp = Kg(function(A3, I2, C) {
          cQ(A3, I2, C);
        }), Sn = Kg(function(A3, I2, C, E) {
          cQ(A3, I2, C, E);
        }), ap = xI(function(A3, I2) {
          var C = {};
          if (A3 == null) return C;
          var E = false;
          I2 = kA(I2, function(D) {
            return D = eg(D, A3), E || (E = D.length > 1), D;
          }), UI(A3, Ft(A3), C), E && (C = DI(C, c | l | i2, Eh));
          for (var r = I2.length; r--; ) yt(C, I2[r]);
          return C;
        });
        function sp2(A3, I2) {
          return Mn(A3, RQ(BA(I2)));
        }
        var cp = xI(function(A3, I2) {
          return A3 == null ? {} : Ou(A3, I2);
        });
        function Mn(A3, I2) {
          if (A3 == null) return {};
          var C = kA(Ft(A3), function(E) {
            return [E];
          });
          return I2 = BA(I2), Di(A3, C, function(E, r) {
            return I2(E, r[0]);
          });
        }
        function up(A3, I2, C) {
          I2 = eg(I2, A3);
          var E = -1, r = I2.length;
          for (r || (r = 1, A3 = Q); ++E < r; ) {
            var D = A3 == null ? Q : A3[JI(I2[E])];
            D === Q && (E = r, D = C), A3 = PI(D) ? D.call(A3) : D;
          }
          return A3;
        }
        function hp(A3, I2, C) {
          return A3 == null ? A3 : sB(A3, I2, C);
        }
        function lp(A3, I2, C, E) {
          return E = typeof E == "function" ? E : Q, A3 == null ? A3 : sB(A3, I2, C, E);
        }
        var Rn = Ti(qA), Fn = Ti(AI);
        function Dp(A3, I2, C) {
          var E = eA(A3), r = E || ng(A3) || Og(A3);
          if (I2 = BA(I2, 4), C == null) {
            var D = A3 && A3.constructor;
            r ? C = E ? new D() : [] : SA(A3) ? C = PI(D) ? Hg(QQ(A3)) : {} : C = {};
          }
          return (r ? uI : LI)(A3, function(w, y, d) {
            return I2(C, w, y, d);
          }), C;
        }
        function pp(A3, I2) {
          return A3 == null ? true : yt(A3, I2);
        }
        function wp(A3, I2, C) {
          return A3 == null ? A3 : Gi(A3, I2, kt(C));
        }
        function fp(A3, I2, C, E) {
          return E = typeof E == "function" ? E : Q, A3 == null ? A3 : Gi(A3, I2, kt(C), E);
        }
        function bg(A3) {
          return A3 == null ? [] : Qt(A3, qA(A3));
        }
        function yp(A3) {
          return A3 == null ? [] : Qt(A3, AI(A3));
        }
        function Gp(A3, I2, C) {
          return C === Q && (C = I2, I2 = Q), C !== Q && (C = fI(C), C = C === C ? C : 0), I2 !== Q && (I2 = fI(I2), I2 = I2 === I2 ? I2 : 0), wg(fI(A3), I2, C);
        }
        function Np(A3, I2, C) {
          return I2 = WI(I2), C === Q ? (C = I2, I2 = 0) : C = WI(C), A3 = fI(A3), Fu(A3, I2, C);
        }
        function kp(A3, I2, C) {
          if (C && typeof C != "boolean" && VA(A3, I2, C) && (I2 = C = Q), C === Q && (typeof I2 == "boolean" ? (C = I2, I2 = Q) : typeof A3 == "boolean" && (C = A3, A3 = Q)), A3 === Q && I2 === Q ? (A3 = 0, I2 = 1) : (A3 = WI(A3), I2 === Q ? (I2 = A3, A3 = 0) : I2 = WI(I2)), A3 > I2) {
            var E = A3;
            A3 = I2, I2 = E;
          }
          if (C || A3 % 1 || I2 % 1) {
            var r = Ai();
            return WA(A3 + r * (I2 - A3 + Qc("1e-" + ((r + "").length - 1))), I2);
          }
          return pt(A3, I2);
        }
        var dp = qg(function(A3, I2, C) {
          return I2 = I2.toLowerCase(), A3 + (C ? Ln(I2) : I2);
        });
        function Ln(A3) {
          return Wt(DA(A3).toLowerCase());
        }
        function Un(A3) {
          return A3 = DA(A3), A3 && A3.replace(Ms, hc).replace(js, "");
        }
        function Sp(A3, I2, C) {
          A3 = DA(A3), I2 = eI(I2);
          var E = A3.length;
          C = C === Q ? E : wg(nA(C), 0, E);
          var r = C;
          return C -= I2.length, C >= 0 && A3.slice(C, r) == I2;
        }
        function Mp(A3) {
          return A3 = DA(A3), A3 && is.test(A3) ? A3.replace(ie, lc) : A3;
        }
        function Rp(A3) {
          return A3 = DA(A3), A3 && cs.test(A3) ? A3.replace(OC, "\\$&") : A3;
        }
        var Fp = qg(function(A3, I2, C) {
          return A3 + (C ? "-" : "") + I2.toLowerCase();
        }), Lp = qg(function(A3, I2, C) {
          return A3 + (C ? " " : "") + I2.toLowerCase();
        }), Up = Yi("toLowerCase");
        function Jp(A3, I2, C) {
          A3 = DA(A3), I2 = nA(I2);
          var E = I2 ? Ug(A3) : 0;
          if (!I2 || E >= I2) return A3;
          var r = (I2 - E) / 2;
          return wQ(eQ(r), C) + A3 + wQ(EQ(r), C);
        }
        function Yp(A3, I2, C) {
          A3 = DA(A3), I2 = nA(I2);
          var E = I2 ? Ug(A3) : 0;
          return I2 && E < I2 ? A3 + wQ(I2 - E, C) : A3;
        }
        function mp(A3, I2, C) {
          A3 = DA(A3), I2 = nA(I2);
          var E = I2 ? Ug(A3) : 0;
          return I2 && E < I2 ? wQ(I2 - E, C) + A3 : A3;
        }
        function vp(A3, I2, C) {
          return C || I2 == null ? I2 = 0 : I2 && (I2 = +I2), xc(DA(A3).replace(bC, ""), I2 || 0);
        }
        function Hp(A3, I2, C) {
          return (C ? VA(A3, I2, C) : I2 === Q) ? I2 = 1 : I2 = nA(I2), wt(DA(A3), I2);
        }
        function Kp() {
          var A3 = arguments, I2 = DA(A3[0]);
          return A3.length < 3 ? I2 : I2.replace(A3[1], A3[2]);
        }
        var qp = qg(function(A3, I2, C) {
          return A3 + (C ? "_" : "") + I2.toLowerCase();
        });
        function Tp(A3, I2, C) {
          return C && typeof C != "number" && VA(A3, I2, C) && (I2 = C = Q), C = C === Q ? QI : C >>> 0, C ? (A3 = DA(A3), A3 && (typeof I2 == "string" || I2 != null && !xt(I2)) && (I2 = eI(I2), !I2 && Lg(A3)) ? ig(kI(A3), 0, C) : A3.split(I2, C)) : [];
        }
        var Op = qg(function(A3, I2, C) {
          return A3 + (C ? " " : "") + Wt(I2);
        });
        function bp(A3, I2, C) {
          return A3 = DA(A3), C = C == null ? 0 : wg(nA(C), 0, A3.length), I2 = eI(I2), A3.slice(C, C + I2.length) == I2;
        }
        function xp(A3, I2, C) {
          var E = h.templateSettings;
          C && VA(A3, I2, C) && (I2 = Q), A3 = DA(A3), I2 = UQ({}, I2, E, Oi);
          var r = UQ({}, I2.imports, E.imports, Oi), D = qA(r), w = Qt(r, D), y, d, T = 0, O2 = I2.interpolate || PB, _ = "__p += '", V2 = tt((I2.escape || PB).source + "|" + O2.source + "|" + (O2 === ne ? ys : PB).source + "|" + (I2.evaluate || PB).source + "|$", "g"), z = "//# sourceURL=" + (pA.call(I2, "sourceURL") ? (I2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++$s + "]") + `
`;
          A3.replace(V2, function(CA, aA, hA, nI, XA, oI) {
            return hA || (hA = nI), _ += A3.slice(T, oI).replace(Rs, Dc), aA && (y = true, _ += `' +
__e(` + aA + `) +
'`), XA && (d = true, _ += `';
` + XA + `;
__p += '`), hA && (_ += `' +
((__t = (` + hA + `)) == null ? '' : __t) +
'`), T = oI + CA.length, CA;
          }), _ += `';
`;
          var QA = pA.call(I2, "variable") && I2.variable;
          if (!QA) _ = `with (obj) {
` + _ + `
}
`;
          else if (ws.test(QA)) throw new EA(o);
          _ = (d ? _.replace(Cs, "") : _).replace(ts, "$1").replace(Es, "$1;"), _ = "function(" + (QA || "obj") + `) {
` + (QA ? "" : `obj || (obj = {});
`) + "var __t, __p = ''" + (y ? ", __e = _.escape" : "") + (d ? `, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
` : `;
`) + _ + `return __p
}`;
          var oA = Yn2(function() {
            return lA(D, z + "return " + _).apply(Q, w);
          });
          if (oA.source = _, bt(oA)) throw oA;
          return oA;
        }
        function _p(A3) {
          return DA(A3).toLowerCase();
        }
        function Pp(A3) {
          return DA(A3).toUpperCase();
        }
        function Wp(A3, I2, C) {
          if (A3 = DA(A3), A3 && (C || I2 === Q)) return be(A3);
          if (!A3 || !(I2 = eI(I2))) return A3;
          var E = kI(A3), r = kI(I2), D = xe(E, r), w = _e(E, r) + 1;
          return ig(E, D, w).join("");
        }
        function jp(A3, I2, C) {
          if (A3 = DA(A3), A3 && (C || I2 === Q)) return A3.slice(0, We(A3) + 1);
          if (!A3 || !(I2 = eI(I2))) return A3;
          var E = kI(A3), r = _e(E, kI(I2)) + 1;
          return ig(E, 0, r).join("");
        }
        function Zp(A3, I2, C) {
          if (A3 = DA(A3), A3 && (C || I2 === Q)) return A3.replace(bC, "");
          if (!A3 || !(I2 = eI(I2))) return A3;
          var E = kI(A3), r = xe(E, kI(I2));
          return ig(E, r).join("");
        }
        function Vp(A3, I2) {
          var C = RA, E = JA;
          if (SA(I2)) {
            var r = "separator" in I2 ? I2.separator : r;
            C = "length" in I2 ? nA(I2.length) : C, E = "omission" in I2 ? eI(I2.omission) : E;
          }
          A3 = DA(A3);
          var D = A3.length;
          if (Lg(A3)) {
            var w = kI(A3);
            D = w.length;
          }
          if (C >= D) return A3;
          var y = C - Ug(E);
          if (y < 1) return E;
          var d = w ? ig(w, 0, y).join("") : A3.slice(0, y);
          if (r === Q) return d + E;
          if (w && (y += d.length - y), xt(r)) {
            if (A3.slice(y).search(r)) {
              var T, O2 = d;
              for (r.global || (r = tt(r.source, DA(oe.exec(r)) + "g")), r.lastIndex = 0; T = r.exec(O2); ) var _ = T.index;
              d = d.slice(0, _ === Q ? y : _);
            }
          } else if (A3.indexOf(eI(r), y) != y) {
            var V2 = d.lastIndexOf(r);
            V2 > -1 && (d = d.slice(0, V2));
          }
          return d + E;
        }
        function Xp(A3) {
          return A3 = DA(A3), A3 && es.test(A3) ? A3.replace(ee, kc) : A3;
        }
        var zp = qg(function(A3, I2, C) {
          return A3 + (C ? " " : "") + I2.toUpperCase();
        }), Wt = Yi("toUpperCase");
        function Jn(A3, I2, C) {
          return A3 = DA(A3), I2 = C ? Q : I2, I2 === Q ? wc(A3) ? Mc(A3) : rc(A3) : A3.match(I2) || [];
        }
        var Yn2 = rA(function(A3, I2) {
          try {
            return tI(A3, Q, I2);
          } catch (C) {
            return bt(C) ? C : new EA(C);
          }
        }), $p = xI(function(A3, I2) {
          return uI(I2, function(C) {
            C = JI(C), OI(A3, C, Tt(A3[C], A3));
          }), A3;
        });
        function Aw(A3) {
          var I2 = A3 == null ? 0 : A3.length, C = BA();
          return A3 = I2 ? kA(A3, function(E) {
            if (typeof E[1] != "function") throw new hI(a);
            return [C(E[0]), E[1]];
          }) : [], rA(function(E) {
            for (var r = -1; ++r < I2; ) {
              var D = A3[r];
              if (tI(D[0], this, E)) return tI(D[1], this, E);
            }
          });
        }
        function Iw(A3) {
          return ku(DI(A3, c));
        }
        function jt(A3) {
          return function() {
            return A3;
          };
        }
        function gw(A3, I2) {
          return A3 == null || A3 !== A3 ? I2 : A3;
        }
        var Bw = vi(), Qw = vi(true);
        function II(A3) {
          return A3;
        }
        function Zt(A3) {
          return ai(typeof A3 == "function" ? A3 : DI(A3, c));
        }
        function Cw(A3) {
          return ci(DI(A3, c));
        }
        function tw(A3, I2) {
          return ui(A3, DI(I2, c));
        }
        var Ew = rA(function(A3, I2) {
          return function(C) {
            return rB(C, A3, I2);
          };
        }), ew = rA(function(A3, I2) {
          return function(C) {
            return rB(A3, C, I2);
          };
        });
        function Vt(A3, I2, C) {
          var E = qA(I2), r = sQ(I2, E);
          C == null && !(SA(I2) && (r.length || !E.length)) && (C = I2, I2 = A3, A3 = this, r = sQ(I2, qA(I2)));
          var D = !(SA(C) && "chain" in C) || !!C.chain, w = PI(A3);
          return uI(r, function(y) {
            var d = I2[y];
            A3[y] = d, w && (A3.prototype[y] = function() {
              var T = this.__chain__;
              if (D || T) {
                var O2 = A3(this.__wrapped__), _ = O2.__actions__ = zA(this.__actions__);
                return _.push({ func: d, args: arguments, thisArg: A3 }), O2.__chain__ = T, O2;
              }
              return d.apply(A3, Bg([this.value()], arguments));
            });
          }), A3;
        }
        function iw() {
          return bA._ === this && (bA._ = Yc), this;
        }
        function Xt() {
        }
        function nw(A3) {
          return A3 = nA(A3), rA(function(I2) {
            return hi(I2, A3);
          });
        }
        var ow = St(kA), rw = St(He), aw = St($C);
        function mn(A3) {
          return Yt(A3) ? At3(JI(A3)) : bu(A3);
        }
        function sw(A3) {
          return function(I2) {
            return A3 == null ? Q : fg(A3, I2);
          };
        }
        var cw = Ki(), uw = Ki(true);
        function zt() {
          return [];
        }
        function $t() {
          return false;
        }
        function hw() {
          return {};
        }
        function lw() {
          return "";
        }
        function Dw() {
          return true;
        }
        function pw(A3, I2) {
          if (A3 = nA(A3), A3 < 1 || A3 > _A) return [];
          var C = QI, E = WA(A3, QI);
          I2 = BA(I2), A3 -= QI;
          for (var r = Bt(E, I2); ++C < A3; ) I2(C);
          return r;
        }
        function ww(A3) {
          return eA(A3) ? kA(A3, JI) : iI(A3) ? [A3] : zA(In3(DA(A3)));
        }
        function fw(A3) {
          var I2 = ++Uc;
          return DA(A3) + I2;
        }
        var yw = pQ(function(A3, I2) {
          return A3 + I2;
        }, 0), Gw = Mt("ceil"), Nw = pQ(function(A3, I2) {
          return A3 / I2;
        }, 1), kw = Mt("floor");
        function dw(A3) {
          return A3 && A3.length ? aQ(A3, II, st) : Q;
        }
        function Sw(A3, I2) {
          return A3 && A3.length ? aQ(A3, BA(I2, 2), st) : Q;
        }
        function Mw(A3) {
          return Te(A3, II);
        }
        function Rw(A3, I2) {
          return Te(A3, BA(I2, 2));
        }
        function Fw(A3) {
          return A3 && A3.length ? aQ(A3, II, lt2) : Q;
        }
        function Lw(A3, I2) {
          return A3 && A3.length ? aQ(A3, BA(I2, 2), lt2) : Q;
        }
        var Uw = pQ(function(A3, I2) {
          return A3 * I2;
        }, 1), Jw = Mt("round"), Yw = pQ(function(A3, I2) {
          return A3 - I2;
        }, 0);
        function mw(A3) {
          return A3 && A3.length ? gt2(A3, II) : 0;
        }
        function vw(A3, I2) {
          return A3 && A3.length ? gt2(A3, BA(I2, 2)) : 0;
        }
        return h.after = CD, h.ary = an, h.assign = PD, h.assignIn = dn, h.assignInWith = UQ, h.assignWith = WD, h.at = jD, h.before = sn, h.bind = Tt, h.bindAll = $p, h.bindKey = cn, h.castArray = hD, h.chain = nn, h.chunk = kh, h.compact = dh, h.concat = Sh, h.cond = Aw, h.conforms = Iw, h.constant = jt, h.countBy = ml, h.create = ZD, h.curry = un, h.curryRight = hn, h.debounce = ln, h.defaults = VD, h.defaultsDeep = XD, h.defer = tD, h.delay = ED, h.difference = Mh, h.differenceBy = Rh, h.differenceWith = Fh, h.drop = Lh, h.dropRight = Uh, h.dropRightWhile = Jh, h.dropWhile = Yh, h.fill = mh, h.filter = Hl, h.flatMap = Tl, h.flatMapDeep = Ol, h.flatMapDepth = bl, h.flatten = Cn, h.flattenDeep = vh, h.flattenDepth = Hh, h.flip = eD, h.flow = Bw, h.flowRight = Qw, h.fromPairs = Kh, h.functions = Qp, h.functionsIn = Cp, h.groupBy = xl, h.initial = Th, h.intersection = Oh, h.intersectionBy = bh, h.intersectionWith = xh, h.invert = Ep, h.invertBy = ep, h.invokeMap = Pl, h.iteratee = Zt, h.keyBy = Wl, h.keys = qA, h.keysIn = AI, h.map = dQ, h.mapKeys = np, h.mapValues = op, h.matches = Cw, h.matchesProperty = tw, h.memoize = MQ, h.merge = rp, h.mergeWith = Sn, h.method = Ew, h.methodOf = ew, h.mixin = Vt, h.negate = RQ, h.nthArg = nw, h.omit = ap, h.omitBy = sp2, h.once = iD, h.orderBy = jl, h.over = ow, h.overArgs = nD, h.overEvery = rw, h.overSome = aw, h.partial = Ot, h.partialRight = Dn, h.partition = Zl, h.pick = cp, h.pickBy = Mn, h.property = mn, h.propertyOf = sw, h.pull = jh, h.pullAll = En, h.pullAllBy = Zh, h.pullAllWith = Vh, h.pullAt = Xh, h.range = cw, h.rangeRight = uw, h.rearg = oD, h.reject = zl, h.remove = zh, h.rest = rD, h.reverse = Kt, h.sampleSize = AD, h.set = hp, h.setWith = lp, h.shuffle = ID2, h.slice = $h, h.sortBy = QD, h.sortedUniq = tl, h.sortedUniqBy = El, h.split = Tp, h.spread = aD, h.tail = el, h.take = il, h.takeRight = nl, h.takeRightWhile = ol, h.takeWhile = rl, h.tap = dl, h.throttle = sD, h.thru = kQ, h.toArray = Gn, h.toPairs = Rn, h.toPairsIn = Fn, h.toPath = ww, h.toPlainObject = kn, h.transform = Dp, h.unary = cD, h.union = al, h.unionBy = sl, h.unionWith = cl, h.uniq = ul, h.uniqBy = hl, h.uniqWith = ll, h.unset = pp, h.unzip = qt, h.unzipWith = en, h.update = wp, h.updateWith = fp, h.values = bg, h.valuesIn = yp, h.without = Dl, h.words = Jn, h.wrap = uD, h.xor = pl, h.xorBy = wl, h.xorWith = fl, h.zip = yl, h.zipObject = Gl, h.zipObjectDeep = Nl, h.zipWith = kl, h.entries = Rn, h.entriesIn = Fn, h.extend = dn, h.extendWith = UQ, Vt(h, h), h.add = yw, h.attempt = Yn2, h.camelCase = dp, h.capitalize = Ln, h.ceil = Gw, h.clamp = Gp, h.clone = lD, h.cloneDeep = pD, h.cloneDeepWith = wD, h.cloneWith = DD, h.conformsTo = fD, h.deburr = Un, h.defaultTo = gw, h.divide = Nw, h.endsWith = Sp, h.eq = SI, h.escape = Mp, h.escapeRegExp = Rp, h.every = vl, h.find = Kl, h.findIndex = Bn, h.findKey = zD, h.findLast = ql, h.findLastIndex = Qn, h.findLastKey = $D, h.floor = kw, h.forEach = on, h.forEachRight = rn, h.forIn = Ap, h.forInRight = Ip, h.forOwn = gp, h.forOwnRight = Bp, h.get = _t, h.gt = yD, h.gte = GD, h.has = tp, h.hasIn = Pt, h.head = tn, h.identity = II, h.includes = _l, h.indexOf = qh, h.inRange = Np, h.invoke = ip, h.isArguments = Ng, h.isArray = eA, h.isArrayBuffer = ND, h.isArrayLike = $A, h.isArrayLikeObject = LA, h.isBoolean = kD, h.isBuffer = ng, h.isDate = dD, h.isElement = SD, h.isEmpty = MD, h.isEqual = RD, h.isEqualWith = FD, h.isError = bt, h.isFinite = LD, h.isFunction = PI, h.isInteger = pn, h.isLength = FQ, h.isMap = wn, h.isMatch = UD, h.isMatchWith = JD, h.isNaN = YD, h.isNative = mD, h.isNil = HD, h.isNull = vD, h.isNumber = fn, h.isObject = SA, h.isObjectLike = FA, h.isPlainObject = lB, h.isRegExp = xt, h.isSafeInteger = KD, h.isSet = yn, h.isString = LQ, h.isSymbol = iI, h.isTypedArray = Og, h.isUndefined = qD, h.isWeakMap = TD, h.isWeakSet = OD, h.join = _h, h.kebabCase = Fp, h.last = wI, h.lastIndexOf = Ph, h.lowerCase = Lp, h.lowerFirst = Up, h.lt = bD, h.lte = xD, h.max = dw, h.maxBy = Sw, h.mean = Mw, h.meanBy = Rw, h.min = Fw, h.minBy = Lw, h.stubArray = zt, h.stubFalse = $t, h.stubObject = hw, h.stubString = lw, h.stubTrue = Dw, h.multiply = Uw, h.nth = Wh, h.noConflict = iw, h.noop = Xt, h.now = SQ, h.pad = Jp, h.padEnd = Yp, h.padStart = mp, h.parseInt = vp, h.random = kp, h.reduce = Vl, h.reduceRight = Xl, h.repeat = Hp, h.replace = Kp, h.result = up, h.round = Jw, h.runInContext = k, h.sample = $l, h.size = gD, h.snakeCase = qp, h.some = BD, h.sortedIndex = Al, h.sortedIndexBy = Il, h.sortedIndexOf = gl, h.sortedLastIndex = Bl, h.sortedLastIndexBy = Ql, h.sortedLastIndexOf = Cl, h.startCase = Op, h.startsWith = bp, h.subtract = Yw, h.sum = mw, h.sumBy = vw, h.template = xp, h.times = pw, h.toFinite = WI, h.toInteger = nA, h.toLength = Nn, h.toLower = _p, h.toNumber = fI, h.toSafeInteger = _D, h.toString = DA, h.toUpper = Pp, h.trim = Wp, h.trimEnd = jp, h.trimStart = Zp, h.truncate = Vp, h.unescape = Xp, h.uniqueId = fw, h.upperCase = zp, h.upperFirst = Wt, h.each = on, h.eachRight = rn, h.first = tn, Vt(h, function() {
          var A3 = {};
          return LI(h, function(I2, C) {
            pA.call(h.prototype, C) || (A3[C] = I2);
          }), A3;
        }(), { chain: false }), h.VERSION = t, uI(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(A3) {
          h[A3].placeholder = h;
        }), uI(["drop", "take"], function(A3, I2) {
          sA.prototype[A3] = function(C) {
            C = C === Q ? 1 : vA(nA(C), 0);
            var E = this.__filtered__ && !I2 ? new sA(this) : this.clone();
            return E.__filtered__ ? E.__takeCount__ = WA(C, E.__takeCount__) : E.__views__.push({ size: WA(C, QI), type: A3 + (E.__dir__ < 0 ? "Right" : "") }), E;
          }, sA.prototype[A3 + "Right"] = function(C) {
            return this.reverse()[A3](C).reverse();
          };
        }), uI(["filter", "map", "takeWhile"], function(A3, I2) {
          var C = I2 + 1, E = C == sg || C == Mg;
          sA.prototype[A3] = function(r) {
            var D = this.clone();
            return D.__iteratees__.push({ iteratee: BA(r, 3), type: C }), D.__filtered__ = D.__filtered__ || E, D;
          };
        }), uI(["head", "last"], function(A3, I2) {
          var C = "take" + (I2 ? "Right" : "");
          sA.prototype[A3] = function() {
            return this[C](1).value()[0];
          };
        }), uI(["initial", "tail"], function(A3, I2) {
          var C = "drop" + (I2 ? "" : "Right");
          sA.prototype[A3] = function() {
            return this.__filtered__ ? new sA(this) : this[C](1);
          };
        }), sA.prototype.compact = function() {
          return this.filter(II);
        }, sA.prototype.find = function(A3) {
          return this.filter(A3).head();
        }, sA.prototype.findLast = function(A3) {
          return this.reverse().find(A3);
        }, sA.prototype.invokeMap = rA(function(A3, I2) {
          return typeof A3 == "function" ? new sA(this) : this.map(function(C) {
            return rB(C, A3, I2);
          });
        }), sA.prototype.reject = function(A3) {
          return this.filter(RQ(BA(A3)));
        }, sA.prototype.slice = function(A3, I2) {
          A3 = nA(A3);
          var C = this;
          return C.__filtered__ && (A3 > 0 || I2 < 0) ? new sA(C) : (A3 < 0 ? C = C.takeRight(-A3) : A3 && (C = C.drop(A3)), I2 !== Q && (I2 = nA(I2), C = I2 < 0 ? C.dropRight(-I2) : C.take(I2 - A3)), C);
        }, sA.prototype.takeRightWhile = function(A3) {
          return this.reverse().takeWhile(A3).reverse();
        }, sA.prototype.toArray = function() {
          return this.take(QI);
        }, LI(sA.prototype, function(A3, I2) {
          var C = /^(?:filter|find|map|reject)|While$/.test(I2), E = /^(?:head|last)$/.test(I2), r = h[E ? "take" + (I2 == "last" ? "Right" : "") : I2], D = E || /^find/.test(I2);
          r && (h.prototype[I2] = function() {
            var w = this.__wrapped__, y = E ? [1] : arguments, d = w instanceof sA, T = y[0], O2 = d || eA(w), _ = function(aA) {
              var hA = r.apply(h, Bg([aA], y));
              return E && V2 ? hA[0] : hA;
            };
            O2 && C && typeof T == "function" && T.length != 1 && (d = O2 = false);
            var V2 = this.__chain__, z = !!this.__actions__.length, QA = D && !V2, oA = d && !z;
            if (!D && O2) {
              w = oA ? w : new sA(this);
              var CA = A3.apply(w, y);
              return CA.__actions__.push({ func: kQ, args: [_], thisArg: Q }), new lI(CA, V2);
            }
            return QA && oA ? A3.apply(this, y) : (CA = this.thru(_), QA ? E ? CA.value()[0] : CA.value() : CA);
          });
        }), uI(["pop", "push", "shift", "sort", "splice", "unshift"], function(A3) {
          var I2 = zB[A3], C = /^(?:push|sort|unshift)$/.test(A3) ? "tap" : "thru", E = /^(?:pop|shift)$/.test(A3);
          h.prototype[A3] = function() {
            var r = arguments;
            if (E && !this.__chain__) {
              var D = this.value();
              return I2.apply(eA(D) ? D : [], r);
            }
            return this[C](function(w) {
              return I2.apply(eA(w) ? w : [], r);
            });
          };
        }), LI(sA.prototype, function(A3, I2) {
          var C = h[I2];
          if (C) {
            var E = C.name + "";
            pA.call(vg, E) || (vg[E] = []), vg[E].push({ name: I2, func: C });
          }
        }), vg[DQ(Q, L).name] = [{ name: "wrapper", func: Q }], sA.prototype.clone = Xc, sA.prototype.reverse = zc, sA.prototype.value = $c, h.prototype.at = Sl, h.prototype.chain = Ml, h.prototype.commit = Rl, h.prototype.next = Fl, h.prototype.plant = Ul, h.prototype.reverse = Jl, h.prototype.toJSON = h.prototype.valueOf = h.prototype.value = Yl, h.prototype.first = h.prototype.head, CB && (h.prototype[CB] = Ll), h;
      }, Jg = Rc();
      hg ? ((hg.exports = Jg)._ = Jg, ZC._ = Jg) : bA._ = Jg;
    }).call(yI);
  }(DB, DB.exports);
  var dA = DB.exports, BE;
  (function(g) {
    g[g.COMPONENT = 0] = "COMPONENT", g[g.RULESET = 1] = "RULESET", g[g.DOCUMENT_PUSH = 2] = "DOCUMENT_PUSH";
  })(BE || (BE = {}));
  class K {
  }
  K.APP_NAME = "Formbird", K.SYSTEM_TYPE_DOCUMENT = "document", K.SYSTEM_TYPE_VERSION = "version", K.SYSTEM_TYPE_TEMPLATE = "template", K.SYSTEM_TYPE_ACCOUNT = "account", K.SYSTEM_TYPE_LOGIN = "login", K.SYSTEM_TYPE_RULESET_DOCUMENT = "rulesetdocument", K.SYSTEM_TYPE_SYSTEM_ACTION = "systemaction", K.SYSTEM_TYPE_SCHEDULE = "schedule", K.SYSTEM_TYPE_FILE_REFERENCE = "fileReference", K.SYSTEM_TYPE_CONFIGURATION = "configuration", K.SYSTEM_TYPE_COMPONENT = "component", K.SYSTEM_TYPE_COUNTER = "counter", K.SYSTEM_TYPE_PASSWORD_RESET = "passwordReset", K.SYSTEM_TYPE_ACCOUNT_SECURITY = "accountSecurity", K.SYSTEM_TYPE_ACCOUNT_CONTROL = "accountControl", K.SYSTEM_TYPE_ACCOUNT_GROUP_CONFIG = "accountGroupConfig", K.SYSTEM_TYPE_PASSWORD = "password", K.SYSTEM_TYPE_RULESET = "ruleset", K.SYSTEM_TYPE_RULESET_INCLUDE = "rulesetInclude", K.SYSTEM_TYPE_APPLICATION = "application", K.SYSTEM_TYPE_VENDOR_LIBRARY = "vendorLibrary", K.STATUS_PENDING = "pending", K.STATUS_PROCESSING = "processing", K.STATUS_PROCESSED = "processed", K.STATUS_ERROR = "error", K.STATUS_SUCCESS = "success", K.STATUS_WARNING = "warning", K.STATUS_INFO = "info", K.STATUS_FORBIDDEN = "forbidden", K.METHOD_POST = "POST", K.METHOD_GET = "GET", K.METHOD_DELETE = "DELETE", K.METHOD_PUT = "PUT", K.DEFAULT_PAGE = 0, K.DEFAULT_PAGE_SIZE = 50, K.DEFAULT_TOTAL_ITEM = 1e4, K.DEFAULT_SEARCH_DELAY = 500, K.DEFAULT_MAX_SEARCH_QUERY_LENGTH = 2048, K.DEFAULT_SEARCH_SELECT_PAGE_SIZE = 5, K.DEFAULT_SEARCH_SELECT_PAGE = 0, K.FIELD_TYPE_RELATED = "Related", K.FIELD_TYPE_HTML = "html", K.FIELD_TYPE_CUSTOM = "Custom", K.ELASTIC_DOCUMENT_TYPE = "documents", K.ELASTIC_DOCUMENT_PREFIXES = { mongodb: "_source" }, K.DEFAULT_DB_PROVIDER = "mongodb", K.DEFAULT_DB_CONNECTION = "default", K.RULESET_EVENT_NAME = "EventName", K.RULESET_RELATIONSHIPS = { PRERENDER_EVENT_NAME: { name: "PreRender", relName: "preRenderClientRuleRel" }, ONLOAD_EVENT_NAME: { name: "OnLoad", relName: "onLoadClientRuleRel" }, ON_RECEIVE_EVENT_NAME: { name: "OnReceive", relName: "onReceiveClientRuleRel" }, ON_FIELD_CHANGE_EVENT_NAME: { name: "OnFieldChange", relName: "onFieldChangeClientRuleRel" }, PRESAVE_EVENT_NAME: { name: "PreSave", relName: "preSaveClientRuleRel" }, POSTSAVE_CLIENT_EVENT_NAME: { name: "PostSaveClient", relName: "postSaveClientRuleRel" }, PRESAVE_SERVER_EVENT_NAME: { name: "PreSaveServer", relName: "preSaveServerRuleRel" }, POSTSAVE_EVENT_NAME: { name: "PostSave", relName: "postSaveServerRuleRel" }, POSTLOGIN_CLIENT_EVENT_NAME: { name: "PostLoginClient", relName: "postLoginClientRuleRel" }, PRELOGOUT_CLIENT_EVENT_NAME: { name: "PreLogoutClient", relName: "preLogoutClientRuleRel" }, PRELOGIN_SERVER_EVENT_NAME: { name: "PreLoginServerName", relName: "preLoginServerRuleRel" }, POSTLOGIN_SERVER_EVENT_NAME: { name: "PostLoginServerName", relName: "postLoginServerRuleRel" }, PRELOGOUT_SERVER_EVENT_NAME: { name: "PreLogoutServerName", relName: "preLogoutServerRuleRel" }, POSTLOGOUT_SERVER_EVENT_NAME: { name: "PostLogoutServerName", relName: "postLogoutServerRuleRel" }, PREDELETE_CLIENT_EVENT_NAME: { name: "PreDeleteClient", relName: "preDeleteClientRuleRel" } }, K.ONLOAD_DONE_RULES_EVENT_NAME = "OnLoadDone", K.ON_CHANGE_FILTER_EVENT_NAME = "OnChangeFilter", K.LOCATION_CHANGE_STATE_EVENT = "$locationChangeStart", K.UPDATE_SHOW_VALUE_EVENT = "updateShowValue", K.EVENT_LIST_NAME = "eventList", K.EVENT_VALIDATION_VALUES_NAME = "validationValues", K.EVENT_REFRESH_COMPONENT_NAME = "refreshComponentData", K.INSERT_OPERATION_TYPE = "Insert", K.UPDATE_OPERATION_TYPE = "Update", K.CSV_DOC_ID_MATCH_MERGE = "merge", K.CSV_DOC_ID_MATCH_REPLACE = "replace", K.CSV_DOC_ID_NO_MATCH_ADD = "add", K.CSV_DOC_ID_NO_MATCH_ERR = "error", K.SAVE_CLICK_OPERATION_TYPE = "SaveClick", K.NEW_CLICK_OPERATION_TYPE = "NewClick", K.PRINT_CLICK_OPERATION_TYPE = "PrintClick", K.MAP_CLICK_OPERATION_TYPE = "MapClick", K.OPERATION_TYPE_READ = "Read", K.OPERATION_TYPE_CREATE = "Create", K.OPERATION_TYPE_UPDATE = "Update", K.OPERATION_TYPE_DELETE = "Delete", K.OPERATION_TYPE_EXECUTE = "Execute", K.OPERATION_TYPE_OFFLINE = "Offline", K.ERROR_TYPE_NOACCESS = "No Access", K.ERROR_TYPE_NOTFOUND = "Not Found", K.ERROR_TYPE_INTERNAL = "Internal", K.ERROR_TYPE_GONE = "Gone", K.WEB_SOCKET_MESSAGE_TEMPLATE_DRAFT_SAVED = "template_draft_saved", K.WEB_SOCKET_MESSAGE_UPDATE_PREVIEW = "update_preview", K.WEB_SOCKET_MESSAGE_SAVE_DOCUMENT = "save_document", K.WEB_SOCKET_MESSAGE_PASSWORD_RESET = "password_reset", K.WEB_SOCKET_MESSAGE_SIGN_OUT_ALL_DEVICE = "sign_out_all_device", K.DIALOG_OK_OPTION = "OK", K.DIALOG_CANCEL_OPTION = "CANCEL", K.RULESET_AFFECTED_DOCUMENT_ID = "affectedDocId", K.RULESET_AFFECTED_TEMPLATE_ID = "affectedTplId", K.RULESET_AFFECTED_FIELD_NAME = "affectedFieldName", K.RULESET_NEW_FILTER = "newFilter", K.RULESET_RESULT_FLAG = "flag", K.RULESET_PARENT_DOCUMENT = "parentDoc", K.RULESET_CHILD_DOCUMENT = "childDoc", K.checkListSeparator = "^", K.DEFAULT_MESSAGE_LENGTH = 200, K.DEFAULT_EXPIRY_DURATION_MINUTES = 60, K.MAKE_CURRENT_VERSION_KEY = "makeCurrentVersion", K.IMPORT_PREVIOUS_VERSION = "importPreviousVersion", K.SEARCH_PROVIDERS = { ELASTIC: "elastic", MONGODB: "mongodb" }, K.DOCUMENT_FIELD_NAME_UPLOAD_FILE = "imageFileNo96", K.PASSWORD_RESET = "password:reset", K.DEFAULT_MAX_UPLOAD_SIZE = 50, K.SYSTEM_TYPE_QUERY = "query", ZI = class {
    static filterNullKeyIds(g) {
      return dA.isString(g) && dA.trim(g) && g !== "undefined";
    }
    static filterAccessKeys(g) {
      const B = g && g.keyId && dA.isString(g.keyId) && dA.trim(g.keyId) && g.keyId !== "undefined", Q = g && g.documentId && dA.isString(g.documentId) && dA.trim(g.documentId) && g.documentId !== "undefined";
      return g && dA.isObject(g) && (B || Q);
    }
    static getUserAccessKeysForOperation(g, B) {
      const Q = [];
      let t = g ? g.accessKeys : null;
      if (t) {
        t = t.filter(ZI.filterAccessKeys);
        for (let n = 0; n < t.length; n++) {
          const e = t[n], a = e.keyId ? e.keyId : e.documentId;
          a && e.rights && e.rights.indexOf(B) > -1 && Q.push(a);
        }
      }
      return Q;
    }
    static checkPermission(g, B, Q, t) {
      const n = t || [];
      let e = g && g.systemHeader && g.systemHeader.keyIds ? g.systemHeader.keyIds : n;
      e = e.filter(ZI.filterNullKeyIds);
      for (let a = 0; a < Q.length; a++) {
        const o = Q[a];
        if ((!e || e.length === 0) && o !== K.OPERATION_TYPE_OFFLINE) return true;
        const u2 = ZI.getUserAccessKeysForOperation(B, o);
        for (let s = 0; s < u2.length; s++) if (e && e.indexOf(u2[s]) > -1) return true;
      }
      return false;
    }
    static checkAccess(g, B, Q, t) {
      return dA.isArray(Q) ? ZI.checkPermission(g, B, Q, t) : ZI.checkPermission(g, B, [Q], t);
    }
    static writeKeysToDocument(g, B, Q, t) {
      g.systemHeader = g.systemHeader ? g.systemHeader : {}, g.systemHeader.keyIds = g.systemHeader.keyIds ? g.systemHeader.keyIds : [];
      let n = [].concat(g.systemHeader.keyIds);
      B && B.attachKeys && B.attachKeys.length && (n = n.concat(B.attachKeys)), n = n.concat(Q.attachKeys), t && t.length && (n = n.concat(t)), g.systemHeader.keyIds = Array.from(new Set(n)), g.systemHeader.keyIds = g.systemHeader.keyIds.filter(ZI.filterNullKeyIds);
    }
    static hasPermission(g, B, Q) {
      const t = Q.split(",");
      return ZI.checkPermission(g, B, t);
    }
  }, gI = class {
  }, gI.ERROR_NO_ACCOUNT_TEMPLATE = "1000", gI.ERROR_NO_ACCOUNT_SECURITY_TEMPLATE = "1001", gI.ERROR_NO_ACCOUNT_CONTROL_TEMPLATE = "1002", gI.ERROR_DUPLICATE_ACCOUNT_EMAIL = "1003", gI.ERROR_DUPLICATE_ACCOUNT_PUBLIC_URL = "1004", gI.ERROR_DUPLICATE_ACCOUNT_API_KEY = "1005", gI.ERROR_UPLOAD_DIR_DOES_NOT_EXIST = "1006", gI.ERROR_ORPHANED_ACCOUNT_API_KEY = "1007", gI.ERROR_ORPHANED_ACCOUNT_PUBLIC_URL = "1008", gI.ERROR_NOT_FOUND_ACCOUNT_API_KEY = "1009", gI.ERROR_NOT_FOUND_ACCOUNT_PUBLIC_URL = "1010", gI.ERROR_PASSWORD_RESET_REQUIRED = "1011";
  const QE = ["serverCreatedDate", "serverUpdatedDate", "previousVersionId"];
  xg = class {
    static filterSystemHeader(g) {
      if (g.systemHeader) for (let B = 0; B < QE.length; B++) delete g.systemHeader[QE[B]];
    }
    static applyUpdatesToSystemHeader(g, B) {
      if (B.systemHeader) {
        xg.filterSystemHeader(g), xg.filterSystemHeader(B);
        const Q = Object.keys(B.systemHeader);
        g.systemHeader || (g.systemHeader = {});
        for (let t = 0; t < Q.length; t++) {
          const n = Q[t], e = B.systemHeader[n];
          n !== "currentVersion" && (g.systemHeader[n] = e);
        }
      }
    }
  };
  const Qo = "data:application/wasm;base64,[encoded data, 229512 characters]", Co = (..._0) => __async(void 0, [..._0], function* (g = {}, B) {
    let Q;
    if (B.startsWith("data:")) {
      const t = B.replace(/^data:.*?base64,/, "");
      let n;
      if (typeof Buffer == "function" && typeof Buffer.from == "function") n = Buffer.from(t, "base64");
      else if (typeof atob == "function") {
        const e = atob(t);
        n = new Uint8Array(e.length);
        for (let a = 0; a < e.length; a++) n[a] = e.charCodeAt(a);
      } else throw new Error("Cannot decode base64-encoded data URL");
      Q = yield WebAssembly.instantiate(n, g);
    } else {
      const t = yield fetch(B), n = t.headers.get("Content-Type") || "";
      if ("instantiateStreaming" in WebAssembly && n.startsWith("application/wasm")) Q = yield WebAssembly.instantiateStreaming(t, g);
      else {
        const e = yield t.arrayBuffer();
        Q = yield WebAssembly.instantiate(e, g);
      }
    }
    return Q.instance.exports;
  });
  let YA;
  function to(g) {
    YA = g;
  }
  const Eo = typeof TextDecoder > "u" ? (0, module.require)("util").TextDecoder : TextDecoder;
  let CE = new Eo("utf-8", { ignoreBOM: true, fatal: true });
  CE.decode();
  let pB = null;
  function wB() {
    return (pB === null || pB.byteLength === 0) && (pB = new Uint8Array(YA.memory.buffer)), pB;
  }
  function HQ(g, B) {
    return g = g >>> 0, CE.decode(wB().subarray(g, g + B));
  }
  const YI = new Array(128).fill(void 0);
  YI.push(void 0, null, true, false);
  let Pg = YI.length;
  function eo(g) {
    Pg === YI.length && YI.push(YI.length + 1);
    const B = Pg;
    return Pg = YI[B], YI[B] = g, B;
  }
  let dg = 0;
  const io = typeof TextEncoder > "u" ? (0, module.require)("util").TextEncoder : TextEncoder;
  let fB = new io("utf-8");
  const no = typeof fB.encodeInto == "function" ? function(g, B) {
    return fB.encodeInto(g, B);
  } : function(g, B) {
    const Q = fB.encode(g);
    return B.set(Q), { read: g.length, written: Q.length };
  };
  function yB(g, B, Q) {
    if (Q === void 0) {
      const o = fB.encode(g), u2 = B(o.length, 1) >>> 0;
      return wB().subarray(u2, u2 + o.length).set(o), dg = o.length, u2;
    }
    let t = g.length, n = B(t, 1) >>> 0;
    const e = wB();
    let a = 0;
    for (; a < t; a++) {
      const o = g.charCodeAt(a);
      if (o > 127) break;
      e[n + a] = o;
    }
    if (a !== t) {
      a !== 0 && (g = g.slice(a)), n = Q(n, t, t = a + g.length * 3, 1) >>> 0;
      const o = wB().subarray(n + a, n + t), u2 = no(g, o);
      a += u2.written;
    }
    return dg = a, n;
  }
  let GB = null;
  function VI() {
    return (GB === null || GB.byteLength === 0) && (GB = new Int32Array(YA.memory.buffer)), GB;
  }
  function oo(g) {
    return YI[g];
  }
  function ro(g) {
    g < 132 || (YI[g] = Pg, Pg = g);
  }
  function tE(g) {
    const B = oo(g);
    return ro(g), B;
  }
  function ao(g, B) {
    let Q, t;
    try {
      const p = YA.__wbindgen_add_to_stack_pointer(-16), c = yB(g, YA.__wbindgen_malloc, YA.__wbindgen_realloc), l = dg, i2 = yB(B, YA.__wbindgen_malloc, YA.__wbindgen_realloc), f = dg;
      YA.createPatch(p, c, l, i2, f);
      var n = VI()[p / 4 + 0], e = VI()[p / 4 + 1], a = VI()[p / 4 + 2], o = VI()[p / 4 + 3], u2 = n, s = e;
      if (o) throw u2 = 0, s = 0, tE(a);
      return Q = u2, t = s, HQ(u2, s);
    } finally {
      YA.__wbindgen_add_to_stack_pointer(16), YA.__wbindgen_free(Q, t, 1);
    }
  }
  function so(g, B) {
    let Q, t;
    try {
      const p = YA.__wbindgen_add_to_stack_pointer(-16), c = yB(g, YA.__wbindgen_malloc, YA.__wbindgen_realloc), l = dg, i2 = yB(B, YA.__wbindgen_malloc, YA.__wbindgen_realloc), f = dg;
      YA.applyPatch(p, c, l, i2, f);
      var n = VI()[p / 4 + 0], e = VI()[p / 4 + 1], a = VI()[p / 4 + 2], o = VI()[p / 4 + 3], u2 = n, s = e;
      if (o) throw u2 = 0, s = 0, tE(a);
      return Q = u2, t = s, HQ(u2, s);
    } finally {
      YA.__wbindgen_add_to_stack_pointer(16), YA.__wbindgen_free(Q, t, 1);
    }
  }
  function co(g, B) {
    const Q = new Error(HQ(g, B));
    return eo(Q);
  }
  URL = globalThis.URL;
  const og = yield Co({ "./json_patcher_bg.js": { __wbindgen_error_new: co } }, Qo), uo = og.memory, ho = og.createPatch, lo = og.applyPatch, Do = og.__wbindgen_add_to_stack_pointer, po = og.__wbindgen_malloc, wo = og.__wbindgen_realloc, fo = og.__wbindgen_free, yo = Object.freeze(Object.defineProperty({ __proto__: null, __wbindgen_add_to_stack_pointer: Do, __wbindgen_free: fo, __wbindgen_malloc: po, __wbindgen_realloc: wo, applyPatch: lo, createPatch: ho, memory: uo }, Symbol.toStringTag, { value: "Module" }));
  to(yo);
  const EE = "$::date:";
  function NB(g) {
    const B = this[g];
    return B instanceof Date ? `${EE}${B.toISOString()}` : B;
  }
  const eE = (g, B) => typeof B == "string" && B.startsWith(EE) ? new Date(B.slice(8)) : B;
  function Go(g, B) {
    const Q = JSON.stringify(g, NB), t = JSON.stringify(B, NB), n = ao(Q, t);
    return JSON.parse(n, eE);
  }
  function No(g, B) {
    const Q = JSON.stringify(g, NB), t = JSON.stringify(B, NB), n = so(Q, t);
    return JSON.parse(n, eE);
  }
  const ko = console;
  RI = class {
    static performSystemTypeUpdateOperations(g, B) {
      g.systemHeader.systemType === K.SYSTEM_TYPE_ACCOUNT && !B.pass && (B.pass = g.pass);
    }
    static applyUpdatesSimple(g, B) {
      if (B) {
        RI.performSystemTypeUpdateOperations(g, B);
        const Q = Object.keys(B);
        for (let t = 0; t < Q.length; t++) {
          const n = Q[t];
          n === "systemHeader" ? xg.applyUpdatesToSystemHeader(g, B) : g[n] = B[n];
        }
      }
    }
    static getUpdates(g, B) {
      return __async(this, null, function* () {
        return ko.info("Determining fields that have changed in update"), { updates: (g ? Go(g, B) : null) ?? [], documentId: B.documentId };
      });
    }
    static applyUpdates(g, B) {
      return __async(this, null, function* () {
        RI.applyDocumentUpdates(g, B);
      });
    }
    static applyDocumentUpdates(g, B) {
      if (B.updates) {
        const Q = No(g, B.updates), t = Object.keys(Q), n = Object.keys(g);
        for (let e = 0; e < n.length; e++) {
          const a = n[e];
          delete g[a];
        }
        for (let e = 0; e < t.length; e++) {
          let a = t[e];
          g[a] = Q[a];
        }
      }
    }
    static applyUpdatesDeepDiff(g, B) {
      return __async(this, null, function* () {
        xg.applyUpdatesToSystemHeader(g, B), B.systemHeader && (B.systemHeader = dA.cloneDeep(g.systemHeader)), RI.performSystemTypeUpdateOperations(g, B);
        const Q = yield RI.getUpdates(g, B);
        RI.applyDocumentUpdates(g, Q);
      });
    }
  }, HA = class {
    static defaultComparator(g, B) {
      return g === B;
    }
    static intersection(g, B, Q) {
      const t = [], n = Q || HA.defaultComparator;
      for (let e = 0; e < g.length; e++) for (let a = 0; a < B.length; a++) if (n(g[e], B[a])) {
        t.push(g[e]);
        break;
      }
      return t;
    }
    static union(g, B, Q) {
      const t = g.concat([]);
      if (!t || !t.length) return B.concat([]);
      const n = Q || HA.defaultComparator;
      for (let e = 0; e < B.length; e++) HA.contains(t, B[e], n) || t.push(B[e]);
      return t;
    }
    static exclude(g, B, Q) {
      const t = [];
      if (!B || !B.length) return g;
      const n = Q || HA.defaultComparator;
      for (let e = 0; e < g.length; e++) HA.contains(B, g[e], n) || t.push(g[e]);
      return t;
    }
    static containsIndex(g, B, Q) {
      if (!g) return -1;
      const t = Q || HA.defaultComparator;
      for (let n = 0; n < g.length; n++) if (t(g[n], B)) return n;
      return -1;
    }
    static contains(g, B, Q) {
      return HA.containsIndex(g, B, Q) !== -1;
    }
    static move(g, B, Q) {
      g[Q] = g[B], g[B] = null;
    }
    static deleteSplice(g, B) {
      g.splice(B, 1);
    }
    static deleteSetNull(g, B) {
      g[B] = null;
    }
    static swap(g, B, Q) {
      const t = g[B];
      g[B] = g[Q], g[Q] = t;
    }
    static add(g, B, Q, t) {
      return Q && HA.contains(g, B, t) ? false : (g.push(B), true);
    }
    static addOrReplace(g, B, Q) {
      const t = HA.containsIndex(g, B, Q);
      t !== -1 ? g[t] = B : g.push(B);
    }
    static get(g, B, Q) {
      const t = HA.containsIndex(g, B, Q);
      return B !== -1 ? g[t] : null;
    }
  }, Hn = class {
    static resolveSimple(g) {
      const B = {};
      if (g.newDocumentBaseDoc ? g.currentDocument ? g.newDocument || (B.error = new Error("New Document object not provided to ConflictResolver.resolveSimple")) : B.error = new Error("Current Document object not provided to ConflictResolver.resolveSimple") : B.error = new Error("Base document not provided to ConflictResolver.resolveSimple"), B.error) return B;
      let Q = g.currentDocument, t = g.newDocument;
      const n = new Date(g.currentDocument.systemHeader.createdDate).getTime(), e = new Date(g.newDocument.systemHeader.createdDate).getTime();
      if (n > e) {
        const u2 = Q;
        Q = t, t = u2;
      }
      RI.applyUpdatesSimple(g.newDocumentBaseDoc, Q), RI.applyUpdatesSimple(g.newDocumentBaseDoc, t);
      const a = g.newDocument.systemHeader.conflicts, o = a ? a.conflictingVersions : [];
      return HA.add(o, g.newDocument.systemHeader.versionId, true, null), HA.add(o, g.currentDocument.systemHeader.versionId, true, null), g.newDocumentBaseDoc.systemHeader.conflicts = { resolved: false, conflictingVersions: o }, B.finalDoc = g.newDocumentBaseDoc, B.finalDoc.systemHeader.currentVersion = true, B.previousVersion = t, B;
    }
    static resolveJSONPatch(g) {
      return __async(this, null, function* () {
        const B = {};
        if (g.newDocumentBaseDoc ? g.currentDocument ? g.newDocument || (B.error = new Error("New Document object not provided to ConflictResolver.resolveJSONPatch")) : B.error = new Error("Current Document object not provided to ConflictResolver.resolveJSONPatch") : B.error = new Error("Base document not provided to ConflictResolver.resolveJSONPatch"), B.error) return B;
        const Q = g.newUpdates, t = g.oldUpdates;
        let n = t, e = Q, a = g.newDocument;
        const o = new Date(g.currentDocument.systemHeader.createdDate).getTime(), u2 = new Date(a.systemHeader.createdDate).getTime();
        o > u2 && (n = Q, e = t, a = g.currentDocument), yield RI.applyUpdates(g.newDocumentBaseDoc, n), yield RI.applyUpdates(g.newDocumentBaseDoc, e);
        const s = g.newDocument.systemHeader.conflicts, p = s ? s.conflictingVersions : [];
        return HA.add(p, g.newDocument.systemHeader.versionId, true, null), HA.add(p, g.currentDocument.systemHeader.versionId, true, null), g.newDocumentBaseDoc.systemHeader.conflicts = { resolved: false, conflictingVersions: p }, B.finalDoc = g.newDocumentBaseDoc, B.finalDoc.systemHeader.currentVersion = true, B.previousVersion = a, B;
      });
    }
  }, go = class {
    static createVersion(g) {
      if (g == null || g.documentId == null) return null;
      const B = dA.cloneDeep(g);
      return B._id && delete B._id, B.systemHeader.currentVersion = false, B;
    }
  };
  const So = console, iE = "ForbiddenError", Mo = "NotFoundError", Ro = "DeletedError", Fo = "Access Restricted", nE = "Access to the template for this document is restricted and no alternate template is configured. Please configure an alternate template to be able to access this document", Lo = "ServerUnResponseError";
  rI = class {
    static createError(g, B) {
      So.error(g);
      const Q = new Error(g);
      return Q.name = B, Q;
    }
    static createErrorObject(g) {
      if (g instanceof Error) return g;
      if (typeof g == "string" || g instanceof String) return new Error(g.toString());
      throw Error("unknown input");
    }
    static createForbiddenError(g, B) {
      let Q;
      return g && (g.systemHeader && g.systemHeader.systemType === K.SYSTEM_TYPE_TEMPLATE && B === K.OPERATION_TYPE_READ ? Q = nE : Q = B + " access denied on document " + g.documentId), this.createError(Q, iE);
    }
    static limitErrorMessage(g) {
      return g && g.length > K.DEFAULT_MESSAGE_LENGTH && (g = g.substring(0, K.DEFAULT_MESSAGE_LENGTH) + "..."), g;
    }
  }, rI.NOT_FOUND_ERROR = Mo, rI.DELETED_ERROR = Ro, rI.FORBIDDEN_MESSAGE = Fo, rI.FORBIDDEN_TEMPLATE_MESSAGE = nE, rI.FORBIDDEN_ERROR = iE, rI.SERVER_UNRESPONSE_ERROR = Lo;
  let kB, oE, rE, aE, sE, cE;
  kB = console, oE = (g, B) => {
    B && B.systemHeader && B.systemHeader.applicationIds && (g.systemHeader.applicationIds = B.systemHeader.applicationIds);
  }, rE = (g, B) => !B.tagApplicationId || B.tagApplicationId === g.systemHeader.tagApplicationId, aE = (g, B) => !B.branchApplicationId || g.systemHeader.branchApplicationIds && g.systemHeader.branchApplicationIds.some((Q) => B.branchApplicationId === Q), sE = (g, B) => !B.applicationId || g.systemHeader.applicationIds && g.systemHeader.applicationIds.some((Q) => B.applicationId === Q), cE = (g, B) => {
    if (!sE(g, B)) {
      let Q = `Document ${g.documentId} doesn't belong to user's selected applicationId: ${B.applicationId}`;
      throw kB.error(Q), rI.createForbiddenError(g, K.OPERATION_TYPE_READ);
    }
    if (!rE(g, B)) {
      let Q = `Document ${g.documentId} doesn't belong to user's selected tagApplicationId: ${B.tagApplicationId}`;
      throw kB.error(Q), rI.createForbiddenError(g, K.OPERATION_TYPE_READ);
    }
    if (!aE(g, B)) {
      let Q = `Document ${g.documentId} doesn't belong to user's selected branchApplicationId: ${B.applicationId}`;
      throw kB.error(Q), rI.createForbiddenError(g, K.OPERATION_TYPE_READ);
    }
  }, _n = { applyApplicationIds: oE, checkDocumentApplication: cE }, qn = class {
    static prepareESQuery(g) {
      return g || (g = { query: { bool: { must: [] } } }), g.query || (g.query = { bool: { must: [] } }), g.query.bool || (g.query.bool = { must: [] }), g.query.bool.must || (g.query.bool.must = []), g;
    }
    static stringifyQuery(g) {
      return JSON.stringify(g, function(B, Q) {
        return Q ?? "${v}";
      });
    }
  };
  const KQ = console;
  Tn = class {
    static processJsonRuleset(g, B, Q, t, n) {
      try {
        KQ.debug("In process JSON/Javascript Flow...");
        const e = {};
        e.document = g, e.context = B, B.isNew !== void 0 && (e.isNew = B.isNew), e.user = B.user, e.logger = B.logger, e.rsLogger = B.rsLogger, e.result = { status: null, message: null }, e.scope = t, e.runCount = 1, e.runCountMax = 100, e.callbackSuccessCompleted = false, e.documentSession = B.documentSession;
        const a = function() {
          e.callbackSuccessCompleted ? o("Multiple callbackSuccess calls detected. Please ensure the ruleset only has one callbackSuccess") : (e.callbackSuccessCompleted = true, e.result.status = "SUCCESS", e.result.message = null, n(e.result));
        }, o = function(s) {
          let p;
          s && dA.isError(s) && (s = s.message, p = s.name), e.result.status = "ERROR", e.result.message = rI.limitErrorMessage(s), e.result.name = p, n(e.result);
        }, u2 = function(s) {
          s.runCount += 1, s.runCount > s.runCountMax ? o("Run Count exceeded -- check there is not a self-looping issue in your script.") : (KQ.info("Re-executing ruleset in callbackContinue with count: " + s.runCount), Q.mainRule(s, u2, a, o));
        };
        Q.mainRule(e, u2, a, o);
      } catch (e) {
        let a = "Errors in JSON/Javascript ruleset: ";
        dA.isError(e) ? a += e.name + " : " + e.message : a += e, KQ.error(a), t.rsLogger && (t.rsLogger.error(a), t.rsLogger.storeMessages()), n({ status: "ERROR", message: rI.limitErrorMessage(a) });
      }
    }
  };
  var uE = { exports: {} };
  (function(g) {
    (function() {
      var B = {};
      function Q() {
      }
      function t(N) {
        return N;
      }
      function n(N) {
        return !!N;
      }
      function e(N) {
        return !N;
      }
      var a, o = typeof self == "object" && self.self === self && self || typeof yI == "object" && yI.global === yI && yI || this;
      o != null && (a = o.async), B.noConflict = function() {
        return o.async = a, B;
      };
      function u2(N) {
        return function() {
          if (N === null) throw new Error("Callback was already called.");
          N.apply(this, arguments), N = null;
        };
      }
      function s(N) {
        return function() {
          N !== null && (N.apply(this, arguments), N = null);
        };
      }
      var p = Object.prototype.toString, c = Array.isArray || function(N) {
        return p.call(N) === "[object Array]";
      }, l = function(N) {
        var M = typeof N;
        return M === "function" || M === "object" && !!N;
      };
      function i2(N) {
        return c(N) || typeof N.length == "number" && N.length >= 0 && N.length % 1 === 0;
      }
      function f(N, M) {
        return i2(N) ? G(N, M) : b(N, M);
      }
      function G(N, M) {
        for (var R = -1, m = N.length; ++R < m; ) M(N[R], R, N);
      }
      function F(N, M) {
        for (var R = -1, m = N.length, q = Array(m); ++R < m; ) q[R] = M(N[R], R, N);
        return q;
      }
      function L(N) {
        return F(Array(N), function(M, R) {
          return R;
        });
      }
      function U(N, M, R) {
        return G(N, function(m, q, W) {
          R = M(R, m, q, W);
        }), R;
      }
      function b(N, M) {
        G(Y(N), function(R) {
          M(N[R], R);
        });
      }
      function S(N, M) {
        for (var R = 0; R < N.length; R++) if (N[R] === M) return R;
        return -1;
      }
      var Y = Object.keys || function(N) {
        var M = [];
        for (var R in N) N.hasOwnProperty(R) && M.push(R);
        return M;
      };
      function Z3(N) {
        var M = -1, R, m;
        return i2(N) ? (R = N.length, function() {
          return M++, M < R ? M : null;
        }) : (m = Y(N), R = m.length, function() {
          return M++, M < R ? m[M] : null;
        });
      }
      function x(N, M) {
        return M = M == null ? N.length - 1 : +M, function() {
          for (var R = Math.max(arguments.length - M, 0), m = Array(R), q = 0; q < R; q++) m[q] = arguments[q + M];
          switch (M) {
            case 0:
              return N.call(this, m);
            case 1:
              return N.call(this, arguments[0], m);
          }
        };
      }
      function iA(N) {
        return function(M, R, m) {
          return N(M, m);
        };
      }
      var uA = typeof setImmediate == "function" && setImmediate, RA = uA ? function(N) {
        uA(N);
      } : function(N) {
        setTimeout(N, 0);
      };
      typeof process == "object" && typeof process.nextTick == "function" ? B.nextTick = process.nextTick : B.nextTick = RA, B.setImmediate = uA ? RA : B.nextTick, B.forEach = B.each = function(N, M, R) {
        return B.eachOf(N, iA(M), R);
      }, B.forEachSeries = B.eachSeries = function(N, M, R) {
        return B.eachOfSeries(N, iA(M), R);
      }, B.forEachLimit = B.eachLimit = function(N, M, R, m) {
        return JA(M)(N, iA(R), m);
      }, B.forEachOf = B.eachOf = function(N, M, R) {
        R = s(R || Q), N = N || [];
        var m = i2(N) ? N.length : Y(N).length, q = 0;
        if (!m) return R(null);
        f(N, function(H, j) {
          M(N[j], j, u2(W));
        });
        function W(H) {
          H ? R(H) : (q += 1, q >= m && R(null));
        }
      }, B.forEachOfSeries = B.eachOfSeries = function(N, M, R) {
        R = s(R || Q), N = N || [];
        var m = Z3(N), q = m();
        function W() {
          var H = true;
          if (q === null) return R(null);
          M(N[q], q, u2(function(j) {
            if (j) R(j);
            else {
              if (q = m(), q === null) return R(null);
              H ? B.nextTick(W) : W();
            }
          })), H = false;
        }
        W();
      }, B.forEachOfLimit = B.eachOfLimit = function(N, M, R, m) {
        JA(M)(N, R, m);
      };
      function JA(N) {
        return function(M, R, m) {
          m = s(m || Q), M = M || [];
          var q = Z3(M);
          if (N <= 0) return m(null);
          var W = false, H = 0, j = false;
          (function $4() {
            if (W && H <= 0) return m(null);
            for (; H < N && !j; ) {
              var gA = q();
              if (gA === null) {
                W = true, H <= 0 && m(null);
                return;
              }
              H += 1, R(M[gA], gA, u2(function(tA) {
                H -= 1, tA ? (m(tA), j = true) : $4();
              }));
            }
          })();
        };
      }
      function BI(N) {
        return function(M, R, m) {
          return N(B.eachOf, M, R, m);
        };
      }
      function IB(N) {
        return function(M, R, m, q) {
          return N(JA(R), M, m, q);
        };
      }
      function sg(N) {
        return function(M, R, m) {
          return N(B.eachOfSeries, M, R, m);
        };
      }
      function gB(N, M, R, m) {
        m = s(m || Q);
        var q = [];
        N(M, function(W, H, j) {
          R(W, function($4, gA) {
            q[H] = gA, j($4);
          });
        }, function(W) {
          m(W, q);
        });
      }
      B.map = BI(gB), B.mapSeries = sg(gB), B.mapLimit = IB(gB), B.inject = B.foldl = B.reduce = function(N, M, R, m) {
        B.eachOfSeries(N, function(q, W, H) {
          R(M, q, function(j, $4) {
            M = $4, H(j);
          });
        }, function(q) {
          m(q || null, M);
        });
      }, B.foldr = B.reduceRight = function(N, M, R, m) {
        var q = F(N, t).reverse();
        B.reduce(q, M, R, m);
      };
      function Mg(N, M, R, m) {
        var q = [];
        N(M, function(W, H, j) {
          R(W, function($4) {
            $4 && q.push({ index: H, value: W }), j();
          });
        }, function() {
          m(F(q.sort(function(W, H) {
            return W.index - H.index;
          }), function(W) {
            return W.value;
          }));
        });
      }
      B.select = B.filter = BI(Mg), B.selectLimit = B.filterLimit = IB(Mg), B.selectSeries = B.filterSeries = sg(Mg);
      function NI(N, M, R, m) {
        Mg(N, M, function(q, W) {
          R(q, function(H) {
            W(!H);
          });
        }, m);
      }
      B.reject = BI(NI), B.rejectLimit = IB(NI), B.rejectSeries = sg(NI);
      function _A(N, M, R) {
        return function(m, q, W, H) {
          function j() {
            H && H(R(false, void 0));
          }
          function $4(gA, tA, wA) {
            if (!H) return wA();
            W(gA, function(sI) {
              H && M(sI) && (H(R(true, gA)), H = W = false), wA();
            });
          }
          arguments.length > 3 ? N(m, q, $4, j) : (H = W, W = q, N(m, $4, j));
        };
      }
      B.any = B.some = _A(B.eachOf, n, t), B.someLimit = _A(B.eachOfLimit, n, t), B.all = B.every = _A(B.eachOf, e, e), B.everyLimit = _A(B.eachOfLimit, e, e);
      function BB(N, M) {
        return M;
      }
      B.detect = _A(B.eachOf, t, BB), B.detectSeries = _A(B.eachOfSeries, t, BB), B.detectLimit = _A(B.eachOfLimit, t, BB), B.sortBy = function(N, M, R) {
        B.map(N, function(q, W) {
          M(q, function(H, j) {
            H ? W(H) : W(null, { value: q, criteria: j });
          });
        }, function(q, W) {
          if (q) return R(q);
          R(null, F(W.sort(m), function(H) {
            return H.value;
          }));
        });
        function m(q, W) {
          var H = q.criteria, j = W.criteria;
          return H < j ? -1 : H > j ? 1 : 0;
        }
      }, B.auto = function(N, M) {
        M = s(M || Q);
        var R = Y(N), m = R.length;
        if (!m) return M(null);
        var q = {}, W = [];
        function H(gA) {
          W.unshift(gA);
        }
        function j(gA) {
          var tA = S(W, gA);
          tA >= 0 && W.splice(tA, 1);
        }
        function $4() {
          m--, G(W.slice(0), function(gA) {
            gA();
          });
        }
        H(function() {
          m || M(null, q);
        }), G(R, function(gA) {
          for (var tA = c(N[gA]) ? N[gA] : [N[gA]], wA = x(function(Ag, PA) {
            if (PA.length <= 1 && (PA = PA[0]), Ag) {
              var cg = {};
              b(q, function(ug, Ig) {
                cg[Ig] = ug;
              }), cg[gA] = PA, M(Ag, cg);
            } else q[gA] = PA, B.setImmediate($4);
          }), sI = tA.slice(0, tA.length - 1), FI = sI.length, KA; FI--; ) {
            if (!(KA = N[sI[FI]])) throw new Error("Has inexistant dependency");
            if (c(KA) && S(KA, gA) >= 0) throw new Error("Has cyclic dependencies");
          }
          function CI() {
            return U(sI, function(Ag, PA) {
              return Ag && q.hasOwnProperty(PA);
            }, true) && !q.hasOwnProperty(gA);
          }
          CI() ? tA[tA.length - 1](wA, q) : H(OA);
          function OA() {
            CI() && (j(OA), tA[tA.length - 1](wA, q));
          }
        });
      }, B.retry = function(N, M, R) {
        var m = 5, q = 0, W = [], H = { times: m, interval: q };
        function j(tA, wA) {
          if (typeof wA == "number") tA.times = parseInt(wA, 10) || m;
          else if (typeof wA == "object") tA.times = parseInt(wA.times, 10) || m, tA.interval = parseInt(wA.interval, 10) || q;
          else throw new Error("Unsupported argument type for 'times': " + typeof wA);
        }
        var $4 = arguments.length;
        if ($4 < 1 || $4 > 3) throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");
        $4 <= 2 && typeof N == "function" && (R = M, M = N), typeof N != "function" && j(H, N), H.callback = R, H.task = M;
        function gA(tA, wA) {
          function sI(CI, OA) {
            return function(Ag) {
              CI(function(PA, cg) {
                Ag(!PA || OA, { err: PA, result: cg });
              }, wA);
            };
          }
          function FI(CI) {
            return function(OA) {
              setTimeout(function() {
                OA(null);
              }, CI);
            };
          }
          for (; H.times; ) {
            var KA = !(H.times -= 1);
            W.push(sI(H.task, KA)), !KA && H.interval > 0 && W.push(FI(H.interval));
          }
          B.series(W, function(CI, OA) {
            OA = OA[OA.length - 1], (tA || H.callback)(OA.err, OA.result);
          });
        }
        return H.callback ? gA() : gA;
      }, B.waterfall = function(N, M) {
        if (M = s(M || Q), !c(N)) {
          var R = new Error("First argument to waterfall must be an array of functions");
          return M(R);
        }
        if (!N.length) return M();
        function m(q) {
          return x(function(W, H) {
            if (W) M.apply(null, [W].concat(H));
            else {
              var j = q.next();
              j ? H.push(m(j)) : H.push(M), $I(q).apply(null, H);
            }
          });
        }
        m(B.iterator(N))();
      };
      function zI(N, M, R) {
        R = R || Q;
        var m = i2(M) ? [] : {};
        N(M, function(q, W, H) {
          q(x(function(j, $4) {
            $4.length <= 1 && ($4 = $4[0]), m[W] = $4, H(j);
          }));
        }, function(q) {
          R(q, m);
        });
      }
      B.parallel = function(N, M) {
        zI(B.eachOf, N, M);
      }, B.parallelLimit = function(N, M, R) {
        zI(JA(M), N, R);
      }, B.series = function(N, M) {
        zI(B.eachOfSeries, N, M);
      }, B.iterator = function(N) {
        function M(R) {
          function m() {
            return N.length && N[R].apply(null, arguments), m.next();
          }
          return m.next = function() {
            return R < N.length - 1 ? M(R + 1) : null;
          }, m;
        }
        return M(0);
      }, B.apply = x(function(N, M) {
        return x(function(R) {
          return N.apply(null, M.concat(R));
        });
      });
      function QI(N, M, R, m) {
        var q = [];
        N(M, function(W, H, j) {
          R(W, function($4, gA) {
            q = q.concat(gA || []), j($4);
          });
        }, function(W) {
          m(W, q);
        });
      }
      B.concat = BI(QI), B.concatSeries = sg(QI), B.whilst = function(N, M, R) {
        if (R = R || Q, N()) {
          var m = x(function(q, W) {
            q ? R(q) : N.apply(this, W) ? M(m) : R(null);
          });
          M(m);
        } else R(null);
      }, B.doWhilst = function(N, M, R) {
        var m = 0;
        return B.whilst(function() {
          return ++m <= 1 || M.apply(this, arguments);
        }, N, R);
      }, B.until = function(N, M, R) {
        return B.whilst(function() {
          return !N.apply(this, arguments);
        }, M, R);
      }, B.doUntil = function(N, M, R) {
        return B.doWhilst(N, function() {
          return !M.apply(this, arguments);
        }, R);
      }, B.during = function(N, M, R) {
        R = R || Q;
        var m = x(function(W, H) {
          W ? R(W) : (H.push(q), N.apply(this, H));
        }), q = function(W, H) {
          W ? R(W) : H ? M(m) : R(null);
        };
        N(q);
      }, B.doDuring = function(N, M, R) {
        var m = 0;
        B.during(function(q) {
          m++ < 1 ? q(null, true) : M.apply(this, arguments);
        }, N, R);
      };
      function bB(N, M, R) {
        if (M == null) M = 1;
        else if (M === 0) throw new Error("Concurrency must not be zero");
        function m(j, $4, gA, tA) {
          if (tA != null && typeof tA != "function") throw new Error("task callback must be a function");
          if (j.started = true, c($4) || ($4 = [$4]), $4.length === 0 && j.idle()) return B.setImmediate(function() {
            j.drain();
          });
          G($4, function(wA) {
            var sI = { data: wA, callback: tA || Q };
            gA ? j.tasks.unshift(sI) : j.tasks.push(sI), j.tasks.length === j.concurrency && j.saturated();
          }), B.setImmediate(j.process);
        }
        function q(j, $4) {
          return function() {
            W -= 1;
            var gA = arguments;
            G($4, function(tA) {
              tA.callback.apply(tA, gA);
            }), j.tasks.length + W === 0 && j.drain(), j.process();
          };
        }
        var W = 0, H = { tasks: [], concurrency: M, payload: R, saturated: Q, empty: Q, drain: Q, started: false, paused: false, push: function(j, $4) {
          m(H, j, false, $4);
        }, kill: function() {
          H.drain = Q, H.tasks = [];
        }, unshift: function(j, $4) {
          m(H, j, true, $4);
        }, process: function() {
          if (!H.paused && W < H.concurrency && H.tasks.length) for (; W < H.concurrency && H.tasks.length; ) {
            var j = H.payload ? H.tasks.splice(0, H.payload) : H.tasks.splice(0, H.tasks.length), $4 = F(j, function(tA) {
              return tA.data;
            });
            H.tasks.length === 0 && H.empty(), W += 1;
            var gA = u2(q(H, j));
            N($4, gA);
          }
        }, length: function() {
          return H.tasks.length;
        }, running: function() {
          return W;
        }, idle: function() {
          return H.tasks.length + W === 0;
        }, pause: function() {
          H.paused = true;
        }, resume: function() {
          if (H.paused !== false) {
            H.paused = false;
            for (var j = Math.min(H.concurrency, H.tasks.length), $4 = 1; $4 <= j; $4++) B.setImmediate(H.process);
          }
        } };
        return H;
      }
      B.queue = function(N, M) {
        var R = bB(function(m, q) {
          N(m[0], q);
        }, M, 1);
        return R;
      }, B.priorityQueue = function(N, M) {
        function R(H, j) {
          return H.priority - j.priority;
        }
        function m(H, j, $4) {
          for (var gA = -1, tA = H.length - 1; gA < tA; ) {
            var wA = gA + (tA - gA + 1 >>> 1);
            $4(j, H[wA]) >= 0 ? gA = wA : tA = wA - 1;
          }
          return gA;
        }
        function q(H, j, $4, gA) {
          if (gA != null && typeof gA != "function") throw new Error("task callback must be a function");
          if (H.started = true, c(j) || (j = [j]), j.length === 0) return B.setImmediate(function() {
            H.drain();
          });
          G(j, function(tA) {
            var wA = { data: tA, priority: $4, callback: typeof gA == "function" ? gA : Q };
            H.tasks.splice(m(H.tasks, wA, R) + 1, 0, wA), H.tasks.length === H.concurrency && H.saturated(), B.setImmediate(H.process);
          });
        }
        var W = B.queue(N, M);
        return W.push = function(H, j, $4) {
          q(W, H, j, $4);
        }, delete W.unshift, W;
      }, B.cargo = function(N, M) {
        return bB(N, 1, M);
      };
      function xB(N) {
        return x(function(M, R) {
          M.apply(null, R.concat([x(function(m, q) {
            typeof console == "object" && (m ? console.error && console.error(m) : console[N] && G(q, function(W) {
              console[N](W);
            }));
          })]));
        });
      }
      B.log = xB("log"), B.dir = xB("dir"), B.memoize = function(N, M) {
        var R = {}, m = {};
        M = M || t;
        var q = x(function(W) {
          var H = W.pop(), j = M.apply(null, W);
          j in R ? B.nextTick(function() {
            H.apply(null, R[j]);
          }) : j in m ? m[j].push(H) : (m[j] = [H], N.apply(null, W.concat([x(function($4) {
            R[j] = $4;
            var gA = m[j];
            delete m[j];
            for (var tA = 0, wA = gA.length; tA < wA; tA++) gA[tA].apply(null, $4);
          })])));
        });
        return q.memo = R, q.unmemoized = N, q;
      }, B.unmemoize = function(N) {
        return function() {
          return (N.unmemoized || N).apply(null, arguments);
        };
      };
      function _B(N) {
        return function(M, R, m) {
          N(L(M), R, m);
        };
      }
      B.times = _B(B.map), B.timesSeries = _B(B.mapSeries), B.timesLimit = function(N, M, R, m) {
        return B.mapLimit(L(N), M, R, m);
      }, B.seq = function() {
        var N = arguments;
        return x(function(M) {
          var R = this, m = M[M.length - 1];
          typeof m == "function" ? M.pop() : m = Q, B.reduce(N, M, function(q, W, H) {
            W.apply(R, q.concat([x(function(j, $4) {
              H(j, $4);
            })]));
          }, function(q, W) {
            m.apply(R, [q].concat(W));
          });
        });
      }, B.compose = function() {
        return B.seq.apply(null, Array.prototype.reverse.call(arguments));
      };
      function KI(N) {
        return x(function(M, R) {
          var m = x(function(q) {
            var W = this, H = q.pop();
            return N(M, function(j, $4, gA) {
              j.apply(W, q.concat([gA]));
            }, H);
          });
          return R.length ? m.apply(this, R) : m;
        });
      }
      B.applyEach = KI(B.eachOf), B.applyEachSeries = KI(B.eachOfSeries), B.forever = function(N, M) {
        var R = u2(M || Q), m = $I(N);
        function q(W) {
          if (W) return R(W);
          m(q);
        }
        q();
      };
      function $I(N) {
        return x(function(M) {
          var R = M.pop();
          M.push(function() {
            var q = arguments;
            m ? B.setImmediate(function() {
              R.apply(null, q);
            }) : R.apply(null, q);
          });
          var m = true;
          N.apply(this, M), m = false;
        });
      }
      B.ensureAsync = $I, B.constant = x(function(N) {
        var M = [null].concat(N);
        return function(R) {
          return R.apply(this, M);
        };
      }), B.wrapSync = B.asyncify = function(N) {
        return x(function(M) {
          var R = M.pop(), m;
          try {
            m = N.apply(this, M);
          } catch (q) {
            return R(q);
          }
          l(m) && typeof m.then == "function" ? m.then(function(q) {
            R(null, q);
          }).catch(function(q) {
            R(q.message ? q : new Error(q));
          }) : R(null, m);
        });
      }, g.exports ? g.exports = B : o.async = B;
    })();
  })(uE);
  var hE = uE.exports;
  const Uo = console;
  YQ = class {
    static processSearchResultsParallel(g, B, Q) {
      YQ.process(hE.each, g, B, Q);
    }
    static processSearchResults(g, B, Q) {
      YQ.process(hE.eachSeries, g, B, Q);
    }
    static process(g, B, Q, t) {
      const n = [], e = B.searchProvier && B.searchProvier !== "elastic";
      let a, o = 0, u2;
      if (e) a = B.data, o = B.total ? B.total : B.data.length;
      else if (a = B.data.hits.hits, o = B.data.hits.total, a.length > 0) {
        const s = a[a.length - 1];
        s.sort && (u2 = s.sort);
      }
      g(a, function(s, p) {
        let c, l;
        if (e) {
          const i2 = Object.keys(s);
          i2.length <= 1 && B.dbName === i2[0] ? (delete s[i2[0]].total_hits, c = s[i2[0]]) : (delete s.total_hits, c = s);
        } else c = s._source, l = s.sort;
        Q(c, l), n.push(c), p();
      }, function(s) {
        s && Uo.error("Error in processing search results : " + JSON.stringify(s)), t(n, o, u2);
      });
    }
  }, Kn = class {
    static validateDocumentId(g, B) {
      const Q = /^[0-9a-zA-Z-]+$/;
      B || (B = {}), B.minimumLength || (B.minimumLength = 24);
      const t = { valid: true, reason: g + " documentId is valid." };
      return g ? typeof g != "string" ? (t.valid = false, t.reason = "DocumentId should be a string.") : g.match(Q) ? B.minimumLength > g.length && (t.valid = false, t.reason = "DocumentId should have a minimum length of " + B.minimumLength + ".") : (t.valid = false, t.reason = "DocumentId should consist of alphanumeric characters.") : (t.valid = false, t.reason = "Unable to validate undefined documentId."), t;
    }
  }, mQ = class {
    static convertToObjectPathArray(g, B) {
      return g ? (B || (B = "/"), g.indexOf(B) === 0 && (g = g.substring(1)), g.split(B)) : "";
    }
    static capitalizeFirstLetter(g) {
      return g.charAt(0).toUpperCase() + g.slice(1);
    }
    static arrayInString(g, B) {
      let Q = 0, t = false;
      do
        t = B.indexOf(g[Q++]) !== -1;
      while (!t && Q < g.length);
      return t;
    }
    static convertToObjectPath(g, B) {
      return this.convertToObjectPathArray(g, B).join(".");
    }
    static escapeSpecialChar(g) {
      const B = /[`~!@#$%^&*()_|+\-=?;:'",<>\{\}\[\]\\\/]/gi;
      return g.replace(B, "\\$&");
    }
  }, Wn = class {
    static getDiffs(g, B) {
      const Q = [], t = Object.keys(B), n = Object.keys(g), e = HA.union(t, n);
      for (let a = 0; a < e.length; a++) {
        const o = e[a];
        if (o !== "systemHeader") {
          const u2 = JSON.stringify(g[o]), s = JSON.stringify(B[o]);
          u2 !== s && Q.push({ fieldName: o, currentValue: g[o], remoteValue: B[o] });
        }
      }
      return Q;
    }
    static checkConflict(g, B) {
      if (g && g.updates && B && B.updates) for (let Q = g.updates.length - 1; Q >= 0; Q--) {
        const t = g.updates[Q], n = mQ.convertToObjectPath(t.path), e = ["systemHeader.serverDate", "systemHeader.createdDate", "systemHeader.createdBy", "systemHeader.serverUpdatedDate", "systemHeader.serverCreatedDate", "systemHeader.currentVersion", "systemHeader.versionId", "systemHeader.previousVersionId"];
        if (!dA.includes(e, n)) for (let a = B.updates.length - 1; a >= 0; a--) {
          const o = B.updates[a], u2 = mQ.convertToObjectPath(o.path, "/");
          if (n === u2 && !dA.isEqual(t.value, o.value)) return true;
        }
      }
      return false;
    }
  }, Pn = class {
    static validateColumnHeader(g, B) {
      let Q = true;
      if (g.length > 0 && B && g[0].length === B.length) {
        for (let t = 0; t < g[0].length; t++) if (g[0][t] !== B[t]) {
          Q = false;
          break;
        }
      } else Q = false;
      return Q;
    }
  }, vQ = class {
    static hasValue(g) {
      if (g === false || g === 0) return true;
      if (!g) return false;
      const B = g.length !== 0, Q = typeof g == "object" && Object.keys(g).length !== 0;
      return B || Q;
    }
    static isDefined(g) {
      return g !== null && typeof g < "u";
    }
    static isString(g) {
      return typeof g == "string" || g instanceof String;
    }
  }, jn = class {
    static isNew(g) {
      return !g.systemHeader || !g.systemHeader.createdDate;
    }
    static isPreviousVersion(g) {
      return g.systemHeader && g.systemHeader.currentVersion === false;
    }
    static isDeleted(g) {
      const B = g.systemHeader ? g.systemHeader.deleted : false;
      return B === true || B === "true";
    }
    static hasIntersect(g, B) {
      if (!g || !B) return false;
      const Q = Object.keys(B);
      for (let t = 0; t < Q.length; t++) {
        const n = Q[t];
        if (vQ.isDefined(g[n]) && vQ.isDefined(B[n]) && g[n] === B[n]) return true;
      }
      return false;
    }
    static filterDocumentFields(g, B) {
      if (!B || B.length === 0) return g;
      const Q = {};
      return B.forEach(function(t) {
        const n = dA.get(g, t);
        dA.set(Q, t, n);
      }), Q;
    }
  };
  var lE = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), Jo = new Uint8Array(16);
  function Yo() {
    if (!lE) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
    return lE(Jo);
  }
  for (var TA = [], qQ = 0; qQ < 256; ++qQ) TA.push((qQ + 256).toString(16).substr(1));
  function DE(g, B) {
    var Q = B || 0;
    return (TA[g[Q + 0]] + TA[g[Q + 1]] + TA[g[Q + 2]] + TA[g[Q + 3]] + "-" + TA[g[Q + 4]] + TA[g[Q + 5]] + "-" + TA[g[Q + 6]] + TA[g[Q + 7]] + "-" + TA[g[Q + 8]] + TA[g[Q + 9]] + "-" + TA[g[Q + 10]] + TA[g[Q + 11]] + TA[g[Q + 12]] + TA[g[Q + 13]] + TA[g[Q + 14]] + TA[g[Q + 15]]).toLowerCase();
  }
  function mo(g) {
    var B = [];
    return g.replace(/[a-fA-F0-9]{2}/g, function(Q) {
      B.push(parseInt(Q, 16));
    }), B;
  }
  function vo(g) {
    g = unescape(encodeURIComponent(g));
    for (var B = [], Q = 0; Q < g.length; ++Q) B.push(g.charCodeAt(Q));
    return B;
  }
  var Ho = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", Ko = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
  function qo(g, B, Q) {
    function t(n, e, a, o) {
      if (typeof n == "string" && (n = vo(n)), typeof e == "string" && (e = mo(e)), !Array.isArray(n)) throw TypeError("value must be an array of bytes");
      if (!Array.isArray(e) || e.length !== 16) throw TypeError("namespace must be uuid string or an Array of 16 byte values");
      var u2 = Q(e.concat(n));
      if (u2[6] = u2[6] & 15 | B, u2[8] = u2[8] & 63 | 128, a) {
        o = o || 0;
        for (var s = 0; s < 16; ++s) a[o + s] = u2[s];
        return a;
      }
      return DE(u2);
    }
    try {
      t.name = g;
    } catch {
    }
    return t.DNS = Ho, t.URL = Ko, t;
  }
  function To(g, B, Q) {
    g = g || {};
    var t = g.random || (g.rng || Yo)();
    if (t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, B) {
      Q = Q || 0;
      for (var n = 0; n < 16; ++n) B[Q + n] = t[n];
      return B;
    }
    return DE(t);
  }
  function Oo(g, B, Q, t) {
    switch (g) {
      case 0:
        return B & Q ^ ~B & t;
      case 1:
        return B ^ Q ^ t;
      case 2:
        return B & Q ^ B & t ^ Q & t;
      case 3:
        return B ^ Q ^ t;
    }
  }
  function TQ(g, B) {
    return g << B | g >>> 32 - B;
  }
  function bo(g) {
    var B = [1518500249, 1859775393, 2400959708, 3395469782], Q = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
    if (typeof g == "string") {
      var t = unescape(encodeURIComponent(g));
      g = [];
      for (var n = 0; n < t.length; ++n) g.push(t.charCodeAt(n));
    }
    g.push(128);
    for (var e = g.length / 4 + 2, a = Math.ceil(e / 16), o = new Array(a), u2 = 0; u2 < a; ++u2) {
      for (var s = new Uint32Array(16), p = 0; p < 16; ++p) s[p] = g[u2 * 64 + p * 4] << 24 | g[u2 * 64 + p * 4 + 1] << 16 | g[u2 * 64 + p * 4 + 2] << 8 | g[u2 * 64 + p * 4 + 3];
      o[u2] = s;
    }
    o[a - 1][14] = (g.length - 1) * 8 / Math.pow(2, 32), o[a - 1][14] = Math.floor(o[a - 1][14]), o[a - 1][15] = (g.length - 1) * 8 & 4294967295;
    for (var c = 0; c < a; ++c) {
      for (var l = new Uint32Array(80), i2 = 0; i2 < 16; ++i2) l[i2] = o[c][i2];
      for (var f = 16; f < 80; ++f) l[f] = TQ(l[f - 3] ^ l[f - 8] ^ l[f - 14] ^ l[f - 16], 1);
      for (var G = Q[0], F = Q[1], L = Q[2], U = Q[3], b = Q[4], S = 0; S < 80; ++S) {
        var Y = Math.floor(S / 20), Z3 = TQ(G, 5) + Oo(Y, F, L, U) + b + B[Y] + l[S] >>> 0;
        b = U, U = L, L = TQ(F, 30) >>> 0, F = G, G = Z3;
      }
      Q[0] = Q[0] + G >>> 0, Q[1] = Q[1] + F >>> 0, Q[2] = Q[2] + L >>> 0, Q[3] = Q[3] + U >>> 0, Q[4] = Q[4] + b >>> 0;
    }
    return [Q[0] >> 24 & 255, Q[0] >> 16 & 255, Q[0] >> 8 & 255, Q[0] & 255, Q[1] >> 24 & 255, Q[1] >> 16 & 255, Q[1] >> 8 & 255, Q[1] & 255, Q[2] >> 24 & 255, Q[2] >> 16 & 255, Q[2] >> 8 & 255, Q[2] & 255, Q[3] >> 24 & 255, Q[3] >> 16 & 255, Q[3] >> 8 & 255, Q[3] & 255, Q[4] >> 24 & 255, Q[4] >> 16 & 255, Q[4] >> 8 & 255, Q[4] & 255];
  }
  var xo = qo("v5", 80, bo);
  const _o = xo, Po = 36;
  gE = class {
    static generateId() {
      const g = typeof window < "u" ? window.crypto : void 0;
      if (typeof g < "u" && g.randomUUID) return g.randomUUID();
      {
        const B = To(), Q = Math.random().toString();
        return _o(Q, B);
      }
    }
    static isValid(g) {
      return g && g.length === Po;
    }
  }, Vn = class {
    static hasValue(g) {
      let B = false;
      if (dA.isArray(g)) for (let Q = 0; Q < g.length; Q++) g[Q] && (B = true);
      else g && (B = true);
      return B;
    }
    static hasValues(g) {
      let B = false;
      if (g && g.features) {
        const Q = g.features;
        for (let t = 0; t < Q.length && !B; t++) {
          if (Q[t].properties) {
            for (const n in Q[t].properties) if (Q[t].properties.hasOwnProperty(n) && Q[t].properties[n] && (B = this.hasValue(Q[t].properties[n]), B)) break;
          }
          if (!B && Q[t].geometry && Q[t].geometry.coordinates) {
            for (let n = 0; n < Q[t].geometry.coordinates.length; n++) if (Q[t].geometry.coordinates[n]) if (dA.isString(Q[t].geometry.coordinates[n])) {
              if (dA.trim(Q[t].geometry.coordinates[n]) !== "") {
                B = true;
                break;
              }
            } else {
              B = true;
              break;
            }
          }
        }
      }
      return B;
    }
  };
  let AA;
  IA = { ACCEPTED: 202, BAD_GATEWAY: 502, BAD_REQUEST: 400, CONFLICT: 409, CONTINUE: 100, CREATED: 201, EXPECTATION_FAILED: 417, FORBIDDEN: 403, GATEWAY_TIMEOUT: 504, GONE: 410, HTTP_VERSION_NOT_SUPPORTED: 505, INSUFFICIENT_SPACE_ON_RESOURCE: 419, INSUFFICIENT_STORAGE: 507, INTERNAL_SERVER_ERROR: 500, LENGTH_REQUIRED: 411, LOCKED: 423, METHOD_FAILURE: 420, METHOD_NOT_ALLOWED: 405, MOVED_PERMANENTLY: 301, MOVED_TEMPORARILY: 302, MULTI_STATUS: 207, MULTIPLE_CHOICES: 300, NO_CONTENT: 204, NON_AUTHORITATIVE_INFORMATION: 203, NOT_ACCEPTABLE: 406, NOT_FOUND: 404, NOT_IMPLEMENTED: 501, NOT_MODIFIED: 304, OK: 200, PARTIAL_CONTENT: 206, PAYMENT_REQUIRED: 402, PRECONDITION_FAILED: 412, PROCESSING: 102, PROXY_AUTHENTICATION_REQUIRED: 407, REQUEST_TIMEOUT: 408, REQUEST_TOO_LONG: 413, REQUEST_URI_TOO_LONG: 414, REQUESTED_RANGE_NOT_SATISFIABLE: 416, RESET_CONTENT: 205, SEE_OTHER: 303, SERVICE_UNAVAILABLE: 503, SWITCHING_PROTOCOLS: 101, TEMPORARY_REDIRECT: 307, UNAUTHORIZED: 401, UNPROCESSABLE_ENTITY: 422, UNSUPPORTED_MEDIA_TYPE: 415, USE_PROXY: 305, ELASTICSEARCH: 306, SERVER_UNRESPONSIVE: 0, EARLY_HINTS: 103 }, AA = {}, AA[IA.ACCEPTED] = "Accepted", AA[IA.BAD_GATEWAY] = "Bad Gateway", AA[IA.BAD_REQUEST] = "Bad Request", AA[IA.CONFLICT] = "Conflict", AA[IA.CONTINUE] = "Continue", AA[IA.CREATED] = "Created", AA[IA.EXPECTATION_FAILED] = "Expectation Failed", AA[IA.FORBIDDEN] = "Forbidden", AA[IA.GATEWAY_TIMEOUT] = "Gateway Timeout", AA[IA.GONE] = "Gone", AA[IA.HTTP_VERSION_NOT_SUPPORTED] = "HTTP Version Not Supported", AA[IA.INSUFFICIENT_SPACE_ON_RESOURCE] = "Insufficient Space on Resource", AA[IA.INSUFFICIENT_STORAGE] = "Insufficient Storage", AA[IA.INTERNAL_SERVER_ERROR] = "Server Error", AA[IA.LENGTH_REQUIRED] = "Length Required", AA[IA.LOCKED] = "Locked", AA[IA.METHOD_FAILURE] = "Method Failure", AA[IA.METHOD_NOT_ALLOWED] = "Method Not Allowed", AA[IA.MOVED_PERMANENTLY] = "Moved Permanently", AA[IA.MOVED_TEMPORARILY] = "Moved Temporarily", AA[IA.MULTI_STATUS] = "Multi-Status", AA[IA.MULTIPLE_CHOICES] = "Multiple Choices", AA[IA.NO_CONTENT] = "No Content", AA[IA.NON_AUTHORITATIVE_INFORMATION] = "Non Authoritative Information", AA[IA.NOT_ACCEPTABLE] = "Not Acceptable", AA[IA.NOT_FOUND] = "Not Found", AA[IA.NOT_IMPLEMENTED] = "Not Implemented", AA[IA.NOT_MODIFIED] = "Not Modified", AA[IA.OK] = "OK", AA[IA.PARTIAL_CONTENT] = "Partial Content", AA[IA.PAYMENT_REQUIRED] = "Payment Required", AA[IA.PRECONDITION_FAILED] = "Precondition Failed", AA[IA.PROCESSING] = "Processing", AA[IA.PROXY_AUTHENTICATION_REQUIRED] = "Proxy Authentication Required", AA[IA.REQUEST_TIMEOUT] = "Request Timeout", AA[IA.REQUEST_TOO_LONG] = "Request Entity Too Large", AA[IA.REQUEST_URI_TOO_LONG] = "Request-URI Too Long", AA[IA.REQUESTED_RANGE_NOT_SATISFIABLE] = "Requested Range Not Satisfiable", AA[IA.RESET_CONTENT] = "Reset Content", AA[IA.SEE_OTHER] = "See Other", AA[IA.SERVICE_UNAVAILABLE] = "Service Unavailable", AA[IA.SWITCHING_PROTOCOLS] = "Switching Protocols", AA[IA.TEMPORARY_REDIRECT] = "Temporary Redirect", AA[IA.UNAUTHORIZED] = "Unauthorized", AA[IA.UNPROCESSABLE_ENTITY] = "Unprocessable Entity", AA[IA.UNSUPPORTED_MEDIA_TYPE] = "Unsupported Media Type", AA[IA.USE_PROXY] = "Use Proxy", AA[IA.ELASTICSEARCH] = "Error - search is not running. Please contact a system administrator to configure it", AA[IA.SERVER_UNRESPONSIVE] = "Aborted/Timed out request: Server is down or client not connected.", AA[IA.EARLY_HINTS] = "Early Hints";
  function Wo(g) {
    if (AA.hasOwnProperty(g)) return AA[g];
    throw new Error("Status code does not exist: " + g);
  }
  IA.getStatusText = Wo;
  function jo(g) {
    const B = [];
    for (let Q = 0; Q < g.length; Q++) {
      const t = g[Q];
      HA.contains(B, t) || B.push(t);
    }
    return B;
  }
  function pE(g) {
    if (g) {
      const B = [], Q = /[\t ]*[\#]include\s+\".*\"/mg;
      let t;
      for (; (t = Q.exec(g)) !== null; ) if (t) {
        const n = new RegExp(`['"](.*)['"]`).exec(t)[1];
        B.push(n);
      }
      return B;
    }
    return [];
  }
  zn = class {
    static getIncludeNames(g) {
      const B = pE(g);
      return [].concat(jo(B));
    }
    static getDuplicateIncludes(g) {
      const B = pE(g), Q = [];
      for (let t = 0; t < B.length; t++) {
        const n = B[t];
        if (!HA.contains(Q, n)) Q.push(n);
        else return n;
      }
      return null;
    }
  }, $n = class {
    static getRelatedName(g) {
      const B = K.RULESET_RELATIONSHIPS, Q = Object.keys(B);
      let t;
      for (let n = 0; n < Q.length; n++) if (B[Q[n]].name === g) {
        t = B[Q[n]].relName;
        break;
      }
      return t;
    }
  };
  class Zo extends Error {
    constructor(B) {
      super(), this.message = B, this.stack = new Error().stack, this.name = this.constructor.name;
    }
  }
  On = class extends Zo {
    constructor(g) {
      super(g);
    }
  };
  function dB(g) {
    throw new Error('Could not dynamically require "' + g + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
  }
  var OQ = { exports: {} }, bQ = { exports: {} }, GI = {}, GA = {};
  GA.__esModule = true, GA.extend = wE, GA.indexOf = Ar, GA.escapeExpression = Ir, GA.isEmpty = gr, GA.createFrame = Br, GA.blockParams = Qr, GA.appendContextPath = Cr;
  var Vo = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;", "=": "&#x3D;" }, Xo = /[&<>"'`=]/g, zo = /[&<>"'`=]/;
  function $o(g) {
    return Vo[g];
  }
  function wE(g) {
    for (var B = 1; B < arguments.length; B++) for (var Q in arguments[B]) Object.prototype.hasOwnProperty.call(arguments[B], Q) && (g[Q] = arguments[B][Q]);
    return g;
  }
  var xQ = Object.prototype.toString;
  GA.toString = xQ;
  var _Q = function(g) {
    return typeof g == "function";
  };
  _Q(/x/) && (GA.isFunction = _Q = function(g) {
    return typeof g == "function" && xQ.call(g) === "[object Function]";
  }), GA.isFunction = _Q;
  var fE = Array.isArray || function(g) {
    return g && typeof g == "object" ? xQ.call(g) === "[object Array]" : false;
  };
  GA.isArray = fE;
  function Ar(g, B) {
    for (var Q = 0, t = g.length; Q < t; Q++) if (g[Q] === B) return Q;
    return -1;
  }
  function Ir(g) {
    if (typeof g != "string") {
      if (g && g.toHTML) return g.toHTML();
      if (g == null) return "";
      if (!g) return g + "";
      g = "" + g;
    }
    return zo.test(g) ? g.replace(Xo, $o) : g;
  }
  function gr(g) {
    return !g && g !== 0 ? true : !!(fE(g) && g.length === 0);
  }
  function Br(g) {
    var B = wE({}, g);
    return B._parent = g, B;
  }
  function Qr(g, B) {
    return g.path = B, g;
  }
  function Cr(g, B) {
    return (g ? g + "." : "") + B;
  }
  var PQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];
    function t(n, e) {
      var a = e && e.loc, o = void 0, u2 = void 0;
      a && (o = a.start.line, u2 = a.start.column, n += " - " + o + ":" + u2);
      for (var s = Error.prototype.constructor.call(this, n), p = 0; p < Q.length; p++) this[Q[p]] = s[Q[p]];
      Error.captureStackTrace && Error.captureStackTrace(this, t);
      try {
        a && (this.lineNumber = o, Object.defineProperty ? Object.defineProperty(this, "column", { value: u2, enumerable: true }) : this.column = u2);
      } catch {
      }
    }
    t.prototype = new Error(), B.default = t, g.exports = B.default;
  })(PQ, PQ.exports);
  var mI = PQ.exports, WQ = {}, jQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = GA;
    B.default = function(t) {
      t.registerHelper("blockHelperMissing", function(n, e) {
        var a = e.inverse, o = e.fn;
        if (n === true) return o(this);
        if (n === false || n == null) return a(this);
        if (Q.isArray(n)) return n.length > 0 ? (e.ids && (e.ids = [e.name]), t.helpers.each(n, e)) : a(this);
        if (e.data && e.ids) {
          var u2 = Q.createFrame(e.data);
          u2.contextPath = Q.appendContextPath(e.data.contextPath, e.name), e = { data: u2 };
        }
        return o(n, e);
      });
    }, g.exports = B.default;
  })(jQ, jQ.exports);
  var tr = jQ.exports, ZQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    function Q(a) {
      return a && a.__esModule ? a : { default: a };
    }
    var t = GA, n = mI, e = Q(n);
    B.default = function(a) {
      a.registerHelper("each", function(o, u2) {
        if (!u2) throw new e.default("Must pass iterator to #each");
        var s = u2.fn, p = u2.inverse, c = 0, l = "", i2 = void 0, f = void 0;
        u2.data && u2.ids && (f = t.appendContextPath(u2.data.contextPath, u2.ids[0]) + "."), t.isFunction(o) && (o = o.call(this)), u2.data && (i2 = t.createFrame(u2.data));
        function G(b, S, Y) {
          i2 && (i2.key = b, i2.index = S, i2.first = S === 0, i2.last = !!Y, f && (i2.contextPath = f + b)), l = l + s(o[b], { data: i2, blockParams: t.blockParams([o[b], b], [f + b, null]) });
        }
        if (o && typeof o == "object") if (t.isArray(o)) for (var F = o.length; c < F; c++) c in o && G(c, c, c === o.length - 1);
        else {
          var L = void 0;
          for (var U in o) o.hasOwnProperty(U) && (L !== void 0 && G(L, c - 1), L = U, c++);
          L !== void 0 && G(L, c - 1, true);
        }
        return c === 0 && (l = p(this)), l;
      });
    }, g.exports = B.default;
  })(ZQ, ZQ.exports);
  var Er = ZQ.exports, VQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    function Q(e) {
      return e && e.__esModule ? e : { default: e };
    }
    var t = mI, n = Q(t);
    B.default = function(e) {
      e.registerHelper("helperMissing", function() {
        if (arguments.length !== 1) throw new n.default('Missing helper: "' + arguments[arguments.length - 1].name + '"');
      });
    }, g.exports = B.default;
  })(VQ, VQ.exports);
  var er = VQ.exports, XQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = GA;
    B.default = function(t) {
      t.registerHelper("if", function(n, e) {
        return Q.isFunction(n) && (n = n.call(this)), !e.hash.includeZero && !n || Q.isEmpty(n) ? e.inverse(this) : e.fn(this);
      }), t.registerHelper("unless", function(n, e) {
        return t.helpers.if.call(this, n, { fn: e.inverse, inverse: e.fn, hash: e.hash });
      });
    }, g.exports = B.default;
  })(XQ, XQ.exports);
  var ir = XQ.exports, zQ = { exports: {} };
  (function(g, B) {
    B.__esModule = true, B.default = function(Q) {
      Q.registerHelper("log", function() {
        for (var t = [void 0], n = arguments[arguments.length - 1], e = 0; e < arguments.length - 1; e++) t.push(arguments[e]);
        var a = 1;
        n.hash.level != null ? a = n.hash.level : n.data && n.data.level != null && (a = n.data.level), t[0] = a, Q.log.apply(Q, t);
      });
    }, g.exports = B.default;
  })(zQ, zQ.exports);
  var nr = zQ.exports, $Q = { exports: {} };
  (function(g, B) {
    B.__esModule = true, B.default = function(Q) {
      Q.registerHelper("lookup", function(t, n) {
        return t && t[n];
      });
    }, g.exports = B.default;
  })($Q, $Q.exports);
  var or = $Q.exports, AC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = GA;
    B.default = function(t) {
      t.registerHelper("with", function(n, e) {
        Q.isFunction(n) && (n = n.call(this));
        var a = e.fn;
        if (Q.isEmpty(n)) return e.inverse(this);
        var o = e.data;
        return e.data && e.ids && (o = Q.createFrame(e.data), o.contextPath = Q.appendContextPath(e.data.contextPath, e.ids[0])), a(n, { data: o, blockParams: Q.blockParams([n], [o && o.contextPath]) });
      });
    }, g.exports = B.default;
  })(AC, AC.exports);
  var rr = AC.exports;
  WQ.__esModule = true, WQ.registerDefaultHelpers = dr;
  function rg(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var ar = tr, sr = rg(ar), cr = Er, ur = rg(cr), hr = er, lr = rg(hr), Dr = ir, pr = rg(Dr), wr = nr, fr = rg(wr), yr = or, Gr = rg(yr), Nr = rr, kr = rg(Nr);
  function dr(g) {
    sr.default(g), ur.default(g), lr.default(g), pr.default(g), fr.default(g), Gr.default(g), kr.default(g);
  }
  var IC = {}, gC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = GA;
    B.default = function(t) {
      t.registerDecorator("inline", function(n, e, a, o) {
        var u2 = n;
        return e.partials || (e.partials = {}, u2 = function(s, p) {
          var c = a.partials;
          a.partials = Q.extend({}, c, e.partials);
          var l = n(s, p);
          return a.partials = c, l;
        }), e.partials[o.args[0]] = o.fn, u2;
      });
    }, g.exports = B.default;
  })(gC, gC.exports);
  var Sr = gC.exports;
  IC.__esModule = true, IC.registerDefaultDecorators = Lr;
  function Mr(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var Rr = Sr, Fr = Mr(Rr);
  function Lr(g) {
    Fr.default(g);
  }
  var BC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = GA, t = { methodMap: ["debug", "info", "warn", "error"], level: "info", lookupLevel: function(n) {
      if (typeof n == "string") {
        var e = Q.indexOf(t.methodMap, n.toLowerCase());
        e >= 0 ? n = e : n = parseInt(n, 10);
      }
      return n;
    }, log: function(n) {
      if (n = t.lookupLevel(n), typeof console < "u" && t.lookupLevel(t.level) <= n) {
        var e = t.methodMap[n];
        console[e] || (e = "log");
        for (var a = arguments.length, o = Array(a > 1 ? a - 1 : 0), u2 = 1; u2 < a; u2++) o[u2 - 1] = arguments[u2];
        console[e].apply(console, o);
      }
    } };
    B.default = t, g.exports = B.default;
  })(BC, BC.exports);
  var Ur = BC.exports;
  GI.__esModule = true, GI.HandlebarsEnvironment = tC;
  function yE(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var ag = GA, Jr = mI, QC = yE(Jr), Yr = WQ, mr = IC, vr = Ur, SB = yE(vr), Hr = "4.1.0";
  GI.VERSION = Hr;
  var Kr = 7;
  GI.COMPILER_REVISION = Kr;
  var qr = { 1: "<= 1.0.rc.2", 2: "== 1.0.0-rc.3", 3: "== 1.0.0-rc.4", 4: "== 1.x.x", 5: "== 2.0.0-alpha.x", 6: ">= 2.0.0-beta.1", 7: ">= 4.0.0" };
  GI.REVISION_CHANGES = qr;
  var CC = "[object Object]";
  function tC(g, B, Q) {
    this.helpers = g || {}, this.partials = B || {}, this.decorators = Q || {}, Yr.registerDefaultHelpers(this), mr.registerDefaultDecorators(this);
  }
  tC.prototype = { constructor: tC, logger: SB.default, log: SB.default.log, registerHelper: function(g, B) {
    if (ag.toString.call(g) === CC) {
      if (B) throw new QC.default("Arg not supported with multiple helpers");
      ag.extend(this.helpers, g);
    } else this.helpers[g] = B;
  }, unregisterHelper: function(g) {
    delete this.helpers[g];
  }, registerPartial: function(g, B) {
    if (ag.toString.call(g) === CC) ag.extend(this.partials, g);
    else {
      if (typeof B > "u") throw new QC.default('Attempting to register a partial called "' + g + '" as undefined');
      this.partials[g] = B;
    }
  }, unregisterPartial: function(g) {
    delete this.partials[g];
  }, registerDecorator: function(g, B) {
    if (ag.toString.call(g) === CC) {
      if (B) throw new QC.default("Arg not supported with multiple decorators");
      ag.extend(this.decorators, g);
    } else this.decorators[g] = B;
  }, unregisterDecorator: function(g) {
    delete this.decorators[g];
  } };
  var Tr = SB.default.log;
  GI.log = Tr, GI.createFrame = ag.createFrame, GI.logger = SB.default;
  var EC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    function Q(t) {
      this.string = t;
    }
    Q.prototype.toString = Q.prototype.toHTML = function() {
      return "" + this.string;
    }, B.default = Q, g.exports = B.default;
  })(EC, EC.exports);
  var Or = EC.exports, XI = {};
  XI.__esModule = true, XI.checkRevision = Wr, XI.template = jr, XI.wrapProgram = MB, XI.resolvePartial = Zr, XI.invokePartial = Vr, XI.noop = GE;
  function br(g) {
    return g && g.__esModule ? g : { default: g };
  }
  function xr(g) {
    if (g && g.__esModule) return g;
    var B = {};
    if (g != null) for (var Q in g) Object.prototype.hasOwnProperty.call(g, Q) && (B[Q] = g[Q]);
    return B.default = g, B;
  }
  var _r = GA, Wg = xr(_r), Pr = mI, vI = br(Pr), Sg = GI;
  function Wr(g) {
    var B = g && g[0] || 1, Q = Sg.COMPILER_REVISION;
    if (B !== Q) if (B < Q) {
      var t = Sg.REVISION_CHANGES[Q], n = Sg.REVISION_CHANGES[B];
      throw new vI.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + t + ") or downgrade your runtime to an older version (" + n + ").");
    } else throw new vI.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + g[1] + ").");
  }
  function jr(g, B) {
    if (!B) throw new vI.default("No environment passed to template");
    if (!g || !g.main) throw new vI.default("Unknown template object: " + typeof g);
    g.main.decorator = g.main_d, B.VM.checkRevision(g.compiler);
    function Q(e, a, o) {
      o.hash && (a = Wg.extend({}, a, o.hash), o.ids && (o.ids[0] = true)), e = B.VM.resolvePartial.call(this, e, a, o);
      var u2 = B.VM.invokePartial.call(this, e, a, o);
      if (u2 == null && B.compile && (o.partials[o.name] = B.compile(e, g.compilerOptions, B), u2 = o.partials[o.name](a, o)), u2 != null) {
        if (o.indent) {
          for (var s = u2.split(`
`), p = 0, c = s.length; p < c && !(!s[p] && p + 1 === c); p++) s[p] = o.indent + s[p];
          u2 = s.join(`
`);
        }
        return u2;
      } else throw new vI.default("The partial " + o.name + " could not be compiled when running in runtime-only mode");
    }
    var t = { strict: function(e, a) {
      if (!(a in e)) throw new vI.default('"' + a + '" not defined in ' + e);
      return e[a];
    }, lookup: function(e, a) {
      for (var o = e.length, u2 = 0; u2 < o; u2++) if (e[u2] && e[u2][a] != null) return e[u2][a];
    }, lambda: function(e, a) {
      return typeof e == "function" ? e.call(a) : e;
    }, escapeExpression: Wg.escapeExpression, invokePartial: Q, fn: function(e) {
      var a = g[e];
      return a.decorator = g[e + "_d"], a;
    }, programs: [], program: function(e, a, o, u2, s) {
      var p = this.programs[e], c = this.fn(e);
      return a || s || u2 || o ? p = MB(this, e, c, a, o, u2, s) : p || (p = this.programs[e] = MB(this, e, c)), p;
    }, data: function(e, a) {
      for (; e && a--; ) e = e._parent;
      return e;
    }, merge: function(e, a) {
      var o = e || a;
      return e && a && e !== a && (o = Wg.extend({}, a, e)), o;
    }, nullContext: Object.seal({}), noop: B.VM.noop, compilerInfo: g.compiler };
    function n(e) {
      var a = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1], o = a.data;
      n._setup(a), !a.partial && g.useData && (o = Xr(e, o));
      var u2 = void 0, s = g.useBlockParams ? [] : void 0;
      g.useDepths && (a.depths ? u2 = e != a.depths[0] ? [e].concat(a.depths) : a.depths : u2 = [e]);
      function p(c) {
        return "" + g.main(t, c, t.helpers, t.partials, o, s, u2);
      }
      return p = NE(g.main, p, t, a.depths || [], o, s), p(e, a);
    }
    return n.isTop = true, n._setup = function(e) {
      e.partial ? (t.helpers = e.helpers, t.partials = e.partials, t.decorators = e.decorators) : (t.helpers = t.merge(e.helpers, B.helpers), g.usePartial && (t.partials = t.merge(e.partials, B.partials)), (g.usePartial || g.useDecorators) && (t.decorators = t.merge(e.decorators, B.decorators)));
    }, n._child = function(e, a, o, u2) {
      if (g.useBlockParams && !o) throw new vI.default("must pass block params");
      if (g.useDepths && !u2) throw new vI.default("must pass parent depths");
      return MB(t, e, g[e], a, 0, o, u2);
    }, n;
  }
  function MB(g, B, Q, t, n, e, a) {
    function o(u2) {
      var s = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1], p = a;
      return a && u2 != a[0] && !(u2 === g.nullContext && a[0] === null) && (p = [u2].concat(a)), Q(g, u2, g.helpers, g.partials, s.data || t, e && [s.blockParams].concat(e), p);
    }
    return o = NE(Q, o, g, a, t, e), o.program = B, o.depth = a ? a.length : 0, o.blockParams = n || 0, o;
  }
  function Zr(g, B, Q) {
    return g ? !g.call && !Q.name && (Q.name = g, g = Q.partials[g]) : Q.name === "@partial-block" ? g = Q.data["partial-block"] : g = Q.partials[Q.name], g;
  }
  function Vr(g, B, Q) {
    var t = Q.data && Q.data["partial-block"];
    Q.partial = true, Q.ids && (Q.data.contextPath = Q.ids[0] || Q.data.contextPath);
    var n = void 0;
    if (Q.fn && Q.fn !== GE && function() {
      Q.data = Sg.createFrame(Q.data);
      var e = Q.fn;
      n = Q.data["partial-block"] = function(a) {
        var o = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
        return o.data = Sg.createFrame(o.data), o.data["partial-block"] = t, e(a, o);
      }, e.partials && (Q.partials = Wg.extend({}, Q.partials, e.partials));
    }(), g === void 0 && n && (g = n), g === void 0) throw new vI.default("The partial " + Q.name + " could not be found");
    if (g instanceof Function) return g(B, Q);
  }
  function GE() {
    return "";
  }
  function Xr(g, B) {
    return (!B || !("root" in B)) && (B = B ? Sg.createFrame(B) : {}, B.root = g), B;
  }
  function NE(g, B, Q, t, n, e) {
    if (g.decorator) {
      var a = {};
      B = g.decorator(B, a, Q, t && t[0], n, e, t), Wg.extend(B, a);
    }
    return B;
  }
  var eC = { exports: {} };
  (function(g, B) {
    B.__esModule = true, B.default = function(Q) {
      var t = typeof yI < "u" ? yI : window, n = t.Handlebars;
      Q.noConflict = function() {
        return t.Handlebars === Q && (t.Handlebars = n), Q;
      };
    }, g.exports = B.default;
  })(eC, eC.exports);
  var kE = eC.exports;
  (function(g, B) {
    B.__esModule = true;
    function Q(U) {
      return U && U.__esModule ? U : { default: U };
    }
    function t(U) {
      if (U && U.__esModule) return U;
      var b = {};
      if (U != null) for (var S in U) Object.prototype.hasOwnProperty.call(U, S) && (b[S] = U[S]);
      return b.default = U, b;
    }
    var n = GI, e = t(n), a = Or, o = Q(a), u2 = mI, s = Q(u2), p = GA, c = t(p), l = XI, i2 = t(l), f = kE, G = Q(f);
    function F() {
      var U = new e.HandlebarsEnvironment();
      return c.extend(U, e), U.SafeString = o.default, U.Exception = s.default, U.Utils = c, U.escapeExpression = c.escapeExpression, U.VM = i2, U.template = function(b) {
        return i2.template(b, U);
      }, U;
    }
    var L = F();
    L.create = F, G.default(L), L.default = L, B.default = L, g.exports = B.default;
  })(bQ, bQ.exports);
  var zr = bQ.exports, iC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = { helpers: { helperExpression: function(t) {
      return t.type === "SubExpression" || (t.type === "MustacheStatement" || t.type === "BlockStatement") && !!(t.params && t.params.length || t.hash);
    }, scopedId: function(t) {
      return /^\.|this\b/.test(t.original);
    }, simpleId: function(t) {
      return t.parts.length === 1 && !Q.helpers.scopedId(t) && !t.depth;
    } } };
    B.default = Q, g.exports = B.default;
  })(iC, iC.exports);
  var dE = iC.exports, RB = {}, nC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    var Q = function() {
      var t = { trace: function() {
      }, yy: {}, symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, partialBlock: 12, content: 13, COMMENT: 14, CONTENT: 15, openRawBlock: 16, rawBlock_repetition_plus0: 17, END_RAW_BLOCK: 18, OPEN_RAW_BLOCK: 19, helperName: 20, openRawBlock_repetition0: 21, openRawBlock_option0: 22, CLOSE_RAW_BLOCK: 23, openBlock: 24, block_option0: 25, closeBlock: 26, openInverse: 27, block_option1: 28, OPEN_BLOCK: 29, openBlock_repetition0: 30, openBlock_option0: 31, openBlock_option1: 32, CLOSE: 33, OPEN_INVERSE: 34, openInverse_repetition0: 35, openInverse_option0: 36, openInverse_option1: 37, openInverseChain: 38, OPEN_INVERSE_CHAIN: 39, openInverseChain_repetition0: 40, openInverseChain_option0: 41, openInverseChain_option1: 42, inverseAndProgram: 43, INVERSE: 44, inverseChain: 45, inverseChain_option0: 46, OPEN_ENDBLOCK: 47, OPEN: 48, mustache_repetition0: 49, mustache_option0: 50, OPEN_UNESCAPED: 51, mustache_repetition1: 52, mustache_option1: 53, CLOSE_UNESCAPED: 54, OPEN_PARTIAL: 55, partialName: 56, partial_repetition0: 57, partial_option0: 58, openPartialBlock: 59, OPEN_PARTIAL_BLOCK: 60, openPartialBlock_repetition0: 61, openPartialBlock_option0: 62, param: 63, sexpr: 64, OPEN_SEXPR: 65, sexpr_repetition0: 66, sexpr_option0: 67, CLOSE_SEXPR: 68, hash: 69, hash_repetition_plus0: 70, hashSegment: 71, ID: 72, EQUALS: 73, blockParams: 74, OPEN_BLOCK_PARAMS: 75, blockParams_repetition_plus0: 76, CLOSE_BLOCK_PARAMS: 77, path: 78, dataName: 79, STRING: 80, NUMBER: 81, BOOLEAN: 82, UNDEFINED: 83, NULL: 84, DATA: 85, pathSegments: 86, SEP: 87, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], performAction: function(a, o, u2, s, p, c, l) {
        var i2 = c.length - 1;
        switch (p) {
          case 1:
            return c[i2 - 1];
          case 2:
            this.$ = s.prepareProgram(c[i2]);
            break;
          case 3:
            this.$ = c[i2];
            break;
          case 4:
            this.$ = c[i2];
            break;
          case 5:
            this.$ = c[i2];
            break;
          case 6:
            this.$ = c[i2];
            break;
          case 7:
            this.$ = c[i2];
            break;
          case 8:
            this.$ = c[i2];
            break;
          case 9:
            this.$ = { type: "CommentStatement", value: s.stripComment(c[i2]), strip: s.stripFlags(c[i2], c[i2]), loc: s.locInfo(this._$) };
            break;
          case 10:
            this.$ = { type: "ContentStatement", original: c[i2], value: c[i2], loc: s.locInfo(this._$) };
            break;
          case 11:
            this.$ = s.prepareRawBlock(c[i2 - 2], c[i2 - 1], c[i2], this._$);
            break;
          case 12:
            this.$ = { path: c[i2 - 3], params: c[i2 - 2], hash: c[i2 - 1] };
            break;
          case 13:
            this.$ = s.prepareBlock(c[i2 - 3], c[i2 - 2], c[i2 - 1], c[i2], false, this._$);
            break;
          case 14:
            this.$ = s.prepareBlock(c[i2 - 3], c[i2 - 2], c[i2 - 1], c[i2], true, this._$);
            break;
          case 15:
            this.$ = { open: c[i2 - 5], path: c[i2 - 4], params: c[i2 - 3], hash: c[i2 - 2], blockParams: c[i2 - 1], strip: s.stripFlags(c[i2 - 5], c[i2]) };
            break;
          case 16:
            this.$ = { path: c[i2 - 4], params: c[i2 - 3], hash: c[i2 - 2], blockParams: c[i2 - 1], strip: s.stripFlags(c[i2 - 5], c[i2]) };
            break;
          case 17:
            this.$ = { path: c[i2 - 4], params: c[i2 - 3], hash: c[i2 - 2], blockParams: c[i2 - 1], strip: s.stripFlags(c[i2 - 5], c[i2]) };
            break;
          case 18:
            this.$ = { strip: s.stripFlags(c[i2 - 1], c[i2 - 1]), program: c[i2] };
            break;
          case 19:
            var f = s.prepareBlock(c[i2 - 2], c[i2 - 1], c[i2], c[i2], false, this._$), G = s.prepareProgram([f], c[i2 - 1].loc);
            G.chained = true, this.$ = { strip: c[i2 - 2].strip, program: G, chain: true };
            break;
          case 20:
            this.$ = c[i2];
            break;
          case 21:
            this.$ = { path: c[i2 - 1], strip: s.stripFlags(c[i2 - 2], c[i2]) };
            break;
          case 22:
            this.$ = s.prepareMustache(c[i2 - 3], c[i2 - 2], c[i2 - 1], c[i2 - 4], s.stripFlags(c[i2 - 4], c[i2]), this._$);
            break;
          case 23:
            this.$ = s.prepareMustache(c[i2 - 3], c[i2 - 2], c[i2 - 1], c[i2 - 4], s.stripFlags(c[i2 - 4], c[i2]), this._$);
            break;
          case 24:
            this.$ = { type: "PartialStatement", name: c[i2 - 3], params: c[i2 - 2], hash: c[i2 - 1], indent: "", strip: s.stripFlags(c[i2 - 4], c[i2]), loc: s.locInfo(this._$) };
            break;
          case 25:
            this.$ = s.preparePartialBlock(c[i2 - 2], c[i2 - 1], c[i2], this._$);
            break;
          case 26:
            this.$ = { path: c[i2 - 3], params: c[i2 - 2], hash: c[i2 - 1], strip: s.stripFlags(c[i2 - 4], c[i2]) };
            break;
          case 27:
            this.$ = c[i2];
            break;
          case 28:
            this.$ = c[i2];
            break;
          case 29:
            this.$ = { type: "SubExpression", path: c[i2 - 3], params: c[i2 - 2], hash: c[i2 - 1], loc: s.locInfo(this._$) };
            break;
          case 30:
            this.$ = { type: "Hash", pairs: c[i2], loc: s.locInfo(this._$) };
            break;
          case 31:
            this.$ = { type: "HashPair", key: s.id(c[i2 - 2]), value: c[i2], loc: s.locInfo(this._$) };
            break;
          case 32:
            this.$ = s.id(c[i2 - 1]);
            break;
          case 33:
            this.$ = c[i2];
            break;
          case 34:
            this.$ = c[i2];
            break;
          case 35:
            this.$ = { type: "StringLiteral", value: c[i2], original: c[i2], loc: s.locInfo(this._$) };
            break;
          case 36:
            this.$ = { type: "NumberLiteral", value: Number(c[i2]), original: Number(c[i2]), loc: s.locInfo(this._$) };
            break;
          case 37:
            this.$ = { type: "BooleanLiteral", value: c[i2] === "true", original: c[i2] === "true", loc: s.locInfo(this._$) };
            break;
          case 38:
            this.$ = { type: "UndefinedLiteral", original: void 0, value: void 0, loc: s.locInfo(this._$) };
            break;
          case 39:
            this.$ = { type: "NullLiteral", original: null, value: null, loc: s.locInfo(this._$) };
            break;
          case 40:
            this.$ = c[i2];
            break;
          case 41:
            this.$ = c[i2];
            break;
          case 42:
            this.$ = s.preparePath(true, c[i2], this._$);
            break;
          case 43:
            this.$ = s.preparePath(false, c[i2], this._$);
            break;
          case 44:
            c[i2 - 2].push({ part: s.id(c[i2]), original: c[i2], separator: c[i2 - 1] }), this.$ = c[i2 - 2];
            break;
          case 45:
            this.$ = [{ part: s.id(c[i2]), original: c[i2] }];
            break;
          case 46:
            this.$ = [];
            break;
          case 47:
            c[i2 - 1].push(c[i2]);
            break;
          case 48:
            this.$ = [c[i2]];
            break;
          case 49:
            c[i2 - 1].push(c[i2]);
            break;
          case 50:
            this.$ = [];
            break;
          case 51:
            c[i2 - 1].push(c[i2]);
            break;
          case 58:
            this.$ = [];
            break;
          case 59:
            c[i2 - 1].push(c[i2]);
            break;
          case 64:
            this.$ = [];
            break;
          case 65:
            c[i2 - 1].push(c[i2]);
            break;
          case 70:
            this.$ = [];
            break;
          case 71:
            c[i2 - 1].push(c[i2]);
            break;
          case 78:
            this.$ = [];
            break;
          case 79:
            c[i2 - 1].push(c[i2]);
            break;
          case 82:
            this.$ = [];
            break;
          case 83:
            c[i2 - 1].push(c[i2]);
            break;
          case 86:
            this.$ = [];
            break;
          case 87:
            c[i2 - 1].push(c[i2]);
            break;
          case 90:
            this.$ = [];
            break;
          case 91:
            c[i2 - 1].push(c[i2]);
            break;
          case 94:
            this.$ = [];
            break;
          case 95:
            c[i2 - 1].push(c[i2]);
            break;
          case 98:
            this.$ = [c[i2]];
            break;
          case 99:
            c[i2 - 1].push(c[i2]);
            break;
          case 100:
            this.$ = [c[i2]];
            break;
          case 101:
            c[i2 - 1].push(c[i2]);
            break;
        }
      }, table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] }, parseError: function(a, o) {
        throw new Error(a);
      }, parse: function(a) {
        var o = this, u2 = [0], s = [null], p = [], c = this.table, l = "", i2 = 0, f = 0;
        this.lexer.setInput(a), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, typeof this.lexer.yylloc > "u" && (this.lexer.yylloc = {});
        var G = this.lexer.yylloc;
        p.push(G);
        var F = this.lexer.options && this.lexer.options.ranges;
        typeof this.yy.parseError == "function" && (this.parseError = this.yy.parseError);
        function L() {
          var BI;
          return BI = o.lexer.lex() || 1, typeof BI != "number" && (BI = o.symbols_[BI] || BI), BI;
        }
        for (var U, b, S, Y, Z3 = {}, x, iA, uA, RA; ; ) {
          if (b = u2[u2.length - 1], this.defaultActions[b] ? S = this.defaultActions[b] : ((U === null || typeof U > "u") && (U = L()), S = c[b] && c[b][U]), typeof S > "u" || !S.length || !S[0]) {
            var JA = "";
            {
              RA = [];
              for (x in c[b]) this.terminals_[x] && x > 2 && RA.push("'" + this.terminals_[x] + "'");
              this.lexer.showPosition ? JA = "Parse error on line " + (i2 + 1) + `:
` + this.lexer.showPosition() + `
Expecting ` + RA.join(", ") + ", got '" + (this.terminals_[U] || U) + "'" : JA = "Parse error on line " + (i2 + 1) + ": Unexpected " + (U == 1 ? "end of input" : "'" + (this.terminals_[U] || U) + "'"), this.parseError(JA, { text: this.lexer.match, token: this.terminals_[U] || U, line: this.lexer.yylineno, loc: G, expected: RA });
            }
          }
          if (S[0] instanceof Array && S.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + b + ", token: " + U);
          switch (S[0]) {
            case 1:
              u2.push(U), s.push(this.lexer.yytext), p.push(this.lexer.yylloc), u2.push(S[1]), U = null, f = this.lexer.yyleng, l = this.lexer.yytext, i2 = this.lexer.yylineno, G = this.lexer.yylloc;
              break;
            case 2:
              if (iA = this.productions_[S[1]][1], Z3.$ = s[s.length - iA], Z3._$ = { first_line: p[p.length - (iA || 1)].first_line, last_line: p[p.length - 1].last_line, first_column: p[p.length - (iA || 1)].first_column, last_column: p[p.length - 1].last_column }, F && (Z3._$.range = [p[p.length - (iA || 1)].range[0], p[p.length - 1].range[1]]), Y = this.performAction.call(Z3, l, f, i2, this.yy, S[1], s, p), typeof Y < "u") return Y;
              iA && (u2 = u2.slice(0, -1 * iA * 2), s = s.slice(0, -1 * iA), p = p.slice(0, -1 * iA)), u2.push(this.productions_[S[1]][0]), s.push(Z3.$), p.push(Z3._$), uA = c[u2[u2.length - 2]][u2[u2.length - 1]], u2.push(uA);
              break;
            case 3:
              return true;
          }
        }
        return true;
      } }, n = function() {
        var a = { EOF: 1, parseError: function(o, u2) {
          if (this.yy.parser) this.yy.parser.parseError(o, u2);
          else throw new Error(o);
        }, setInput: function(o) {
          return this._input = o, this._more = this._less = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
        }, input: function() {
          var o = this._input[0];
          this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
          var u2 = o.match(/(?:\r\n?|\n).*/g);
          return u2 ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
        }, unput: function(o) {
          var u2 = o.length, s = o.split(/(?:\r\n?|\n)/g);
          this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u2 - 1), this.offset -= u2;
          var p = this.match.split(/(?:\r\n?|\n)/g);
          this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1);
          var c = this.yylloc.range;
          return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: s ? (s.length === p.length ? this.yylloc.first_column : 0) + p[p.length - s.length].length - s[0].length : this.yylloc.first_column - u2 }, this.options.ranges && (this.yylloc.range = [c[0], c[0] + this.yyleng - u2]), this;
        }, more: function() {
          return this._more = true, this;
        }, less: function(o) {
          this.unput(this.match.slice(o));
        }, pastInput: function() {
          var o = this.matched.substr(0, this.matched.length - this.match.length);
          return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
        }, upcomingInput: function() {
          var o = this.match;
          return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
        }, showPosition: function() {
          var o = this.pastInput(), u2 = new Array(o.length + 1).join("-");
          return o + this.upcomingInput() + `
` + u2 + "^";
        }, next: function() {
          if (this.done) return this.EOF;
          this._input || (this.done = true);
          var o, u2, s, p, c;
          this._more || (this.yytext = "", this.match = "");
          for (var l = this._currentRules(), i2 = 0; i2 < l.length && (s = this._input.match(this.rules[l[i2]]), !(s && (!u2 || s[0].length > u2[0].length) && (u2 = s, p = i2, !this.options.flex))); i2++) ;
          return u2 ? (c = u2[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + u2[0].length }, this.yytext += u2[0], this.match += u2[0], this.matches = u2, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._input = this._input.slice(u2[0].length), this.matched += u2[0], o = this.performAction.call(this, this.yy, this, l[p], this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), o || void 0) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
        }, lex: function() {
          var o = this.next();
          return typeof o < "u" ? o : this.lex();
        }, begin: function(o) {
          this.conditionStack.push(o);
        }, popState: function() {
          return this.conditionStack.pop();
        }, _currentRules: function() {
          return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
        }, topState: function() {
          return this.conditionStack[this.conditionStack.length - 2];
        }, pushState: function(o) {
          this.begin(o);
        } };
        return a.options = {}, a.performAction = function(o, u2, s, p) {
          function c(l, i2) {
            return u2.yytext = u2.yytext.substr(l, u2.yyleng - i2);
          }
          switch (s) {
            case 0:
              if (u2.yytext.slice(-2) === "\\\\" ? (c(0, 1), this.begin("mu")) : u2.yytext.slice(-1) === "\\" ? (c(0, 1), this.begin("emu")) : this.begin("mu"), u2.yytext) return 15;
              break;
            case 1:
              return 15;
            case 2:
              return this.popState(), 15;
            case 3:
              return this.begin("raw"), 15;
            case 4:
              return this.popState(), this.conditionStack[this.conditionStack.length - 1] === "raw" ? 15 : (u2.yytext = u2.yytext.substr(5, u2.yyleng - 9), "END_RAW_BLOCK");
            case 5:
              return 15;
            case 6:
              return this.popState(), 14;
            case 7:
              return 65;
            case 8:
              return 68;
            case 9:
              return 19;
            case 10:
              return this.popState(), this.begin("raw"), 23;
            case 11:
              return 55;
            case 12:
              return 60;
            case 13:
              return 29;
            case 14:
              return 47;
            case 15:
              return this.popState(), 44;
            case 16:
              return this.popState(), 44;
            case 17:
              return 34;
            case 18:
              return 39;
            case 19:
              return 51;
            case 20:
              return 48;
            case 21:
              this.unput(u2.yytext), this.popState(), this.begin("com");
              break;
            case 22:
              return this.popState(), 14;
            case 23:
              return 48;
            case 24:
              return 73;
            case 25:
              return 72;
            case 26:
              return 72;
            case 27:
              return 87;
            case 28:
              break;
            case 29:
              return this.popState(), 54;
            case 30:
              return this.popState(), 33;
            case 31:
              return u2.yytext = c(1, 2).replace(/\\"/g, '"'), 80;
            case 32:
              return u2.yytext = c(1, 2).replace(/\\'/g, "'"), 80;
            case 33:
              return 85;
            case 34:
              return 82;
            case 35:
              return 82;
            case 36:
              return 83;
            case 37:
              return 84;
            case 38:
              return 81;
            case 39:
              return 75;
            case 40:
              return 77;
            case 41:
              return 72;
            case 42:
              return u2.yytext = u2.yytext.replace(/\\([\\\]])/g, "$1"), 72;
            case 43:
              return "INVALID";
            case 44:
              return 5;
          }
        }, a.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/], a.conditions = { mu: { rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [6], inclusive: false }, raw: { rules: [3, 4, 5], inclusive: false }, INITIAL: { rules: [0, 1, 44], inclusive: true } }, a;
      }();
      t.lexer = n;
      function e() {
        this.yy = {};
      }
      return e.prototype = t, t.Parser = e, new e();
    }();
    B.default = Q, g.exports = B.default;
  })(nC, nC.exports);
  var $r = nC.exports, oC = { exports: {} }, rC = { exports: {} };
  (function(g, B) {
    B.__esModule = true;
    function Q(s) {
      return s && s.__esModule ? s : { default: s };
    }
    var t = mI, n = Q(t);
    function e() {
      this.parents = [];
    }
    e.prototype = { constructor: e, mutating: false, acceptKey: function(s, p) {
      var c = this.accept(s[p]);
      if (this.mutating) {
        if (c && !e.prototype[c.type]) throw new n.default('Unexpected node type "' + c.type + '" found when accepting ' + p + " on " + s.type);
        s[p] = c;
      }
    }, acceptRequired: function(s, p) {
      if (this.acceptKey(s, p), !s[p]) throw new n.default(s.type + " requires " + p);
    }, acceptArray: function(s) {
      for (var p = 0, c = s.length; p < c; p++) this.acceptKey(s, p), s[p] || (s.splice(p, 1), p--, c--);
    }, accept: function(s) {
      if (s) {
        if (!this[s.type]) throw new n.default("Unknown type: " + s.type, s);
        this.current && this.parents.unshift(this.current), this.current = s;
        var p = this[s.type](s);
        if (this.current = this.parents.shift(), !this.mutating || p) return p;
        if (p !== false) return s;
      }
    }, Program: function(s) {
      this.acceptArray(s.body);
    }, MustacheStatement: a, Decorator: a, BlockStatement: o, DecoratorBlock: o, PartialStatement: u2, PartialBlockStatement: function(s) {
      u2.call(this, s), this.acceptKey(s, "program");
    }, ContentStatement: function() {
    }, CommentStatement: function() {
    }, SubExpression: a, PathExpression: function() {
    }, StringLiteral: function() {
    }, NumberLiteral: function() {
    }, BooleanLiteral: function() {
    }, UndefinedLiteral: function() {
    }, NullLiteral: function() {
    }, Hash: function(s) {
      this.acceptArray(s.pairs);
    }, HashPair: function(s) {
      this.acceptRequired(s, "value");
    } };
    function a(s) {
      this.acceptRequired(s, "path"), this.acceptArray(s.params), this.acceptKey(s, "hash");
    }
    function o(s) {
      a.call(this, s), this.acceptKey(s, "program"), this.acceptKey(s, "inverse");
    }
    function u2(s) {
      this.acceptRequired(s, "name"), this.acceptArray(s.params), this.acceptKey(s, "hash");
    }
    B.default = e, g.exports = B.default;
  })(rC, rC.exports);
  var aC = rC.exports;
  (function(g, B) {
    B.__esModule = true;
    function Q(p) {
      return p && p.__esModule ? p : { default: p };
    }
    var t = aC, n = Q(t);
    function e() {
      var p = arguments.length <= 0 || arguments[0] === void 0 ? {} : arguments[0];
      this.options = p;
    }
    e.prototype = new n.default(), e.prototype.Program = function(p) {
      var c = !this.options.ignoreStandalone, l = !this.isRootSeen;
      this.isRootSeen = true;
      for (var i2 = p.body, f = 0, G = i2.length; f < G; f++) {
        var F = i2[f], L = this.accept(F);
        if (L) {
          var U = a(i2, f, l), b = o(i2, f, l), S = L.openStandalone && U, Y = L.closeStandalone && b, Z3 = L.inlineStandalone && U && b;
          L.close && u2(i2, f, true), L.open && s(i2, f, true), c && Z3 && (u2(i2, f), s(i2, f) && F.type === "PartialStatement" && (F.indent = /([ \t]+$)/.exec(i2[f - 1].original)[1])), c && S && (u2((F.program || F.inverse).body), s(i2, f)), c && Y && (u2(i2, f), s((F.inverse || F.program).body));
        }
      }
      return p;
    }, e.prototype.BlockStatement = e.prototype.DecoratorBlock = e.prototype.PartialBlockStatement = function(p) {
      this.accept(p.program), this.accept(p.inverse);
      var c = p.program || p.inverse, l = p.program && p.inverse, i2 = l, f = l;
      if (l && l.chained) for (i2 = l.body[0].program; f.chained; ) f = f.body[f.body.length - 1].program;
      var G = { open: p.openStrip.open, close: p.closeStrip.close, openStandalone: o(c.body), closeStandalone: a((i2 || c).body) };
      if (p.openStrip.close && u2(c.body, null, true), l) {
        var F = p.inverseStrip;
        F.open && s(c.body, null, true), F.close && u2(i2.body, null, true), p.closeStrip.open && s(f.body, null, true), !this.options.ignoreStandalone && a(c.body) && o(i2.body) && (s(c.body), u2(i2.body));
      } else p.closeStrip.open && s(c.body, null, true);
      return G;
    }, e.prototype.Decorator = e.prototype.MustacheStatement = function(p) {
      return p.strip;
    }, e.prototype.PartialStatement = e.prototype.CommentStatement = function(p) {
      var c = p.strip || {};
      return { inlineStandalone: true, open: c.open, close: c.close };
    };
    function a(p, c, l) {
      c === void 0 && (c = p.length);
      var i2 = p[c - 1], f = p[c - 2];
      if (!i2) return l;
      if (i2.type === "ContentStatement") return (f || !l ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(i2.original);
    }
    function o(p, c, l) {
      c === void 0 && (c = -1);
      var i2 = p[c + 1], f = p[c + 2];
      if (!i2) return l;
      if (i2.type === "ContentStatement") return (f || !l ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(i2.original);
    }
    function u2(p, c, l) {
      var i2 = p[c == null ? 0 : c + 1];
      if (!(!i2 || i2.type !== "ContentStatement" || !l && i2.rightStripped)) {
        var f = i2.value;
        i2.value = i2.value.replace(l ? /^\s+/ : /^[ \t]*\r?\n?/, ""), i2.rightStripped = i2.value !== f;
      }
    }
    function s(p, c, l) {
      var i2 = p[c == null ? p.length - 1 : c - 1];
      if (!(!i2 || i2.type !== "ContentStatement" || !l && i2.leftStripped)) {
        var f = i2.value;
        return i2.value = i2.value.replace(l ? /\s+$/ : /[ \t]+$/, ""), i2.leftStripped = i2.value !== f, i2.leftStripped;
      }
    }
    B.default = e, g.exports = B.default;
  })(oC, oC.exports);
  var Aa = oC.exports, aI = {};
  aI.__esModule = true, aI.SourceLocation = Ba, aI.id = Qa, aI.stripFlags = Ca, aI.stripComment = ta, aI.preparePath = Ea, aI.prepareMustache = ea, aI.prepareRawBlock = ia, aI.prepareBlock = na, aI.prepareProgram = oa, aI.preparePartialBlock = ra;
  function Ia(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var ga = mI, sC = Ia(ga);
  function cC(g, B) {
    if (B = B.path ? B.path.original : B, g.path.original !== B) {
      var Q = { loc: g.path.loc };
      throw new sC.default(g.path.original + " doesn't match " + B, Q);
    }
  }
  function Ba(g, B) {
    this.source = g, this.start = { line: B.first_line, column: B.first_column }, this.end = { line: B.last_line, column: B.last_column };
  }
  function Qa(g) {
    return /^\[.*\]$/.test(g) ? g.substr(1, g.length - 2) : g;
  }
  function Ca(g, B) {
    return { open: g.charAt(2) === "~", close: B.charAt(B.length - 3) === "~" };
  }
  function ta(g) {
    return g.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
  }
  function Ea(g, B, Q) {
    Q = this.locInfo(Q);
    for (var t = g ? "@" : "", n = [], e = 0, a = 0, o = B.length; a < o; a++) {
      var u2 = B[a].part, s = B[a].original !== u2;
      if (t += (B[a].separator || "") + u2, !s && (u2 === ".." || u2 === "." || u2 === "this")) {
        if (n.length > 0) throw new sC.default("Invalid path: " + t, { loc: Q });
        u2 === ".." && e++;
      } else n.push(u2);
    }
    return { type: "PathExpression", data: g, depth: e, parts: n, original: t, loc: Q };
  }
  function ea(g, B, Q, t, n, e) {
    var a = t.charAt(3) || t.charAt(2), o = a !== "{" && a !== "&", u2 = /\*/.test(t);
    return { type: u2 ? "Decorator" : "MustacheStatement", path: g, params: B, hash: Q, escaped: o, strip: n, loc: this.locInfo(e) };
  }
  function ia(g, B, Q, t) {
    cC(g, Q), t = this.locInfo(t);
    var n = { type: "Program", body: B, strip: {}, loc: t };
    return { type: "BlockStatement", path: g.path, params: g.params, hash: g.hash, program: n, openStrip: {}, inverseStrip: {}, closeStrip: {}, loc: t };
  }
  function na(g, B, Q, t, n, e) {
    t && t.path && cC(g, t);
    var a = /\*/.test(g.open);
    B.blockParams = g.blockParams;
    var o = void 0, u2 = void 0;
    if (Q) {
      if (a) throw new sC.default("Unexpected inverse block on decorator", Q);
      Q.chain && (Q.program.body[0].closeStrip = t.strip), u2 = Q.strip, o = Q.program;
    }
    return n && (n = o, o = B, B = n), { type: a ? "DecoratorBlock" : "BlockStatement", path: g.path, params: g.params, hash: g.hash, program: B, inverse: o, openStrip: g.strip, inverseStrip: u2, closeStrip: t && t.strip, loc: this.locInfo(e) };
  }
  function oa(g, B) {
    if (!B && g.length) {
      var Q = g[0].loc, t = g[g.length - 1].loc;
      Q && t && (B = { source: Q.source, start: { line: Q.start.line, column: Q.start.column }, end: { line: t.end.line, column: t.end.column } });
    }
    return { type: "Program", body: g, strip: {}, loc: B };
  }
  function ra(g, B, Q, t) {
    return cC(g, Q), { type: "PartialBlockStatement", name: g.path, params: g.params, hash: g.hash, program: B, openStrip: g.strip, closeStrip: Q && Q.strip, loc: this.locInfo(t) };
  }
  RB.__esModule = true, RB.parse = pa;
  function aa(g) {
    if (g && g.__esModule) return g;
    var B = {};
    if (g != null) for (var Q in g) Object.prototype.hasOwnProperty.call(g, Q) && (B[Q] = g[Q]);
    return B.default = g, B;
  }
  function SE(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var sa = $r, uC = SE(sa), ca = Aa, ua2 = SE(ca), ha = aI, la = aa(ha), Da = GA;
  RB.parser = uC.default;
  var FB = {};
  Da.extend(FB, la);
  function pa(g, B) {
    if (g.type === "Program") return g;
    uC.default.yy = FB, FB.locInfo = function(t) {
      return new FB.SourceLocation(B && B.srcName, t);
    };
    var Q = new ua2.default(B);
    return Q.accept(uC.default.parse(g));
  }
  var jg = {};
  jg.__esModule = true, jg.Compiler = hC, jg.precompile = Ga, jg.compile = Na;
  function ME(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var wa = mI, Zg = ME(wa), LB = GA, fa = dE, Vg = ME(fa), ya = [].slice;
  function hC() {
  }
  hC.prototype = { compiler: hC, equals: function(g) {
    var B = this.opcodes.length;
    if (g.opcodes.length !== B) return false;
    for (var Q = 0; Q < B; Q++) {
      var t = this.opcodes[Q], n = g.opcodes[Q];
      if (t.opcode !== n.opcode || !RE(t.args, n.args)) return false;
    }
    B = this.children.length;
    for (var Q = 0; Q < B; Q++) if (!this.children[Q].equals(g.children[Q])) return false;
    return true;
  }, guid: 0, compile: function(g, B) {
    this.sourceNode = [], this.opcodes = [], this.children = [], this.options = B, this.stringParams = B.stringParams, this.trackIds = B.trackIds, B.blockParams = B.blockParams || [];
    var Q = B.knownHelpers;
    if (B.knownHelpers = { helperMissing: true, blockHelperMissing: true, each: true, if: true, unless: true, with: true, log: true, lookup: true }, Q) for (var t in Q) this.options.knownHelpers[t] = Q[t];
    return this.accept(g);
  }, compileProgram: function(g) {
    var B = new this.compiler(), Q = B.compile(g, this.options), t = this.guid++;
    return this.usePartial = this.usePartial || Q.usePartial, this.children[t] = Q, this.useDepths = this.useDepths || Q.useDepths, t;
  }, accept: function(g) {
    if (!this[g.type]) throw new Zg.default("Unknown type: " + g.type, g);
    this.sourceNode.unshift(g);
    var B = this[g.type](g);
    return this.sourceNode.shift(), B;
  }, Program: function(g) {
    this.options.blockParams.unshift(g.blockParams);
    for (var B = g.body, Q = B.length, t = 0; t < Q; t++) this.accept(B[t]);
    return this.options.blockParams.shift(), this.isSimple = Q === 1, this.blockParams = g.blockParams ? g.blockParams.length : 0, this;
  }, BlockStatement: function(g) {
    FE(g);
    var B = g.program, Q = g.inverse;
    B = B && this.compileProgram(B), Q = Q && this.compileProgram(Q);
    var t = this.classifySexpr(g);
    t === "helper" ? this.helperSexpr(g, B, Q) : t === "simple" ? (this.simpleSexpr(g), this.opcode("pushProgram", B), this.opcode("pushProgram", Q), this.opcode("emptyHash"), this.opcode("blockValue", g.path.original)) : (this.ambiguousSexpr(g, B, Q), this.opcode("pushProgram", B), this.opcode("pushProgram", Q), this.opcode("emptyHash"), this.opcode("ambiguousBlockValue")), this.opcode("append");
  }, DecoratorBlock: function(g) {
    var B = g.program && this.compileProgram(g.program), Q = this.setupFullMustacheParams(g, B, void 0), t = g.path;
    this.useDecorators = true, this.opcode("registerDecorator", Q.length, t.original);
  }, PartialStatement: function(g) {
    this.usePartial = true;
    var B = g.program;
    B && (B = this.compileProgram(g.program));
    var Q = g.params;
    if (Q.length > 1) throw new Zg.default("Unsupported number of partial arguments: " + Q.length, g);
    Q.length || (this.options.explicitPartialContext ? this.opcode("pushLiteral", "undefined") : Q.push({ type: "PathExpression", parts: [], depth: 0 }));
    var t = g.name.original, n = g.name.type === "SubExpression";
    n && this.accept(g.name), this.setupFullMustacheParams(g, B, void 0, true);
    var e = g.indent || "";
    this.options.preventIndent && e && (this.opcode("appendContent", e), e = ""), this.opcode("invokePartial", n, t, e), this.opcode("append");
  }, PartialBlockStatement: function(g) {
    this.PartialStatement(g);
  }, MustacheStatement: function(g) {
    this.SubExpression(g), g.escaped && !this.options.noEscape ? this.opcode("appendEscaped") : this.opcode("append");
  }, Decorator: function(g) {
    this.DecoratorBlock(g);
  }, ContentStatement: function(g) {
    g.value && this.opcode("appendContent", g.value);
  }, CommentStatement: function() {
  }, SubExpression: function(g) {
    FE(g);
    var B = this.classifySexpr(g);
    B === "simple" ? this.simpleSexpr(g) : B === "helper" ? this.helperSexpr(g) : this.ambiguousSexpr(g);
  }, ambiguousSexpr: function(g, B, Q) {
    var t = g.path, n = t.parts[0], e = B != null || Q != null;
    this.opcode("getContext", t.depth), this.opcode("pushProgram", B), this.opcode("pushProgram", Q), t.strict = true, this.accept(t), this.opcode("invokeAmbiguous", n, e);
  }, simpleSexpr: function(g) {
    var B = g.path;
    B.strict = true, this.accept(B), this.opcode("resolvePossibleLambda");
  }, helperSexpr: function(g, B, Q) {
    var t = this.setupFullMustacheParams(g, B, Q), n = g.path, e = n.parts[0];
    if (this.options.knownHelpers[e]) this.opcode("invokeKnownHelper", t.length, e);
    else {
      if (this.options.knownHelpersOnly) throw new Zg.default("You specified knownHelpersOnly, but used the unknown helper " + e, g);
      n.strict = true, n.falsy = true, this.accept(n), this.opcode("invokeHelper", t.length, n.original, Vg.default.helpers.simpleId(n));
    }
  }, PathExpression: function(g) {
    this.addDepth(g.depth), this.opcode("getContext", g.depth);
    var B = g.parts[0], Q = Vg.default.helpers.scopedId(g), t = !g.depth && !Q && this.blockParamIndex(B);
    t ? this.opcode("lookupBlockParam", t, g.parts) : B ? g.data ? (this.options.data = true, this.opcode("lookupData", g.depth, g.parts, g.strict)) : this.opcode("lookupOnContext", g.parts, g.falsy, g.strict, Q) : this.opcode("pushContext");
  }, StringLiteral: function(g) {
    this.opcode("pushString", g.value);
  }, NumberLiteral: function(g) {
    this.opcode("pushLiteral", g.value);
  }, BooleanLiteral: function(g) {
    this.opcode("pushLiteral", g.value);
  }, UndefinedLiteral: function() {
    this.opcode("pushLiteral", "undefined");
  }, NullLiteral: function() {
    this.opcode("pushLiteral", "null");
  }, Hash: function(g) {
    var B = g.pairs, Q = 0, t = B.length;
    for (this.opcode("pushHash"); Q < t; Q++) this.pushParam(B[Q].value);
    for (; Q--; ) this.opcode("assignToHash", B[Q].key);
    this.opcode("popHash");
  }, opcode: function(g) {
    this.opcodes.push({ opcode: g, args: ya.call(arguments, 1), loc: this.sourceNode[0].loc });
  }, addDepth: function(g) {
    g && (this.useDepths = true);
  }, classifySexpr: function(g) {
    var B = Vg.default.helpers.simpleId(g.path), Q = B && !!this.blockParamIndex(g.path.parts[0]), t = !Q && Vg.default.helpers.helperExpression(g), n = !Q && (t || B);
    if (n && !t) {
      var e = g.path.parts[0], a = this.options;
      a.knownHelpers[e] ? t = true : a.knownHelpersOnly && (n = false);
    }
    return t ? "helper" : n ? "ambiguous" : "simple";
  }, pushParams: function(g) {
    for (var B = 0, Q = g.length; B < Q; B++) this.pushParam(g[B]);
  }, pushParam: function(g) {
    var B = g.value != null ? g.value : g.original || "";
    if (this.stringParams) B.replace && (B = B.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".")), g.depth && this.addDepth(g.depth), this.opcode("getContext", g.depth || 0), this.opcode("pushStringParam", B, g.type), g.type === "SubExpression" && this.accept(g);
    else {
      if (this.trackIds) {
        var Q = void 0;
        if (g.parts && !Vg.default.helpers.scopedId(g) && !g.depth && (Q = this.blockParamIndex(g.parts[0])), Q) {
          var t = g.parts.slice(1).join(".");
          this.opcode("pushId", "BlockParam", Q, t);
        } else B = g.original || B, B.replace && (B = B.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "")), this.opcode("pushId", g.type, B);
      }
      this.accept(g);
    }
  }, setupFullMustacheParams: function(g, B, Q, t) {
    var n = g.params;
    return this.pushParams(n), this.opcode("pushProgram", B), this.opcode("pushProgram", Q), g.hash ? this.accept(g.hash) : this.opcode("emptyHash", t), n;
  }, blockParamIndex: function(g) {
    for (var B = 0, Q = this.options.blockParams.length; B < Q; B++) {
      var t = this.options.blockParams[B], n = t && LB.indexOf(t, g);
      if (t && n >= 0) return [B, n];
    }
  } };
  function Ga(g, B, Q) {
    if (g == null || typeof g != "string" && g.type !== "Program") throw new Zg.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + g);
    B = B || {}, "data" in B || (B.data = true), B.compat && (B.useDepths = true);
    var t = Q.parse(g, B), n = new Q.Compiler().compile(t, B);
    return new Q.JavaScriptCompiler().compile(n, B);
  }
  function Na(g, B, Q) {
    if (B === void 0 && (B = {}), g == null || typeof g != "string" && g.type !== "Program") throw new Zg.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + g);
    B = LB.extend({}, B), "data" in B || (B.data = true), B.compat && (B.useDepths = true);
    var t = void 0;
    function n() {
      var a = Q.parse(g, B), o = new Q.Compiler().compile(a, B), u2 = new Q.JavaScriptCompiler().compile(o, B, void 0, true);
      return Q.template(u2);
    }
    function e(a, o) {
      return t || (t = n()), t.call(this, a, o);
    }
    return e._setup = function(a) {
      return t || (t = n()), t._setup(a);
    }, e._child = function(a, o, u2, s) {
      return t || (t = n()), t._child(a, o, u2, s);
    }, e;
  }
  function RE(g, B) {
    if (g === B) return true;
    if (LB.isArray(g) && LB.isArray(B) && g.length === B.length) {
      for (var Q = 0; Q < g.length; Q++) if (!RE(g[Q], B[Q])) return false;
      return true;
    }
  }
  function FE(g) {
    if (!g.path.parts) {
      var B = g.path;
      g.path = { type: "PathExpression", data: false, depth: 0, parts: [B.original + ""], original: B.original + "", loc: B.loc };
    }
  }
  var lC = { exports: {} }, DC = { exports: {} }, UB = {}, pC = {}, JB = {}, YB = {}, LE;
  function ka() {
    if (LE) return YB;
    LE = 1;
    var g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
    return YB.encode = function(B) {
      if (0 <= B && B < g.length) return g[B];
      throw new TypeError("Must be between 0 and 63: " + B);
    }, YB.decode = function(B) {
      var Q = 65, t = 90, n = 97, e = 122, a = 48, o = 57, u2 = 43, s = 47, p = 26, c = 52;
      return Q <= B && B <= t ? B - Q : n <= B && B <= e ? B - n + p : a <= B && B <= o ? B - a + c : B == u2 ? 62 : B == s ? 63 : -1;
    }, YB;
  }
  var UE;
  function JE() {
    if (UE) return JB;
    UE = 1;
    var g = ka(), B = 5, Q = 1 << B, t = Q - 1, n = Q;
    function e(o) {
      return o < 0 ? (-o << 1) + 1 : (o << 1) + 0;
    }
    function a(o) {
      var u2 = (o & 1) === 1, s = o >> 1;
      return u2 ? -s : s;
    }
    return JB.encode = function(o) {
      var u2 = "", s, p = e(o);
      do
        s = p & t, p >>>= B, p > 0 && (s |= n), u2 += g.encode(s);
      while (p > 0);
      return u2;
    }, JB.decode = function(o, u2, s) {
      var p = o.length, c = 0, l = 0, i2, f;
      do {
        if (u2 >= p) throw new Error("Expected more digits in base 64 VLQ value.");
        if (f = g.decode(o.charCodeAt(u2++)), f === -1) throw new Error("Invalid base64 digit: " + o.charAt(u2 - 1));
        i2 = !!(f & n), f &= t, c = c + (f << l), l += B;
      } while (i2);
      s.value = a(c), s.rest = u2;
    }, JB;
  }
  var YE = {}, mE;
  function Xg() {
    return mE || (mE = 1, function(g) {
      function B(S, Y, Z3) {
        if (Y in S) return S[Y];
        if (arguments.length === 3) return Z3;
        throw new Error('"' + Y + '" is a required argument.');
      }
      g.getArg = B;
      var Q = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, t = /^data:.+\,.+$/;
      function n(S) {
        var Y = S.match(Q);
        return Y ? { scheme: Y[1], auth: Y[2], host: Y[3], port: Y[4], path: Y[5] } : null;
      }
      g.urlParse = n;
      function e(S) {
        var Y = "";
        return S.scheme && (Y += S.scheme + ":"), Y += "//", S.auth && (Y += S.auth + "@"), S.host && (Y += S.host), S.port && (Y += ":" + S.port), S.path && (Y += S.path), Y;
      }
      g.urlGenerate = e;
      function a(S) {
        var Y = S, Z3 = n(S);
        if (Z3) {
          if (!Z3.path) return S;
          Y = Z3.path;
        }
        for (var x = g.isAbsolute(Y), iA = Y.split(/\/+/), uA, RA = 0, JA = iA.length - 1; JA >= 0; JA--) uA = iA[JA], uA === "." ? iA.splice(JA, 1) : uA === ".." ? RA++ : RA > 0 && (uA === "" ? (iA.splice(JA + 1, RA), RA = 0) : (iA.splice(JA, 2), RA--));
        return Y = iA.join("/"), Y === "" && (Y = x ? "/" : "."), Z3 ? (Z3.path = Y, e(Z3)) : Y;
      }
      g.normalize = a;
      function o(S, Y) {
        S === "" && (S = "."), Y === "" && (Y = ".");
        var Z3 = n(Y), x = n(S);
        if (x && (S = x.path || "/"), Z3 && !Z3.scheme) return x && (Z3.scheme = x.scheme), e(Z3);
        if (Z3 || Y.match(t)) return Y;
        if (x && !x.host && !x.path) return x.host = Y, e(x);
        var iA = Y.charAt(0) === "/" ? Y : a(S.replace(/\/+$/, "") + "/" + Y);
        return x ? (x.path = iA, e(x)) : iA;
      }
      g.join = o, g.isAbsolute = function(S) {
        return S.charAt(0) === "/" || Q.test(S);
      };
      function u2(S, Y) {
        S === "" && (S = "."), S = S.replace(/\/$/, "");
        for (var Z3 = 0; Y.indexOf(S + "/") !== 0; ) {
          var x = S.lastIndexOf("/");
          if (x < 0 || (S = S.slice(0, x), S.match(/^([^\/]+:\/)?\/*$/))) return Y;
          ++Z3;
        }
        return Array(Z3 + 1).join("../") + Y.substr(S.length + 1);
      }
      g.relative = u2;
      var s = function() {
        var S = /* @__PURE__ */ Object.create(null);
        return !("__proto__" in S);
      }();
      function p(S) {
        return S;
      }
      function c(S) {
        return i2(S) ? "$" + S : S;
      }
      g.toSetString = s ? p : c;
      function l(S) {
        return i2(S) ? S.slice(1) : S;
      }
      g.fromSetString = s ? p : l;
      function i2(S) {
        if (!S) return false;
        var Y = S.length;
        if (Y < 9 || S.charCodeAt(Y - 1) !== 95 || S.charCodeAt(Y - 2) !== 95 || S.charCodeAt(Y - 3) !== 111 || S.charCodeAt(Y - 4) !== 116 || S.charCodeAt(Y - 5) !== 111 || S.charCodeAt(Y - 6) !== 114 || S.charCodeAt(Y - 7) !== 112 || S.charCodeAt(Y - 8) !== 95 || S.charCodeAt(Y - 9) !== 95) return false;
        for (var Z3 = Y - 10; Z3 >= 0; Z3--) if (S.charCodeAt(Z3) !== 36) return false;
        return true;
      }
      function f(S, Y, Z3) {
        var x = F(S.source, Y.source);
        return x !== 0 || (x = S.originalLine - Y.originalLine, x !== 0) || (x = S.originalColumn - Y.originalColumn, x !== 0 || Z3) || (x = S.generatedColumn - Y.generatedColumn, x !== 0) || (x = S.generatedLine - Y.generatedLine, x !== 0) ? x : F(S.name, Y.name);
      }
      g.compareByOriginalPositions = f;
      function G(S, Y, Z3) {
        var x = S.generatedLine - Y.generatedLine;
        return x !== 0 || (x = S.generatedColumn - Y.generatedColumn, x !== 0 || Z3) || (x = F(S.source, Y.source), x !== 0) || (x = S.originalLine - Y.originalLine, x !== 0) || (x = S.originalColumn - Y.originalColumn, x !== 0) ? x : F(S.name, Y.name);
      }
      g.compareByGeneratedPositionsDeflated = G;
      function F(S, Y) {
        return S === Y ? 0 : S === null ? 1 : Y === null ? -1 : S > Y ? 1 : -1;
      }
      function L(S, Y) {
        var Z3 = S.generatedLine - Y.generatedLine;
        return Z3 !== 0 || (Z3 = S.generatedColumn - Y.generatedColumn, Z3 !== 0) || (Z3 = F(S.source, Y.source), Z3 !== 0) || (Z3 = S.originalLine - Y.originalLine, Z3 !== 0) || (Z3 = S.originalColumn - Y.originalColumn, Z3 !== 0) ? Z3 : F(S.name, Y.name);
      }
      g.compareByGeneratedPositionsInflated = L;
      function U(S) {
        return JSON.parse(S.replace(/^\)]}'[^\n]*\n/, ""));
      }
      g.parseSourceMapInput = U;
      function b(S, Y, Z3) {
        if (Y = Y || "", S && (S[S.length - 1] !== "/" && Y[0] !== "/" && (S += "/"), Y = S + Y), Z3) {
          var x = n(Z3);
          if (!x) throw new Error("sourceMapURL could not be parsed");
          if (x.path) {
            var iA = x.path.lastIndexOf("/");
            iA >= 0 && (x.path = x.path.substring(0, iA + 1));
          }
          Y = o(e(x), Y);
        }
        return a(Y);
      }
      g.computeSourceURL = b;
    }(YE)), YE;
  }
  var wC = {}, vE;
  function HE() {
    if (vE) return wC;
    vE = 1;
    var g = Xg(), B = Object.prototype.hasOwnProperty, Q = typeof Map < "u";
    function t() {
      this._array = [], this._set = Q ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
    }
    return t.fromArray = function(n, e) {
      for (var a = new t(), o = 0, u2 = n.length; o < u2; o++) a.add(n[o], e);
      return a;
    }, t.prototype.size = function() {
      return Q ? this._set.size : Object.getOwnPropertyNames(this._set).length;
    }, t.prototype.add = function(n, e) {
      var a = Q ? n : g.toSetString(n), o = Q ? this.has(n) : B.call(this._set, a), u2 = this._array.length;
      (!o || e) && this._array.push(n), o || (Q ? this._set.set(n, u2) : this._set[a] = u2);
    }, t.prototype.has = function(n) {
      if (Q) return this._set.has(n);
      var e = g.toSetString(n);
      return B.call(this._set, e);
    }, t.prototype.indexOf = function(n) {
      if (Q) {
        var e = this._set.get(n);
        if (e >= 0) return e;
      } else {
        var a = g.toSetString(n);
        if (B.call(this._set, a)) return this._set[a];
      }
      throw new Error('"' + n + '" is not in the set.');
    }, t.prototype.at = function(n) {
      if (n >= 0 && n < this._array.length) return this._array[n];
      throw new Error("No element indexed by " + n);
    }, t.prototype.toArray = function() {
      return this._array.slice();
    }, wC.ArraySet = t, wC;
  }
  var fC = {}, KE;
  function da() {
    if (KE) return fC;
    KE = 1;
    var g = Xg();
    function B(t, n) {
      var e = t.generatedLine, a = n.generatedLine, o = t.generatedColumn, u2 = n.generatedColumn;
      return a > e || a == e && u2 >= o || g.compareByGeneratedPositionsInflated(t, n) <= 0;
    }
    function Q() {
      this._array = [], this._sorted = true, this._last = { generatedLine: -1, generatedColumn: 0 };
    }
    return Q.prototype.unsortedForEach = function(t, n) {
      this._array.forEach(t, n);
    }, Q.prototype.add = function(t) {
      B(this._last, t) ? (this._last = t, this._array.push(t)) : (this._sorted = false, this._array.push(t));
    }, Q.prototype.toArray = function() {
      return this._sorted || (this._array.sort(g.compareByGeneratedPositionsInflated), this._sorted = true), this._array;
    }, fC.MappingList = Q, fC;
  }
  var qE;
  function TE() {
    if (qE) return pC;
    qE = 1;
    var g = JE(), B = Xg(), Q = HE().ArraySet, t = da().MappingList;
    function n(e) {
      e || (e = {}), this._file = B.getArg(e, "file", null), this._sourceRoot = B.getArg(e, "sourceRoot", null), this._skipValidation = B.getArg(e, "skipValidation", false), this._sources = new Q(), this._names = new Q(), this._mappings = new t(), this._sourcesContents = null;
    }
    return n.prototype._version = 3, n.fromSourceMap = function(e) {
      var a = e.sourceRoot, o = new n({ file: e.file, sourceRoot: a });
      return e.eachMapping(function(u2) {
        var s = { generated: { line: u2.generatedLine, column: u2.generatedColumn } };
        u2.source != null && (s.source = u2.source, a != null && (s.source = B.relative(a, s.source)), s.original = { line: u2.originalLine, column: u2.originalColumn }, u2.name != null && (s.name = u2.name)), o.addMapping(s);
      }), e.sources.forEach(function(u2) {
        var s = u2;
        a !== null && (s = B.relative(a, u2)), o._sources.has(s) || o._sources.add(s);
        var p = e.sourceContentFor(u2);
        p != null && o.setSourceContent(u2, p);
      }), o;
    }, n.prototype.addMapping = function(e) {
      var a = B.getArg(e, "generated"), o = B.getArg(e, "original", null), u2 = B.getArg(e, "source", null), s = B.getArg(e, "name", null);
      this._skipValidation || this._validateMapping(a, o, u2, s), u2 != null && (u2 = String(u2), this._sources.has(u2) || this._sources.add(u2)), s != null && (s = String(s), this._names.has(s) || this._names.add(s)), this._mappings.add({ generatedLine: a.line, generatedColumn: a.column, originalLine: o != null && o.line, originalColumn: o != null && o.column, source: u2, name: s });
    }, n.prototype.setSourceContent = function(e, a) {
      var o = e;
      this._sourceRoot != null && (o = B.relative(this._sourceRoot, o)), a != null ? (this._sourcesContents || (this._sourcesContents = /* @__PURE__ */ Object.create(null)), this._sourcesContents[B.toSetString(o)] = a) : this._sourcesContents && (delete this._sourcesContents[B.toSetString(o)], Object.keys(this._sourcesContents).length === 0 && (this._sourcesContents = null));
    }, n.prototype.applySourceMap = function(e, a, o) {
      var u2 = a;
      if (a == null) {
        if (e.file == null) throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);
        u2 = e.file;
      }
      var s = this._sourceRoot;
      s != null && (u2 = B.relative(s, u2));
      var p = new Q(), c = new Q();
      this._mappings.unsortedForEach(function(l) {
        if (l.source === u2 && l.originalLine != null) {
          var i2 = e.originalPositionFor({ line: l.originalLine, column: l.originalColumn });
          i2.source != null && (l.source = i2.source, o != null && (l.source = B.join(o, l.source)), s != null && (l.source = B.relative(s, l.source)), l.originalLine = i2.line, l.originalColumn = i2.column, i2.name != null && (l.name = i2.name));
        }
        var f = l.source;
        f != null && !p.has(f) && p.add(f);
        var G = l.name;
        G != null && !c.has(G) && c.add(G);
      }, this), this._sources = p, this._names = c, e.sources.forEach(function(l) {
        var i2 = e.sourceContentFor(l);
        i2 != null && (o != null && (l = B.join(o, l)), s != null && (l = B.relative(s, l)), this.setSourceContent(l, i2));
      }, this);
    }, n.prototype._validateMapping = function(e, a, o, u2) {
      if (a && typeof a.line != "number" && typeof a.column != "number") throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");
      if (!(e && "line" in e && "column" in e && e.line > 0 && e.column >= 0 && !a && !o && !u2)) {
        if (e && "line" in e && "column" in e && a && "line" in a && "column" in a && e.line > 0 && e.column >= 0 && a.line > 0 && a.column >= 0 && o) return;
        throw new Error("Invalid mapping: " + JSON.stringify({ generated: e, source: o, original: a, name: u2 }));
      }
    }, n.prototype._serializeMappings = function() {
      for (var e = 0, a = 1, o = 0, u2 = 0, s = 0, p = 0, c = "", l, i2, f, G, F = this._mappings.toArray(), L = 0, U = F.length; L < U; L++) {
        if (i2 = F[L], l = "", i2.generatedLine !== a) for (e = 0; i2.generatedLine !== a; ) l += ";", a++;
        else if (L > 0) {
          if (!B.compareByGeneratedPositionsInflated(i2, F[L - 1])) continue;
          l += ",";
        }
        l += g.encode(i2.generatedColumn - e), e = i2.generatedColumn, i2.source != null && (G = this._sources.indexOf(i2.source), l += g.encode(G - p), p = G, l += g.encode(i2.originalLine - 1 - u2), u2 = i2.originalLine - 1, l += g.encode(i2.originalColumn - o), o = i2.originalColumn, i2.name != null && (f = this._names.indexOf(i2.name), l += g.encode(f - s), s = f)), c += l;
      }
      return c;
    }, n.prototype._generateSourcesContent = function(e, a) {
      return e.map(function(o) {
        if (!this._sourcesContents) return null;
        a != null && (o = B.relative(a, o));
        var u2 = B.toSetString(o);
        return Object.prototype.hasOwnProperty.call(this._sourcesContents, u2) ? this._sourcesContents[u2] : null;
      }, this);
    }, n.prototype.toJSON = function() {
      var e = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() };
      return this._file != null && (e.file = this._file), this._sourceRoot != null && (e.sourceRoot = this._sourceRoot), this._sourcesContents && (e.sourcesContent = this._generateSourcesContent(e.sources, e.sourceRoot)), e;
    }, n.prototype.toString = function() {
      return JSON.stringify(this.toJSON());
    }, pC.SourceMapGenerator = n, pC;
  }
  var zg = {}, OE = {}, bE;
  function Sa() {
    return bE || (bE = 1, function(g) {
      g.GREATEST_LOWER_BOUND = 1, g.LEAST_UPPER_BOUND = 2;
      function B(Q, t, n, e, a, o) {
        var u2 = Math.floor((t - Q) / 2) + Q, s = a(n, e[u2], true);
        return s === 0 ? u2 : s > 0 ? t - u2 > 1 ? B(u2, t, n, e, a, o) : o == g.LEAST_UPPER_BOUND ? t < e.length ? t : -1 : u2 : u2 - Q > 1 ? B(Q, u2, n, e, a, o) : o == g.LEAST_UPPER_BOUND ? u2 : Q < 0 ? -1 : Q;
      }
      g.search = function(Q, t, n, e) {
        if (t.length === 0) return -1;
        var a = B(-1, t.length, Q, t, n, e || g.GREATEST_LOWER_BOUND);
        if (a < 0) return -1;
        for (; a - 1 >= 0 && n(t[a], t[a - 1], true) === 0; ) --a;
        return a;
      };
    }(OE)), OE;
  }
  var yC = {}, xE;
  function Ma() {
    if (xE) return yC;
    xE = 1;
    function g(t, n, e) {
      var a = t[n];
      t[n] = t[e], t[e] = a;
    }
    function B(t, n) {
      return Math.round(t + Math.random() * (n - t));
    }
    function Q(t, n, e, a) {
      if (e < a) {
        var o = B(e, a), u2 = e - 1;
        g(t, o, a);
        for (var s = t[a], p = e; p < a; p++) n(t[p], s) <= 0 && (u2 += 1, g(t, u2, p));
        g(t, u2 + 1, p);
        var c = u2 + 1;
        Q(t, n, e, c - 1), Q(t, n, c + 1, a);
      }
    }
    return yC.quickSort = function(t, n) {
      Q(t, n, 0, t.length - 1);
    }, yC;
  }
  var _E;
  function Ra() {
    if (_E) return zg;
    _E = 1;
    var g = Xg(), B = Sa(), Q = HE().ArraySet, t = JE(), n = Ma().quickSort;
    function e(s, p) {
      var c = s;
      return typeof s == "string" && (c = g.parseSourceMapInput(s)), c.sections != null ? new u2(c, p) : new a(c, p);
    }
    e.fromSourceMap = function(s, p) {
      return a.fromSourceMap(s, p);
    }, e.prototype._version = 3, e.prototype.__generatedMappings = null, Object.defineProperty(e.prototype, "_generatedMappings", { configurable: true, enumerable: true, get: function() {
      return this.__generatedMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__generatedMappings;
    } }), e.prototype.__originalMappings = null, Object.defineProperty(e.prototype, "_originalMappings", { configurable: true, enumerable: true, get: function() {
      return this.__originalMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__originalMappings;
    } }), e.prototype._charIsMappingSeparator = function(s, p) {
      var c = s.charAt(p);
      return c === ";" || c === ",";
    }, e.prototype._parseMappings = function(s, p) {
      throw new Error("Subclasses must implement _parseMappings");
    }, e.GENERATED_ORDER = 1, e.ORIGINAL_ORDER = 2, e.GREATEST_LOWER_BOUND = 1, e.LEAST_UPPER_BOUND = 2, e.prototype.eachMapping = function(s, p, c) {
      var l = p || null, i2 = c || e.GENERATED_ORDER, f;
      switch (i2) {
        case e.GENERATED_ORDER:
          f = this._generatedMappings;
          break;
        case e.ORIGINAL_ORDER:
          f = this._originalMappings;
          break;
        default:
          throw new Error("Unknown order of iteration.");
      }
      var G = this.sourceRoot;
      f.map(function(F) {
        var L = F.source === null ? null : this._sources.at(F.source);
        return L = g.computeSourceURL(G, L, this._sourceMapURL), { source: L, generatedLine: F.generatedLine, generatedColumn: F.generatedColumn, originalLine: F.originalLine, originalColumn: F.originalColumn, name: F.name === null ? null : this._names.at(F.name) };
      }, this).forEach(s, l);
    }, e.prototype.allGeneratedPositionsFor = function(s) {
      var p = g.getArg(s, "line"), c = { source: g.getArg(s, "source"), originalLine: p, originalColumn: g.getArg(s, "column", 0) };
      if (c.source = this._findSourceIndex(c.source), c.source < 0) return [];
      var l = [], i2 = this._findMapping(c, this._originalMappings, "originalLine", "originalColumn", g.compareByOriginalPositions, B.LEAST_UPPER_BOUND);
      if (i2 >= 0) {
        var f = this._originalMappings[i2];
        if (s.column === void 0) for (var G = f.originalLine; f && f.originalLine === G; ) l.push({ line: g.getArg(f, "generatedLine", null), column: g.getArg(f, "generatedColumn", null), lastColumn: g.getArg(f, "lastGeneratedColumn", null) }), f = this._originalMappings[++i2];
        else for (var F = f.originalColumn; f && f.originalLine === p && f.originalColumn == F; ) l.push({ line: g.getArg(f, "generatedLine", null), column: g.getArg(f, "generatedColumn", null), lastColumn: g.getArg(f, "lastGeneratedColumn", null) }), f = this._originalMappings[++i2];
      }
      return l;
    }, zg.SourceMapConsumer = e;
    function a(s, p) {
      var c = s;
      typeof s == "string" && (c = g.parseSourceMapInput(s));
      var l = g.getArg(c, "version"), i2 = g.getArg(c, "sources"), f = g.getArg(c, "names", []), G = g.getArg(c, "sourceRoot", null), F = g.getArg(c, "sourcesContent", null), L = g.getArg(c, "mappings"), U = g.getArg(c, "file", null);
      if (l != this._version) throw new Error("Unsupported version: " + l);
      G && (G = g.normalize(G)), i2 = i2.map(String).map(g.normalize).map(function(b) {
        return G && g.isAbsolute(G) && g.isAbsolute(b) ? g.relative(G, b) : b;
      }), this._names = Q.fromArray(f.map(String), true), this._sources = Q.fromArray(i2, true), this._absoluteSources = this._sources.toArray().map(function(b) {
        return g.computeSourceURL(G, b, p);
      }), this.sourceRoot = G, this.sourcesContent = F, this._mappings = L, this._sourceMapURL = p, this.file = U;
    }
    a.prototype = Object.create(e.prototype), a.prototype.consumer = e, a.prototype._findSourceIndex = function(s) {
      var p = s;
      if (this.sourceRoot != null && (p = g.relative(this.sourceRoot, p)), this._sources.has(p)) return this._sources.indexOf(p);
      var c;
      for (c = 0; c < this._absoluteSources.length; ++c) if (this._absoluteSources[c] == s) return c;
      return -1;
    }, a.fromSourceMap = function(s, p) {
      var c = Object.create(a.prototype), l = c._names = Q.fromArray(s._names.toArray(), true), i2 = c._sources = Q.fromArray(s._sources.toArray(), true);
      c.sourceRoot = s._sourceRoot, c.sourcesContent = s._generateSourcesContent(c._sources.toArray(), c.sourceRoot), c.file = s._file, c._sourceMapURL = p, c._absoluteSources = c._sources.toArray().map(function(Y) {
        return g.computeSourceURL(c.sourceRoot, Y, p);
      });
      for (var f = s._mappings.toArray().slice(), G = c.__generatedMappings = [], F = c.__originalMappings = [], L = 0, U = f.length; L < U; L++) {
        var b = f[L], S = new o();
        S.generatedLine = b.generatedLine, S.generatedColumn = b.generatedColumn, b.source && (S.source = i2.indexOf(b.source), S.originalLine = b.originalLine, S.originalColumn = b.originalColumn, b.name && (S.name = l.indexOf(b.name)), F.push(S)), G.push(S);
      }
      return n(c.__originalMappings, g.compareByOriginalPositions), c;
    }, a.prototype._version = 3, Object.defineProperty(a.prototype, "sources", { get: function() {
      return this._absoluteSources.slice();
    } });
    function o() {
      this.generatedLine = 0, this.generatedColumn = 0, this.source = null, this.originalLine = null, this.originalColumn = null, this.name = null;
    }
    a.prototype._parseMappings = function(s, p) {
      for (var c = 1, l = 0, i2 = 0, f = 0, G = 0, F = 0, L = s.length, U = 0, b = {}, S = {}, Y = [], Z3 = [], x, iA, uA, RA, JA; U < L; ) if (s.charAt(U) === ";") c++, U++, l = 0;
      else if (s.charAt(U) === ",") U++;
      else {
        for (x = new o(), x.generatedLine = c, RA = U; RA < L && !this._charIsMappingSeparator(s, RA); RA++) ;
        if (iA = s.slice(U, RA), uA = b[iA], uA) U += iA.length;
        else {
          for (uA = []; U < RA; ) t.decode(s, U, S), JA = S.value, U = S.rest, uA.push(JA);
          if (uA.length === 2) throw new Error("Found a source, but no line and column");
          if (uA.length === 3) throw new Error("Found a source and line, but no column");
          b[iA] = uA;
        }
        x.generatedColumn = l + uA[0], l = x.generatedColumn, uA.length > 1 && (x.source = G + uA[1], G += uA[1], x.originalLine = i2 + uA[2], i2 = x.originalLine, x.originalLine += 1, x.originalColumn = f + uA[3], f = x.originalColumn, uA.length > 4 && (x.name = F + uA[4], F += uA[4])), Z3.push(x), typeof x.originalLine == "number" && Y.push(x);
      }
      n(Z3, g.compareByGeneratedPositionsDeflated), this.__generatedMappings = Z3, n(Y, g.compareByOriginalPositions), this.__originalMappings = Y;
    }, a.prototype._findMapping = function(s, p, c, l, i2, f) {
      if (s[c] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + s[c]);
      if (s[l] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + s[l]);
      return B.search(s, p, i2, f);
    }, a.prototype.computeColumnSpans = function() {
      for (var s = 0; s < this._generatedMappings.length; ++s) {
        var p = this._generatedMappings[s];
        if (s + 1 < this._generatedMappings.length) {
          var c = this._generatedMappings[s + 1];
          if (p.generatedLine === c.generatedLine) {
            p.lastGeneratedColumn = c.generatedColumn - 1;
            continue;
          }
        }
        p.lastGeneratedColumn = 1 / 0;
      }
    }, a.prototype.originalPositionFor = function(s) {
      var p = { generatedLine: g.getArg(s, "line"), generatedColumn: g.getArg(s, "column") }, c = this._findMapping(p, this._generatedMappings, "generatedLine", "generatedColumn", g.compareByGeneratedPositionsDeflated, g.getArg(s, "bias", e.GREATEST_LOWER_BOUND));
      if (c >= 0) {
        var l = this._generatedMappings[c];
        if (l.generatedLine === p.generatedLine) {
          var i2 = g.getArg(l, "source", null);
          i2 !== null && (i2 = this._sources.at(i2), i2 = g.computeSourceURL(this.sourceRoot, i2, this._sourceMapURL));
          var f = g.getArg(l, "name", null);
          return f !== null && (f = this._names.at(f)), { source: i2, line: g.getArg(l, "originalLine", null), column: g.getArg(l, "originalColumn", null), name: f };
        }
      }
      return { source: null, line: null, column: null, name: null };
    }, a.prototype.hasContentsOfAllSources = function() {
      return this.sourcesContent ? this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(s) {
        return s == null;
      }) : false;
    }, a.prototype.sourceContentFor = function(s, p) {
      if (!this.sourcesContent) return null;
      var c = this._findSourceIndex(s);
      if (c >= 0) return this.sourcesContent[c];
      var l = s;
      this.sourceRoot != null && (l = g.relative(this.sourceRoot, l));
      var i2;
      if (this.sourceRoot != null && (i2 = g.urlParse(this.sourceRoot))) {
        var f = l.replace(/^file:\/\//, "");
        if (i2.scheme == "file" && this._sources.has(f)) return this.sourcesContent[this._sources.indexOf(f)];
        if ((!i2.path || i2.path == "/") && this._sources.has("/" + l)) return this.sourcesContent[this._sources.indexOf("/" + l)];
      }
      if (p) return null;
      throw new Error('"' + l + '" is not in the SourceMap.');
    }, a.prototype.generatedPositionFor = function(s) {
      var p = g.getArg(s, "source");
      if (p = this._findSourceIndex(p), p < 0) return { line: null, column: null, lastColumn: null };
      var c = { source: p, originalLine: g.getArg(s, "line"), originalColumn: g.getArg(s, "column") }, l = this._findMapping(c, this._originalMappings, "originalLine", "originalColumn", g.compareByOriginalPositions, g.getArg(s, "bias", e.GREATEST_LOWER_BOUND));
      if (l >= 0) {
        var i2 = this._originalMappings[l];
        if (i2.source === c.source) return { line: g.getArg(i2, "generatedLine", null), column: g.getArg(i2, "generatedColumn", null), lastColumn: g.getArg(i2, "lastGeneratedColumn", null) };
      }
      return { line: null, column: null, lastColumn: null };
    }, zg.BasicSourceMapConsumer = a;
    function u2(s, p) {
      var c = s;
      typeof s == "string" && (c = g.parseSourceMapInput(s));
      var l = g.getArg(c, "version"), i2 = g.getArg(c, "sections");
      if (l != this._version) throw new Error("Unsupported version: " + l);
      this._sources = new Q(), this._names = new Q();
      var f = { line: -1, column: 0 };
      this._sections = i2.map(function(G) {
        if (G.url) throw new Error("Support for url field in sections not implemented.");
        var F = g.getArg(G, "offset"), L = g.getArg(F, "line"), U = g.getArg(F, "column");
        if (L < f.line || L === f.line && U < f.column) throw new Error("Section offsets must be ordered and non-overlapping.");
        return f = F, { generatedOffset: { generatedLine: L + 1, generatedColumn: U + 1 }, consumer: new e(g.getArg(G, "map"), p) };
      });
    }
    return u2.prototype = Object.create(e.prototype), u2.prototype.constructor = e, u2.prototype._version = 3, Object.defineProperty(u2.prototype, "sources", { get: function() {
      for (var s = [], p = 0; p < this._sections.length; p++) for (var c = 0; c < this._sections[p].consumer.sources.length; c++) s.push(this._sections[p].consumer.sources[c]);
      return s;
    } }), u2.prototype.originalPositionFor = function(s) {
      var p = { generatedLine: g.getArg(s, "line"), generatedColumn: g.getArg(s, "column") }, c = B.search(p, this._sections, function(i2, f) {
        var G = i2.generatedLine - f.generatedOffset.generatedLine;
        return G || i2.generatedColumn - f.generatedOffset.generatedColumn;
      }), l = this._sections[c];
      return l ? l.consumer.originalPositionFor({ line: p.generatedLine - (l.generatedOffset.generatedLine - 1), column: p.generatedColumn - (l.generatedOffset.generatedLine === p.generatedLine ? l.generatedOffset.generatedColumn - 1 : 0), bias: s.bias }) : { source: null, line: null, column: null, name: null };
    }, u2.prototype.hasContentsOfAllSources = function() {
      return this._sections.every(function(s) {
        return s.consumer.hasContentsOfAllSources();
      });
    }, u2.prototype.sourceContentFor = function(s, p) {
      for (var c = 0; c < this._sections.length; c++) {
        var l = this._sections[c], i2 = l.consumer.sourceContentFor(s, true);
        if (i2) return i2;
      }
      if (p) return null;
      throw new Error('"' + s + '" is not in the SourceMap.');
    }, u2.prototype.generatedPositionFor = function(s) {
      for (var p = 0; p < this._sections.length; p++) {
        var c = this._sections[p];
        if (c.consumer._findSourceIndex(g.getArg(s, "source")) !== -1) {
          var l = c.consumer.generatedPositionFor(s);
          if (l) {
            var i2 = { line: l.line + (c.generatedOffset.generatedLine - 1), column: l.column + (c.generatedOffset.generatedLine === l.line ? c.generatedOffset.generatedColumn - 1 : 0) };
            return i2;
          }
        }
      }
      return { line: null, column: null };
    }, u2.prototype._parseMappings = function(s, p) {
      this.__generatedMappings = [], this.__originalMappings = [];
      for (var c = 0; c < this._sections.length; c++) for (var l = this._sections[c], i2 = l.consumer._generatedMappings, f = 0; f < i2.length; f++) {
        var G = i2[f], F = l.consumer._sources.at(G.source);
        F = g.computeSourceURL(l.consumer.sourceRoot, F, this._sourceMapURL), this._sources.add(F), F = this._sources.indexOf(F);
        var L = null;
        G.name && (L = l.consumer._names.at(G.name), this._names.add(L), L = this._names.indexOf(L));
        var U = { source: F, generatedLine: G.generatedLine + (l.generatedOffset.generatedLine - 1), generatedColumn: G.generatedColumn + (l.generatedOffset.generatedLine === G.generatedLine ? l.generatedOffset.generatedColumn - 1 : 0), originalLine: G.originalLine, originalColumn: G.originalColumn, name: L };
        this.__generatedMappings.push(U), typeof U.originalLine == "number" && this.__originalMappings.push(U);
      }
      n(this.__generatedMappings, g.compareByGeneratedPositionsDeflated), n(this.__originalMappings, g.compareByOriginalPositions);
    }, zg.IndexedSourceMapConsumer = u2, zg;
  }
  var GC = {}, PE;
  function Fa() {
    if (PE) return GC;
    PE = 1;
    var g = TE().SourceMapGenerator, B = Xg(), Q = /(\r?\n)/, t = 10, n = "$$$isSourceNode$$$";
    function e(a, o, u2, s, p) {
      this.children = [], this.sourceContents = {}, this.line = a ?? null, this.column = o ?? null, this.source = u2 ?? null, this.name = p ?? null, this[n] = true, s != null && this.add(s);
    }
    return e.fromStringWithSourceMap = function(a, o, u2) {
      var s = new e(), p = a.split(Q), c = 0, l = function() {
        var L = b(), U = b() || "";
        return L + U;
        function b() {
          return c < p.length ? p[c++] : void 0;
        }
      }, i2 = 1, f = 0, G = null;
      return o.eachMapping(function(L) {
        if (G !== null) if (i2 < L.generatedLine) F(G, l()), i2++, f = 0;
        else {
          var U = p[c] || "", b = U.substr(0, L.generatedColumn - f);
          p[c] = U.substr(L.generatedColumn - f), f = L.generatedColumn, F(G, b), G = L;
          return;
        }
        for (; i2 < L.generatedLine; ) s.add(l()), i2++;
        if (f < L.generatedColumn) {
          var U = p[c] || "";
          s.add(U.substr(0, L.generatedColumn)), p[c] = U.substr(L.generatedColumn), f = L.generatedColumn;
        }
        G = L;
      }, this), c < p.length && (G && F(G, l()), s.add(p.splice(c).join(""))), o.sources.forEach(function(L) {
        var U = o.sourceContentFor(L);
        U != null && (u2 != null && (L = B.join(u2, L)), s.setSourceContent(L, U));
      }), s;
      function F(L, U) {
        if (L === null || L.source === void 0) s.add(U);
        else {
          var b = u2 ? B.join(u2, L.source) : L.source;
          s.add(new e(L.originalLine, L.originalColumn, b, U, L.name));
        }
      }
    }, e.prototype.add = function(a) {
      if (Array.isArray(a)) a.forEach(function(o) {
        this.add(o);
      }, this);
      else if (a[n] || typeof a == "string") a && this.children.push(a);
      else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + a);
      return this;
    }, e.prototype.prepend = function(a) {
      if (Array.isArray(a)) for (var o = a.length - 1; o >= 0; o--) this.prepend(a[o]);
      else if (a[n] || typeof a == "string") this.children.unshift(a);
      else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + a);
      return this;
    }, e.prototype.walk = function(a) {
      for (var o, u2 = 0, s = this.children.length; u2 < s; u2++) o = this.children[u2], o[n] ? o.walk(a) : o !== "" && a(o, { source: this.source, line: this.line, column: this.column, name: this.name });
    }, e.prototype.join = function(a) {
      var o, u2, s = this.children.length;
      if (s > 0) {
        for (o = [], u2 = 0; u2 < s - 1; u2++) o.push(this.children[u2]), o.push(a);
        o.push(this.children[u2]), this.children = o;
      }
      return this;
    }, e.prototype.replaceRight = function(a, o) {
      var u2 = this.children[this.children.length - 1];
      return u2[n] ? u2.replaceRight(a, o) : typeof u2 == "string" ? this.children[this.children.length - 1] = u2.replace(a, o) : this.children.push("".replace(a, o)), this;
    }, e.prototype.setSourceContent = function(a, o) {
      this.sourceContents[B.toSetString(a)] = o;
    }, e.prototype.walkSourceContents = function(a) {
      for (var o = 0, u2 = this.children.length; o < u2; o++) this.children[o][n] && this.children[o].walkSourceContents(a);
      for (var s = Object.keys(this.sourceContents), o = 0, u2 = s.length; o < u2; o++) a(B.fromSetString(s[o]), this.sourceContents[s[o]]);
    }, e.prototype.toString = function() {
      var a = "";
      return this.walk(function(o) {
        a += o;
      }), a;
    }, e.prototype.toStringWithSourceMap = function(a) {
      var o = { code: "", line: 1, column: 0 }, u2 = new g(a), s = false, p = null, c = null, l = null, i2 = null;
      return this.walk(function(f, G) {
        o.code += f, G.source !== null && G.line !== null && G.column !== null ? ((p !== G.source || c !== G.line || l !== G.column || i2 !== G.name) && u2.addMapping({ source: G.source, original: { line: G.line, column: G.column }, generated: { line: o.line, column: o.column }, name: G.name }), p = G.source, c = G.line, l = G.column, i2 = G.name, s = true) : s && (u2.addMapping({ generated: { line: o.line, column: o.column } }), p = null, s = false);
        for (var F = 0, L = f.length; F < L; F++) f.charCodeAt(F) === t ? (o.line++, o.column = 0, F + 1 === L ? (p = null, s = false) : s && u2.addMapping({ source: G.source, original: { line: G.line, column: G.column }, generated: { line: o.line, column: o.column }, name: G.name })) : o.column++;
      }), this.walkSourceContents(function(f, G) {
        u2.setSourceContent(f, G);
      }), { code: o.code, map: u2 };
    }, GC.SourceNode = e, GC;
  }
  var WE;
  function La() {
    return WE || (WE = 1, UB.SourceMapGenerator = TE().SourceMapGenerator, UB.SourceMapConsumer = Ra().SourceMapConsumer, UB.SourceNode = Fa().SourceNode), UB;
  }
  (function(g, B) {
    B.__esModule = true;
    var Q = GA, t = void 0;
    try {
      var n = La();
      t = n.SourceNode;
    } catch {
    }
    t || (t = function(o, u2, s, p) {
      this.src = "", p && this.add(p);
    }, t.prototype = { add: function(o) {
      Q.isArray(o) && (o = o.join("")), this.src += o;
    }, prepend: function(o) {
      Q.isArray(o) && (o = o.join("")), this.src = o + this.src;
    }, toStringWithSourceMap: function() {
      return { code: this.toString() };
    }, toString: function() {
      return this.src;
    } });
    function e(o, u2, s) {
      if (Q.isArray(o)) {
        for (var p = [], c = 0, l = o.length; c < l; c++) p.push(u2.wrap(o[c], s));
        return p;
      } else if (typeof o == "boolean" || typeof o == "number") return o + "";
      return o;
    }
    function a(o) {
      this.srcFile = o, this.source = [];
    }
    a.prototype = { isEmpty: function() {
      return !this.source.length;
    }, prepend: function(o, u2) {
      this.source.unshift(this.wrap(o, u2));
    }, push: function(o, u2) {
      this.source.push(this.wrap(o, u2));
    }, merge: function() {
      var o = this.empty();
      return this.each(function(u2) {
        o.add(["  ", u2, `
`]);
      }), o;
    }, each: function(o) {
      for (var u2 = 0, s = this.source.length; u2 < s; u2++) o(this.source[u2]);
    }, empty: function() {
      var o = this.currentLocation || { start: {} };
      return new t(o.start.line, o.start.column, this.srcFile);
    }, wrap: function(o) {
      var u2 = arguments.length <= 1 || arguments[1] === void 0 ? this.currentLocation || { start: {} } : arguments[1];
      return o instanceof t ? o : (o = e(o, this, u2), new t(u2.start.line, u2.start.column, this.srcFile, o));
    }, functionCall: function(o, u2, s) {
      return s = this.generateList(s), this.wrap([o, u2 ? "." + u2 + "(" : "(", s, ")"]);
    }, quotedString: function(o) {
      return '"' + (o + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"';
    }, objectLiteral: function(o) {
      var u2 = [];
      for (var s in o) if (o.hasOwnProperty(s)) {
        var p = e(o[s], this);
        p !== "undefined" && u2.push([this.quotedString(s), ":", p]);
      }
      var c = this.generateList(u2);
      return c.prepend("{"), c.add("}"), c;
    }, generateList: function(o) {
      for (var u2 = this.empty(), s = 0, p = o.length; s < p; s++) s && u2.add(","), u2.add(e(o[s], this));
      return u2;
    }, generateArray: function(o) {
      var u2 = this.generateList(o);
      return u2.prepend("["), u2.add("]"), u2;
    } }, B.default = a, g.exports = B.default;
  })(DC, DC.exports);
  var Ua = DC.exports;
  (function(g, B) {
    B.__esModule = true;
    function Q(l) {
      return l && l.__esModule ? l : { default: l };
    }
    var t = GI, n = mI, e = Q(n), a = GA, o = Ua, u2 = Q(o);
    function s(l) {
      this.value = l;
    }
    function p() {
    }
    p.prototype = { nameLookup: function(l, i2) {
      return i2 === "constructor" ? ["(", l, ".propertyIsEnumerable('constructor') ? ", l, ".constructor : undefined", ")"] : p.isValidJavaScriptVariableName(i2) ? [l, ".", i2] : [l, "[", JSON.stringify(i2), "]"];
    }, depthedLookup: function(l) {
      return [this.aliasable("container.lookup"), '(depths, "', l, '")'];
    }, compilerInfo: function() {
      var l = t.COMPILER_REVISION, i2 = t.REVISION_CHANGES[l];
      return [l, i2];
    }, appendToBuffer: function(l, i2, f) {
      return a.isArray(l) || (l = [l]), l = this.source.wrap(l, i2), this.environment.isSimple ? ["return ", l, ";"] : f ? ["buffer += ", l, ";"] : (l.appendToBuffer = true, l);
    }, initializeBuffer: function() {
      return this.quotedString("");
    }, compile: function(l, i2, f, G) {
      this.environment = l, this.options = i2, this.stringParams = this.options.stringParams, this.trackIds = this.options.trackIds, this.precompile = !G, this.name = this.environment.name, this.isChild = !!f, this.context = f || { decorators: [], programs: [], environments: [] }, this.preamble(), this.stackSlot = 0, this.stackVars = [], this.aliases = {}, this.registers = { list: [] }, this.hashes = [], this.compileStack = [], this.inlineStack = [], this.blockParams = [], this.compileChildren(l, i2), this.useDepths = this.useDepths || l.useDepths || l.useDecorators || this.options.compat, this.useBlockParams = this.useBlockParams || l.useBlockParams;
      var F = l.opcodes, L = void 0, U = void 0, b = void 0, S = void 0;
      for (b = 0, S = F.length; b < S; b++) L = F[b], this.source.currentLocation = L.loc, U = U || L.loc, this[L.opcode].apply(this, L.args);
      if (this.source.currentLocation = U, this.pushSource(""), this.stackSlot || this.inlineStack.length || this.compileStack.length) throw new e.default("Compile completed with content left on stack");
      this.decorators.isEmpty() ? this.decorators = void 0 : (this.useDecorators = true, this.decorators.prepend(`var decorators = container.decorators;
`), this.decorators.push("return fn;"), G ? this.decorators = Function.apply(this, ["fn", "props", "container", "depth0", "data", "blockParams", "depths", this.decorators.merge()]) : (this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
`), this.decorators.push(`}
`), this.decorators = this.decorators.merge()));
      var Y = this.createFunctionContext(G);
      if (this.isChild) return Y;
      var Z3 = { compiler: this.compilerInfo(), main: Y };
      this.decorators && (Z3.main_d = this.decorators, Z3.useDecorators = true);
      var x = this.context, iA = x.programs, uA = x.decorators;
      for (b = 0, S = iA.length; b < S; b++) iA[b] && (Z3[b] = iA[b], uA[b] && (Z3[b + "_d"] = uA[b], Z3.useDecorators = true));
      return this.environment.usePartial && (Z3.usePartial = true), this.options.data && (Z3.useData = true), this.useDepths && (Z3.useDepths = true), this.useBlockParams && (Z3.useBlockParams = true), this.options.compat && (Z3.compat = true), G ? Z3.compilerOptions = this.options : (Z3.compiler = JSON.stringify(Z3.compiler), this.source.currentLocation = { start: { line: 1, column: 0 } }, Z3 = this.objectLiteral(Z3), i2.srcName ? (Z3 = Z3.toStringWithSourceMap({ file: i2.destName }), Z3.map = Z3.map && Z3.map.toString()) : Z3 = Z3.toString()), Z3;
    }, preamble: function() {
      this.lastContext = 0, this.source = new u2.default(this.options.srcName), this.decorators = new u2.default(this.options.srcName);
    }, createFunctionContext: function(l) {
      var i2 = "", f = this.stackVars.concat(this.registers.list);
      f.length > 0 && (i2 += ", " + f.join(", "));
      var G = 0;
      for (var F in this.aliases) {
        var L = this.aliases[F];
        this.aliases.hasOwnProperty(F) && L.children && L.referenceCount > 1 && (i2 += ", alias" + ++G + "=" + F, L.children[0] = "alias" + G);
      }
      var U = ["container", "depth0", "helpers", "partials", "data"];
      (this.useBlockParams || this.useDepths) && U.push("blockParams"), this.useDepths && U.push("depths");
      var b = this.mergeSource(i2);
      return l ? (U.push(b), Function.apply(this, U)) : this.source.wrap(["function(", U.join(","), `) {
  `, b, "}"]);
    }, mergeSource: function(l) {
      var i2 = this.environment.isSimple, f = !this.forceBuffer, G = void 0, F = void 0, L = void 0, U = void 0;
      return this.source.each(function(b) {
        b.appendToBuffer ? (L ? b.prepend("  + ") : L = b, U = b) : (L && (F ? L.prepend("buffer += ") : G = true, U.add(";"), L = U = void 0), F = true, i2 || (f = false));
      }), f ? L ? (L.prepend("return "), U.add(";")) : F || this.source.push('return "";') : (l += ", buffer = " + (G ? "" : this.initializeBuffer()), L ? (L.prepend("return buffer + "), U.add(";")) : this.source.push("return buffer;")), l && this.source.prepend("var " + l.substring(2) + (G ? "" : `;
`)), this.source.merge();
    }, blockValue: function(l) {
      var i2 = this.aliasable("helpers.blockHelperMissing"), f = [this.contextName(0)];
      this.setupHelperArgs(l, 0, f);
      var G = this.popStack();
      f.splice(1, 0, G), this.push(this.source.functionCall(i2, "call", f));
    }, ambiguousBlockValue: function() {
      var l = this.aliasable("helpers.blockHelperMissing"), i2 = [this.contextName(0)];
      this.setupHelperArgs("", 0, i2, true), this.flushInline();
      var f = this.topStack();
      i2.splice(1, 0, f), this.pushSource(["if (!", this.lastHelper, ") { ", f, " = ", this.source.functionCall(l, "call", i2), "}"]);
    }, appendContent: function(l) {
      this.pendingContent ? l = this.pendingContent + l : this.pendingLocation = this.source.currentLocation, this.pendingContent = l;
    }, append: function() {
      if (this.isInline()) this.replaceStack(function(i2) {
        return [" != null ? ", i2, ' : ""'];
      }), this.pushSource(this.appendToBuffer(this.popStack()));
      else {
        var l = this.popStack();
        this.pushSource(["if (", l, " != null) { ", this.appendToBuffer(l, void 0, true), " }"]), this.environment.isSimple && this.pushSource(["else { ", this.appendToBuffer("''", void 0, true), " }"]);
      }
    }, appendEscaped: function() {
      this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"), "(", this.popStack(), ")"]));
    }, getContext: function(l) {
      this.lastContext = l;
    }, pushContext: function() {
      this.pushStackLiteral(this.contextName(this.lastContext));
    }, lookupOnContext: function(l, i2, f, G) {
      var F = 0;
      !G && this.options.compat && !this.lastContext ? this.push(this.depthedLookup(l[F++])) : this.pushContext(), this.resolvePath("context", l, F, i2, f);
    }, lookupBlockParam: function(l, i2) {
      this.useBlockParams = true, this.push(["blockParams[", l[0], "][", l[1], "]"]), this.resolvePath("context", i2, 1);
    }, lookupData: function(l, i2, f) {
      l ? this.pushStackLiteral("container.data(data, " + l + ")") : this.pushStackLiteral("data"), this.resolvePath("data", i2, 0, true, f);
    }, resolvePath: function(l, i2, f, G, F) {
      var L = this;
      if (this.options.strict || this.options.assumeObjects) {
        this.push(c(this.options.strict && F, this, i2, l));
        return;
      }
      for (var U = i2.length; f < U; f++) this.replaceStack(function(b) {
        var S = L.nameLookup(b, i2[f], l);
        return G ? [" && ", S] : [" != null ? ", S, " : ", b];
      });
    }, resolvePossibleLambda: function() {
      this.push([this.aliasable("container.lambda"), "(", this.popStack(), ", ", this.contextName(0), ")"]);
    }, pushStringParam: function(l, i2) {
      this.pushContext(), this.pushString(i2), i2 !== "SubExpression" && (typeof l == "string" ? this.pushString(l) : this.pushStackLiteral(l));
    }, emptyHash: function(l) {
      this.trackIds && this.push("{}"), this.stringParams && (this.push("{}"), this.push("{}")), this.pushStackLiteral(l ? "undefined" : "{}");
    }, pushHash: function() {
      this.hash && this.hashes.push(this.hash), this.hash = { values: [], types: [], contexts: [], ids: [] };
    }, popHash: function() {
      var l = this.hash;
      this.hash = this.hashes.pop(), this.trackIds && this.push(this.objectLiteral(l.ids)), this.stringParams && (this.push(this.objectLiteral(l.contexts)), this.push(this.objectLiteral(l.types))), this.push(this.objectLiteral(l.values));
    }, pushString: function(l) {
      this.pushStackLiteral(this.quotedString(l));
    }, pushLiteral: function(l) {
      this.pushStackLiteral(l);
    }, pushProgram: function(l) {
      l != null ? this.pushStackLiteral(this.programExpression(l)) : this.pushStackLiteral(null);
    }, registerDecorator: function(l, i2) {
      var f = this.nameLookup("decorators", i2, "decorator"), G = this.setupHelperArgs(i2, l);
      this.decorators.push(["fn = ", this.decorators.functionCall(f, "", ["fn", "props", "container", G]), " || fn;"]);
    }, invokeHelper: function(l, i2, f) {
      var G = this.popStack(), F = this.setupHelper(l, i2), L = f ? [F.name, " || "] : "", U = ["("].concat(L, G);
      this.options.strict || U.push(" || ", this.aliasable("helpers.helperMissing")), U.push(")"), this.push(this.source.functionCall(U, "call", F.callParams));
    }, invokeKnownHelper: function(l, i2) {
      var f = this.setupHelper(l, i2);
      this.push(this.source.functionCall(f.name, "call", f.callParams));
    }, invokeAmbiguous: function(l, i2) {
      this.useRegister("helper");
      var f = this.popStack();
      this.emptyHash();
      var G = this.setupHelper(0, l, i2), F = this.lastHelper = this.nameLookup("helpers", l, "helper"), L = ["(", "(helper = ", F, " || ", f, ")"];
      this.options.strict || (L[0] = "(helper = ", L.push(" != null ? helper : ", this.aliasable("helpers.helperMissing"))), this.push(["(", L, G.paramsInit ? ["),(", G.paramsInit] : [], "),", "(typeof helper === ", this.aliasable('"function"'), " ? ", this.source.functionCall("helper", "call", G.callParams), " : helper))"]);
    }, invokePartial: function(l, i2, f) {
      var G = [], F = this.setupParams(i2, 1, G);
      l && (i2 = this.popStack(), delete F.name), f && (F.indent = JSON.stringify(f)), F.helpers = "helpers", F.partials = "partials", F.decorators = "container.decorators", l ? G.unshift(i2) : G.unshift(this.nameLookup("partials", i2, "partial")), this.options.compat && (F.depths = "depths"), F = this.objectLiteral(F), G.push(F), this.push(this.source.functionCall("container.invokePartial", "", G));
    }, assignToHash: function(l) {
      var i2 = this.popStack(), f = void 0, G = void 0, F = void 0;
      this.trackIds && (F = this.popStack()), this.stringParams && (G = this.popStack(), f = this.popStack());
      var L = this.hash;
      f && (L.contexts[l] = f), G && (L.types[l] = G), F && (L.ids[l] = F), L.values[l] = i2;
    }, pushId: function(l, i2, f) {
      l === "BlockParam" ? this.pushStackLiteral("blockParams[" + i2[0] + "].path[" + i2[1] + "]" + (f ? " + " + JSON.stringify("." + f) : "")) : l === "PathExpression" ? this.pushString(i2) : l === "SubExpression" ? this.pushStackLiteral("true") : this.pushStackLiteral("null");
    }, compiler: p, compileChildren: function(l, i2) {
      for (var f = l.children, G = void 0, F = void 0, L = 0, U = f.length; L < U; L++) {
        G = f[L], F = new this.compiler();
        var b = this.matchExistingProgram(G);
        if (b == null) {
          this.context.programs.push("");
          var S = this.context.programs.length;
          G.index = S, G.name = "program" + S, this.context.programs[S] = F.compile(G, i2, this.context, !this.precompile), this.context.decorators[S] = F.decorators, this.context.environments[S] = G, this.useDepths = this.useDepths || F.useDepths, this.useBlockParams = this.useBlockParams || F.useBlockParams, G.useDepths = this.useDepths, G.useBlockParams = this.useBlockParams;
        } else G.index = b.index, G.name = "program" + b.index, this.useDepths = this.useDepths || b.useDepths, this.useBlockParams = this.useBlockParams || b.useBlockParams;
      }
    }, matchExistingProgram: function(l) {
      for (var i2 = 0, f = this.context.environments.length; i2 < f; i2++) {
        var G = this.context.environments[i2];
        if (G && G.equals(l)) return G;
      }
    }, programExpression: function(l) {
      var i2 = this.environment.children[l], f = [i2.index, "data", i2.blockParams];
      return (this.useBlockParams || this.useDepths) && f.push("blockParams"), this.useDepths && f.push("depths"), "container.program(" + f.join(", ") + ")";
    }, useRegister: function(l) {
      this.registers[l] || (this.registers[l] = true, this.registers.list.push(l));
    }, push: function(l) {
      return l instanceof s || (l = this.source.wrap(l)), this.inlineStack.push(l), l;
    }, pushStackLiteral: function(l) {
      this.push(new s(l));
    }, pushSource: function(l) {
      this.pendingContent && (this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)), this.pendingContent = void 0), l && this.source.push(l);
    }, replaceStack: function(l) {
      var i2 = ["("], f = void 0, G = void 0, F = void 0;
      if (!this.isInline()) throw new e.default("replaceStack on non-inline");
      var L = this.popStack(true);
      if (L instanceof s) f = [L.value], i2 = ["(", f], F = true;
      else {
        G = true;
        var U = this.incrStack();
        i2 = ["((", this.push(U), " = ", L, ")"], f = this.topStack();
      }
      var b = l.call(this, f);
      F || this.popStack(), G && this.stackSlot--, this.push(i2.concat(b, ")"));
    }, incrStack: function() {
      return this.stackSlot++, this.stackSlot > this.stackVars.length && this.stackVars.push("stack" + this.stackSlot), this.topStackName();
    }, topStackName: function() {
      return "stack" + this.stackSlot;
    }, flushInline: function() {
      var l = this.inlineStack;
      this.inlineStack = [];
      for (var i2 = 0, f = l.length; i2 < f; i2++) {
        var G = l[i2];
        if (G instanceof s) this.compileStack.push(G);
        else {
          var F = this.incrStack();
          this.pushSource([F, " = ", G, ";"]), this.compileStack.push(F);
        }
      }
    }, isInline: function() {
      return this.inlineStack.length;
    }, popStack: function(l) {
      var i2 = this.isInline(), f = (i2 ? this.inlineStack : this.compileStack).pop();
      if (!l && f instanceof s) return f.value;
      if (!i2) {
        if (!this.stackSlot) throw new e.default("Invalid stack pop");
        this.stackSlot--;
      }
      return f;
    }, topStack: function() {
      var l = this.isInline() ? this.inlineStack : this.compileStack, i2 = l[l.length - 1];
      return i2 instanceof s ? i2.value : i2;
    }, contextName: function(l) {
      return this.useDepths && l ? "depths[" + l + "]" : "depth" + l;
    }, quotedString: function(l) {
      return this.source.quotedString(l);
    }, objectLiteral: function(l) {
      return this.source.objectLiteral(l);
    }, aliasable: function(l) {
      var i2 = this.aliases[l];
      return i2 ? (i2.referenceCount++, i2) : (i2 = this.aliases[l] = this.source.wrap(l), i2.aliasable = true, i2.referenceCount = 1, i2);
    }, setupHelper: function(l, i2, f) {
      var G = [], F = this.setupHelperArgs(i2, l, G, f), L = this.nameLookup("helpers", i2, "helper"), U = this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : (container.nullContext || {})");
      return { params: G, paramsInit: F, name: L, callParams: [U].concat(G) };
    }, setupParams: function(l, i2, f) {
      var G = {}, F = [], L = [], U = [], b = !f, S = void 0;
      b && (f = []), G.name = this.quotedString(l), G.hash = this.popStack(), this.trackIds && (G.hashIds = this.popStack()), this.stringParams && (G.hashTypes = this.popStack(), G.hashContexts = this.popStack());
      var Y = this.popStack(), Z3 = this.popStack();
      (Z3 || Y) && (G.fn = Z3 || "container.noop", G.inverse = Y || "container.noop");
      for (var x = i2; x--; ) S = this.popStack(), f[x] = S, this.trackIds && (U[x] = this.popStack()), this.stringParams && (L[x] = this.popStack(), F[x] = this.popStack());
      return b && (G.args = this.source.generateArray(f)), this.trackIds && (G.ids = this.source.generateArray(U)), this.stringParams && (G.types = this.source.generateArray(L), G.contexts = this.source.generateArray(F)), this.options.data && (G.data = "data"), this.useBlockParams && (G.blockParams = "blockParams"), G;
    }, setupHelperArgs: function(l, i2, f, G) {
      var F = this.setupParams(l, i2, f);
      return F = this.objectLiteral(F), G ? (this.useRegister("options"), f.push("options"), ["options=", F]) : f ? (f.push(F), "") : F;
    } }, function() {
      for (var l = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "), i2 = p.RESERVED_WORDS = {}, f = 0, G = l.length; f < G; f++) i2[l[f]] = true;
    }(), p.isValidJavaScriptVariableName = function(l) {
      return !p.RESERVED_WORDS[l] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(l);
    };
    function c(l, i2, f, G) {
      var F = i2.popStack(), L = 0, U = f.length;
      for (l && U--; L < U; L++) F = i2.nameLookup(F, f[L], G);
      return l ? [i2.aliasable("container.strict"), "(", F, ", ", i2.quotedString(f[L]), ")"] : F;
    }
    B.default = p, g.exports = B.default;
  })(lC, lC.exports);
  var Ja = lC.exports;
  (function(g, B) {
    B.__esModule = true;
    function Q(U) {
      return U && U.__esModule ? U : { default: U };
    }
    var t = zr, n = Q(t), e = dE, a = Q(e), o = RB, u2 = jg, s = Ja, p = Q(s), c = aC, l = Q(c), i2 = kE, f = Q(i2), G = n.default.create;
    function F() {
      var U = G();
      return U.compile = function(b, S) {
        return u2.compile(b, S, U);
      }, U.precompile = function(b, S) {
        return u2.precompile(b, S, U);
      }, U.AST = a.default, U.Compiler = u2.Compiler, U.JavaScriptCompiler = p.default, U.Parser = o.parser, U.parse = o.parse, U;
    }
    var L = F();
    L.create = F, f.default(L), L.Visitor = l.default, L.default = L, B.default = L, g.exports = B.default;
  })(OQ, OQ.exports);
  var Ya = OQ.exports, mB = {};
  mB.__esModule = true, mB.print = Ka, mB.PrintVisitor = MA;
  function ma(g) {
    return g && g.__esModule ? g : { default: g };
  }
  var va = aC, Ha = ma(va);
  function Ka(g) {
    return new MA().accept(g);
  }
  function MA() {
    this.padding = 0;
  }
  MA.prototype = new Ha.default(), MA.prototype.pad = function(g) {
    for (var B = "", Q = 0, t = this.padding; Q < t; Q++) B += "  ";
    return B += g + `
`, B;
  }, MA.prototype.Program = function(g) {
    var B = "", Q = g.body, t = void 0, n = void 0;
    if (g.blockParams) {
      var e = "BLOCK PARAMS: [";
      for (t = 0, n = g.blockParams.length; t < n; t++) e += " " + g.blockParams[t];
      e += " ]", B += this.pad(e);
    }
    for (t = 0, n = Q.length; t < n; t++) B += this.accept(Q[t]);
    return this.padding--, B;
  }, MA.prototype.MustacheStatement = function(g) {
    return this.pad("{{ " + this.SubExpression(g) + " }}");
  }, MA.prototype.Decorator = function(g) {
    return this.pad("{{ DIRECTIVE " + this.SubExpression(g) + " }}");
  }, MA.prototype.BlockStatement = MA.prototype.DecoratorBlock = function(g) {
    var B = "";
    return B += this.pad((g.type === "DecoratorBlock" ? "DIRECTIVE " : "") + "BLOCK:"), this.padding++, B += this.pad(this.SubExpression(g)), g.program && (B += this.pad("PROGRAM:"), this.padding++, B += this.accept(g.program), this.padding--), g.inverse && (g.program && this.padding++, B += this.pad("{{^}}"), this.padding++, B += this.accept(g.inverse), this.padding--, g.program && this.padding--), this.padding--, B;
  }, MA.prototype.PartialStatement = function(g) {
    var B = "PARTIAL:" + g.name.original;
    return g.params[0] && (B += " " + this.accept(g.params[0])), g.hash && (B += " " + this.accept(g.hash)), this.pad("{{> " + B + " }}");
  }, MA.prototype.PartialBlockStatement = function(g) {
    var B = "PARTIAL BLOCK:" + g.name.original;
    return g.params[0] && (B += " " + this.accept(g.params[0])), g.hash && (B += " " + this.accept(g.hash)), B += " " + this.pad("PROGRAM:"), this.padding++, B += this.accept(g.program), this.padding--, this.pad("{{> " + B + " }}");
  }, MA.prototype.ContentStatement = function(g) {
    return this.pad("CONTENT[ '" + g.value + "' ]");
  }, MA.prototype.CommentStatement = function(g) {
    return this.pad("{{! '" + g.value + "' }}");
  }, MA.prototype.SubExpression = function(g) {
    for (var B = g.params, Q = [], t = void 0, n = 0, e = B.length; n < e; n++) Q.push(this.accept(B[n]));
    return B = "[" + Q.join(", ") + "]", t = g.hash ? " " + this.accept(g.hash) : "", this.accept(g.path) + " " + B + t;
  }, MA.prototype.PathExpression = function(g) {
    var B = g.parts.join("/");
    return (g.data ? "@" : "") + "PATH:" + B;
  }, MA.prototype.StringLiteral = function(g) {
    return '"' + g.value + '"';
  }, MA.prototype.NumberLiteral = function(g) {
    return "NUMBER{" + g.value + "}";
  }, MA.prototype.BooleanLiteral = function(g) {
    return "BOOLEAN{" + g.value + "}";
  }, MA.prototype.UndefinedLiteral = function() {
    return "UNDEFINED";
  }, MA.prototype.NullLiteral = function() {
    return "NULL";
  }, MA.prototype.Hash = function(g) {
    for (var B = g.pairs, Q = [], t = 0, n = B.length; t < n; t++) Q.push(this.accept(B[t]));
    return "HASH{" + Q.join(", ") + "}";
  }, MA.prototype.HashPair = function(g) {
    return g.key + "=" + this.accept(g.value);
  };
  const qa = {}, Ta = Object.freeze(Object.defineProperty({ __proto__: null, default: qa }, Symbol.toStringTag, { value: "Module" })), Oa = Bo(Ta);
  var vB = Ya.default, jE = mB;
  vB.PrintVisitor = jE.PrintVisitor, vB.print = jE.print;
  var NC = vB;
  function ZE(g, B) {
    var Q = Oa, t = Q.readFileSync(B, "utf8");
    g.exports = vB.compile(t);
  }
  typeof dB < "u" && dB.extensions && (dB.extensions[".handlebars"] = ZE, dB.extensions[".hbs"] = ZE);
  const ba = console;
  Io = class {
    static writeSystemHeaderValue(g, B) {
      let Q;
      return B && g && (Q = NC.compile(B)(g)), Q;
    }
    static writeSystemHeaderSummary(g, B, Q, t) {
      if (ba.debug("Writing system header summary"), B) {
        let n, e;
        if ((B.summaryNameRule || B.summaryDescriptionRule) && (n = B.summaryNameRule, e = B.summaryDescriptionRule, g)) {
          let a;
          if (Q) {
            a = dA.cloneDeep(Q);
            const u2 = Object.keys(g);
            for (let s = 0; s < u2.length; s++) {
              const p = u2[s];
              a[p] = g[p];
            }
          } else a = dA.cloneDeep(g);
          let o;
          n && (o = NC.compile(n), t && t.systemHeader && t.systemHeader.summaryName ? g.systemHeader.summaryName = t.systemHeader.summaryName : g.systemHeader.summaryName = o(a)), e && (o = NC.compile(e), t && t.systemHeader && t.systemHeader.summaryDescription ? g.systemHeader.summaryDescription = t.systemHeader.summaryDescription : g.systemHeader.summaryDescription = o(a));
        }
      }
    }
    static writeSystemHeaderCreated(g, B, Q, t) {
      (B === K.INSERT_OPERATION_TYPE || B === K.UPDATE_OPERATION_TYPE) && (g.systemHeader.createdDate || (g.systemHeader.createdDate = t || /* @__PURE__ */ new Date()), Q && (g.systemHeader.createdBy = Q.documentId)), B === K.INSERT_OPERATION_TYPE && (g.systemHeader.documentCreatedDate || (g.systemHeader.documentCreatedDate = t || /* @__PURE__ */ new Date()), Q && !g.systemHeader.documentCreatedBy && (g.systemHeader.documentCreatedBy = Q.documentId));
    }
  };
  const xa = { documentExtensionNameMap: { DOC: "Word 97-2003 Document", DOCX: "Word Document", PPT: "PowerPoint 97-2003 Presentation", PPTX: "PowerPoint Presentation", XLS: "Excel 97-2003 Workbook", XLSX: "Excel Workbook" }, supportedImageExtensions: ["png", "jpg", "jpeg", "gif", "tif", "tiff", "bmp", "png", "psd", "psp", "svg"], supportedVideoExtensions: ["ogg", "mp4", "webm"] }, _a56 = ["jpeg", "jpg", "png", "tiff", "bmp", "gif", "pdf", "txt", "doc", "docx", "ppt", "pptx", "xls", "xlsx", "zip", "rar", "7zip", "gzip"];
  var $g = null;
  const Pa = console;
  _g = class {
    static getItemIndex(g, B) {
      return B.indexOf(g);
    }
    static isImageFile(g) {
      const B = _g.getExtension(g).toLowerCase();
      return _g.filterImage(B);
    }
    static getExtension(g) {
      return g.substring(g.lastIndexOf(".") + 1).toUpperCase();
    }
    static filterImage(g) {
      return _g.arrayContains(g.toLowerCase(), xa.supportedImageExtensions);
    }
    static arrayContains(g, B) {
      return _g.getItemIndex(g, B) > -1;
    }
    static whiteListed(g, B) {
      if (g || (g = "unknown"), g = g.toLowerCase(), g === "unknown") return true;
      if ($g == null) {
        var Q = B;
        Q && Q.extensionWhitelist && Array.isArray(Q.extensionWhitelist) ? ($g = Q.extensionWhitelist, Pa.warn("DEPRECATED: please use allowlist and denylist instead of whitelist and blacklist.")) : Q && Q.extensionAllowlist && Array.isArray(Q.extensionAllowlist) ? $g = Q.extensionAllowlist : $g = _a56;
      }
      return $g.indexOf(g) > -1;
    }
  }, kg = class {
    static getValidatorObj(g) {
      const B = {};
      return kg.hasValue(g) && g.fieldValidator && g.fieldValidator.validationFunc && g.fieldValidator.validationMsg && (B.validationFunc = new Function("value", g.fieldValidator.validationFunc), B.validationMsg = g.fieldValidator.validationMsg, B.name = g.fieldValidator.name), B;
    }
    static hasValidateFunc(g) {
      return !!kg.getValidatorObj(g).validationFunc;
    }
    static validateFieldValue(g) {
      let B = false;
      const Q = kg.getValidatorObj(g);
      if (Q.validationFunc && g.fieldValue) {
        const t = Q.validationFunc;
        B = t(g.fieldValue);
      }
      return B;
    }
    static validateField(g, B) {
      let Q = true;
      if (g.validationFunc) {
        const t = g.validationFunc;
        Q = t(B);
      }
      return Q === false ? g.name : null;
    }
    static hasValue(g) {
      return g !== null && typeof g < "u" && g !== "";
    }
    static validateMinLength(g, B) {
      return kg.hasValue(g) && g.length >= B;
    }
    static validateMaxLength(g, B) {
      return !g || kg.hasValue(g) && g.length <= B;
    }
  };
  let VE;
  Xn2 = { registerHelper: (g) => {
    g.registerHelper({ eq: function(B, Q) {
      return B === Q;
    }, ne: function(B, Q) {
      return B !== Q;
    }, lt: function(B, Q) {
      return B < Q;
    }, gt: function(B, Q) {
      return B > Q;
    }, lte: function(B, Q) {
      return B <= Q;
    }, gte: function(B, Q) {
      return B >= Q;
    }, and: function(B, Q) {
      return B && Q;
    }, or: function(B, Q) {
      return B || Q;
    } });
  } }, VE = console, Zn2 = class {
    static constructFileReferenceDocument(g, B, Q, t, n) {
      var e;
      !dA.isEmpty(Q) && Q !== "undefined" ? e = Q : t && !dA.isEmpty(t.defaultTemplateId) && (e = t.defaultTemplateId);
      var a = t.relatedDocumentField, o = t.fileUploaderField;
      if (e == null || a == null || o == null) {
        var u2 = "Invalid configuration values for generating reference document.";
        VE.error(u2), n(new Error(u2));
      } else {
        var s = { systemHeader: { systemType: K.SYSTEM_TYPE_FILE_REFERENCE, templateId: e } };
        s[o] = [g];
        var p = B.name != null && B.name !== "undefined" ? B.name : B.documentId;
        s[a] = [{ documentId: B.documentId, name: p }], n(null, s);
      }
    }
  }, Ao = class {
    static processList(g, B) {
      let Q = Promise.resolve();
      return g.forEach(function(t) {
        Q = Q.then(function() {
          return B(t);
        });
      }), Q;
    }
    static processRange(g, B, Q) {
      let t = Promise.resolve();
      for (let n = g; n <= B; n++) t = t.then(function() {
        return Q(n);
      });
      return t;
    }
  };
  var kC = function(g, B) {
    return kC = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(Q, t) {
      Q.__proto__ = t;
    } || function(Q, t) {
      for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (Q[n] = t[n]);
    }, kC(g, B);
  };
  function AB(g, B) {
    if (typeof B != "function" && B !== null) throw new TypeError("Class extends value " + String(B) + " is not a constructor or null");
    kC(g, B);
    function Q() {
      this.constructor = g;
    }
    g.prototype = B === null ? Object.create(B) : (Q.prototype = B.prototype, new Q());
  }
  function dC(g) {
    var B = typeof Symbol == "function" && Symbol.iterator, Q = B && g[B], t = 0;
    if (Q) return Q.call(g);
    if (g && typeof g.length == "number") return { next: function() {
      return g && t >= g.length && (g = void 0), { value: g && g[t++], done: !g };
    } };
    throw new TypeError(B ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }
  function HB(g, B) {
    var Q = typeof Symbol == "function" && g[Symbol.iterator];
    if (!Q) return g;
    var t = Q.call(g), n, e = [], a;
    try {
      for (; (B === void 0 || B-- > 0) && !(n = t.next()).done; ) e.push(n.value);
    } catch (o) {
      a = { error: o };
    } finally {
      try {
        n && !n.done && (Q = t.return) && Q.call(t);
      } finally {
        if (a) throw a.error;
      }
    }
    return e;
  }
  function KB(g, B, Q) {
    if (Q || arguments.length === 2) for (var t = 0, n = B.length, e; t < n; t++) (e || !(t in B)) && (e || (e = Array.prototype.slice.call(B, 0, t)), e[t] = B[t]);
    return g.concat(e || Array.prototype.slice.call(B));
  }
  function HI(g) {
    return typeof g == "function";
  }
  function XE(g) {
    var B = function(t) {
      Error.call(t), t.stack = new Error().stack;
    }, Q = g(B);
    return Q.prototype = Object.create(Error.prototype), Q.prototype.constructor = Q, Q;
  }
  var SC = XE(function(g) {
    return function(B) {
      g(this), this.message = B ? B.length + ` errors occurred during unsubscription:
` + B.map(function(Q, t) {
        return t + 1 + ") " + Q.toString();
      }).join(`
  `) : "", this.name = "UnsubscriptionError", this.errors = B;
    };
  });
  function MC(g, B) {
    if (g) {
      var Q = g.indexOf(B);
      0 <= Q && g.splice(Q, 1);
    }
  }
  var qB = function() {
    function g(B) {
      this.initialTeardown = B, this.closed = false, this._parentage = null, this._finalizers = null;
    }
    return g.prototype.unsubscribe = function() {
      var B, Q, t, n, e;
      if (!this.closed) {
        this.closed = true;
        var a = this._parentage;
        if (a) if (this._parentage = null, Array.isArray(a)) try {
          for (var o = dC(a), u2 = o.next(); !u2.done; u2 = o.next()) {
            var s = u2.value;
            s.remove(this);
          }
        } catch (G) {
          B = { error: G };
        } finally {
          try {
            u2 && !u2.done && (Q = o.return) && Q.call(o);
          } finally {
            if (B) throw B.error;
          }
        }
        else a.remove(this);
        var p = this.initialTeardown;
        if (HI(p)) try {
          p();
        } catch (G) {
          e = G instanceof SC ? G.errors : [G];
        }
        var c = this._finalizers;
        if (c) {
          this._finalizers = null;
          try {
            for (var l = dC(c), i2 = l.next(); !i2.done; i2 = l.next()) {
              var f = i2.value;
              try {
                Ae(f);
              } catch (G) {
                e = e ?? [], G instanceof SC ? e = KB(KB([], HB(e)), HB(G.errors)) : e.push(G);
              }
            }
          } catch (G) {
            t = { error: G };
          } finally {
            try {
              i2 && !i2.done && (n = l.return) && n.call(l);
            } finally {
              if (t) throw t.error;
            }
          }
        }
        if (e) throw new SC(e);
      }
    }, g.prototype.add = function(B) {
      var Q;
      if (B && B !== this) if (this.closed) Ae(B);
      else {
        if (B instanceof g) {
          if (B.closed || B._hasParent(this)) return;
          B._addParent(this);
        }
        (this._finalizers = (Q = this._finalizers) !== null && Q !== void 0 ? Q : []).push(B);
      }
    }, g.prototype._hasParent = function(B) {
      var Q = this._parentage;
      return Q === B || Array.isArray(Q) && Q.includes(B);
    }, g.prototype._addParent = function(B) {
      var Q = this._parentage;
      this._parentage = Array.isArray(Q) ? (Q.push(B), Q) : Q ? [Q, B] : B;
    }, g.prototype._removeParent = function(B) {
      var Q = this._parentage;
      Q === B ? this._parentage = null : Array.isArray(Q) && MC(Q, B);
    }, g.prototype.remove = function(B) {
      var Q = this._finalizers;
      Q && MC(Q, B), B instanceof g && B._removeParent(this);
    }, g.EMPTY = function() {
      var B = new g();
      return B.closed = true, B;
    }(), g;
  }(), zE = qB.EMPTY;
  function $E(g) {
    return g instanceof qB || g && "closed" in g && HI(g.remove) && HI(g.add) && HI(g.unsubscribe);
  }
  function Ae(g) {
    HI(g) ? g() : g.unsubscribe();
  }
  var Ie = { onUnhandledError: null, onStoppedNotification: null, Promise: void 0, useDeprecatedSynchronousErrorHandling: false, useDeprecatedNextContext: false }, RC = { setTimeout: function(g, B) {
    for (var Q = [], t = 2; t < arguments.length; t++) Q[t - 2] = arguments[t];
    var n = RC.delegate;
    return n != null && n.setTimeout ? n.setTimeout.apply(n, KB([g, B], HB(Q))) : setTimeout.apply(void 0, KB([g, B], HB(Q)));
  }, clearTimeout: function(g) {
    var B = RC.delegate;
    return ((B == null ? void 0 : B.clearTimeout) || clearTimeout)(g);
  }, delegate: void 0 };
  function Wa(g) {
    RC.setTimeout(function() {
      throw g;
    });
  }
  function ge() {
  }
  function TB(g) {
    g();
  }
  var Be = function(g) {
    AB(B, g);
    function B(Q) {
      var t = g.call(this) || this;
      return t.isStopped = false, Q ? (t.destination = Q, $E(Q) && Q.add(t)) : t.destination = Xa, t;
    }
    return B.create = function(Q, t, n) {
      return new LC(Q, t, n);
    }, B.prototype.next = function(Q) {
      this.isStopped || this._next(Q);
    }, B.prototype.error = function(Q) {
      this.isStopped || (this.isStopped = true, this._error(Q));
    }, B.prototype.complete = function() {
      this.isStopped || (this.isStopped = true, this._complete());
    }, B.prototype.unsubscribe = function() {
      this.closed || (this.isStopped = true, g.prototype.unsubscribe.call(this), this.destination = null);
    }, B.prototype._next = function(Q) {
      this.destination.next(Q);
    }, B.prototype._error = function(Q) {
      try {
        this.destination.error(Q);
      } finally {
        this.unsubscribe();
      }
    }, B.prototype._complete = function() {
      try {
        this.destination.complete();
      } finally {
        this.unsubscribe();
      }
    }, B;
  }(qB), ja = Function.prototype.bind;
  function FC(g, B) {
    return ja.call(g, B);
  }
  var Za = function() {
    function g(B) {
      this.partialObserver = B;
    }
    return g.prototype.next = function(B) {
      var Q = this.partialObserver;
      if (Q.next) try {
        Q.next(B);
      } catch (t) {
        OB(t);
      }
    }, g.prototype.error = function(B) {
      var Q = this.partialObserver;
      if (Q.error) try {
        Q.error(B);
      } catch (t) {
        OB(t);
      }
      else OB(B);
    }, g.prototype.complete = function() {
      var B = this.partialObserver;
      if (B.complete) try {
        B.complete();
      } catch (Q) {
        OB(Q);
      }
    }, g;
  }(), LC = function(g) {
    AB(B, g);
    function B(Q, t, n) {
      var e = g.call(this) || this, a;
      if (HI(Q) || !Q) a = { next: Q ?? void 0, error: t ?? void 0, complete: n ?? void 0 };
      else {
        var o;
        e && Ie.useDeprecatedNextContext ? (o = Object.create(Q), o.unsubscribe = function() {
          return e.unsubscribe();
        }, a = { next: Q.next && FC(Q.next, o), error: Q.error && FC(Q.error, o), complete: Q.complete && FC(Q.complete, o) }) : a = Q;
      }
      return e.destination = new Za(a), e;
    }
    return B;
  }(Be);
  function OB(g) {
    Wa(g);
  }
  function Va(g) {
    throw g;
  }
  var Xa = { closed: true, next: ge, error: Va, complete: ge }, za = function() {
    return typeof Symbol == "function" && Symbol.observable || "@@observable";
  }();
  function $a(g) {
    return g;
  }
  function As(g) {
    return g.length === 0 ? $a : g.length === 1 ? g[0] : function(B) {
      return g.reduce(function(Q, t) {
        return t(Q);
      }, B);
    };
  }
  var Qe = function() {
    function g(B) {
      B && (this._subscribe = B);
    }
    return g.prototype.lift = function(B) {
      var Q = new g();
      return Q.source = this, Q.operator = B, Q;
    }, g.prototype.subscribe = function(B, Q, t) {
      var n = this, e = gs(B) ? B : new LC(B, Q, t);
      return TB(function() {
        var a = n, o = a.operator, u2 = a.source;
        e.add(o ? o.call(e, u2) : u2 ? n._subscribe(e) : n._trySubscribe(e));
      }), e;
    }, g.prototype._trySubscribe = function(B) {
      try {
        return this._subscribe(B);
      } catch (Q) {
        B.error(Q);
      }
    }, g.prototype.forEach = function(B, Q) {
      var t = this;
      return Q = Ce(Q), new Q(function(n, e) {
        var a = new LC({ next: function(o) {
          try {
            B(o);
          } catch (u2) {
            e(u2), a.unsubscribe();
          }
        }, error: e, complete: n });
        t.subscribe(a);
      });
    }, g.prototype._subscribe = function(B) {
      var Q;
      return (Q = this.source) === null || Q === void 0 ? void 0 : Q.subscribe(B);
    }, g.prototype[za] = function() {
      return this;
    }, g.prototype.pipe = function() {
      for (var B = [], Q = 0; Q < arguments.length; Q++) B[Q] = arguments[Q];
      return As(B)(this);
    }, g.prototype.toPromise = function(B) {
      var Q = this;
      return B = Ce(B), new B(function(t, n) {
        var e;
        Q.subscribe(function(a) {
          return e = a;
        }, function(a) {
          return n(a);
        }, function() {
          return t(e);
        });
      });
    }, g.create = function(B) {
      return new g(B);
    }, g;
  }();
  function Ce(g) {
    var B;
    return (B = g ?? Ie.Promise) !== null && B !== void 0 ? B : Promise;
  }
  function Is(g) {
    return g && HI(g.next) && HI(g.error) && HI(g.complete);
  }
  function gs(g) {
    return g && g instanceof Be || Is(g) && $E(g);
  }
  var Bs = XE(function(g) {
    return function() {
      g(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
    };
  }), te = function(g) {
    AB(B, g);
    function B() {
      var Q = g.call(this) || this;
      return Q.closed = false, Q.currentObservers = null, Q.observers = [], Q.isStopped = false, Q.hasError = false, Q.thrownError = null, Q;
    }
    return B.prototype.lift = function(Q) {
      var t = new Ee(this, this);
      return t.operator = Q, t;
    }, B.prototype._throwIfClosed = function() {
      if (this.closed) throw new Bs();
    }, B.prototype.next = function(Q) {
      var t = this;
      TB(function() {
        var n, e;
        if (t._throwIfClosed(), !t.isStopped) {
          t.currentObservers || (t.currentObservers = Array.from(t.observers));
          try {
            for (var a = dC(t.currentObservers), o = a.next(); !o.done; o = a.next()) {
              var u2 = o.value;
              u2.next(Q);
            }
          } catch (s) {
            n = { error: s };
          } finally {
            try {
              o && !o.done && (e = a.return) && e.call(a);
            } finally {
              if (n) throw n.error;
            }
          }
        }
      });
    }, B.prototype.error = function(Q) {
      var t = this;
      TB(function() {
        if (t._throwIfClosed(), !t.isStopped) {
          t.hasError = t.isStopped = true, t.thrownError = Q;
          for (var n = t.observers; n.length; ) n.shift().error(Q);
        }
      });
    }, B.prototype.complete = function() {
      var Q = this;
      TB(function() {
        if (Q._throwIfClosed(), !Q.isStopped) {
          Q.isStopped = true;
          for (var t = Q.observers; t.length; ) t.shift().complete();
        }
      });
    }, B.prototype.unsubscribe = function() {
      this.isStopped = this.closed = true, this.observers = this.currentObservers = null;
    }, Object.defineProperty(B.prototype, "observed", { get: function() {
      var Q;
      return ((Q = this.observers) === null || Q === void 0 ? void 0 : Q.length) > 0;
    }, enumerable: false, configurable: true }), B.prototype._trySubscribe = function(Q) {
      return this._throwIfClosed(), g.prototype._trySubscribe.call(this, Q);
    }, B.prototype._subscribe = function(Q) {
      return this._throwIfClosed(), this._checkFinalizedStatuses(Q), this._innerSubscribe(Q);
    }, B.prototype._innerSubscribe = function(Q) {
      var t = this, n = this, e = n.hasError, a = n.isStopped, o = n.observers;
      return e || a ? zE : (this.currentObservers = null, o.push(Q), new qB(function() {
        t.currentObservers = null, MC(o, Q);
      }));
    }, B.prototype._checkFinalizedStatuses = function(Q) {
      var t = this, n = t.hasError, e = t.thrownError, a = t.isStopped;
      n ? Q.error(e) : a && Q.complete();
    }, B.prototype.asObservable = function() {
      var Q = new Qe();
      return Q.source = this, Q;
    }, B.create = function(Q, t) {
      return new Ee(Q, t);
    }, B;
  }(Qe), Ee = function(g) {
    AB(B, g);
    function B(Q, t) {
      var n = g.call(this) || this;
      return n.destination = Q, n.source = t, n;
    }
    return B.prototype.next = function(Q) {
      var t, n;
      (n = (t = this.destination) === null || t === void 0 ? void 0 : t.next) === null || n === void 0 || n.call(t, Q);
    }, B.prototype.error = function(Q) {
      var t, n;
      (n = (t = this.destination) === null || t === void 0 ? void 0 : t.error) === null || n === void 0 || n.call(t, Q);
    }, B.prototype.complete = function() {
      var Q, t;
      (t = (Q = this.destination) === null || Q === void 0 ? void 0 : Q.complete) === null || t === void 0 || t.call(Q);
    }, B.prototype._subscribe = function(Q) {
      var t, n;
      return (n = (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(Q)) !== null && n !== void 0 ? n : zE;
    }, B;
  }(te), Qs = function(g) {
    AB(B, g);
    function B(Q) {
      var t = g.call(this) || this;
      return t._value = Q, t;
    }
    return Object.defineProperty(B.prototype, "value", { get: function() {
      return this.getValue();
    }, enumerable: false, configurable: true }), B.prototype._subscribe = function(Q) {
      var t = g.prototype._subscribe.call(this, Q);
      return !t.closed && Q.next(this._value), t;
    }, B.prototype.getValue = function() {
      var Q = this, t = Q.hasError, n = Q.thrownError, e = Q._value;
      if (t) throw n;
      return this._throwIfClosed(), e;
    }, B.prototype.next = function(Q) {
      g.prototype.next.call(this, this._value = Q);
    }, B;
  }(te);
  IE = class {
  }, AE = class {
    constructor(g, B) {
      this.uploaded = g, this.total = B;
    }
    percentage() {
      return this.total === void 0 ? null : this.uploaded / this.total * 100;
    }
  }, JQ = class {
    constructor(g) {
      this.response = g;
    }
  }, xn = class {
    constructor(g, B) {
      this.file = g, this.documentId = B, this.fileProviderService = window.FormbirdServiceInjector.get("FileProviderService"), this.subject = new Qs(void 0), this.upload();
    }
    upload() {
      const g = { fileNo: gE.generateId(), file: this.file, documentId: this.documentId }, B = this.fileProviderService.uploadFile(g);
      this.sub = B.subscribe((Q) => {
        switch (Q.type) {
          case 0:
            this.subject.next(new IE());
            break;
          case 4:
            this.subject.next(new JQ(Q.body)), this.subject.complete();
            break;
          case 1:
            this.subject.next(new AE(Q.loaded, Q.total));
            break;
        }
      }, (Q) => {
        this.subject.error(Q);
      });
    }
    get observable() {
      return this.subject.asObservable();
    }
    destroy() {
      this.sub.unsubscribe(), this.subject.complete();
    }
    asPromise() {
      return new Promise((g, B) => {
        this.observable.subscribe((Q) => {
          Q instanceof JQ && g(Q.response);
        }, (Q) => B(Q));
      });
    }
  };
}))();

// projects/formbird-mapping/src/lib/scl-util-map.service.ts
var import_lodash2 = __toESM(require_lodash());
var _SclUtilMapService = class _SclUtilMapService {
  constructor() {
    this.sclUtilDate = new SclUtilDateService();
    this.formatDimension = function(value, dimensionsUnit, dimensionsPrecision) {
      if (dimensionsUnit === "km") {
        value = value / 1e3;
      } else if (dimensionsUnit === "mm") {
        value = value * 1e3;
      }
      const factor = Math.pow(10, dimensionsPrecision);
      const valuePrecision = Math.round(value * factor) / factor;
      return `${valuePrecision} ${dimensionsUnit}`;
    };
  }
  isContainAsset(asset, assets) {
    if (!assets) {
      return false;
    }
    for (let i2 = 0; i2 < assets.length; i2++) {
      const ass = assets[i2];
      if (ass.properties.linkAssets[0].documentId === asset.properties.linkAssets[0].documentId) {
        return true;
      }
    }
    return false;
  }
  isContainAssetWithType(asset, features) {
    if (!features) {
      return false;
    }
    for (let i2 = 0; i2 < features.length; i2++) {
      const ass = features[i2];
      if (ass.properties.linkAssets[0].documentId === asset.properties.linkAssets[0].documentId) {
        return true;
      }
    }
    return false;
  }
  containLayer(item, items) {
    if (!items) {
      return false;
    }
    for (let i2 = 0; i2 < items.length; i2++) {
      const pos = items[i2];
      if (pos === "All" || pos === "all") {
        return false;
      }
    }
    for (let i2 = 0; i2 < items.length; i2++) {
      const pos = items[i2];
      if (item === pos) {
        return true;
      }
    }
    return false;
  }
  removeItemFromMap(id2, sourceVector) {
    const fea = sourceVector.getFeatureById(id2);
    if (fea) {
      sourceVector.removeFeature(fea);
    }
  }
  getIdxAssetByType(features, type) {
    for (let i2 = 0; i2 < features.length; i2++) {
      if (features[i2].properties.type === type) {
        return i2;
      }
    }
    return -1;
  }
  getQueryGeo(coor, coorNext, filter2, geoJsonField, hasBoundingBox) {
    let res;
    let filterObj;
    if (typeof filter2 === "string") {
      res = filter2.replace(/'/g, '"');
      filterObj = JSON.parse(res);
    } else {
      filterObj = filter2;
    }
    let command = "";
    if (geoJsonField) {
      command = geoJsonField + ".features.geometry";
    } else {
      command = "features.geometry";
    }
    const feature = {};
    feature[command] = {
      shape: {
        type: "envelope",
        coordinates: [coor, coorNext]
      },
      relation: "intersects"
    };
    const geoshape = {
      geo_shape: feature
    };
    if (hasBoundingBox) {
      if (filterObj?.query?.bool?.filter) {
        filterObj.query.bool.filter.push(geoshape);
      } else if (filterObj?.query?.bool?.must) {
        filterObj.query.bool.must.push(geoshape);
      }
    }
    const query = JSON.stringify(filterObj);
    return query;
  }
  getPointFeature(location2, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName) {
    const graphPoint = new Feature_default2(new Point_default(location2));
    const properties2 = {
      icon: image,
      name,
      id: id2
    };
    if (color2) {
      properties2.color = color2;
    }
    if (tooltip) {
      properties2.tooltip = tooltip;
    }
    if (layerDisplayOnly) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (type) {
      properties2.type = type;
    }
    if (anchor2) {
      properties2.anchor = anchor2;
    }
    if (layerName) {
      properties2.layerName = layerName;
    }
    if (relatedAsset) {
      for (const field in relatedAsset) {
        if (relatedAsset.hasOwnProperty(field)) {
          const value = relatedAsset[field];
          properties2[field] = value;
        }
      }
    }
    const style2 = new Style_default({
      image: new Icon_default({
        anchor: [0.5, 0.5],
        anchorXUnits: "fraction",
        anchorYUnits: "fraction",
        opacity: 1,
        scale: 1,
        src: image
      })
    });
    graphPoint.setProperties(properties2);
    graphPoint.setStyle(style2);
    return graphPoint;
  }
  getLineFeature(coordinates2, id2, name, EPSG, layer, relatedAsset, color2, popup, layerName, layerDisplayOnly, lineDash) {
    const feature = this.parseToLine(coordinates2, id2, EPSG);
    const typeFeature = "line";
    const lineWidth = layer.lineWidth !== void 0 ? layer.lineWidth : 4;
    const lineCap = layer.lineCap !== void 0 ? layer.lineCap : "round";
    const properties2 = {
      name,
      color: color2,
      id: id2,
      tooltip: popup,
      typeFeature,
      lineWidth,
      lineCap
    };
    if (lineDash) {
      properties2.lineDash = lineDash;
    }
    if (layerName) {
      properties2.layerName = layerName;
    }
    if (layerDisplayOnly) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (relatedAsset) {
      for (const field in relatedAsset) {
        if (relatedAsset.hasOwnProperty(field)) {
          properties2[field] = relatedAsset[field];
        }
      }
    }
    feature.setProperties(properties2);
    return feature;
  }
  parseRelatedField(source, relatedFields, primaryFields, secondaryFields) {
    const relatedAsset = {};
    if (primaryFields) {
      relatedAsset.primaryFields = {};
      for (const field in primaryFields) {
        if (primaryFields.hasOwnProperty(field)) {
          const fieldAsset = primaryFields[field];
          relatedAsset.primaryFields[field] = source[fieldAsset];
        }
      }
    }
    if (secondaryFields) {
      relatedAsset.secondaryFields = {};
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const fieldAsset = relatedFields[field];
          relatedAsset.secondaryFields[field] = source[fieldAsset];
        }
      }
    }
    if (relatedFields) {
      relatedAsset.mainFields = {};
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const fieldAsset = relatedFields[field];
          relatedAsset.mainFields[field] = source[fieldAsset];
        }
      }
    }
    return relatedAsset;
  }
  parseToLine(coor, id2, toEPSG) {
    const array2 = [];
    for (let i2 = 0; i2 < coor.length; i2++) {
      const coordinate = coor[i2];
      const coordi = transform([parseFloat(coordinate[0]), parseFloat(coordinate[1])], "EPSG:4326", toEPSG);
      array2.push(coordi);
    }
    const lineFeature = new Feature_default2(new LineString_default(array2));
    lineFeature.setId(id2);
    return lineFeature;
  }
  queryLastEvent(imei) {
    const filter2 = {
      query: {
        bool: {
          filter: [
            {
              match: {
                "features.properties.imei": {
                  query: imei
                }
              }
            }
          ]
        }
      },
      /*"sort": [
          {
              "features.properties.eventDate": "desc"
          }
      ],*/
      size: 1
    };
    console.log("Query get last event is " + JSON.stringify(filter2));
    return filter2;
  }
  parseAVLData(data) {
    const feature = data.features[0];
    const lat = feature.geometry.coordinates[0];
    const lon = feature.geometry.coordinates[1];
    const properties2 = feature.properties;
    const object = {};
    object.latitude = lat;
    object.longitude = lon;
    const currentDate = new Date(properties2.eventDate);
    object.eventDate = currentDate;
    object.speedKPH = parseInt(properties2.speedKPH, 10);
    let streetNo;
    let street;
    let town;
    let postcode;
    let state2;
    let country;
    if (properties2 && properties2.address) {
      streetNo = properties2.address.streetNo;
      street = properties2.address.street;
      town = properties2.address.town;
      postcode = properties2.address.postcode;
      state2 = properties2.address.state;
      country = properties2.address.country;
    }
    let address = "";
    if (streetNo) {
      address = streetNo;
    }
    if (street) {
      address += ", " + street;
    }
    if (state2) {
      address += ", " + state2;
    }
    if (town) {
      address += ", " + town;
    }
    if (postcode) {
      address += ", " + postcode;
    }
    if (country) {
      address += ", " + country;
    }
    if (address) {
      object.address = address;
    }
    return object;
  }
  parseAVLData_New(item) {
    const feature = item.locationGeo.features[0];
    const properties2 = feature.properties;
    const currentDate = /* @__PURE__ */ new Date();
    const newEventDate = new Date(item.eventDate);
    const obj = {};
    obj.id = item._id;
    obj.imei = item.imeis[0];
    obj.longitude = item.locationGeo.features[0].geometry.coordinates[0];
    obj.latitude = item.locationGeo.features[0].geometry.coordinates[1];
    obj.speedKPH = item.speedKPH;
    obj.heading = item.heading;
    obj.eventDate = item.eventDate;
    obj.address = "";
    return obj;
  }
  checkAVLSpeed(beginning, speedKPH, heading, speedA, speedB, speedC, speedD, speedE) {
    let result = beginning;
    let exist = false;
    if (speedKPH <= speedA) {
      result += "_red_dot";
      exist = true;
    } else if (speedA < speedKPH && speedKPH <= speedB) {
      result += "_orange";
      if (SclMapConstantService.HEADING_THRESHOLD_H7 < heading || heading <= SclMapConstantService.HEADING_THRESHOLD_H0) {
        result += SclMapConstantService.AVL_SPEED_H0;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H0 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H1) {
        result += SclMapConstantService.AVL_SPEED_H1;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H1 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H2) {
        result += SclMapConstantService.AVL_SPEED_H2;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H2 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H3) {
        result += SclMapConstantService.AVL_SPEED_H3;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H3 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H4) {
        result += SclMapConstantService.AVL_SPEED_H4;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H4 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H5) {
        result += SclMapConstantService.AVL_SPEED_H5;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H5 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H6) {
        result += SclMapConstantService.AVL_SPEED_H6;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H6 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H7) {
        result += SclMapConstantService.AVL_SPEED_H7;
      }
      exist = true;
    } else if (speedB < speedKPH && speedKPH <= speedC) {
      result += "_green";
      if (SclMapConstantService.HEADING_THRESHOLD_H7 < heading || heading <= SclMapConstantService.HEADING_THRESHOLD_H0) {
        result += SclMapConstantService.AVL_SPEED_H0;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H0 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H1) {
        result += SclMapConstantService.AVL_SPEED_H1;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H1 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H2) {
        result += SclMapConstantService.AVL_SPEED_H2;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H2 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H3) {
        result += SclMapConstantService.AVL_SPEED_H3;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H3 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H4) {
        result += SclMapConstantService.AVL_SPEED_H4;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H4 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H5) {
        result += SclMapConstantService.AVL_SPEED_H5;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H5 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H6) {
        result += SclMapConstantService.AVL_SPEED_H6;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H6 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H7) {
        result += SclMapConstantService.AVL_SPEED_H7;
      }
      exist = true;
    } else if (speedC < speedKPH && speedKPH <= speedD) {
      result += "_black";
      if (SclMapConstantService.HEADING_THRESHOLD_H7 < heading || heading <= SclMapConstantService.HEADING_THRESHOLD_H0) {
        result += SclMapConstantService.AVL_SPEED_H0;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H0 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H1) {
        result += SclMapConstantService.AVL_SPEED_H1;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H1 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H2) {
        result += SclMapConstantService.AVL_SPEED_H2;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H2 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H3) {
        result += SclMapConstantService.AVL_SPEED_H3;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H3 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H4) {
        result += SclMapConstantService.AVL_SPEED_H4;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H4 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H5) {
        result += SclMapConstantService.AVL_SPEED_H5;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H5 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H6) {
        result += SclMapConstantService.AVL_SPEED_H6;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H6 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H7) {
        result += SclMapConstantService.AVL_SPEED_H7;
      }
      exist = true;
    } else if (speedD < speedKPH && speedKPH <= speedE) {
      result += "_yellow";
      if (SclMapConstantService.HEADING_THRESHOLD_H7 < heading || heading <= SclMapConstantService.HEADING_THRESHOLD_H0) {
        result += SclMapConstantService.AVL_SPEED_H0;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H0 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H1) {
        result += SclMapConstantService.AVL_SPEED_H1;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H1 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H2) {
        result += SclMapConstantService.AVL_SPEED_H2;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H2 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H3) {
        result += SclMapConstantService.AVL_SPEED_H3;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H3 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H4) {
        result += SclMapConstantService.AVL_SPEED_H4;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H4 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H5) {
        result += SclMapConstantService.AVL_SPEED_H5;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H5 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H6) {
        result += SclMapConstantService.AVL_SPEED_H6;
      } else if (SclMapConstantService.HEADING_THRESHOLD_H6 < heading && heading <= SclMapConstantService.HEADING_THRESHOLD_H7) {
        result += SclMapConstantService.AVL_SPEED_H7;
      }
      exist = true;
    }
    result += ".png";
    if (exist === false) {
      result = "styles/images/pp/pin30_black.png";
    }
    return result;
  }
  parseAVLTracePoint(point, timeFormat, imei) {
    const coor = transform([parseFloat(point.longitude), parseFloat(point.latitude)], "EPSG:4326", "EPSG:3857");
    const imeiContent = "<div><bold>IMEI : </bold> " + imei + "</div>";
    let address = "";
    if (typeof point.address !== "undefined") {
      address = "<div><bold>Address : </bold> " + point.address + "</div>";
    }
    const gps = "<div><bold>GPS : </bold> " + point.latitude.toFixed(4) + "/" + point.longitude.toFixed(4) + "</div>";
    const eventDate = new Date(point.eventDate);
    const dateFormat = this.sclUtilDate.parseDate(eventDate, timeFormat);
    const dateContent = "<div><bold>Time : </bold> " + dateFormat + "</div>";
    const speedContent = "<div><bold>Speed : </bold> " + point.speedKPH + "</div>";
    const tooltip = imeiContent + address + gps + dateContent + speedContent;
    const propertiesData = {
      "address": tooltip,
      "icon": point.icon
    };
    const pointFeature = new Feature_default2(new Point_default(coor));
    pointFeature.setProperties(propertiesData);
    return pointFeature;
  }
  constructQueryVehicleData(imeis, doc) {
    const feature = {};
    feature.imei = imeis;
    const terms = {
      terms: feature
    };
    const match2 = {
      match: {
        appTags: {
          query: "avlVehicle"
        }
      }
    };
    const filter2 = {
      query: {
        bool: {
          filter: [terms, match2]
        }
      }
    };
    const query = JSON.stringify(filter2);
    const options = {};
    options.filter = query;
    options.document = doc;
    return options;
  }
  constructQueryGeoZones(filter2, doc) {
    const res = filter2.replace(/'/g, '"');
    const filterObj = JSON.parse(res);
    const query = JSON.stringify(filterObj);
    const options = {};
    options.filter = query;
    options.document = doc;
    return options;
  }
  constructQueryDocument(docIds, doc) {
    const documentId = {};
    documentId.documentId = docIds;
    const terms = {
      terms: documentId
    };
    const filter2 = {
      query: {
        bool: {
          filter: [terms]
        }
      }
    };
    const query = JSON.stringify(filter2);
    const options = {};
    options.filter = query;
    options.document = doc;
    return options;
  }
  queryVehicleInfo(imei) {
    const filter2 = {
      query: {
        bool: {
          filter: [
            {
              match: {
                imei: {
                  query: imei
                }
              }
            }
          ]
        }
      }
    };
    const query = JSON.stringify(filter2);
    return query;
  }
  parseAVLQuery(date, imei, numOffSet) {
    const startDate = new Date(date);
    startDate.setHours(0);
    startDate.setMinutes(0);
    startDate.setSeconds(0);
    startDate.setHours(startDate.getHours() + numOffSet);
    const endDate = new Date(date);
    endDate.setHours(23);
    endDate.setMinutes(59);
    endDate.setSeconds(59);
    endDate.setHours(endDate.getHours() + numOffSet);
    const format = "YYYY-MM-DD HH:mm:ss";
    const startDateFormat = this.sclUtilDate.parseDate(startDate, format);
    const endDateFormat = this.sclUtilDate.parseDate(endDate, format);
    const filter2 = {
      query: {
        bool: {
          filter: [
            {
              match: {
                "features.properties.imei": {
                  query: imei
                }
              }
            },
            {
              range: {
                "features.properties.eventDate": {
                  gte: startDateFormat,
                  lte: endDateFormat,
                  format: "yyyy-MM-dd HH:mm:ss"
                }
              }
            }
          ]
        }
      },
      sort: [
        {
          "features.properties.eventDate": "asc"
        }
      ]
    };
    const query = JSON.stringify(filter2);
    return query;
  }
  positionView(view, lng, lat, zoom, EPSG) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lng = typeof lng !== "undefined" ? lng : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    view.setCenter(transform([lng, lat], "EPSG:4326", EPSG));
    view.setZoom(zoom);
    return view;
  }
  setView(lng, lat, zoom, EPSG, minResolution, maxResolution) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lng = typeof lng !== "undefined" ? lng : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    let view;
    if (minResolution && maxResolution) {
      view = new View_default({
        projection: EPSG,
        center: transform([lng, lat], "EPSG:4326", EPSG),
        zoom,
        minResolution,
        maxResolution
      });
    } else {
      view = new View_default({
        projection: EPSG,
        center: transform([lng, lat], "EPSG:4326", EPSG),
        zoom,
        minZoom: 2
      });
    }
    return view;
  }
  createAddressQuery(geoJsonField) {
    const filter2 = {
      query: {
        bool: {
          filter: [
            { exists: { field: geoJsonField } },
            { term: { appTags: "property" } }
          ]
        }
      }
    };
    console.log("The Query Address is " + JSON.stringify(filter2));
    return filter2;
  }
  getDocument(result) {
    const prefix = "_source";
    let hold = result;
    if (result && prefix) {
      const split = prefix.split(".");
      for (let i2 = 0; i2 < split.length; i2++) {
        if (split[i2]) {
          if (hold[split[i2]]) {
            hold = hold[split[i2]];
          } else {
            hold = null;
            break;
          }
        } else {
          break;
        }
      }
    }
    return hold;
  }
  fit(ConfigService3, sourceVector, view, map2, maxZoomComponent) {
    let maxZoom = 15;
    if (maxZoomComponent) {
      maxZoom = maxZoomComponent;
    } else {
      if (ConfigService3.clientConfig().maxZoomLevel) {
        maxZoom = ConfigService3.clientConfig().maxZoomLevel;
      }
    }
    const featuresExtent = createEmpty();
    sourceVector.getFeatures().forEach(function(feature) {
      extend2(featuresExtent, feature.getGeometry().getExtent());
    });
    view.fit(featuresExtent, map2.getSize(), { maxZoom });
  }
  initializeMap(ConfigService3, controls, target, view, interactions, disableMouseWheel, mapLayers, multiLayers) {
    let sourceXYZ = [];
    if (multiLayers && multiLayers.length > 0) {
      sourceXYZ = multiLayers;
    } else {
      if (mapLayers) {
        sourceXYZ.push(mapLayers);
      } else {
        const optionOSM = {
          url: ConfigService3.clientConfig().openLayers.tileServer.url,
          crossOrigin: ConfigService3.clientConfig().openLayers.tileServer.crossOrigin,
          wrapDateLine: false,
          // not support 6.15.1
          wrapX: false,
          noWrap: true
          // not support 6.15.1
        };
        const tile = new Tile_default4({
          source: new OSM_default(optionOSM)
        });
        sourceXYZ.push(tile);
      }
    }
    let mouseWheel = true;
    if (disableMouseWheel) {
      mouseWheel = false;
    }
    const map2 = new Map_default2({
      controls: defaults2().extend([
        new FullScreen_default()
      ]),
      interactions: defaults3({ mouseWheelZoom: mouseWheel }),
      layers: sourceXYZ,
      target,
      view
    });
    if (controls.length) {
      for (let i2 = 0; i2 < controls.length; i2++) {
        map2.addControl(controls[i2]);
      }
    }
    if (interactions.length) {
      for (let i2 = 0; i2 < interactions.length; i2++) {
        map2.addInteraction(interactions[i2]);
      }
    }
    return map2;
  }
  initializeMapDefault(controls, target, view, interactions, disableMouseWheel, mapLayers, multiLayers) {
    let sourceXYZ = [];
    if (multiLayers && multiLayers.length > 0) {
      sourceXYZ = multiLayers;
    } else {
      if (mapLayers) {
        sourceXYZ.push(mapLayers);
      } else {
        const optionOSM = {
          wrapDateLine: false,
          // not support 6.15.1
          wrapX: false,
          noWrap: true
          // not support 6.15.1
        };
        const tile = new Tile_default4({
          source: new OSM_default(optionOSM)
        });
        sourceXYZ.push(tile);
      }
    }
    let mouseWheel = true;
    if (disableMouseWheel) {
      mouseWheel = false;
    }
    const map2 = new Map_default2({
      controls: defaults2().extend([
        new FullScreen_default()
      ]),
      interactions: defaults3({ mouseWheelZoom: mouseWheel }),
      layers: sourceXYZ,
      target,
      view
    });
    if (controls.length) {
      for (let i2 = 0; i2 < controls.length; i2++) {
        map2.addControl(controls[i2]);
      }
    }
    if (interactions.length) {
      for (let i2 = 0; i2 < interactions.length; i2++) {
        map2.addInteraction(interactions[i2]);
      }
    }
    return map2;
  }
  getPointStyle(color2, icon, imageAnchor, zIndex) {
    let zIn = 0;
    if (zIndex) {
      zIn = zIndex;
    }
    let pointColor = "green";
    if (color2) {
      pointColor = color2;
    }
    let image = new Circle_default({
      radius: 7,
      fill: new Fill_default({
        color: "#ffcc33"
      })
    });
    if (icon) {
      let anchor2 = [0.5, 0.5];
      if (imageAnchor) {
        anchor2 = imageAnchor;
      }
      image = new Icon_default({
        src: icon,
        anchor: anchor2
      });
    }
    const style2 = new Style_default({
      fill: new Fill_default({
        color: "rgba(255, 255, 255, 0.2)"
      }),
      stroke: new Stroke_default({
        color: pointColor,
        width: 2
      }),
      zIndex: zIn,
      image
    });
    return style2;
  }
  getLineStyle(color2, properties2) {
    let lineColor = "blue";
    if (color2) {
      lineColor = color2;
    }
    const style2 = new Style_default({
      image: new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: "#ffcc33"
        })
      })
    });
    const stroke = new Stroke_default({
      color: lineColor,
      width: 2
    });
    if (properties2) {
      if (properties2.lineWidth) {
        stroke.setWidth(properties2.lineWidth);
      }
      if (properties2.lineDash) {
        stroke.setLineDash(properties2.lineDash);
      }
      if (properties2.lineCap) {
        stroke.setLineCap(properties2.lineCap);
      }
    }
    style2.setStroke(stroke);
    let fillColor = "rgba(255, 255, 255, 0.2)";
    if (properties2 && properties2.fillColor) {
      color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      if (properties2.fillOpacity) {
        color2[3] = properties2.fillOpacity;
      }
      fillColor = color2;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    return style2;
  }
  getWrapLon(value) {
    const worlds = Math.floor((value + 180) / 360);
    return value - worlds * 360;
  }
  getGeocodeAddress(url, key, text, field) {
    let link = url + text;
    if (key) {
      link = link + "&key=" + key;
    }
    if (field) {
      if (field.country) {
        link = link + "&country=" + field.country;
      }
      if (field.language) {
        link = link + "&lang=" + field.language;
      }
    }
    return link;
  }
  getGoogleAddress(text, key) {
    const link = "https://maps.googleapis.com/maps/api/place/autocomplete/json?query=" + text + "&key=" + key;
    return link;
  }
  getGeocodeCoordinate(url, lat, lon, field, key) {
    let link = url + "?lat=" + lat + "&lon=" + lon + "&key=" + key + "&count=1";
    if (field) {
      if (field.country) {
        link = link + "&country=" + field.country;
      }
      if (field.language) {
        link = link + "&lang=" + field.language;
      }
    }
    return link;
  }
  getAllCoordinates(feature) {
    const coords = [];
    if (feature.geometry.type === "Polygon") {
      let k;
      for (k = 0; k < feature.geometry.coordinates[0].length; ++k) {
        coords.push(feature.geometry.coordinates[0][k]);
      }
    } else if (feature.geometry.type === "LineString") {
      let j;
      for (j = 0; j < feature.geometry.coordinates.length; ++j) {
        coords.push(feature.geometry.coordinates[j]);
      }
    } else if (feature.geometry.type === "Point") {
      if (feature.geometry.coordinates.length > 0) {
        coords.push(feature.geometry.coordinates);
      }
    } else if (feature.geometry.type === "MultiPolygon") {
      let k;
      for (k = 0; k < feature.geometry.coordinates.length; ++k) {
        const pol = feature.geometry.coordinates[k];
        let k1;
        for (k1 = 0; k1 < pol.length; ++k1) {
          const pol1 = pol[k1];
          if (pol1.length >= 3) {
            let k2;
            for (k2 = 0; k2 < pol1.length; ++k2) {
              coords.push(pol1[k2]);
            }
          }
        }
      }
    } else if (feature.geometry.type === "MultiLineString") {
      let k;
      for (k = 0; k < feature.geometry.coordinates.length; ++k) {
        const pol = feature.geometry.coordinates[k];
        if (pol.length >= 2) {
          let k1;
          for (k1 = 0; k1 < pol.length; ++k1) {
            coords.push(pol[k1]);
          }
        }
      }
    } else if (feature.geometry.type === "MultiPoint") {
      let k;
      for (k = 0; k < feature.geometry.coordinates.length; ++k) {
        coords.push(feature.geometry.coordinates[k]);
      }
    }
    return coords;
  }
  isValidFeature(f) {
    if (f.geometry.type === "LineString") {
      if (f.geometry.coordinates.length >= 2) {
        return true;
      }
    } else if (f.geometry.type === "Polygon") {
      if (f.geometry.coordinates.length >= 1 && f.geometry.coordinates[0].length >= 3) {
        return true;
      }
    } else if (f.geometry.type === "Point" && f.geometry.coordinates.length > 1) {
      return true;
    } else if (f.geometry.type === "MultiPoint" && f.geometry.coordinates.length > 1) {
      return true;
    } else if (f.geometry.type === "MultiLineString") {
      let k;
      for (k = 0; k < f.geometry.coordinates.length; ++k) {
        const pol = f.geometry.coordinates[k];
        if (pol.length < 2) {
          return false;
        }
      }
      return true;
    } else if (f.geometry.type === "MultiPolygon") {
      let k;
      for (k = 0; k < f.geometry.coordinates.length; ++k) {
        const pol = f.geometry.coordinates[k];
        let k1;
        for (k1 = 0; k1 < pol.length; ++k1) {
          const pol1 = pol[k1];
          if (pol1.length < 3) {
            return false;
          }
        }
      }
      return true;
    }
    return false;
  }
  transformEPSG(long, lat, from2, to) {
    const location2 = transform([parseFloat(long), parseFloat(lat)], from2, to);
    return location2;
  }
  transformCoordinate(coordinate, from2, to) {
    const location2 = transform(coordinate, from2, to);
    return location2;
  }
  parseCellTemplate(tmpl) {
    let str = "";
    let errStr = "";
    try {
      let hasUndefined = false;
      const tmplVars = tmpl.match(/{{.+?}}/g).map(function(data) {
        return data.slice(2, -2);
      });
      if (!tmplVars) {
        return tmpl;
      }
      for (let i = 0; i < tmplVars.length; i++) {
        const reg = "{{" + tmplVars[i] + "}}";
        if (eval(tmplVars[i])) {
          tmpl = tmpl.replace(reg, '"' + eval(tmplVars[i]) + '"');
        } else {
          hasUndefined = true;
          errStr = tmplVars[i] + " ; " + errStr;
          tmpl = tmpl.replace(reg, "");
        }
      }
      if (hasUndefined) {
      }
      str = tmpl;
    } catch (e) {
      console.error("sc-datatables cellTemplate Error : variable in " + tmpl + " is Undefined in Document:  Error : " + e.message);
      str = "";
    }
    return str;
  }
  // Deprecated - use sclHandlebars.processHandlebars()
  parseHandlerBar(stringHandlerbars, data) {
    if (stringHandlerbars == null) {
      return "";
    }
    const template = Handlebars3.compile(stringHandlerbars);
    const result = template(data);
    return result;
  }
  preSuffixNumbers(pre, suff, num) {
    let fixedNum;
    fixedNum = (pre != null ? pre : "") + (num != null ? num : "") + (suff != null ? suff : "");
    if (fixedNum != null && fixedNum.length > 0) {
      return fixedNum;
    } else {
      return null;
    }
  }
  parseAddress(address) {
    const sugg = {};
    sugg.street = address.addressLine;
    const res = address.pos[0].split(",");
    sugg.coordinates = {}, sugg.coordinates.latitude = res[0];
    sugg.coordinates.longitude = res[1];
    sugg.address = {}, sugg.address.unitNo = this.preSuffixNumbers(address.unitNumberPrefix, address.unitNumberSuffix, address.unitNumber);
    sugg.address.street_number = this.preSuffixNumbers(address.thoroughfareNumberFromPrefix, address.thoroughfareNumberFromSuffix, address.thoroughfareNumberFrom);
    sugg.address.street_name = "";
    if (address.thoroughfareName) {
      sugg.address.street_name = address.thoroughfareName;
    }
    if (address.thoroughfareTrailingType) {
      sugg.address.street_name += " " + address.thoroughfareTrailingType;
    }
    sugg.address.locality = address.locality;
    sugg.address.postal_code = address.postcode;
    if (!address.country) {
      sugg.address.country = "Australia";
    }
    sugg.address.admin_1 = address.state;
    return sugg;
  }
  createBorderMandatory(doc) {
  }
  parseQuery(filter2, geojsonField) {
    let filterObj;
    if (typeof filter2 === "string") {
      const res = filter2.replace(/'/g, '"');
      filterObj = JSON.parse(res);
    } else {
      filterObj = filter2;
    }
    if (geojsonField) {
      if (filterObj.query.bool.filter) {
        const term = {
          term: {}
        };
        const value = geojsonField + ".type";
        term.term[value] = "FeatureCollection";
        filterObj.query.bool.filter.push(term);
      } else if (filterObj.query.bool.must) {
        const exist = {
          match: {}
        };
        const value = geojsonField + ".type";
        exist.match[value] = {
          query: "FeatureCollection"
        }, filterObj.query.bool.must.push(exist);
      }
    }
    const query = JSON.stringify(filterObj);
    return filterObj;
  }
  processVicmapSearch(url, scope) {
  }
  search(scope, text, mapField, psmaAutoCompleteURL, psmaKey) {
  }
  fillGoogleAddress(data, streetData) {
    for (let i2 = 0; i2 < data.address_components.length; i2++) {
      const addressType = data.address_components[i2].types[0];
      const val = data.address_components[i2].long_name;
      if (addressType === "subpremise") {
        streetData.properties.unitNo = val;
      } else if (addressType === "street_number") {
        streetData.properties.streetNo = val;
      } else if (addressType === "route") {
        streetData.properties.street = val;
      } else if (addressType === "administrative_area_level_1") {
        streetData.properties.state = val;
      } else if (addressType === "locality") {
        streetData.properties.suburb = val;
      } else if (addressType === "postal_code") {
        streetData.properties.postcode = val;
      } else if (addressType === "country") {
        streetData.properties.country = val;
      }
    }
    if (data.geometry && data.geometry.location) {
      streetData = this.checkStreetGeometry(streetData);
      if (!isNaN(data.geometry.location.lng)) {
        streetData.geometry.coordinates[0] = data.geometry.location.lng;
      } else {
        streetData.geometry.coordinates[0] = data.geometry.location.lng();
      }
      if (!isNaN(data.geometry.location.lat)) {
        streetData.geometry.coordinates[1] = data.geometry.location.lat;
      } else {
        streetData.geometry.coordinates[1] = data.geometry.location.lat();
      }
    }
    return streetData;
  }
  checkStreetGeometry(streetData) {
    if (!streetData.geometry) {
      const geometry2 = {
        type: "Point",
        coordinates: []
      };
      streetData.geometry = geometry2;
    }
    return streetData;
  }
  setTooltipPosition(scope, pixel) {
  }
  streetDataRemoveEmpty(street) {
    if (street.properties.hasOwnProperty("unitNo") && (street.properties.unitNo === null || street.properties.unitNo.trim().length === 0)) {
      delete street.properties.unitNo;
    }
    if (street.properties.hasOwnProperty("streetNo") && (street.properties.streetNo === null || street.properties.streetNo.trim().length === 0)) {
      delete street.properties.streetNo;
    }
    if (street.properties.hasOwnProperty("street") && (street.properties.street === null || street.properties.street.trim().length === 0)) {
      delete street.properties.street;
    }
    if (street.properties.hasOwnProperty("suburb") && (street.properties.suburb === null || street.properties.suburb.trim().length === 0)) {
      delete street.properties.suburb;
    }
    if (street.properties.hasOwnProperty("postcode") && (street.properties.postcode === null || street.properties.postcode.trim().length === 0)) {
      delete street.properties.postcode;
    }
    if (street.properties.hasOwnProperty("locationDescription") && (street.properties.locationDescription === null || street.properties.locationDescription.trim().length === 0)) {
      delete street.properties.locationDescription;
    }
    if (street.properties.hasOwnProperty("country") && (street.properties.country === null || street.properties.country.trim().length === 0)) {
      delete street.properties.country;
    }
    if (street.properties.hasOwnProperty("iconImage") && (street.properties.iconImage === null || street.properties.iconImage.trim().length === 0)) {
      delete street.properties.iconImage;
    }
    if (street.properties.hasOwnProperty("iconSize") && (street.properties.iconSize === null || street.properties.iconSize.trim().length === 0)) {
      delete street.properties.iconSize;
    }
    if (street.properties.hasOwnProperty("state") && (street.properties.state === null || street.properties.state.trim().length === 0)) {
      delete street.properties.state;
    }
  }
  createOverlay(container) {
    return new Overlay_default({
      element: container,
      autoPan: true,
      positioning: "center-center",
      autoPanAnimation: {
        duration: 250
      }
    });
  }
  styleFunction(feature, resolution) {
    const p = feature.getProperties();
    const geometry2 = feature.getGeometry();
    if (geometry2 && geometry2.getType() === "Point") {
      let icon = "";
      if (p && p.icon) {
        icon = p.icon;
      }
      const stylePoint = [new Style_default({
        image: new Icon_default({
          src: icon,
          anchor: [0.5, 1]
        })
      })];
      return stylePoint;
    }
    const styles = [new Style_default({
      fill: new Fill_default({
        color: "rgba(255, 255, 255, 0.2)"
      }),
      stroke: new Stroke_default({
        color: "red",
        width: 2
      }),
      image: new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: "#ffcc33"
        })
      })
    })];
    if (p && p.displayArrorHeads) {
      geometry2.forEachSegment((start2, end) => {
        const dx = end[0] - start2[0];
        const dy = end[1] - start2[1];
        const rotation = Math.atan2(dy, dx);
        styles.push(new Style_default({
          geometry: new Point_default(end),
          image: new Icon_default({
            src: SclMapConstantService.MAP_MARKER_ARROW,
            anchor: [0.75, 0.5],
            rotateWithView: false,
            rotation: -rotation
          })
        }));
      });
    }
    return styles;
  }
  parseLineString(coor, coor1, nextCoor, nextCoor1) {
    return new Feature_default2(new LineString_default([[coor, coor1], [nextCoor, nextCoor1]]));
  }
  dexieSearchFunction(filterFunc, pageNumber, numberPerPage) {
    return {
      dexieSearchFunction: function(db, callbackFunc) {
        try {
          const fun = eval("(" + filterFunc + ")");
          if (fun) {
            fun(db, function(err, filterDocs) {
              if (err) {
                callbackFunc(err);
              } else {
                let docs = [];
                if (filterDocs && filterDocs.length > 0) {
                  const size = numberPerPage || SharedConstants.DEFAULT_PAGE_SIZE;
                  const page = pageNumber || SharedConstants.DEFAULT_PAGE;
                  const docsArray = (0, import_lodash.chunk)(filterDocs, size);
                  docs = (0, import_lodash.nth)(docsArray, page);
                }
                let results;
                results = {};
                results.total = filterDocs.length;
                results.statusCode = IA.OK;
                results.data = docs;
                results.searchProvier = "dexie";
                callbackFunc(null, results);
              }
            });
          }
        } catch (err) {
          console.log(err);
          callbackFunc(err);
        }
      }
    };
  }
  calculateRotate(bearing, initialImageDirection, initialImageWheelDirection) {
    let calculateRotation = false;
    let calculateFlip = false;
    let rotation = 0;
    let isFlip = false;
    if (typeof initialImageWheelDirection == "number" && (initialImageWheelDirection > 0 && initialImageWheelDirection <= 360)) {
      calculateFlip = true;
    }
    if (typeof initialImageDirection == "number" && (initialImageDirection > 0 && initialImageDirection <= 360)) {
      calculateRotation = true;
    }
    if (typeof bearing == "number" && (bearing >= 0 && bearing <= 360)) {
      calculateRotation = true;
    } else {
      calculateRotation = false;
    }
    if (calculateRotation) {
      rotation = bearing - initialImageDirection;
      rotation = (rotation % 360 + 360) % 360;
      if (calculateFlip) {
        const wheelRotation = initialImageWheelDirection - rotation;
        if (wheelRotation < 90 || wheelRotation > 270) {
          isFlip = true;
        }
      }
    }
    return { rotation, isFlip };
  }
  processHandlebarsOnVisualItem(componentDefinition, contextParams, value, field, handlebarsContext, returnType, handlebarsOptions) {
    let result;
    if (field) {
      switch (returnType) {
        case "int":
          return sclHandlebars.processIntHandlebars(field, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "float":
          return sclHandlebars.processFloatHandlebars(field, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "boolean":
          return sclHandlebars.processBooleanHandlebars(field, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "array":
          return sclHandlebars.processArrayHandlebars(field, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        default:
          return sclHandlebars.processHandlebars(field, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
      }
    } else if (value) {
      switch (returnType) {
        case "int":
          return sclHandlebars.processIntHandlebars(value, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "float":
          return sclHandlebars.processFloatHandlebars(value, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "boolean":
          return sclHandlebars.processBooleanHandlebars(value, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        case "array":
          return sclHandlebars.processArrayHandlebars(value, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
        default:
          return sclHandlebars.processHandlebars(value, handlebarsContext, null, componentDefinition.handlebarsHelpers, contextParams, handlebarsOptions);
      }
    }
    return result;
  }
  processHandlebarsOnLabel(componentDefinition, contextParams, label, handlebarsContext, layer, layerIndex, idCache) {
    label.labelText = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelText, layer.labelTextHandlebars, handlebarsContext, null, null);
    label.labelColor = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelColor, layer.labelColorHandlebars, handlebarsContext, null, null);
    label.labelOutlineColor = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelOutlineColor, layer.labelOutlineColorHandlebars, handlebarsContext, null, null);
    label.labelOutlineWidth = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelOutlineWidth, layer.labelOutlineWidthHandlebarsRemoveElastic, handlebarsContext, "int", null);
    label.labelFont = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelFont, layer.labelFontHandlebars, handlebarsContext, null, null);
    label.labelFontSize = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelFontSize, layer.labelFontSizeHandlebars, handlebarsContext, "int", null);
    label.labelTextAlign = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelTextAlign, layer.labelTextAlignHandlebars, handlebarsContext, null, null);
    label.labelTextBaseline = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelTextBaseline, layer.labelTextBaselineHandlebars, handlebarsContext, null, null);
    label.labelOffsetX = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelOffsetX, layer.labelOffsetXHandlebars, handlebarsContext, "int", null);
    label.labelOffsetY = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelOffsetY, layer.labelOffsetYHandlebars, handlebarsContext, "int", null);
    label.labelPlacement = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelPlacement, layer.labelPlacementHandlebars, handlebarsContext, null, null);
    label.labelMaxAngle = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelMaxAngle, layer.labelMaxAngleHandlebars, handlebarsContext, "float", null);
    label.labelOverflow = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelOverflow, layer.labelOverflowHandlebars, handlebarsContext, "boolean", null);
    label.labelRotationWithView = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelRotationWithView, layer.labelRotationWithViewHandlebars, handlebarsContext, "boolean", null);
    label.labelRotation = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelRotation, layer.labelRotationHandlebars, handlebarsContext, "int", null);
    label.labelPadding = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelPadding, layer.labelPaddingHandlebars, handlebarsContext, "array", null);
    label.labelFontWeight = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelFontWeight, layer.labelFontWeightHandlebars, handlebarsContext, null, null);
    label.labelDisplayZoom = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, label.labelDisplayZoom, layer.labelDisplayZoomHandlebars, handlebarsContext, "int", null);
    return label;
  }
  processHandlebarsOnLayer(componentDefinition, contextParams, layerClone, handlebarsContext, layer, layerIndex) {
    layerClone.lineCap = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.lineCap, layer.lineCapHandlebars, handlebarsContext, null, null);
    if (!layerClone.lineCap && layer.lineCap) {
      layerClone.lineCap = layer.lineCap;
    }
    layerClone.lineWidth = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.lineWidth, layer.lineWidthHandlebars, handlebarsContext, "int", null);
    if (!layerClone.lineWidth && layer.lineWidth) {
      layerClone.lineWidth = layer.lineWidth;
    }
    layerClone.lineDash = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.lineDash, layer.lineDashHandlebars, handlebarsContext, "array", null);
    if (!layerClone.lineDash && layer.lineDash) {
      layerClone.lineDash = layer.lineDash;
    }
    layerClone.fill = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.fill, layer.fillHandlebars, handlebarsContext, null, null);
    if (!layerClone.fill && layer.fill) {
      layerClone.fill = layer.fill;
    }
    layerClone.fillOpacity = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.fillOpacity, layer.fillOpacityHandlebars, handlebarsContext, "float", null);
    if (!layerClone.fillOpacity && layer.fillOpacity) {
      layerClone.fillOpacity = layer.fillOpacity;
    }
    return layerClone;
  }
  processHandlebarsOnField(componentDefinition, contextParams, handlebarsContext, layerName, layerIndex, fieldName, layerField, layerFieldHandlebars, returnType) {
    const field = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layerField, layerFieldHandlebars, handlebarsContext, returnType, null);
    return field;
  }
  processDynamicLayerData(layer, itemData, i2, layerIndex, customData, vehicle) {
    const item = itemData.features[0];
    const pro = item.properties;
    const name = pro.name ? pro.name : "";
    if (pro.labelDisplayZoom && (typeof pro.labelDisplayZoom === "string" || pro.labelDisplayZoom instanceof String)) {
      pro.labelDisplayZoom = parseInt(pro.labelDisplayZoom);
    }
    const label = {
      labelText: typeof pro.label === "string" && pro.label.trim().length > 0 ? pro.label : layer.labelText,
      labelTextAlign: typeof pro.labelTextAlign === "string" && pro.labelTextAlign.trim().length > 0 ? pro.labelTextAlign : layer.labelTextAlign,
      labelTextBaseline: typeof pro.labelTextBaseline === "string" && pro.labelTextBaseline.trim().length > 0 ? pro.labelTextBaseline : layer.labelTextBaseline,
      labelColor: typeof pro.labelColor === "string" && pro.labelColor.trim().length > 0 ? pro.labelColor : layer.labelColor,
      labelOutlineColor: typeof pro.labelOutlineColor === "string" && pro.labelOutlineColor.trim().length > 0 ? pro.labelOutlineColor : layer.labelOutlineColor,
      labelOutlineWidth: typeof pro.labelOutlineWidth === "number" && pro.labelOutlineWidth > 0 ? pro.labelOutlineWidth : layer.labelOutlineWidth,
      labelOffsetX: typeof pro.labelOffsetX === "number" ? pro.labelOffsetX : layer.labelOffsetX,
      labelOffsetY: typeof pro.labelOffsetY === "number" ? pro.labelOffsetY : layer.labelOffsetY,
      labelPlacement: typeof pro.labelPlacement === "string" && pro.labelPlacement.trim().length > 0 ? pro.labelPlacement : layer.labelPlacement,
      labelMaxAngle: typeof pro.labelMaxAngle === "number" && pro.labelMaxAngle >= 0 && pro.labelMaxAngle <= 360 ? pro.labelMaxAngle : layer.labelMaxAngle,
      labelOverflow: typeof pro.labelOverflow === "boolean" ? pro.labelOverflow : layer.labelOverflow,
      labelRotationWithView: typeof pro.labelRotationWithView === "boolean" ? pro.labelRotationWithView : layer.labelRotationWithView,
      labelRotation: typeof pro.labelRotation === "number" && pro.labelRotation >= 0 && pro.labelRotation <= 360 ? pro.labelRotation : layer.labelRotation,
      labelPadding: Array.isArray(pro.labelPadding) ? pro.labelPadding : layer.labelPadding,
      labelFont: typeof pro.labelFont === "string" && pro.labelFont.trim().length > 0 ? pro.labelFont : layer.labelFont,
      labelFontWeight: typeof pro.labelFontWeight === "string" && pro.labelFontWeight.trim().length > 0 ? pro.labelFontWeight : layer.labelFontWeight,
      labelFontSize: typeof pro.labelFontSize === "string" && pro.labelFontSize.trim().length > 0 && pro.labelFontSize.indexOf("px") > -1 ? pro.labelFontSize : layer.labelFontSize,
      labelDisplayZoom: typeof pro.labelDisplayZoom === "number" && pro.labelDisplayZoom > 0 ? pro.labelDisplayZoom : layer.labelDisplayZoom
    };
    let imageFileNo = "";
    if (layer.imageFileNo) {
      imageFileNo = layer.imageFileNo;
    }
    if (pro.image && Array.isArray(pro.image) && pro.image.length > 0) {
      imageFileNo = pro.image[0].fileNo;
    }
    const calRotate = this.calculateRotate(pro.bearing, pro.initialImageDirection, pro.initialImageWheelDirection);
    const rotation = calRotate.rotation;
    let scaleValue = 1;
    if (typeof pro.imageScale == "number" && pro.imageScale > 0) {
      scaleValue = pro.imageScale;
    }
    let scale5 = [scaleValue, scaleValue];
    if (calRotate.isFlip) {
      scale5[0] = -scaleValue;
    }
    const tooltip = typeof pro.tooltip === "string" && pro.tooltip.trim().length > 0 ? pro.tooltip : layer.tooltip;
    const dataId = pro.vehicleDocumentId;
    if (!dataId) {
      console.log(`*** invalid vehicleDocumentId: ${dataId}`);
    }
    const id2 = dataId + "_" + i2 + "_" + layerIndex;
    const url = "form/" + dataId;
    const handlebarsContext = {
      results: customData,
      resultsCount: customData.length,
      resultsIndex: i2,
      queryResultDocument: itemData
    };
    if (vehicle) {
      handlebarsContext.vehicle = vehicle;
    }
    return { pro, handlebarsContext, label, item, id: id2, name, tooltip, imageFileNo, url, dataId, rotation, scale: scale5 };
  }
  processLayerRotation(layer, layerIndex, componentDefinition, contextParams, handlebarsContext) {
    let rotation = 0;
    if (layer.imageRotation) {
      rotation = layer.imageRotation;
    }
    if (layer.imageRotationHandlebars) {
      rotation = this.processHandlebarsOnVisualItem(componentDefinition, contextParams, layer.imageRotation, layer.imageRotationHandlebars, handlebarsContext, "int", null);
      if (!rotation && layer.imageRotation) {
        rotation = layer.imageRotation;
      }
      if (!rotation) {
        rotation = 0;
      }
    }
    return rotation;
  }
  checkValidStyleString(obj) {
    if (!(0, import_lodash.isString)(obj) || obj.trim().length == 0 || obj.indexOf("{") > -1 || obj.indexOf("}") > -1) {
      return false;
    }
    return true;
  }
  checkStyleValue(assetSelection, isPrimary) {
    const styleInfo = (0, import_lodash.cloneDeep)(assetSelection);
    if (!this.checkValidStyleString(assetSelection.selectionImageFileNo)) {
      styleInfo.selectionImageFileNo = isPrimary ? SclMapConstantService.MAP_PRIMARY_ASSET : SclMapConstantService.MAP_SECONDARY_ASSET;
    }
    if (!Array.isArray(assetSelection.selectionImageAnchor)) {
      styleInfo.selectionImageAnchor = [0.5, 0.5];
    }
    if (!(0, import_lodash2.isNumber)(assetSelection.selectionImageRotation)) {
      styleInfo.selectionImageRotation = 0;
    }
    if (!this.checkValidStyleString(assetSelection.selectionColor)) {
      styleInfo.selectionColor = "purple";
    }
    if (!this.checkValidStyleString(assetSelection.selectionFill)) {
      styleInfo.selectionFill = "purple";
    }
    if (!(0, import_lodash2.isNumber)(assetSelection.selectionFillOpacity)) {
      styleInfo.selectionFillOpacity = 1;
    }
    if (!this.checkValidStyleString(assetSelection.selectionLineCap)) {
      styleInfo.selectionLineCap = null;
    }
    if (!Array.isArray(assetSelection.selectionLineDash)) {
      styleInfo.selectionLineDash = null;
    }
    if (!(0, import_lodash2.isNumber)(assetSelection.selectionLineWidth)) {
      styleInfo.selectionLineWidth = null;
    }
    return styleInfo;
  }
  toRadians(angleInDegrees) {
    return angleInDegrees * Math.PI / 180;
  }
  toDegrees(angleInRadians) {
    return angleInRadians * 180 / Math.PI;
  }
  offset(c1, distance2, earthRadius, bearing) {
    var lat1 = this.toRadians(c1[1]);
    var lon1 = this.toRadians(c1[0]);
    var dByR = distance2 / earthRadius;
    var lat = Math.asin(Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing));
    var lon = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat));
    return [this.toDegrees(lon), this.toDegrees(lat)];
  }
  circleToPolygon(center, radius) {
    var n = 4;
    var earthRadius = 6378137;
    var bearing = 0;
    var direction = -1;
    var start2 = this.toRadians(bearing);
    var coordinates2 = [];
    for (var i2 = 0; i2 < n; ++i2) {
      coordinates2.push(this.offset(center, radius, earthRadius, start2 + direction * 2 * Math.PI * -i2 / n));
    }
    coordinates2.push(coordinates2[0]);
    return [coordinates2];
  }
  calculateCircleCenterPoint(p12, p22) {
    const x1 = p12[0];
    const y1 = p12[1];
    const x2 = p22[0];
    const y2 = p22[1];
    const x = (x1 + x2) / 2;
    const y = (y1 + y2) / 2;
    console.log(`center = [${x}, ${y}]`);
    return [x, y];
  }
  buildFilterObj(componentDefinition, geoJsonField) {
    const fil = {
      filter: componentDefinition.filter,
      layerDisplayOnly: componentDefinition.layerDisplayOnly,
      geoJsonField
    };
    if (componentDefinition.color) {
      fil.color = componentDefinition.color;
    }
    if (componentDefinition.fill) {
      fil.fill = componentDefinition.fill;
    }
    if (componentDefinition.fillOpacity) {
      fil.fillOpacity = componentDefinition.fillOpacity;
    }
    if (componentDefinition.tooltips) {
      fil.tooltips = componentDefinition.tooltips;
    }
    if (componentDefinition.lineDash) {
      fil.lineDash = componentDefinition.lineDash;
    }
    if (componentDefinition.lineCap) {
      fil.lineCap = componentDefinition.lineCap;
    }
    if (componentDefinition.lineWidth) {
      fil.lineWidth = componentDefinition.lineWidth;
    }
    if (componentDefinition.imageAnchor) {
      fil.imageAnchor = componentDefinition.imageAnchor;
    }
    if (componentDefinition.imageFileNo) {
      fil.imageFileNo = componentDefinition.imageFileNo;
    }
    if (componentDefinition.labelText) {
      fil.labelText = componentDefinition.labelText;
    }
    if (componentDefinition.labelTextAlign) {
      fil.labelTextAlign = componentDefinition.labelTextAlign;
    }
    if (componentDefinition.labelTextBaseline) {
      fil.labelTextBaseline = componentDefinition.labelTextBaseline;
    }
    if (componentDefinition.labelColor) {
      fil.labelColor = componentDefinition.labelColor;
    }
    if (componentDefinition.labelOutlineColor) {
      fil.labelOutlineColor = componentDefinition.labelOutlineColor;
    }
    if (componentDefinition.labelOutlineWidth) {
      fil.labelOutlineWidth = componentDefinition.labelOutlineWidth;
    }
    if (componentDefinition.labelOffsetX) {
      fil.labelOffsetX = componentDefinition.labelOffsetX;
    }
    if (componentDefinition.labelOffsetY) {
      fil.labelOffsetY = componentDefinition.labelOffsetY;
    }
    if (componentDefinition.labelPlacement) {
      fil.labelPlacement = componentDefinition.labelPlacement;
    }
    if (componentDefinition.labelMaxAngle) {
      fil.labelMaxAngle = componentDefinition.labelMaxAngle;
    }
    if (componentDefinition.labelOverflow) {
      fil.labelOverflow = componentDefinition.labelOverflow;
    }
    if (componentDefinition.labelRotationWithView) {
      fil.labelRotationWithView = componentDefinition.labelRotationWithView;
    }
    if (componentDefinition.labelRotation) {
      fil.labelRotation = componentDefinition.labelRotation;
    }
    if (componentDefinition.labelPadding) {
      fil.labelPadding = componentDefinition.labelPadding;
    }
    if (componentDefinition.labelFont) {
      fil.labelFont = componentDefinition.labelFont;
    }
    if (componentDefinition.labelFontWeight) {
      fil.labelFontWeight = componentDefinition.labelFontWeight;
    }
    if (componentDefinition.labelFontSize) {
      fil.labelFontSize = componentDefinition.labelFontSize;
    }
    if (componentDefinition.labelDisplayZoom) {
      fil.labelDisplayZoom = componentDefinition.labelDisplayZoom;
    }
    if (componentDefinition.type) {
      fil.type = componentDefinition.type;
    }
    return fil;
  }
  // **** calculate middle point of line string
  getPointByDistance(pnts, distance2) {
    let cl = 0;
    let ol;
    let result;
    pnts.forEach((point, i2, points) => {
      ol = cl;
      cl += i2 ? this.lineLen([points[i2 - 1], point]) : 0;
      if (distance2 <= cl && distance2 > ol) {
        const dd = distance2 - ol;
        result = this.pntOnLine([points[i2 - 1], point], dd);
      }
    });
    return result;
  }
  pntOnLine(line, distance2) {
    const t = distance2 / this.lineLen(line);
    const xt = (1 - t) * line[0][0] + t * line[1][0];
    const yt = (1 - t) * line[0][1] + t * line[1][1];
    return [xt, yt];
  }
  totalLen(pnts) {
    let tl = 0;
    pnts.forEach((point, i2, points) => {
      tl += i2 ? this.lineLen([points[i2 - 1], point]) : 0;
    });
    return tl;
  }
  lineLen(line) {
    const xd = line[0][0] - line[1][0];
    const yd = line[0][1] - line[1][1];
    return Math.sqrt(xd * xd + yd * yd);
  }
};
_SclUtilMapService.\u0275fac = function SclUtilMapService_Factory(t) {
  return new (t || _SclUtilMapService)();
};
_SclUtilMapService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclUtilMapService, factory: _SclUtilMapService.\u0275fac, providedIn: "root" });
var SclUtilMapService = _SclUtilMapService;

// projects/formbird-mapping/src/lib/scl-projection-constant.service.ts
var _SclProjectionConstantService = class _SclProjectionConstantService {
};
_SclProjectionConstantService.EPSG = {
  "EPSG:28355": "+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
  "EPSG:3111": "+proj=lcc +lat_1=-36 +lat_2=-38 +lat_0=-37 +lon_0=145 +x_0=2500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
  // update Aug-2019
  "EPSG:3857": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs",
  "EPSG:4326": "+proj=longlat +datum=WGS84 +no_defs",
  "EPSG:900913": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"
};
var SclProjectionConstantService = _SclProjectionConstantService;

// projects/formbird-mapping/src/lib/scl-map-views.service.ts
var _SclMapViewsService = class _SclMapViewsService {
  constructor() {
  }
  getMultiLayers(mapViews) {
    const layers = [];
    let existShow = false;
    for (let i2 = 0; i2 < mapViews.length; i2++) {
      const mapView = mapViews[i2];
      if (mapView.isShow) {
        existShow = true;
        break;
      }
    }
    for (let i2 = 0; i2 < mapViews.length; i2++) {
      const mapView = mapViews[i2];
      let isShow = false;
      if (mapView.isShow) {
        isShow = mapView.isShow;
      }
      if (!existShow && i2 === 0) {
        existShow = true;
        isShow = true;
      }
      let tile = null;
      if (mapView.groupView) {
        const listLayers = [];
        for (let j = 0; j < mapView.groupView.length; j++) {
          const view = mapView.groupView[j];
          const member = this.getTile(view, isShow);
          listLayers.push(member);
        }
        const option = {
          visible: isShow,
          title: mapView.uiLabel,
          // not support 6.15.1
          layers: listLayers
        };
        tile = new Group_default(option);
      } else {
        tile = this.getTile(mapView, isShow);
      }
      layers.push(tile);
    }
    return layers;
  }
  getTile(mapView, isShow) {
    let tile;
    tile = "";
    if (mapView.serverType === "tile") {
      const optionOSM = {
        url: mapView.url,
        crossOrigin: mapView.crossOrigin,
        wrapDateLine: false,
        wrapX: false,
        noWrap: true
      };
      const optionTile = {
        title: mapView.uiLabel,
        // not support 6.15.1
        visible: isShow,
        source: new OSM_default(optionOSM)
      };
      tile = new Tile_default4(optionTile);
    } else if (mapView.serverType === "geoserver") {
      let tileGrid;
      if (mapView.extent) {
        tileGrid = new TileGrid_default({
          extent: mapView.extent,
          resolutions: mapView.resolutions,
          tileSize: mapView.tileSize
        });
      }
      const optionWMS = {
        url: mapView.url,
        params: mapView.params,
        projection: mapView.EPSG,
        serverType: mapView.serverType,
        tileGrid,
        wrapDateLine: false,
        // not support 6.15.1
        wrapX: false,
        noWrap: true
        // not support 6.15.1
      };
      const tileWMS = new TileWMS_default(optionWMS);
      const optionLayer = {
        title: mapView.uiLabel,
        // not support 6.15.1
        visible: isShow,
        source: tileWMS
      };
      tile = new Tile_default4(optionLayer);
      if (mapView.extent) {
        tile.setExtent(mapView.extent);
      }
    }
    return tile;
  }
  createUIButton(document2, action, classAction, title, text) {
    const button = document2.createElement("BUTTON");
    button.setAttribute("class", classAction);
    button.setAttribute("title", title);
    button.addEventListener("click", action, false);
    if (text) {
      button.innerHTML = text;
    }
    const spanButton = document2.createElement("SPAN");
    spanButton.setAttribute("role", "tooltip");
    button.appendChild(spanButton);
    return button;
  }
  createCheckbox(document2, name) {
    const checkbox = document2.createElement("input");
    checkbox.setAttribute("type", "checkbox");
    checkbox.setAttribute("id", name);
    return checkbox;
  }
  createRadio(document2, title, visible, name) {
    const radio = document2.createElement("input");
    radio.setAttribute("type", "radio");
    radio.setAttribute("name", name);
    radio.setAttribute("id", title);
    if (visible) {
      radio.setAttribute("checked", "checked");
    }
    return radio;
  }
  createLabel(document2, name, innerHTML) {
    const label = document2.createElement("label");
    label.setAttribute("for", name);
    if (innerHTML) {
      label.innerHTML = innerHTML;
    }
    return label;
  }
  addRadioButton(document2, element, layers, compId) {
    layers.forEach(function(layer, i2) {
      const title = layer.get("title");
      const radio = this.createRadio(document2, compId + title, layer.getVisible(), compId);
      radio.onclick = function() {
        layers.forEach(function(layer2, j) {
          let value = layer2.get("title");
          if (!value || value === "Vector") {
            return;
          }
          const newTil = compId + title;
          value = compId + value;
          if (value === newTil) {
            layer2.setVisible(true);
            if (layer2 instanceof Group_default) {
              layer2.getLayers().forEach(function(sublayer, k) {
                sublayer.setVisible(true);
              });
            }
          } else {
            layer2.setVisible(false);
          }
        });
      }, element.appendChild(radio);
      const label = this.createLabel(document2, compId + title, title);
      element.appendChild(label);
    });
  }
};
_SclMapViewsService.\u0275fac = function SclMapViewsService_Factory(t) {
  return new (t || _SclMapViewsService)();
};
_SclMapViewsService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapViewsService, factory: _SclMapViewsService.\u0275fac, providedIn: "root" });
var SclMapViewsService = _SclMapViewsService;

// projects/formbird-mapping/src/lib/scl-asset-layers.service.ts
var import_lodash3 = __toESM(require_lodash());
var _SclAssetLayersService = class _SclAssetLayersService {
  constructor() {
  }
  getAssetPoint(customData, fieldData, typeAsset, geoJsonField, primaryAssetAddressSelection) {
    let name = "";
    let id2 = null;
    if (customData) {
      if (customData.systemHeader && customData.systemHeader.summaryName) {
        name = customData.systemHeader.summaryName;
      } else if (customData.assetId) {
        name = customData.assetId;
      }
      if (customData.documentId) {
        id2 = customData.documentId;
      }
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (!id2) {
      return "";
    }
    if (primaryAssetAddressSelection && geoJsonField && customData[geoJsonField]) {
      const pointFeature = customData[geoJsonField]?.features[0];
      asset.street = {};
      asset.street.geometry = {
        type: "Point",
        coordinates: pointFeature?.geometry?.coordinates
      };
      asset.street.properties = pointFeature?.properties;
    }
    const relatedFields = fieldData?.relatedFields;
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const fieldAsset = relatedFields[field];
          const value = customData[fieldAsset];
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  getGeometryAssetPoint(customData, fieldData, geoJsonField, primaryAssetAddressSelection) {
    let name = "";
    let id2 = null;
    if (customData) {
      if (customData.systemHeader && customData.systemHeader.summaryName) {
        name = customData.systemHeader.summaryName;
      } else if (customData.assetId) {
        name = customData.assetId;
      }
      if (customData.documentId) {
        id2 = customData.documentId;
      }
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: "primaryAsset",
        linkAssets: []
      }
    };
    if (!id2) {
      return "";
    }
    if (primaryAssetAddressSelection && geoJsonField) {
      if (customData[geoJsonField]) {
        const pointFeature = customData[geoJsonField]?.features[0];
        asset.street = {};
        asset.street.geometry = {
          type: "Point",
          coordinates: pointFeature?.geometry?.coordinates
        };
        asset.street.properties = pointFeature?.properties;
      }
    }
    const relatedFields = fieldData?.relatedFields;
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const fieldAsset = relatedFields[field];
          const value = customData[fieldAsset];
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  getAssetProperties(feature, relatedFields, coordinates2, typeAsset, typeSelection) {
    let name = "";
    let id2 = "";
    if (feature) {
      const p = feature.getProperties();
      if (p) {
        name = p.name;
        id2 = p.id;
      }
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (!typeSelection || typeSelection === "featureCollection") {
      asset.geometry = {
        type: "Point",
        coordinates: coordinates2
      };
    }
    if (!id2) {
      return "";
    }
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const value = feature.getProperties()[field];
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  getAssetPropertiesSelection(feature, relatedFields, coordinates2, typeAsset, typeSelection) {
    let name = "";
    let id2 = "";
    if (feature) {
      const p = feature.getProperties();
      if (p) {
        name = p.name;
        id2 = p.id;
      }
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (!typeSelection || typeSelection === "featureCollection") {
      asset.geometry = {
        type: "Point",
        coordinates: coordinates2
      };
    }
    if (!id2) {
      return "";
    }
    if (!typeSelection || typeSelection === "featureCollection") {
      if (relatedFields) {
        for (const field in relatedFields) {
          if (relatedFields.hasOwnProperty(field)) {
            propertiesLinkAsset[field] = relatedFields[field];
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  createSelectionObject(title, icon, anchor2) {
    const selection = {};
    selection.imageAnchor = anchor2;
    selection.imageFileNo = icon;
    selection.selectionType = "multiple";
    selection.uiLabel = title;
    selection.relatedVisible = true;
    selection.selectionOutput = "documentCollection";
    return selection;
  }
  getRelatedFieldSelection(feature, type) {
    const relatedFields = {};
    let fields = [];
    if (!feature) {
      return relatedFields;
    }
    const pro = feature.getProperties();
    if (!pro) {
      return relatedFields;
    }
    if (type == "primary") {
      fields = pro.primaryFields;
    } else {
      fields = pro.secondaryFields;
    }
    if (fields) {
      for (const field in fields) {
        if (fields[field]) {
          relatedFields[field] = fields[field];
        }
      }
    } else {
      for (const field in pro.mainFields) {
        if (pro.mainFields[field]) {
          relatedFields[field] = pro.mainFields[field];
        }
      }
    }
    return relatedFields;
  }
  removeUnselectedAsset(assets, unSelectedAssetIds, type) {
    for (let i2 = 0; i2 < unSelectedAssetIds.length; i2++) {
      const priAsset = unSelectedAssetIds[i2];
      for (let j = 0; j < assets.length; j++) {
        const id2 = assets[j].properties.linkAssets[0].documentId;
        if (id2 === priAsset) {
          console.log("TODO sort out the missing sourceVector variable");
        }
      }
    }
  }
  removeUnselectedAssetItem(existAsset, assets, type) {
    if (existAsset) {
      for (let j = 0; j < assets.length; j++) {
        const item = assets[j];
        const id2 = item.properties.linkAssets[0].documentId + "_" + type;
        if (id2 === existAsset.properties.linkAssets[0].documentId) {
          console.log("TODO sort out the missing sourceVector variable");
          return true;
        }
      }
    }
    return false;
  }
  getPointFeature(location2, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName, url) {
    const graphPoint = new Feature_default2(new Point_default(location2));
    const properties2 = {
      icon: image,
      name,
      id: id2
    };
    if (color2) {
      properties2.color = color2;
    }
    if (tooltip) {
      properties2.tooltip = tooltip;
    }
    if (layerDisplayOnly) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (type) {
      properties2.type = type;
    }
    if (anchor2) {
      properties2.anchor = anchor2;
    }
    if (layerName) {
      properties2.layerName = layerName;
    }
    if (url) {
      properties2.url = url;
    }
    if (relatedAsset) {
      for (const field in relatedAsset) {
        if (relatedAsset.hasOwnProperty(field)) {
          const value = relatedAsset[field];
          properties2[field] = value;
        }
      }
    }
    graphPoint.setProperties(properties2);
    return graphPoint;
  }
  parseToLine(coor, id2, toEPSG) {
    const feature = new Feature_default2(new LineString_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseToMultiLine(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiLineString_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseToPolygon(coor, id2, toEPSG) {
    const feature = new Feature_default2(new Polygon_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseToMultiPolygon(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiPolygon_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseToPoint(coor, id2, toEPSG) {
    const feature = new Feature_default2(new Point_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseToMultiPoint(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiPoint_default(coor));
    const geom = feature.getGeometry().transform("EPSG:4326", toEPSG);
    feature.setId(id2);
    return feature;
  }
  parseAssetsFromFeatures(features, assetField, coor, typeAsset) {
    const assets = [];
    for (let i2 = 0; i2 < features.length; i2++) {
      const asset = this.getAssetProperties(features[i2], assetField.relatedFields, coor, typeAsset);
      if (!asset) {
        return;
      }
      assets.push(asset);
    }
    return assets;
  }
  isContainFeature(id2, assets) {
    if (!assets) {
      return false;
    }
    for (let i2 = 0; i2 < assets.length; i2++) {
      const ass = assets[i2];
      if (ass.properties.linkAssets[0].documentId === id2) {
        return true;
      }
    }
    return false;
  }
  createFeatureByType(coordinates2, type, EPSG, id2) {
    let feature;
    if (type === "Point") {
      feature = this.parseToPoint(coordinates2, id2, EPSG);
    } else if (type === "MultiPoint") {
      feature = this.parseToMultiPoint(coordinates2, id2, EPSG);
    } else if (type === "LineString") {
      feature = this.parseToLine(coordinates2, id2, EPSG);
    } else if (type === "MultiLineString") {
      feature = this.parseToMultiLine(coordinates2, id2, EPSG);
    } else if (type === "Polygon") {
      feature = this.parseToPolygon(coordinates2, id2, EPSG);
    } else if (type === "MultiPolygon") {
      feature = this.parseToMultiPolygon(coordinates2, id2, EPSG);
    }
    return feature;
  }
  createLineProperties(layer, name, color2, id2, popup, primaryMultiPopup, secondaryMultiPopup, layerDisplayOnly, relatedAsset, url) {
    const isDashedLine = layer && layer.lineDash !== void 0 && layer.lineDash instanceof Array && layer.lineDash.length > 0;
    let lineWidth = 4;
    if (layer && (0, import_lodash3.isNumber)(layer.lineWidth)) {
      lineWidth = layer.lineWidth;
    }
    let lineDash = isDashedLine ? layer.lineDash : void 0;
    if (layer && isDashedLine) {
      lineDash = layer.lineDash;
    }
    let lineCap = "round";
    if (layer && layer.lineCap) {
      lineCap = layer.lineCap;
    }
    const properties2 = {};
    if (name) {
      properties2.name = name;
    }
    if (color2) {
      properties2.color = color2;
    }
    if (id2) {
      properties2.id = id2;
    }
    if (popup) {
      properties2.tooltip = popup;
    }
    if (url) {
      properties2.url = url;
    }
    if (primaryMultiPopup) {
      properties2.primaryMultiPopup = primaryMultiPopup;
    }
    if (secondaryMultiPopup) {
      properties2.secondaryMultiPopup = secondaryMultiPopup;
    }
    if (lineWidth) {
      properties2.lineWidth = lineWidth;
    }
    if (lineDash) {
      properties2.lineDash = lineDash;
    }
    if (lineCap) {
      properties2.lineCap = lineCap;
    }
    if (layerDisplayOnly) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (layer && layer.fill) {
      properties2.fillColor = layer.fill;
    }
    if (layer && (0, import_lodash3.isNumber)(layer.fillOpacity)) {
      properties2.fillOpacity = layer.fillOpacity;
    }
    if (relatedAsset) {
      for (const field in relatedAsset) {
        if (relatedAsset[field]) {
          properties2[field] = relatedAsset[field];
        }
      }
    }
    return properties2;
  }
};
_SclAssetLayersService.\u0275fac = function SclAssetLayersService_Factory(t) {
  return new (t || _SclAssetLayersService)();
};
_SclAssetLayersService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclAssetLayersService, factory: _SclAssetLayersService.\u0275fac, providedIn: "root" });
var SclAssetLayersService = _SclAssetLayersService;

// node_modules/ol/source/Cluster.js
var __extends100 = /* @__PURE__ */ function() {
  var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
      d2.__proto__ = b2;
    } || function(d2, b2) {
      for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
    };
    return extendStatics(d, b);
  };
  return function(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();
var Cluster = (
  /** @class */
  function(_super) {
    __extends100(Cluster3, _super);
    function Cluster3(options) {
      var _this = _super.call(this, {
        attributions: options.attributions,
        wrapX: options.wrapX
      }) || this;
      _this.resolution = void 0;
      _this.distance = options.distance !== void 0 ? options.distance : 20;
      _this.minDistance = options.minDistance || 0;
      _this.interpolationRatio = 0;
      _this.features = [];
      _this.geometryFunction = options.geometryFunction || function(feature) {
        var geometry2 = (
          /** @type {Point} */
          feature.getGeometry()
        );
        assert(geometry2.getType() == "Point", 10);
        return geometry2;
      };
      _this.createCustomCluster_ = options.createCluster;
      _this.source = null;
      _this.boundRefresh_ = _this.refresh.bind(_this);
      _this.updateDistance(_this.distance, _this.minDistance);
      _this.setSource(options.source || null);
      return _this;
    }
    Cluster3.prototype.clear = function(opt_fast) {
      this.features.length = 0;
      _super.prototype.clear.call(this, opt_fast);
    };
    Cluster3.prototype.getDistance = function() {
      return this.distance;
    };
    Cluster3.prototype.getSource = function() {
      return this.source;
    };
    Cluster3.prototype.loadFeatures = function(extent, resolution, projection) {
      this.source.loadFeatures(extent, resolution, projection);
      if (resolution !== this.resolution) {
        this.resolution = resolution;
        this.refresh();
      }
    };
    Cluster3.prototype.setDistance = function(distance2) {
      this.updateDistance(distance2, this.minDistance);
    };
    Cluster3.prototype.setMinDistance = function(minDistance) {
      this.updateDistance(this.distance, minDistance);
    };
    Cluster3.prototype.getMinDistance = function() {
      return this.minDistance;
    };
    Cluster3.prototype.setSource = function(source) {
      if (this.source) {
        this.source.removeEventListener(EventType_default.CHANGE, this.boundRefresh_);
      }
      this.source = source;
      if (source) {
        source.addEventListener(EventType_default.CHANGE, this.boundRefresh_);
      }
      this.refresh();
    };
    Cluster3.prototype.refresh = function() {
      this.clear();
      this.cluster();
      this.addFeatures(this.features);
    };
    Cluster3.prototype.updateDistance = function(distance2, minDistance) {
      var ratio = distance2 === 0 ? 0 : Math.min(minDistance, distance2) / distance2;
      var changed = distance2 !== this.distance || this.interpolationRatio !== ratio;
      this.distance = distance2;
      this.minDistance = minDistance;
      this.interpolationRatio = ratio;
      if (changed) {
        this.refresh();
      }
    };
    Cluster3.prototype.cluster = function() {
      if (this.resolution === void 0 || !this.source) {
        return;
      }
      var extent = createEmpty();
      var mapDistance = this.distance * this.resolution;
      var features = this.source.getFeatures();
      var clustered = {};
      for (var i2 = 0, ii = features.length; i2 < ii; i2++) {
        var feature = features[i2];
        if (!(getUid(feature) in clustered)) {
          var geometry2 = this.geometryFunction(feature);
          if (geometry2) {
            var coordinates2 = geometry2.getCoordinates();
            createOrUpdateFromCoordinate(coordinates2, extent);
            buffer2(extent, mapDistance, extent);
            var neighbors = this.source.getFeaturesInExtent(extent).filter(function(neighbor) {
              var uid = getUid(neighbor);
              if (uid in clustered) {
                return false;
              }
              clustered[uid] = true;
              return true;
            });
            this.features.push(this.createCluster(neighbors, extent));
          }
        }
      }
    };
    Cluster3.prototype.createCluster = function(features, extent) {
      var centroid2 = [0, 0];
      for (var i2 = features.length - 1; i2 >= 0; --i2) {
        var geometry_1 = this.geometryFunction(features[i2]);
        if (geometry_1) {
          add3(centroid2, geometry_1.getCoordinates());
        } else {
          features.splice(i2, 1);
        }
      }
      scale4(centroid2, 1 / features.length);
      var searchCenter = getCenter(extent);
      var ratio = this.interpolationRatio;
      var geometry2 = new Point_default([
        centroid2[0] * (1 - ratio) + searchCenter[0] * ratio,
        centroid2[1] * (1 - ratio) + searchCenter[1] * ratio
      ]);
      if (this.createCustomCluster_) {
        return this.createCustomCluster_(geometry2, features);
      } else {
        return new Feature_default2({
          geometry: geometry2,
          features
        });
      }
    };
    return Cluster3;
  }(Vector_default2)
);
var Cluster_default = Cluster;

// projects/formbird-mapping/src/lib/scl-mapping-function-open-layers.service.ts
var import_lodash5 = __toESM(require_lodash());

// projects/formbird-mapping/src/lib/map-library.ts
var import_lodash4 = __toESM(require_lodash());
var sclMapViews = new SclMapViewsService();
var MapLibrary = class {
  constructor() {
    this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
    this.map = null;
    this.marker = null;
    this.setDirtyFunction = null;
    this.singleColor = "black";
    this.multiColor = "red";
    this.singleColorDraging = "blue";
    this.multiColorDraging = "green";
    this.selectionStyle = null;
    this.selectedAssets = [];
    this.openSansAdded = false;
    this.layerAssets = [];
    this.layerIndexFilter = -1;
    this.layerIndexUser = -1;
    this.layerIndexAddress = -1;
    this.layerIndexPrimary = -1;
    this.layerIndexSecondary = -1;
    this.layerIndexTooltips = -1;
    this.layerIndexControl = -1;
    this.primaryAssetSelection = null;
    this.secondaryAssetSelection = null;
    this.isDrawModeSingle = true;
    this.modeLabel = null;
    this.heightNum = 1;
    this.lstHeatWeight = [];
    this.heatDatas = [];
    this.defaultZoom = null;
    this.defaultLat = null;
    this.defaultLon = null;
    this.compActionType = "";
    this.isMapReady = false;
    this.toolTipOnFeatureHover = null;
    this.setupTooltipUI = null;
    this.mapDiv = null;
    this.drawButtonsForOnlySingleMode = [];
    this.drawMenuChild = null;
    this.pointBtn = null;
    this.lineBtn = null;
    this.polygonBtn = null;
    this.circleBtn = null;
    this.boxBtn = null;
    this.colorWrapper = null;
    this.squareBtn = null;
    this.lineWidthWrapper = null;
    this.lineDashWrapper = null;
    this.iconWrapper = null;
    this.textBtn = null;
    this.arrowFirstPointBtn = null;
    this.arrowLastPointBtn = null;
    this.menuBtn = null;
    this.menuPointBtn = null;
    this.menuLineBtn = null;
    this.menuPolygonBtn = null;
    this.menuCircleBtn = null;
    this.menuBoxBtn = null;
    this.menuWrapper = null;
    this.menuSquareBtn = null;
    this.menuColorBtn = null;
    this.menuColorLabel = null;
    this.menuLineWidthBtn = null;
    this.menuLineWidthLabel = null;
    this.menuLineDashBtn = null;
    this.menuLineDashLabel = null;
    this.menuTextBtn = null;
    this.menuArrowFirstPointBtn = null;
    this.menuArrowLastPointBtn = null;
    this.menuIconBtn = null;
    this.menuIconLabel = null;
    this.isBottom = false;
    this.drawToolButtonSize = 40;
    this.isDrawCircleAsPolygon = false;
    this.showTooltip = true;
    this.allowDrawingMode = SclMapConstantService.DRAWING_MODE_ALL;
    this.drawingTools = [];
    this.drawingToolsFromConfig = [];
    this.drawingToolsSupported = [];
    this.totalDrawTool = 0;
    this.locationElementIcon = null;
    this.locationChecked = false;
    this.hasDocumentChangeValue = false;
    this.cacheImageUrls = [];
    this.cacheImageBase64s = [];
    this.cacheImages = [];
    this.cacheImageRequesting = [];
    this.cacheImageModifiedBase64 = [];
    this.cacheImageModifiedInfo = [];
    this.cacheImageModifiedInfoRequesting = [];
    this.type = -1;
    this.heightMapInit = 0;
    this.showSubMenuDrawStylingFunc = {};
    this.controlBtns = [];
    this.isFullScreen = false;
    this.drawColors = [];
    this.colorWrapperShow = false;
    this.drawWidths = [];
    this.lineWidthWrapperShow = false;
    this.drawDashes = [];
    this.lineDashWrapperShow = false;
    this.cssLineDashDiv = {};
    this.allowCreateNewTextBox = true;
    this.isPressKeyEscape = false;
    this.drawTypeSpecific = null;
    this.iconArrowWhiteBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIpJREFUSEvV1cEOgDAIA1D5/4/GaIKHObC0XPQ2TfrSuTA7lsfd/XplZrZ+Y9avkAAiTIU+AbUNBCgIDLBIC2D+CwV02tAAikgAsmUjQNVmDMiQUWCH/AvYza2xBtlQHAGqiSsByCinAST8PlXZjVbdXmh4G+gEP2MEbcCEww3YcAhQwktADY6tPwFHBGAZE4MTKAAAAABJRU5ErkJggg==";
    this.currentLine = null;
    this.drawIcons = [];
    this.iconWrapperShow = false;
    this.iconAnchorCurrentSelected = [0.5, 0.5];
    this.cssIconDiv = {};
    this.cssIconButtonChild = "draw-icon-button-icon";
    this.dimensionsUnit = "m";
    this.dimensionsPrecision = 2;
    this.menuDimensionBtn = null;
    this.dimensionBtn = null;
    this.dimensionEditorContainer = null;
    this.dimensionEditorInput = null;
    this.dimensionEditorCloseButton = null;
    this.closeDimensionEditorFn = null;
    this.dimensionEditorRecalculateButton = null;
    this.reCalculateDimensionFn = null;
    this.previousDimensionValue = null;
    this.drawFonts = [];
    this.fontWrapperShow = false;
    this.fontWrapper = null;
    this.menuFontBtn = null;
    this.menuFontLabel = null;
    this.fontCurrentSelected = null;
    this.fontBtn = null;
    this.drawFontSizes = [];
    this.fontSizeWrapperShow = false;
    this.fontSizeWrapper = null;
    this.menuFontSizeBtn = null;
    this.menuFontSizeLabel = null;
    this.fontSizeCurrentSelected = null;
    this.fontSizeBtn = null;
    this.showSubMenuDrawStylingFunc = {
      [SclMapConstantService.DRAWING_STYLING_COLOR]: this.showSubMenuColor.bind(this),
      [SclMapConstantService.DRAWING_STYLING_LINE_WIDTH]: this.showSubMenuLineWidth.bind(this),
      [SclMapConstantService.DRAWING_STYLING_LINE_DASH]: this.showSubMenuLineDash.bind(this),
      [SclMapConstantService.DRAWING_STYLING_ICON]: this.showSubMenuIcon.bind(this),
      [SclMapConstantService.DRAWING_STYLING_FONT]: this.showSubMenuFont.bind(this),
      [SclMapConstantService.DRAWING_STYLING_FONT_SIZE]: this.showSubMenuFontSize.bind(this)
    };
  }
  init(initObj, keyName) {
    this.type = initObj.style;
    this.keyName = keyName;
    if (initObj.color) {
      this.singleColor = initObj.color;
    }
    if (initObj.multiColor) {
      this.multiColor = initObj.multiColor;
    }
    if (initObj.setDirty) {
      this.setDirtyFunction = initObj.setDirty;
    }
    if (initObj.onTilesLoaded) {
      this.onTilesLoaded = initObj.onTilesLoaded;
    }
    if (initObj.heightNum) {
      this.heightNum = initObj.heightNum;
    }
    if (initObj.zoomFloor) {
      this.zoomFloor = initObj.zoomFloor;
    }
    if (initObj.toolTipOnFeatureHover) {
      this.toolTipOnFeatureHover = initObj.toolTipOnFeatureHover;
    }
    if (initObj.setupTooltipUI) {
      this.setupTooltipUI = initObj.setupTooltipUI;
    }
    if (initObj.target) {
      this.mapDiv = initObj.target;
      this.heightMapInit = initObj.target.offsetHeight;
    }
    if (initObj.fullScreenEvent) {
      this.fullScreenEvent = initObj.fullScreenEvent;
    }
    if (initObj.clusterClick) {
      this.clusterClick = initObj.clusterClick;
    }
    if (initObj.getLocationFn) {
      this.getLocationFn = initObj.getLocationFn;
    }
    this.isDrawCircleAsPolygon = initObj.isDrawCircleAsPolygon ? initObj.isDrawCircleAsPolygon : false;
    if (initObj.componentDefinition) {
      if (initObj.componentDefinition.drawingMode) {
        this.isDrawModeSingle = initObj.componentDefinition.drawingMode === "single" ? true : false;
      }
      this.allowDrawingMode = this.isDrawModeSingle ? SclMapConstantService.DRAWING_MODE_SINGLE : SclMapConstantService.DRAWING_MODE_MULTI;
      if (initObj.componentDefinition.drawingTools) {
        this.drawingToolsFromConfig = initObj.componentDefinition.drawingTools;
        if (this.isDrawModeSingle && this.drawingToolsFromConfig.indexOf("multi") > -1 || !this.isDrawModeSingle && this.drawingToolsFromConfig.indexOf("single") > -1) {
          this.allowDrawingMode = SclMapConstantService.DRAWING_MODE_ALL;
        }
      }
      if (initObj.componentDefinition.drawColors && Array.isArray(initObj.componentDefinition.drawColors) && initObj.componentDefinition.drawColors.length > 0) {
        this.drawColors = initObj.componentDefinition.drawColors;
        this.drawingTools.push("colors");
      }
      if (initObj.componentDefinition.drawWidth && Array.isArray(initObj.componentDefinition.drawWidth) && initObj.componentDefinition.drawWidth.length > 0) {
        this.drawWidths = initObj.componentDefinition.drawWidth;
        this.drawingTools.push("lineWidth");
      }
      if (initObj.componentDefinition.drawDash && Array.isArray(initObj.componentDefinition.drawDash) && initObj.componentDefinition.drawDash.length > 0) {
        this.drawDashes = initObj.componentDefinition.drawDash;
        this.drawingTools.push("lineDash");
      }
      if (initObj.componentDefinition.drawIcon && Array.isArray(initObj.componentDefinition.drawIcon) && initObj.componentDefinition.drawIcon.length > 0) {
        this.drawIcons = initObj.componentDefinition.drawIcon;
        this.drawingTools.push("icon");
      }
      if (initObj.componentDefinition.dimensionsUnit && typeof initObj.componentDefinition.dimensionsUnit === "string") {
        this.dimensionsUnit = initObj.componentDefinition.dimensionsUnit.toLowerCase();
      }
      if (initObj.componentDefinition.dimensionsPrecision) {
        const n = new Number(initObj.componentDefinition.dimensionsPrecision);
        if ((0, import_lodash4.isNumber)(n)) {
          this.dimensionsPrecision = initObj.componentDefinition.dimensionsPrecision;
        }
      }
      if (initObj.componentDefinition.drawFont && Array.isArray(initObj.componentDefinition.drawFont) && initObj.componentDefinition.drawFont.length > 0) {
        this.drawFonts = initObj.componentDefinition.drawFont;
        this.drawingTools.push("fontFamily");
      }
      if (initObj.componentDefinition.drawFontSize && Array.isArray(initObj.componentDefinition.drawFontSize) && initObj.componentDefinition.drawFontSize.length > 0) {
        this.drawFontSizes = initObj.componentDefinition.drawFontSize;
        this.drawingTools.push("fontSize");
      }
    }
    if (this.heightNum < 3) {
      this.isBottom = true;
    } else {
      this.isBottom = false;
    }
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY && this.heightNum < 3 || this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.heightNum === 1) {
      this.isBottom = true;
    } else {
      this.isBottom = false;
    }
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.closeTextBox = document.getElementById(`${this.keyName}_closeTextBox`);
      document.addEventListener("keyup", (event) => {
        if (event.key === "Escape") {
          const isNotCombinedKey = !(event.ctrlKey || event.altKey || event.shiftKey);
          if (isNotCombinedKey && typeof this.currentCloseTextBoxFn === "function") {
            this.currentCloseTextBoxFn();
            this.allowCreateNewTextBox = true;
            this.isPressKeyEscape = true;
          }
        }
      });
      this.dimensionEditorContainer = document.getElementById(`${this.keyName}_dimension_editor_container`);
      this.dimensionEditorInput = document.getElementById(`${this.keyName}_dimension_editor_input`);
      this.dimensionEditorCloseButton = document.getElementById(`${this.keyName}_dimension_editor_close`);
      if (this.dimensionEditorCloseButton) {
        this.dimensionEditorCloseButton.onclick = (e) => {
          if (typeof this.closeDimensionEditorFn === "function") {
            this.closeDimensionEditorFn();
          }
        };
      }
      this.dimensionEditorRecalculateButton = document.getElementById(`${this.keyName}_dimension_eitor_re_calculate`);
      if (this.dimensionEditorRecalculateButton) {
        this.dimensionEditorRecalculateButton.onclick = (e) => {
          if (typeof this.reCalculateDimensionFn === "function") {
            this.reCalculateDimensionFn();
          }
        };
      }
    }
  }
  createDrawButton(id2, title, text, css, actionFunction, isMaterialIcon, drawSpecific = null) {
    const btn = sclMapViews.createUIButton(document, actionFunction, "ol-has-tooltip", title, null);
    let iSpan = null;
    if (drawSpecific === SclMapConstantService.DRAWING_SPECIAL_ICON) {
      iSpan = document.createElement("div");
      Object.assign(iSpan.style, this.cssIconDiv);
    } else {
      iSpan = document.createElement("i");
      if (isMaterialIcon) {
        iSpan.setAttribute("class", "material-icons");
      }
      iSpan.innerHTML = text;
    }
    iSpan.id = id2 + "_icon";
    btn.appendChild(iSpan);
    btn.id = id2;
    if (css) {
      Object.assign(btn.style, css);
    }
    return { btn, iSpan };
  }
  hideDrawTool(element) {
    if (!element) {
      return;
    }
    element.style.display = "none";
  }
  hideDrawTools() {
    this.hideDrawTool(this.pointBtn);
    this.hideDrawTool(this.lineBtn);
    this.hideDrawTool(this.polygonBtn);
    this.hideDrawTool(this.circleBtn);
    this.hideDrawTool(this.boxBtn);
    this.hideDrawTool(this.textBtn);
    this.hideDrawTool(this.colorWrapper);
    this.hideDrawTool(this.lineWidthWrapper);
    this.hideDrawTool(this.lineDashWrapper);
    this.hideDrawTool(this.iconWrapper);
    this.hideDrawTool(this.arrowFirstPointBtn);
    this.hideDrawTool(this.arrowLastPointBtn);
    this.hideDrawTool(this.dimensionBtn);
    this.hideDrawTool(this.fontWrapper);
    this.hideDrawTool(this.fontSizeWrapper);
  }
  showMenuChilds(isShow) {
    const display = isShow ? "block" : "none";
    if (this.menuPointBtn) {
      this.menuPointBtn.style.display = display;
    }
    if (this.menuLineBtn) {
      this.menuLineBtn.style.display = display;
    }
    if (this.menuArrowFirstPointBtn) {
      this.menuArrowFirstPointBtn.style.display = display;
    }
    if (this.menuArrowLastPointBtn) {
      this.menuArrowLastPointBtn.style.display = display;
    }
    if (this.menuPolygonBtn) {
      this.menuPolygonBtn.style.display = display;
    }
    if (this.menuCircleBtn) {
      this.menuCircleBtn.style.display = display;
    }
    if (this.menuBoxBtn) {
      this.menuBoxBtn.style.display = display;
    }
    if (this.menuTextBtn) {
      this.menuTextBtn.style.display = display;
    }
    if (this.menuColorBtn) {
      this.menuColorBtn.style.display = display;
    }
    if (this.menuLineWidthBtn) {
      this.menuLineWidthBtn.style.display = display;
    }
    if (this.menuLineDashBtn) {
      this.menuLineDashBtn.style.display = display;
    }
    if (this.menuIconBtn) {
      this.menuIconBtn.style.display = display;
    }
    if (this.menuDimensionBtn) {
      this.menuDimensionBtn.style.display = display;
    }
    if (this.menuFontBtn) {
      this.menuFontBtn.style.display = display;
    }
    if (this.menuFontSizeBtn) {
      this.menuFontSizeBtn.style.display = display;
    }
    if (!isShow) {
      this.showStylingSubMenu(null, isShow);
    }
  }
  btnAddEvent(btn) {
    if (!btn) {
      return;
    }
    btn.onmouseover = function() {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "lightgrey";
    };
    btn.onmouseout = function() {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "white";
    };
  }
  updateDrawingSubMenuCss(mapDivSize) {
    if (!mapDivSize || !this.menuBtn || !this.drawMenuChild) {
      return;
    }
    const availableCountDrawTool = this.isDrawModeSingle ? this.totalDrawTool : this.totalDrawTool - this.drawButtonsForOnlySingleMode.length;
    const sizeMenuChilds = availableCountDrawTool * this.drawToolButtonSize;
    if (this.isBottom) {
      const heighRemain = mapDivSize - this.menuBtn.offsetHeight - 10;
      if (sizeMenuChilds > heighRemain) {
        this.drawMenuChild.style.height = `${heighRemain}px`;
        this.drawMenuChild.style.top = `${-heighRemain}px`;
        this.drawMenuChild.style.overflow = "scroll";
        this.drawMenuChild.style["overflow-x"] = "hidden";
        this.drawMenuChild.scrollTop = heighRemain;
      } else {
        this.drawMenuChild.style.removeProperty("height");
        this.drawMenuChild.style.removeProperty("overflow");
        this.drawMenuChild.style.removeProperty("overflow-x");
        this.drawMenuChild.style.top = `${-sizeMenuChilds}px`;
      }
    } else {
      const widthRemain = mapDivSize - this.menuBtn.offsetWidth - 10;
      if (sizeMenuChilds > widthRemain) {
        this.drawMenuChild.style.width = `${widthRemain}px`;
        this.drawMenuChild.style.left = `${this.drawToolButtonSize}px`;
        this.drawMenuChild.style.overflow = "scroll";
        this.drawMenuChild.style["overflow-y"] = "hidden";
      } else {
        this.drawMenuChild.style.removeProperty("width");
        this.drawMenuChild.style.removeProperty("overflow");
        this.drawMenuChild.style.removeProperty("overflow-y");
        this.drawMenuChild.style.left = `${this.drawToolButtonSize}px`;
      }
    }
  }
  updateMenuStylePositionForBottom(menuBtnElement, childWrapper) {
    const mapDivSize = this.elementWrapperForBottomPosition?.offsetHeight;
    if (!mapDivSize) {
      return;
    }
    const parentPos = this.elementWrapperForBottomPosition?.getBoundingClientRect();
    const childPos = menuBtnElement?.getBoundingClientRect();
    const top = childPos?.top - parentPos?.top;
    const left = childPos?.left - parentPos?.left;
    const bottom = Math.abs(childPos?.bottom - parentPos?.bottom);
    const css = {
      display: "flex"
    };
    if (this.drawMenuChild?.style?.overflow) {
      css.left = `${left + this.drawMenuChild?.offsetWidth}px`;
    } else {
      css.left = `${left + this.drawToolButtonSize}px`;
    }
    childWrapper?.style.removeProperty("top");
    childWrapper?.style.removeProperty("bottom");
    if (this.isFullScreen) {
      css.bottom = `${bottom}px`;
    } else {
      css.top = `${top}px`;
    }
    Object.assign(childWrapper?.style, css);
  }
  showSubMenuStylingWrapper(isShow, wrapperElement, wrapperStatus, menuBtnElement) {
    if (!wrapperElement) {
      return;
    }
    wrapperStatus = isShow;
    if (isShow) {
      if (this.isBottom) {
        this.updateMenuStylePositionForBottom(menuBtnElement, wrapperElement);
      } else {
        wrapperElement.style.display = "inline-flex";
        let index = -1;
        for (let i2 = 0; i2 < this.drawMenuChild.children.length; i2++) {
          if (this.drawMenuChild.children[i2].id == menuBtnElement.id) {
            index = i2;
            break;
          }
        }
        const space = 2;
        const wrapperRealWidth = wrapperElement.children.length * this.drawToolButtonSize + wrapperElement.children.length * space;
        const totalMenuToolOpeningWidth = (index + 1) * this.drawToolButtonSize + wrapperRealWidth + this.drawToolButtonSize + (index + 1) * space;
        const factor = this.mapDiv.offsetWidth - totalMenuToolOpeningWidth;
        if (factor < 0) {
          const width = this.mapDiv.offsetWidth - (index + 1) * this.drawToolButtonSize - (index + 1) * space - this.drawToolButtonSize - wrapperElement.children.length;
          wrapperElement.style.width = `${Math.abs(width)}px`;
          wrapperElement.style.overflow = "scroll";
          wrapperElement.style["overflow-y"] = "hidden";
          wrapperElement.style.bottom = "-15px";
        } else {
          wrapperElement.style.removeProperty("width");
          wrapperElement.style.removeProperty("overflow");
          wrapperElement.style.removeProperty("overflow-y");
          wrapperElement.style.bottom = "1px";
          wrapperElement.style.width = `${wrapperRealWidth}px`;
        }
      }
    } else {
      wrapperElement.style.display = "none";
    }
    return wrapperStatus;
  }
  showStylingSubMenu(currentStyling, isShow) {
    for (let key in this.showSubMenuDrawStylingFunc) {
      if (key === currentStyling) {
        continue;
      }
      this.showSubMenuDrawStylingFunc[key](isShow);
    }
  }
  // draw colors
  showSubMenuColor(isShow) {
    this.colorWrapperShow = this.showSubMenuStylingWrapper(isShow, this.colorWrapper, this.colorWrapperShow, this.menuColorBtn);
  }
  colorAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_COLOR, false);
    this.colorWrapperShow = !this.colorWrapperShow;
    this.showSubMenuColor(this.colorWrapperShow);
  }
  setColorForButtonColor(element, color2) {
    if (element) {
      const css = { "background-color": color2, color: color2 };
      Object.assign(element.style, css);
    }
  }
  setColorForMenuDrawColor(color2) {
    this.setColorForButtonColor(this.menuColorLabel, color2);
  }
  drawColorChildAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawColors.length) {
      this.setColorForMenuDrawColor(this.drawColors[childIndex]);
      this.colorCurrentSelected = this.drawColors[childIndex];
    }
  }
  createADrawButtonStyle(i2, id2, title, text, css, onClickFn, wrapper, layerIds, styleFn, style2, isMaterialIcon, drawSpecific = null) {
    const obj = this.createDrawButton(id2, title, text, css, null, isMaterialIcon, drawSpecific);
    obj.btn.addEventListener("click", (e) => {
      onClickFn(e, i2);
    });
    styleFn(obj.iSpan, style2);
    this.btnAddEvent(obj.btn);
    layerIds.push(obj.btn.id);
    wrapper.appendChild(obj.btn);
    return layerIds;
  }
  createDrawButtonStyling(compId, layerIds, css, arr, wrapper, wrapperSubId, wrapperCssBottom, wrapperCssMiddleLeft, onClickFn, styleFn, menuBtnStyling, childBtnSubId, colorBtnText, parentForBottomPosition, isMaterialIcon, drawSpecific) {
    if (arr.length > 0) {
      wrapper = document.createElement("div");
      wrapper.id = compId + wrapperSubId;
      wrapper.style["z-index"] = 2;
      for (let i2 = 0; i2 < arr.length; i2++) {
        layerIds = this.createADrawButtonStyle(i2, compId + childBtnSubId + i2, arr[i2].fileNo, colorBtnText, css, onClickFn, wrapper, layerIds, styleFn, arr[i2], isMaterialIcon, drawSpecific);
      }
      if (this.isBottom) {
        wrapper.setAttribute("class", wrapperCssBottom);
        parentForBottomPosition.appendChild(wrapper);
      } else {
        wrapper.setAttribute("class", wrapperCssMiddleLeft);
        menuBtnStyling.appendChild(wrapper);
      }
    }
    return { layerIds, wrapper };
  }
  // draw line width
  lineWidthAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_LINE_WIDTH, false);
    this.lineWidthWrapperShow = !this.lineWidthWrapperShow;
    this.showSubMenuLineWidth(this.lineWidthWrapperShow);
  }
  showSubMenuLineWidth(isShow) {
    this.lineWidthWrapperShow = this.showSubMenuStylingWrapper(isShow, this.lineWidthWrapper, this.lineWidthWrapperShow, this.menuLineWidthBtn);
  }
  setWidthForButtonLineWidth(element, width) {
    if (element) {
      element.innerHTML = "";
      const icon = document.createElement("div");
      const css = {
        "height": `${this.drawToolButtonSize / 2}px`,
        "width": `${width}px`,
        "border-radius": "5px",
        "background-color": "black",
        "transform": "rotate(30deg)"
      };
      Object.assign(icon.style, css);
      element.appendChild(icon);
    }
  }
  setValueForSubMenuDrawLineWidth(width) {
    this.setWidthForButtonLineWidth(this.menuLineWidthLabel, width);
  }
  drawLineWidthSubMenuAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawWidths.length) {
      this.setValueForSubMenuDrawLineWidth(this.drawWidths[childIndex]);
      this.lineWidthCurrentSelected = this.drawWidths[childIndex];
    }
  }
  // draw line dash
  lineDashAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_LINE_DASH, false);
    this.lineDashWrapperShow = !this.lineDashWrapperShow;
    this.showSubMenuLineDash(this.lineDashWrapperShow);
  }
  showSubMenuLineDash(isShow) {
    this.lineDashWrapperShow = this.showSubMenuStylingWrapper(isShow, this.lineDashWrapper, this.lineDashWrapperShow, this.menuLineDashBtn);
  }
  setValueForButtonLineDash(element, value) {
    if (element && Array.isArray(value) && value.length > 1) {
      element.innerHTML = "";
      const icon = document.createElement("div");
      const btnSize = this.drawToolButtonSize / 2;
      const total = value[0] + value[1] + 1;
      const factor = btnSize / total;
      const start1 = 0;
      const stop1 = value[0] * factor;
      const start2 = stop1 + factor;
      const stop2 = start2 + value[1] * factor;
      const css = {
        "height": `2px`,
        "border-radius": "5px",
        "width": `${btnSize}px`,
        "background": `repeating-linear-gradient(
                    to right,
                    black ${start1}px,
                    black ${stop1}px,
                    transparent ${stop1}px,
                    transparent ${start2}px,
                    black ${start2}px,
                    black ${stop2}px`,
        "transform": "rotate(297deg)"
      };
      Object.assign(icon.style, css);
      element.appendChild(icon);
    }
  }
  setValueForSubMenuDrawLineDash(value) {
    this.setValueForButtonLineDash(this.menuLineDashLabel, value);
  }
  drawLineDashSubMenuAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawDashes.length) {
      this.setValueForSubMenuDrawLineDash(this.drawDashes[childIndex]);
      this.lineDashCurrentSelected = this.drawDashes[childIndex];
    }
  }
  // draw icons
  showSubMenuIcon(isShow) {
    this.iconWrapperShow = this.showSubMenuStylingWrapper(isShow, this.iconWrapper, this.iconWrapperShow, this.menuIconBtn);
  }
  iconAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_ICON, false);
    this.iconWrapperShow = !this.iconWrapperShow;
    this.showSubMenuIcon(this.iconWrapperShow);
    if (this.iconWrapperShow == false) {
      this.drawIconAction(e);
    }
  }
  setIconForButtonIcon(element, icon) {
    if (element) {
      const imgId = `${element.id}_img`;
      const imgSrc = `api/getFile/${icon.fileNo}`;
      if (element.innerHTML.indexOf(imgId) < 0) {
        element.innerHTML = "";
        element.style.height = `${this.drawToolButtonSize}px`;
        element.style.width = `${this.drawToolButtonSize}px`;
        const img = document.createElement("img");
        img.id = imgId;
        img.src = imgSrc;
        img.className = this.cssIconButtonChild;
        element.appendChild(img);
      } else {
        const img = document.getElementById(imgId);
        img.src = imgSrc;
      }
    }
  }
  setIconForMenuDrawIcon(icon) {
    this.setIconForButtonIcon(this.menuIconLabel, icon);
  }
  drawIconChildAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawIcons.length) {
      this.setIconForMenuDrawIcon(this.drawIcons[childIndex]);
      this.iconCurrentSelected = `api/getFile/${this.drawIcons[childIndex].fileNo}`;
      this.iconAnchorCurrentSelected = this.drawIcons[childIndex].imageAnchor ? this.drawIcons[childIndex].imageAnchor : [0.5, 0.5];
    }
  }
  // draw fonts
  showSubMenuFont(isShow) {
    this.fontWrapperShow = this.showSubMenuStylingWrapper(isShow, this.fontWrapper, this.fontWrapperShow, this.menuFontBtn);
  }
  fontAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_FONT, false);
    this.fontWrapperShow = !this.fontWrapperShow;
    this.showSubMenuFont(this.fontWrapperShow);
    if (this.fontWrapperShow == false) {
    }
  }
  setFontForButtonFont(element, fontFamily) {
    if (element) {
      const divId = `${element.id}_font`;
      if (element.innerHTML.indexOf(divId) < 0) {
        element.innerHTML = "";
        element.style.height = `${this.drawToolButtonSize}px`;
        element.style.width = `${this.drawToolButtonSize}px`;
        const div = document.createElement("div");
        div.id = divId;
        div.innerHTML = fontFamily.charAt(0);
        element.appendChild(div);
      } else {
        const div = document.getElementById(divId);
        div.innerHTML = fontFamily.charAt(0);
      }
    }
  }
  setFontForMenuDrawFont(fontFamily) {
    this.setFontForButtonFont(this.menuFontLabel, fontFamily);
  }
  drawFontChildAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawFonts.length) {
      this.setFontForMenuDrawFont(this.drawFonts[childIndex]);
      this.fontCurrentSelected = this.drawFonts[childIndex];
    }
  }
  // draw font size
  showSubMenuFontSize(isShow) {
    this.fontSizeWrapperShow = this.showSubMenuStylingWrapper(isShow, this.fontSizeWrapper, this.fontSizeWrapperShow, this.menuFontSizeBtn);
  }
  fontSizeAction(e) {
    this.showStylingSubMenu(SclMapConstantService.DRAWING_STYLING_FONT_SIZE, false);
    this.fontSizeWrapperShow = !this.fontSizeWrapperShow;
    this.showSubMenuFontSize(this.fontSizeWrapperShow);
    if (this.fontSizeWrapperShow == false) {
    }
  }
  setFontSizeForButtonFontSize(element, fontSize) {
    if (element) {
      element.innerHTML = fontSize;
    }
  }
  setFontSizeForMenuDrawFontSize(fontSize) {
    this.setFontSizeForButtonFontSize(this.menuFontSizeLabel, fontSize);
  }
  drawFontSizeChildAction(e, childIndex) {
    e.stopPropagation();
    if (childIndex < this.drawFontSizes.length) {
      this.setFontSizeForMenuDrawFontSize(this.drawFontSizes[childIndex]);
      this.fontSizeCurrentSelected = this.drawFontSizes[childIndex];
    }
  }
  //
  showMenu(isShow) {
  }
  showMenuButton(isShow) {
    this.menuBtn.style.display = isShow ? "block" : "none";
  }
  menuChildAction(childIndex) {
    if (this.allowDrawingMode == SclMapConstantService.DRAWING_MODE_SINGLE && !this.isDrawModeSingle || this.allowDrawingMode == SclMapConstantService.DRAWING_MODE_MULTI && this.isDrawModeSingle) {
      return;
    }
    this.hideDrawTools();
    this.showMenu(false);
    this.showMenuButton(false);
    switch (childIndex) {
      case 0:
        this.pointAction({ currentTarget: this.pointBtn });
        this.pointBtn.style.display = "block";
        break;
      case 1:
        this.lineAction({ currentTarget: this.lineBtn });
        this.lineBtn.style.display = "block";
        break;
      case 2:
        this.polygonAction({ currentTarget: this.polygonBtn });
        this.polygonBtn.style.display = "block";
        break;
      case 3:
        this.circleAction({ currentTarget: this.circleBtn });
        this.circleBtn.style.display = "block";
        break;
      case 4:
        this.squareAction({ currentTarget: this.squareBtn });
        this.squareBtn.style.display = "block";
        break;
      case 5:
        this.boxAction({ currentTarget: this.boxBtn });
        this.boxBtn.style.display = "block";
        break;
      case 6:
        this.textAction({ currentTarget: this.textBtn });
        this.textBtn.style.display = "block";
        break;
      case 7:
        this.arrowAtFirstPointAction({ currentTarget: this.arrowFirstPointBtn });
        this.arrowFirstPointBtn.style.display = "block";
        break;
      case 8:
        this.arrowAtLastPointAction({ currentTarget: this.arrowLastPointBtn });
        this.arrowLastPointBtn.style.display = "block";
        break;
      case 9:
        this.dimensionAction({ currentTarget: this.dimensionBtn });
        this.dimensionBtn.style.display = "block";
        break;
      default:
        break;
    }
  }
  modeAction(e) {
  }
  selectAction(e) {
  }
  locationAction(e) {
  }
  deleteAction(e) {
  }
  menuAction(e) {
  }
  pointAction(e) {
  }
  lineAction(e) {
  }
  polygonAction(e) {
  }
  circleAction(e) {
  }
  squareAction(e) {
  }
  boxAction(e) {
  }
  textAction(e) {
  }
  arrowAtFirstPointAction(e) {
  }
  arrowAtLastPointAction(e) {
  }
  drawIconAction(e) {
  }
  dimensionAction(e) {
  }
  addDrawButtons(layerIds, compId, css, drawMenuChildClassName) {
    for (let i2 = 0; i2 < this.drawingToolsSupported.length; i2++) {
      if (this.drawingToolsFromConfig.indexOf(this.drawingToolsSupported[i2]) > -1 && this.drawingTools.indexOf(this.drawingToolsSupported[i2]) < 0) {
        this.drawingTools.push(this.drawingToolsSupported[i2]);
      }
    }
    console.log(`**** drawingTools = ${this.drawingTools}`);
    this.controlBtns = [];
    this.totalDrawTool = 0;
    const objMode = this.createDrawButton(
      /*id*/
      compId + "_Mode",
      /*title*/
      this.isDrawModeSingle ? "Single mode" : "Multi mode",
      /*text*/
      this.isDrawModeSingle ? "layers_clear" : "layers",
      /*css*/
      css,
      /*actionFunction*/
      this.modeAction.bind(this),
      true
    );
    const modeBtn = objMode.btn;
    this.modeLabel = objMode.iSpan;
    this.controlBtns.push(modeBtn);
    layerIds.push(modeBtn.id);
    const objSelect = this.createDrawButton(compId + "_Select", "Select", "create", css, this.selectAction.bind(this), true);
    const selectBtn = objSelect.btn;
    this.controlBtns.push(selectBtn);
    layerIds.push(selectBtn.id);
    const objMenu = this.createDrawButton(compId + "_Menu", "Menu", "menu", css, this.menuAction.bind(this), true);
    this.menuBtn = objMenu.btn;
    this.controlBtns.push(this.menuBtn);
    layerIds.push(this.menuBtn.id);
    if (this.drawingTools.indexOf("point") > -1) {
      const objPoint = this.createDrawButton(compId + "_mPoint", "Point", "pin_drop", css, this.menuChildAction.bind(this, 0), true);
      this.menuPointBtn = objPoint.btn;
      this.controlBtns.push(this.menuPointBtn);
      const objPointBtn = this.createDrawButton(compId + "_Point", "Point", "pin_drop", css, this.pointAction.bind(this), true);
      this.pointBtn = objPointBtn.btn;
      layerIds.push(this.pointBtn.id);
      this.controlBtns.push(this.pointBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("line") > -1) {
      const objLine = this.createDrawButton(compId + "_mLine", "Line", "linear_scale", css, this.menuChildAction.bind(this, 1), true);
      this.menuLineBtn = objLine.btn;
      this.controlBtns.push(this.menuLineBtn);
      const objLineBtn = this.createDrawButton(compId + "_Line", "Line", "linear_scale", css, this.lineAction.bind(this), true);
      this.lineBtn = objLineBtn.btn;
      layerIds.push(this.lineBtn.id);
      this.controlBtns.push(this.lineBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("arrowAtFirstPoint") > -1) {
      const title = "Arrow head at first point";
      const icon = "arrow_back";
      const objArrow = this.createDrawButton(compId + "_mArrowFirstPoint", title, icon, css, this.menuChildAction.bind(this, 7), true);
      this.menuArrowFirstPointBtn = objArrow.btn;
      this.controlBtns.push(this.menuArrowFirstPointBtn);
      const objArrowBtn = this.createDrawButton(compId + "_ArrowFirstPoint", title, icon, css, this.arrowAtFirstPointAction.bind(this), true);
      this.arrowFirstPointBtn = objArrowBtn.btn;
      layerIds.push(this.arrowFirstPointBtn.id);
      this.controlBtns.push(this.arrowFirstPointBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("arrowAtLastPoint") > -1) {
      const title1 = "Arrow head at last point";
      const icon1 = "arrow_forward";
      const objArrow1 = this.createDrawButton(compId + "_mArrowLastPoint", title1, icon1, css, this.menuChildAction.bind(this, 8), true);
      this.menuArrowLastPointBtn = objArrow1.btn;
      this.controlBtns.push(this.menuArrowLastPointBtn);
      const objArrowBtn1 = this.createDrawButton(compId + "_ArrowLastPoint", title1, icon1, css, this.arrowAtLastPointAction.bind(this), true);
      this.arrowLastPointBtn = objArrowBtn1.btn;
      layerIds.push(this.arrowLastPointBtn.id);
      this.controlBtns.push(this.arrowLastPointBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("polygon") > -1) {
      const objPolygon = this.createDrawButton(compId + "_mPolygon", "Polygon", "turned_in_not", css, this.menuChildAction.bind(this, 2), true);
      this.menuPolygonBtn = objPolygon.btn;
      this.controlBtns.push(this.menuPolygonBtn);
      const objPolygonBtn = this.createDrawButton(compId + "_Polygon", "Polygon", "turned_in_not", css, this.polygonAction.bind(this), true);
      this.polygonBtn = objPolygonBtn.btn;
      layerIds.push(this.polygonBtn.id);
      this.controlBtns.push(this.polygonBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("circle") > -1) {
      const objCircle = this.createDrawButton(compId + "_mCircle", "Circle", "radio_button_unchecked", css, this.menuChildAction.bind(this, 3), true);
      this.menuCircleBtn = objCircle.btn;
      this.controlBtns.push(this.menuCircleBtn);
      this.drawButtonsForOnlySingleMode.push(this.menuCircleBtn);
      const objCircleBtn = this.createDrawButton(compId + "_Circle", "Circle", "radio_button_unchecked", css, this.circleAction.bind(this), true);
      this.circleBtn = objCircleBtn.btn;
      layerIds.push(this.circleBtn.id);
      this.controlBtns.push(this.circleBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("square") > -1) {
      const objSquare = this.createDrawButton(
        /*id*/
        compId + "_mSquare",
        /*title*/
        "Square",
        /*text*/
        "crop_rotate",
        /*css*/
        null,
        /*actionFunction*/
        this.menuChildAction.bind(this, 4),
        true
      );
      this.menuSquareBtn = objSquare.btn;
      this.controlBtns.push(this.menuSquareBtn);
      this.drawButtonsForOnlySingleMode.push(this.menuSquareBtn);
      const objSquareBtn = this.createDrawButton(
        /*id*/
        compId + "_Square",
        /*title*/
        "Square",
        /*text*/
        "crop_rotate",
        /*css*/
        null,
        /*actionFunction*/
        this.squareAction.bind(this),
        true
      );
      this.squareBtn = objSquareBtn.btn;
      layerIds.push(this.squareBtn.id);
      this.controlBtns.push(this.squareBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("box") > -1) {
      const objBox = this.createDrawButton(compId + "_mBox", "Box", "check_box_outline_blank", css, this.menuChildAction.bind(this, 5), true);
      this.menuBoxBtn = objBox.btn;
      this.controlBtns.push(this.menuBoxBtn);
      const objBoxBtn = this.createDrawButton(compId + "_Box", "Box", "check_box_outline_blank", css, this.boxAction.bind(this), true);
      this.boxBtn = objBoxBtn.btn;
      layerIds.push(this.boxBtn.id);
      this.controlBtns.push(this.boxBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("text") > -1) {
      const objText = this.createDrawButton(compId + "_mText", "Text", "A", css, this.menuChildAction.bind(this, 6), true);
      this.menuTextBtn = objText.btn;
      this.controlBtns.push(this.menuTextBtn);
      const objTextBtn = this.createDrawButton(compId + "_Text", "Text", "A", css, this.textAction.bind(this), true);
      this.textBtn = objTextBtn.btn;
      layerIds.push(this.textBtn.id);
      this.controlBtns.push(this.textBtn);
      this.totalDrawTool++;
    }
    if (this.drawingTools.indexOf("dimension") > -1) {
      const objDimension = this.createDrawButton(compId + "_mDimension", "Dimension", "D", css, this.menuChildAction.bind(this, 9), true);
      this.menuDimensionBtn = objDimension.btn;
      this.controlBtns.push(this.menuDimensionBtn);
      const objDimensionBtn = this.createDrawButton(compId + "_Dimension", "Dimension", "D", css, this.dimensionAction.bind(this), true);
      this.dimensionBtn = objDimensionBtn.btn;
      layerIds.push(this.dimensionBtn.id);
      this.controlBtns.push(this.dimensionBtn);
      this.drawButtonsForOnlySingleMode.push(this.menuDimensionBtn);
      this.totalDrawTool++;
    }
    if (this.drawColors.length > 0) {
      const objColor = this.createDrawButton(compId + "_mColor", "Select drawing color", "check_box_outline_blank", css, this.colorAction.bind(this), true);
      this.menuColorLabel = objColor.iSpan;
      this.setColorForMenuDrawColor(this.drawColors[0]);
      this.menuColorBtn = objColor.btn;
      this.controlBtns.push(this.menuColorBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawColors, this.colorWrapper, "_ColorWrapper", "draw-color-wrapper-vertical", "draw-color-wrapper-horizontal", this.drawColorChildAction.bind(this), this.setColorForButtonColor.bind(this), this.menuColorBtn, "_Color_", "check_box_outline_blank", this.elementWrapperForBottomPosition, true, null);
      layerIds = objDraw.layerIds;
      this.colorWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    if (this.drawWidths.length > 0) {
      const objLineWidth = this.createDrawButton(compId + "_mLineWidth", "Select drawing width for lines and points", "check_box_outline_blank", css, this.lineWidthAction.bind(this), true);
      this.menuLineWidthLabel = objLineWidth.iSpan;
      this.setValueForSubMenuDrawLineWidth(this.drawWidths[0]);
      this.menuLineWidthBtn = objLineWidth.btn;
      this.controlBtns.push(this.menuLineWidthBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawWidths, this.lineWidthWrapper, "_LineWidthWrapper", "draw-color-wrapper-vertical", "draw-line-width-wrapper-horizontal", this.drawLineWidthSubMenuAction.bind(this), this.setWidthForButtonLineWidth.bind(this), this.menuLineWidthBtn, "_Line_Width_", "check_box_outline_blank", this.elementWrapperForBottomPosition, true, null);
      layerIds = objDraw.layerIds;
      this.lineWidthWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    if (this.drawDashes.length > 0) {
      const objLineDash = this.createDrawButton(compId + "_mLineDash", "Select drawing dashed for lines", "check_box_outline_blank", css, this.lineDashAction.bind(this), null);
      this.menuLineDashLabel = objLineDash.iSpan;
      this.setValueForSubMenuDrawLineDash(this.drawDashes[0]);
      this.menuLineDashBtn = objLineDash.btn;
      this.controlBtns.push(this.menuLineDashBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawDashes, this.lineDashWrapper, "_LineDashWrapper", "draw-color-wrapper-vertical", "draw-line-dash-wrapper-horizontal", this.drawLineDashSubMenuAction.bind(this), this.setValueForButtonLineDash.bind(this), this.menuLineDashBtn, "_Line_Dash_", "check_box_outline_blank", this.elementWrapperForBottomPosition, true, null);
      layerIds = objDraw.layerIds;
      this.lineDashWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    if (this.drawIcons.length > 0) {
      const objIcon = this.createDrawButton(compId + "_mIcon", "Select drawing icon", "photo_library", css, this.iconAction.bind(this), true, SclMapConstantService.DRAWING_SPECIAL_ICON);
      this.menuIconLabel = objIcon.iSpan;
      this.setIconForMenuDrawIcon(this.drawIcons[0]);
      this.menuIconBtn = objIcon.btn;
      this.controlBtns.push(this.menuIconBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawIcons, this.iconWrapper, "_IconWrapper", "draw-color-wrapper-vertical", "draw-icon-wrapper-horizontal", this.drawIconChildAction.bind(this), this.setIconForButtonIcon.bind(this), this.menuIconBtn, "_Icon_", "photo_library", this.elementWrapperForBottomPosition, true, SclMapConstantService.DRAWING_SPECIAL_ICON);
      layerIds = objDraw.layerIds;
      this.iconWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    if (this.drawFonts.length > 0) {
      const objFont = this.createDrawButton(compId + "_mFont", "Select font", "F", css, this.fontAction.bind(this), true, SclMapConstantService.DRAWING_STYLING_FONT);
      this.menuFontLabel = objFont.iSpan;
      this.setFontForMenuDrawFont(this.drawFonts[0]);
      this.menuFontBtn = objFont.btn;
      this.controlBtns.push(this.menuFontBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawFonts, this.fontWrapper, "_FontWrapper", "draw-color-wrapper-vertical", "draw-font-wrapper-horizontal", this.drawFontChildAction.bind(this), this.setFontForButtonFont.bind(this), this.menuFontBtn, "_Font_", "F", this.elementWrapperForBottomPosition, true, SclMapConstantService.DRAWING_STYLING_FONT);
      layerIds = objDraw.layerIds;
      this.fontWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    if (this.drawFontSizes.length > 0) {
      const objFontSize = this.createDrawButton(compId + "_mFontSize", "Select font size", "FS", css, this.fontSizeAction.bind(this), false, SclMapConstantService.DRAWING_STYLING_FONT_SIZE);
      this.menuFontSizeLabel = objFontSize.iSpan;
      this.setFontSizeForMenuDrawFontSize(this.drawFontSizes[0]);
      this.menuFontSizeBtn = objFontSize.btn;
      this.controlBtns.push(this.menuFontSizeBtn);
      const objDraw = this.createDrawButtonStyling(compId, layerIds, this.drawStylingButtonCss, this.drawFontSizes, this.fontSizeWrapper, "_FontSizeWrapper", "draw-color-wrapper-vertical", "draw-font-wrapper-horizontal", this.drawFontSizeChildAction.bind(this), this.setFontSizeForButtonFontSize.bind(this), this.menuFontSizeBtn, "_Font_Size_", "FS", this.elementWrapperForBottomPosition, false, SclMapConstantService.DRAWING_STYLING_FONT_SIZE);
      layerIds = objDraw.layerIds;
      this.fontSizeWrapper = objDraw.wrapper;
      this.totalDrawTool++;
    }
    let locationBtn;
    if (this.drawingTools.indexOf("currentLocation") > -1) {
      const objLocation = this.createDrawButton(compId + "_Current_Location", "Current Location", "my_location", css, this.locationAction.bind(this), true);
      locationBtn = objLocation.btn;
      this.locationElementIcon = objLocation.iSpan;
      this.locationChecked = false;
      layerIds.push(locationBtn.id);
      this.controlBtns.push(locationBtn);
    }
    let deleteBtn;
    if (this.drawingTools.indexOf("delete") > -1) {
      const objDelete = this.createDrawButton(compId + "_Delete", "Delete", "delete", css, this.deleteAction.bind(this), true);
      deleteBtn = objDelete.btn;
      layerIds.push(deleteBtn.id);
      this.controlBtns.push(deleteBtn);
    }
    this.drawMenuChild = document.createElement("div");
    this.drawMenuChild.id = compId + "_DrawMenuChild";
    this.drawMenuChild.className = drawMenuChildClassName;
    if (this.isBottom) {
      if (this.menuFontSizeBtn) {
        this.drawMenuChild.appendChild(this.menuFontSizeBtn);
      }
      if (this.menuFontBtn) {
        this.drawMenuChild.appendChild(this.menuFontBtn);
      }
      if (this.menuIconBtn) {
        this.drawMenuChild.appendChild(this.menuIconBtn);
      }
      if (this.menuLineDashBtn) {
        this.drawMenuChild.appendChild(this.menuLineDashBtn);
      }
      if (this.menuLineWidthBtn) {
        this.drawMenuChild.appendChild(this.menuLineWidthBtn);
      }
      if (this.menuColorBtn) {
        this.drawMenuChild.appendChild(this.menuColorBtn);
      }
      if (this.menuDimensionBtn) {
        this.drawMenuChild.appendChild(this.menuDimensionBtn);
      }
      if (this.menuTextBtn) {
        this.drawMenuChild.appendChild(this.menuTextBtn);
      }
      if (this.menuBoxBtn) {
        this.drawMenuChild.appendChild(this.menuBoxBtn);
      }
      if (this.menuSquareBtn) {
        this.drawMenuChild.appendChild(this.menuSquareBtn);
      }
      if (this.menuCircleBtn) {
        this.drawMenuChild.appendChild(this.menuCircleBtn);
      }
      if (this.menuPolygonBtn) {
        this.drawMenuChild.appendChild(this.menuPolygonBtn);
      }
      if (this.menuArrowFirstPointBtn) {
        this.drawMenuChild.appendChild(this.menuArrowFirstPointBtn);
      }
      if (this.menuArrowLastPointBtn) {
        this.drawMenuChild.appendChild(this.menuArrowLastPointBtn);
      }
      if (this.menuLineBtn) {
        this.drawMenuChild.appendChild(this.menuLineBtn);
      }
      if (this.menuPointBtn) {
        this.drawMenuChild.appendChild(this.menuPointBtn);
      }
    } else {
      if (this.menuPointBtn) {
        this.drawMenuChild.appendChild(this.menuPointBtn);
      }
      if (this.menuLineBtn) {
        this.drawMenuChild.appendChild(this.menuLineBtn);
      }
      if (this.menuArrowFirstPointBtn) {
        this.drawMenuChild.appendChild(this.menuArrowFirstPointBtn);
      }
      if (this.menuArrowLastPointBtn) {
        this.drawMenuChild.appendChild(this.menuArrowLastPointBtn);
      }
      if (this.menuPolygonBtn) {
        this.drawMenuChild.appendChild(this.menuPolygonBtn);
      }
      if (this.menuCircleBtn) {
        this.drawMenuChild.appendChild(this.menuCircleBtn);
      }
      if (this.menuSquareBtn) {
        this.drawMenuChild.appendChild(this.menuSquareBtn);
      }
      if (this.menuBoxBtn) {
        this.drawMenuChild.appendChild(this.menuBoxBtn);
      }
      if (this.menuTextBtn) {
        this.drawMenuChild.appendChild(this.menuTextBtn);
      }
      if (this.menuDimensionBtn) {
        this.drawMenuChild.appendChild(this.menuDimensionBtn);
      }
      if (this.menuColorBtn) {
        this.drawMenuChild.appendChild(this.menuColorBtn);
      }
      if (this.menuLineWidthBtn) {
        this.drawMenuChild.appendChild(this.menuLineWidthBtn);
      }
      if (this.menuLineDashBtn) {
        this.drawMenuChild.appendChild(this.menuLineDashBtn);
      }
      if (this.menuIconBtn) {
        this.drawMenuChild.appendChild(this.menuIconBtn);
      }
      if (this.menuFontBtn) {
        this.drawMenuChild.appendChild(this.menuFontBtn);
      }
      if (this.menuFontSizeBtn) {
        this.drawMenuChild.appendChild(this.menuFontSizeBtn);
      }
    }
    this.menuWrapper = document.createElement("div");
    this.menuWrapper.id = compId + "_MenuWrapper";
    if (this.pointBtn) {
      this.menuWrapper.appendChild(this.pointBtn);
    }
    if (this.lineBtn) {
      this.menuWrapper.appendChild(this.lineBtn);
    }
    if (this.arrowFirstPointBtn) {
      this.menuWrapper.appendChild(this.arrowFirstPointBtn);
    }
    if (this.arrowLastPointBtn) {
      this.menuWrapper.appendChild(this.arrowLastPointBtn);
    }
    if (this.polygonBtn) {
      this.menuWrapper.appendChild(this.polygonBtn);
    }
    if (this.circleBtn) {
      this.menuWrapper.appendChild(this.circleBtn);
    }
    if (this.squareBtn) {
      this.menuWrapper.appendChild(this.squareBtn);
    }
    if (this.boxBtn) {
      this.menuWrapper.appendChild(this.boxBtn);
    }
    if (this.textBtn) {
      this.menuWrapper.appendChild(this.textBtn);
    }
    if (this.dimensionBtn) {
      this.menuWrapper.appendChild(this.dimensionBtn);
    }
    if (this.menuBtn) {
      this.menuWrapper.appendChild(this.menuBtn);
    }
    if (this.drawMenuChild) {
      this.menuWrapper.appendChild(this.drawMenuChild);
    }
    this.showMenu(false);
    this.hideDrawTools();
    for (let i2 = 0; i2 < this.controlBtns.length; i2++) {
      this.btnAddEvent(this.controlBtns[i2]);
    }
    this.drawingMenu.appendChild(modeBtn);
    this.drawingMenu.appendChild(selectBtn);
    this.drawingMenu.appendChild(this.menuWrapper);
    if (locationBtn) {
      this.drawingMenu.appendChild(locationBtn);
    }
    if (deleteBtn) {
      this.drawingMenu.appendChild(deleteBtn);
    }
  }
};

// projects/formbird-mapping/src/lib/scl-mapping-function-open-layers.service.ts
var uuid2 = __toESM(require_uuid());
var sclUtilMap = new SclUtilMapService();
var sclProjectionConstant = SclProjectionConstantService;
var sclMapViews2 = new SclMapViewsService();
var sclAssetLayers = new SclAssetLayersService();
var _OpenlayerDrawType = class _OpenlayerDrawType {
};
_OpenlayerDrawType.NA = "";
_OpenlayerDrawType.POINT = "Point";
_OpenlayerDrawType.LINE_STRING = "LineString";
_OpenlayerDrawType.POLYGON = "Polygon";
_OpenlayerDrawType.CIRCLE = "Circle";
_OpenlayerDrawType.SQUARE = "Square";
_OpenlayerDrawType.BOX = "Box";
_OpenlayerDrawType.MULTI_POINT = "MultiPoint";
_OpenlayerDrawType.MULTI_LINE_STRING = "MultiLineString";
_OpenlayerDrawType.MULTI_POLYGON = "MultiPolygon";
_OpenlayerDrawType.TEXT = "text";
var OpenlayerDrawType = _OpenlayerDrawType;
function olInherits(child, parent) {
  child.prototype = Object.create(parent.prototype);
  child.prototype.constructor = child;
}
var _SclMappingFunctionOpenLayersService = class _SclMappingFunctionOpenLayersService extends MapLibrary {
  constructor() {
    super();
    this.proj4s = lib_default;
    this.wmsState = { hasTile: false, hasEvent: false, finishLoad: false, tileCount: 0, hasTransparency: false, waitMapRender: null };
    this.fitObject = { hasCall: false, service: null, maxZoom: null, initialZoomChange: null };
    this.positionObject = { hasCall: false, lat: null, lon: null, zoom: null, epsg: null };
    this.layersRedraw = false;
    this.layersRedrawCount = 0;
    this.assetOfLayers = {};
    this.fromFitData = false;
    this.hasClickButtonZoom = false;
    this.onMapWheelScroll = null;
    this.fitPadding = 0;
    this.countGetImgSrc = 0;
    this.minResolution = null;
    this.maxResolution = null;
    this.sketch = null;
    this.sketchGeomOnChange = null;
    this.sketchGPS = null;
    this.sketchGPSPoints = [];
    this.setupMapControlInterval = null;
    this.setupMapControlIntervalLimit = 10;
    this.setupMapControlIntervalCount = 0;
    console.log("************ OL using dynamic style");
    this.zoomFloor = 12;
    this.drawingToolsSupported = [
      "point",
      "line",
      "polygon",
      "circle",
      "square",
      "box",
      "text",
      "currentLocation",
      "delete",
      "arrowAtFirstPoint",
      "arrowAtLastPoint",
      "dimension"
    ];
    this.totalDrawTool = 7;
  }
  load(cb) {
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  interactionSelect() {
    this.select = new Select_default();
  }
  interactionModify() {
    this.modify = new Modify_default({
      features: this.select.getFeatures()
    });
    this.modify.on("modifystart", (e) => {
    });
    this.modify.on("modifyend", (e) => {
      if (this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
        this.setDirtyFunction();
      }
    });
  }
  interactionSelectMultiple(isActive, cb) {
    this.selectMultiple = new Select_default({
      multi: true,
      condition: click,
      toggleCondition: primaryAction,
      style: this.styleSelectedFunc.bind(this)
    });
    this.selectMultiple.setActive(isActive);
    const self2 = this;
    this.selectMultiple.on("select", function(e) {
      const selected = e.target.getFeatures();
      for (let i2 = 0; i2 < selected.getLength(); i2++) {
        const fea = selected.getArray()[i2];
        if (fea === "undefined" || fea == null) {
          continue;
        }
        const pro = fea.getProperties();
        if (pro == null) {
          continue;
        }
        if (!pro.layerDisplayOnly) {
          self2.addFeature(fea, self2.layerIndexUser);
        }
      }
      if (cb && typeof cb === "function") {
        cb(e);
      }
    });
  }
  removeOverlays() {
    const overlays = this.map.getOverlays();
    const len = overlays.getLength();
    for (let i2 = len - 1; i2 > -1; i2--) {
      const ov = overlays.item(i2);
      console.log(`*** removeOverlays id : ${ov.getId()}`);
      this.map.removeOverlay(ov);
    }
  }
  checkAndDrawGeoJson(geoJson) {
    if (geoJson && this.checkGeoJson(geoJson)) {
      this.vector.getSource().clear();
      this.removeOverlays();
      this.drawGeoJSON(geoJson);
    }
  }
  checkGeoJson(geojson) {
    if (typeof geojson.features === "undefined" || geojson.features.length == null || geojson.features.length === 0) {
      return false;
    }
    const f0 = geojson.features[0];
    if (typeof f0.type !== "undefined" && typeof f0.geometry !== "undefined" && typeof f0.geometry.type !== "undefined") {
      return true;
    }
    return false;
  }
  clampZoomFloor() {
    if (this.view.getZoom() > this.zoomFloor) {
      this.view.setZoom(this.zoomFloor);
    }
  }
  createMapboxStreetsV6Style(Style2, Fill2, Stroke2, Icon2, Text3) {
    var fill = new Fill2({ color: "" });
    var stroke = new Stroke2({ color: "", width: 1 });
    var polygon = new Style2({ fill });
    var strokedPolygon = new Style2({ fill, stroke });
    var line = new Style2({ stroke });
    var text = new Style2({ text: new Text3({
      text: "",
      fill,
      stroke
    }) });
    var iconCache = {};
    function getIcon(iconName) {
      var icon = iconCache[iconName];
      if (!icon) {
        icon = new Style2({ image: new Icon2({
          src: "https://unpkg.com/@mapbox/maki@4.0.0/icons/" + iconName + "-15.svg",
          imgSize: [15, 15],
          crossOrigin: "anonymous"
        }) });
        iconCache[iconName] = icon;
      }
      return icon;
    }
    var styles = [];
    return function(feature, resolution) {
      if (!feature) {
        return;
      }
      var length = 0;
      var layer = feature.get("layer");
      var cls = feature.get("class");
      var type = feature.get("type");
      var scalerank = feature.get("scalerank");
      var labelrank = feature.get("labelrank");
      var adminLevel = feature.get("admin_level");
      var maritime = feature.get("maritime");
      var disputed = feature.get("disputed");
      var maki = feature.get("maki");
      var geom = feature.getGeometry().getType();
      if (layer == "landuse" && cls == "park") {
        fill.setColor("#d8e8c8");
        styles[length++] = polygon;
      } else if (layer == "landuse" && cls == "cemetery") {
        fill.setColor("#e0e4dd");
        styles[length++] = polygon;
      } else if (layer == "landuse" && cls == "hospital") {
        fill.setColor("#fde");
        styles[length++] = polygon;
      } else if (layer == "landuse" && cls == "school") {
        fill.setColor("#f0e8f8");
        styles[length++] = polygon;
      } else if (layer == "landuse" && cls == "wood") {
        fill.setColor("rgb(233,238,223)");
        styles[length++] = polygon;
      } else if (layer == "waterway" && cls != "river" && cls != "stream" && cls != "canal") {
        stroke.setColor("#a0c8f0");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "waterway" && cls == "river") {
        stroke.setColor("#a0c8f0");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "waterway" && (cls == "stream" || cls == "canal")) {
        stroke.setColor("#a0c8f0");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "water") {
        fill.setColor("#a0c8f0");
        styles[length++] = polygon;
      } else if (layer == "aeroway" && geom == "Polygon") {
        fill.setColor("rgb(242,239,235)");
        styles[length++] = polygon;
      } else if (layer == "aeroway" && geom == "LineString" && resolution <= 76.43702828517625) {
        stroke.setColor("#f0ede9");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "building") {
        fill.setColor("#f2eae2");
        stroke.setColor("#dfdbd7");
        stroke.setWidth(1);
        styles[length++] = strokedPolygon;
      } else if (layer == "tunnel" && cls == "motorway_link") {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && cls == "service") {
        stroke.setColor("#cfcdca");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && (cls == "street" || cls == "street_limited")) {
        stroke.setColor("#cfcdca");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && cls == "main" && resolution <= 1222.99245256282) {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && cls == "motorway") {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && cls == "path") {
        stroke.setColor("#cba");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "tunnel" && cls == "major_rail") {
        stroke.setColor("#bbb");
        stroke.setWidth(2);
        styles[length++] = line;
      } else if (layer == "road" && cls == "motorway_link") {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "road" && (cls == "street" || cls == "street_limited") && geom == "LineString") {
        stroke.setColor("#cfcdca");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "road" && cls == "main" && resolution <= 1222.99245256282) {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "road" && cls == "motorway" && resolution <= 4891.96981025128) {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "road" && cls == "path") {
        stroke.setColor("#cba");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "road" && cls == "major_rail") {
        stroke.setColor("#bbb");
        stroke.setWidth(2);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "motorway_link") {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "motorway") {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "service") {
        stroke.setColor("#cfcdca");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && (cls == "street" || cls == "street_limited")) {
        stroke.setColor("#cfcdca");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "main" && resolution <= 1222.99245256282) {
        stroke.setColor("#e9ac77");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "path") {
        stroke.setColor("#cba");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "bridge" && cls == "major_rail") {
        stroke.setColor("#bbb");
        stroke.setWidth(2);
        styles[length++] = line;
      } else if (layer == "admin" && adminLevel >= 3 && maritime === 0) {
        stroke.setColor("#9e9cab");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "admin" && adminLevel == 2 && disputed === 0 && maritime === 0) {
        stroke.setColor("#9e9cab");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "admin" && adminLevel == 2 && disputed === 1 && maritime === 0) {
        stroke.setColor("#9e9cab");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "admin" && adminLevel >= 3 && maritime === 1) {
        stroke.setColor("#a0c8f0");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "admin" && adminLevel == 2 && maritime === 1) {
        stroke.setColor("#a0c8f0");
        stroke.setWidth(1);
        styles[length++] = line;
      } else if (layer == "country_label" && scalerank === 1) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('bold 11px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#334");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(2);
        styles[length++] = text;
      } else if (layer == "country_label" && scalerank === 2 && resolution <= 19567.87924100512) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('bold 10px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#334");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(2);
        styles[length++] = text;
      } else if (layer == "country_label" && scalerank === 3 && resolution <= 9783.93962050256) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('bold 9px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#334");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(2);
        styles[length++] = text;
      } else if (layer == "country_label" && scalerank === 4 && resolution <= 4891.96981025128) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('bold 8px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#334");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(2);
        styles[length++] = text;
      } else if (layer == "marine_label" && labelrank === 1 && geom == "Point") {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('italic 11px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#74aee9");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "marine_label" && labelrank === 2 && geom == "Point") {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('italic 11px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#74aee9");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "marine_label" && labelrank === 3 && geom == "Point") {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('italic 10px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#74aee9");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "marine_label" && labelrank === 4 && geom == "Point") {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('italic 9px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#74aee9");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "place_label" && type == "city" && resolution <= 1222.99245256282) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('11px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#333");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "place_label" && type == "town" && resolution <= 305.748113140705) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('9px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#333");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "place_label" && type == "village" && resolution <= 38.21851414258813) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('8px "Open Sans", "Arial Unicode MS"');
        fill.setColor("#333");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "place_label" && resolution <= 19.109257071294063 && (type == "hamlet" || type == "suburb" || type == "neighbourhood")) {
        text.getText().setText(feature.get("name_en"));
        text.getText().setFont('bold 9px "Arial Narrow"');
        fill.setColor("#633");
        stroke.setColor("rgba(255,255,255,0.8)");
        stroke.setWidth(1);
        styles[length++] = text;
      } else if (layer == "poi_label" && resolution <= 19.109257071294063 && scalerank == 1 && maki !== "marker") {
        styles[length++] = getIcon(maki);
      } else if (layer == "poi_label" && resolution <= 9.554628535647032 && scalerank == 2 && maki !== "marker") {
        styles[length++] = getIcon(maki);
      } else if (layer == "poi_label" && resolution <= 4.777314267823516 && scalerank == 3 && maki !== "marker") {
        styles[length++] = getIcon(maki);
      } else if (layer == "poi_label" && resolution <= 2.388657133911758 && scalerank == 4 && maki !== "marker") {
        styles[length++] = getIcon(maki);
      } else if (layer == "poi_label" && resolution <= 1.194328566955879 && scalerank >= 5 && maki !== "marker") {
        styles[length++] = getIcon(maki);
      }
      styles.length = length;
      return styles;
    };
  }
  getTile(mapView, isShow) {
    let tile;
    this.wmsState = { hasTile: false, hasEvent: false, finishLoad: false, tileCount: 0, hasTransparency: false, waitMapRender: null };
    const self2 = this;
    let tileLoading = 0;
    let tileLoaded = 0;
    let crossOrigin = mapView.crossOrigin ? mapView.crossOrigin : "anonymous";
    let tileSource;
    const tileSourceOption = {
      url: mapView.url,
      crossOrigin,
      wrapDateLine: false,
      // not support 6.15.1
      wrapX: false,
      noWrap: true
      // not support 6.15.1
    };
    const tileOption = {
      title: mapView.uiLabel,
      // not support 6.15.1
      visible: isShow
    };
    if (mapView.serverType === "tile") {
      tileSource = new OSM_default(tileSourceOption);
      tileOption.source = tileSource;
      tile = new Tile_default4(tileOption);
    } else if (mapView.serverType === "tilePBF") {
      tileSourceOption.format = new MVT_default({ featureClass: Feature_default2 });
      tileSource = new VectorTile_default3(tileSourceOption);
      tileOption.source = tileSource;
      tileOption.style = this.createMapboxStreetsV6Style(Style_default, Fill_default, Stroke_default, Icon_default, Text_default);
      tile = new VectorTile_default(tileOption);
    } else {
      crossOrigin = "anonymous";
      let tileGrid;
      if (mapView.extent) {
        tileGrid = new TileGrid_default({
          extent: mapView.extent,
          resolutions: mapView.resolutions,
          tileSize: mapView.tileSize
        });
      }
      tileSourceOption.params = mapView.params;
      tileSourceOption.projection = mapView.EPSG;
      tileSourceOption.serverType = mapView.serverType;
      tileSourceOption.tileGrid = tileGrid;
      tileSourceOption.crossOrigin = crossOrigin;
      tileSource = new TileWMS_default(tileSourceOption);
      tileOption.source = tileSource;
      tileOption.crossOrigin = crossOrigin;
      tile = new Tile_default4(tileOption);
      if (mapView.extent) {
        tile.setExtent(mapView.extent);
      }
    }
    this.wmsState.hasTile = true;
    tileSource.on("tileloadstart", function(event) {
      self2.wmsState.hasEvent = true;
      console.log("%c tileSource.tileloadstart", "color:blue");
      tileLoading++;
    });
    tileSource.on("tileloadend", function(event) {
      console.log("%c tileSource.tileloadend", "color:blue");
      tileLoaded++;
      if (tileLoaded === tileLoading) {
        console.log("%c FINISH LOAD TILE", "color:blue");
        self2.wmsState.tileCount = tileLoaded;
        self2.wmsState.finishLoad = true;
        if (this.fromFitData) {
          this.checkMapEmpty(this.canvas);
        }
        if (self2.afterLoadSelectedAssetFn && typeof self2.afterLoadSelectedAssetFn === "function") {
          self2.afterLoadSelectedAssetFn();
        }
      }
    });
    tileSource.on("tileloaderror", function(event) {
      console.log("tileloaderror, There has been an error returned from the mapping service tileloader - is the map visible?");
    });
    return tile;
  }
  multiLayers(mapViews) {
    const layers = [];
    if (typeof mapViews !== "undefined" && mapViews !== null) {
      let existShow = false;
      for (let i2 = 0; i2 < mapViews.length; i2++) {
        const mapView = mapViews[i2];
        if (mapView.isShow) {
          existShow = true;
          break;
        }
      }
      for (let i2 = 0; i2 < mapViews.length; i2++) {
        const mapView = mapViews[i2];
        if (typeof mapView.EPSG !== "undefined" && mapView.EPSG !== null) {
          lib_default.defs(mapView.EPSG, sclProjectionConstant.EPSG[mapView.EPSG]);
        }
        let isVisible = true;
        if (mapView.visible != null) {
          isVisible = mapView.visible;
        }
        if (isVisible === false) {
          continue;
        }
        let isShow = false;
        if (mapView.isShow) {
          isShow = mapView.isShow;
        }
        if (!existShow && i2 === 0) {
          existShow = true;
          isShow = true;
        }
        let tile = null;
        if (mapView.groupView) {
          const listLayers = [];
          for (let j = 0; j < mapView.groupView.length; j++) {
            const view = mapView.groupView[j];
            const member = this.getTile(view, isShow);
            listLayers.push(member);
          }
          const option = {
            visible: isShow,
            title: mapView.uiLabel,
            // not support 6.15.1
            layers: listLayers
          };
          tile = new Group_default(option);
        } else {
          tile = this.getTile(mapView, isShow);
        }
        layers.push(tile);
      }
    }
    return layers;
  }
  setView(lng, lat, zoom, EPSG, minResolution, maxResolution, maxZoom) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lng = typeof lng !== "undefined" ? lng : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    maxZoom = typeof maxZoom !== "undefined" ? maxZoom : 19;
    this.minResolution = minResolution;
    this.maxResolution = maxResolution;
    let view;
    if (EPSG !== SclMapConstantService.EPSG_3857) {
      const projection = sclProjectionConstant.EPSG;
      lib_default.defs(EPSG, projection[EPSG]);
    }
    register2(lib_default);
    if (minResolution && maxResolution) {
      view = new View_default({
        projection: EPSG,
        center: transform([lng, lat], "EPSG:4326", EPSG),
        zoom,
        // maxZoom: 12,//13885
        maxZoom,
        minResolution,
        maxResolution
      });
    } else {
      view = new View_default({
        projection: EPSG,
        center: transform([lng, lat], "EPSG:4326", EPSG),
        zoom,
        // maxZoom: 12,//13885
        maxZoom,
        minZoom: 2,
        maxResolution: 2116.67090000847,
        minResolution: 0.0116670900008467
      });
    }
    return view;
  }
  createLayerSourceNormal(zIndex, pStyle, title, source, layerDisplayOnly) {
    const options = {
      title,
      source,
      zIndex,
      style: pStyle,
      isHeatMap: false,
      layerDisplayOnly
    };
    return new Vector_default(options);
  }
  createLayerCluster(zIndex, pStyle, title, source, layerDisplayOnly, distance2) {
    let d = 20;
    if (distance2) {
      d = distance2;
    }
    const clusterSource = new Cluster_default({
      distance: d,
      source
    });
    const options = {
      name: "Cluster",
      source: clusterSource,
      // Cluster style
      style: pStyle,
      zIndex,
      isHeatMap: false,
      layerDisplayOnly,
      isCluster: true
    };
    const clusterLayer = new Vector_default(options);
    return clusterLayer;
  }
  createEmptyLayer(zIndex, pStyle, title, isHeatMap, options) {
    let newLayer;
    let src = new Vector_default2();
    let layerDisplayOnly = false;
    if (options && options.layerDisplayOnly) {
      layerDisplayOnly = options.layerDisplayOnly;
    }
    if (isHeatMap) {
      let gradient = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"];
      if (options != null && typeof options.gradient !== "undefined") {
        gradient = options.gradient;
      }
      let opacity = 1;
      if (options != null && typeof options.opacity !== "undefined") {
        opacity = options.opacity;
      }
      let radius = 8;
      if (options != null && typeof options.radius !== "undefined") {
        radius = options.radius;
      }
      let blur = 15;
      if (options != null && typeof options.blur !== "undefined") {
        blur = options.blur;
      }
      let shadow = 250;
      if (options != null && typeof options.shadow !== "undefined") {
        shadow = options.shadow;
      }
      const optionsHeatmap = {
        source: src,
        zIndex,
        gradient,
        opacity,
        radius,
        blur,
        shadow,
        renderMode: "image",
        title,
        isHeatMap,
        layerDisplayOnly
      };
      newLayer = new Heatmap_default(optionsHeatmap);
    } else {
      if (options && options.type === "cluster") {
        newLayer = this.createLayerCluster(zIndex, pStyle, title, src, layerDisplayOnly, options.clusterDistance);
      } else {
        newLayer = this.createLayerSourceNormal(zIndex, pStyle, title, src, layerDisplayOnly);
      }
    }
    return newLayer;
  }
  loadGeoJSON(layerIndex, geoJson) {
    const featuresJSON = new GeoJSON_default().readFeatures(geoJson);
    this.layerAssets[layerIndex].getSource().addFeatures(featuresJSON);
    if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && layerIndex !== this.layerIndexPrimary && layerIndex !== this.layerIndexSecondary) {
      this.layerAssets[layerIndex].getSource().forEachFeature((feature) => {
        feature.setStyle(this.styleAsset(feature, layerIndex));
      });
    }
  }
  createLayerAsset(layerQuery, styleLayer, hasFilterQuery, styleFilter, hasSecondary, styleSecondary, hasPrimary, stylePrimary, hasUserItems, styleSelected, hasAddressPoint, stylePoint) {
    let layerIndex = 0;
    if (this.layerAssets == null) {
      this.layerAssets = [];
    }
    if (layerQuery) {
      for (let i2 = 0; i2 < layerQuery.length; i2++) {
        if (layerQuery[i2].query.indexOf("_layer") < 0) {
          continue;
        }
        layerIndex++;
        if (layerQuery[i2].layer.type === "cluster") {
          this.layerAssets.push(this.createEmptyLayer(layerIndex, styleLayer, "layer" + layerIndex, layerQuery[i2].isHeatMap, layerQuery[i2].layer));
        } else {
          this.layerAssets.push(this.createEmptyLayer(layerIndex, null, "layer" + layerIndex, layerQuery[i2].isHeatMap, layerQuery[i2].layer));
        }
      }
    }
    if (hasFilterQuery) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleLayer, "filter", null, null));
      this.layerIndexFilter = layerIndex;
    }
    if (hasSecondary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleSecondary, "secondary", null, null));
      this.layerIndexSecondary = layerIndex;
    }
    if (hasPrimary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, stylePrimary, "primary", null, null));
      this.layerIndexPrimary = layerIndex;
    }
    if (hasUserItems) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleSelected, "selectedItems", null, null));
      this.layerIndexUser = layerIndex;
    }
    if (hasAddressPoint) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, stylePoint, "addressPoint", null, null));
      this.layerIndexAddress = layerIndex;
    }
    this.layerIndexTooltips = layerIndex + 1;
    this.layerIndexControl = layerIndex + 2;
  }
  createLayers(initObj) {
    this.layerAssets = [];
    this.layerAssets.push(this.vector);
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.createLayerAsset(initObj.layerAssets, this.styleAddress.bind(this), true, null, false, null, false, null, false, null, true, this.styleAddress.bind(this));
    } else if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      if (initObj.layerAssets) {
        this.createLayerAsset(initObj.layerAssets, this.styleAddress.bind(this), true, null, false, null, false, null, true, null, false, null);
      } else {
        this.createLayerAsset([], null, true, null, false, null, false, null, true, null, false, null);
      }
    } else if (this.type === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
      this.createLayerAsset(initObj.layerAssets, this.styleAddress.bind(this), true, null, false, null, false, null, false, null, true, this.styleStAddress.bind(this));
    } else if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      if (initObj.layerAssets) {
        this.createLayerAsset(initObj.layerAssets, null, true, null, true, null, true, null, false, null, true, null);
      } else {
        this.createLayerAsset([], null, true, null, true, null, true, null, false, null, true, null);
      }
    }
  }
  createHeatMap(layerIndex) {
    this.layerAssets[layerIndex].getSource().clear();
    const min = Math.min.apply(null, this.lstHeatWeight);
    const max = Math.max.apply(null, this.lstHeatWeight);
    for (let i2 = 0; i2 < this.heatDatas.length; i2++) {
      let weight = (this.heatDatas[i2].weight - min) / (max - min);
      if (isNaN(weight)) {
        if (max === min) {
          weight = 1;
        } else {
          weight = 0;
        }
      }
      if (weight > 1) {
        weight = 1;
      }
      const coord = transform(this.heatDatas[i2].location, "EPSG:4326", this.EPSG);
      const lonLat = new Point_default(coord);
      const pf = new Feature_default2({
        geometry: lonLat,
        weight
        // e.g. temperature
      });
      this.layerAssets[layerIndex].getSource().addFeature(pf);
    }
    this.heatDatas = [];
    this.lstHeatWeight = [];
  }
  drawGeoJSON(geoJson) {
    if (!geoJson || !geoJson.features) {
      return;
    }
    const textBoxJson = [];
    const dimensionJson = [];
    for (let i2 = geoJson.features.length - 1; i2 > -1; i2--) {
      if (geoJson.features[i2].properties && geoJson.features[i2].geometry && geoJson.features[i2].geometry.coordinates) {
        if (geoJson.features[i2].properties.radius) {
          let center = null;
          if (geoJson.features[i2].geometry.coordinates.length == 2 && geoJson.features[i2].geometry.type == "Point") {
            center = geoJson.features[i2].geometry.coordinates;
          } else if (geoJson.features[i2].geometry.coordinates.length == 1 && geoJson.features[i2].geometry.coordinates[0].length > 3 && geoJson.features[i2].geometry.type == "Polygon") {
            center = sclUtilMap.calculateCircleCenterPoint(geoJson.features[i2].geometry.coordinates[0][0], geoJson.features[i2].geometry.coordinates[0][2]);
          }
          if (!center) {
            continue;
          }
          const radius = geoJson.features[i2].properties.radius;
          const centerProj = transform([center[0], center[1]], "EPSG:4326", this.EPSG);
          const circle = new Circle_default2(centerProj, radius);
          const circleFeature = new Feature_default2(circle);
          if (geoJson.features[i2].properties) {
            let p = circleFeature.getProperties();
            if (!p) {
              p = {};
            }
            for (let key in geoJson.features[i2].properties) {
              p[key] = geoJson.features[i2].properties[key];
            }
            circleFeature.setProperties(p);
          }
          this.vector.getSource().addFeature(circleFeature);
          geoJson.features.splice(i2, 1);
        } else if (typeof geoJson.features[i2].properties.text === "string" && geoJson.features[i2].properties.text.trim().length > 0) {
          textBoxJson.push(geoJson.features[i2]);
        } else if ((0, import_lodash5.isNumber)(geoJson.features[i2].properties.dimension) && geoJson.features[i2].geometry.type === "LineString") {
          dimensionJson.push(geoJson.features[i2]);
        }
      }
    }
    if (geoJson?.features?.length > 0) {
      const featuresJSON = new GeoJSON_default().readFeatures(geoJson, { featureProjection: this.EPSG, dataProjection: "EPSG:4326" });
      this.vector.getSource().addFeatures(featuresJSON);
    }
    for (let i2 = 0; i2 < textBoxJson.length; i2++) {
      const mapPoint = transform(textBoxJson[i2].geometry.coordinates, "EPSG:4326", this.EPSG);
      this.createTextBoxFeature(mapPoint, textBoxJson[i2].geometry.coordinates, textBoxJson[i2].properties.text, textBoxJson[i2].properties.textId, false, textBoxJson[i2].properties.font, textBoxJson[i2].properties.fontSize);
    }
    for (let i2 = 0; i2 < dimensionJson.length; i2++) {
      if (Array.isArray(dimensionJson[i2].geometry.coordinates) && dimensionJson[i2].geometry.coordinates.length > 0) {
        const dimensionId = dimensionJson[i2].properties.dimensionId;
        const coorJson = dimensionJson[i2].geometry.coordinates;
        const totalLength = sclUtilMap.totalLen(coorJson);
        const midDistance = totalLength / 2;
        const coord = sclUtilMap.getPointByDistance(coorJson, midDistance);
        let tooltipCoord = transform(coord, "EPSG:4326", this.EPSG);
        const obj = this.createDimensionFeature(dimensionId, tooltipCoord, dimensionJson[i2].properties.dimension, dimensionJson[i2].properties.font, dimensionJson[i2].properties.fontSize);
        const dimensionLabel = obj.dimensionLabel;
        const dimensionOverlay = obj.dimensionOverlay;
        let feature = null;
        this.vector.getSource().getFeatures().forEach((f) => {
          const p = f.getProperties();
          if (p.dimensionId === dimensionId) {
            feature = f;
            if (dimensionJson[i2].properties.font) {
              p.font = dimensionJson[i2].properties.font;
            }
            if (dimensionJson[i2].properties.fontSize) {
              p.fontSize = dimensionJson[i2].properties.fontSize;
            }
            f.setProperties(p);
            console.log(`*** This feature with dimensionId = ${dimensionId} has already added to map`);
            return;
          }
        });
        if (feature) {
          feature.getGeometry().on("change", (evt) => {
            this.hasDocumentChangeValue = false;
            const geom = evt.target;
            let output;
            const p = feature.getProperties();
            if (geom instanceof LineString_default) {
              const length = getLength(geom);
              output = sclUtilMap.formatDimension(length, this.dimensionsUnit, this.dimensionsPrecision);
              tooltipCoord = geom.getLastCoordinate();
              p.dimension = length;
              feature.setProperties(p);
            }
            dimensionLabel.innerHTML = output;
            dimensionOverlay.setPosition(tooltipCoord);
          });
        }
      } else {
        console.warn(`Invalid line's geometry data: ${JSON.stringify(dimensionJson[i2])}`);
      }
    }
  }
  init(initObj, keyName) {
    super.init(initObj, keyName);
    this.EPSG = initObj.EPSG;
    if (this.EPSG === SclMapConstantService.EPSG_4326) {
      this.EPSG = "EPSG:3857";
    }
    if (this.EPSG !== SclMapConstantService.EPSG_4326) {
      const projection = sclProjectionConstant.EPSG;
      this.proj4s.defs(this.EPSG, projection[this.EPSG]);
    }
    this.divWrapper = initObj.divWrapper;
    this.selectedAssets = [];
    let savedGeoJSON;
    if (initObj.formatGeoJSON) {
      savedGeoJSON = initObj.formatGeoJSON;
      if (initObj.formatGeoJSON.crs) {
        this.EPSG = initObj.formatGeoJSON.crs.properties.name;
      }
    }
    if (initObj.setupMapDone) {
      this.setupMapDone = initObj.setupMapDone;
    }
    this.source = new Vector_default2();
    if (initObj.selectionStyle) {
      this.selectionStyle = initObj.selectionStyle;
    }
    if (initObj.primaryAssetSelection) {
      this.primaryAssetSelection = initObj.primaryAssetSelection;
    }
    if (initObj.secondaryAssetSelection) {
      this.secondaryAssetSelection = initObj.secondaryAssetSelection;
    }
    if (initObj.layersRedraw) {
      this.layersRedraw = initObj.layersRedraw;
    }
    if (initObj.mapId) {
      this.mapId = initObj.mapId;
    }
    if (initObj.onMapWheelScroll) {
      this.onMapWheelScroll = initObj.onMapWheelScroll;
    }
    this.checkMapEmptyLogError = initObj.checkMapEmptyLogError;
    this.defaultLat = initObj.defaultLat ? initObj.defaultLat : -37.8;
    this.defaultLon = initObj.defaultLon ? initObj.defaultLon : 144.9;
    this.defaultZoom = initObj.defaultZoom ? initObj.defaultZoom : 10;
    if (initObj.style === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.vector = this.createLayerSourceNormal(0, this.styleBoundary.bind(this), "layerTile", this.source, false);
      if (initObj.layers) {
        this.tileLayers = initObj.layers;
      }
    } else if (initObj.style === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      this.vector = this.createLayerSourceNormal(0, this.styleAddress.bind(this), "layerTile", this.source, false);
      if (initObj.layers) {
        this.tileLayers = initObj.layers;
      }
    } else if (initObj.style === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
      this.vector = this.createLayerSourceNormal(0, this.styleStAddress.bind(this), "layerTile", this.source, false);
      if (initObj.layers) {
        this.tileLayers = initObj.layers;
      }
    } else if (initObj.style === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      this.addressImageAnchor = initObj.addressImageAnchor;
      this.primaryImageAnchor = initObj.primaryImageAnchor;
      this.secondaryImageAnchor = initObj.secondaryImageAnchor;
      this.vector = this.createLayerSourceNormal(0, this.styleAsset.bind(this), "layerTile", this.source, false);
      if (initObj.layers) {
        this.tileLayers = initObj.layers;
      }
    }
    this.createLayers(initObj);
    const mZoom = this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP ? 12 : 19;
    this.view = this.setView(this.defaultLon, this.defaultLat, this.defaultZoom, this.EPSG, initObj.minResolution, initObj.maxResolution, mZoom);
    const controls = initObj.controls ? initObj.controls : [];
    this.map = this.initializeMap(initObj, controls, this.view, null, this.tileLayers);
    const lst = document.querySelectorAll(".ol-overlaycontainer-stopevent");
    if (lst != null && lst.length > 0) {
      for (let i2 = 0; i2 < lst.length; i2++) {
        lst[i2].style.zIndex = this.layerIndexControl;
        const childs = lst[i2].children;
        if (childs == null || childs.length === 0) {
          continue;
        }
        for (let j = 0; j < childs.length; j++) {
          childs[j].style.zIndex = this.layerIndexControl;
        }
      }
    }
    let numInFlightTiles = 0;
    this.map.getLayers().forEach(function(layer) {
      if (layer.type && layer.type === "TILE") {
        const source = layer.getSource();
        if (source instanceof TileImage_default) {
          source.on("tileloadstart", function() {
            numInFlightTiles++;
          });
          source.on("tileloadend", function() {
            numInFlightTiles--;
          });
        }
      }
    });
    this.map.on("postrender", (evt) => {
      if (!evt.frameState) {
        return;
      }
      let numHeldTiles = 0;
      const wanted = evt.frameState.wantedTiles;
      for (const layer in wanted) {
        if (wanted.hasOwnProperty(layer)) {
          numHeldTiles += Object.keys(wanted[layer]).length;
        }
      }
      const ready = numInFlightTiles === 0 && numHeldTiles === 0;
      if (this.map.get("ready") !== ready) {
        this.map.set("ready", ready);
        if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.bounds) {
          this.view.fit(this.bounds);
          if (this.fitCoordCount === 1) {
            let currentZoom = this.view.getZoom();
            currentZoom = currentZoom - 2;
            if (currentZoom < 0) {
              currentZoom = 1;
            }
            this.view.setZoom(currentZoom);
          }
          this.clampZoomFloor();
          this.bounds = null;
        }
        if (ready) {
          if (this.canvas == null) {
            this.canvas = document.querySelector(initObj.mapId + " canvas");
          }
          this.checkMapEmpty(this.canvas);
          this.isMapReady = true;
          if (this.type !== SclMapConstantService.COMP_TYPE_ADDRESS_MAP && savedGeoJSON) {
            this.checkAndDrawGeoJson(savedGeoJSON);
            this.clampZoomFloor();
          }
        }
      }
    });
    this.map.set("ready", false);
    function whenMapIsReady(callback) {
      if (this.map.get("ready")) {
        callback();
      } else {
        this.map.once("change:ready", whenMapIsReady.bind(null, callback));
      }
    }
    const lstCv = initObj.target.getElementsByTagName("canvas");
    if (lstCv && lstCv.length > 0) {
      const cv = lstCv[0];
      this.canvas = cv;
    }
    console.log(`**** INIT MAP, componentDefinition.visible = ${initObj?.componentDefinition?.visible}`);
    if (initObj.componentDefinition && (typeof initObj.componentDefinition.visible === "undefined" || initObj.componentDefinition.visible)) {
      let mapWidth = this.map.getSize()[0];
      let mapHeight = this.map.getSize()[1];
      let wrapperWitdh = this.divWrapper ? this.divWrapper.offsetWidth : mapWidth;
      let wrapperHeight = this.divWrapper ? this.divWrapper.offsetHeight : mapHeight;
      let count = 0;
      const limitCheckCanvas = 10;
      const checkCanvasId = setInterval(() => {
        mapWidth = this.map.getSize()[0];
        mapHeight = this.map.getSize()[1];
        wrapperWitdh = this.divWrapper ? this.divWrapper.offsetWidth : mapWidth;
        wrapperHeight = this.divWrapper ? this.divWrapper.offsetHeight : mapHeight;
        console.log("this.canvas = " + this.canvas + ", mapWidth = " + mapWidth + ", mapHeight = " + mapHeight + ", wrapperWitdh = " + wrapperWitdh + ", wrapperHeight = " + wrapperHeight);
        if (this.canvas) {
          if (this.canvas.style.display === "none" || mapWidth <= 0 || wrapperWitdh !== mapWidth || mapHeight <= 0 || wrapperHeight !== mapHeight) {
            this.show = true;
            this.canvas.style.display = "block";
            this.map.setSize(wrapperWitdh, wrapperHeight);
            this.map.updateSize();
            if (initObj.watchDocFn && typeof initObj.watchDocFn === "function") {
              const doc = initObj.watchDocFn();
              const extent = this.vector.getSource().getExtent();
              if (extent != null && extent.length === 4 && isFinite(extent[0]) && isFinite(extent[1]) && isFinite(extent[2]) && isFinite(extent[3])) {
                this.map.getView().fit(extent, [500, 500], { maxZoom: 15 });
                this.clampZoomFloor();
              }
            }
            if (initObj.style === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
              this.fit(initObj.configService, null, initObj.initialZoomChange, null);
            }
          } else {
            clearInterval(checkCanvasId);
          }
        } else {
          const lstCv1 = initObj.target.getElementsByTagName("canvas");
          if (lstCv1 && lstCv1.length > 0) {
            const cv = lstCv1[0];
            this.canvas = cv;
          }
        }
        if (this.layersRedraw === true && this.testDiv !== null) {
          const offsetHeight = this.testDiv.offsetHeight;
          const top = mapHeight - offsetHeight;
          const css = { top: top + "px", left: "10px", display: "flex" };
          Object.assign(this.testDiv.style, css);
        }
        count++;
        if (count > limitCheckCanvas) {
          console.log("%c out of limit check canvas", "color:blue");
          console.log(`**** out of limit check canvas, componentDefinition.visible = ${initObj.componentDefinition.visible}`);
          clearInterval(checkCanvasId);
        }
      }, 500);
      this.setupMapControl();
      setTimeout(() => {
        if (mapWidth === wrapperWitdh && this.wmsState.hasTile && this.wmsState.hasEvent === false && this.wmsState.finishLoad === false) {
          console.log("There has been an error returned from the mapping service tileloader - is the map visible?");
        }
      }, 1e3);
    }
    this.checkMapLoadDone = setInterval(() => {
      if (this.wmsState.finishLoad) {
        clearInterval(this.checkMapLoadDone);
        this.checkMapLoadDone = null;
        if (this.setupMapDone) {
          this.setupMapDone();
        }
        if (this.setupTooltipUI && typeof this.setupTooltipUI === "function") {
          this.setupTooltipUI();
          this.setupTooltipUI = null;
        }
      }
    }, 500);
  }
  checkIsFullScreenSupport() {
    const body = document.body;
    return !!(body.webkitRequestFullscreen || body.mozRequestFullScreen || body.msRequestFullscreen || body.requestFullscreen);
  }
  setupMapControl() {
    if (this.setupMapControlInterval !== null) {
      return;
    }
    this.setupMapControlInterval = setInterval(() => {
      if (this.elementCtrl != null && this.canvas != null) {
        clearInterval(this.setupMapControlInterval);
        this.setupMapControlInterval = null;
        this.setupMapControlIntervalCount = 0;
        const css = this.isBottom ? "ol-custom-control-bottom" : "ol-custom-control";
        this.elementCtrl.classList.add(css);
        this.mapControlStyle(this.elementCtrl, this.mapDiv.offsetHeight);
      } else {
        this.setupMapControlIntervalCount++;
        if (this.setupMapControlIntervalCount > this.setupMapControlIntervalLimit) {
          console.log(`**** setupMapControl, out of waiting to get canvas and the <_Drawing_Menu_>`);
          clearInterval(this.setupMapControlInterval);
          this.setupMapControlInterval = null;
          this.setupMapControlIntervalCount = 0;
        }
      }
    }, 500);
  }
  mapControlStyle(elem, mapHeight) {
    if (this.elementCtrl == null) {
      return {};
    }
    if (this.isBottom) {
      elem.style.bottom = "10px";
      elem.style.display = "flex";
    } else {
      const offsetHeight = this.elementCtrl.offsetHeight;
      const offsetWidth = this.elementCtrl.offsetWidth;
      let elemHeight = offsetHeight;
      if (offsetHeight < offsetWidth) {
        elemHeight = offsetWidth;
      }
      const top = mapHeight / 2 - elemHeight / 2;
      elem.style.top = top + "px";
      elem.style.setProperty("display", "grid", "important");
    }
  }
  mapMoveEnd(moveEndFunc) {
    this.map.on("moveend", moveEndFunc);
  }
  createTextStyle(label, color2, type) {
    const currentZoom = this.view.getZoom();
    const displayZoom = !label.labelDisplayZoom ? 9 : label.labelDisplayZoom > 17 ? 17 : label.labelDisplayZoom;
    const text = currentZoom < displayZoom ? "" : label.labelText ? label.labelText : "";
    const align = label.labelTextAlign === "" || label.labelTextAlign == null ? void 0 : label.labelTextAlign;
    const baseLine = label.labelTextBaseline === "" || label.labelTextBaseline == null ? void 0 : label.labelTextBaseline;
    const fillColor = label.labelColor === "" || label.labelColor == null ? color2 : label.labelColor;
    const outlineColor = label.labelOutlineColor === "" || label.labelOutlineColor == null ? "white" : label.labelOutlineColor;
    const outlineWidth = label.labelOutlineWidth === "" || label.labelOutlineWidth == null || label.labelOutlineWidth === 0 ? 5 : label.labelOutlineWidth;
    const offsetX = label.labelOffsetX === "" || label.labelOffsetX == null || label.labelOffsetX === 0 ? 0 : label.labelOffsetX;
    const offsetY = label.labelOffsetY === "" || label.labelOffsetY == null || label.labelOffsetY === 0 ? 0 : label.labelOffsetY;
    let placement = label.labelPlacement === "" || label.labelPlacement == null ? "point" : label.labelPlacement;
    const maxAngle = label.labelMaxAngle === "" || label.labelMaxAngle == null ? 90 : parseFloat(label.labelMaxAngle);
    const overflow = typeof label.labelOverflow !== "undefined" && label.labelOverflow !== null ? label.labelOverflow : true;
    const rotationWithView = label.labelRotationWithView === true;
    const rotation = label.labelRotation === "" || label.labelRotation == null ? 0 : label.labelRotation;
    const padding = label.labelPadding === "" || label.labelPadding == null ? void 0 : label.labelPadding;
    const weight = label.labelFontWeight === "" || label.labelFontWeight == null ? "normal" : label.labelFontWeight;
    let size = label.labelFontSize === "" || label.labelFontSize == null || label.labelFontSize === 0 ? "12px" : label.labelFontSize;
    const fontValue = label.labelFont === "" || label.labelFont == null ? "Arial" : label.labelFont;
    if (typeof size === "string") {
      size = size.replace("px", "");
    }
    const font = weight + " " + size + "px " + fontValue;
    if (type === "Point") {
      placement = "point";
    }
    const options = {
      textAlign: align,
      textBaseline: baseLine,
      font,
      text,
      fill: new Fill_default({ color: fillColor }),
      stroke: new Stroke_default({ color: outlineColor, width: outlineWidth }),
      offsetX,
      offsetY,
      placement,
      maxAngle,
      overflow,
      rotationWithView,
      // not support 6.15.1
      rotation,
      padding
    };
    return new Text_default(options);
  }
  updateLabelByZoom() {
    const currentZoom = this.view.getZoom();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      try {
        if (this.layerAssets[i2].get("isCluster") || !this.layerAssets[i2].getSource()) {
          continue;
        }
        this.layerAssets[i2].getSource().getFeatures().forEach((fea) => {
          const lb = fea.get("label");
          if (lb) {
            const displayZoom = !lb.labelDisplayZoom ? 9 : lb.labelDisplayZoom > 17 ? 17 : lb.labelDisplayZoom;
            const text = currentZoom < displayZoom ? "" : lb.labelText ? lb.labelText : "";
            const style2 = fea.getStyle();
            if (style2 && style2.length > 0) {
              const txt = style2[0].getText();
              if (txt) {
                txt.setText(text);
                fea.setStyle(style2);
              }
            }
          }
        });
      } catch (err) {
        console.log(err);
      }
    }
  }
  getAnchor(icon, anchor2) {
    if ((icon === SclMapConstantService.MAP_MARKER || icon === SclMapConstantService.MAP_PRIMARY_ASSET || icon === SclMapConstantService.MAP_SECONDARY_ASSET) && anchor2 == null) {
      anchor2 = [0.5, 1];
    }
    if (anchor2 == null) {
      anchor2 = [0.5, 0.5];
    }
    return anchor2;
  }
  updateLabel(feature, label) {
    const currentZoom = this.view.getZoom();
    const displayZoom = !label.labelDisplayZoom ? 9 : label.labelDisplayZoom > 17 ? 17 : label.labelDisplayZoom;
    const text = currentZoom < displayZoom ? "" : label.labelText ? label.labelText : "";
    if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      const style2 = feature.getStyle();
      if (style2 && style2.length > 0) {
        const txt = feature.getStyle()[0].getText();
        if (txt) {
          txt.setText(text);
        }
      }
    }
  }
  getCircleStyle(properties2, label, t) {
    let strokeColor = "blue";
    let fillColor = asArray("blue");
    let width = 2;
    if (properties2.color) {
      strokeColor = properties2.color;
    }
    if (properties2.fillColor) {
      fillColor = properties2.fillColor;
    }
    if (properties2.lineWidth) {
      width = properties2.lineWidth;
    }
    const stroke = new Stroke_default({
      color: strokeColor,
      width
    });
    if (properties2 && properties2.fillColor && properties2.fillOpacity) {
      let color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      color2[3] = properties2.fillOpacity;
      fillColor = color2;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    let image = new Circle_default({
      radius: properties2.radius,
      fill: new Fill_default({
        color: fillColor
        // '#ffcc33'
      })
    });
    const style2 = new Style_default({
      image,
      fill,
      stroke
    });
    const styles = [style2];
    if (label != null) {
      style2.setText(this.createTextStyle(label, strokeColor, t));
    }
    return styles;
  }
  getPointStyle(color2, icon, imageAnchor, geom, label, t, rotation, useCache) {
    let pointColor = "green";
    if (color2) {
      pointColor = color2;
    }
    let image = null;
    if (icon) {
      let anchor2 = imageAnchor;
      anchor2 = this.getAnchor(icon, anchor2);
      const angle = rotation ? rotation * (Math.PI / 180) : 0;
      let imageSrc = icon;
      if (useCache) {
        const iconIndex = this.cacheImageUrls.indexOf(icon);
        if (iconIndex > -1) {
          imageSrc = this.cacheImageBase64s[iconIndex];
        }
      }
      image = new Icon_default({
        src: imageSrc,
        anchor: anchor2,
        rotation: angle
      });
    } else {
      image = new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: pointColor
          // '#ffcc33'
        })
      });
    }
    const style2 = new Style_default({
      fill: new Fill_default({
        color: "rgba(255, 255, 255, 0.2)"
      }),
      stroke: new Stroke_default({
        color: pointColor,
        width: 2
      }),
      image
    });
    const styles = [style2];
    if (label != null) {
      style2.setText(this.createTextStyle(label, color2, t));
    }
    return styles;
  }
  getPointStyleScale(feature, p, style2) {
    let scaleX = 1;
    let scaleY = 1;
    if (p.scale) {
      if (Array.isArray(p.scale) && p.scale.length == 2) {
        scaleX = p.scale[0];
        scaleY = p.scale[1];
      } else if ((0, import_lodash5.isNumber)(p.scale)) {
        scaleX = p.scale;
        scaleY = p.scale;
      }
    }
    const iconIndex = this.cacheImageUrls.indexOf(p.icon);
    let img = p.icon;
    let strBase64 = "";
    if (iconIndex > -1) {
      img = this.cacheImages[iconIndex];
      strBase64 = this.cacheImageBase64s[iconIndex];
    }
    this.countGetImgSrc++;
    feature.set("size", [img.width, img.height]);
    let maxSize = img.width;
    if (img.width < img.height) {
      maxSize = img.height;
    }
    if (this.fitPadding < maxSize) {
      this.fitPadding = maxSize;
    }
    if (scaleX != 1 || scaleY != 1) {
      style2.setImage(this.drawImage(img, scaleX, scaleY, style2));
    }
  }
  getMultiPointStyle(properties2) {
    let strokeColor = "blue";
    let fillColor = asArray("blue");
    if (properties2.color) {
      strokeColor = properties2.color;
    }
    if (properties2.fillColor) {
      fillColor = properties2.fillColor;
    }
    let image = new Circle_default({
      radius: 7,
      fill: new Fill_default({
        color: fillColor
        // '#ffcc33'
      })
    });
    const styles = [];
    const style2 = new Style_default({
      image
    });
    if (properties2.icon) {
      const iconIndex = this.cacheImageUrls.indexOf(properties2.icon);
      let strBase64 = "";
      if (iconIndex > -1) {
        strBase64 = this.cacheImageBase64s[iconIndex];
      }
      let anchor2 = [0.5, 1];
      if (properties2.anchor) {
        anchor2 = properties2.anchor;
      }
      anchor2 = this.getAnchor(properties2.icon, anchor2);
      image = new Icon_default({
        src: strBase64,
        anchor: anchor2
      });
    }
    const stroke = new Stroke_default({
      color: strokeColor,
      width: 2
    });
    style2.setStroke(stroke);
    if (properties2 && properties2.fillColor) {
      let color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      if (properties2.fillOpacity) {
        color2[3] = properties2.fillOpacity;
      }
      fillColor = color2;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    styles.push(style2);
    return styles;
  }
  getLineStyle(pColor, properties2, geom, t) {
    let lineColor = "blue";
    if (pColor) {
      lineColor = pColor;
    }
    const styles = [];
    const style2 = new Style_default({
      image: new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: "#ffcc33"
        })
      })
    });
    const stroke = new Stroke_default({
      color: lineColor,
      width: 2
    });
    if (properties2) {
      if (properties2.lineWidth) {
        stroke.setWidth(properties2.lineWidth);
      }
      if (properties2.lineDash) {
        stroke.setLineDash(properties2.lineDash);
      }
      if (properties2.lineCap) {
        stroke.setLineCap(properties2.lineCap);
      }
    }
    style2.setStroke(stroke);
    let fillColor = "rgba(255, 255, 255, 0.2)";
    if (properties2 && properties2.fillColor) {
      let color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      if (properties2.fillOpacity) {
        color2[3] = properties2.fillOpacity;
      }
      fillColor = "rgba(" + color2[0] + ", " + color2[1] + ", " + color2[2] + ", " + color2[3] + ")";
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    styles.push(style2);
    if (typeof properties2.label !== void 0 && properties2.label != null) {
      style2.setText(this.createTextStyle(properties2.label, pColor, t));
    }
    return styles;
  }
  lableStyle(geom, label, color2, t) {
    return new Style_default({
      geometry: geom,
      text: this.createTextStyle(label, color2, t)
    });
  }
  colorWithAlpha(color2, alpha) {
    let c = asArray(color2);
    c = c.slice();
    c[3] = alpha;
    return c;
  }
  // sc-boundary
  styleArrow(feature, p, colorByMode, isDrawing) {
    let styles = [];
    const color2 = p.color ? p.color : colorByMode;
    const geom = feature.getGeometry();
    const type = geom.getType();
    let lineStrings = [];
    const isMulti = type.indexOf("Multi") > -1;
    if (isMulti) {
      lineStrings = geom.getLineStrings();
    } else {
      lineStrings.push(geom);
    }
    for (let i2 = 0; i2 < lineStrings.length; i2++) {
      const coords = lineStrings[i2].getCoordinates();
      if (coords.length < 3 && isDrawing == true && p.arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT || coords.length < 2 && isDrawing == false && p.arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT) {
        continue;
      }
      let indexOfSegmentFinal = p.arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT ? 0 : coords.length - 2;
      let index = 0;
      for (let j = 0; j < coords.length - 1; j++) {
        if (index == indexOfSegmentFinal) {
          const start2 = coords[j];
          const end = coords[j + 1];
          const dx = end[0] - start2[0];
          const dy = end[1] - start2[1];
          let rotation = Math.atan2(dy, dx);
          let pos = end;
          if (p.arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT) {
            rotation = Math.atan2(dy, dx) + Math.PI;
            pos = start2;
          }
          styles.push(new Style_default({
            geometry: new Point_default(pos),
            image: new Icon_default({
              src: this.iconArrowWhiteBase64,
              anchor: [0.25, 0.5],
              rotateWithView: true,
              rotation: -rotation,
              color: color2
            })
          }));
          break;
        }
        index++;
      }
    }
    return styles;
  }
  // sc-boundary
  styleBoundary(feature) {
    if (feature == null) {
      return;
    }
    const type = feature.getGeometry().getType();
    const p = feature.getProperties();
    if (typeof p.text === "string" && p.text.trim().length > 0 || this.currentTextBoxId === p.textId && typeof p.textId === "string" && p.textId.trim().length > 0) {
      return null;
    }
    let width = 2;
    if (p?.lineWidth) {
      width = p.lineWidth;
    }
    let lineDash = null;
    if (p?.lineDash) {
      lineDash = p.lineDash;
    }
    let color2 = p?.color;
    let styles = [];
    if (type?.indexOf("Multi") > -1) {
      color2 = p.color ? p.color : this.multiColor;
      if (type === "MultiLineString" && p.arrowHead) {
        const st = this.styleArrow(feature, p, this.multiColor, false);
        for (let i2 = 0; i2 < st.length; i2++) {
          styles.push(st[i2]);
        }
      }
    } else {
      color2 = p.color ? p.color : this.singleColor;
      if (type === "LineString" && p.arrowHead) {
        const st = this.styleArrow(feature, p, this.singleColor, false);
        for (let i2 = 0; i2 < st.length; i2++) {
          styles.push(st[i2]);
        }
      }
    }
    let icon = p?.icon;
    if (p?.point) {
      icon = p?.point;
    }
    if (icon) {
      let anchor2 = [0.5, 1];
      if (icon === SclMapConstantService.MAP_PRIMARY_ASSET || p.icon === SclMapConstantService.MAP_SECONDARY_ASSET || icon === SclMapConstantService.MAP_MARKER) {
        anchor2 = [0.5, 1];
      } else {
        anchor2 = [0.5, 0.5];
      }
      if (p?.point && p?.anchor) {
        anchor2 = p.anchor;
      }
      const iconStyle = new Icon_default({
        src: icon,
        anchor: anchor2
      });
      styles.push(new Style_default({
        image: iconStyle
      }));
    } else {
      const st = new Style_default({
        fill: new Fill_default({
          color: this.colorWithAlpha(color2, 0.3)
          // 'rgba(255, 255, 255, 0.2)'
        }),
        stroke: new Stroke_default({
          color: color2,
          width,
          lineDash
        }),
        image: new Circle_default({
          radius: 7,
          fill: new Fill_default({
            color: color2
          })
        })
      });
      styles.push(st);
    }
    return styles;
  }
  // sc-address-map
  styleAddress(feature, resolution) {
    if (feature == null) {
      return;
    }
    let p = feature.getProperties();
    if (p.features && p.features.length > 0) {
      p = p.features[0].getProperties();
    }
    const fIndex = p.zIndex;
    const geom = feature.getGeometry();
    if (!geom) {
      return;
    }
    let color2 = p.color;
    if (p.radius) {
      if (fIndex === this.layerIndexUser) {
        return this.getCircleSelectionStyle(p, this.selectionStyle);
      } else {
        return this.getCircleStyle(p, p.label, "Point");
      }
    }
    let t = geom.getType();
    if (!t) {
      return;
    }
    let style2 = [];
    if (t === "Point") {
      if (fIndex === this.layerIndexUser) {
        color2 = this.selectionStyle && this.selectionStyle.selectionColor ? this.selectionStyle.selectionColor : p.color;
        style2 = this.getPointSelectionStyle(feature, color2, this.selectionStyle, true);
      } else {
        style2 = this.getPointStyle(color2, p.icon, p.anchor, feature.getGeometry(), p.label, t, p.rotation, true);
        if (p.icon && !p.size) {
          this.getPointStyleScale(feature, p, style2[0]);
        } else {
          this.countGetImgSrc++;
        }
      }
    } else if (t === "MultiPoint") {
      if (fIndex === this.layerIndexUser) {
        color2 = this.selectionStyle && this.selectionStyle.selectionColor ? this.selectionStyle.selectionColor : p.color;
        style2 = this.getMultiPointSelectedStyle(p, this.selectionStyle);
      } else {
        style2 = this.getMultiPointStyle(p);
      }
    } else {
      t = "Line";
      if (fIndex === this.layerIndexUser) {
        color2 = this.selectionStyle && this.selectionStyle.selectionColor ? this.selectionStyle.selectionColor : p.color;
        style2 = this.getLineSelectionStyle(p, color2, this.selectionStyle);
      } else {
        style2 = this.getLineStyle(color2, p, feature.getGeometry(), t);
      }
    }
    return style2;
  }
  drawImage(img, scaleX, scaleY, oldStyle) {
    const x = Math.round(img.width * scaleX);
    const y = Math.round(img.height * scaleY);
    const canvas = document.createElement("canvas");
    canvas.width = Math.abs(x);
    canvas.height = Math.abs(y);
    var ctx = canvas.getContext("2d");
    ctx.translate(Math.abs(Math.min(0, x)), Math.abs(Math.min(0, y)));
    ctx.scale(x < 0 ? -1 : 1, y < 0 ? -1 : 1);
    ctx.drawImage(img, 0, 0, Math.abs(x), Math.abs(y));
    const dataUrl = canvas.toDataURL();
    canvas.remove();
    const anchor2 = oldStyle.getImage().anchor_;
    const angle = oldStyle.getImage().getRotation();
    const iconOptions = {
      src: dataUrl,
      anchor: anchor2,
      rotation: angle
    };
    return new Icon_default(iconOptions);
  }
  // sc-street-address
  styleStAddress(feature, resolution) {
    if (feature == null) {
      return;
    }
    const option = {
      image: SclMapConstantService.MAP_MARKER,
      anchor: [0.5, 1]
      // system defined image
    };
    const styles = {
      Point: [new Style_default(option)],
      LineString: [new Style_default({
        stroke: new Stroke_default({
          color: "blue",
          width: 2
        })
      })]
    };
    if (feature.getProperties() && feature.getGeometry().getType() === "Point") {
      const type = feature.getProperties().typeFeature;
      if (type && type === "tree") {
        console.log("TODO - determine what image should be displayed for the tree type");
        return new Style_default({
          //     image
        });
      }
      if (feature.getProperties().icon) {
        const style2 = new Style_default({
          image: new Icon_default({
            src: feature.getProperties().icon,
            anchor: [0.5, 1]
            // system defined image
          })
        });
        return style2;
      }
    }
    return styles[feature.getGeometry().getType()];
  }
  // sc-selected-asset
  styleAsset(feature, resolution) {
    if (feature == null) {
      return;
    }
    let p = feature.getProperties();
    if (p.features && p.features.length > 0) {
      p = p.features[0].getProperties();
    }
    const color2 = p.color;
    const geom = feature.getGeometry();
    if (!geom) {
      return;
    }
    if (p.radius) {
      return this.getCircleStyle(p, p.label, "Point");
    }
    let t = geom.getType();
    if (!t) {
      return;
    }
    if (t === "Point") {
      let anchor2 = p.anchor;
      const assetType = feature.get("assetType");
      const id2 = p.id;
      const zIndex = "";
      if (id2 === "address") {
        anchor2 = this.addressImageAnchor;
      }
      if (assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
        if (p.primary) {
          anchor2 = p.primary.anchor;
        } else {
          anchor2 = this.primaryImageAnchor;
        }
      }
      if (assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
        if (p.secondary) {
          anchor2 = p.secondary.anchor;
        } else {
          anchor2 = this.secondaryImageAnchor;
        }
      }
      anchor2 = this.getAnchor(p.icon, anchor2);
      const pointStyle = this.getPointStyle(color2, p.icon, anchor2, feature.getGeometry(), p.label, t, p.rotation, true);
      if (p.icon && !p.size) {
        this.getPointStyleScale(feature, p, pointStyle[0]);
      }
      feature.set("feaStyle", pointStyle);
      return pointStyle;
    } else if (t === "MultiPoint") {
      return this.getMultiPointStyle(p);
    } else {
      t = "Line";
      const lineStyle = this.getLineStyle(color2, p, feature.getGeometry(), t);
      return lineStyle;
    }
    return null;
  }
  stylePinAddress(feature) {
    if (feature == null) {
      return;
    }
    let p = feature.getProperties();
    if (p.features && p.features.length > 0) {
      p = p.features[0].getProperties();
    }
    const color2 = p.color;
    const geom = feature.getGeometry();
    if (!geom) {
      return;
    }
    if (p.radius) {
      return this.getCircleStyle(p, p.label, "Point");
    }
    let t = geom.getType();
    if (!t) {
      return null;
    }
    if (t === "Point") {
      let anchor2 = p.anchor;
      const assetType = feature.get("assetType");
      const id2 = p.id;
      const zIndex = "";
      if (id2 === "address") {
        anchor2 = this.addressImageAnchor;
      }
      if (assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
        if (p.primary) {
          anchor2 = p.primary.anchor;
        } else {
          anchor2 = this.primaryImageAnchor;
        }
      }
      if (assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
        if (p.secondary) {
          anchor2 = p.secondary.anchor;
        } else {
          anchor2 = this.secondaryImageAnchor;
        }
      }
      anchor2 = this.getAnchor(p.icon, anchor2);
      const pointStyle = this.getPointStyle(color2, p.icon, anchor2, feature.getGeometry(), p.label, t, p.rotation, false);
      if (p.icon && !p.size) {
        this.getPointStyleScale(feature, p, pointStyle[0]);
      }
      feature.set("feaStyle", pointStyle);
      return pointStyle;
    }
    return null;
  }
  // use for primary selected asset
  stylePrimaryAssetFunc(feature, resolution) {
    return this.styleSelectedAssetFunc(feature, this.primaryAssetSelection, true);
  }
  // use for secondary selected asset
  styleSecondaryAssetFunc(feature, resolution) {
    return this.styleSelectedAssetFunc(feature, this.secondaryAssetSelection, false);
  }
  styleSelectedAssetFunc(feature, assetSelection, isPrimary) {
    if (feature == null) {
      return;
    }
    let style2 = [];
    const p = feature.getProperties();
    if (isPrimary) {
      if (p.primary) {
        assetSelection.selectionImageFileNo = p.primary.image;
        assetSelection.selectionImageAnchor = p.primary.anchor;
        assetSelection.selectionImageRotation = p.primary.rotation;
        assetSelection.selectionColor = p.primary.color;
        assetSelection.selectionFill = p.primary.fillColor;
        assetSelection.selectionFillOpacity = p.primary.fillOpacity;
        assetSelection.selectionLineCap = p.primary.lineCap;
        assetSelection.selectionLineDash = p.primary.lineDash;
        assetSelection.selectionLineWidth = p.primary.lineWidth;
      } else if (!assetSelection.selectionImageFileNo) {
        assetSelection.selectionImageFileNo = SclMapConstantService.MAP_PRIMARY_ASSET;
      }
    } else {
      if (p.secondary) {
        assetSelection.selectionImageFileNo = p.secondary.image;
        assetSelection.selectionImageAnchor = p.secondary.anchor;
        assetSelection.selectionImageRotation = p.secondary.rotation;
        assetSelection.selectionColor = p.secondary.color;
        assetSelection.selectionFill = p.secondary.fillColor;
        assetSelection.selectionFillOpacity = p.secondary.fillOpacity;
        assetSelection.selectionLineCap = p.secondary.lineCap;
        assetSelection.selectionLineDash = p.secondary.lineDash;
        assetSelection.selectionLineWidth = p.secondary.lineWidth;
      } else if (!assetSelection.selectionImageFileNo) {
        assetSelection.selectionImageFileNo = SclMapConstantService.MAP_SECONDARY_ASSET;
      }
    }
    assetSelection = sclUtilMap.checkStyleValue(assetSelection, isPrimary);
    const geom = feature.getGeometry();
    if (!geom) {
      return;
    }
    let t = geom.getType();
    if (p && p.layerDisplayOnly) {
      if (t === "Point") {
        if (p.radius) {
          style2 = this.getCircleStyle(p, p.label, t);
        } else {
          style2 = this.getPointStyle(p.color, p.icon, p.anchor, null, null, null, p.rotation, false);
        }
        feature.set("feaStyle", style2);
      } else {
        style2 = this.getLineStyle(p.color, p, null, null);
      }
      return style2;
    }
    let color2 = assetSelection && assetSelection.selectionColor ? assetSelection.selectionColor : p.color;
    if (t === "Point") {
      if (p.radius) {
        style2 = this.getCircleSelectionStyle(p, assetSelection);
      } else {
        style2 = this.getPointSelectionStyle(feature, color2, assetSelection, false);
      }
      feature.set("feaStyle", style2);
    } else if (t === "MultiPoint") {
      style2.push(this.getMultiPointSelectedStyle(p, assetSelection));
    } else {
      style2.push(this.getLineSelectionStyle(p, color2, assetSelection));
    }
    if (typeof p.label !== void 0 && p.label != null) {
      color2 = p.color;
      style2.push(this.lableStyle(geom, p.label, color2, t));
    }
    return style2;
  }
  getCircleSelectionStyle(properties2, selection) {
    let strokeColor = asArray("#ffcc33");
    let fillColor = asArray("#ffcc33");
    if (properties2.color) {
      strokeColor = properties2.color;
    }
    if (properties2.fillColor) {
      fillColor = properties2.fillColor;
    } else {
      fillColor = strokeColor;
    }
    if (selection) {
      if (selection.selectionColor) {
        strokeColor = selection.selectionColor;
      }
      if (selection.selectionFill) {
        let color1 = asArray(selection.selectionFill);
        color1 = color1.slice();
        if (selection.selectionFillOpacity) {
          color1[3] = selection.selectionFillOpacity;
        }
        fillColor = color1;
      }
    }
    let image = new Circle_default({
      radius: properties2.radius,
      fill: new Fill_default({
        color: fillColor
      })
    });
    const style2 = new Style_default({
      image
    });
    let icon = properties2.icon;
    if (selection && selection.selectionImageFileNo) {
      icon = selection.selectionImageFileNo;
    }
    if (icon) {
      let anchor2 = properties2.anchor;
      let rotation = 0;
      if (selection) {
        if (selection.selectionImageAnchor) {
          anchor2 = selection.selectionImageAnchor;
        }
        if (selection.selectionImageRotation) {
          rotation = selection.selectionImageRotation;
        }
      } else {
        if (icon === SclMapConstantService.MAP_PRIMARY_ASSET) {
          anchor2 = this.primaryImageAnchor;
        } else if (icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
          anchor2 = this.secondaryImageAnchor;
        }
      }
      if (anchor2 === void 0 || anchor2 === null) {
        if (icon === SclMapConstantService.MAP_PRIMARY_ASSET || icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
          anchor2 = [0.5, 1];
        } else {
          if (typeof properties2.assetType !== "undefined" && properties2.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
            if (this.primaryImageAnchor !== void 0) {
              anchor2 = this.primaryImageAnchor;
            }
            if (properties2.primary && properties2.primary.anchor) {
              anchor2 = properties2.primary.anchor;
            }
          } else if (typeof properties2.assetType !== "undefined" && properties2.assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
            if (this.secondaryImageAnchor !== void 0) {
              anchor2 = this.secondaryImageAnchor;
            }
            if (properties2.secondary && properties2.secondary.anchor) {
              anchor2 = properties2.secondary.anchor;
            }
          } else {
            anchor2 = [0.5, 0.5];
          }
        }
      }
      const angle = rotation ? rotation * (Math.PI / 180) : 0;
      const iconIndex = this.cacheImageUrls.indexOf(icon);
      if (iconIndex > -1) {
        const strBase64 = this.cacheImageBase64s[iconIndex];
        image = new Icon_default({
          src: strBase64,
          anchor: anchor2,
          rotation: angle
        });
      }
    }
    const stroke = new Stroke_default({
      color: strokeColor,
      width: 2
    });
    style2.setStroke(stroke);
    if (properties2 && properties2.fillColor) {
      let color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      if (properties2.fillOpacity) {
        color2[3] = properties2.fillOpacity;
      }
      fillColor = color2;
    }
    if (selection & selection.selectionFill) {
      let color1 = asArray(selection.selectionFill);
      color1 = color1.slice();
      if (selection.selectionFillOpacity) {
        color1[3] = selection.selectionFillOpacity;
      }
      fillColor = color1;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    return style2;
  }
  // copy from sclStyleUtil.getPointSelectionStyle
  getPointSelectionStyle(feature, color2, selection, useCache) {
    const p = feature.getProperties();
    let icon = p.icon;
    let anchor2 = p.anchor;
    let rotation = 0;
    if (selection) {
      if (selection.selectionImageFileNo) {
        icon = selection.selectionImageFileNo;
      }
      if (selection.selectionImageAnchor) {
        anchor2 = selection.selectionImageAnchor;
      }
      if (selection.selectionImageRotation) {
        rotation = selection.selectionImageRotation;
      }
    }
    if (icon === SclMapConstantService.MAP_PRIMARY_ASSET) {
      anchor2 = this.primaryImageAnchor;
    } else if (icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
      anchor2 = this.secondaryImageAnchor;
    } else if (icon === SclMapConstantService.MAP_MARKER) {
      anchor2 = [0.5, 1];
    }
    if (anchor2 === void 0 || anchor2 === null) {
      if (icon === SclMapConstantService.MAP_PRIMARY_ASSET || icon === SclMapConstantService.MAP_SECONDARY_ASSET || icon === SclMapConstantService.MAP_MARKER) {
        anchor2 = [0.5, 1];
      } else {
        if (typeof p.assetType !== "undefined" && p.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
          if (this.primaryImageAnchor !== void 0) {
            anchor2 = this.primaryImageAnchor;
          }
          if (p.primary) {
            anchor2 = p.primary.anchor;
          }
        } else if (typeof p.assetType !== "undefined" && p.assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
          if (this.secondaryImageAnchor !== void 0) {
            anchor2 = this.secondaryImageAnchor;
          }
          if (p.secondary) {
            anchor2 = p.secondary.anchor;
          }
        } else {
          anchor2 = [0.5, 0.5];
        }
      }
    }
    const angle = rotation ? rotation * (Math.PI / 180) : 0;
    let iconStyle = null;
    let strBase64 = null;
    if (icon) {
      strBase64 = icon;
      if (useCache) {
        const iconIndex = this.cacheImageUrls.indexOf(icon);
        if (iconIndex > -1) {
          strBase64 = this.cacheImageBase64s[iconIndex];
        }
      }
      iconStyle = new Icon_default({
        src: strBase64,
        anchor: anchor2,
        rotation: angle
      });
    } else {
      iconStyle = new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: color2
          // '#ffcc33'
        })
      });
    }
    if (selection) {
      if (selection.selectionImageAnchor) {
        iconStyle = new Icon_default({
          src: strBase64,
          anchor: anchor2,
          rotation: angle
        });
      }
    }
    const stylePoint = [new Style_default({
      image: iconStyle
      // zIndex: 10
    })];
    return stylePoint;
  }
  // copy from sclStyleUtil.getLineSelectionStyle
  getLineSelectionStyle(properties2, color2, selection) {
    if (properties2.type === "MultiPoint") {
      const multiPointStyle = this.getMultiPointSelectedStyle(properties2, selection);
      return multiPointStyle;
    } else {
      if (selection && selection.selectionColor) {
        color2 = selection.selectionColor;
      }
      const lineStyle = this.getLineStyle2(color2, properties2);
      if (selection) {
        if (selection.selectionColor) {
          lineStyle.getStroke().setColor(selection.selectionColor);
        }
        if (selection.selectionLineDash) {
          if (Array.isArray(selection.selectionLineDash)) {
            lineStyle.getStroke().setLineDash(selection.selectionLineDash);
          }
        }
        if (selection.selectionLineWidth) {
          lineStyle.getStroke().setWidth(selection.selectionLineWidth);
        }
        if (selection.selectionLineCap) {
          lineStyle.getStroke().setLineCap(selection.selectionLineCap);
        }
        if (selection.selectionFill) {
          let color1 = asArray(selection.selectionFill);
          color1 = color1.slice();
          if (selection.selectionFillOpacity) {
            color1[3] = selection.selectionFillOpacity;
          }
          lineStyle.getFill().setColor(color1);
        }
      }
      return lineStyle;
    }
  }
  getLineStyle2(color2, properties2) {
    let lineColor = "blue";
    if (color2) {
      lineColor = color2;
    }
    const style2 = new Style_default({
      image: new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: "#ffcc33"
        })
      })
    });
    const stroke = new Stroke_default({
      color: lineColor,
      width: 2
    });
    if (properties2) {
      if (properties2.lineWidth) {
        stroke.setWidth(properties2.lineWidth);
      }
      if (properties2.lineDash) {
        stroke.setLineDash(properties2.lineDash);
      }
      if (properties2.lineCap) {
        stroke.setLineCap(properties2.lineCap);
      }
    }
    style2.setStroke(stroke);
    let fillColor = asArray("rgba(255, 255, 255, 0.2)");
    if (properties2 && properties2.fillColor) {
      let color1 = asArray(properties2.fillColor);
      color1 = color1.slice();
      if (properties2.fillOpacity) {
        color1[3] = properties2.fillOpacity;
      }
      fillColor = color1;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    return style2;
  }
  getMultiPointSelectedStyle(properties2, selection) {
    let strokeColor = asArray("#ffcc33");
    let fillColor = asArray("#ffcc33");
    if (properties2.color) {
      strokeColor = properties2.color;
    }
    if (properties2.fillColor) {
      fillColor = properties2.fillColor;
    } else {
      fillColor = strokeColor;
    }
    if (selection) {
      if (selection.selectionColor) {
        strokeColor = selection.selectionColor;
      }
      if (selection.selectionFill) {
        let color1 = asArray(selection.selectionFill);
        color1 = color1.slice();
        if (selection.selectionFillOpacity) {
          color1[3] = selection.selectionFillOpacity;
        }
        fillColor = color1;
      }
    }
    let image = new Circle_default({
      radius: 7,
      fill: new Fill_default({
        color: fillColor
      })
    });
    const style2 = new Style_default({
      image
    });
    let icon = properties2.icon;
    if (selection && selection.selectionImageFileNo) {
      icon = selection.selectionImageFileNo;
    }
    if (icon) {
      let anchor2 = properties2.anchor;
      let rotation = 0;
      if (selection) {
        if (selection.selectionImageAnchor) {
          anchor2 = selection.selectionImageAnchor;
        }
        if (selection.selectionImageRotation) {
          rotation = selection.selectionImageRotation;
        }
      } else {
        if (icon === SclMapConstantService.MAP_PRIMARY_ASSET) {
          anchor2 = this.primaryImageAnchor;
        } else if (icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
          anchor2 = this.secondaryImageAnchor;
        }
      }
      if (anchor2 === void 0 || anchor2 === null) {
        if (icon === SclMapConstantService.MAP_PRIMARY_ASSET || icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
          anchor2 = [0.5, 1];
        } else {
          if (typeof properties2.assetType !== "undefined" && properties2.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
            if (this.primaryImageAnchor !== void 0) {
              anchor2 = this.primaryImageAnchor;
            }
            if (properties2.primary && properties2.primary.anchor) {
              anchor2 = properties2.primary.anchor;
            }
          } else if (typeof properties2.assetType !== "undefined" && properties2.assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
            if (this.secondaryImageAnchor !== void 0) {
              anchor2 = this.secondaryImageAnchor;
            }
            if (properties2.secondary && properties2.secondary.anchor) {
              anchor2 = properties2.secondary.anchor;
            }
          } else {
            anchor2 = [0.5, 0.5];
          }
        }
      }
      const angle = rotation ? rotation * (Math.PI / 180) : 0;
      image = new Icon_default({
        src: icon,
        anchor: anchor2,
        rotation: angle
      });
    }
    const stroke = new Stroke_default({
      color: strokeColor,
      width: 2
    });
    style2.setStroke(stroke);
    if (properties2 && properties2.fillColor) {
      let color2 = asArray(properties2.fillColor);
      color2 = color2.slice();
      if (properties2.fillOpacity) {
        color2[3] = properties2.fillOpacity;
      }
      fillColor = color2;
    }
    if (selection & selection.selectionFill) {
      let color1 = asArray(selection.selectionFill);
      color1 = color1.slice();
      if (selection.selectionFillOpacity) {
        color1[3] = selection.selectionFillOpacity;
      }
      fillColor = color1;
    }
    const fill = new Fill_default({
      color: fillColor
    });
    style2.setFill(fill);
    return style2;
  }
  styleSelectedFunc(feature, resolution) {
    if (feature == null) {
      return;
    }
    let style2 = [];
    const p = feature.getProperties();
    const geom = feature.getGeometry();
    let t = geom.getType();
    let color2 = this.selectionStyle && this.selectionStyle.selectionColor ? this.selectionStyle.selectionColor : p.color;
    if (geom && t === "Point") {
      t = "Point";
      style2 = this.getPointSelectionStyle(feature, color2, this.selectionStyle, false);
    } else {
      style2.push(this.getLineSelectionStyle(p, color2, this.selectionStyle));
    }
    if (typeof p.label !== void 0 && p.label != null) {
      color2 = p.color;
      style2.push(this.lableStyle(geom, p.label, color2, t));
    }
    return style2;
  }
  addStyleControlButton(btn, zoomOptions) {
    btn.onmouseover = () => {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "lightgrey";
      if (zoomOptions) {
        if (zoomOptions.isZoomIn) {
          btn.setAttribute("title", "Zoom in (" + this.view.getZoom() + ")");
        } else {
          btn.setAttribute("title", "Zoom out (" + this.view.getZoom() + ")");
        }
      }
    };
    btn.onmouseout = () => {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "white";
    };
    btn.onclick = () => {
      this.hasClickButtonZoom = true;
    };
  }
  initializeMap(initObj, controls, view, mapLayers, multiLayers) {
    const ConfigService3 = initObj.configService;
    const interactions = initObj.interactions;
    const disableMouseWheel = initObj.disableMouseWheel;
    let sourceXYZ = [];
    if (multiLayers && multiLayers.length > 0) {
      sourceXYZ = multiLayers;
    } else {
      if (mapLayers) {
        sourceXYZ.push(mapLayers);
      } else {
        const optionOSM = {
          url: "https://osm.formbird.com/tiles/{z}/{x}/{y}.png",
          // ConfigService.clientConfig().openLayers.tileServer.url,
          // crossOrigin: ConfigService.clientConfig().openLayers.tileServer.crossOrigin,
          wrapDateLine: false,
          // not support 6.15.1
          wrapX: false,
          noWrap: true
          // not support 6.15.1
        };
        const tile = new Tile_default4({
          source: new OSM_default(optionOSM)
        });
        sourceXYZ.push(tile);
      }
    }
    let mouseWheel = true;
    if (disableMouseWheel) {
      mouseWheel = false;
    }
    const fspan = document.createElement("i");
    fspan.setAttribute("class", "material-icons");
    fspan.innerHTML = "fullscreen";
    fspan.style.fontSize = "30px";
    const fSpanActive = document.createElement("i");
    fSpanActive.setAttribute("class", "material-icons");
    fSpanActive.innerHTML = "fullscreen_exit";
    fSpanActive.style.fontSize = "30px";
    const fullscreenCtrl = new FullScreen_default({
      label: fspan,
      labelActive: fSpanActive,
      tipLabel: "Fullscreen"
    });
    const fullscreenBtn = fullscreenCtrl.element.childNodes[0];
    this.addStyleControlButton(fullscreenBtn, null);
    document.addEventListener("webkitfullscreenchange mozfullscreenchange fullscreenchange", (evt) => {
      this.fullscreenChangeHandle(fspan);
    });
    const zoomBtn = new Zoom_default({
      className: "ol-zoom my-new-class-name"
    });
    const zoomBtnIn = zoomBtn.element.childNodes[0];
    const zoomBtnOut = zoomBtn.element.childNodes[1];
    this.addStyleControlButton(zoomBtnIn, { isZoomIn: true });
    this.addStyleControlButton(zoomBtnOut, { isZoomIn: false });
    if (initObj.componentDefinition) {
      let clConfig;
      if (initObj.configService) {
        clConfig = initObj.configService.clientConfig();
      }
      if (initObj.componentDefinition.tileServerGL && clConfig && clConfig.openLayers && clConfig.openLayers.tileServerGL) {
        const mapUrl = clConfig.openLayers.tileServerGL.url;
        const layerMVT = new VectorTile_default({
          source: new VectorTile_default3({
            format: new MVT_default({ featureClass: Feature_default2 }),
            url: mapUrl,
            maxZoom: 14
          })
        });
        const styleUrl = mapUrl.replace("data/v3/{z}/{x}/{y}.pbf", "styles/basic-preview/style.json");
        fetch(styleUrl).then(function(response) {
          response.json().then(function(glStyle) {
            stylefunction(layerMVT, glStyle, "openmaptiles");
          });
        });
        sourceXYZ = [layerMVT];
      }
    }
    const map2 = new Map_default2({
      controls: defaults2({
        attribution: false,
        zoom: false
      }).extend([
        fullscreenCtrl,
        zoomBtn
      ]),
      interactions: defaults3({ mouseWheelZoom: mouseWheel }),
      layers: sourceXYZ,
      target: this.mapDiv,
      view
    });
    if (controls != null && controls.length) {
      for (let i2 = 0; i2 < controls.length; i2++) {
        controls[i2].element.style.zIndex = this.layerIndexControl;
        map2.addControl(controls[i2]);
      }
    }
    if (interactions != null && interactions.length) {
      for (let i2 = 0; i2 < interactions.length; i2++) {
        map2.addInteraction(interactions[i2]);
      }
    }
    if (this.layerAssets.length > 0) {
      for (let iLa = 0; iLa < this.layerAssets.length; iLa++) {
        map2.addLayer(this.layerAssets[iLa]);
      }
    }
    if (mouseWheel) {
      if (this.onMapWheelScroll && typeof this.onMapWheelScroll === "function") {
        this.mapDiv.onwheel = this.onMapWheelScroll;
      }
    }
    return map2;
  }
  fullscreenChangeHandle(fspan) {
    this.isFullScreen = false;
    if (fspan.innerHTML === "fullscreen") {
      fspan.innerHTML = "fullscreen_exit";
      this.isFullScreen = true;
    } else {
      fspan.innerHTML = "fullscreen";
    }
    if (!window.screenTop && !window.screenY) {
      let heightMap = this.heightMapInit;
      if (heightMap <= 0) {
        heightMap = this.mapDiv.offsetHeight;
      }
      this.handleFullScreen(this.isFullScreen, heightMap);
    } else {
      this.handleFullScreen(this.isFullScreen, this.mapDiv.offsetHeight);
    }
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.updateMenuChildCss();
    }
  }
  handleFullScreen(isFullScreen2, mapHeight) {
    console.log(`**** handleFullScreen`);
    if (this.elementCtrl != null) {
      this.mapControlStyle(this.elementCtrl, mapHeight);
    }
    if (this.fullScreenEvent != null && typeof this.fullScreenEvent === "function") {
      this.fullScreenEvent(mapHeight, isFullScreen2);
    }
  }
  addInteractionSnap() {
    this.snap = [];
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (this.layerAssets[i2].get("isHeatMap") || this.layerAssets[i2].get("layerDisplayOnly")) {
        continue;
      }
      const iSnap = new Snap_default({
        source: this.layerAssets[i2].getSource(),
        pixelTolerance: 5
      });
      this.snap.push(iSnap);
      this.map.addInteraction(iSnap);
    }
  }
  removeInteractionSnap() {
    if (!this.snap) {
      return;
    }
    for (let i2 = 0; i2 < this.snap.length; i2++) {
      this.map.removeInteraction(this.snap[i2]);
    }
    this.snap = [];
  }
  drawDefaultStyle(drawStart, drawEnd) {
    this.draw = new Draw_default({
      source: this.source,
      type: this.drawType,
      snapTolerance: 1
    });
    this.map.addInteraction(this.draw);
    if (drawStart) {
      this.draw.on("drawstart", (evt) => {
        if (typeof drawStart === "function") {
          drawStart(evt);
        }
      });
    }
    if (drawEnd) {
      this.draw.on("drawend", (evt) => {
        if (typeof drawEnd === "function") {
          drawEnd(evt);
        }
      });
    }
  }
  drawPrimaryStyle(drawStart, drawEnd) {
    if (this.drawType == null) {
      this.drawType = OpenlayerDrawType.POINT;
    }
    let color2 = "#0099FF";
    if (this.compActionType === "primary") {
      color2 = "LimeGreen";
    }
    if (this.compActionType === "secondary") {
      color2 = "black";
    }
    if (this.selectPointerMove !== null) {
      this.map.removeInteraction(this.selectPointerMove);
    }
    this.selectPointerMove = new Select_default({
      condition: pointerMove,
      style: this.selectInteractionStyle.bind(this),
      filter: function(f) {
        if (f.getGeometry() && f.getGeometry().getType() !== "Point") {
          return true;
        }
      }
    });
    if (this.selectPointerMove !== null) {
      this.map.addInteraction(this.selectPointerMove);
    }
    this.draw = new Draw_default({
      source: this.source,
      type: this.drawType,
      style: new Style_default({
        image: new Circle_default({
          radius: 7,
          fill: new Fill_default({
            color: color2
          }),
          stroke: new Stroke_default({
            color: "white",
            width: 2
          })
        })
      })
    });
    this.map.addInteraction(this.draw);
    if (drawStart) {
      this.draw.on("drawstart", (evt) => {
        if (typeof drawStart === "function") {
          drawStart(evt);
        }
      });
    }
    if (drawEnd) {
      this.draw.on("drawend", (evt) => {
        const fea = evt.feature;
        if (fea) {
          const geom = fea.getGeometry();
          const coord = geom.getCoordinates();
          const coor = transform(coord, this.EPSG, "EPSG:4326");
          evt.latLng = { lat: parseFloat(coor[1]), lng: parseFloat(coor[0]) };
        }
        if (typeof drawEnd === "function") {
          drawEnd(evt);
        }
      });
    }
  }
  drawEndFeature(feature, lineLength, dimensionId) {
    let color2 = this.colorCurrentSelected ? this.colorCurrentSelected : this.singleColor;
    if (!this.isDrawModeSingle) {
      color2 = this.colorCurrentSelected ? this.colorCurrentSelected : this.multiColor;
    }
    let fillColor = asArray(color2);
    fillColor = this.colorWithAlpha(fillColor, 0.3);
    const width = this.lineWidthCurrentSelected ? this.lineWidthCurrentSelected : 2;
    const lineDash = this.lineDashCurrentSelected ? this.lineDashCurrentSelected : null;
    const imageSrc = this.iconCurrentSelected ? this.iconCurrentSelected : null;
    let st = new Style_default({
      fill: new Fill_default({
        color: fillColor
      }),
      stroke: new Stroke_default({
        color: color2,
        width,
        lineDash
      }),
      image: new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: color2
        })
      })
    });
    if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ICON && imageSrc) {
      st.setImage(new Icon_default({
        src: imageSrc,
        anchor: this.iconAnchorCurrentSelected
      }));
    }
    let s = [st];
    if (feature) {
      const p = feature.getProperties();
      if ((this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT || this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_LAST_POINT) && (this.drawType === OpenlayerDrawType.LINE_STRING || this.drawType === OpenlayerDrawType.MULTI_LINE_STRING)) {
        const st2 = this.styleArrow(feature, p, color2, false);
        for (let i2 = 0; i2 < st2.length; i2++) {
          s.push(st2[i2]);
        }
        p.arrowHead = this.drawTypeSpecific;
      } else if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ICON) {
        p.point = imageSrc;
        p.anchor = this.iconAnchorCurrentSelected;
      } else if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION) {
        p.dimension = lineLength;
        p.dimensionId = dimensionId;
      }
      feature.setStyle(s);
      if (this.colorCurrentSelected) {
        p.fillColor = color2;
        p.color = color2;
      }
      if (this.lineWidthCurrentSelected) {
        p.lineWidth = this.lineWidthCurrentSelected;
      }
      if (this.lineDashCurrentSelected) {
        p.lineDash = this.lineDashCurrentSelected;
      }
      if (this.fontCurrentSelected) {
        p.font = this.fontCurrentSelected;
      }
      if (this.fontSizeCurrentSelected) {
        p.fontSize = this.fontSizeCurrentSelected;
      }
      if (!this.isDrawModeSingle) {
        if (this.drawType === OpenlayerDrawType.POINT || this.drawType === OpenlayerDrawType.MULTI_POINT) {
          p.idGroup = SclMapConstantService.DRAWING_MULTI_POINT;
        } else if (this.drawType === OpenlayerDrawType.LINE_STRING || this.drawType === OpenlayerDrawType.MULTI_LINE_STRING) {
          p.idGroup = SclMapConstantService.DRAWING_MULTI_LINE_STRING;
        } else if (this.drawType === OpenlayerDrawType.POLYGON || this.drawType === OpenlayerDrawType.MULTI_POLYGON) {
          p.idGroup = SclMapConstantService.DRAWING_MULTI_POLYGON;
        } else if (this.drawType === OpenlayerDrawType.CIRCLE) {
          p.idGroup = SclMapConstantService.DRAWING_MULTI_CIRCLE;
        } else if (this.drawType === OpenlayerDrawType.SQUARE) {
          p.idGroup = SclMapConstantService.DRAWING_MODE_SINGLE;
        } else if (this.drawType === OpenlayerDrawType.BOX) {
          p.idGroup = SclMapConstantService.DRAWING_MULTI_RECTANGLE;
        }
      }
      feature.setProperties(p);
    }
    return feature;
  }
  drawCustomStyle(drawStart, drawEnd) {
    if (this.drawType === OpenlayerDrawType.TEXT) {
      return;
    }
    let geometryFunction;
    if (this.drawType == null) {
      this.drawType = OpenlayerDrawType.POINT;
    }
    let color2 = this.singleColorDraging;
    if (!this.isDrawModeSingle) {
      color2 = this.multiColorDraging;
    }
    let drawType = this.drawType;
    let dimensionLabel;
    let dimensionOverlay;
    let lineLength = 0;
    let dimensionId = null;
    if (this.drawType === OpenlayerDrawType.CIRCLE) {
    } else if (this.drawType === OpenlayerDrawType.SQUARE) {
      drawType = OpenlayerDrawType.CIRCLE;
      geometryFunction = createRegularPolygon(4);
    } else if (this.drawType === OpenlayerDrawType.BOX) {
      drawType = OpenlayerDrawType.CIRCLE;
      geometryFunction = createBox();
    }
    this.draw = new Draw_default({
      source: this.source,
      type: drawType,
      geometryFunction,
      style: new Style_default({
        image: new Circle_default({
          radius: 7,
          fill: new Fill_default({
            color: color2
          }),
          stroke: new Stroke_default({
            color: "white",
            width: 2
          })
        })
      })
    });
    this.map.addInteraction(this.draw);
    if (drawStart) {
      this.draw.on("drawstart", (evt) => {
        this.hasDocumentChangeValue = false;
        let color1 = this.singleColorDraging;
        const width = this.lineWidthCurrentSelected ? this.lineWidthCurrentSelected : 2;
        const lineDash = this.lineDashCurrentSelected ? this.lineDashCurrentSelected : null;
        if (!this.isDrawModeSingle && (this.drawType === OpenlayerDrawType.LINE_STRING || this.drawType === OpenlayerDrawType.POLYGON || this.drawType === OpenlayerDrawType.MULTI_LINE_STRING || this.drawType === OpenlayerDrawType.MULTI_POLYGON || this.drawType === OpenlayerDrawType.CIRCLE || this.drawType === OpenlayerDrawType.SQUARE || this.drawType === OpenlayerDrawType.BOX)) {
          color1 = this.multiColorDraging;
        }
        if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION) {
          dimensionId = uuid2.v1();
          const obj = this.createDimensionFeature(dimensionId, evt.coordinate, null, this.fontCurrentSelected, this.fontSizeCurrentSelected);
          dimensionOverlay = obj.dimensionOverlay;
          dimensionLabel = obj.dimensionLabel;
          this.sketch = evt.feature;
          let tooltipCoord = evt.coordinate;
          this.sketchGeomOnChange = this.sketch.getGeometry().on("change", (evt2) => {
            const geom = evt2.target;
            let output;
            if (geom instanceof LineString_default) {
              const length = getLength(geom);
              output = sclUtilMap.formatDimension(length, this.dimensionsUnit, this.dimensionsPrecision);
              const coords = geom.getCoordinates();
              const totalLength = sclUtilMap.totalLen(coords);
              const midDistance = totalLength / 2;
              tooltipCoord = sclUtilMap.getPointByDistance(coords, midDistance);
              lineLength = length;
            }
            dimensionLabel.innerHTML = output;
            dimensionOverlay.setPosition(tooltipCoord);
          });
        }
        const s = [
          new Style_default({
            stroke: new Stroke_default({
              color: color1,
              width,
              lineDash
            }),
            image: new Circle_default({
              radius: 7,
              fill: new Fill_default({
                color: color1
              }),
              stroke: new Stroke_default({
                color: "white",
                width,
                lineDash
              })
            })
          })
        ];
        this.currentLine = null;
        if (evt && evt.feature) {
          if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT || this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_LAST_POINT) {
            const p = evt.feature.getProperties();
            p.arrowHead = this.drawTypeSpecific;
            evt.feature.setProperties(p);
          }
          evt.feature.setStyle(s);
          this.currentLine = evt.feature;
        }
        if (typeof drawStart === "function") {
          drawStart(evt);
        }
      });
    }
    if (drawEnd) {
      this.draw.on("drawend", (evt) => {
        if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION) {
          this.sketch = null;
          unByKey(this.sketchGeomOnChange);
          dimensionLabel.className = "ol-tooltip";
          dimensionOverlay.setOffset([0, -7]);
          if (this.fontCurrentSelected) {
            dimensionLabel.style["font-family"] = this.fontCurrentSelected;
          }
          if (this.fontSizeCurrentSelected) {
            dimensionLabel.style["font-size"] = this.fontSizeCurrentSelected;
          }
        }
        evt.feature = this.drawEndFeature(evt?.feature, lineLength, dimensionId);
        if (typeof drawEnd === "function") {
          drawEnd(evt);
        }
      });
    }
  }
  createDimensionFeature(id2, coordinate, dimensionValue, fontFamily, fontSize) {
    let overlayIsAdded = false;
    if (this.map.getOverlayById(id2)) {
      overlayIsAdded = true;
    }
    if (overlayIsAdded) {
      console.log(`This dimension box ${id2} is added in map before`);
      return;
    }
    console.log(`Create dimension box ${id2}, coordinate = ${coordinate}`);
    const dimensionContainer = document.createElement("div");
    dimensionContainer.className = "ol-tooltip";
    dimensionContainer.id = id2;
    const idLabel = `${id2}_label`;
    const dimensionLabel = document.createElement("div");
    dimensionLabel.id = idLabel;
    dimensionLabel.style.display = "block";
    dimensionContainer.appendChild(dimensionLabel);
    const dimensionOverlay = new Overlay_default({
      element: dimensionContainer,
      offset: [0, -15],
      positioning: "bottom-center",
      stopEvent: false,
      insertFirst: false,
      id: id2
    });
    this.map.addOverlay(dimensionOverlay);
    dimensionOverlay.setPosition(coordinate);
    if (dimensionValue !== null) {
      dimensionContainer.innerHTML = sclUtilMap.formatDimension(dimensionValue, this.dimensionsUnit, this.dimensionsPrecision);
      dimensionContainer.className = "ol-tooltip";
      dimensionOverlay.setOffset([0, -7]);
    }
    if (fontFamily) {
      dimensionContainer.style["font-family"] = fontFamily;
      dimensionLabel.style["font-family"] = fontFamily;
    }
    if (fontSize) {
      dimensionContainer.style["font-size"] = fontSize;
      dimensionLabel.style["font-size"] = fontSize;
    }
    const closeDimensionEditorFn = (e) => {
      this.dimensionEditorContainer.style.display = "none";
      dimensionLabel.style.display = "block";
      const value = parseFloat(this.dimensionEditorInput.value);
      dimensionLabel.innerHTML = sclUtilMap.formatDimension(value, this.dimensionsUnit, this.dimensionsPrecision);
      this.vector.getSource().getFeatures().forEach((f) => {
        const p = f.getProperties();
        if (p.dimensionId === id2) {
          p.dimension = value;
          if (fontFamily) {
            p.font = fontFamily;
          }
          if (fontSize) {
            p.fontSize = fontSize;
          }
          f.setProperties(p);
          if (this.previousDimensionValue != value) {
            this.hasDocumentChangeValue = false;
            if (typeof this.setDirtyFunction === "function") {
              this.setDirtyFunction();
            }
          }
          return;
        }
      });
      this.closeDimensionEditorFn = null;
      this.reCalculateDimensionFn = null;
    };
    const reCalculateDimensionFn = (e) => {
      let feature = null;
      this.vector.getSource().getFeatures().forEach((f) => {
        const p = f.getProperties();
        if (p.dimensionId === id2) {
          feature = f;
          return;
        }
      });
      if (feature) {
        const p = feature.getProperties();
        const geom = feature.getGeometry();
        if (geom instanceof LineString_default) {
          const length = getLength(geom);
          p.dimension = length;
          if (fontFamily) {
            p.font = fontFamily;
          }
          if (fontSize) {
            p.fontSize = fontSize;
          }
          feature.setProperties(p);
          this.dimensionEditorInput.value = length;
        }
      }
    };
    dimensionContainer.onclick = (e) => {
      console.log(`**** click dimensionContainer ${dimensionContainer.id}`);
      this.dimensionEditorContainer.style.display = "flex";
      dimensionLabel.style.display = "none";
      const containerPos = dimensionContainer.getBoundingClientRect();
      const containerHeight = dimensionContainer.offsetHeight / 2;
      const editorHeight = this.dimensionEditorContainer.offsetHeight;
      this.dimensionEditorContainer.style.top = `${containerPos.top - editorHeight - containerHeight}px`;
      this.dimensionEditorContainer.style.left = `${containerPos.left}px`;
      const content = dimensionContainer.innerHTML.replace(this.dimensionsUnit, "");
      this.previousDimensionValue = parseFloat(content);
      this.dimensionEditorInput.value = this.previousDimensionValue;
      this.closeDimensionEditorFn = closeDimensionEditorFn.bind(this);
      this.reCalculateDimensionFn = reCalculateDimensionFn.bind(this);
    };
    return { dimensionLabel, dimensionOverlay };
  }
  selectInteractionStyle(feature, resolution) {
    const type = feature.getGeometry().getType();
    let color2 = "rgba(0,153,255,1.0)";
    if (this.compActionType === "primary") {
      color2 = "LimeGreen";
    } else if (this.compActionType === "secondary") {
      color2 = "black";
    }
    if (type === "Point") {
      return feature.get("feaStyle");
    } else if (type === "MultiPoint") {
      const image = new Circle_default({
        radius: 7,
        fill: new Fill_default({
          color: color2
        })
      });
      return new Style_default({
        image
      });
    } else {
      return new Style_default({
        stroke: new Stroke_default({
          color: color2,
          width: 0
        }),
        fill: new Fill_default({
          color: "rgba(255,255,255,0.5)"
        })
      });
    }
  }
  selectInteraction() {
    if (this.selectPointerMove !== null) {
      this.map.removeInteraction(this.selectPointerMove);
    }
    this.selectPointerMove = new Select_default({
      condition: pointerMove,
      style: this.selectInteractionStyle.bind(this)
      // filter: function(f) {
      //   if ((f.getGeometry() && f.getGeometry().getType() !== 'Point') ) {
      //     return true;
      //   }
      // }
    });
    if (this.selectPointerMove !== null) {
      this.map.addInteraction(this.selectPointerMove);
      this.selectPointerMove.on("select", this.toolTipOnFeatureHover);
    }
  }
  addInteractionDraw(drawStart, drawEnd) {
    if (this.drawType == null) {
      this.drawType = OpenlayerDrawType.POINT;
    }
    this.map.removeInteraction(this.selectPointerMove);
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.drawCustomStyle(drawStart, drawEnd);
    } else if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      this.drawPrimaryStyle(drawStart, drawEnd);
    } else {
      this.drawDefaultStyle(drawStart, drawEnd);
    }
  }
  removeInteractionDraw() {
    this.map.removeInteraction(this.draw);
    if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      if (this.compActionType === "") {
        this.selectInteraction();
      }
    }
  }
  addInteraction() {
    this.addInteractionDraw({}, {});
    this.vector.getSource().on("addfeature", (event) => {
      if (this.drawType === OpenlayerDrawType.TEXT) {
        return;
      }
      if (this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
        this.setDirtyFunction();
      }
    });
  }
  deselectAllControlBtn(currentBtnId) {
    for (let i2 = 0; i2 < this.controlBtns.length; i2++) {
      if (!this.controlBtns[i2] || this.controlBtns[i2].id === currentBtnId) {
        continue;
      }
      this.controlBtns[i2].style.backgroundColor = "white";
    }
  }
  modeAction(e) {
    this.hideDrawTools();
    this.showMenu(false);
    this.showMenuButton(true);
    this.showTooltip = true;
    this.deselectAllControlBtn(e.currentTarget.id);
    this.map.removeInteraction(this.select);
    this.map.removeInteraction(this.draw);
    this.map.removeInteraction(this.modify);
    const cssOnlySingleMode = this.isDrawModeSingle ? "block" : "none";
    for (let i2 = 0; i2 < this.drawButtonsForOnlySingleMode.length; i2++) {
      this.drawButtonsForOnlySingleMode[i2].style.display = cssOnlySingleMode;
    }
    if (this.allowDrawingMode !== SclMapConstantService.DRAWING_MODE_ALL) {
      return;
    }
    if (this.isDrawModeSingle) {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Multi mode";
      }
      this.isDrawModeSingle = false;
      this.modeLabel.innerHTML = "layers";
    } else {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Single mode";
      }
      this.isDrawModeSingle = true;
      this.modeLabel.innerHTML = "layers_clear";
    }
    this.actionType = SclMapConstantService.DRAWING_ACTION_MODE;
  }
  selectAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.deselectAllControlBtn(e.currentTarget.id);
    this.map.removeInteraction(this.draw);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showTooltip = true;
      this.selectInteraction();
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_SELECT;
      this.map.addInteraction(this.select);
      this.map.addInteraction(this.modify);
      this.showTooltip = false;
      this.map.removeInteraction(this.selectPointerMove);
    }
  }
  updateMenuChildCss() {
    this.showStylingSubMenu(null, false);
    const mapDivSize = this.isBottom ? this.mapDiv?.offsetHeight : this.mapDiv?.offsetWidth;
    this.updateDrawingSubMenuCss(mapDivSize);
  }
  showMenu(isShow) {
    if (!this.drawMenuChild) {
      return;
    }
    const displayBottom = this.isBottom ? "block" : "-webkit-box";
    const display = isShow ? displayBottom : "none";
    this.drawMenuChild.style.display = display;
    this.showMenuChilds(isShow);
    const cssOnlySingleMode = this.isDrawModeSingle ? "block" : "none";
    for (let i2 = 0; i2 < this.drawButtonsForOnlySingleMode.length; i2++) {
      this.drawButtonsForOnlySingleMode[i2].style.display = cssOnlySingleMode;
    }
    this.updateMenuChildCss();
  }
  showMenuChilds(isShow) {
    super.showMenuChilds(isShow);
    const display = isShow ? "block" : "none";
    if (this.menuSquareBtn) {
      this.menuSquareBtn.style.display = display;
    }
  }
  menuAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    this.map.removeInteraction(this.draw);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showMenu(false);
      this.showTooltip = true;
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_MENU;
      this.showMenu(true);
      this.showTooltip = false;
    }
  }
  hideDrawTools() {
    super.hideDrawTools();
    this.hideDrawTool(this.squareBtn);
  }
  shapeAction(e, drawTypeSingle, drawTypeMulti, drawTypeSpecific = null) {
    this.deselectAllControlBtn(e.currentTarget.id);
    this.map.removeInteraction(this.modify);
    this.map.removeInteraction(this.draw);
    this.map.removeInteraction(this.select);
    this.drawTypeSpecific = null;
    this.sketchGPS = null;
    this.sketchGPSPoints = [];
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.drawType = OpenlayerDrawType.NA;
      this.showMenu(true);
      this.hideDrawTools();
      this.showMenuButton(true);
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_EDIT;
      if (drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX) {
        this.drawType = drawTypeSpecific;
      } else {
        this.drawType = this.isDrawModeSingle ? drawTypeSingle : drawTypeMulti;
        this.addInteraction();
      }
      this.showMenu(false);
    }
  }
  pointAction(e) {
    this.shapeAction(e, "Point", "MultiPoint");
  }
  lineAction(e) {
    this.shapeAction(e, "LineString", "MultiLineString");
  }
  polygonAction(e) {
    this.shapeAction(e, "Polygon", "MultiPolygon");
  }
  circleAction(e) {
    this.shapeAction(e, "Circle", "Circle");
  }
  squareAction(e) {
    this.shapeAction(e, "Square", "Square");
  }
  boxAction(e) {
    this.shapeAction(e, "Box", "Box");
  }
  textAction(e) {
    this.shapeAction(e, "Point", "Point", SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX);
  }
  arrowAtFirstPointAction(e) {
    this.shapeAction(e, "LineString", "MultiLineString");
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT;
  }
  arrowAtLastPointAction(e) {
    this.shapeAction(e, "LineString", "MultiLineString");
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_LAST_POINT;
  }
  drawIconAction(e) {
    this.shapeAction(e, "Point", "MultiPoint");
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ICON;
  }
  dimensionAction(e) {
    if (!this.isDrawModeSingle) {
      return;
    }
    this.shapeAction(e, "LineString", "LineString");
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_DIMENSION;
  }
  deleteAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.map.removeInteraction(this.modify);
    this.map.removeInteraction(this.draw);
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showTooltip = true;
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_DELETE;
      this.showTooltip = false;
    }
    console.log(`**** deleteAction, drawType = ${this.drawType}`);
    if (this.drawType === OpenlayerDrawType.TEXT) {
      this.drawType = OpenlayerDrawType.POINT;
    }
  }
  resetCheckLocationUI() {
    this.locationChecked = false;
    if (this.locationElementIcon) {
      this.locationElementIcon.setAttribute("class", "material-icons");
    }
  }
  locationAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.actionType = SclMapConstantService.DRAWING_ACTION_LOCATION;
    this.deselectAllControlBtn(e.currentTarget.id);
    if (this.locationChecked) {
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      if (this.locationElementIcon) {
        this.locationElementIcon.setAttribute("class", "material-icons");
      }
    } else {
      this.actionType = SclMapConstantService.DRAWING_ACTION_LOCATION;
      if (this.locationElementIcon) {
        this.locationElementIcon.setAttribute("class", "material-icons button-location-pulse");
      }
      if (this.getLocationFn && typeof this.getLocationFn === "function") {
        this.getLocationFn();
      }
    }
    this.locationChecked = !this.locationChecked;
  }
  // clone from sclMapViews.addRadioButton and have modify
  addRadioButton(document2, element, layers, compId) {
    layers.forEach((layer, i2) => {
      const title = layer.get("title");
      const radio = sclMapViews2.createRadio(document2, compId + title, layer.getVisible(), compId);
      radio.onclick = () => {
        layers.forEach((layer1, j) => {
          let value = layer1.get("title");
          if (!value || value === "Vector") {
            return;
          }
          const newTil = compId + title;
          value = compId + value;
          if (value === newTil) {
            layer1.setVisible(true);
            if (layer1 instanceof Group_default) {
              layer1.getLayers().forEach((sublayer, k) => {
                sublayer.setVisible(true);
              });
            }
          } else {
            layer1.setVisible(false);
          }
        });
      };
      element.appendChild(radio);
      const label = sclMapViews2.createLabel(document2, compId + title, "");
      const sLabel = document2.createElement("span");
      sLabel.innerHTML = title;
      sLabel.style.verticalAlign = "-webkit-baseline-middle";
      sLabel.style.color = "black";
      label.appendChild(sLabel);
      element.appendChild(label);
    });
  }
  addMapViewControl(element, mapViewLayers, compId, layerIds) {
    const elementMapView = document.createElement("div");
    elementMapView.className = "select-action ol-control custom-control";
    elementMapView.style.top = "10px";
    if (typeof mapViewLayers !== "undefined" || mapViewLayers !== null) {
      const radioElement = document.createElement("div");
      radioElement.className = "radio-group";
      this.addRadioButton(document, radioElement, mapViewLayers, compId);
      elementMapView.appendChild(radioElement);
      mapViewLayers.forEach((layer, i2) => {
        const title = compId + layer.get("title");
        layerIds.push(title);
      });
    }
    element.append(elementMapView);
  }
  addControlDraw(compId, pOptions, cb) {
    let layerIds = [];
    const self2 = this;
    const ActionControl = function(ctrlOptions) {
      const options = ctrlOptions || {};
      const element = document.createElement("div");
      if (pOptions != null) {
        self2.addMapViewControl(element, pOptions.mapViewLayers, compId, layerIds);
      }
      self2.drawingMenu = document.createElement("div");
      self2.drawingMenu.id = compId + "_Drawing_Menu_";
      self2.drawingMenu.className = "select-action ol-control custom-control";
      self2.elementWrapperForBottomPosition = null;
      if (self2.isBottom) {
        self2.elementWrapperForBottomPosition = self2.mapDiv;
      }
      self2.drawStylingButtonCss = {
        "background-color": "white",
        color: "black",
        width: self2.drawToolButtonSize + "px",
        height: self2.drawToolButtonSize + "px",
        border: "white 0px"
      };
      self2.cssIconDiv = {
        "height": `40px`,
        "width": `40px`,
        "position": `relative`
      };
      self2.addDrawButtons(layerIds, compId, null, self2.isBottom ? "draw-menu-bottom" : "draw-menu");
      if (self2.menuBoxBtn) {
        self2.drawButtonsForOnlySingleMode.push(self2.menuBoxBtn);
      }
      self2.elementCtrl = self2.drawingMenu;
      element.appendChild(self2.drawingMenu);
      Control_default.call(this, {
        element,
        target: options.target
      });
    };
    olInherits(ActionControl, Control_default);
    this.map.addControl(new ActionControl({}));
    cb(layerIds);
  }
  testRedraw(e) {
    console.log("click btn, id = " + e.currentTarget.id);
    const idx = parseInt(e.currentTarget.id, 10);
    this.clearAllFeaturesLayer(idx);
    setTimeout(() => {
      if (idx in this.assetOfLayers) {
        for (let i2 = 0; i2 < this.assetOfLayers[idx].length; i2++) {
          if (!this.layerAssets[idx].getSource()) {
            continue;
          }
          this.layerAssets[idx].getSource().addFeature(this.assetOfLayers[idx][i2]);
          console.log("redraw feature of layerIdx = " + idx);
        }
      }
    }, 1e3);
  }
  addTestBtn(element) {
    const testDiv = document.createElement("div");
    testDiv.className = "select-action ol-control custom-control";
    let idx = 1;
    for (let i2 = 0; i2 < this.layersRedrawCount; i2++) {
      const testBtn = sclMapViews2.createUIButton(document, this.testRedraw.bind(this), "ol-has-tooltip", idx + "", null);
      testBtn.setAttribute("id", idx);
      const iSpan = document.createElement("i");
      iSpan.innerHTML = idx + "";
      testBtn.appendChild(iSpan);
      testDiv.appendChild(testBtn);
      idx++;
    }
    this.testDiv = testDiv;
    element.appendChild(testDiv);
  }
  addControl(ActionControl, element, options) {
    if (this.layersRedraw) {
      this.addTestBtn(element);
    }
    Control_default.call(ActionControl, {
      element,
      target: options.target
    });
  }
  setupControl(ActionControl) {
    olInherits(ActionControl, Control_default);
  }
  setTextBoxFeatureContent(feature, textContent, textId, fontFamily, fontSize) {
    this.setFeatureProperties(feature, {
      text: textContent,
      icon: null,
      isCluster: null,
      textId,
      font: fontFamily,
      fontSize
    });
  }
  createTextBoxFeature(mapClickPoint, coor, textContent, id2, isEdit, fontFamily, fontSize) {
    let overlayIsAdded = false;
    if (this.map.getOverlayById(id2)) {
      overlayIsAdded = true;
    }
    if (overlayIsAdded) {
      console.log(`This textbox ${id2} is added in map before`);
      return;
    }
    const mapHeight = this.mapDiv?.offsetHeight;
    const mapWidth = this.mapDiv?.offsetWidth;
    let textBoxSize = mapHeight;
    if (mapHeight > mapWidth) {
      textBoxSize = mapWidth;
    }
    textBoxSize /= 2;
    if (textBoxSize <= 0) {
      textBoxSize = 100;
    }
    const container = document.createElement("div");
    container.id = `${this.keyName}__text-container__${id2}}`;
    container.className = "ol-popup";
    const elemContent = document.createElement("div");
    elemContent.id = `${this.keyName}__text-content__${id2}}`;
    elemContent.className = "draw-text-content";
    elemContent.style.display = isEdit ? "none" : "block";
    container.appendChild(elemContent);
    const elemTextBox = document.createElement("textarea");
    elemTextBox.id = `${this.keyName}__text-input__${id2}}`;
    elemTextBox.className = "draw-text-area";
    elemTextBox.style.width = `${textBoxSize}px`;
    elemTextBox.style["z-index"] = 100;
    elemTextBox.style.display = isEdit ? "block" : "none";
    elemTextBox.setAttribute("placeholder", "...");
    container.appendChild(elemTextBox);
    if (textContent) {
      elemContent.innerHTML = textContent;
      elemTextBox.value = textContent;
    }
    if (fontFamily) {
      elemContent.style["font-family"] = fontFamily;
      elemTextBox.style["font-family"] = fontFamily;
    }
    if (fontSize) {
      elemContent.style["font-size"] = fontSize;
      elemTextBox.style["font-size"] = fontSize;
    }
    const overlay = new Overlay_default({
      element: container,
      id: id2,
      autoPan: {
        animation: {
          duration: 250
        }
      },
      offset: [0, 0]
    });
    this.map.addOverlay(overlay);
    overlay.setPosition(mapClickPoint);
    let feature = null;
    this.vector.getSource().getFeatures().forEach((f) => {
      const p = f.getProperties();
      if (p.textId === id2) {
        feature = f;
        console.log(`*** This feature with textId = ${id2} has already added to map`);
        return;
      }
    });
    if (feature == null) {
      feature = this.createFeaturePoint(coor, "Point", {
        EPSG: this.EPSG
      });
      this.vector.getSource().addFeature(feature);
      this.setTextBoxFeatureContent(feature, textContent, id2, fontFamily, fontSize);
    }
    const closeTextBoxFn = (e) => {
      elemContent.innerHTML = elemTextBox.value;
      elemContent.style.display = "block";
      elemTextBox.style.display = "none";
      this.hasDocumentChangeValue = false;
      this.setTextBoxFeatureContent(feature, elemTextBox.value, id2, fontFamily, fontSize);
      this.closeTextBox.style.display = "none";
      this.currentCloseTextBoxFn = null;
      this.currentTextBoxId = null;
      if (elemContent.innerHTML.trim().length == 0) {
        this.map.getOverlays().remove(overlay);
        this.map.removeOverlay(overlay);
      }
      if (this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
        this.setDirtyFunction();
      }
    };
    this.currentCloseTextBoxFn = isEdit ? closeTextBoxFn : null;
    this.currentTextBoxId = isEdit ? id2 : null;
    elemTextBox.onblur = (e) => {
      closeTextBoxFn(e);
    };
    container.onclick = (e) => {
      elemTextBox.style.display = "block";
      this.closeTextBox.style.display = "block";
      elemContent.style.display = "none";
      this.currentCloseTextBoxFn = closeTextBoxFn;
      this.currentTextBoxId = id2;
    };
    this.closeTextBox.style.display = isEdit ? "block" : "none";
    this.closeTextBox.style.width = `${mapWidth}px`;
    this.closeTextBox.style.height = `${mapHeight}px`;
    this.closeTextBox.style["z-index"] = 1;
    this.closeTextBox.onclick = (e) => {
      closeTextBoxFn(e);
    };
  }
  mapClickEvent(cb) {
    this.map.on("click", (evt) => {
      const coor = transform(evt.coordinate, this.EPSG, "EPSG:4326");
      if (this.drawType === SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX) {
        this.hasDocumentChangeValue = false;
        const id2 = uuid2.v1();
        this.createTextBoxFeature(evt.coordinate, coor, "", id2, true, this.fontCurrentSelected, this.fontSizeCurrentSelected);
      } else if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT && this.currentLine !== null) {
        const newStyle = [];
        const styles = this.currentLine.getStyle();
        if (styles?.length > 0) {
          newStyle.push(styles[0]);
        }
        const st = this.styleArrow(this.currentLine, this.currentLine.getProperties(), this.isDrawModeSingle ? this.singleColorDraging : this.multiColorDraging, true);
        if (st.length > 0) {
          newStyle.push(st[0]);
        }
        this.currentLine.setStyle(newStyle);
      } else {
        evt.latLng = { lat: parseFloat(coor[1]), lng: parseFloat(coor[0]) };
        const featureOnClick = this.map.forEachFeatureAtPixel(evt.pixel, (feature, layer) => {
          const fs = feature.get("features");
          if (fs) {
            return fs;
          }
          return feature;
        });
        if (featureOnClick) {
          if (Array.isArray(featureOnClick) && featureOnClick.length > 0) {
            if (this.clusterClick && typeof this.clusterClick === "function") {
              this.clusterClick(featureOnClick, evt.pixel);
            }
          } else {
            if (cb && typeof cb === "function") {
              cb(evt);
            }
          }
        } else {
          if (cb && typeof cb === "function") {
            cb(evt);
          }
        }
      }
    });
  }
  mapPointerMoveEvent(cb) {
    this.map.on("pointermove", (evt) => {
      if (cb && typeof cb === "function") {
        cb(evt);
      }
    });
  }
  getPointFeature(location2, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName) {
    const graphPoint = new Feature_default2(new Point_default(location2));
    if (arguments.length === 2) {
      graphPoint.setProperties({
        icon: image
      });
    } else {
      const properties2 = {
        icon: image,
        name,
        id: id2
      };
      if (color2) {
        properties2.color = color2;
      }
      if (tooltip) {
        properties2.tooltip = tooltip;
      }
      if (layerDisplayOnly) {
        properties2.layerDisplayOnly = layerDisplayOnly;
      }
      if (type) {
        properties2.type = type;
      }
      if (anchor2) {
        properties2.anchor = anchor2;
      }
      if (layerName) {
        properties2.layerName = layerName;
      }
      if (relatedAsset) {
        for (const field in relatedAsset) {
          if (relatedAsset.hasOwnProperty(field)) {
            const value = relatedAsset[field];
            properties2[field] = value;
          }
        }
      }
      graphPoint.setProperties(properties2);
    }
    return graphPoint;
  }
  updateLocation(lat, lon, id2, image, name, proId, isMapClick) {
    const location2 = transform([lon, lat], "EPSG:4326", this.EPSG);
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY && this.drawType != null) {
      this.hasDocumentChangeValue = false;
      let lineLength;
      let dimensionId;
      let hasUpdateSketch = false;
      if (this.drawType == OpenlayerDrawType.POINT) {
        if (this.sketchGPS == null) {
          this.sketchGPS = this.parseToPoint(location2, null, null);
          this.sketchGPS = this.drawEndFeature(this.sketchGPS, lineLength, dimensionId);
          this.vector.getSource().addFeature(this.sketchGPS);
        }
      } else if (this.drawType == OpenlayerDrawType.LINE_STRING) {
        this.sketchGPSPoints.push(location2);
        if (this.sketchGPS == null) {
          if (this.sketchGPSPoints.length > 1) {
            this.sketchGPS = this.parseToLine(this.sketchGPSPoints, null, null);
            this.sketchGPS = this.drawEndFeature(this.sketchGPS, lineLength, dimensionId);
            this.vector.getSource().addFeature(this.sketchGPS);
            const feas = this.vector.getSource().getFeatures();
            this.sketchGPS = feas[feas.length - 1];
          }
        } else {
          hasUpdateSketch = true;
          const geometry2 = this.sketchGPS.getGeometry();
          const coordinates2 = geometry2.getCoordinates();
          coordinates2.push(location2);
          geometry2.setCoordinates(coordinates2);
          this.sketchGPS.setGeometry(geometry2);
        }
      } else if (this.drawType == OpenlayerDrawType.POLYGON) {
        if (this.sketchGPSPoints.length == 0) {
          this.sketchGPSPoints.push(location2);
          this.sketchGPSPoints.push(location2);
        } else {
          this.sketchGPSPoints.splice(this.sketchGPSPoints.length - 1, 0, location2);
        }
        if (this.sketchGPS == null) {
          if (this.sketchGPSPoints.length > 3) {
            console.log(`***** create new polygon`);
            this.sketchGPS = this.parseToPolygon([this.sketchGPSPoints], null, null);
            this.sketchGPS = this.drawEndFeature(this.sketchGPS, lineLength, dimensionId);
            this.vector.getSource().addFeature(this.sketchGPS);
            const feas = this.vector.getSource().getFeatures();
            this.sketchGPS = feas[feas.length - 1];
          }
        } else {
          console.log(`***** update polygon postion for feature: ${this.sketchGPS.getId()}`);
          hasUpdateSketch = true;
          const geometry2 = this.sketchGPS.getGeometry();
          const coordinates2 = geometry2.getCoordinates();
          coordinates2[0].splice(coordinates2[0].length - 1, 0, location2);
          geometry2.setCoordinates(coordinates2);
          this.sketchGPS.setGeometry(geometry2);
        }
      } else if (this.drawType == OpenlayerDrawType.CIRCLE) {
        if (this.sketchGPS == null) {
          if (this.sketchGPSPoints.length > 1) {
          }
        }
      }
      console.log(`**** feature.len = ${this.vector.getSource().getFeatures()?.length}`);
      if (hasUpdateSketch && typeof this.setDirtyFunction === "function") {
        this.setDirtyFunction();
      }
    } else {
      if (isMapClick === false) {
        this.view.setCenter(location2);
        this.view.setResolution(1);
      }
      if (proId != null && this.marker != null && this.marker.getId() === proId) {
        this.marker.getGeometry().setCoordinates(location2);
      } else {
        if (!image) {
          image = SclMapConstantService.MAP_MARKER;
        }
        this.marker = this.getPointFeature(location2, image, name, proId, null, null, null, null, null, null, null);
        this.marker.setId(proId);
        this.marker.setStyle(this.stylePinAddress(this.marker));
        this.layerAssets[this.layerIndexAddress].getSource().addFeature(this.marker);
      }
    }
  }
  removeLocation(feature) {
    if (feature && this.layerAssets[this.layerIndexAddress] && this.layerAssets[this.layerIndexAddress].getSource()) {
      this.layerAssets[this.layerIndexAddress].getSource().removeFeature(feature);
    }
    this.marker = null;
  }
  zoomToLocation(lat, lon) {
    const location2 = transform([lon, lat], "EPSG:4326", this.EPSG);
    this.view.setCenter(location2);
    this.view.setResolution(1);
  }
  zoomToValue(zoomValue) {
    if (zoomValue) {
      this.view.setZoom(zoomValue);
    }
  }
  // 14781
  centerDefault() {
    this.zoomToLocation(this.defaultLat, this.defaultLon);
  }
  // 14781
  fitLayers(layersIndexFit, hasDefaultCoord) {
    const extent = createEmpty();
    if (hasDefaultCoord) {
      const location2 = transform([this.defaultLon, this.defaultLat], "EPSG:4326", this.EPSG);
      const fExtent = [location2[0], location2[1], location2[0], location2[1]];
      extend2(extent, fExtent);
    }
    let padding = 0;
    for (let i2 = 0; i2 < layersIndexFit.length; i2++) {
      const idx = layersIndexFit[i2];
      if (!this.layerAssets[idx].getSource()) {
        continue;
      }
      const fs = this.layerAssets[idx].getSource().getFeatures();
      if (fs == null || fs.length === 0) {
        continue;
      }
      this.layerAssets[idx].getSource().getFeatures().forEach((function(feature) {
        const fExt = feature.getGeometry().getExtent();
        extend2(extent, fExt);
        if (feature.getGeometry().getType() === "Point") {
          padding = 32;
        }
      }).bind(this));
    }
    if (extent !== null && extent.length === 4 && isFinite(extent[0]) && isFinite(extent[1]) && isFinite(extent[2]) && isFinite(extent[3])) {
      this.view.fit(extent, { padding: [padding, padding, padding, padding] });
    }
    setInterval(() => {
      const currentZoom = Math.floor(this.view.getZoom());
      this.view.setZoom(currentZoom);
    }, 200);
  }
  createMarkerAsset(lat, lon, id2, image, name, type) {
    const location2 = transform([lon, lat], "EPSG:4326", this.EPSG);
    const f = this.getPointFeature(location2, image, name, id2, null, null, null, null, null, null, null);
    if (type) {
      f.set("assetType", type);
    }
    f.setId(id2);
    if (type === SclMapConstantService.ASSET_PRIMARY_TYPE) {
      f.setStyle(this.stylePrimaryAssetFunc(f, null));
      this.layerAssets[this.layerIndexPrimary].getSource().addFeature(f);
      this.storeSelectedAssets(f, true);
    } else if (type === SclMapConstantService.ASSET_SECONDARY_TYPE) {
      f.setStyle(this.styleSecondaryAssetFunc(f, null));
      this.layerAssets[this.layerIndexSecondary].getSource().addFeature(f);
      this.storeSelectedAssets(f, false);
    } else {
      f.setStyle(this.stylePinAddress(f));
      this.layerAssets[this.layerIndexAddress].getSource().addFeature(f);
    }
    return location2;
  }
  getGEOJSON(cb) {
    const features = this.vector.getSource().getFeatures();
    console.log(`***** getGEOJSON, features.len = ${features?.length}`);
    const format = new GeoJSON_default();
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      const fp = "EPSG:4326";
      const data = format.writeFeaturesObject(features, { featureProjection: this.EPSG, dataProjection: fp });
      const finalData = { type: "FeatureCollection", features: [] };
      const multiPoint = { type: "Feature", properties: null, geometry: { type: "MultiPoint", coordinates: [] } };
      const multiPolygon = { type: "Feature", properties: null, geometry: { type: "MultiPolygon", coordinates: [] } };
      const multiLineString = { type: "Feature", properties: null, geometry: { type: "MultiLineString", coordinates: [] } };
      for (let i2 = 0; i2 < data.features.length; i2++) {
        const geom = data.features[i2].geometry;
        if (!geom) {
          continue;
        }
        if (geom.type === "MultiPoint") {
          for (let j = 0; j < geom.coordinates.length; j++) {
            multiPoint.geometry.coordinates.push(geom.coordinates[j]);
          }
          multiPoint.properties = data.features[i2].properties;
        } else if (geom.type === "MultiPolygon") {
          for (let j = 0; j < geom.coordinates.length; j++) {
            multiPolygon.geometry.coordinates.push(geom.coordinates[j]);
          }
          multiPolygon.properties = data.features[i2].properties;
        } else if (geom.type === "MultiLineString") {
          for (let j = 0; j < geom.coordinates.length; j++) {
            multiLineString.geometry.coordinates.push(geom.coordinates[j]);
          }
          multiLineString.properties = data.features[i2].properties;
        } else if (geom.type === "GeometryCollection") {
          const geom2 = features[i2].getGeometry();
          const radius = geom2.getRadius();
          let center = geom2.getCenter();
          center = transform(center, this.EPSG, "EPSG:4326");
          const shapeJson = {
            type: "Feature",
            geometry: {},
            properties: {
              radius,
              subType: "Circle"
            }
          };
          if (this.isDrawCircleAsPolygon) {
            const coords = sclUtilMap.circleToPolygon(center, radius);
            shapeJson.geometry.type = "Polygon";
            shapeJson.geometry.coordinates = coords;
          } else {
            shapeJson.geometry.type = "Point";
            shapeJson.geometry.coordinates = center;
          }
          for (let key in data.features[i2].properties) {
            shapeJson.properties[key] = data.features[i2].properties[key];
          }
          finalData.features.push(shapeJson);
        } else {
          finalData.features.push(data.features[i2]);
        }
      }
      if (multiPoint.geometry.coordinates.length > 0) {
        finalData.features.push(multiPoint);
      }
      if (multiPolygon.geometry.coordinates.length > 0) {
        finalData.features.push(multiPolygon);
      }
      if (multiLineString.geometry.coordinates.length > 0) {
        finalData.features.push(multiLineString);
      }
      if (cb && typeof cb === "function") {
        cb(finalData);
      }
    } else {
      const data = format.writeFeaturesObject(features);
      if (cb && typeof cb === "function") {
        cb(data);
      }
    }
  }
  transformEPSG(long, lat, from2, to) {
    const location2 = transform([parseFloat(long), parseFloat(lat)], from2, to);
    return location2;
  }
  checkMapEmpty(pCanvas) {
    if (pCanvas == null) {
      return;
    }
    try {
      const ctx = pCanvas.getContext("2d");
      const imageData = ctx.getImageData(0, 0, pCanvas.width, pCanvas.height);
      const data = imageData.data;
      const imageDataLength = data.length;
      let totalAlpha = 0;
      let countTransparent = 0;
      for (let i2 = 3; i2 < imageDataLength; i2 += 4) {
        totalAlpha++;
        if (data[i2] === 0) {
          countTransparent++;
        }
      }
      if (totalAlpha === countTransparent && totalAlpha > 0) {
        if (this.fromFitData) {
          console.log("We have no map tiles to display.  Your map is centered at LAT, LONG which may not be with in your map tile service.  Please check that location and the data you are trying to display.");
        }
      }
      this.fromFitData = false;
    } catch (err) {
      if (this.checkMapEmptyLogError) {
        console.log("*** checkMapEmpty error = ", err);
      } else {
        console.log(`checkMapEmpty error - Not all tiles yet drawn`);
      }
    }
  }
  fit(ConfigService3, maxZoom, initialZoomChange, isCheckEmpty) {
    if (this.type !== SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      let maxZoom1 = 15;
      if (maxZoom) {
        maxZoom1 = maxZoom;
      } else {
        if (ConfigService3.clientConfig().maxZoomLevel) {
          maxZoom1 = ConfigService3.clientConfig().maxZoomLevel;
        }
      }
      const featuresExtent = this.source.getExtent();
      if (featuresExtent != null && featuresExtent.length === 4 && isFinite(featuresExtent[0]) && isFinite(featuresExtent[1]) && isFinite(featuresExtent[2]) && isFinite(featuresExtent[3])) {
        this.view.fit(featuresExtent, { size: this.map.getSize(), maxZoom1 });
      }
      if (this.layerAssets != null && this.layerAssets.length > 0) {
        for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
          const extent = this.layerAssets[i2].getSource().getExtent();
          if (extent != null && extent.length === 4 && isFinite(extent[0]) && isFinite(extent[1]) && isFinite(extent[2]) && isFinite(extent[3])) {
            this.view.fit(extent, this.map.getSize());
          }
        }
      }
    } else {
      const extent = createEmpty();
      if (this.layerAssets != null && this.layerAssets.length > 0) {
        for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
          if (!this.layerAssets[i2].getSource()) {
            continue;
          }
          const fs = this.layerAssets[i2].getSource().getFeatures();
          if (fs == null || fs.length === 0) {
            continue;
          }
          this.layerAssets[i2].getSource().getFeatures().forEach(function(feature) {
            try {
              extend2(extent, feature.getGeometry().getExtent());
            } catch (err) {
              console.log(err);
            }
          });
        }
      }
      if (extent != null && extent.length === 4 && isFinite(extent[0]) && isFinite(extent[1]) && isFinite(extent[2]) && isFinite(extent[3])) {
        this.view.fit(extent);
      }
    }
    if (initialZoomChange != null && initialZoomChange !== 0) {
      let currentZoom = this.view.getZoom();
      currentZoom += initialZoomChange;
      this.view.setZoom(currentZoom);
    }
    if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP && this.view.getZoom() > 12) {
      this.view.setZoom(12);
    }
    if (isCheckEmpty === void 0 || isCheckEmpty === null || isCheckEmpty === true) {
      this.fromFitData = true;
    }
    this.clampZoomFloor();
  }
  fitCoords(coords) {
    if (!coords || coords.length === 0) {
      return;
    }
    this.bounds = createEmpty();
    this.fitCoordCount = coords.length;
    for (let i2 = 0; i2 < coords.length; i2++) {
      const iCoord = transform(coords[i2], "EPSG:4326", this.EPSG);
      const geom = new Point_default(iCoord);
      extend2(this.bounds, geom.getExtent());
    }
    this.view.fit(this.bounds);
    if (coords.length === 1) {
      let currentZoom = this.view.getZoom();
      currentZoom = currentZoom - 2;
      if (currentZoom < 0) {
        currentZoom = 1;
      }
      this.view.setZoom(currentZoom);
    } else {
      const currentZoom = Math.floor(this.view.getZoom());
      this.view.setZoom(currentZoom);
    }
    this.clampZoomFloor();
  }
  mapReadOnly(isReadOnly) {
    if (isReadOnly) {
      this.map.removeInteraction(this.modify);
      this.map.removeInteraction(this.draw);
    } else {
      if (this.actionType) {
        if (this.actionType === SclMapConstantService.DRAWING_ACTION_SELECT) {
          this.map.addInteraction(this.modify);
        } else if (this.actionType !== SclMapConstantService.DRAWING_ACTION_DELETE) {
          this.addInteraction();
        }
      }
    }
  }
  getAllFeatures() {
    let features = [];
    if (this.vector.getSource()) {
      features = this.vector.getSource().getFeatures();
    }
    if (this.layerAssets != null && this.layerAssets.length > 0) {
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        if (!this.layerAssets[i2].getSource()) {
          continue;
        }
        const fs = this.layerAssets[i2].getSource().getFeatures();
        if (fs != null && fs.length > 0) {
          fs.forEach(function(f) {
            features.push(f);
          });
        }
      }
    }
    return features;
  }
  getFeaturesFromMap(features, pixel, type, assetSelectionsAvailable, sType) {
    const existedFeatures = [];
    const self2 = this;
    this.map.forEachFeatureAtPixel(pixel, function(feature, layer) {
      if (feature && layer) {
        if (layer.get("isCluster")) {
          const lstFeature = feature.get("features");
          for (let i2 = 0; i2 < lstFeature.length; i2++) {
            const result = self2.getAFeatureFromMap(lstFeature[i2], features, type, assetSelectionsAvailable, sType);
            if (result.f) {
              features.push(result.f);
            }
            if (result.existedFeature) {
              existedFeatures.push(result.existedFeature);
            }
          }
        } else {
          const result = self2.getAFeatureFromMap(feature, features, type, assetSelectionsAvailable, sType);
          if (result.f) {
            features.push(result.f);
          }
          if (result.existedFeature) {
            existedFeatures.push(result.existedFeature);
          }
        }
      }
    });
    return existedFeatures;
  }
  getAFeatureFromMap(feature, features, type, assetSelectionsAvailable, sType) {
    let existedFeature, f;
    if (!feature.getProperties() || feature.getProperties().id === void 0) {
      return { existedFeature, feature };
    }
    const p = feature.getProperties();
    if (assetSelectionsAvailable == null && p.layerDisplayOnly) {
      return { existedFeature, feature };
    } else {
      const iAssetSelectionsAvailable = assetSelectionsAvailable[p.zIndex - 1 < 0 ? 0 : p.zIndex - 1];
      if (iAssetSelectionsAvailable != null && iAssetSelectionsAvailable.indexOf(sType) < 0) {
        let sType2 = sType;
        if (sType != null && sType.trim().length > 0) {
          sType = sType.charAt(0).toUpperCase() + (sType != null && sType.trim().length > 1 ? sType.slice(1) : "");
        }
        console.log("sc-selected-asset: The assetSelectiosAvailable field is not set to allow " + sType + " selections for this layer");
        return { existedFeature, feature };
      }
    }
    if (p.id === "address") {
      return { existedFeature, feature };
    }
    if (type === SclMapConstantService.ASSET_PRIMARY_TYPE && p.id && p.id.indexOf("_secondary") > -1 || type === SclMapConstantService.ASSET_SECONDARY_TYPE && p.id && p.id.indexOf("_primary") > -1) {
      return { existedFeature, feature };
    }
    if (p.assetType !== type) {
      let isExist = false;
      for (let i2 = 0; i2 < features.length; i2++) {
        if (features[i2].getProperties().name === p.name) {
          isExist = true;
          break;
        }
      }
      if (!isExist) {
        f = feature;
      }
    } else {
      existedFeature = feature;
    }
    return { existedFeature, f };
  }
  getAssetProperties(feature, relatedFields, coordinates2, typeAsset, typeSelection) {
    let name = "";
    let id2 = "";
    let radius = null;
    const p = feature.getProperties();
    if (p) {
      name = p.name;
      id2 = p.id;
      radius = p.radius;
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (radius) {
      asset.properties.radius = radius;
      asset.properties.subType = "Circle";
    }
    if (!typeSelection || typeSelection === "featureCollection") {
      asset.geometry = {
        type: "Point",
        coordinates: coordinates2
      };
    } else if (typeSelection !== "undefined" && typeSelection === SclMapConstantService.ASSET_SELECTION_MODE_ASSET) {
      let t = feature.getGeometry().getType();
      if (t == "Circle") {
        t = "Point";
      }
      asset.geometry = {
        type: t,
        coordinates: coordinates2
      };
    }
    if (!id2) {
      return "";
    }
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const value = p[field];
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  removeUnselectedAssetItem(existAsset, assets, assetType) {
    if (existAsset) {
      let isExist = false;
      let idExistAsset = existAsset.properties.linkAssets[0].documentId;
      if (idExistAsset && idExistAsset.indexOf("_") > -1) {
        idExistAsset = idExistAsset.split("_")[0];
      }
      for (let j = 0; j < assets.length; j++) {
        const item = assets[j];
        let idItem = item.properties.linkAssets[0].documentId;
        if (idItem == null) {
          continue;
        }
        if (idItem.indexOf("_") > -1) {
          idItem = idItem.split("_")[0];
        }
        const id2 = item.properties.linkAssets[0].documentId + "_" + assetType;
        if (idItem === idExistAsset) {
          assets.splice(j, 1);
          isExist = true;
        }
      }
      const len = this.selectedAssets.length;
      for (let i2 = len - 1; i2 > -1; i2--) {
        let iId = this.selectedAssets[i2].getId();
        if (iId && iId.indexOf("_") > -1) {
          iId = iId.split("_")[0];
        }
        if (iId === idExistAsset) {
          const f = this.selectedAssets[i2];
          if (f == null || f.getId() == null) {
            continue;
          }
          if (assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
            const source = this.layerAssets[this.layerIndexPrimary].getSource();
            const fea = source.getFeatureById(f.getId());
            if (fea && source) {
              source.removeFeature(fea);
              this.selectedAssets.splice(i2, 1);
            }
          } else if (assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
            const source = this.layerAssets[this.layerIndexSecondary].getSource();
            const fea = source.getFeatureById(f.getId());
            if (fea && source) {
              source.removeFeature(fea);
              this.selectedAssets.splice(i2, 1);
            }
          }
          isExist = true;
        }
      }
      return isExist;
    }
    return false;
  }
  parseAssetsFromFeatures(features, assetField, coor, typeAsset, mode) {
    if (mode === SclMapConstantService.ASSET_SELECTION_MODE_ASSET || !Array.isArray(features)) {
      const asset = this.getAssetProperties(features, assetField.relatedFields, coor, typeAsset, mode);
      return asset;
    } else {
      const assets = [];
      for (let i2 = 0; i2 < features.length; i2++) {
        const asset = this.getAssetProperties(features[i2], assetField.relatedFields, coor[i2], typeAsset, null);
        if (!asset) {
          return;
        }
        assets.push(asset);
      }
      return assets;
    }
  }
  getAllFeaturesSelected() {
    if (this.selectMultiple) {
      return this.selectMultiple.getFeatures();
    } else {
      return [];
    }
  }
  addInteractionSelect(currentSelected) {
    if (this.selectMultiple) {
      this.map.addInteraction(this.selectMultiple);
    }
  }
  removeInteractionSelect() {
    if (this.selectMultiple) {
      this.map.removeInteraction(this.selectMultiple);
    }
  }
  showLayer(options) {
    if (options.isShow) {
      this.layerAssets[options.layerIndex].setVisible(true);
    } else {
      this.layerAssets[options.layerIndex].setVisible(false);
    }
  }
  activeInteractionSelect(isActive) {
    if (this.selectMultiple) {
      this.selectMultiple.setActive(isActive);
    }
  }
  drawActionDelete(evt) {
    this.map.forEachFeatureAtPixel(evt.pixel, (f, l) => {
      if (!f) {
        return;
      }
      const p = f.getProperties();
      if (p && p.zIndex) {
        return;
      }
      this.vector.getSource().removeFeature(f);
      if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY && this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
        this.setDirtyFunction();
      }
    });
  }
  drawActionProperties(evt) {
    const feature = this.map.forEachFeatureAtPixel(evt.pixel, function(feature1, layer) {
      return feature1;
    });
  }
  setPointProperties(relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName, url) {
    const properties2 = {};
    if (color2) {
      properties2.color = color2;
    }
    if (tooltip) {
      properties2.tooltip = tooltip;
    }
    if (layerDisplayOnly) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (type) {
      properties2.type = type;
    }
    if (anchor2) {
      properties2.anchor = anchor2;
    }
    if (layerName) {
      properties2.layerName = layerName;
    }
    if (url) {
      properties2.url = url;
    }
    if (relatedAsset) {
      for (const field in relatedAsset) {
        if (relatedAsset.hasOwnProperty(field)) {
          const value = relatedAsset[field];
          properties2[field] = value;
        }
      }
    }
    return properties2;
  }
  sclAssetLayersGetPointFeature(location2, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName, url) {
    let graphPoint;
    if (type === "MultiPoint") {
      graphPoint = new Feature_default2(new MultiPoint_default(location2));
    } else {
      graphPoint = new Feature_default2(new Point_default(location2));
    }
    const properties2 = this.setPointProperties(relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName, url);
    properties2.icon = image;
    properties2.name = name;
    properties2.id = id2;
    graphPoint.setProperties(properties2);
    return graphPoint;
  }
  parseToLine(coor, id2, toEPSG) {
    const feature = new Feature_default2(new LineString_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  parseToMultiLine(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiLineString_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  parseToPolygon(coor, id2, toEPSG) {
    const feature = new Feature_default2(new Polygon_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  parseToMultiPolygon(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiPolygon_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  parseToPoint(coor, id2, toEPSG) {
    const feature = new Feature_default2(new Point_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  parseToMultiPoint(coor, id2, toEPSG) {
    const feature = new Feature_default2(new MultiPoint_default(coor));
    feature.getGeometry().transform("EPSG:4326", toEPSG);
    if (id2) {
      feature.setId(id2);
    }
    return feature;
  }
  sclAssetLayersCreateFeatureByType(coordinates2, type, EPSG, id2) {
    let feature;
    if (type === "Point") {
      feature = this.parseToPoint(coordinates2, id2, EPSG);
    } else if (type === "MultiPoint") {
      feature = this.parseToMultiPoint(coordinates2, id2, EPSG);
    } else if (type === "LineString") {
      feature = this.parseToLine(coordinates2, id2, EPSG);
    } else if (type === "MultiLineString") {
      feature = this.parseToMultiLine(coordinates2, id2, EPSG);
    } else if (type === "Polygon") {
      feature = this.parseToPolygon(coordinates2, id2, EPSG);
    } else if (type === "MultiPolygon") {
      feature = this.parseToMultiPolygon(coordinates2, id2, EPSG);
    }
    return feature;
  }
  traverseCoor(coor, obj) {
    if (Array.isArray(coor)) {
      for (let i2 = 0; i2 < coor.length; i2++) {
        if (Array.isArray(coor[i2])) {
          this.traverseCoor(coor[i2], obj);
        } else {
          if (isNaN(coor[i2])) {
            obj.hasNaN = true;
          } else {
            coor[i2] = Number(coor[i2]);
          }
        }
      }
    }
  }
  createFeatureCircle(coord, type, options) {
    const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
    const url = options.url ? options.url : "";
    const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
    const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
    const lon = Number(coord[0]);
    const lat = Number(coord[1]);
    if (isNaN(lon) || isNaN(lat)) {
      return null;
    }
    const center = transform([lon, lat], "EPSG:4326", options.EPSG);
    let feature = new Feature_default2(new Circle_default2(center, options.radius));
    const p = this.setPointProperties(relatedAssets, options.color, options.layerDisplayOnly, options.tooltip, null, type, "", url);
    p.name = options.name;
    p.id = options.id;
    p.radius = options.radius;
    if (options.layer) {
      const layer = options.layer;
      if (layer.fill) {
        p.fillColor = layer.fill;
      }
      if ((0, import_lodash5.isNumber)(layer.fillOpacity)) {
        p.fillOpacity = layer.fillOpacity;
      }
      if ((0, import_lodash5.isNumber)(layer.lineWidth)) {
        p.lineWidth = layer.lineWidth;
      }
    }
    if (options.label != null) {
      p.label = options.label;
    }
    feature.setProperties(p);
    feature.setId(options.id);
    return feature;
  }
  createFeaturePoint(coord, type, options) {
    let feature;
    const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
    const url = options.url ? options.url : "";
    const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
    const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
    const lon = Number(coord[0]);
    const lat = Number(coord[1]);
    if (isNaN(lon) || isNaN(lat)) {
      return null;
    }
    const location2 = transform([lon, lat], "EPSG:4326", options.EPSG);
    let point = SclMapConstantService.MAP_MARKER;
    if (options.point) {
      point = options.point;
    }
    if (options.imageFileNo) {
      if (options.imageFileNo === SclMapConstantService.MAP_MARKER || options.imageFileNo === SclMapConstantService.MAP_PRIMARY_ASSET || options.imageFileNo === SclMapConstantService.MAP_SECONDARY_ASSET) {
        point = options.imageFileNo;
      } else {
        point = options.imageFileNo;
      }
    }
    if (options.image) {
      point = options.image;
    }
    feature = this.sclAssetLayersGetPointFeature(location2, point, options.name, options.id, relatedAssets, options.color, options.layerDisplayOnly, options.tooltip, options.anchor, "", "", url);
    const p = feature.getProperties();
    p.isCluster = true;
    if (options.label != null) {
      p.label = options.label;
    }
    if (options.rotation) {
      p.rotation = options.rotation;
    }
    if (options.scale) {
      p.scale = options.scale;
    }
    feature.setProperties(p);
    feature.setId(options.id);
    return feature;
  }
  createFeatureByType(coord, type, options) {
    let feature;
    const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
    const url = options.url ? options.url : "";
    const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
    const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
    const radius = options.radius;
    if (type === "Point") {
      if (radius) {
        feature = this.createFeatureCircle(coord, type, options);
      } else {
        feature = this.createFeaturePoint(coord, type, options);
      }
    } else {
      if (options.layerType === "cluster") {
        type = "Point";
        const centerPoint = options.centerPoint;
        delete options.centerPoint;
        feature = this.createFeaturePoint(centerPoint, type, options);
      } else {
        const hasNaN = false;
        const obj = { hasNaN };
        this.traverseCoor(coord, obj);
        if (obj.hasNaN) {
          return null;
        }
        feature = this.sclAssetLayersCreateFeatureByType(coord, type, options.EPSG, options.id);
        if (feature == null) {
          return null;
        }
        let color2 = "purple";
        if (options.color) {
          color2 = options.color;
        }
        const properties2 = sclAssetLayers.createLineProperties(options.layer, options.name, color2, options.id, options.tooltip, primaryMultiPopup, secondaryMultiPopup, options.layerDisplayOnly, relatedAssets, url);
        if (options.label != null) {
          properties2.label = options.label;
        }
        feature.setProperties(properties2);
      }
    }
    return feature;
  }
  setFeatureProperties(feature, properties2) {
    for (const p in properties2) {
      if (properties2.hasOwnProperty(p)) {
        feature.set(p, properties2[p]);
      }
    }
  }
  resetFeatureProperties(feature, properties2) {
    feature.setProperties(properties2);
  }
  getFeatureProperty(feature, propertyName) {
    const pros = feature.getProperties();
    return pros[propertyName];
  }
  getFeatureProperties(feature, fieldNames) {
    const p = {};
    const pro = feature.getProperties();
    for (let i2 = 0; i2 < fieldNames.length; i2++) {
      p[fieldNames[i2]] = pro[fieldNames[i2]];
    }
    return p;
  }
  getFeatureId(feature) {
    return feature.getId();
  }
  setFeatureId(feature, id2) {
    feature.setId(id2);
  }
  getFeatureGeomType(feature) {
    const geom = feature.getGeometry();
    const type = geom.getType();
    return type;
  }
  getFeatureById(id2) {
    let f = null;
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (!this.layerAssets[i2].getSource()) {
        continue;
      }
      if (this.layerAssets[i2].get("isCluster")) {
        const src = this.layerAssets[i2].getSource().getSource();
        f = src.getFeatureById(id2);
      } else {
        f = this.layerAssets[i2].getSource().getFeatureById(id2);
      }
      if (f != null) {
        break;
      }
    }
    return f;
  }
  getFeatureByLayer(id2, layerIndex) {
    if (layerIndex > this.layerAssets.length - 1) {
      return null;
    }
    let f = null;
    if (!this.layerAssets[layerIndex].getSource()) {
      return null;
    }
    f = this.layerAssets[layerIndex].getSource().getFeatureById(id2);
    return f;
  }
  getFeatureByPixel(pixel) {
    return this.map.forEachFeatureAtPixel(pixel, function(feature, layer) {
      if (layer == null) {
        return null;
      } else {
        if (layer.get("isCluster")) {
          const fs = feature.get("features");
          if (fs && fs.length > 0) {
            return { feature: fs[0], layerIdx: layer.getZIndex() };
          } else {
            return { feature: null, layerIdx: layer.getZIndex() };
          }
        } else {
          return { feature, layerIdx: layer.getZIndex() };
        }
      }
    }, {
      hitTolerance: 10
    });
  }
  featureClone(fea, layerIndex) {
    const fClone = fea.clone();
    const pClone = fClone.getProperties();
    pClone.id = this.getFeatureId(fea);
    pClone.zIndex = layerIndex;
    fClone.setProperties(pClone);
    fClone.setId(pClone.id);
    return fClone;
  }
  getEventByPixel(pixel) {
    return this.map.getEventPixel(pixel);
  }
  getFeaturesCollection(options) {
    let fs = [];
    this.map.forEachFeatureAtPixel(options.pixel, (feature, layer) => {
      if (layer && !layer.get("isHeatMap") && layer.get("layerDisplayOnly") === false) {
        const layerIdx = layer.getZIndex();
        if (layerIdx && layerIdx < this.layerAssets.length) {
          if (this.layerAssets[layerIdx].get("isCluster")) {
            const lst = this.layerAssets[layerIdx].getSource().getSource().getFeatures();
            const p = feature.getProperties();
            const lstClicked = p.features;
            for (let i2 = 0; i2 < lstClicked.length; i2++) {
              fs.push({ feature: lstClicked[i2], layerIdx });
              const fId = this.getFeatureId(lstClicked[i2]);
              let id2 = fId;
              if (id2.indexOf("_") > -1) {
                id2 = id2.split("_")[0];
              }
              for (let j = 0; j < lst.length; j++) {
                const jId = this.getFeatureId(lst[j]);
                if (jId === fId) {
                  continue;
                }
                if (jId.indexOf(id2) > -1) {
                  fs.push({ feature: lst[j], layerIdx });
                }
              }
            }
          } else if (this.layerAssets[layerIdx].getSource()) {
            const id2 = feature.getId();
            if (id2) {
              fs.push({ feature, layerIdx });
            }
            if (id2 && id2.indexOf("_") > -1) {
              const id0 = id2.split("_")[0];
              const lst = this.layerAssets[layerIdx].getSource().getFeatures();
              if (lst == null || lst.length === 0) {
                return fs;
              }
              lst.forEach((f, j) => {
                const fId = f.getId();
                if (fId && fId.indexOf(id0) > -1 && fId !== id2) {
                  fs.push({ feature: f, layerIdx: layer.getZIndex() });
                }
              });
            }
          }
          if (typeof options.mode === "undefined" || options.mode === null) {
            return fs;
          }
        }
      }
    }, {
      hitTolerance: 10
    });
    return fs;
  }
  getFeaturesCollectionId(id2) {
    const fs = [];
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (!this.layerAssets[i2].getSource()) {
        continue;
      }
      const lst = this.layerAssets[i2].getSource().getFeatures();
      if (lst == null || lst.length === 0) {
        continue;
      }
      lst.forEach(function(f, j) {
        const fId = f.getId();
        if (fId && fId.indexOf(id2) > -1) {
          let isExist = false;
          for (let k = 0; k < fs.length; k++) {
            if (fs[k].getId() === fId) {
              isExist = true;
              break;
            }
          }
          if (!isExist) {
            fs.push(f);
          }
        }
      });
    }
    return fs;
  }
  addFeature(feature, layerIndex) {
    if (feature == null) {
      return;
    }
    const p = feature.getProperties();
    p.zIndex = 0;
    if (layerIndex && layerIndex < this.layerAssets.length && this.layerAssets[layerIndex].getSource()) {
      p.zIndex = layerIndex;
      if (this.layerAssets[layerIndex].get("isCluster")) {
        const src = this.layerAssets[layerIndex].getSource().getSource();
        src.addFeature(feature);
      } else {
        if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY || this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP || this.type === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
          feature.setStyle(this.styleAddress(feature, null));
        } else if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && layerIndex !== this.layerIndexPrimary && layerIndex !== this.layerIndexSecondary) {
          feature.setStyle(this.styleAsset(feature, layerIndex));
        }
        this.layerAssets[layerIndex].getSource().addFeature(feature);
      }
    }
    feature.setProperties(p);
  }
  removeFeature(feature, layerIndex) {
    if (layerIndex) {
      if (layerIndex > this.layerAssets.length || !this.layerAssets[layerIndex].getSource()) {
        return;
      }
      this.layerAssets[layerIndex].getSource().removeFeature(feature);
    } else {
      const fId = feature.getId();
      this.removeItemFromMap(fId);
    }
  }
  removeItemFromMap(id2) {
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (!this.layerAssets[i2].getSource()) {
        continue;
      }
      if (this.layerAssets[i2].get("isCluster")) {
        const src = this.layerAssets[i2].getSource().getSource();
        const f = src.getFeatureById(id2);
        if (f) {
          src.removeFeature(f);
          break;
        }
      } else {
        const f = this.layerAssets[i2].getSource().getFeatureById(id2);
        if (f) {
          this.layerAssets[i2].getSource().removeFeature(f);
          break;
        }
      }
    }
  }
  getMapSize() {
    return this.map.getSize();
  }
  getBoundingBox(options) {
    if (this.view === null || typeof this.view === "undefined") {
      return null;
    }
    const zoom = this.view.getZoom();
    const extent = this.view.calculateExtent(this.map.getSize());
    const bottomLeft = transform(getBottomLeft(extent), options.EPSG, SclMapConstantService.EPSG_4326);
    const topRight = transform(getTopRight(extent), options.EPSG, SclMapConstantService.EPSG_4326);
    if (isNaN(bottomLeft[0]) || isNaN(bottomLeft[1]) || isNaN(topRight[0]) || isNaN(topRight[1])) {
      return null;
    }
    const left = bottomLeft[0];
    const bottom = bottomLeft[1];
    const right = topRight[0];
    const top = topRight[1];
    let minLon = left;
    let maxLon = right;
    if (left > right) {
      minLon = right;
      maxLon = left;
    }
    let minLat = bottom;
    let maxLat = top;
    if (bottom > top) {
      minLat = top;
      maxLat = bottom;
    }
    return { minLon, maxLat, maxLon, minLat, zoom };
  }
  getLayerSourceBoundingBox(layerIndex, systemMapLimit, EPSG) {
    const extent = this.layerAssets[this.layerIndexFilter].getSource().getExtent();
    const bottomLeft = transform(getBottomLeft(extent), EPSG, SclMapConstantService.EPSG_4326);
    const topRight = transform(getTopRight(extent), EPSG, SclMapConstantService.EPSG_4326);
    if (isNaN(bottomLeft[0]) || isNaN(bottomLeft[1]) || isNaN(topRight[0]) || isNaN(topRight[1])) {
      return null;
    }
    let l = bottomLeft[0];
    let b = bottomLeft[1];
    let r = topRight[0];
    let t = topRight[1];
    const boxLimit = {
      left: systemMapLimit[0][1],
      bottom: systemMapLimit[1][0],
      right: systemMapLimit[1][1],
      top: systemMapLimit[0][0]
    };
    if (l < boxLimit.left) {
      l = boxLimit.left;
    }
    if (r > boxLimit.right) {
      r = boxLimit.right;
    }
    if (b < boxLimit.bottom) {
      b = boxLimit.bottom;
    }
    if (t > boxLimit.top) {
      t = boxLimit.top;
    }
    const box = this.validateBoxInBound({ l, b, r, t }, boxLimit);
    return transformExtent(box, SclMapConstantService.EPSG_4326, EPSG);
  }
  validateBoxInBound(box, boxLimit) {
    if (box.l < boxLimit.left) {
      box.l = boxLimit.left;
    }
    if (box.r > boxLimit.right) {
      box.r = boxLimit.right;
    }
    if (box.b < boxLimit.bottom) {
      box.b = boxLimit.bottom;
    }
    if (box.t > boxLimit.top) {
      box.t = boxLimit.top;
    }
    return [box.l, box.b, box.r, box.t];
  }
  validateBox(box, systemMapLimit, EPSG) {
    const box4326 = transformExtent(box, EPSG, SclMapConstantService.EPSG_4326);
    const bbox = {
      l: box4326[0],
      b: box4326[1],
      r: box4326[2],
      t: box4326[3]
    };
    const boxLimit = {
      left: systemMapLimit[0][1],
      bottom: systemMapLimit[1][0],
      right: systemMapLimit[1][1],
      top: systemMapLimit[0][0]
    };
    const boxEPSG = this.validateBoxInBound(bbox, boxLimit);
    return transformExtent(boxEPSG, SclMapConstantService.EPSG_4326, EPSG);
  }
  addSearchAddress(apiKey, wrapper, cb) {
    console.log("Need to bring back GoogleMapLoader ?");
  }
  clearAllFeatures() {
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.layerAssets[i2].getSource().clear();
    }
  }
  clearAllFeaturesLayer(layerIndex) {
    if (layerIndex > this.layerAssets.length || !this.layerAssets[layerIndex].getSource() || this.layerAssets[layerIndex].get("isCluster")) {
      return;
    }
    this.layerAssets[layerIndex].getSource().clear();
  }
  updateSize() {
    this.map.updateSize();
  }
  getLatLngFromPixel(pixel) {
    const coordinate = this.map.getCoordinateFromPixel(pixel);
    const coor = transform(coordinate, this.EPSG, "EPSG:4326");
    return coor;
  }
  getPixelFromCoordinate(coordinate) {
    const coor = transform(coordinate, this.EPSG, "EPSG:4326");
    const pixel = this.map.getPixelFromCoordinate(coordinate);
    return { coor, pixel };
  }
  findFeatureByClick(evt, assetType, assetSelectionsAvailable, sType) {
    const features = [];
    const coordinate = evt.feature.getGeometry().getCoordinates();
    const obj = this.getPixelFromCoordinate(coordinate);
    const existedFeature = this.getFeaturesFromMap(features, obj.pixel, assetType, assetSelectionsAvailable, sType);
    return { coor: obj.coor, pixel: obj.pixel, features, existedFeature };
  }
  storeSelectedAssets(feature, isPrimary) {
    const fId = feature.getId();
    const fPro = feature.getProperties();
    const assetType = feature.get("assetType");
    if (this.selectedAssets == null) {
      this.selectedAssets = [];
    }
    const len = this.selectedAssets.length;
    for (let i2 = 0; i2 < len; i2++) {
      const iId = this.selectedAssets[i2].getId();
      if (iId === fId) {
        if (isPrimary) {
          const f = this.layerAssets[this.layerIndexPrimary].getSource().getFeatureById(iId);
          if (f == null) {
            this.addSelectedAssetsIcon(feature, this.layerIndexPrimary, this.stylePrimaryAssetFunc.bind(this));
          }
        } else {
          const f = this.layerAssets[this.layerIndexSecondary].getSource().getFeatureById(iId);
          if (f == null) {
            this.addSelectedAssetsIcon(feature, this.layerIndexSecondary, this.styleSecondaryAssetFunc.bind(this));
          }
        }
        this.selectedAssets[i2] = feature;
        return;
      }
    }
    this.selectedAssets.push(feature);
    if (isPrimary) {
      this.addSelectedAssetsIcon(feature, this.layerIndexPrimary, this.stylePrimaryAssetFunc.bind(this));
    } else {
      this.addSelectedAssetsIcon(feature, this.layerIndexSecondary, this.styleSecondaryAssetFunc.bind(this));
    }
  }
  addSelectedAssetsIcon(feature, layerIndex, styleFunc) {
    feature.set("zIndex", layerIndex);
    feature.setStyle(styleFunc(feature, null));
    this.layerAssets[layerIndex].getSource().addFeature(feature);
    this.layerAssets[layerIndex].setVisible(true);
  }
  updateStoredSelectedAssetVisualize(id2, handlebarsContext, primaryIcon, primaryAssetSelection, secondaryIcon, secondaryAssetSelection, handlebarAssetFn) {
    return __async(this, null, function* () {
      if (!this.selectedAssets) {
        return;
      }
      const len = this.selectedAssets.length;
      for (let i2 = 0; i2 < len; i2++) {
        const feature = this.selectedAssets[i2];
        let fId = feature.getId();
        if (fId.indexOf("_") > -1) {
          fId = fId.split("_")[0];
        }
        if (id2.indexOf(fId) > -1) {
          const p = feature.getProperties();
          let isPrimary = false;
          if (p.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
            isPrimary = true;
          }
          if (isPrimary) {
            const primary = yield handlebarAssetFn(handlebarsContext, primaryIcon, primaryAssetSelection, true);
            this.setFeatureProperties(feature, { primary });
            feature.setStyle(this.stylePrimaryAssetFunc(feature, null));
          } else {
            const secondary = yield handlebarAssetFn(handlebarsContext, secondaryIcon, secondaryAssetSelection, false);
            this.setFeatureProperties(feature, { secondary });
            feature.setStyle(this.styleSecondaryAssetFunc(feature, null));
          }
          break;
        }
      }
    });
  }
  removeSelectedAssetsById(id2) {
    let fId = id2;
    let mode = "NA";
    if (fId && fId.indexOf("primary") > -1) {
      mode = "primary";
    } else if (fId && fId.indexOf("secondary") > -1) {
      mode = "secondary";
    }
    if (fId && fId.indexOf("_") > -1) {
      fId = fId.split("_")[0];
    }
    const len = this.selectedAssets.length;
    for (let i2 = len - 1; i2 > -1; i2--) {
      const iId = this.selectedAssets[i2].getId();
      if (iId && iId.indexOf(mode) > -1 && iId.indexOf(fId) > -1 || iId === fId) {
        this.selectedAssets.splice(i2, 1);
        this.removeItemFromMap(iId);
      }
    }
  }
  removeLayerFeatures() {
    this.clearAllFeatures();
  }
  // copy from sclAssetLayers.removeUnselectedAsset
  removeUnselectedAsset(assets, unSelectedAssetIds, type) {
    for (let i2 = 0; i2 < unSelectedAssetIds.length; i2++) {
      const priAsset = unSelectedAssetIds[i2];
      for (let j = 0; j < assets.length; j++) {
        const id2 = assets[j].properties.linkAssets[0].documentId;
        if (id2 === priAsset) {
          this.removeItemFromMap(id2 + "_" + type);
          assets.splice(j, 1);
        }
      }
    }
  }
  updateLayers(pLayerAssets) {
    this.removeLayerFeatures();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.map.removeLayer(this.layerAssets[i2]);
    }
    const obj = { layerAssets: pLayerAssets };
    this.createLayers(obj);
    if (this.layerAssets.length > 0) {
      for (let iLa = 1; iLa < this.layerAssets.length; iLa++) {
        this.map.addLayer(this.layerAssets[iLa]);
      }
    }
  }
  // ************** use for psma layer reverse function *******************************************
  psmaStyleFunction(feature, resolution) {
    if (typeof feature !== "object" || typeof feature.getProperties() === "undefined") {
      return null;
    }
    const p = feature.getProperties();
    const description = feature.getProperties().description;
    const label = typeof description === "undefined" || description === null ? "" : description + "";
    let image = new Circle_default({
      radius: 3,
      fill: new Fill_default({
        color: [255, 127, 39, 1]
      }),
      stroke: new Stroke_default({
        color: [255, 0, 0, 1],
        width: 1.5
      })
    });
    if (p.icon) {
      const anchor2 = [0.5, 0.5];
      image = new Icon_default({
        src: p.icon,
        anchor: anchor2
      });
    }
    const style2 = new Style_default({
      fill: new Fill_default({
        color: "rgba(255,255,255,0.4)"
      }),
      stroke: new Stroke_default({
        color: "#3399CC",
        width: 1.25
      }),
      text: new Text_default({
        font: "12px Arial",
        fill: new Fill_default({ color: "#000" }),
        stroke: new Stroke_default({
          color: "#fff",
          width: 2
        }),
        textBaseline: "top",
        // get the text from the feature - `this` is ol.Feature
        // and show only under certain resolution
        text: label
      }),
      image
      // zIndex: 10000 //13835
    });
    return style2;
  }
  psmaCreateLayer(psmaPoints) {
    if (typeof this.psmaReverse === "undefined" || this.psmaReverse === null) {
      this.psmaReverse = {};
      this.layerAssets[this.layerIndexAddress].getSource().addFeatures(psmaPoints);
      this.psmaReverse.psmaSourceVector = this.layerAssets[this.layerIndexAddress].getSource();
      this.layerAssets[this.layerIndexAddress].setStyle(this.psmaStyleFunction.bind(this));
      this.psmaReverse.psmaLayer = this.layerAssets[this.layerIndexAddress];
    }
    return this.psmaReverse;
  }
  psmaCreatePoint(coor, properties2, psmaPoints) {
    const coorMap = transform(coor, "EPSG:4326", this.EPSG);
    const iconFeature = new Feature_default2(new Point_default(coorMap));
    iconFeature.setProperties(properties2);
    this.layerAssets[this.layerIndexAddress].getSource().addFeature(iconFeature);
    psmaPoints.push(iconFeature);
    return psmaPoints;
  }
  psmaCreatePointClick(coor, radius, psmaPoints) {
    const circle4326 = circular(coor, radius);
    const circle3857 = circle4326.clone().transform("EPSG:4326", this.EPSG);
    const clickFeature = new Feature_default2(circle3857);
    this.layerAssets[this.layerIndexAddress].getSource().addFeature(clickFeature);
    psmaPoints.push(clickFeature);
    return psmaPoints;
  }
  psmaRemovePoint(psmaPoints, psmaSourceVector) {
    for (let i2 = 0; i2 < psmaPoints.length; ++i2) {
      if (psmaPoints[i2] == null) {
        continue;
      }
      psmaSourceVector.removeFeature(psmaPoints[i2]);
    }
    return { psmaPoints, psmaSourceVector };
  }
  psmaDistanceCoords(coorA, coorB) {
    const distance2 = getDistance(coorA, coorB);
    return distance2;
  }
  // copy from sclUtilMap.positionView
  positionView(lat, lon, zoom, EPSG) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lon = typeof lon !== "undefined" ? lon : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    this.view.setCenter(transform([lon, lat], "EPSG:4326", EPSG));
    this.view.setZoom(zoom);
  }
  //
  setCenterMapViewByCoordinates(bbox) {
    const bottom = bbox[1][1];
    const left = bbox[0][0];
    const top = bbox[0][1];
    const right = bbox[1][0];
    let ext = [left, bottom, right, top];
    ext = applyTransform(ext, getTransform("EPSG:4326", this.EPSG));
    this.view.fit(ext, {
      size: this.map.getSize(),
      constrainResolution: false
    });
  }
  // 15262
  setCenter(lat, lon) {
    const center = transform([lon, lat], "EPSG:4326", this.EPSG);
    this.view.setCenter(center);
  }
  setSelectAssetCluster(features, currentSelected) {
    for (let i2 = 0; i2 < features.length; i2++) {
      currentSelected.push(features[i2].feature);
    }
  }
  extendToCoordinate(coord) {
    const currentLoc = transform(this.map.getView().getCenter(), this.EPSG, "EPSG:4326");
    let ext = boundingExtent([coord, currentLoc]);
    ext = transformExtent(ext, get3("EPSG:4326"), get3(this.EPSG));
    this.map.getView().fit(ext, {
      size: this.map.getSize(),
      padding: [50, 0, 50, 0]
    });
  }
  getFeatureCoordinate(feature) {
    let geom = (0, import_lodash5.cloneDeep)(feature.getGeometry());
    geom = geom.transform(this.EPSG, "EPSG:4326");
    const type = geom.getType();
    const coords = geom.getCoordinates();
    let coordArray = (0, import_lodash5.cloneDeep)(coords);
    const finalCoords = [];
    ;
    if (type == "LineString") {
      for (let i2 = 0; i2 < coords.length - 1; i2++) {
        finalCoords.push([coords[i2], coords[i2 + 1]]);
      }
      coordArray = [];
      for (let i2 = 0; i2 < coords.length; i2++) {
        coordArray.push(coords[i2]);
      }
    } else if (type == "Polygon") {
      for (let i2 = 0; i2 < coords[0].length - 1; i2++) {
        finalCoords.push([coords[0][i2], coords[0][i2 + 1]]);
      }
      coordArray = [];
      for (let i2 = 0; i2 < coords[0].length; i2++) {
        coordArray.push(coords[0][i2]);
      }
    } else if (type == "MultiLineString") {
      for (let i2 = 0; i2 < coords.length; i2++) {
        for (let j = 0; j < coords[i2].length - 1; j++) {
          finalCoords.push([coords[i2][j], coords[i2][j + 1]]);
        }
      }
      coordArray = [];
      for (let i2 = 0; i2 < coords.length; i2++) {
        for (let j = 0; j < coords[i2].length; j++) {
          coordArray.push(coords[i2][j]);
        }
      }
    } else if (type == "MultiPolygon") {
      for (let i2 = 0; i2 < coords.length; i2++) {
        for (let j = 0; j < coords[i2][0].length - 1; j++) {
          finalCoords.push([coords[i2][0][j], coords[i2][0][j + 1]]);
        }
      }
      coordArray = [];
      for (let i2 = 0; i2 < coords.length; i2++) {
        for (let j = 0; j < coords[i2][0].length; j++) {
          coordArray.push(coords[i2][0][j]);
        }
      }
    }
    return { coords: finalCoords, type, coordArray };
  }
};
_SclMappingFunctionOpenLayersService.\u0275fac = function SclMappingFunctionOpenLayersService_Factory(t) {
  return new (t || _SclMappingFunctionOpenLayersService)();
};
_SclMappingFunctionOpenLayersService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMappingFunctionOpenLayersService, factory: _SclMappingFunctionOpenLayersService.\u0275fac, providedIn: "root" });
var SclMappingFunctionOpenLayersService = _SclMappingFunctionOpenLayersService;

// projects/formbird-mapping/src/lib/scl-mapping-functions-arc-gis.service.ts
var import_esri_loader = __toESM(require_esri_loader());
var import_lodash6 = __toESM(require_lodash());
var sclMapConstant = SclMapConstantService;
var sclMapViews3 = new SclMapViewsService();
var sclAssetLayers2 = new SclAssetLayersService();
(0, import_esri_loader.setDefaultOptions)({ css: true });
var _SclMappingFunctionsArcGisService = class _SclMappingFunctionsArcGisService {
  constructor() {
    this.sclUtilMapService = new SclUtilMapService();
    this.selectedAssets = [];
    this.selectedFeatures = [];
    this.zoomFloor = 18;
    this.layerAssets = [];
    this.compActionType = "";
    this.ActionControls = [];
    this.lstHeatWeight = [];
    this.heatDatas = [];
    this.heatLayerConfig = {};
    this.fitCoors = [];
    this.mapLoaded = false;
    this.drawingMode = "single";
    this.color = "black";
    this.multiColor = "red";
    this.drawingShapeSingle = [];
    this.drawingShapeMulti = { point: [], line: [], polygon: [] };
    this.textSymbolVerticalAlignment = ["baseline", "top", "middle", "bottom"];
    this.textSymbolHorizontalAlignment = ["left", "right", "center", "justify"];
    this.isMapReady = false;
    this.controlBtns = [];
    this.mouseHoverFeature = null;
  }
  load(cb) {
    this.lib = {};
    (0, import_esri_loader.loadModules)([
      "esri/Map",
      "esri/views/MapView",
      "esri/views/SceneView",
      "esri/layers/FeatureLayer",
      "esri/layers/GraphicsLayer",
      "esri/Graphic",
      "esri/core/watchUtils",
      "esri/geometry/support/webMercatorUtils",
      "esri/Color",
      "esri/geometry/Multipoint",
      "esri/geometry/Circle",
      "esri/geometry/Point",
      "esri/symbols/Font",
      "esri/symbols/TextSymbol",
      "esri/widgets/Fullscreen",
      "esri/geometry/Extent",
      "esri/widgets/Sketch/SketchViewModel"
    ]).then(([Map3, MapView, SceneView, FeatureLayer, GraphicsLayer, Graphic, watchUtils, webMercatorUtils, Color3, Multipoint, Circle2, Point3, Font, TextSymbol, Fullscreen, Extent, SketchViewModel]) => {
      this.lib = {
        Map: Map3,
        MapView,
        SceneView,
        FeatureLayer,
        GraphicsLayer,
        Graphic,
        watchUtils,
        webMercatorUtils,
        Color: Color3,
        Multipoint,
        Circle: Circle2,
        Point: Point3,
        Font,
        TextSymbol,
        Fullscreen,
        Extent,
        SketchViewModel
      };
      if (cb && typeof cb === "function") {
        cb();
      }
    }).catch(() => {
      if (cb && typeof cb === "function") {
        cb();
      }
    });
  }
  interactionSelect() {
  }
  interactionModify() {
  }
  interactionSelectMultiple(isActive, cb) {
  }
  checkGeoJson(geojson) {
    if (typeof geojson.features === "undefined" || geojson.features.length == null || geojson.features.length === 0) {
      return false;
    }
    const f0 = geojson.features[0];
    if (typeof f0.type !== "undefined" && typeof f0.geometry !== "undefined" && typeof f0.geometry.type !== "undefined") {
      return true;
    }
    return false;
  }
  clampZoomFloor() {
    if (this.mapView.zoom > this.zoomFloor) {
      this.mapView.goTo({
        zoom: this.zoomFloor
      });
    }
  }
  getTile(mapView, isShow, self2) {
    const tile = "";
    return tile;
  }
  multiLayers(mapViews) {
    return [];
  }
  // copy from sclUtilMap
  setView(lng, lat, zoom, EPSG, minResolution, maxResolution, maxZoom) {
  }
  createLayerSourceNormal(zIndex, pStyle, title, layerDisplayOnly) {
    let objStyle = {
      color: "black",
      fill: null,
      fillOpacity: 1,
      lineCap: null,
      lineDash: null,
      lineWidth: 1,
      imageAnchor: [0.5, 0.5],
      imageFileNo: ""
    };
    if (pStyle) {
      objStyle = {
        color: pStyle.color ? pStyle.color : "black",
        fill: pStyle.fill ? pStyle.fill : null,
        fillOpacity: pStyle.fillOpacity ? pStyle.fillOpacity : 1,
        lineCap: pStyle.lineCap ? pStyle.lineCap : null,
        lineDash: pStyle.lineDash ? pStyle.lineDash : null,
        lineWidth: pStyle.lineWidth ? pStyle.lineWidth : 1,
        imageAnchor: pStyle.imageAnchor ? pStyle.imageAnchor : [0.5, 0.5],
        imageFileNo: pStyle.imageFileNo ? pStyle.imageFileNo : ""
      };
    }
    return {
      graphicLayer: new this.lib.GraphicsLayer(),
      zIndex,
      style: objStyle,
      title,
      layerDisplayOnly
    };
  }
  createEmptyLayer(zIndex, pStyle, title, isHeatMap, options) {
    let newLayer;
    let layerDisplayOnly = false;
    if (options && options.layerDisplayOnly) {
      layerDisplayOnly = options.layerDisplayOnly;
    }
    if (isHeatMap) {
      const renderer = {
        type: "heatmap",
        field: "weight",
        colorStops: [
          { ratio: 0, color: "rgba(255, 140, 0, 0)" },
          { ratio: 0.75, color: "rgba(255, 140, 0, 1)" },
          { ratio: 0.9, color: "rgba(255, 0,   0, 1)" }
        ],
        minPixelIntensity: 0,
        maxPixelIntensity: 100,
        blurRadius: 10
      };
      if (options != null && typeof options.gradient !== "undefined") {
        renderer.colorStops = [];
        const factor = parseFloat((1 / options.gradient.length).toFixed(2));
        let ratio = 0;
        for (let i2 = 0; i2 < options.gradient.length; i2++) {
          renderer.colorStops.push({ ratio, color: options.gradient[i2] });
          ratio += factor;
          if (ratio > 1) {
            ratio = 1;
          }
        }
      }
      if (options != null && typeof options.blur !== "undefined") {
        renderer.blurRadius = options.blur;
      }
      const aLayer = new this.lib.FeatureLayer({
        fields: [
          {
            name: "id",
            alias: "id",
            type: "string"
          },
          {
            name: "weight",
            alias: "weight",
            type: "double"
          }
        ],
        objectIdField: "id",
        geometryType: "point",
        // spatialReference: view.spatialReference,
        renderer,
        source: []
      });
      newLayer = {
        graphicLayer: aLayer,
        zIndex,
        isHeatMap: true,
        layerDisplayOnly: true
      };
    } else {
      newLayer = this.createLayerSourceNormal(zIndex, pStyle, title, layerDisplayOnly);
    }
    newLayer.layerQuery = options;
    return newLayer;
  }
  createLayerAsset(options) {
    let layerQuery = [];
    let hasFilterQuery = false;
    let hasSecondary = false;
    let styleSecondary = null;
    let hasPrimary = false;
    let stylePrimary = null;
    let hasUserItems = false;
    let styleSelected = null;
    let hasAddressPoint = false;
    let stylePoint = null;
    if (options.layerQuery) {
      layerQuery = options.layerQuery;
    }
    if (options.hasFilterQuery) {
      hasFilterQuery = options.hasFilterQuery;
    }
    if (options.hasSecondary) {
      hasSecondary = options.hasSecondary;
    }
    if (options.styleSecondary) {
      styleSecondary = options.styleSecondary;
    }
    if (options.hasPrimary) {
      hasPrimary = options.hasPrimary;
    }
    if (options.stylePrimary) {
      stylePrimary = options.stylePrimary;
    }
    if (options.hasUserItems) {
      hasUserItems = options.hasUserItems;
    }
    if (options.styleSelected) {
      styleSelected = options.styleSelected;
    }
    if (options.hasAddressPoint) {
      hasAddressPoint = options.hasAddressPoint;
    }
    if (options.stylePoint) {
      stylePoint = options.stylePoint;
    }
    let layerIndex = 0;
    if (this.layerAssets == null) {
      this.layerAssets = [];
    }
    if (layerQuery) {
      for (let i2 = 0; i2 < layerQuery.length; i2++) {
        if (layerQuery[i2].query.indexOf("_layer") < 0) {
          continue;
        }
        let style2 = {};
        if (layerIndex < layerQuery.length) {
          style2 = layerQuery[layerIndex].layer;
        }
        layerIndex++;
        this.layerAssets.push(this.createEmptyLayer(layerIndex, style2, "layer" + layerIndex, layerQuery[i2].isHeatMap, layerQuery[i2].layer));
      }
    }
    if (hasFilterQuery) {
      let style2 = {};
      if (layerIndex < layerQuery.length) {
        style2 = layerQuery[layerIndex].layer;
      }
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, style2, "filter", null, null));
      this.layerIndexFilter = layerIndex;
    }
    if (hasSecondary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, this.convertStylePrimary(styleSecondary, "secondary"), "secondary", null, null));
      this.layerIndexSecondary = layerIndex;
    }
    if (hasPrimary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, this.convertStylePrimary(stylePrimary, "primary"), "primary", null, null));
      this.layerIndexPrimary = layerIndex;
    }
    if (hasUserItems) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, this.convertStylePrimary(styleSelected, ""), "selectedItems", null, null));
      this.layerIndexUser = layerIndex;
    }
    if (hasAddressPoint) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, stylePoint, "addressPoint", null, null));
      this.layerIndexAddress = layerIndex;
    }
    this.layerIndexTooltips = layerIndex + 1;
    this.layerIndexControl = layerIndex + 2;
  }
  convertStylePrimary(style2, type) {
    let defaultImgFileNo = sclMapConstant.MAP_MARKER;
    if (type === "primary") {
      defaultImgFileNo = sclMapConstant.MAP_PRIMARY_ASSET;
    } else if (type === "secondary") {
      defaultImgFileNo = sclMapConstant.MAP_SECONDARY_ASSET;
    }
    let imgFileNo = style2.selectionImageFileNo;
    if (imgFileNo && imgFileNo !== sclMapConstant.MAP_MARKER && imgFileNo !== sclMapConstant.MAP_PRIMARY_ASSET && imgFileNo !== sclMapConstant.MAP_SECONDARY_ASSET) {
      imgFileNo = "/api/getFile/" + imgFileNo.replace("api/getFile/", "").replace("/api/getFile/", "");
    }
    return {
      color: style2.selectionColor ? style2.selectionColor : "black",
      fill: style2.selectionFill ? style2.selectionFill : null,
      fillOpacity: style2.selectionFillOpacity ? style2.selectionFillOpacity : 1,
      lineCap: style2.selectionLineCap ? style2.selectionLineCap : null,
      lineDash: style2.selectionLineDash ? style2.selectionLineDash : null,
      lineWidth: style2.selectionLineWidth ? style2.selectionLineWidth : 1,
      imageAnchor: style2.selectionImageAnchor ? style2.selectionImageAnchor : [0.5, 0.5],
      imageFileNo: imgFileNo ? imgFileNo : defaultImgFileNo
    };
  }
  createLayers(initObj) {
    this.layerAssets = [];
    this.layerAssets.push(this.createLayerSourceNormal(0, {}, "layer0", false));
    let layerQuery = [];
    if (this.type === 0) {
      this.createLayerAsset({ layerQuery, hasAddressPoint: true, stylePoint: initObj.styleAddress });
    } else if (this.type === 1) {
      if (initObj.layerAssets) {
        layerQuery = initObj.layerAssets;
      }
      this.createLayerAsset({ layerQuery, hasFilterQuery: true, hasUserItems: true, styleSelected: initObj.selectionStyle });
    } else if (this.type === 2) {
      this.createLayerAsset({ layerQuery, hasAddressPoint: true, stylePoint: initObj.styleAddress });
    } else if (this.type === 3) {
      if (initObj.layerAssets) {
        layerQuery = initObj.layerAssets;
      }
      this.createLayerAsset({
        layerQuery,
        hasFilterQuery: true,
        hasSecondary: true,
        styleSecondary: initObj.secondaryAssetSelection,
        hasPrimary: true,
        stylePrimary: initObj.primaryAssetSelection,
        hasAddressPoint: true,
        stylePoint: initObj.styleAddress
      });
    }
  }
  createHeatMap(layerIndex) {
    const min = Math.min.apply(null, this.lstHeatWeight);
    const max = Math.max.apply(null, this.lstHeatWeight);
    const addFeatures = [];
    for (let i2 = 0; i2 < this.heatDatas.length; i2++) {
      let weight = (this.heatDatas[i2].weight - min) / (max - min);
      if (isNaN(weight)) {
        if (max === min) {
          weight = 1;
        } else {
          weight = 0;
        }
      }
      if (weight > 1) {
        weight = 1;
      }
      const coord = this.heatDatas[i2].location;
      const pf = {
        geometry: {
          type: "point",
          longitude: coord[0],
          latitude: coord[1]
        }
      };
      this.heatDatas[i2].weight = weight;
      this.setFeatureProperties(pf, this.heatDatas[i2]);
      addFeatures.push(pf);
    }
    this.heatDatas = [];
    this.lstHeatWeight = [];
    this.layerAssets[layerIndex].graphicLayer.applyEdits({
      addFeatures
    });
  }
  init(initObj) {
    this.divWrapper = initObj.divWrapper;
    this.selectedAssets = [];
    if (initObj.setDirty) {
      this.setDirtyFunction = initObj.setDirty;
    }
    this.type = initObj.style;
    let coordinates2;
    if (initObj.formatGeoJSON) {
      coordinates2 = initObj.formatGeoJSON;
    }
    if (initObj.setupMapDone) {
      this.setupMapDone = initObj.setupMapDone;
    }
    if (initObj.selectionStyle) {
      this.selectionStyle = initObj.selectionStyle;
    }
    if (initObj.primaryAssetSelection) {
      this.primaryAssetSelection = initObj.primaryAssetSelection;
    }
    if (initObj.secondaryAssetSelection) {
      this.secondaryAssetSelection = initObj.secondaryAssetSelection;
    }
    if (initObj.color) {
      this.color = initObj.color;
    }
    if (initObj.multiColor) {
      this.multiColor = initObj.multiColor;
    }
    if (initObj.setDirty) {
      this.setDirtyFunction = initObj.setDirty;
    }
    if (initObj.layersRedraw) {
      this.layersRedraw = initObj.layersRedraw;
    }
    if (initObj.heightNum) {
      this.heightNum = initObj.heightNum;
    }
    if (initObj.mapId) {
      this.mapId = initObj.mapId;
    }
    if (initObj.onTilesLoaded) {
      this.onTilesLoaded = initObj.onTilesLoaded;
    }
    if (initObj.singleSelectMode) {
      this.funcSingleSelectMode = initObj.singleSelectMode;
    }
    if (initObj.zoomFloor) {
      this.zoomFloor = initObj.zoomFloor;
    }
    if (initObj.layers) {
      this.tileLayers = initObj.layers;
    }
    if (initObj.toolTipOnFeatureHover) {
      this.toolTipOnFeatureHover = initObj.toolTipOnFeatureHover;
    }
    if (initObj.setupTooltipUI) {
      this.setupTooltipUI = initObj.setupTooltipUI;
    }
    if (initObj.fullScreenEvent) {
      this.fullScreenEvent = initObj.fullScreenEvent;
    }
    if (initObj.target) {
      this.mapDiv = initObj.target;
    }
    this.defaultLat = initObj.defaultLat ? initObj.defaultLat : -37.8;
    this.defaultLon = initObj.defaultLon ? initObj.defaultLon : 144.9;
    this.defaultZoom = initObj.defaultZoom ? initObj.defaultZoom : 14;
    this.drawingShapeMulti = { point: [], line: [], polygon: [] };
    this.map = new this.lib.Map({
      basemap: "topo-vector"
    });
    this.mapView = new this.lib.MapView({
      container: initObj.target,
      map: this.map,
      center: [this.defaultLon, this.defaultLat],
      zoom: this.defaultZoom
      // navigation: {
      //     mouseWheelZoomEnabled: scrollWheel
      // }
    });
    if (initObj.disableMouseWheel) {
      this.mapView.on("mouse-wheel", function(event) {
        event.stopPropagation();
      });
    }
    if (initObj.style === 0) {
      if (coordinates2 && this.checkGeoJson(coordinates2)) {
      }
    } else if (initObj.style === 1) {
    } else if (initObj.style === 2) {
      if (coordinates2 && this.checkGeoJson(coordinates2)) {
      }
    } else if (initObj.style === 3) {
      this.addressImageAnchor = initObj.addressImageAnchor;
      this.primaryImageAnchor = initObj.primaryImageAnchor;
      this.secondaryImageAnchor = initObj.secondaryImageAnchor;
      if (coordinates2 && this.checkGeoJson(coordinates2)) {
      }
    }
    this.createLayers(initObj);
    if (coordinates2) {
      this.clampZoomFloor();
    }
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      this.map.add(this.layerAssets[i2].graphicLayer, i2);
    }
    const fullscreen = new this.lib.Fullscreen({
      view: this.mapView
    });
    this.mapView.ui.add(fullscreen, "top-right");
    this.lib.watchUtils.watch(fullscreen.viewModel, "state", (value) => {
      let isFullScreen2 = false;
      if (value === "ready") {
        initObj.target.style.width = "100%";
        initObj.target.style.height = "100%";
      } else if (value === "active") {
        isFullScreen2 = true;
      }
      if (!this.isBottom) {
        this.elementCtrl.style.top = (initObj.target.offsetHeight - 45) / 2 - this.customControlHeight / 2 + "px";
      }
      if (this.fullScreenEvent != null && typeof this.fullScreenEvent === "function") {
        this.fullScreenEvent(this.mapDiv.offsetHeight, isFullScreen2);
      }
    });
    this.lib.watchUtils.watch(this.mapView, "zoom", (newValue) => {
      if (this.divZoomIn) {
        this.divZoomIn.title = "Zoom In (" + newValue + ")";
      }
      if (this.divZoomOut) {
        this.divZoomOut.title = "Zoom Out (" + newValue + ")";
      }
      for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
        if (this.isHeatLayer(i2) || !this.layerAssets[i2].layerQuery || !this.layerAssets[i2].layerQuery.labelDisplayZoom) {
          continue;
        }
        const labelDisplayZoom = this.layerAssets[i2].layerQuery.labelDisplayZoom;
        if (labelDisplayZoom > newValue) {
          this.layerAssets[i2].graphicLayer.graphics.forEach((feature) => {
            if (feature.attributes && feature.attributes.lb) {
              feature.attributes.lb.symbol.text = "";
            }
          });
        } else {
          this.layerAssets[i2].graphicLayer.graphics.forEach((feature) => {
            if (feature.attributes && feature.attributes.lb) {
              feature.attributes.lb.symbol.text = feature.attributes.label.labelText;
            }
          });
        }
      }
      if (this.type === 1) {
        this.showHeatLayer(newValue);
      }
    });
    this.mapView.ui.move("zoom", "bottom-right");
    this.mapView.when((function() {
      console.log("view loaded successfully");
      if (this.setupTooltipUI && typeof this.setupTooltipUI === "function") {
        this.setupTooltipUI();
        this.setupTooltipUI = null;
      }
      if (this.type === 0) {
        const pointSymbol = {
          type: "simple-marker",
          // autocasts as new SimpleMarkerSymbol()
          style: "circle",
          color: this.color,
          size: "16px",
          outline: {
            color: this.color,
            width: 1
          }
        };
        const polylineSymbol = {
          type: "simple-line",
          // autocasts as new SimpleLineSymbol()
          color: this.color,
          width: "4",
          style: "solid",
          outline: {
            color: this.color,
            width: 1
          }
        };
        const polygonSymbol = {
          type: "simple-fill",
          // autocasts as new SimpleFillSymbol()
          color: this.color,
          style: "solid",
          outline: {
            color: this.color,
            width: 1
          }
        };
        this.layerAssets[0].graphicLayer.id = "tempGraphics";
        this.sketchViewModel = new this.lib.SketchViewModel({
          view: this.mapView,
          layer: this.layerAssets[0].graphicLayer,
          updateOnGraphicClick: false,
          pointSymbol,
          polylineSymbol,
          polygonSymbol
        });
        this.finalColor = this.color;
        this.tempColor = "blue";
        this.setSketchColor(this.tempColor, this.finalColor);
        if (coordinates2 && coordinates2.features) {
          let fullExtent = null;
          try {
            for (let i2 = 0; i2 < coordinates2.features.length; i2++) {
              const json = coordinates2.features[i2];
              const type = json.geometry.type;
              let idx = i2 + "";
              let extent = null;
              if (type === "Point") {
                let g1 = this.createPointNormal(json.geometry.coordinates[0], json.geometry.coordinates[1], pointSymbol);
                g1 = this.sketchItemSetAttribute(g1, "single", this.color, "blue", idx);
                this.sketchViewModel.layer.add(g1);
                this.drawingShapeSingle.push(g1);
                extent = new this.lib.Extent({
                  xmin: g1.geometry.x,
                  ymin: g1.geometry.y,
                  xmax: g1.geometry.x,
                  ymax: g1.geometry.y
                });
                if (extent) {
                  if (!fullExtent) {
                    fullExtent = extent.clone();
                  } else {
                    fullExtent.union(extent);
                  }
                }
              } else if (type === "LineString") {
                let g2 = this.createLineNormal(json.geometry.coordinates, polylineSymbol);
                g2.geometry = this.lib.webMercatorUtils.geographicToWebMercator(g2.geometry);
                g2 = this.sketchItemSetAttribute(g2, "single", this.color, "blue", idx);
                this.sketchViewModel.layer.add(g2);
                this.drawingShapeSingle.push(g2);
                extent = g2.geometry.extent;
                if (extent) {
                  if (!fullExtent) {
                    fullExtent = extent.clone();
                  } else {
                    fullExtent.union(extent);
                  }
                }
              } else if (type === "Polygon") {
                let g3 = this.createPolygonNormal(json.geometry.coordinates, polygonSymbol);
                g3.geometry = this.lib.webMercatorUtils.geographicToWebMercator(g3.geometry);
                g3 = this.sketchItemSetAttribute(g3, "single", this.color, "blue", idx);
                this.sketchViewModel.layer.add(g3);
                this.drawingShapeSingle.push(g3);
                extent = g3.geometry.extent;
                if (extent) {
                  if (!fullExtent) {
                    fullExtent = extent.clone();
                  } else {
                    fullExtent.union(extent);
                  }
                }
              } else if (type === "MultiPoint") {
                for (let j1 = 0; j1 < json.geometry.coordinates.length; j1++) {
                  idx = idx + j1;
                  const coor = json.geometry.coordinates[j1];
                  let g4 = this.createPointNormal(coor[0], coor[1], pointSymbol);
                  g4.symbol.color = this.multiColor;
                  g4.symbol.outline.color = this.multiColor;
                  g4 = this.sketchItemSetAttribute(g4, "multi", this.multiColor, "green", idx);
                  this.sketchViewModel.layer.add(g4);
                  this.drawingShapeMulti.point.push(g4);
                  extent = new this.lib.Extent({
                    xmin: g4.geometry.x,
                    ymin: g4.geometry.y,
                    xmax: g4.geometry.x,
                    ymax: g4.geometry.y
                  });
                  if (extent) {
                    if (!fullExtent) {
                      fullExtent = extent.clone();
                    } else {
                      fullExtent.union(extent);
                    }
                  }
                }
              } else if (type === "MultiLineString") {
                for (let j2 = 0; j2 < json.geometry.coordinates.length; j2++) {
                  idx = idx + j2;
                  const coor = json.geometry.coordinates[j2];
                  let g5 = this.createLineNormal(coor, polylineSymbol);
                  g5.geometry = this.lib.webMercatorUtils.geographicToWebMercator(g5.geometry);
                  g5.symbol.color = this.multiColor;
                  g5.symbol.outline.color = this.multiColor;
                  g5 = this.sketchItemSetAttribute(g5, "multi", this.multiColor, "green", idx);
                  this.sketchViewModel.layer.add(g5);
                  this.drawingShapeMulti.line.push(g5);
                  extent = g5.geometry.extent;
                  if (extent) {
                    if (!fullExtent) {
                      fullExtent = extent.clone();
                    } else {
                      fullExtent.union(extent);
                    }
                  }
                }
              } else if (type === "MultiPolygon") {
                for (let j = 0; j < json.geometry.coordinates.length; j++) {
                  idx = idx + j;
                  const coor = json.geometry.coordinates[j];
                  let g = this.createPolygonNormal(coor, polygonSymbol);
                  g.geometry = this.lib.webMercatorUtils.geographicToWebMercator(g.geometry);
                  g.symbol.color = this.multiColor;
                  g.symbol.outline.color = this.multiColor;
                  g = this.sketchItemSetAttribute(g, "multi", this.multiColor, "green", idx);
                  this.sketchViewModel.layer.add(g);
                  this.drawingShapeMulti.polygon.push(g);
                  extent = g.geometry.extent;
                  if (extent) {
                    if (!fullExtent) {
                      fullExtent = extent.clone();
                    } else {
                      fullExtent.union(extent);
                    }
                  }
                }
              }
            }
            if (fullExtent) {
              fullExtent.spatialReference = this.mapView.spatialReference;
              this.mapView.goTo(fullExtent);
            }
          } catch (err) {
            console.log(err);
          }
        }
        this.sketchViewModel.on("create", (event) => {
          if (event.state === "complete") {
            const idx = (/* @__PURE__ */ new Date()).toISOString();
            event.graphic = this.sketchItemSetAttribute(event.graphic, this.drawingMode, this.finalColor, this.tempColor, idx);
            if (this.drawingMode === "single") {
              this.drawingShapeSingle.push(event.graphic);
            } else {
              const geomType = event.graphic.geometry.type;
              if (geomType === "point") {
                this.drawingShapeMulti.point.push(event.graphic);
              } else if (geomType === "polyline") {
                this.drawingShapeMulti.line.push(event.graphic);
              } else if (geomType === "polygon") {
                this.drawingShapeMulti.polygon.push(event.graphic);
              }
            }
            if (this.drawBtn) {
              this.drawBtn.click();
              setTimeout(() => {
                this.drawBtn.click();
              }, 100);
            }
            if (this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
              this.setDirtyFunction();
            }
          }
        });
        this.sketchViewModel.on("update", (event) => {
          if (this.actionType === "select") {
            if (this.sketchViewModel.updateGraphics.length !== 1 || event.tool == null) {
              this.sketchViewModel.complete();
              this.editGraphic = null;
              return;
            }
            if (event.state === "complete" || event.state === "cancel") {
              this.editGraphic = null;
            }
            if ((event.state === "start" || event.state === "complete" || event.state === "cancel") && this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
              this.setDirtyFunction();
            }
            return;
          } else {
            console.log("invalid action for sc-boundary");
          }
        });
      }
      this.mapLoaded = true;
      const findBtnZoom = setInterval(() => {
        this.divZoomIn = document.querySelector('[title="Zoom in"]');
        if (this.divZoomIn) {
          clearInterval(findBtnZoom);
          this.divZoomIn.title = "Zoom In (" + this.mapView.zoom + ")";
          this.divZoomOut = document.querySelector('[title="Zoom out"]');
          this.divZoomOut.title = "Zoom Out (" + this.mapView.zoom + ")";
        }
      }, 200);
      if (this.ActionControls.length > 0) {
        const height = 32;
        const width = 32;
        this.divCustomControl = document.createElement("DIV");
        this.divCustomControl.id = "customControl";
        this.customControlHeight = 0;
        this.isBottom = false;
        if (this.type === 0 && this.heightNum < 3 || this.type === 3 && this.heightNum === 1) {
          this.isBottom = true;
        }
        for (let i2 = 0; i2 < this.ActionControls.length; i2++) {
          for (let j = 0; j < this.ActionControls[i2].childNodes.length; j++) {
            for (let k = 0; k < this.ActionControls[i2].childNodes[j].childNodes.length; k++) {
              this.ActionControls[i2].childNodes[j].childNodes[k].style.width = width + "px";
              this.ActionControls[i2].childNodes[j].childNodes[k].style.height = height + "px";
            }
            this.customControlHeight += this.ActionControls[i2].childNodes[j].childNodes.length * height;
            if (this.isBottom) {
              this.ActionControls[i2].childNodes[j].style.display = "flex";
            } else {
              this.ActionControls[i2].childNodes[j].style.display = "grid";
            }
            this.divCustomControl.appendChild(this.ActionControls[i2].childNodes[j]);
          }
        }
        initObj.target.appendChild(this.divCustomControl);
        this.elementCtrl.classList.add("gis-custom-control");
        if (this.isBottom) {
          const css = {
            // position: 'relative',
            "z-index": 1e3,
            // , left: '10px'
            width: this.elementCtrl.offsetWidth + "px"
            // , height: height + 'px'
            // , bottom: '35px'
            // , display: 'flex'
          };
          Object.assign(this.divCustomControl.style, css);
          this.mapView.ui.add(this.divCustomControl, "bottom-left");
        } else {
          const css = {
            // position: 'absolute',
            "z-index": 1e3,
            // , left: '10px'
            height: this.elementCtrl.offsetHeight + "px"
            // , width: width + 'px'
            // , top: (this.mapView.height - 45 - this.customControlHeight / 2) + 'px'
            // , display: 'grid'
          };
          Object.assign(this.divCustomControl.style, css);
          this.mapView.ui.add(this.divCustomControl, "top-left");
          this.elementCtrl.style.top = (this.mapView.height - 45) / 2 - this.customControlHeight / 2 + "px";
        }
      }
      if (this.fitCoors) {
        this.fitCoordsAction();
        if (this.type === 2 && this.marker) {
          this.clampZoomFloor();
        }
      }
      if (this.setupMapDone && typeof this.setupMapDone === "function") {
        this.setupMapDone();
      }
      this.isMapReady = true;
    }).bind(this)).catch(function(err) {
      console.log(err);
    });
  }
  createPointNormal(lon, lat, symbol) {
    const g = new this.lib.Graphic({
      geometry: {
        type: "point",
        longitude: lon,
        latitude: lat,
        spatialReference: this.mapView.spatialReference
      },
      symbol
    });
    return g;
  }
  createLineNormal(coords, symbol) {
    const g = new this.lib.Graphic({
      geometry: {
        type: "polyline",
        paths: coords,
        spatialReference: this.mapView.spatialReference
      },
      symbol
    });
    return g;
  }
  createPolygonNormal(coords, symbol) {
    const g = new this.lib.Graphic({
      geometry: {
        type: "polygon",
        rings: coords,
        spatialReference: this.mapView.spatialReference
      },
      symbol
    });
    return g;
  }
  sketchItemSetAttribute(graphic, realType, finalColor, tempColor, idx) {
    graphic.attributes = {
      finalColor,
      tempColor,
      realType,
      idx
    };
    return graphic;
  }
  showHeatLayer(zoom) {
    for (const f in this.heatLayerConfig) {
      if (this.heatLayerConfig[f].zoomLevel) {
        if (zoom < this.heatLayerConfig[f].zoomLevel) {
          this.layerAssets[f].graphicLayer.visible = false;
        } else {
          this.layerAssets[f].graphicLayer.visible = true;
        }
      }
    }
  }
  checkIsFullScreenSupport() {
    const body = document.body;
    return !!(body.webkitRequestFullscreen || body.mozRequestFullScreen || body.msRequestFullscreen || body.requestFullscreen);
  }
  mapMoveEnd(moveEndFunc) {
    this.lib.watchUtils.whenTrue(this.mapView, "stationary", () => {
      if (this.mapView.extent) {
        const debugleftTop = this.lib.webMercatorUtils.xyToLngLat(this.mapView.extent.xmin, this.mapView.extent.ymin);
        const debugrightBottom = this.lib.webMercatorUtils.xyToLngLat(this.mapView.extent.xmax, this.mapView.extent.ymax);
        console.log("%c MAP IS MOVED, min = " + debugleftTop + ", max = " + debugrightBottom, "color:blue");
        if (this.fitCoors && this.fitCoors.length > 0) {
          this.fitCoors = null;
          let currentZoom = this.mapView.zoom;
          if (this.type === 3) {
            if (this.fitCoordCount === 1) {
              currentZoom = currentZoom - 2;
              if (currentZoom < 0) {
                currentZoom = 1;
              }
              this.mapView.zoom = currentZoom;
            }
          } else if (this.type === 1) {
            if (this.initialZoomChange && this.initialZoomChange !== 0) {
              currentZoom += this.initialZoomChange;
              this.mapView.zoom = currentZoom;
            }
          }
          if (this.mapView.zoom < 0) {
            this.mapView.zoom = 1;
          }
          console.log("%c after FIT, zoom = " + this.mapView.zoom, "color:blue");
          this.clampZoomFloor();
          console.log("%c |===> after clampZoomFloor, zoom = " + this.mapView.zoom, "color:blue");
        }
        if (moveEndFunc && typeof moveEndFunc === "function") {
          moveEndFunc();
        }
      }
    });
  }
  createTextStyle(label, color2, type) {
  }
  getAnchor(icon, anchor2) {
    if ((icon === sclMapConstant.MAP_MARKER || icon === sclMapConstant.MAP_PRIMARY_ASSET || icon === sclMapConstant.MAP_SECONDARY_ASSET) && anchor2 == null) {
      anchor2 = [0.5, 1];
    }
    if (anchor2 == null) {
      anchor2 = [0.5, 0.5];
    }
    return anchor2;
  }
  // copy from sclStyleUtil
  getPointStyle(color2, icon, imageAnchor, geom, label, t) {
  }
  getMultiPointStyle(properties2) {
  }
  getLineStyle(pColor, properties2, geom, t) {
  }
  lableStyle(geom, label, color2, t) {
  }
  colorWithAlpha(color2, alpha) {
  }
  addStyleControlButton(btn) {
    btn.onmouseover = function() {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "lightgrey";
    };
    btn.onmouseout = function() {
      if (btn.style.backgroundColor === "grey") {
        return;
      }
      btn.style.backgroundColor = "white";
    };
  }
  initializeMap(ConfigService3, controls, target, view, interactions, disableMouseWheel, mapLayers, multiLayers) {
  }
  addInteractionSnap() {
  }
  removeInteractionSnap() {
  }
  drawDefaultStyle(drawStart, drawEnd) {
  }
  drawPrimaryStyle(drawStart, drawEnd) {
  }
  drawCustomStyle(drawStart, drawEnd) {
  }
  addInteractionDraw(drawStart, drawEnd) {
    if (drawStart && drawEnd) {
      this.interactionDraw = this.mapView.on("click", (event) => {
        this.mapView.hitTest(event.screenPoint).then((response) => {
          const features = [];
          const graphics = response.results;
          graphics.forEach((graphic) => {
            const att = graphic.graphic.attributes;
            if (att && att.isAsset && !att.layerDisplayOnly) {
              features.push(graphic.graphic);
            }
          });
          const mp = this.lib.webMercatorUtils.webMercatorToGeographic(event.mapPoint);
          const obj = { event, clickFeature: features, latLng: { lat: mp.y, lng: mp.x } };
          drawStart(obj);
          drawEnd(obj);
        });
      });
    }
  }
  removeInteractionDraw() {
    if (this.interactionDraw) {
      this.interactionDraw.remove();
    }
  }
  // use for sc-address-map
  setLayerSelectAsset(event) {
    const style2 = this.layerAssets[this.layerIndexUser].style;
    this.mapView.hitTest(event.screenPoint).then((response) => {
      let fs = [];
      if (this.multipleSelection) {
        const graphics = response.results;
        graphics.forEach((graphic) => {
          const att = graphic.graphic.attributes;
          if (att && att.isAsset && !att.layerDisplayOnly) {
            fs.push(graphic.graphic);
          }
        });
        fs = this.getFeaturesCollection({ feature: fs });
        if (fs.length > 0) {
          let isDirty = false;
          let lstAdd = [];
          let isRemove = false;
          for (let i2 = 0; i2 < fs.length; i2++) {
            const f = fs[i2].feature;
            const fId = this.getFeatureId(f);
            let added = false;
            let lb;
            for (let k = this.selectedFeatures.length - 1; k > -1; k--) {
              const kId = this.getFeatureId(this.selectedFeatures[k]);
              if (kId === fId) {
                added = true;
                if (f.attributes.zIndex === this.layerIndexUser) {
                  isRemove = true;
                  this.selectedFeatures.splice(k, 1);
                  if (f.attributes.lb) {
                    lb = f.attributes.lb;
                  }
                  this.layerAssets[this.layerIndexUser].graphicLayer.graphics.remove(f);
                }
              }
            }
            if (added) {
              lstAdd = [];
            } else {
              lstAdd.push(f);
            }
          }
          if (isRemove) {
            isDirty = true;
            lstAdd = [];
          }
          lstAdd.forEach((f, j) => {
            const g = f.clone();
            g.attributes.zIndex = this.layerIndexUser;
            if (g.attributes.type === "Point" || g.attributes.type === "MultiPoint") {
              if (style2.imageFileNo) {
                g.symbol.url = style2.imageFileNo;
              }
            }
            if (g.attributes.lb) {
              delete g.attributes.lb;
            }
            this.selectedFeatures.push(g);
            this.addFeature(g, this.layerIndexUser);
            isDirty = true;
          });
          if (isDirty && this.setDirtyFunction) {
            this.setDirtyFunction(this.selectedFeatures);
          }
        }
      } else {
        if (this.funcSingleSelectMode) {
          const graphics = response.results;
          graphics.forEach((graphic) => {
            const att = graphic.graphic.attributes;
            if (att && att.isAsset) {
              fs.push(graphic.graphic);
            }
          });
          let fea;
          if (fs.length > 0) {
            fea = fs[0];
          }
          this.funcSingleSelectMode({ fea });
        }
      }
    });
  }
  setSketchColor(sketchColor, graphicColor) {
    this.sketchViewModel.activeFillSymbol.color = sketchColor;
    this.sketchViewModel.activePointSymbol.color = sketchColor;
    this.sketchViewModel.activeLineSymbol.color = sketchColor;
    this.sketchViewModel.updatePolygonSymbol.color = sketchColor;
    this.sketchViewModel.updatePolylineSymbol.color = sketchColor;
    this.sketchViewModel.updatePointSymbol.color = sketchColor;
    this.sketchViewModel.activeVertexSymbol.color = sketchColor;
    this.sketchViewModel.pointSymbol.color = graphicColor;
    this.sketchViewModel.pointSymbol.outline.color = graphicColor;
    this.sketchViewModel.polylineSymbol.color = graphicColor;
    this.sketchViewModel.polylineSymbol.outline.color = graphicColor;
    this.sketchViewModel.polygonSymbol.color = graphicColor;
    this.sketchViewModel.polygonSymbol.outline.color = graphicColor;
  }
  // use for sc-boundary
  drawActionClickMap(event) {
    this.mapView.hitTest(event).then((response) => {
      const graphics = response.results;
      if (graphics && graphics.length > 0) {
        let isDelete = false;
        for (let i2 = 0; i2 < graphics.length; i2++) {
          const g = graphics[i2];
          if (!this.editGraphic && g && g.graphic && g.graphic.layer.id === "tempGraphics" && this.actionType === "select") {
            this.editGraphic = g.graphic;
            this.sketchViewModel.layer.add(this.editGraphic);
            const finalColor = this.editGraphic.attributes.finalColor;
            const tempColor = this.editGraphic.attributes.tempColor;
            this.sketchViewModel.complete();
            this.sketchViewModel.update([this.editGraphic], {
              tool: "reshape",
              toggleToolOnClick: true
            });
            this.setSketchColor(tempColor, finalColor);
            break;
          }
          if (g.graphic.layer.id !== "tempGraphics") {
            this.sketchViewModel.complete();
          }
          if (this.actionType === "delete") {
            if (g && g.graphic && g.graphic.attributes) {
              const idx = g.graphic.attributes.idx;
              if (g.graphic.attributes.realType === "single") {
                for (let i1 = 0; i1 < this.drawingShapeSingle.length; i1++) {
                  const item = this.drawingShapeSingle[i1];
                  if (item.attributes && item.attributes.idx === idx) {
                    this.drawingShapeSingle.splice(i1, 1);
                    break;
                  }
                }
              } else {
                if (g.graphic.geometry.type === "point") {
                  for (let i22 = 0; i22 < this.drawingShapeMulti.point.length; i22++) {
                    const item = this.drawingShapeMulti.point[i22];
                    if (item.attributes && item.attributes.idx === idx) {
                      this.drawingShapeMulti.point.splice(i22, 1);
                      break;
                    }
                  }
                } else if (g.graphic.geometry.type === "polyline") {
                  for (let i3 = 0; i3 < this.drawingShapeMulti.line.length; i3++) {
                    const item = this.drawingShapeMulti.line[i3];
                    if (item.attributes && item.attributes.idx === idx) {
                      this.drawingShapeMulti.line.splice(i3, 1);
                      break;
                    }
                  }
                } else if (g.graphic.geometry.type === "polygon") {
                  for (let i4 = 0; i4 < this.drawingShapeMulti.polygon.length; i4++) {
                    const item = this.drawingShapeMulti.polygon[i4];
                    if (item.attributes && item.attributes.idx === idx) {
                      this.drawingShapeMulti.polygon.splice(i4, 1);
                      break;
                    }
                  }
                }
              }
              this.sketchViewModel.layer.remove(g.graphic);
              isDelete = true;
            } else {
              console.log("error, this graphic is invalid");
            }
          }
        }
        if (isDelete && this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
          this.setDirtyFunction();
        }
      }
    });
  }
  addInteraction() {
  }
  btnAddEvent(btn) {
  }
  deselectAllControlBtn(currentBtnId) {
    if (this.sketchViewModel) {
      this.sketchViewModel.cancel();
    }
    for (let i2 = 0; i2 < this.controlBtns.length; i2++) {
      if (this.controlBtns[i2].id === currentBtnId) {
        continue;
      }
      this.controlBtns[i2].style.backgroundColor = "white";
    }
  }
  modeAction(e) {
    if (this.drawingMode === "single") {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Multi mode";
      }
      this.drawingMode = "multi";
      this.modeLabel.innerHTML = "layers";
      this.tempColor = "green";
      this.finalColor = this.multiColor;
    } else {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Single mode";
      }
      this.drawingMode = "single";
      this.modeLabel.innerHTML = "layers_clear";
      this.tempColor = "blue";
      this.finalColor = this.color;
    }
    this.actionType = "mode";
    this.setSketchColor(this.tempColor, this.finalColor);
    this.deselectAllControlBtn(e.currentTarget.id);
  }
  selectAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = "select";
    }
  }
  pointAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    this.drawBtn = e.currentTarget;
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
      this.sketchViewModel.cancel();
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = "drawPoint";
      this.sketchViewModel.create("point");
    }
  }
  polygonAction(e) {
    this.drawBtn = e.currentTarget;
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
      this.sketchViewModel.cancel();
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = "drawPolygon";
      this.sketchViewModel.create("polygon");
    }
  }
  lineAction(e) {
    this.drawBtn = e.currentTarget;
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
      this.sketchViewModel.cancel();
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = "drawLine";
      this.sketchViewModel.create("polyline");
    }
  }
  deleteAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
    } else {
      this.actionType = "delete";
      e.currentTarget.style.backgroundColor = "grey";
    }
    if (this.setDirtyFunction) {
      this.setDirtyFunction();
    }
  }
  locationAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = "";
    } else {
      this.actionType = "location";
      e.currentTarget.style.backgroundColor = "grey";
    }
  }
  // clone from sclMapViews.addRadioButton and have modify
  addRadioButton(document2, element, layers, compId) {
  }
  addMapViewControl(element, mapViewLayers, compId, layerIds) {
  }
  // call this function for draw on map
  addControlDraw(compId, pOptions, cb) {
    const layerIds = [];
    const element = document.createElement("div");
    let btnId = compId + "Mode";
    this.modeLabel = document.createElement("i");
    this.modeLabel.setAttribute("class", "material-icons");
    this.modeLabel.innerHTML = this.drawingMode === "single" ? "layers_clear" : "layers";
    const modeBtn = sclMapViews3.createUIButton(document, this.modeAction.bind(this), "ol-has-tooltip", this.drawingMode === "single" ? "Single mode" : "Multi mode", null);
    modeBtn.appendChild(this.modeLabel);
    modeBtn.id = btnId;
    layerIds.push(modeBtn.id);
    btnId = compId + "Select";
    const selectBtn = sclMapViews3.createUIButton(document, this.selectAction.bind(this), "ol-has-tooltip", "Select", null);
    let iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "create";
    selectBtn.appendChild(iSpan);
    selectBtn.id = btnId;
    layerIds.push(selectBtn.id);
    btnId = compId + "Point";
    const pointBtn = sclMapViews3.createUIButton(document, this.pointAction.bind(this), "ol-has-tooltip", "Point", null);
    iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "pin_drop";
    pointBtn.appendChild(iSpan);
    pointBtn.id = btnId;
    layerIds.push(pointBtn.id);
    btnId = compId + "Line";
    const lineBtn = sclMapViews3.createUIButton(document, this.lineAction.bind(this), "ol-has-tooltip", "Line", null);
    iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "linear_scale";
    lineBtn.appendChild(iSpan);
    lineBtn.id = btnId;
    layerIds.push(lineBtn.id);
    btnId = compId + "Polygon";
    const polygonBtn = sclMapViews3.createUIButton(document, this.polygonAction.bind(this), "ol-has-tooltip", "Polygon", null);
    iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "turned_in_not";
    polygonBtn.appendChild(iSpan);
    polygonBtn.id = btnId;
    layerIds.push(polygonBtn.id);
    btnId = compId + "CurrentLocation";
    const locationBtn = sclMapViews3.createUIButton(document, this.locationAction.bind(this), "ol-has-tooltip", "Current Location", null);
    iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "my_location";
    locationBtn.appendChild(iSpan);
    locationBtn.id = btnId;
    layerIds.push(locationBtn.id);
    btnId = compId + "Delete";
    const deleteBtn = sclMapViews3.createUIButton(document, this.deleteAction.bind(this), "ol-has-tooltip", "Delete", null);
    iSpan = document.createElement("i");
    iSpan.setAttribute("class", "material-icons");
    iSpan.innerHTML = "delete";
    deleteBtn.appendChild(iSpan);
    deleteBtn.id = btnId;
    layerIds.push(deleteBtn.id);
    const elementCtrl = document.createElement("div");
    elementCtrl.className = "select-action ol-control custom-control";
    elementCtrl.appendChild(modeBtn);
    elementCtrl.appendChild(selectBtn);
    elementCtrl.appendChild(pointBtn);
    elementCtrl.appendChild(lineBtn);
    elementCtrl.appendChild(polygonBtn);
    elementCtrl.appendChild(locationBtn);
    elementCtrl.appendChild(deleteBtn);
    this.elementCtrl = elementCtrl;
    this.controlBtns = [modeBtn, selectBtn, pointBtn, lineBtn, polygonBtn, locationBtn, deleteBtn];
    this.btnAddEvent(modeBtn);
    this.btnAddEvent(selectBtn);
    this.btnAddEvent(pointBtn);
    this.btnAddEvent(lineBtn);
    this.btnAddEvent(polygonBtn);
    this.btnAddEvent(locationBtn);
    this.btnAddEvent(deleteBtn);
    element.appendChild(elementCtrl);
    this.ActionControls.push(element);
    if (cb && typeof cb === "function") {
      cb(layerIds);
    }
  }
  // test redraw layers
  testRedraw(e) {
  }
  addTestBtn(element) {
  }
  addControl(ActionControl, element, options) {
    this.ActionControls.push(element);
  }
  setupControl(ActionControl) {
  }
  mapClickEvent(cb) {
    this.mapView.on("click", (evt) => {
      if (this.type === 0) {
        this.drawActionClickMap(evt);
      } else if (this.type === 1) {
        this.setLayerSelectAsset(evt);
      } else {
        evt.latLng = { lat: evt.mapPoint.latitude, lng: evt.mapPoint.longitude };
        if (cb && typeof cb === "function") {
          cb(evt);
        }
      }
    });
  }
  mapPointerMoveEvent(cb) {
    this.mapView.on("pointer-move", (event) => {
      this.mapView.hitTest(event).then((response) => {
        const lst = response.results.filter((result) => {
          return result.graphic.attributes && result.graphic.attributes.isAsset;
        });
        if (this.mouseHoverFeature) {
          this.layerAssets[this.mouseHoverFeature.attributes.zIndex].graphicLayer.graphics.remove(this.mouseHoverFeature);
          this.mouseHoverFeature = null;
        }
        if (lst && lst.length > 0) {
          try {
            this.mouseHoverFeature = lst[0].graphic.clone();
          } catch (err) {
            console.log("err = " + err);
          }
        }
        if (this.mouseHoverFeature) {
          if (this.type === 3) {
            let color2 = "#0099FF";
            if (this.compActionType === "primary") {
              color2 = "limegreen";
            } else if (this.compActionType === "secondary") {
              color2 = "black";
            } else {
              if (this.toolTipOnFeatureHover && typeof this.toolTipOnFeatureHover === "function") {
                this.toolTipOnFeatureHover(this.mouseHoverFeature);
              }
            }
            if (this.mouseHoverFeature.attributes.type !== "Point") {
              if (this.mouseHoverFeature.attributes.type === "LineString" || this.mouseHoverFeature.attributes.type === "MultiLineString" || this.mouseHoverFeature.attributes.type === "Polyline") {
                this.mouseHoverFeature.symbol.color = color2;
              } else {
                this.mouseHoverFeature.symbol.outline.color = color2;
                this.mouseHoverFeature.symbol.color = "white";
                this.mouseHoverFeature.symbol.color.a = 0.5;
              }
              this.layerAssets[this.mouseHoverFeature.attributes.zIndex].graphicLayer.graphics.add(this.mouseHoverFeature);
            }
          }
          if (cb && typeof cb === "function") {
            cb({ fea: this.mouseHoverFeature, pixel: [event.x, event.y] });
          }
        }
      });
    });
  }
  getPointFeature(location2, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName) {
  }
  updateLocation(lat, lon, id2, image, name, proId, isMapClick) {
    if (!isMapClick) {
      this.mapView.center = [lon, lat];
    }
    if (this.marker) {
      this.removeFeature(this.marker, this.layerIndexAddress);
    }
    if (!image) {
      image = sclMapConstant.MAP_MARKER;
    }
    if (image && image.charAt(0) !== "/") {
      image = "/" + image;
    }
    this.marker = this.createPoint(lon, lat, { id: proId, image, name });
    this.addFeature(this.marker, this.layerIndexAddress);
  }
  removeLocation(feature) {
    if (feature && this.layerAssets[this.layerIndexAddress] && this.layerAssets[this.layerIndexAddress].graphicLayer) {
      this.layerAssets[this.layerIndexAddress].graphicLayer.graphics.remove(feature);
    }
    this.marker = null;
  }
  zoomToLocation(lat, lon) {
    this.mapView.goTo({
      center: [lon, lat],
      zoom: 20
    });
  }
  zoomToValue(zoomValue) {
    if (zoomValue) {
      this.mapView.goTo({
        zoom: zoomValue
      });
    }
  }
  // 14781
  centerDefault() {
    this.mapView.goTo({
      center: [this.defaultLon, this.defaultLat],
      zoom: 18
    });
  }
  // 14781
  fitLayersOLD(layersIndexFit, hasDefaultCoord) {
    let fullExtent = null;
    let count = 0;
    if (hasDefaultCoord) {
      const geometry2 = {
        type: "point",
        longitude: this.defaultLon,
        latitude: this.defaultLat
      };
      const extent = this.createExtentForPoint(geometry2);
      fullExtent = extent.clone();
      count++;
    }
    for (let i2 = 0; i2 < layersIndexFit.length; i2++) {
      const idx = layersIndexFit[i2];
      if (this.isHeatLayer(idx)) {
        continue;
      }
      const layer = this.layerAssets[idx].graphicLayer;
      const graphics = layer.graphics;
      for (let j = 0; j < graphics.length; j++) {
        const f = graphics.getItemAt(j);
        if (!f || !f.attributes || !f.attributes.isAsset || !f.geometry) {
          continue;
        }
        let extent = f.geometry.extent;
        if (f.geometry.type === "point") {
          extent = this.createExtentForPoint(f.geometry);
        }
        if (extent) {
          count++;
          if (!fullExtent) {
            fullExtent = extent.clone();
          } else {
            fullExtent.union(extent);
          }
        }
      }
    }
    if (fullExtent) {
      if (count === 1) {
        this.mapView.goTo({
          center: [fullExtent.xmin, fullExtent.ymin],
          zoom: 20
        });
      } else {
        this.mapView.goTo(fullExtent).then(function() {
        });
      }
    }
  }
  fitLayers(layersIndexFit, hasDefaultCoord) {
    let fullExtent = null;
    let count = 0;
    if (hasDefaultCoord) {
      const geometry2 = {
        type: "point",
        longitude: this.defaultLon,
        latitude: this.defaultLat
      };
      const extent = this.createExtentForPoint(geometry2);
      fullExtent = extent.clone();
      count++;
    }
    for (let i2 = 0; i2 < layersIndexFit.length; i2++) {
      const idx = layersIndexFit[i2];
      if (this.isHeatLayer(idx)) {
        continue;
      }
      const layer = this.layerAssets[idx].graphicLayer;
      const graphics = layer.graphics;
      if (graphics.length === 0) {
        continue;
      }
      const f0 = graphics.getItemAt(0);
      if (graphics.length === 1 && f0.geometry.type === "point") {
        const extent = this.createExtentForPoint(f0.geometry);
        this.mapView.goTo({
          center: [extent.xmin, extent.ymin],
          zoom: 20
        });
      } else {
        const e = graphics.map((g) => g.geometry).reduce((acc, geom) => ({
          xmin: Math.min(acc.xmin, geom.longitude),
          ymin: Math.min(acc.ymin, geom.latitude),
          xmax: Math.max(acc.xmax, geom.longitude),
          ymax: Math.max(acc.ymax, geom.latitude)
        }), {
          xmin: Number.MAX_SAFE_INTEGER,
          ymin: Number.MAX_SAFE_INTEGER,
          xmax: Number.MIN_SAFE_INTEGER,
          ymax: Number.MIN_SAFE_INTEGER
        });
        const extent = new this.lib.Extent(e);
        if (extent) {
          count++;
          this.mapView.extent = extent.expand(2);
        }
      }
    }
  }
  createMarkerAsset(lat, lon, id2, image, name, type) {
    let f = this.getFeatureById(id2);
    if (!f) {
      f = this.createPoint(lon, lat, { image, name, type: "Point" });
    }
    if (type) {
      f.attributes.assetType = type;
    }
    f.attributes.id = id2;
    if (type === sclMapConstant.ASSET_PRIMARY_TYPE) {
      this.addFeature(f, this.layerIndexPrimary);
      this.storeSelectedAssets(f, true);
    } else if (type === sclMapConstant.ASSET_SECONDARY_TYPE) {
      this.addFeature(f, this.layerIndexSecondary);
      this.storeSelectedAssets(f, false);
    } else {
      this.addFeature(f, this.layerIndexAddress);
    }
    return [lon, lat];
  }
  getGEOJSON(cb) {
    const geoJson = { type: "FeatureCollection", features: [] };
    if (this.drawingShapeSingle) {
      for (let i1 = 0; i1 < this.drawingShapeSingle.length; i1++) {
        const g = this.drawingShapeSingle[i1];
        const geomType = g.geometry.type;
        if (geomType === "point") {
          geoJson.features.push({
            type: "Feature",
            properties: null,
            geometry: {
              type: "Point",
              coordinates: [g.geometry.longitude, g.geometry.latitude]
            }
          });
        } else if (geomType === "polyline") {
          const coors1 = [];
          const path0 = g.geometry.paths[0];
          for (let j1 = 0; j1 < path0.length; j1++) {
            const xy1 = path0[j1];
            const lngLat1 = this.lib.webMercatorUtils.xyToLngLat(xy1[0], xy1[1]);
            coors1.push(lngLat1);
          }
          geoJson.features.push({
            type: "Feature",
            properties: null,
            geometry: {
              type: "LineString",
              coordinates: coors1
            }
          });
        } else if (geomType === "polygon") {
          const ring0 = g.geometry.rings[0];
          const coors2 = [[]];
          for (let j2 = 0; j2 < ring0.length; j2++) {
            const xy2 = ring0[j2];
            const lngLat = this.lib.webMercatorUtils.xyToLngLat(xy2[0], xy2[1]);
            coors2[0].push(lngLat);
          }
          geoJson.features.push({
            type: "Feature",
            properties: null,
            geometry: {
              type: "Polygon",
              coordinates: coors2
            }
          });
        }
      }
    }
    if (this.drawingShapeMulti) {
      if (this.drawingShapeMulti.point && this.drawingShapeMulti.point.length > 0) {
        const coors3 = [];
        for (let i1 = 0; i1 < this.drawingShapeMulti.point.length; i1++) {
          const g = this.drawingShapeMulti.point[i1];
          coors3.push([g.geometry.longitude, g.geometry.latitude]);
        }
        geoJson.features.push({
          type: "Feature",
          properties: null,
          geometry: {
            type: "MultiPoint",
            coordinates: coors3
          }
        });
      }
      if (this.drawingShapeMulti.line && this.drawingShapeMulti.line.length > 0) {
        const coors4 = [];
        for (let i2 = 0; i2 < this.drawingShapeMulti.line.length; i2++) {
          const g = this.drawingShapeMulti.line[i2];
          const lst = [];
          for (let j = 0; j < g.geometry.paths.length; j++) {
            const j0 = g.geometry.paths[j];
            for (let k = 0; k < j0.length; k++) {
              const xy = j0[k];
              const lngLat = this.lib.webMercatorUtils.xyToLngLat(xy[0], xy[1]);
              lst.push(lngLat);
            }
          }
          coors4.push(lst);
        }
        geoJson.features.push({
          type: "Feature",
          properties: null,
          geometry: {
            type: "MultiLineString",
            coordinates: coors4
          }
        });
      }
      if (this.drawingShapeMulti.polygon && this.drawingShapeMulti.polygon.length > 0) {
        const coors = [];
        for (let i2 = 0; i2 < this.drawingShapeMulti.polygon.length; i2++) {
          const g = this.drawingShapeMulti.polygon[i2];
          const lst = [];
          for (let j = 0; j < g.geometry.rings.length; j++) {
            const lst0 = [];
            const j0 = g.geometry.rings[j];
            for (let k = 0; k < j0.length; k++) {
              const xy = j0[k];
              const lngLat = this.lib.webMercatorUtils.xyToLngLat(xy[0], xy[1]);
              lst0.push(lngLat);
            }
            lst.push(lst0);
          }
          coors.push(lst);
        }
        geoJson.features.push({
          type: "Feature",
          properties: null,
          geometry: {
            type: "MultiPolygon",
            coordinates: coors
          }
        });
      }
    }
    if (cb && typeof cb === "function") {
      cb(geoJson);
    }
  }
  transformEPSG(long, lat, from2, to) {
  }
  checkMapEmpty(pCanvas) {
  }
  isHeatLayer(layerIndex) {
    if (layerIndex < this.layerAssets.length) {
      const isHeatMap = this.layerAssets[layerIndex].isHeatMap;
      if (isHeatMap) {
        return true;
      }
      return false;
    }
    return false;
  }
  setMinMax(minMax, lng, lat) {
    if (!lat || !lng) {
      return minMax;
    }
    if (lat < minMax.minLat) {
      minMax.minLat = lat;
    } else if (lat > minMax.maxLat) {
      minMax.maxLat = lat;
    }
    if (lng < minMax.minLng) {
      minMax.minLng = lng;
    } else if (lng > minMax.maxLng) {
      minMax.maxLng = lng;
    }
    return minMax;
  }
  // arcGIS unsupport extent for a point
  createExtentForPoint(geom) {
    const ext = new this.lib.Extent({
      xmin: geom.longitude,
      ymin: geom.latitude,
      xmax: geom.longitude,
      ymax: geom.latitude,
      spatialReference: 4326
    });
    return ext;
  }
  fit(ConfigService3, maxZoom, initialZoomChange, isCheckEmpty) {
    this.initialZoomChange = initialZoomChange;
    this.fitCoors = [];
    let fullExtent = null;
    let countAdd = 0;
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      const layer = this.layerAssets[i2].graphicLayer;
      const graphics = layer.graphics;
      for (let j = 0; j < graphics.length; j++) {
        const f = graphics.getItemAt(j);
        if (!f || !f.attributes || !f.attributes.isAsset || !f.geometry) {
          continue;
        }
        let extent = f.geometry.extent;
        if (f.geometry.type === "point") {
          extent = this.createExtentForPoint(f.geometry);
        }
        if (extent) {
          if (!fullExtent) {
            fullExtent = extent.clone();
          } else {
            fullExtent.union(extent);
          }
          countAdd++;
        }
      }
    }
    if (fullExtent) {
      console.log("%c arcGIS FIT, this.fitCoors = " + this.fitCoors + ", mapLoaded = " + this.mapLoaded, "color:blue");
      this.fitCoors.push([fullExtent.xmin, fullExtent.ymin]);
      this.fitCoors.push([fullExtent.xmax, fullExtent.ymax]);
      this.mapView.goTo(fullExtent).then(function() {
      });
    }
  }
  fitCoords(coords) {
    if (!coords || coords.length === 0) {
      return;
    }
    this.fitCoors = coords;
  }
  fitCoordsAction() {
    this.fitCoordCount = this.fitCoors.length;
    console.log("arcGIS fit action , type = " + this.type + ", fitCoordCount = " + this.fitCoordCount);
    if (this.fitCoordCount < 2) {
      if (this.fitCoordCount === 1) {
        this.mapView.goTo({
          center: this.fitCoors[0],
          zoom: this.zoomFloor
        });
      }
      this.fitCoors = null;
      return;
    }
    let xMin = this.fitCoors[0][0];
    let yMin = this.fitCoors[0][1];
    let xMax = this.fitCoors[0][0];
    let yMax = this.fitCoors[0][1];
    for (let i2 = 0; i2 < this.fitCoors.length; i2++) {
      const x = this.fitCoors[i2][0];
      const y = this.fitCoors[i2][1];
      if (x > xMax) {
        xMax = x;
      }
      if (x < xMin) {
        xMin = x;
      }
      if (y > yMax) {
        yMax = y;
      }
      if (y < yMin) {
        yMin = y;
      }
    }
    const leftTop = this.lib.webMercatorUtils.lngLatToXY(xMin, yMin);
    const rightBottom = this.lib.webMercatorUtils.lngLatToXY(xMax, yMax);
    const ext = new this.lib.Extent({
      xmin: leftTop[0],
      ymin: leftTop[1],
      xmax: rightBottom[0],
      ymax: rightBottom[1],
      spatialReference: this.mapView.spatialReference
    });
    this.mapView.extent = ext;
    let currentZoom = this.mapView.zoom;
    if (this.type === 3) {
      if (this.fitCoordCount === 1) {
        currentZoom = currentZoom - 2;
        if (currentZoom < 0) {
          currentZoom = 1;
        }
        this.mapView.zoom = currentZoom;
      }
    } else if (this.type === 1) {
      if (this.initialZoomChange && this.initialZoomChange !== 0) {
        currentZoom += this.initialZoomChange;
        this.mapView.zoom = currentZoom;
      }
    }
    if (this.mapView.zoom < 0) {
      this.mapView.zoom = 1;
    }
    console.log("%c fitCoord, mapZoom = " + this.mapView.zoom, "color:blue");
    this.clampZoomFloor();
    this.fitCoors = null;
    this.fitCoordCount = 0;
  }
  mapReadOnly(isReadOnly) {
  }
  getAllFeatures() {
    const features = [];
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      this.layerAssets[i2].graphicLayer.graphics.forEach((feature) => {
        if (feature.attributes && feature.attributes.isAsset) {
          features.push(feature);
        }
      });
    }
    return features;
  }
  getFeaturesFromMap(features, pixel, type, assetSelectionsAvailable) {
    let existedFeature;
    for (let i2 = features.length - 1; i2 > -1; i2--) {
      if (!features[i2] || !features[i2].attributes) {
        continue;
      }
      const zIndex = features[i2].attributes.zIndex;
      if (features[i2].attributes.id.indexOf(type) > -1) {
        existedFeature = features[i2];
        features.splice(i2, 1);
        continue;
      }
      if (type === "primary" && features[i2].attributes.id.indexOf("secondary") > -1 || type === "secondary" && features[i2].attributes.id.indexOf("primary") > -1) {
        features.splice(i2, 1);
        continue;
      }
      if (assetSelectionsAvailable) {
        const iAssetSelectionsAvailable = assetSelectionsAvailable[zIndex - 1 < 0 ? 0 : zIndex - 1];
        if (iAssetSelectionsAvailable != null && iAssetSelectionsAvailable.indexOf(type) < 0) {
          let sType = type;
          if (type != null && type.trim().length > 0) {
            sType = type.charAt(0).toUpperCase() + (type != null && sType.trim().length > 1 ? type.slice(1) : "");
          }
          console.log("sc-selected-asset: The assetSelectiosAvailable field is not set to allow " + sType + " selections for this layer");
          features.splice(i2, 1);
        }
      }
    }
    return existedFeature;
  }
  getAssetProperties(feature, relatedFields, coordinates2, typeAsset, typeSelection) {
    let name = "";
    let id2 = "";
    if (feature.attributes) {
      name = feature.attributes.name;
      id2 = feature.attributes.id;
    }
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (!typeSelection || typeSelection === "featureCollection") {
      asset.geometry = {
        type: "Point",
        coordinates: coordinates2
      };
    } else if (typeSelection !== "undefined" && typeSelection === SclMapConstantService.ASSET_SELECTION_MODE_ASSET) {
      const t = feature.attributes.type;
      asset.geometry = {
        type: t,
        coordinates: coordinates2
      };
    }
    if (!id2) {
      return "";
    }
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const value = feature.attributes[field];
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  removeUnselectedAssetItem(existAsset, assets, type) {
    if (existAsset) {
      let isExist = false;
      let idExistAsset = existAsset.properties.linkAssets[0].documentId;
      if (idExistAsset && idExistAsset.indexOf("_") > -1) {
        idExistAsset = idExistAsset.split("_")[0];
      }
      for (let j = 0; j < assets.length; j++) {
        const item = assets[j];
        let idItem = item.properties.linkAssets[0].documentId;
        if (!idItem) {
          continue;
        }
        if (idItem.indexOf("_") > -1) {
          idItem = idItem.split("_")[0];
        }
        if (idItem === idExistAsset) {
          assets.splice(j, 1);
          isExist = true;
        }
      }
      const len = this.selectedAssets.length;
      for (let i2 = len - 1; i2 > -1; i2--) {
        let iId = this.getFeatureId(this.selectedAssets[i2]);
        if (iId && iId.indexOf("_") > -1) {
          iId = iId.split("_")[0];
        }
        if (iId === idExistAsset) {
          const f = this.selectedAssets[i2];
          if (!f || !this.getFeatureId(f)) {
            continue;
          }
          if (type === "primary" && f.attributes.assetType.indexOf(type) > -1) {
            this.removeFeature(f, this.layerIndexPrimary);
            this.selectedAssets.splice(i2, 1);
            isExist = true;
          } else if (type === "secondary" && f.attributes.assetType.indexOf(type) > -1) {
            this.removeFeature(f, this.layerIndexSecondary);
            this.selectedAssets.splice(i2, 1);
            isExist = true;
          }
        }
      }
      return isExist;
    }
    return false;
  }
  parseAssetsFromFeatures(features, assetField, coor, typeAsset, mode) {
    if (mode === sclMapConstant.ASSET_SELECTION_MODE_ASSET) {
      return this.getAssetProperties(features, assetField.relatedFields, coor, typeAsset, mode);
    } else {
      const assets = [];
      for (let i2 = 0; i2 < features.length; i2++) {
        const asset = this.getAssetProperties(features[i2], assetField.relatedFields, coor[i2], typeAsset, null);
        if (!asset) {
          return;
        }
        assets.push(asset);
      }
      return assets;
    }
  }
  getAllFeaturesSelected() {
  }
  addInteractionSelect(currentSelected) {
    if (this.selectedFeatures == null || currentSelected != null && this.selectedFeatures.length !== currentSelected.length) {
      this.selectedFeatures = currentSelected;
    }
    this.multipleSelection = true;
  }
  removeInteractionSelect() {
    this.multipleSelection = false;
  }
  showLayer(options) {
    if (options.isShow) {
      this.layerAssets[options.layerIndex].graphicLayer.visible = true;
      this.addInteractionSelect(options.currentSelected);
    } else {
      this.layerAssets[options.layerIndex].graphicLayer.visible = false;
      this.removeInteractionSelect();
    }
  }
  activeInteractionSelect(isActive) {
    this.multipleSelection = isActive;
  }
  drawActionDelete(evt) {
  }
  drawActionProperties(evt) {
  }
  traverseCoor(coor, obj) {
    if (Array.isArray(coor)) {
      for (let i2 = 0; i2 < coor.length; i2++) {
        if (Array.isArray(coor[i2])) {
          this.traverseCoor(coor[i2], obj);
        } else {
          if (isNaN(coor[i2])) {
            obj.hasNaN = true;
          } else {
            coor[i2] = Number(coor[i2]);
          }
        }
      }
    }
  }
  createLabel(lat, lng, label, id2, color2) {
    const font = new this.lib.Font();
    font.size = !label.labelFontSize ? "12px" : typeof label.labelFontSize === "string" ? label.labelFontSize.replace("px", "") + "px" : label.labelFontSize + "px";
    if (label.labelFontWeight) {
      const weight = label.labelFontWeight.toLowerCase();
      if (weight === "italic") {
        font.style = weight;
      } else {
        font.weight = weight;
      }
    }
    font.family = label.labelFont ? label.labelFont : "Arial";
    const currentZoom = this.mapView.zoom;
    const displayZoom = label.labelDisplayZoom === "" || label.labelDisplayZoom == null ? 9 : label.labelDisplayZoom > 17 ? 17 : label.labelDisplayZoom;
    const text = currentZoom < displayZoom ? void 0 : label.labelText === "" || label.labelText == null ? void 0 : label.labelText;
    const textSymbol = new this.lib.TextSymbol(text);
    textSymbol.color = (label.labelColor ? label.labelColor : color2).toLowerCase();
    textSymbol.haloColor = label.labelOutlineColor ? label.labelOutlineColor.toLowerCase() : "black";
    textSymbol.haloSize = !label.labelOutlineWidth ? "0px" : typeof label.labelOutlineWidth === "string" ? label.labelOutlineWidth.replace("px", "") + "px" : label.labelOutlineWidth + "px";
    textSymbol.angle = label.labelRotation ? label.labelRotation : 0;
    if (this.textSymbolVerticalAlignment.indexOf(label.labelTextBaseline) > -1) {
      textSymbol.verticalAlignment = label.labelTextBaseline;
    } else {
      textSymbol.verticalAlignment = "baseline";
    }
    if (this.textSymbolHorizontalAlignment.indexOf(label.labelTextAlign) > -1) {
      textSymbol.horizontalAlignment = label.labelTextAlign;
    } else {
      textSymbol.horizontalAlignment = "center";
    }
    textSymbol.xoffset = !label.labelOffsetX ? "0px" : typeof label.labelOffsetX === "string" ? label.labelOffsetX.replace("px", "") + "px" : label.labelOffsetX + "px";
    textSymbol.yoffset = !label.labelOffsetY ? "0px" : typeof label.labelOffsetY === "string" ? label.labelOffsetY.replace("px", "") + "px" : label.labelOffsetY + "px";
    textSymbol.font = font;
    const pt = new this.lib.Point(lng, lat);
    const lb = new this.lib.Graphic(pt, textSymbol);
    lb.attributes = {
      id: "lb_" + id2,
      isAsset: false
    };
    return lb;
  }
  updateLabelAllLayers() {
  }
  setupPointSymbol(options) {
    let color2 = "black";
    let width = 1;
    if (options.color) {
      color2 = options.color;
    }
    if (options.width) {
      width = options.width;
    }
    color2 = new this.lib.Color(color2.toLowerCase());
    let symbol = {
      type: "simple-marker",
      color: color2,
      // orange
      outline: {
        color: color2,
        // white
        width
      }
    };
    if (options && options.image) {
      if (options.image.charAt(0) !== "/") {
        options.image = "/" + options.image;
      }
      let anchor2 = [0, 0];
      if (options.anchor) {
        anchor2 = options.anchor;
      }
      const size = 24;
      anchor2 = this.getAnchor(options.image, anchor2);
      let xoffset = 0;
      let yoffset = 0;
      if (anchor2) {
        xoffset = size * anchor2[0];
        yoffset = size * anchor2[1];
      }
      symbol = {
        type: "picture-marker",
        url: options.image,
        width: size,
        height: size,
        xoffset,
        yoffset
      };
    }
    return symbol;
  }
  // this.coorAnchor = function(coor, offset){
  //     let num = coor;
  //     let sN1 = num.toString().split('.')[0];
  //     let sN2 = num.toString().split('.')[1];
  //     let n2 = parseInt(sN2);
  //     n2 = n2 - offset;
  //     let sNewNum = sN1 + '.' + n2;
  //     let newNum = parseFloat(sNewNum);
  //     return newNum;
  // };
  coorAnchor(coor, offset2) {
    const num = coor;
    const sN1 = num.toString().split(".")[0];
    const sN2 = num.toString().split(".")[1];
    let n2 = parseInt(sN2, 10);
    n2 = n2 - offset2;
    const s = n2 + "";
    const len = sN2.length - s.length;
    let s2 = "";
    for (let i2 = 0; i2 < len; i2++) {
      s2 += "0";
    }
    s2 += n2;
    const sNewNum = sN1 + "." + s2;
    const newNum = parseFloat(sNewNum);
    return newNum;
  }
  createPoint(lng, lat, options) {
    const symbol = this.setupPointSymbol(options);
    if (options && options.image) {
      lat = this.coorAnchor(lat, symbol.yoffset);
      lng = this.coorAnchor(lng, symbol.xoffset);
    }
    const point = new this.lib.Graphic({
      geometry: {
        type: "point",
        longitude: lng,
        latitude: lat
      },
      symbol,
      attributes: {
        isAsset: true
      }
    });
    this.setFeatureProperties(point, options);
    return point;
  }
  createLine(coords, options) {
    let color2 = "black";
    let width = 1;
    if (options) {
      if (options.color) {
        color2 = options.color;
      }
      if (options.width) {
        width = options.width;
      }
    }
    color2 = new this.lib.Color(color2.toLowerCase());
    let cap = "square";
    let dash = "solid";
    if (options && options.layer) {
      if (options.layer.lineCap) {
        cap = options.layer.lineCap;
      }
      if (options.layer.lineDash) {
        dash = "dash";
      }
    }
    const line = new this.lib.Graphic({
      geometry: {
        type: "polyline",
        paths: coords
      },
      symbol: {
        type: "simple-line",
        color: color2,
        width,
        cap,
        style: dash
      },
      attributes: {
        isAsset: true
      }
    });
    this.setFeatureProperties(line, options);
    return line;
  }
  createPolygon(coords, options) {
    let color2 = "black";
    let outlineColor = "black";
    let width = 1;
    if (options) {
      if (options.color) {
        color2 = options.color;
      }
      if (options.width) {
        width = options.width;
      }
      if (options.fillColor) {
        outlineColor = options.fillColor;
      }
    }
    color2 = new this.lib.Color(color2.toLowerCase());
    outlineColor = new this.lib.Color(outlineColor.toLowerCase());
    let cap = "square";
    let dash = "solid";
    if (options && options.layer) {
      if (options.layer.lineCap) {
        cap = options.layer.lineCap;
      }
      if (options.layer.lineDash) {
        dash = "dash";
      }
    }
    const polygon = new this.lib.Graphic({
      geometry: {
        type: "polygon",
        rings: coords
      },
      symbol: {
        type: "simple-fill",
        color: color2,
        // orange, opacity 80%
        outline: {
          type: "simple-line",
          color: outlineColor,
          width,
          cap,
          style: dash
        }
      },
      attributes: {
        isAsset: true
      }
    });
    this.setFeatureProperties(polygon, options);
    return polygon;
  }
  createMultiPoint(coords, options) {
    if (options.image) {
      delete options.image;
    }
    const mpJson = { points: coords };
    const geom = new this.lib.Multipoint(mpJson);
    const symbol = this.setupPointSymbol(options);
    const obj = new this.lib.Graphic({
      geometry: geom,
      symbol,
      attributes: {
        isAsset: true
      }
    });
    this.setFeatureProperties(obj, options);
    obj.attributes.coordinatesData = coords;
    obj.attributes.type = "MultiPoint";
    return obj;
  }
  createMultiLineString(coords, options) {
    const obj = this.createLine(coords[0], options);
    obj.attributes.type = "MultiLineString";
    obj.attributes.coordinatesData = coords;
    for (let i2 = 1; i2 < coords.length; i2++) {
      obj.geometry.paths.push(coords[i2]);
    }
    return obj;
  }
  createMultiPolygon(coords, options) {
    const obj = this.createPolygon(coords[0], options);
    for (let i2 = 1; i2 < coords.length; i2++) {
      const p = this.createPolygon(coords[i2], options);
      obj.geometry.rings.push(p.geometry.rings[0]);
    }
    obj.attributes.type = "MultiPolygon";
    obj.attributes.coordinatesData = coords;
    return obj;
  }
  createFeatureByType(coord, type, options) {
    let feature;
    options.type = type;
    if (options.tooltips) {
      const tooltip = options.tooltips;
      options.tooltip = tooltip;
      delete options.tooltips;
    }
    if (type === "Point") {
      const lng = Number(coord[0]);
      const lat = Number(coord[1]);
      if (isNaN(lng) || isNaN(lat)) {
        return null;
      }
      let img = sclMapConstant.MAP_MARKER;
      if (options.point) {
        img = options.point;
      }
      if (options.imageFileNo) {
        if (options.imageFileNo === sclMapConstant.MAP_MARKER || options.imageFileNo === sclMapConstant.MAP_PRIMARY_ASSET || options.imageFileNo === sclMapConstant.MAP_SECONDARY_ASSET) {
          img = options.imageFileNo;
        } else {
          img = "/api/getFile/" + options.imageFileNo.replace("/api/getFile/", "");
        }
      }
      if (options.image) {
        img = options.image;
      }
      options.image = img;
      feature = this.createPoint(lng, lat, options);
      if (options.label) {
        feature.attributes.lb = this.createLabel(lat, lng, options.label, options.id, options.color);
      }
    } else {
      const hasNaN = false;
      const obj = { hasNaN };
      this.traverseCoor(coord, obj);
      if (obj.hasNaN) {
        return null;
      }
      if (type === "LineString" || type === "Polyline") {
        feature = this.createLine(coord, options);
      } else if (type === "Polygon") {
        feature = this.createPolygon(coord, options);
      } else if (type === "MultiPoint") {
        feature = this.createMultiPoint(coord, options);
      } else if (type === "MultiLineString") {
        feature = this.createMultiLineString(coord, options);
      } else if (type === "MultiPolygon") {
        feature = this.createMultiPolygon(coord, options);
      }
      let color2 = "purple";
      if (options.color) {
        color2 = options.color;
      }
      const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
      const url = options.url ? options.url : "";
      const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
      const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
      const properties2 = sclAssetLayers2.createLineProperties(options.layer, options.name, color2, options.id, options.tooltip, primaryMultiPopup, secondaryMultiPopup, options.layerDisplayOnly, relatedAssets, url);
      for (const p in properties2) {
        if (properties2.hasOwnProperty(p) && !feature.attributes.hasOwnProperty(p)) {
          feature.attributes[p] = properties2[p];
        }
      }
      if (options.label) {
        const coord1 = feature.geometry.extent.center;
        feature.attributes.lb = this.createLabel(coord1.latitude, coord1.longitude, options.label, options.id, options.color);
      }
    }
    if (options.layer) {
      feature.attributes.layer = options.layer;
    }
    return feature;
  }
  setFeatureProperties(feature, properties2) {
    if (!feature.attributes) {
      feature.attributes = {};
    }
    if (properties2) {
      for (const p in properties2) {
        if (properties2.hasOwnProperty(p)) {
          feature.attributes[p] = properties2[p];
        }
      }
    }
  }
  resetFeatureProperties(feature, properties2) {
    feature.attributes = properties2;
  }
  getFeatureProperty(feature, propertyName) {
    return feature.attributes[propertyName];
  }
  getFeatureProperties(feature, fieldNames) {
    const p = {};
    const pro = feature.attributes;
    for (let i2 = 0; i2 < fieldNames.length; i2++) {
      p[fieldNames[i2]] = pro[fieldNames[i2]];
    }
    return p;
  }
  getFeatureId(feature) {
    return feature.attributes.id;
  }
  setFeatureId(feature, id2) {
    feature.attributes.id = id2;
  }
  getFeatureGeomType(feature) {
    const t = feature.attributes.type;
    return t;
  }
  getFeatureById(id2) {
    let f = null;
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      const graphics = this.layerAssets[i2].graphicLayer.graphics;
      for (let j = 0; j < graphics.length; j++) {
        const fea = graphics.getItemAt(j);
        if (!fea || !fea.attributes || !fea.attributes.isAsset) {
          continue;
        }
        const fId = this.getFeatureId(fea);
        if (fId === id2) {
          f = fea;
          break;
        }
      }
      if (f) {
        break;
      }
    }
    return f;
  }
  getFeatureByLayer(id2, layerIndex) {
    if (layerIndex > this.layerAssets.length - 1) {
      return null;
    }
    if (this.isHeatLayer(layerIndex)) {
      return null;
    }
    let f = null;
    const graphics = this.layerAssets[this.layerIndexUser].graphicLayer.graphics;
    const len = graphics.length;
    for (let i2 = 0; i2 < len; i2++) {
      const fea = graphics.getItemAt(i2);
      const fId = this.getFeatureId(fea);
      if (fId === id2) {
        f = fea;
        return;
      }
    }
    return f;
  }
  getFeatureByPixel(pixel) {
    return { feature: pixel.fea };
  }
  featureClone(fea, layerIndex) {
    const g = fea.clone();
    if (g.attributes.lb) {
      delete g.attributes.lb;
    }
    if (layerIndex === this.layerIndexUser && g.attributes && (g.attributes.type === "Point" || g.attributes.type === "MultiPoint")) {
      const style2 = this.layerAssets[layerIndex].style;
      if (style2.imageFileNo) {
        g.symbol.url = style2.imageFileNo;
      }
    }
    return g;
  }
  getEventByPixel(pixel) {
  }
  getFeaturesCollection(options) {
    const lst = [];
    if (options.feature && options.feature.length > 0) {
      for (let i2 = 0; i2 < options.feature.length; i2++) {
        lst.push({ feature: options.feature[i2] });
        const fId = options.feature[i2].attributes.id;
        const zIndex = options.feature[i2].attributes.zIndex;
        if (this.isHeatLayer(zIndex)) {
          continue;
        }
        const layer = this.layerAssets[zIndex].graphicLayer.graphics;
        layer.forEach((graphic) => {
          const att = graphic.attributes;
          let id0 = att.id;
          if (att && att.id && att.id !== fId) {
            if (att.id.indexOf("_") > -1) {
              id0 = att.id.split("_")[0];
            }
            if (fId.indexOf(id0) > -1) {
              lst.push({ feature: graphic });
            }
          }
        });
      }
    }
    return lst;
  }
  getFeaturesCollectionId(id2, isClone) {
    const fs = [];
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      const graphics = this.layerAssets[i2].graphicLayer.graphics;
      graphics.forEach((f) => {
        if (f.attributes && f.attributes.isAsset) {
          const fId = f.attributes.id;
          if (fId && fId.indexOf(id2) > -1) {
            let isExist = false;
            for (let k = 0; k < fs.length; k++) {
              if (!fs[k].attributes) {
                continue;
              }
              if (fs[k].attributes.id === fId) {
                isExist = true;
                break;
              }
            }
            if (!isExist) {
              if (isClone) {
                const g = f.clone();
                if (g.attributes.lb) {
                  delete g.attributes.lb;
                }
                if (this.type === 1) {
                  const style2 = this.layerAssets[this.layerIndexUser].style;
                  if (style2.imageFileNo) {
                    g.symbol.url = style2.imageFileNo;
                  }
                }
                fs.push(g);
              } else {
                fs.push(f);
              }
            }
          }
        }
      });
    }
    return fs;
  }
  updateStyleByFeature(layerClone, color2, imageFileNo, anchor2, style2) {
    const currentStyle = (0, import_lodash6.cloneDeep)(style2);
    if (color2) {
      currentStyle.color = color2;
    }
    if (layerClone.fill) {
      currentStyle.fill = layerClone.fill;
    }
    if (layerClone.fillOpacity) {
      currentStyle.fillOpacity = layerClone.fillOpacity;
    }
    if (layerClone.lineCap) {
      currentStyle.lineCap = layerClone.lineCap;
    }
    if (layerClone.lineDash) {
      currentStyle.lineDash = layerClone.lineDash;
    }
    if (layerClone.lineWidth) {
      currentStyle.lineWidth = layerClone.lineWidth;
    }
    if (anchor2) {
      currentStyle.imageAnchor = anchor2;
    }
    if (imageFileNo) {
      currentStyle.imageFileNo = imageFileNo;
    }
    return currentStyle;
  }
  featureUpdateStyle(feature, style2) {
    if (feature.attributes && style2) {
      if (feature.attributes.type === "Point" || feature.attributes.type === "MultiPoint") {
        if (style2.fill && style2.fill.indexOf("{") > -1) {
          return;
        }
        if (style2.color) {
          feature.symbol.color = style2.color.toLowerCase();
        }
        if (style2.fill) {
          feature.symbol.color = style2.fill.toLowerCase();
        }
        if (style2.fillOpacity) {
          feature.symbol.color.a = style2.fillOpacity;
        }
        if (feature.symbol.outline) {
          if (style2.lineWidth) {
            feature.symbol.outline.width = style2.lineWidth;
          }
          if (style2.color) {
            feature.symbol.outline.color = style2.color.toLowerCase();
          }
        }
        if (style2.imageAnchor) {
          if (feature.symbol.width) {
            feature.symbol.xoffset = feature.symbol.width * style2.imageAnchor[0];
          }
          if (feature.symbol.height) {
            feature.symbol.yoffset = feature.symbol.height * style2.imageAnchor[1];
          }
        }
      } else if (feature.attributes.type === "LineString" || feature.attributes.type === "MultiLineString" || feature.attributes.type === "Polyline") {
        if (style2.color && style2.color.indexOf("{") > -1) {
          return;
        }
        if (style2.color) {
          feature.symbol.color = style2.color.toLowerCase();
        }
        if (style2.lineWidth) {
          feature.symbol.width = style2.lineWidth;
        }
        if (style2.lineCap) {
          feature.symbol.cap = style2.lineCap;
        }
        if (style2.lineDash) {
          feature.symbol.style = "dash";
        }
      } else {
        if (style2.fill && style2.fill.indexOf("{") > -1) {
          return;
        }
        if (style2.fill) {
          feature.symbol.color = style2.fill.toLowerCase();
        }
        if (style2.fillOpacity && feature.symbol.color) {
          feature.symbol.color.a = style2.fillOpacity;
        }
        if (!feature.symbol.outline) {
          feature.symbol.outline = { color: "black", width: 1 };
        }
        if (style2.lineWidth) {
          feature.symbol.outline.width = style2.lineWidth;
        }
        if (style2.color) {
          feature.symbol.outline.color = style2.color.toLowerCase();
        }
        if (style2.lineCap) {
          feature.symbol.outline.cap = style2.lineCap;
        }
        if (style2.lineDash) {
          feature.symbol.outline.style = "dash";
        }
      }
    }
  }
  addFeature(feature, layerIndex) {
    if (!feature) {
      return;
    }
    const style2 = this.layerAssets[layerIndex].style;
    if (!feature.attributes) {
      feature.attributes = {};
    }
    feature.attributes.zIndex = 0;
    if (layerIndex && layerIndex < this.layerAssets.length) {
      feature.attributes.zIndex = layerIndex;
      if (style2.color && style2.color.indexOf("{") > -1 || style2.fill && style2.fill.indexOf("{") > -1) {
        const handlebarStyle = this.updateStyleByFeature(feature.attributes.layer, feature.attributes.color, null, null, style2);
        this.featureUpdateStyle(feature, handlebarStyle);
      } else {
        this.featureUpdateStyle(feature, style2);
      }
      const graphics = this.layerAssets[layerIndex].graphicLayer.graphics;
      let isAdded = false;
      graphics.forEach((f, i2) => {
        if (f.attributes.id === feature.attributes.id) {
          isAdded = true;
          return;
        }
      });
      if (!isAdded) {
        graphics.add(feature);
        if (feature.attributes.lb) {
          graphics.add(feature.attributes.lb);
        }
      }
    }
  }
  removeFeature(feature, layerIndex) {
    if (layerIndex) {
      if (layerIndex > this.layerAssets.length) {
        return;
      }
      if (feature.attributes.lb) {
        this.layerAssets[layerIndex].graphicLayer.graphics.remove(feature.attributes.lb);
      }
      this.layerAssets[layerIndex].graphicLayer.graphics.remove(feature);
    } else {
      const zIndex = feature.attributes.zIndex;
      if (feature.attributes.lb) {
        this.layerAssets[zIndex].graphicLayer.graphics.remove(feature.attributes.lb);
      }
      this.layerAssets[zIndex].graphicLayer.graphics.remove(feature);
    }
  }
  removeItemFromMap(id2) {
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      const layer = this.layerAssets[i2].graphicLayer.graphics;
      if (!layer) {
        continue;
      }
      layer.forEach((graphic) => {
        const att = graphic.attributes;
        if (att && att.id && att.id === id2) {
          if (att.lb) {
            layer.remove(att.lb);
          }
          layer.remove(graphic);
        }
      });
    }
  }
  getMapSize() {
    return [this.mapView.width, this.mapView.height];
  }
  getBoundingBox(options) {
    const extent = this.mapView.extent;
    if (extent) {
      const leftTop = this.lib.webMercatorUtils.xyToLngLat(extent.xmin, extent.ymin);
      const rightBottom = this.lib.webMercatorUtils.xyToLngLat(extent.xmax, extent.ymax);
      if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {
        return null;
      }
      const left = leftTop[0];
      const bottom = rightBottom[1];
      const right = rightBottom[0];
      const top = leftTop[1];
      let minLon = left;
      let maxLon = right;
      if (left > right) {
        minLon = right;
        maxLon = left;
      }
      let minLat = bottom;
      let maxLat = top;
      if (bottom > top) {
        minLat = top;
        maxLat = bottom;
      }
      return { minLon, maxLat, maxLon, minLat, zoom: this.mapView.zoom };
    }
    return null;
  }
  addSearchAddress(apiKey, wrapper, cb) {
  }
  clearAllFeatures() {
  }
  clearAllFeaturesLayer(layerIndex) {
    if (layerIndex > this.layerAssets.length) {
      return;
    }
    this.layerAssets[layerIndex].graphicLayer.removeAll();
  }
  updateSize() {
  }
  getLatLngFromPixel(pixel) {
    return [];
  }
  getPixelFromCoordinate(coordinate) {
  }
  findFeatureByClick(evt, sType, assetSelectionsAvailable) {
    const features = evt.clickFeature;
    const coor = [evt.event.mapPoint.longitude, evt.event.mapPoint.latitude];
    const pixel = [evt.event.x, evt.event.y];
    const existedFeature = this.getFeaturesFromMap(features, pixel, sType, assetSelectionsAvailable);
    return { coor, pixel, features, existedFeature };
  }
  checkFeatureExist(layerIndex, id2) {
    this.layerAssets[layerIndex].graphicLayer.graphics.find(function(fea) {
      return fea.attributes.id === id2;
    });
  }
  _storeSelectedAsset(feature, isPrimary) {
    if (!this.selectedAssets) {
      this.selectedAssets = [];
    }
    const len = this.selectedAssets.length;
    if (!feature.attributes) {
      return;
    }
    const fId = feature.attributes.id;
    for (let i2 = 0; i2 < len; i2++) {
      const iPro = this.selectedAssets[i2].attributes;
      if (!iPro) {
        continue;
      }
      const iId = iPro.id;
      if (iId === fId) {
        if (isPrimary) {
          let isExist;
          isExist = this.checkFeatureExist(this.layerIndexPrimary, iId);
          if (!isExist) {
            this.addFeature(feature, this.layerIndexPrimary);
            this.setFeatureProperties(feature, { zIndex: this.layerIndexPrimary });
          }
        } else {
          let isExist;
          isExist = this.checkFeatureExist(this.layerIndexSecondary, iId);
          if (!isExist) {
            this.addFeature(feature, this.layerIndexSecondary);
            this.setFeatureProperties(feature, { zIndex: this.layerIndexSecondary });
          }
        }
        this.selectedAssets[i2] = feature;
        return;
      }
    }
    this.selectedAssets.push(feature);
    if (isPrimary) {
      this.addFeature(feature, this.layerIndexPrimary);
    } else {
      this.addFeature(feature, this.layerIndexSecondary);
    }
  }
  storeSelectedAssets(feature, isPrimary) {
    this._storeSelectedAsset(feature, isPrimary);
  }
  updateStoredSelectedAssetVisualize(id2, primary, secondary) {
    if (!this.selectedAssets) {
      return;
    }
    const len = this.selectedAssets.length;
    for (let i2 = 0; i2 < len; i2++) {
      const feature = this.selectedAssets[i2];
      const p = feature.attributes;
      let fId = p.id;
      if (fId.indexOf("_") > -1) {
        fId = fId.split("_")[0];
      }
      if (id2.indexOf(fId) > -1) {
        this.setFeatureProperties(feature, { primary, secondary });
        break;
      }
    }
  }
  removeSelectedAssetsById(id2) {
    let fId = id2;
    let mode = "NA";
    if (fId && fId.indexOf("primary") > -1) {
      mode = "primary";
    } else if (fId && fId.indexOf("secondary") > -1) {
      mode = "secondary";
    }
    if (fId && fId.indexOf("_") > -1) {
      fId = fId.split("_")[0];
    }
    const len = this.selectedAssets.length;
    for (let i2 = len - 1; i2 > -1; i2--) {
      if (!this.selectedAssets[i2].attributes) {
        continue;
      }
      const iId = this.selectedAssets[i2].attributes.id;
      if (iId && iId.indexOf(mode) > -1 && iId.indexOf(fId) > -1 || iId === fId) {
        this.selectedAssets.splice(i2, 1);
        this.removeItemFromMap(iId);
      }
    }
  }
  removeLayerFeatures() {
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      this.layerAssets[i2].graphicLayer.graphics.removeAll();
    }
  }
  // copy from sclAssetLayers.removeUnselectedAsset
  removeUnselectedAsset(assets, unSelectedAssetIds, type) {
  }
  updateLayers(pLayerAssets) {
    this.removeLayerFeatures();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.map.remove(this.layerAssets[i2].graphicLayer);
    }
    const obj = { layerAssets: pLayerAssets };
    this.createLayers(obj);
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.map.add(this.layerAssets[i2].graphicLayer, i2);
    }
  }
  // ************** use for psma layer reverse function *******************************************
  psmaStyleFunction() {
  }
  psmaCreateLayer(psmaPoints) {
    if (!this.psmaReverse) {
      this.psmaReverse = {};
      for (let i2 = 0; i2 < psmaPoints.length; i2++) {
        this.addFeature(psmaPoints[i2], this.layerIndexAddress);
      }
      this.psmaReverse.psmaSourceVector = this.layerAssets[this.layerIndexAddress];
      this.psmaReverse.psmaLayer = this.layerAssets[this.layerIndexAddress];
    }
    return this.psmaReverse;
  }
  psmaCreatePoint(coor, properties2, psmaPoints) {
    const symbol = {
      type: "simple-marker",
      color: "rgba(255, 127, 39, 1)",
      // orange
      outline: {
        color: "rgba(255, 0, 0, 1)",
        // red
        width: 1
      },
      size: 4
    };
    const circleGeom = new this.lib.Circle({
      center: coor,
      radius: 0.1
    });
    const point = new this.lib.Graphic({
      geometry: circleGeom,
      symbol
    });
    this.setFeatureProperties(point, properties2);
    this.addFeature(point, this.layerIndexAddress);
    psmaPoints.push(point);
    return psmaPoints;
  }
  psmaCreatePointClick(coor, radius, psmaPoints) {
    const symbol = {
      type: "simple-fill",
      color: "rgba(255,255,255,0.4)",
      // white, opacity 40%
      outline: {
        color: "#3399CC",
        // blue
        width: 1
      }
    };
    const center = new this.lib.Point({ latitude: coor[1], longitude: coor[0], spatialReference: this.mapView.spatialReference });
    const circleGeom = new this.lib.Circle({
      center,
      radius
    });
    const circle = new this.lib.Graphic({
      geometry: circleGeom,
      symbol
    });
    this.addFeature(circle, this.layerIndexAddress);
    psmaPoints.push(this.marker);
    psmaPoints.push(circle);
    return psmaPoints;
  }
  psmaRemovePoint(psmaPoints, psmaSourceVector) {
    for (let i2 = 0; i2 < psmaPoints.length; ++i2) {
      psmaSourceVector.graphicLayer.graphics.remove(psmaPoints[i2]);
    }
    return { psmaPoints, psmaSourceVector };
  }
  rad(x) {
    return x * Math.PI / 180;
  }
  psmaDistanceCoords(coorA, coorB) {
    const R = 6378137;
    const dLat = this.rad(coorB[1] - coorA[1]);
    const dLong = this.rad(coorB[0] - coorA[0]);
    const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(this.rad(coorA[1])) * Math.cos(this.rad(coorB[1])) * Math.sin(dLong / 2) * Math.sin(dLong / 2);
    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
    const d = R * c;
    return d;
  }
  // copy from this.sclUtilMapService.positionView
  positionView(lat, lon, zoom, EPSG) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lon = typeof lon !== "undefined" ? lon : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    this.mapView.zoom = zoom;
    this.mapView.center = [lon, lat];
  }
  //
  setCenterMapViewByCoordinates(bbox) {
    const xmin = bbox[0][0];
    const ymin = bbox[0][1];
    const xmax = bbox[1][0];
    const ymax = bbox[1][1];
    const ext = new this.lib.Extent({
      xmin,
      ymin,
      xmax,
      ymax
    });
    this.mapView.extent = ext;
  }
  // 15262
  setCenter(lat, lon) {
    this.mapView.center = [lon, lat];
  }
};
_SclMappingFunctionsArcGisService.\u0275fac = function SclMappingFunctionsArcGisService_Factory(t) {
  return new (t || _SclMappingFunctionsArcGisService)();
};
_SclMappingFunctionsArcGisService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMappingFunctionsArcGisService, factory: _SclMappingFunctionsArcGisService.\u0275fac, providedIn: "root" });
var SclMappingFunctionsArcGisService = _SclMappingFunctionsArcGisService;

// projects/formbird-mapping/src/lib/google/google-map-loader.service.ts
var _GoogleMapLoaderService = class _GoogleMapLoaderService {
  constructor() {
    this.URL = "https://maps.googleapis.com/maps/api/js";
    this.KEY = null;
    this.CLIENT = null;
    this.SENSOR = false;
    this.VERSION = "3.14";
    this.LIBRARIES = null;
    this.WINDOW_CALLBACK_NAME = "__google_maps_api_provider_initializator__";
    this.script = null;
    this.google = null;
    this.loading = false;
    this.callbacks = [];
    this.onLoadEvents = [];
    this.countLoadLibrary = 0;
  }
  load(cb, cbFail) {
    try {
      if (this.countLoadLibrary > 0) {
        if (this.google) {
          cb(this.google);
        } else {
          this.callbacks.push({ cb, cbFail });
          if (!this.waitForLoadingDoneInterval) {
            this.waitForLoadingDoneInterval = setInterval(() => {
              if (this.google) {
                clearInterval(this.waitForLoadingDoneInterval);
                this.waitForLoadingDoneInterval = null;
                for (let i2 = 0; i2 < this.callbacks.length; i2++) {
                  const obj = this.callbacks[i2];
                  obj.cb(this.google);
                }
                this.callbacks = [];
              } else {
              }
            }, 200);
          } else {
          }
        }
      } else {
        this.countLoadLibrary++;
        let url = this.URL;
        if (this.SENSOR === true) {
          url += "?sensor=true";
        } else {
          url += "?sensor=false";
        }
        if (this.KEY != null) {
          url += "&key=" + this.KEY;
        }
        if (this.CLIENT != null) {
          url += "&client=" + this.CLIENT + "&v=" + this.VERSION;
        }
        if (this.LIBRARIES != null) {
          url += "&libraries=" + this.LIBRARIES;
        }
        url += "&callback=" + this.WINDOW_CALLBACK_NAME;
        this.google = window.google;
        if (this.google == null) {
          this.script = document.createElement("script");
          this.script.type = "text/javascript";
          this.script.src = url;
          document.body.appendChild(this.script);
          window[this.WINDOW_CALLBACK_NAME] = () => {
            this.google = window.google;
            cb(this.google);
          };
          this.script.onerror = (error3) => {
            cbFail(error3);
          };
        } else {
          cb(this.google);
        }
      }
    } catch (err) {
      console.log(`**** load google library error = `, err);
      cbFail(err);
    }
  }
};
_GoogleMapLoaderService.\u0275fac = function GoogleMapLoaderService_Factory(t) {
  return new (t || _GoogleMapLoaderService)();
};
_GoogleMapLoaderService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _GoogleMapLoaderService, factory: _GoogleMapLoaderService.\u0275fac, providedIn: "root" });
var GoogleMapLoaderService = _GoogleMapLoaderService;

// projects/formbird-mapping/src/lib/scl-mapping-function-google.service.ts
var MarkerWithLabelLibrary = __toESM(require_markerwithlabel());
var $2 = __toESM(require_jquery());
var import_lodash7 = __toESM(require_lodash());

// node_modules/@googlemaps/markerclusterer/dist/index.esm.js
var import_fast_deep_equal = __toESM(require_fast_deep_equal());

// node_modules/kdbush/index.js
var ARRAY_TYPES = [
  Int8Array,
  Uint8Array,
  Uint8ClampedArray,
  Int16Array,
  Uint16Array,
  Int32Array,
  Uint32Array,
  Float32Array,
  Float64Array
];
var VERSION9 = 1;
var HEADER_SIZE = 8;
var KDBush = class _KDBush {
  /**
   * Creates an index from raw `ArrayBuffer` data.
   * @param {ArrayBuffer} data
   */
  static from(data) {
    if (!(data instanceof ArrayBuffer)) {
      throw new Error("Data must be an instance of ArrayBuffer.");
    }
    const [magic, versionAndType] = new Uint8Array(data, 0, 2);
    if (magic !== 219) {
      throw new Error("Data does not appear to be in a KDBush format.");
    }
    const version = versionAndType >> 4;
    if (version !== VERSION9) {
      throw new Error(`Got v${version} data when expected v${VERSION9}.`);
    }
    const ArrayType = ARRAY_TYPES[versionAndType & 15];
    if (!ArrayType) {
      throw new Error("Unrecognized array type.");
    }
    const [nodeSize] = new Uint16Array(data, 2, 1);
    const [numItems] = new Uint32Array(data, 4, 1);
    return new _KDBush(numItems, nodeSize, ArrayType, data);
  }
  /**
   * Creates an index that will hold a given number of items.
   * @param {number} numItems
   * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
   * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
   * @param {ArrayBuffer} [data] (For internal use only)
   */
  constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {
    if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);
    this.numItems = +numItems;
    this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);
    this.ArrayType = ArrayType;
    this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;
    const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);
    const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;
    const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;
    const padCoords = (8 - idsByteSize % 8) % 8;
    if (arrayTypeIndex < 0) {
      throw new Error(`Unexpected typed array class: ${ArrayType}.`);
    }
    if (data && data instanceof ArrayBuffer) {
      this.data = data;
      this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);
      this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);
      this._pos = numItems * 2;
      this._finished = true;
    } else {
      this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);
      this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);
      this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);
      this._pos = 0;
      this._finished = false;
      new Uint8Array(this.data, 0, 2).set([219, (VERSION9 << 4) + arrayTypeIndex]);
      new Uint16Array(this.data, 2, 1)[0] = nodeSize;
      new Uint32Array(this.data, 4, 1)[0] = numItems;
    }
  }
  /**
   * Add a point to the index.
   * @param {number} x
   * @param {number} y
   * @returns {number} An incremental index associated with the added item (starting from `0`).
   */
  add(x, y) {
    const index = this._pos >> 1;
    this.ids[index] = index;
    this.coords[this._pos++] = x;
    this.coords[this._pos++] = y;
    return index;
  }
  /**
   * Perform indexing of the added points.
   */
  finish() {
    const numAdded = this._pos >> 1;
    if (numAdded !== this.numItems) {
      throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);
    }
    sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);
    this._finished = true;
    return this;
  }
  /**
   * Search the index for items within a given bounding box.
   * @param {number} minX
   * @param {number} minY
   * @param {number} maxX
   * @param {number} maxY
   * @returns {number[]} An array of indices correponding to the found items.
   */
  range(minX, minY, maxX, maxY) {
    if (!this._finished) throw new Error("Data not yet indexed - call index.finish().");
    const { ids, coords, nodeSize } = this;
    const stack = [0, ids.length - 1, 0];
    const result = [];
    while (stack.length) {
      const axis = stack.pop() || 0;
      const right = stack.pop() || 0;
      const left = stack.pop() || 0;
      if (right - left <= nodeSize) {
        for (let i2 = left; i2 <= right; i2++) {
          const x2 = coords[2 * i2];
          const y2 = coords[2 * i2 + 1];
          if (x2 >= minX && x2 <= maxX && y2 >= minY && y2 <= maxY) result.push(ids[i2]);
        }
        continue;
      }
      const m = left + right >> 1;
      const x = coords[2 * m];
      const y = coords[2 * m + 1];
      if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);
      if (axis === 0 ? minX <= x : minY <= y) {
        stack.push(left);
        stack.push(m - 1);
        stack.push(1 - axis);
      }
      if (axis === 0 ? maxX >= x : maxY >= y) {
        stack.push(m + 1);
        stack.push(right);
        stack.push(1 - axis);
      }
    }
    return result;
  }
  /**
   * Search the index for items within a given radius.
   * @param {number} qx
   * @param {number} qy
   * @param {number} r Query radius.
   * @returns {number[]} An array of indices correponding to the found items.
   */
  within(qx, qy, r) {
    if (!this._finished) throw new Error("Data not yet indexed - call index.finish().");
    const { ids, coords, nodeSize } = this;
    const stack = [0, ids.length - 1, 0];
    const result = [];
    const r2 = r * r;
    while (stack.length) {
      const axis = stack.pop() || 0;
      const right = stack.pop() || 0;
      const left = stack.pop() || 0;
      if (right - left <= nodeSize) {
        for (let i2 = left; i2 <= right; i2++) {
          if (sqDist(coords[2 * i2], coords[2 * i2 + 1], qx, qy) <= r2) result.push(ids[i2]);
        }
        continue;
      }
      const m = left + right >> 1;
      const x = coords[2 * m];
      const y = coords[2 * m + 1];
      if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);
      if (axis === 0 ? qx - r <= x : qy - r <= y) {
        stack.push(left);
        stack.push(m - 1);
        stack.push(1 - axis);
      }
      if (axis === 0 ? qx + r >= x : qy + r >= y) {
        stack.push(m + 1);
        stack.push(right);
        stack.push(1 - axis);
      }
    }
    return result;
  }
};
function sort(ids, coords, nodeSize, left, right, axis) {
  if (right - left <= nodeSize) return;
  const m = left + right >> 1;
  select(ids, coords, m, left, right, axis);
  sort(ids, coords, nodeSize, left, m - 1, 1 - axis);
  sort(ids, coords, nodeSize, m + 1, right, 1 - axis);
}
function select(ids, coords, k, left, right, axis) {
  while (right > left) {
    if (right - left > 600) {
      const n = right - left + 1;
      const m = k - left + 1;
      const z = Math.log(n);
      const s = 0.5 * Math.exp(2 * z / 3);
      const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
      const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
      const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
      select(ids, coords, k, newLeft, newRight, axis);
    }
    const t = coords[2 * k + axis];
    let i2 = left;
    let j = right;
    swapItem(ids, coords, left, k);
    if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);
    while (i2 < j) {
      swapItem(ids, coords, i2, j);
      i2++;
      j--;
      while (coords[2 * i2 + axis] < t) i2++;
      while (coords[2 * j + axis] > t) j--;
    }
    if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);
    else {
      j++;
      swapItem(ids, coords, j, right);
    }
    if (j <= k) left = j + 1;
    if (k <= j) right = j - 1;
  }
}
function swapItem(ids, coords, i2, j) {
  swap(ids, i2, j);
  swap(coords, 2 * i2, 2 * j);
  swap(coords, 2 * i2 + 1, 2 * j + 1);
}
function swap(arr, i2, j) {
  const tmp = arr[i2];
  arr[i2] = arr[j];
  arr[j] = tmp;
}
function sqDist(ax, ay, bx, by) {
  const dx = ax - bx;
  const dy = ay - by;
  return dx * dx + dy * dy;
}

// node_modules/supercluster/index.js
var defaultOptions = {
  minZoom: 0,
  // min zoom to generate clusters on
  maxZoom: 16,
  // max zoom level to cluster the points on
  minPoints: 2,
  // minimum points to form a cluster
  radius: 40,
  // cluster radius in pixels
  extent: 512,
  // tile extent (radius is calculated relative to it)
  nodeSize: 64,
  // size of the KD-tree leaf node, affects performance
  log: false,
  // whether to log timing info
  // whether to generate numeric ids for input features (in vector tiles)
  generateId: false,
  // a reduce function for calculating custom cluster properties
  reduce: null,
  // (accumulated, props) => { accumulated.sum += props.sum; }
  // properties to use for individual points when running the reducer
  map: (props) => props
  // props => ({sum: props.my_value})
};
var fround = Math.fround || /* @__PURE__ */ ((tmp) => (x) => {
  tmp[0] = +x;
  return tmp[0];
})(new Float32Array(1));
var OFFSET_ZOOM = 2;
var OFFSET_ID = 3;
var OFFSET_PARENT = 4;
var OFFSET_NUM = 5;
var OFFSET_PROP = 6;
var Supercluster = class {
  constructor(options) {
    this.options = Object.assign(Object.create(defaultOptions), options);
    this.trees = new Array(this.options.maxZoom + 1);
    this.stride = this.options.reduce ? 7 : 6;
    this.clusterProps = [];
  }
  load(points) {
    const { log, minZoom, maxZoom } = this.options;
    if (log) console.time("total time");
    const timerId = `prepare ${points.length} points`;
    if (log) console.time(timerId);
    this.points = points;
    const data = [];
    for (let i2 = 0; i2 < points.length; i2++) {
      const p = points[i2];
      if (!p.geometry) continue;
      const [lng, lat] = p.geometry.coordinates;
      const x = fround(lngX(lng));
      const y = fround(latY(lat));
      data.push(
        x,
        y,
        // projected point coordinates
        Infinity,
        // the last zoom the point was processed at
        i2,
        // index of the source feature in the original input array
        -1,
        // parent cluster id
        1
        // number of points in a cluster
      );
      if (this.options.reduce) data.push(0);
    }
    let tree = this.trees[maxZoom + 1] = this._createTree(data);
    if (log) console.timeEnd(timerId);
    for (let z = maxZoom; z >= minZoom; z--) {
      const now = +Date.now();
      tree = this.trees[z] = this._createTree(this._cluster(tree, z));
      if (log) console.log("z%d: %d clusters in %dms", z, tree.numItems, +Date.now() - now);
    }
    if (log) console.timeEnd("total time");
    return this;
  }
  getClusters(bbox, zoom) {
    let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;
    const minLat = Math.max(-90, Math.min(90, bbox[1]));
    let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;
    const maxLat = Math.max(-90, Math.min(90, bbox[3]));
    if (bbox[2] - bbox[0] >= 360) {
      minLng = -180;
      maxLng = 180;
    } else if (minLng > maxLng) {
      const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);
      const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);
      return easternHem.concat(westernHem);
    }
    const tree = this.trees[this._limitZoom(zoom)];
    const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));
    const data = tree.data;
    const clusters = [];
    for (const id2 of ids) {
      const k = this.stride * id2;
      clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);
    }
    return clusters;
  }
  getChildren(clusterId) {
    const originId = this._getOriginId(clusterId);
    const originZoom = this._getOriginZoom(clusterId);
    const errorMsg = "No cluster with the specified id.";
    const tree = this.trees[originZoom];
    if (!tree) throw new Error(errorMsg);
    const data = tree.data;
    if (originId * this.stride >= data.length) throw new Error(errorMsg);
    const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));
    const x = data[originId * this.stride];
    const y = data[originId * this.stride + 1];
    const ids = tree.within(x, y, r);
    const children = [];
    for (const id2 of ids) {
      const k = id2 * this.stride;
      if (data[k + OFFSET_PARENT] === clusterId) {
        children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);
      }
    }
    if (children.length === 0) throw new Error(errorMsg);
    return children;
  }
  getLeaves(clusterId, limit, offset2) {
    limit = limit || 10;
    offset2 = offset2 || 0;
    const leaves = [];
    this._appendLeaves(leaves, clusterId, limit, offset2, 0);
    return leaves;
  }
  getTile(z, x, y) {
    const tree = this.trees[this._limitZoom(z)];
    const z2 = Math.pow(2, z);
    const { extent, radius } = this.options;
    const p = radius / extent;
    const top = (y - p) / z2;
    const bottom = (y + 1 + p) / z2;
    const tile = {
      features: []
    };
    this._addTileFeatures(
      tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),
      tree.data,
      x,
      y,
      z2,
      tile
    );
    if (x === 0) {
      this._addTileFeatures(
        tree.range(1 - p / z2, top, 1, bottom),
        tree.data,
        z2,
        y,
        z2,
        tile
      );
    }
    if (x === z2 - 1) {
      this._addTileFeatures(
        tree.range(0, top, p / z2, bottom),
        tree.data,
        -1,
        y,
        z2,
        tile
      );
    }
    return tile.features.length ? tile : null;
  }
  getClusterExpansionZoom(clusterId) {
    let expansionZoom = this._getOriginZoom(clusterId) - 1;
    while (expansionZoom <= this.options.maxZoom) {
      const children = this.getChildren(clusterId);
      expansionZoom++;
      if (children.length !== 1) break;
      clusterId = children[0].properties.cluster_id;
    }
    return expansionZoom;
  }
  _appendLeaves(result, clusterId, limit, offset2, skipped) {
    const children = this.getChildren(clusterId);
    for (const child of children) {
      const props = child.properties;
      if (props && props.cluster) {
        if (skipped + props.point_count <= offset2) {
          skipped += props.point_count;
        } else {
          skipped = this._appendLeaves(result, props.cluster_id, limit, offset2, skipped);
        }
      } else if (skipped < offset2) {
        skipped++;
      } else {
        result.push(child);
      }
      if (result.length === limit) break;
    }
    return skipped;
  }
  _createTree(data) {
    const tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);
    for (let i2 = 0; i2 < data.length; i2 += this.stride) tree.add(data[i2], data[i2 + 1]);
    tree.finish();
    tree.data = data;
    return tree;
  }
  _addTileFeatures(ids, data, x, y, z2, tile) {
    for (const i2 of ids) {
      const k = i2 * this.stride;
      const isCluster = data[k + OFFSET_NUM] > 1;
      let tags, px, py;
      if (isCluster) {
        tags = getClusterProperties(data, k, this.clusterProps);
        px = data[k];
        py = data[k + 1];
      } else {
        const p = this.points[data[k + OFFSET_ID]];
        tags = p.properties;
        const [lng, lat] = p.geometry.coordinates;
        px = lngX(lng);
        py = latY(lat);
      }
      const f = {
        type: 1,
        geometry: [[
          Math.round(this.options.extent * (px * z2 - x)),
          Math.round(this.options.extent * (py * z2 - y))
        ]],
        tags
      };
      let id2;
      if (isCluster || this.options.generateId) {
        id2 = data[k + OFFSET_ID];
      } else {
        id2 = this.points[data[k + OFFSET_ID]].id;
      }
      if (id2 !== void 0) f.id = id2;
      tile.features.push(f);
    }
  }
  _limitZoom(z) {
    return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));
  }
  _cluster(tree, zoom) {
    const { radius, extent, reduce, minPoints } = this.options;
    const r = radius / (extent * Math.pow(2, zoom));
    const data = tree.data;
    const nextData = [];
    const stride = this.stride;
    for (let i2 = 0; i2 < data.length; i2 += stride) {
      if (data[i2 + OFFSET_ZOOM] <= zoom) continue;
      data[i2 + OFFSET_ZOOM] = zoom;
      const x = data[i2];
      const y = data[i2 + 1];
      const neighborIds = tree.within(data[i2], data[i2 + 1], r);
      const numPointsOrigin = data[i2 + OFFSET_NUM];
      let numPoints = numPointsOrigin;
      for (const neighborId of neighborIds) {
        const k = neighborId * stride;
        if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];
      }
      if (numPoints > numPointsOrigin && numPoints >= minPoints) {
        let wx = x * numPointsOrigin;
        let wy = y * numPointsOrigin;
        let clusterProperties;
        let clusterPropIndex = -1;
        const id2 = ((i2 / stride | 0) << 5) + (zoom + 1) + this.points.length;
        for (const neighborId of neighborIds) {
          const k = neighborId * stride;
          if (data[k + OFFSET_ZOOM] <= zoom) continue;
          data[k + OFFSET_ZOOM] = zoom;
          const numPoints2 = data[k + OFFSET_NUM];
          wx += data[k] * numPoints2;
          wy += data[k + 1] * numPoints2;
          data[k + OFFSET_PARENT] = id2;
          if (reduce) {
            if (!clusterProperties) {
              clusterProperties = this._map(data, i2, true);
              clusterPropIndex = this.clusterProps.length;
              this.clusterProps.push(clusterProperties);
            }
            reduce(clusterProperties, this._map(data, k));
          }
        }
        data[i2 + OFFSET_PARENT] = id2;
        nextData.push(wx / numPoints, wy / numPoints, Infinity, id2, -1, numPoints);
        if (reduce) nextData.push(clusterPropIndex);
      } else {
        for (let j = 0; j < stride; j++) nextData.push(data[i2 + j]);
        if (numPoints > 1) {
          for (const neighborId of neighborIds) {
            const k = neighborId * stride;
            if (data[k + OFFSET_ZOOM] <= zoom) continue;
            data[k + OFFSET_ZOOM] = zoom;
            for (let j = 0; j < stride; j++) nextData.push(data[k + j]);
          }
        }
      }
    }
    return nextData;
  }
  // get index of the point from which the cluster originated
  _getOriginId(clusterId) {
    return clusterId - this.points.length >> 5;
  }
  // get zoom of the point from which the cluster originated
  _getOriginZoom(clusterId) {
    return (clusterId - this.points.length) % 32;
  }
  _map(data, i2, clone2) {
    if (data[i2 + OFFSET_NUM] > 1) {
      const props = this.clusterProps[data[i2 + OFFSET_PROP]];
      return clone2 ? Object.assign({}, props) : props;
    }
    const original = this.points[data[i2 + OFFSET_ID]].properties;
    const result = this.options.map(original);
    return clone2 && result === original ? Object.assign({}, result) : result;
  }
};
function getClusterJSON(data, i2, clusterProps) {
  return {
    type: "Feature",
    id: data[i2 + OFFSET_ID],
    properties: getClusterProperties(data, i2, clusterProps),
    geometry: {
      type: "Point",
      coordinates: [xLng(data[i2]), yLat(data[i2 + 1])]
    }
  };
}
function getClusterProperties(data, i2, clusterProps) {
  const count = data[i2 + OFFSET_NUM];
  const abbrev = count >= 1e4 ? `${Math.round(count / 1e3)}k` : count >= 1e3 ? `${Math.round(count / 100) / 10}k` : count;
  const propIndex = data[i2 + OFFSET_PROP];
  const properties2 = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);
  return Object.assign(properties2, {
    cluster: true,
    cluster_id: data[i2 + OFFSET_ID],
    point_count: count,
    point_count_abbreviated: abbrev
  });
}
function lngX(lng) {
  return lng / 360 + 0.5;
}
function latY(lat) {
  const sin = Math.sin(lat * Math.PI / 180);
  const y = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;
  return y < 0 ? 0 : y > 1 ? 1 : y;
}
function xLng(x) {
  return (x - 0.5) * 360;
}
function yLat(y) {
  const y2 = (180 - y * 360) * Math.PI / 180;
  return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;
}

// node_modules/@googlemaps/markerclusterer/dist/index.esm.js
function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
    t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i2 = 0, p = Object.getOwnPropertySymbols(s); i2 < p.length; i2++) {
      if (e.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i2]))
        t[p[i2]] = s[p[i2]];
    }
  return t;
}
var MarkerUtils = class {
  static isAdvancedMarkerAvailable(map2) {
    return google.maps.marker && map2.getMapCapabilities().isAdvancedMarkersAvailable === true;
  }
  static isAdvancedMarker(marker) {
    return google.maps.marker && marker instanceof google.maps.marker.AdvancedMarkerElement;
  }
  static setMap(marker, map2) {
    if (this.isAdvancedMarker(marker)) {
      marker.map = map2;
    } else {
      marker.setMap(map2);
    }
  }
  static getPosition(marker) {
    if (this.isAdvancedMarker(marker)) {
      if (marker.position) {
        if (marker.position instanceof google.maps.LatLng) {
          return marker.position;
        }
        if (marker.position.lat && marker.position.lng) {
          return new google.maps.LatLng(marker.position.lat, marker.position.lng);
        }
      }
      return new google.maps.LatLng(null);
    }
    return marker.getPosition();
  }
  static getVisible(marker) {
    if (this.isAdvancedMarker(marker)) {
      return true;
    }
    return marker.getVisible();
  }
};
var Cluster2 = class {
  constructor({ markers, position }) {
    this.markers = markers;
    if (position) {
      if (position instanceof google.maps.LatLng) {
        this._position = position;
      } else {
        this._position = new google.maps.LatLng(position);
      }
    }
  }
  get bounds() {
    if (this.markers.length === 0 && !this._position) {
      return;
    }
    const bounds = new google.maps.LatLngBounds(this._position, this._position);
    for (const marker of this.markers) {
      bounds.extend(MarkerUtils.getPosition(marker));
    }
    return bounds;
  }
  get position() {
    return this._position || this.bounds.getCenter();
  }
  /**
   * Get the count of **visible** markers.
   */
  get count() {
    return this.markers.filter((m) => MarkerUtils.getVisible(m)).length;
  }
  /**
   * Add a marker to the cluster.
   */
  push(marker) {
    this.markers.push(marker);
  }
  /**
   * Cleanup references and remove marker from map.
   */
  delete() {
    if (this.marker) {
      MarkerUtils.setMap(this.marker, null);
      this.marker = void 0;
    }
    this.markers.length = 0;
  }
};
var AbstractAlgorithm = class {
  constructor({ maxZoom = 16 }) {
    this.maxZoom = maxZoom;
  }
  /**
   * Helper function to bypass clustering based upon some map state such as
   * zoom, number of markers, etc.
   *
   * ```typescript
   *  cluster({markers, map}: AlgorithmInput): Cluster[] {
   *    if (shouldBypassClustering(map)) {
   *      return this.noop({markers})
   *    }
   * }
   * ```
   */
  noop({ markers }) {
    return noop4(markers);
  }
};
var noop4 = (markers) => {
  const clusters = markers.map((marker) => new Cluster2({
    position: MarkerUtils.getPosition(marker),
    markers: [marker]
  }));
  return clusters;
};
var SuperClusterAlgorithm = class extends AbstractAlgorithm {
  constructor(_a56) {
    var { maxZoom, radius = 60 } = _a56, options = __rest(_a56, ["maxZoom", "radius"]);
    super({ maxZoom });
    this.state = { zoom: -1 };
    this.superCluster = new Supercluster(Object.assign({ maxZoom: this.maxZoom, radius }, options));
  }
  calculate(input2) {
    let changed = false;
    const state2 = { zoom: input2.map.getZoom() };
    if (!(0, import_fast_deep_equal.default)(input2.markers, this.markers)) {
      changed = true;
      this.markers = [...input2.markers];
      const points = this.markers.map((marker) => {
        const position = MarkerUtils.getPosition(marker);
        const coordinates2 = [position.lng(), position.lat()];
        return {
          type: "Feature",
          geometry: {
            type: "Point",
            coordinates: coordinates2
          },
          properties: { marker }
        };
      });
      this.superCluster.load(points);
    }
    if (!changed) {
      if (this.state.zoom <= this.maxZoom || state2.zoom <= this.maxZoom) {
        changed = !(0, import_fast_deep_equal.default)(this.state, state2);
      }
    }
    this.state = state2;
    if (changed) {
      this.clusters = this.cluster(input2);
    }
    return { clusters: this.clusters, changed };
  }
  cluster({ map: map2 }) {
    return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(map2.getZoom())).map((feature) => this.transformCluster(feature));
  }
  transformCluster({ geometry: { coordinates: [lng, lat] }, properties: properties2 }) {
    if (properties2.cluster) {
      return new Cluster2({
        markers: this.superCluster.getLeaves(properties2.cluster_id, Infinity).map((leaf) => leaf.properties.marker),
        position: { lat, lng }
      });
    }
    const marker = properties2.marker;
    return new Cluster2({
      markers: [marker],
      position: MarkerUtils.getPosition(marker)
    });
  }
};
var ClusterStats = class {
  constructor(markers, clusters) {
    this.markers = { sum: markers.length };
    const clusterMarkerCounts = clusters.map((a) => a.count);
    const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);
    this.clusters = {
      count: clusters.length,
      markers: {
        mean: clusterMarkerSum / clusters.length,
        sum: clusterMarkerSum,
        min: Math.min(...clusterMarkerCounts),
        max: Math.max(...clusterMarkerCounts)
      }
    };
  }
};
var DefaultRenderer = class {
  /**
   * The default render function for the library used by {@link MarkerClusterer}.
   *
   * Currently set to use the following:
   *
   * ```typescript
   * // change color if this cluster has more markers than the mean cluster
   * const color =
   *   count > Math.max(10, stats.clusters.markers.mean)
   *     ? "#ff0000"
   *     : "#0000ff";
   *
   * // create svg url with fill color
   * const svg = window.btoa(`
   * <svg fill="${color}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
   *   <circle cx="120" cy="120" opacity=".6" r="70" />
   *   <circle cx="120" cy="120" opacity=".3" r="90" />
   *   <circle cx="120" cy="120" opacity=".2" r="110" />
   *   <circle cx="120" cy="120" opacity=".1" r="130" />
   * </svg>`);
   *
   * // create marker using svg icon
   * return new google.maps.Marker({
   *   position,
   *   icon: {
   *     url: `data:image/svg+xml;base64,${svg}`,
   *     scaledSize: new google.maps.Size(45, 45),
   *   },
   *   label: {
   *     text: String(count),
   *     color: "rgba(255,255,255,0.9)",
   *     fontSize: "12px",
   *   },
   *   // adjust zIndex to be above other markers
   *   zIndex: 1000 + count,
   * });
   * ```
   */
  render({ count, position }, stats, map2) {
    const color2 = count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff";
    const svg = `<svg fill="${color2}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
<circle cx="120" cy="120" opacity=".6" r="70" />
<circle cx="120" cy="120" opacity=".3" r="90" />
<circle cx="120" cy="120" opacity=".2" r="110" />
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${count}</text>
</svg>`;
    const title = `Cluster of ${count} markers`, zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count;
    if (MarkerUtils.isAdvancedMarkerAvailable(map2)) {
      const parser = new DOMParser();
      const svgEl = parser.parseFromString(svg, "image/svg+xml").documentElement;
      svgEl.setAttribute("transform", "translate(0 25)");
      const clusterOptions2 = {
        map: map2,
        position,
        zIndex,
        title,
        content: svgEl
      };
      return new google.maps.marker.AdvancedMarkerElement(clusterOptions2);
    }
    const clusterOptions = {
      position,
      zIndex,
      title,
      icon: {
        url: `data:image/svg+xml;base64,${btoa(svg)}`,
        anchor: new google.maps.Point(25, 25)
      }
    };
    return new google.maps.Marker(clusterOptions);
  }
};
function extend3(type1, type2) {
  for (let property in type2.prototype) {
    type1.prototype[property] = type2.prototype[property];
  }
}
var OverlayViewSafe = class _OverlayViewSafe {
  constructor() {
    extend3(_OverlayViewSafe, google.maps.OverlayView);
  }
};
var MarkerClustererEvents;
(function(MarkerClustererEvents2) {
  MarkerClustererEvents2["CLUSTERING_BEGIN"] = "clusteringbegin";
  MarkerClustererEvents2["CLUSTERING_END"] = "clusteringend";
  MarkerClustererEvents2["CLUSTER_CLICK"] = "click";
})(MarkerClustererEvents || (MarkerClustererEvents = {}));
var defaultOnClusterClickHandler = (_, cluster, map2) => {
  map2.fitBounds(cluster.bounds);
};
var MarkerClusterer = class extends OverlayViewSafe {
  constructor({ map: map2, markers = [], algorithmOptions = {}, algorithm = new SuperClusterAlgorithm(algorithmOptions), renderer = new DefaultRenderer(), onClusterClick = defaultOnClusterClickHandler }) {
    super();
    this.markers = [...markers];
    this.clusters = [];
    this.algorithm = algorithm;
    this.renderer = renderer;
    this.onClusterClick = onClusterClick;
    if (map2) {
      this.setMap(map2);
    }
  }
  addMarker(marker, noDraw) {
    if (this.markers.includes(marker)) {
      return;
    }
    this.markers.push(marker);
    if (!noDraw) {
      this.render();
    }
  }
  addMarkers(markers, noDraw) {
    markers.forEach((marker) => {
      this.addMarker(marker, true);
    });
    if (!noDraw) {
      this.render();
    }
  }
  removeMarker(marker, noDraw) {
    const index = this.markers.indexOf(marker);
    if (index === -1) {
      return false;
    }
    MarkerUtils.setMap(marker, null);
    this.markers.splice(index, 1);
    if (!noDraw) {
      this.render();
    }
    return true;
  }
  removeMarkers(markers, noDraw) {
    let removed = false;
    markers.forEach((marker) => {
      removed = this.removeMarker(marker, true) || removed;
    });
    if (removed && !noDraw) {
      this.render();
    }
    return removed;
  }
  clearMarkers(noDraw) {
    this.markers.length = 0;
    if (!noDraw) {
      this.render();
    }
  }
  /**
   * Recalculates and draws all the marker clusters.
   */
  render() {
    const map2 = this.getMap();
    if (map2 instanceof google.maps.Map && map2.getProjection()) {
      google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);
      const { clusters, changed } = this.algorithm.calculate({
        markers: this.markers,
        map: map2,
        mapCanvasProjection: this.getProjection()
      });
      if (changed || changed == void 0) {
        const singleMarker = /* @__PURE__ */ new Set();
        for (const cluster of clusters) {
          if (cluster.markers.length == 1) {
            singleMarker.add(cluster.markers[0]);
          }
        }
        const groupMarkers = [];
        for (const cluster of this.clusters) {
          if (cluster.marker == null) {
            continue;
          }
          if (cluster.markers.length == 1) {
            if (!singleMarker.has(cluster.marker)) {
              MarkerUtils.setMap(cluster.marker, null);
            }
          } else {
            groupMarkers.push(cluster.marker);
          }
        }
        this.clusters = clusters;
        this.renderClusters();
        requestAnimationFrame(() => groupMarkers.forEach((marker) => MarkerUtils.setMap(marker, null)));
      }
      google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);
    }
  }
  onAdd() {
    this.idleListener = this.getMap().addListener("idle", this.render.bind(this));
    this.render();
  }
  onRemove() {
    google.maps.event.removeListener(this.idleListener);
    this.reset();
  }
  reset() {
    this.markers.forEach((marker) => MarkerUtils.setMap(marker, null));
    this.clusters.forEach((cluster) => cluster.delete());
    this.clusters = [];
  }
  renderClusters() {
    const stats = new ClusterStats(this.markers, this.clusters);
    const map2 = this.getMap();
    this.clusters.forEach((cluster) => {
      if (cluster.markers.length === 1) {
        cluster.marker = cluster.markers[0];
      } else {
        cluster.marker = this.renderer.render(cluster, stats, map2);
        cluster.markers.forEach((marker) => MarkerUtils.setMap(marker, null));
        if (this.onClusterClick) {
          cluster.marker.addListener(
            "click",
            /* istanbul ignore next */
            (event) => {
              google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);
              this.onClusterClick(event, cluster, map2);
            }
          );
        }
      }
      MarkerUtils.setMap(cluster.marker, map2);
    });
  }
};

// projects/formbird-mapping/src/lib/scl-mapping-function-google.service.ts
var uuid3 = __toESM(require_uuid());
var sclMapViews4 = new SclMapViewsService();
var sclAssetLayers3 = new SclAssetLayersService();
var sclUtilMap2 = new SclUtilMapService();
var GoogleMapsLoader = new GoogleMapLoaderService();
var _SclMappingFunctionGoogleService = class _SclMappingFunctionGoogleService extends MapLibrary {
  constructor() {
    super();
    this.apiKey = "AIzaSyDLF3KfOk7figOYUQAudATOTTqCbzf1ylc";
    this.drawingManager = null;
    this.selectedShape = null;
    this.selectedFeatures = [];
    this.ActionControls = [];
    this.shapes = null;
    this.funcSingleSelectMode = null;
    this.dicDrawShape = {};
    this.heatLayerConfig = {};
    this.google = null;
    this.MarkerWithLabel = null;
    this.btnZoomIn = null;
    this.btnZoomOut = null;
    this.checkImgTransparent = null;
    this.checkImgTransparentCount = 0;
    this.markerImage = null;
    this.divCustomControl = null;
    this.clusterImageSize = [];
    this.singleSelectModeCluster = null;
    this.drawStartCluster = null;
    this.drawEndCluster = null;
    this.findBtnZoomIn = null;
    this.findBtnZoomInCount = 0;
    this.findBtnZoomLimit = 10;
    this.findBtnZoomOut = null;
    this.findBtnZoomOutCount = 0;
    this.dynamicIconRotate = "";
    this.dynamicIconRotateInterval = [];
    this.dynamicIconRotateCount = [];
    this.dynamicIconRotateLimit = 10;
    this.dynamicIconScale = "";
    this.dynamicIconScaleInterval = [];
    this.dynamicIconScaleCount = [];
    this.dynamicIconScaleLimit = 20;
    this.vertexes = [];
    this.arrow = null;
    this.iconAnchors = [];
    this.currentDimensionId = null;
    this.dimensionOverlays = {};
    this.mouseOverAdded = false;
    this.updateLocationMarkers = [];
    console.log("************ GG constructor");
    this.zoomFloor = 17;
    this.drawingToolsSupported = [
      "point",
      "line",
      "polygon",
      "circle",
      "box",
      "currentLocation",
      "delete",
      "text",
      "arrowAtFirstPoint",
      "arrowAtLastPoint",
      "dimension"
    ];
    this.totalDrawTool = 6;
  }
  load(constructObj, cb) {
    return __async(this, null, function* () {
      this.apiKey = constructObj.googleKey === null ? this.apiKey : constructObj.googleKey;
      GoogleMapsLoader.KEY = this.apiKey;
      GoogleMapsLoader.LIBRARIES = "places,drawing,visualization,geometry";
      GoogleMapsLoader.SENSOR = true;
      GoogleMapsLoader.load((google2) => {
        this.google = google2;
        if (this.google) {
          this.MarkerWithLabel = new MarkerWithLabelLibrary(google2.maps);
        } else {
          console.log(`**** LOAD GOOGLE MAP DONE BUT google is NULL`);
        }
        if (cb && typeof cb === "function") {
          cb();
        }
      }, (err) => {
        console.log(`**** LOAD GOOGLE MAP ERROR:`, err);
      });
    });
  }
  multiLayers(mapViews) {
    return [];
  }
  // function for calculating 6 letters hex value
  calculateFull(hex, opacity) {
    const r = parseInt(hex.substring(0, 2), 16);
    const g = parseInt(hex.substring(2, 4), 16);
    const b = parseInt(hex.substring(4, 6), 16);
    return "rgba(" + r + ", " + g + ", " + b + "," + opacity + " )";
  }
  // function for calculating 3 letters hex value
  calculatePartial(hex, opacity) {
    const r = parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16);
    const g = parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16);
    const b = parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16);
    return "rgba(" + r + ", " + g + ", " + b + "," + opacity + " )";
  }
  clampZoomFloor() {
    if (this.map.getZoom() > this.zoomFloor) {
      this.map.setZoom(this.zoomFloor);
    }
  }
  colourNameToRGB(color2, opacity) {
    const colors = {
      aliceblue: "#f0f8ff",
      antiquewhite: "#faebd7",
      aqua: "#00ffff",
      aquamarine: "#7fffd4",
      azure: "#f0ffff",
      beige: "#f5f5dc",
      bisque: "#ffe4c4",
      black: "#000000",
      blanchedalmond: "#ffebcd",
      blue: "#0000ff",
      blueviolet: "#8a2be2",
      brown: "#a52a2a",
      burlywood: "#deb887",
      cadetblue: "#5f9ea0",
      chartreuse: "#7fff00",
      chocolate: "#d2691e",
      coral: "#ff7f50",
      cornflowerblue: "#6495ed",
      cornsilk: "#fff8dc",
      crimson: "#dc143c",
      cyan: "#00ffff",
      darkblue: "#00008b",
      darkcyan: "#008b8b",
      darkgoldenrod: "#b8860b",
      darkgray: "#a9a9a9",
      darkgreen: "#006400",
      darkkhaki: "#bdb76b",
      darkmagenta: "#8b008b",
      darkolivegreen: "#556b2f",
      darkorange: "#ff8c00",
      darkorchid: "#9932cc",
      darkred: "#8b0000",
      darksalmon: "#e9967a",
      darkseagreen: "#8fbc8f",
      darkslateblue: "#483d8b",
      darkslategray: "#2f4f4f",
      darkturquoise: "#00ced1",
      darkviolet: "#9400d3",
      deeppink: "#ff1493",
      deepskyblue: "#00bfff",
      dimgray: "#696969",
      dodgerblue: "#1e90ff",
      firebrick: "#b22222",
      floralwhite: "#fffaf0",
      forestgreen: "#228b22",
      fuchsia: "#ff00ff",
      gainsboro: "#dcdcdc",
      ghostwhite: "#f8f8ff",
      gold: "#ffd700",
      goldenrod: "#daa520",
      gray: "#808080",
      green: "#008000",
      greenyellow: "#adff2f",
      honeydew: "#f0fff0",
      hotpink: "#ff69b4",
      indianred: "#cd5c5c",
      indigo: "#4b0082",
      ivory: "#fffff0",
      khaki: "#f0e68c",
      lavender: "#e6e6fa",
      lavenderblush: "#fff0f5",
      lawngreen: "#7cfc00",
      lemonchiffon: "#fffacd",
      lightblue: "#add8e6",
      lightcoral: "#f08080",
      lightcyan: "#e0ffff",
      lightgoldenrodyellow: "#fafad2",
      lightgrey: "#d3d3d3",
      lightgreen: "#90ee90",
      lightpink: "#ffb6c1",
      lightsalmon: "#ffa07a",
      lightseagreen: "#20b2aa",
      lightskyblue: "#87cefa",
      lightslategray: "#778899",
      lightsteelblue: "#b0c4de",
      lightyellow: "#ffffe0",
      lime: "#00ff00",
      limegreen: "#32cd32",
      linen: "#faf0e6",
      magenta: "#ff00ff",
      maroon: "#800000",
      mediumaquamarine: "#66cdaa",
      mediumblue: "#0000cd",
      mediumorchid: "#ba55d3",
      mediumpurple: "#9370d8",
      mediumseagreen: "#3cb371",
      mediumslateblue: "#7b68ee",
      mediumspringgreen: "#00fa9a",
      mediumturquoise: "#48d1cc",
      mediumvioletred: "#c71585",
      midnightblue: "#191970",
      mintcream: "#f5fffa",
      mistyrose: "#ffe4e1",
      moccasin: "#ffe4b5",
      navajowhite: "#ffdead",
      navy: "#000080",
      oldlace: "#fdf5e6",
      olive: "#808000",
      olivedrab: "#6b8e23",
      orange: "#ffa500",
      orangered: "#ff4500",
      orchid: "#da70d6",
      palegoldenrod: "#eee8aa",
      palegreen: "#98fb98",
      paleturquoise: "#afeeee",
      palevioletred: "#d87093",
      papayawhip: "#ffefd5",
      peachpuff: "#ffdab9",
      peru: "#cd853f",
      pink: "#ffc0cb",
      plum: "#dda0dd",
      powderblue: "#b0e0e6",
      purple: "#800080",
      rebeccapurple: "#663399",
      red: "#ff0000",
      rosybrown: "#bc8f8f",
      royalblue: "#4169e1",
      saddlebrown: "#8b4513",
      salmon: "#fa8072",
      sandybrown: "#f4a460",
      seagreen: "#2e8b57",
      seashell: "#fff5ee",
      sienna: "#a0522d",
      silver: "#c0c0c0",
      skyblue: "#87ceeb",
      slateblue: "#6a5acd",
      slategray: "#708090",
      snow: "#fffafa",
      springgreen: "#00ff7f",
      steelblue: "#4682b4",
      tan: "#d2b48c",
      teal: "#008080",
      thistle: "#d8bfd8",
      tomato: "#ff6347",
      turquoise: "#40e0d0",
      violet: "#ee82ee",
      wheat: "#f5deb3",
      white: "#ffffff",
      whitesmoke: "#f5f5f5",
      yellow: "#ffff00",
      yellowgreen: "#9acd32"
    };
    let hex;
    if (colors.hasOwnProperty(color2)) {
      hex = colors[color2].substr(1);
      return this.calculateFull(hex, opacity);
    } else {
      hex = color2.charAt(0) === "#" ? color2.substr(1) : color2;
      if (hex.length === 6) {
        return this.calculateFull(hex, opacity);
      } else if (hex.length === 3) {
        return this.calculatePartial(hex, opacity);
      }
    }
    return color2;
  }
  createLayerCluster(zIndex, options, map2) {
    let textColor = "white";
    if (options.clusterTextColor) {
      textColor = options.clusterTextColor;
    }
    let textSize = 10;
    if (options.clusterTextSize) {
      textSize = options.clusterTextSize;
    }
    let clusterDistance = 20;
    if (options.clusterDistance) {
      clusterDistance = options.clusterDistance;
    }
    let clusterImageWidth = 18;
    if (options.clusterImageWidth) {
      clusterImageWidth = options.clusterImageWidth;
    }
    let clusterImageHeight = 30;
    if (options.clusterImageHeight) {
      clusterImageHeight = options.clusterImageHeight;
    }
    let isExists = false;
    for (let i2 = 0; i2 < this.clusterImageSize.length; i2++) {
      if (this.clusterImageSize[i2].width === clusterImageWidth && this.clusterImageSize[i2].height === clusterImageHeight) {
        isExists = true;
        break;
      }
    }
    if (isExists === false) {
      this.clusterImageSize.push({ width: clusterImageWidth, height: clusterImageHeight });
    }
    const styleRenderer = {
      render: function({ count, position }, stats) {
        return new google.maps.Marker({
          position,
          icon: {
            url: options.clusterImageFileNo,
            scaledSize: new google.maps.Size(clusterImageWidth, clusterImageHeight)
          },
          label: {
            text: String(count),
            color: textColor,
            fontSize: `${textSize}px`
          },
          // adjust zIndex to be above other markers
          zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count
        });
      }
    };
    const clusterLayer = new MarkerClusterer({ renderer: styleRenderer });
    clusterLayer.set("isHeatMap", false);
    clusterLayer.set("isCluster", true);
    clusterLayer.set("clusterImageWidth", clusterImageWidth);
    clusterLayer.set("clusterImageHeight", clusterImageHeight);
    clusterLayer.onClusterClick = (mouseEvent, cluster, map3) => {
      const m = cluster.markers;
      const clusterFeaturesSelected = [];
      for (let i2 = 0; i2 < m.length; i2++) {
        clusterFeaturesSelected.push(m[i2]);
      }
      const latLng = mouseEvent.latLng;
      const pixel = this.convertLatLngToPixel(latLng);
      if (this.clusterClick && typeof this.clusterClick === "function") {
        this.clusterClick(clusterFeaturesSelected, pixel);
      }
    };
    return clusterLayer;
  }
  createEmptyLayer(zIndex, pStyle, title, isHeatMap = false, options = null, map2 = null) {
    if (isHeatMap) {
      const heatLayer = new this.google.maps.visualization.HeatmapLayer({
        opacity: 1
      });
      this.heatLayerConfig[zIndex] = {};
      if (options != null) {
        if (typeof options.gradient !== "undefined") {
          const g = ["rgba(0, 255, 255, 0)", "rgba(0, 255, 255, 1)"];
          for (let i2 = 0; i2 < options.gradient.length; i2++) {
            const c = this.colourNameToRGB(options.gradient[i2], 1);
            g.push(c);
          }
          if (options.gradient.length > 0) {
            this.heatLayerConfig[zIndex].gradient = g;
          }
        }
        if (typeof options.opacity !== "undefined") {
          this.heatLayerConfig[zIndex].opacity = options.opacity;
        }
        if (typeof options.radius !== "undefined") {
          this.heatLayerConfig[zIndex].radius = options.radius;
        }
        if (typeof options.zoomLevel !== "undefined") {
          this.heatLayerConfig[zIndex].zoomLevel = options.zoomLevel;
        }
      }
      heatLayer.set("isHeatMap", true);
      return heatLayer;
    } else {
      if (options && options.type === "cluster") {
        return this.createLayerCluster(zIndex, options, map2);
      } else {
        const dataLayer = new this.google.maps.Data();
        pStyle.zIndex = zIndex;
        dataLayer.setStyle(pStyle);
        dataLayer.set("isHeatMap", false);
        return dataLayer;
      }
    }
  }
  createLayerAsset(layerQuery, styleLayer, hasFilterQuery, styleFilter, hasSecondary, styleSecondary, hasPrimary, stylePrimary, hasUserItems, styleSelected, hasAddressPoint, stylePoint, map2) {
    let layerIndex = 0;
    if (this.layerAssets == null) {
      this.layerAssets = [];
    }
    if (layerQuery) {
      for (let i2 = 0; i2 < layerQuery.length; i2++) {
        if (layerQuery[i2].query.indexOf("_layer") < 0) {
          continue;
        }
        layerIndex++;
        this.layerAssets.push(this.createEmptyLayer(layerIndex, styleLayer, "layer" + layerIndex, layerQuery[i2].isHeatMap, layerQuery[i2].layer, map2));
      }
    }
    if (hasFilterQuery) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleLayer, "filter"));
      this.layerIndexFilter = layerIndex;
    }
    if (hasSecondary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleSecondary, "secondary"));
      this.layerIndexSecondary = layerIndex;
    }
    if (hasPrimary) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, stylePrimary, "primary"));
      this.layerIndexPrimary = layerIndex;
    }
    if (hasUserItems) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, styleSelected, "selectedItems"));
      this.layerIndexUser = layerIndex;
    }
    if (hasAddressPoint) {
      layerIndex++;
      this.layerAssets.push(this.createEmptyLayer(layerIndex, stylePoint, "addressPoint"));
      this.layerIndexAddress = layerIndex;
    }
    this.layerIndexTooltips = layerIndex + 1;
    this.layerIndexControl = layerIndex + 2;
  }
  createLayers(initObj, map2) {
    this.layerAssets = [];
    this.layerAssets.push(this.createEmptyLayer(0, {}, null));
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      const boundary = this.styleAddress.bind(this);
      this.createLayerAsset(initObj.layerAssets, boundary, true, boundary, false, null, false, null, false, null, true, boundary, map2);
    } else if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      if (initObj.layerAssets) {
        this.createLayerAsset(initObj.layerAssets, this.styleAddress.bind(this), true, this.styleAddress.bind(this), false, null, false, null, true, this.styleSelectedFunc.bind(this), false, null, map2);
      } else {
        this.createLayerAsset([], this.styleAddress.bind(this), true, this.styleAddress.bind(this), false, null, false, null, true, this.styleSelectedFunc.bind(this), false, null, map2);
      }
    } else if (this.type === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
      this.createLayerAsset(initObj.layerAssets, this.styleAddress.bind(this), true, this.styleAddress.bind(this), false, null, false, null, false, null, true, this.styleStAddress.bind(this), map2);
    } else if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      if (initObj.layerAssets) {
        this.createLayerAsset(initObj.layerAssets, this.styleAsset.bind(this), true, this.styleAsset.bind(this), true, this.styleSecondaryAssetFunc.bind(this), true, this.stylePrimaryAssetFunc.bind(this), false, null, true, this.styleAsset.bind(this), map2);
      } else {
        this.createLayerAsset([], this.styleAsset.bind(this), true, this.styleAsset.bind(this), true, this.styleSecondaryAssetFunc.bind(this), true, this.stylePrimaryAssetFunc.bind(this), false, null, true, this.styleAsset.bind(this), map2);
      }
    }
  }
  createHeatMap(layerIndex) {
    this.layerAssets[layerIndex] = new this.google.maps.visualization.HeatmapLayer({
      data: this.heatDatas,
      map: this.map,
      opacity: 1,
      isHeatMap: true
    });
    if (typeof this.heatLayerConfig[layerIndex].gradient !== "undefined") {
      this.layerAssets[layerIndex].set("gradient", this.heatLayerConfig[layerIndex].gradient);
    }
    if (typeof this.heatLayerConfig[layerIndex].opacity !== "undefined") {
      this.layerAssets[layerIndex].set("opacity", this.heatLayerConfig[layerIndex].opacity);
    }
    if (typeof this.heatLayerConfig[layerIndex].radius !== "undefined") {
      this.layerAssets[layerIndex].set("radius", this.heatLayerConfig[layerIndex].radius);
    }
    if (typeof this.heatLayerConfig[layerIndex].zoomLevel !== "undefined") {
      const z = this.map.getZoom();
      if (z < this.heatLayerConfig[layerIndex].zoomLevel) {
        this.layerAssets[layerIndex].setMap(null);
      }
    }
    this.heatDatas = [];
    this.lstHeatWeight = [];
  }
  checkAndDrawGeoJson(geoJSON) {
    this.shapes.clearAllShape();
    const featureJSON = geoJSON.features;
    const obj = this.initHaveJSON(featureJSON, this.type);
    this.bounds = obj.bounds;
    this.countPoint = obj.countPoint;
  }
  getIconAnchor(fileNo) {
    let anchor2 = [0, 0];
    let index = -1;
    for (let i2 = 0; i2 < this.iconAnchors.length; i2++) {
      if (this.iconAnchors[i2].fileNo === fileNo) {
        index = i2;
        break;
      }
    }
    if (index > -1) {
      anchor2 = this.iconAnchors[index].imageAnchor;
    } else {
      console.log(`*** the fileNo has not existed in config: ${fileNo}`);
    }
    return anchor2;
  }
  createPointByJson(geoJson, id2, bounds, countPoint, fillColor, color2, lineWidth, lineDash, arrowHead, icon, anchor2) {
    let radius = null;
    if (geoJson.properties) {
      radius = typeof geoJson.properties.radius === "undefined" || geoJson.properties.radius === null ? null : geoJson.properties.radius;
    }
    const latLng = new this.google.maps.LatLng(geoJson.geometry.coordinates[1], geoJson.geometry.coordinates[0]);
    if (geoJson.properties?.fillColor) {
      fillColor = geoJson.properties?.fillColor;
    }
    if (geoJson.properties?.color) {
      color2 = geoJson.properties?.color;
    }
    if (radius == null) {
      let mIcon = null;
      if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
        if (icon) {
          const imageAnchor = this.getIconAnchor(icon);
          mIcon = {
            url: icon,
            anchor: new this.google.maps.Point(imageAnchor[0], imageAnchor[1])
          };
        } else {
          mIcon = {
            path: this.google.maps.SymbolPath.CIRCLE,
            fillColor,
            fillOpacity: 0.6,
            strokeColor: color2,
            strokeOpacity: 0.9,
            strokeWeight: lineWidth,
            scale: 7
          };
          if (geoJson.properties?.text) {
            mIcon.strokeOpacity = 0;
            mIcon.fillOpacity = 0;
          }
        }
      }
      const pointStyle = {
        position: latLng,
        map: this.map,
        // editable: true,
        draggable: true,
        strokeColor: color2,
        fillColor,
        icon: mIcon
      };
      if (geoJson.properties?.text) {
        pointStyle.strokeOpacity = 0;
        pointStyle.fillOpacity = 0;
      }
      const m = new this.google.maps.Marker(pointStyle);
      m.type = this.google.maps.drawing.OverlayType.MARKER;
      m.realType = "Marker";
      bounds.extend(latLng);
      countPoint++;
      if (geoJson.properties?.text) {
        const id3 = geoJson.properties?.textId;
        this.createTextBoxFeature(m, latLng, geoJson.properties?.text, id3, false, geoJson, geoJson.properties?.font, geoJson.properties?.fontSize);
      } else {
        this.shapes.add(m, geoJson, id2, null, color2, lineWidth, lineDash, arrowHead, icon, anchor2, null, null);
      }
    } else {
      const circleStyle = {
        map: this.map,
        center: latLng,
        radius,
        // editable: true,
        draggable: true,
        strokeColor: color2,
        fillColor,
        strokeWeight: lineWidth
      };
      const c = new this.google.maps.Circle(circleStyle);
      c.type = this.google.maps.drawing.OverlayType.CIRCLE;
      c.realType = "Circle";
      bounds.union(c.getBounds());
      this.shapes.add(c, geoJson, id2, null, color2, lineWidth, lineDash, arrowHead, arrowHead, null, null, null, null);
    }
    return { bounds, countPoint };
  }
  createMultiPointByJson(geoJson, bounds, fillColor, color2, lineWidth, lineDash, arrowHead, iconImage, anchor2) {
    let radius1 = null;
    color2 = this.multiColor;
    fillColor = this.multiColor;
    if (geoJson.properties) {
      radius1 = typeof geoJson.properties.radius === "undefined" || geoJson.properties.radius === null ? null : geoJson.properties.radius;
      if (geoJson.properties.fillColor) {
        fillColor = geoJson.properties.fillColor;
      }
      if (geoJson.properties.color) {
        color2 = geoJson.properties.color;
      }
    }
    const dataCoords = geoJson.geometry.coordinates;
    if (radius1 == null) {
      const idGroup = SclMapConstantService.DRAWING_MULTI_POINT;
      for (let j = 0; j < dataCoords.length; j++) {
        const latLng1 = new this.google.maps.LatLng(dataCoords[j][1], dataCoords[j][0]);
        let icon = {};
        if (iconImage) {
          icon = iconImage;
        } else {
          icon = {
            path: this.google.maps.SymbolPath.CIRCLE,
            fillColor,
            fillOpacity: 0.6,
            strokeColor: color2,
            strokeOpacity: 0.9,
            strokeWeight: lineWidth,
            scale: 7
          };
        }
        const c = new this.google.maps.Marker({
          map: this.map,
          position: latLng1,
          // editable: true,
          draggable: true,
          icon
        });
        c.type = this.google.maps.drawing.OverlayType.MARKER;
        c.realType = "MultiPoint";
        bounds.extend(latLng1);
        const geoFea = {
          type: "Feature",
          properties: geoJson.properties,
          geometry: {
            type: "MultiPoint",
            coordinates: dataCoords[j]
          }
        };
        const count = this.storeDrawMultiShape(idGroup);
        this.shapes.add(c, geoFea, idGroup + "_" + count, idGroup, color2, lineWidth, lineDash, arrowHead, arrowHead, icon, anchor2, null, null);
      }
    } else {
      fillColor = geoJson.properties?.fillColor ? geoJson.properties.fillColor : this.singleColor;
      color2 = geoJson.properties?.color ? geoJson.properties.color : this.singleColor;
      const idGroup = SclMapConstantService.DRAWING_MULTI_CIRCLE;
      for (let j = 0; j < dataCoords.length; j++) {
        const latLng2 = new this.google.maps.LatLng(dataCoords[j][1], dataCoords[j][0]);
        const c = new this.google.maps.Circle({
          map: this.map,
          center: latLng2,
          radius: radius1,
          // editable: true,
          draggable: true,
          strokeColor: color2,
          strokeWeight: lineWidth,
          fillColor
        });
        c.type = this.google.maps.drawing.OverlayType.CIRCLE;
        c.realType = "MultiPoint";
        bounds.union(c.getBounds());
        const geoFea = {
          type: "Feature",
          properties: geoJson.properties,
          geometry: {
            type: "MultiPoint",
            coordinates: dataCoords[j]
          }
        };
        const count = this.storeDrawMultiShape(idGroup);
        this.shapes.add(c, geoFea, idGroup + "_" + count, idGroup, color2, lineWidth, lineDash, arrowHead, null, null, null, null);
      }
    }
    return bounds;
  }
  createPolygonByJson(geoJson, id2, bounds, fillColor, color2, lineWidth, lineDash, arrowHead) {
    const triangleCoords = [];
    const dataCoords = geoJson.geometry.coordinates[0];
    for (let j = 0; j < dataCoords.length; j++) {
      const pLatLng = { lat: dataCoords[j][1], lng: dataCoords[j][0] };
      triangleCoords.push(pLatLng);
      bounds.extend(pLatLng);
    }
    fillColor = geoJson.properties?.fillColor ? geoJson.properties.fillColor : this.singleColor;
    color2 = geoJson.properties?.color ? geoJson.properties.color : this.singleColor;
    let radius = null;
    if (geoJson.properties) {
      radius = typeof geoJson.properties.radius === "undefined" || geoJson.properties.radius === null ? null : geoJson.properties.radius;
    }
    if (radius) {
      const center = sclUtilMap2.calculateCircleCenterPoint(geoJson.geometry.coordinates[0][0], geoJson.geometry.coordinates[0][2]);
      const latLng = new this.google.maps.LatLng(center[1], center[0]);
      const style2 = {
        map: this.map,
        center: latLng,
        radius,
        // editable: true,
        draggable: true,
        strokeColor: color2,
        strokeWeight: lineWidth,
        fillColor
      };
      const c = new this.google.maps.Circle(style2);
      c.type = this.google.maps.drawing.OverlayType.CIRCLE;
      c.realType = "Circle";
      bounds.union(c.getBounds());
      this.shapes.add(c, geoJson, id2, null, color2, lineWidth, lineDash, arrowHead, null, null, null, null);
    } else {
      const style2 = {
        map: this.map,
        paths: triangleCoords,
        // editable: true,
        draggable: true,
        strokeColor: color2,
        strokeWeight: lineWidth,
        fillColor
      };
      const poly = new this.google.maps.Polygon(style2);
      poly.type = this.google.maps.drawing.OverlayType.POLYGON;
      poly.realType = "Polygon";
      this.shapes.add(poly, geoJson, id2, null, color2, lineWidth, lineDash, arrowHead, null, null, null, null);
    }
    return bounds;
  }
  createMultiPolygonByJson(geoJson, bounds, fillColor, color2, lineWidth, lineDash, arrowHead) {
    fillColor = geoJson.properties?.fillColor ? geoJson.properties.fillColor : this.multiColor;
    color2 = geoJson.properties?.color ? geoJson.properties.color : this.multiColor;
    const dataCoords = geoJson.geometry.coordinates;
    const properties2 = geoJson.properties;
    const idGroup = properties2?.idGroup ? properties2?.idGroup : SclMapConstantService.DRAWING_MULTI_POLYGON;
    for (let j = 0; j < dataCoords.length; j++) {
      const mpCoords = [];
      for (let n = 0; n < dataCoords[j].length; n++) {
        const nCoords = [];
        for (let m = 0; m < dataCoords[j][n].length; m++) {
          const pLatLng2 = { lat: dataCoords[j][n][m][1], lng: dataCoords[j][n][m][0] };
          nCoords.push(pLatLng2);
          bounds.extend(pLatLng2);
        }
        mpCoords.push(nCoords);
      }
      const poly = new this.google.maps.Polygon({
        map: this.map,
        paths: mpCoords,
        draggable: true,
        strokeColor: color2,
        strokeWeight: lineWidth,
        fillColor
      });
      poly.type = this.google.maps.drawing.OverlayType.POLYGON;
      poly.realType = "MultiPolygon";
      const geoFea = {
        type: "Feature",
        properties: properties2,
        geometry: {
          type: "MultiPolygon",
          coordinates: dataCoords[j]
        }
      };
      const count = this.storeDrawMultiShape(idGroup);
      this.shapes.add(poly, geoFea, idGroup + "_" + count, idGroup, color2, lineWidth, lineDash, arrowHead, null, null, null, null);
    }
    return bounds;
  }
  createLineStringByJson(geoJson, id2, bounds, fillColor, color2, lineWidth, lineDash, arrowHead, icons, dimensionId, dimensionValue, fontFamily, fontSize) {
    const lineCoords = [];
    const dataCoords = geoJson.geometry.coordinates;
    for (let j = 0; j < dataCoords.length; j++) {
      const lsLatLng = { lat: dataCoords[j][1], lng: dataCoords[j][0] };
      lineCoords.push(lsLatLng);
      bounds.extend(lsLatLng);
    }
    fillColor = geoJson.properties?.fillColor ? geoJson.properties.fillColor : this.singleColor;
    color2 = geoJson.properties?.color ? geoJson.properties.color : this.singleColor;
    const style2 = {
      map: this.map,
      path: lineCoords,
      geodesic: true,
      // editable: true,
      draggable: true,
      strokeColor: color2,
      strokeWeight: lineWidth,
      fillColor
    };
    if (icons) {
      icons.push(this.styleArrow(arrowHead));
      style2.icons = icons;
      style2.strokeOpacity = 0;
    } else {
      style2.icons = [this.styleArrow(arrowHead)];
    }
    const poline = new this.google.maps.Polyline(style2);
    poline.type = this.google.maps.drawing.OverlayType.POLYLINE;
    poline.realType = "LineString";
    this.shapes.add(poline, geoJson, id2, null, color2, lineWidth, lineDash, arrowHead, null, null, dimensionId, dimensionValue);
    if (dimensionId !== null) {
      const coor = { lat: dataCoords[0][1], lng: dataCoords[0][0] };
      this.createDimensionFeature(dimensionId, coor, dimensionValue, fontFamily, fontSize);
    }
    return bounds;
  }
  createMultiLineStringByJson(geoJson, bounds, fillColor, color2, lineWidth, lineDash, arrowHead, icons) {
    fillColor = geoJson.properties?.fillColor ? geoJson.properties.fillColor : this.multiColor;
    color2 = geoJson.properties?.color ? geoJson.properties.color : this.multiColor;
    const dataCoords = geoJson.geometry.coordinates;
    const idGroup = SclMapConstantService.DRAWING_MULTI_LINE_STRING;
    for (let j = 0; j < dataCoords.length; j++) {
      const mCoords = [];
      const mCoorsJson = [];
      for (let n = 0; n < dataCoords[j].length; n++) {
        const pLatLng = { lat: dataCoords[j][n][1], lng: dataCoords[j][n][0] };
        mCoords.push(pLatLng);
        mCoorsJson.push(dataCoords[j][n]);
        bounds.extend(pLatLng);
      }
      const style2 = {
        map: this.map,
        path: mCoords,
        geodesic: true,
        // editable: true,
        draggable: true,
        strokeColor: color2,
        strokeWeight: lineWidth,
        fillColor
      };
      if (icons) {
        icons.push(this.styleArrow(arrowHead));
        style2.icons = icons;
        style2.strokeOpacity = 0;
      } else {
        style2.icons = [this.styleArrow(arrowHead)];
      }
      const poline = new this.google.maps.Polyline(style2);
      poline.type = this.google.maps.drawing.OverlayType.POLYLINE;
      poline.realType = "MultiLineString";
      const geoFea = {
        type: "Feature",
        properties: geoJson.properties,
        geometry: {
          type: "MultiLineString",
          coordinates: mCoorsJson
        }
      };
      const count = this.storeDrawMultiShape(idGroup);
      this.shapes.add(poline, geoFea, idGroup + "_" + count, idGroup, color2, lineWidth, lineDash, arrowHead, null, null, null, null);
    }
    return bounds;
  }
  initHaveJSON(featureJSON, style2) {
    let bounds = new this.google.maps.LatLngBounds();
    let countPoint = 0;
    for (let i2 = 0; i2 < featureJSON.length; i2++) {
      if (typeof featureJSON[i2].geometry === "undefined" || featureJSON[i2].geometry === null) {
        continue;
      }
      const type = featureJSON[i2].geometry.type;
      let id2 = "shape_" + i2;
      if (featureJSON[i2].properties?.dimensionId) {
        id2 = featureJSON[i2].properties?.dimensionId;
      }
      let color2 = null;
      let fillColor = null;
      let lineWidth = featureJSON[i2].properties?.lineWidth ? featureJSON[i2].properties.lineWidth : 2;
      let lineDash = featureJSON[i2].properties?.lineDash ? featureJSON[i2].properties.lineDash : null;
      const arrowHead = featureJSON[i2].properties?.arrowHead;
      const icon = featureJSON[i2].properties?.point;
      const anchor2 = featureJSON[i2].properties?.anchor ? featureJSON[i2].properties?.anchor : [0.5, 0.5];
      let icons = null;
      if (lineDash && Array.isArray(lineDash) && lineDash.length > 1) {
        icons = [
          {
            icon: {
              path: `m 0 -${lineDash[0]} l 0 ${lineDash[0]}`,
              // dash length
              strokeOpacity: 1,
              scale: lineWidth
            },
            offset: "0",
            repeat: `${(lineDash[0] + lineDash[1]) * lineWidth}px`
            // dash space
          }
        ];
      }
      switch (type) {
        case "Point":
          const obj = this.createPointByJson(featureJSON[i2], id2, bounds, countPoint, fillColor, color2, lineWidth, lineDash, arrowHead, icon, anchor2);
          bounds = obj.bounds;
          countPoint = obj.countPoint;
          break;
        case "MultiPoint": {
          bounds = this.createMultiPointByJson(featureJSON[i2], bounds, fillColor, color2, lineWidth, lineDash, arrowHead, icon, anchor2);
          break;
        }
        case "Polygon": {
          bounds = this.createPolygonByJson(featureJSON[i2], id2, bounds, fillColor, color2, lineWidth, lineDash, arrowHead);
          break;
        }
        case "MultiPolygon": {
          bounds = this.createMultiPolygonByJson(featureJSON[i2], bounds, fillColor, color2, lineWidth, lineDash, arrowHead);
          break;
        }
        case "LineString": {
          bounds = this.createLineStringByJson(featureJSON[i2], id2, bounds, fillColor, color2, lineWidth, lineDash, arrowHead, icons, featureJSON[i2].properties?.dimensionId, featureJSON[i2].properties?.dimension, featureJSON[i2].properties?.font, featureJSON[i2].properties?.fontSize);
          break;
        }
        case "MultiLineString": {
          bounds = this.createMultiLineStringByJson(featureJSON[i2], bounds, fillColor, color2, lineWidth, lineDash, arrowHead, icons);
          break;
        }
      }
    }
    return { bounds, countPoint };
  }
  shapeModel() {
    const self2 = this;
    return {
      collection: {},
      selectedShape: null,
      actionType: SclMapConstantService.DRAWING_ACTION_NA,
      setDirtyFunction: null,
      spawnShape: function(e, geoJson, id2, idGroup, color2, lineWidth, lineDash, text, arrowHead, iconImage, iconAnchor, dimensionId, dimensionValue, fontFamily, fontSize) {
        self2.hasDocumentChangeValue = false;
        const shape = e.overlay != null ? e.overlay : e;
        const that = this;
        shape.type = e.type;
        shape.realType = e.realType;
        shape.id = id2;
        shape.idGroup = idGroup;
        shape.geoJson = geoJson;
        if (!shape.geoJson.properties) {
          shape.geoJson.properties = {};
        }
        shape.geoJson.properties.idGroup = idGroup;
        if (color2) {
          shape.geoJson.properties.color = color2;
          shape.geoJson.properties.fillColor = color2;
        }
        if (lineWidth) {
          shape.geoJson.properties.lineWidth = lineWidth;
        }
        if (lineDash) {
          shape.geoJson.properties.lineDash = lineDash;
        }
        if (text) {
          shape.geoJson.properties.text = text;
          shape.geoJson.properties.textId = id2;
        }
        if (arrowHead) {
          shape.geoJson.properties.arrowHead = arrowHead;
        }
        if (iconImage) {
          shape.geoJson.properties.point = iconImage;
          shape.geoJson.properties.anchor = iconAnchor;
        }
        if (dimensionId) {
          shape.geoJson.properties.dimensionId = dimensionId;
          shape.geoJson.properties.dimension = dimensionValue;
        }
        if (fontFamily) {
          shape.geoJson.properties.font = fontFamily;
        }
        if (fontSize) {
          shape.geoJson.properties.fontSize = fontSize;
        }
        this.collection[shape.id] = shape;
        that.setSelection(shape);
        return shape;
      },
      add: function(e, geoJson, id2, idGroup, color2, lineWidth, lineDash, arrowHead, iconImage, iconAnchor, dimensionId, dimensionValue) {
        const that = this;
        const shape = this.spawnShape(e, geoJson, id2, idGroup, color2, lineWidth, lineDash, null, arrowHead, iconImage, iconAnchor, dimensionId, dimensionValue);
        self2.google.maps.event.addListener(shape, "click", function() {
          that.setSelection(this);
          if (that.actionType === SclMapConstantService.DRAWING_ACTION_DELETE) {
            that.deleteSelected();
            if (that.setDirtyFunction) {
              that.setDirtyFunction();
            }
          }
        });
        self2.google.maps.event.addListener(shape, "dragstart", function() {
          console.log("drag start");
        });
        self2.google.maps.event.addListener(shape, "dragend", function() {
          console.log("drag end");
          switch (e.type) {
            case self2.google.maps.drawing.OverlayType.CIRCLE:
              shape.geoJson.geometry.coordinates = [shape.getCenter().lng(), shape.getCenter().lat()];
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
              break;
            case self2.google.maps.drawing.OverlayType.MARKER:
              if (shape.realType === "MultiPoint") {
                const lng = shape.position.lng();
                const lat = shape.position.lat();
                shape.geoJson.geometry.coordinates = [lng, lat];
                if (self2.setDirtyFunction) {
                  self2.setDirtyFunction();
                }
              }
              break;
          }
          if (self2.setDirtyFunction) {
            self2.setDirtyFunction();
          }
        });
        switch (e.type) {
          case self2.google.maps.drawing.OverlayType.POLYGON:
            const paths = shape.getPaths();
            paths.forEach(function(path1, idx) {
              self2.google.maps.event.addListener(path1, "insert_at", function() {
                that.updateCoordsPolygon(shape, path1);
                if (self2.setDirtyFunction) {
                  self2.setDirtyFunction();
                }
              });
              self2.google.maps.event.addListener(path1, "set_at", function() {
                that.updateCoordsPolygon(shape, path1);
                if (self2.setDirtyFunction) {
                  self2.setDirtyFunction();
                }
              });
              self2.google.maps.event.addListener(path1, "remove_at", function() {
                that.updateCoordsPolygon(shape, path1);
                if (self2.setDirtyFunction) {
                  self2.setDirtyFunction();
                }
              });
            });
            break;
          case self2.google.maps.drawing.OverlayType.CIRCLE:
            self2.google.maps.event.addListener(shape, "radius_changed", function() {
              shape.geoJson.properties.radius = shape.getRadius();
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            });
            break;
          case self2.google.maps.drawing.OverlayType.RECTANGLE:
            self2.google.maps.event.addListener(shape, "bounds_changed", function() {
              const b = shape.getBounds();
              const p = [
                [b.getSouthWest().lng(), b.getSouthWest().lat()],
                [b.getNorthEast().lng(), b.getSouthWest().lat()],
                [b.getNorthEast().lng(), b.getNorthEast().lat()],
                [b.getSouthWest().lng(), b.getNorthEast().lat()],
                [b.getSouthWest().lng(), b.getSouthWest().lat()]
              ];
              shape.geoJson.geometry.coordinates[0] = p;
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            });
            break;
          case self2.google.maps.drawing.OverlayType.POLYLINE:
            const path = shape.getPath();
            self2.google.maps.event.addListener(path, "insert_at", function() {
              console.log("insert_at " + e.type);
              that.updateCoordsPolyline(shape, path.getArray());
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            });
            self2.google.maps.event.addListener(path, "set_at", function() {
              console.log("set_at " + e.type);
              that.updateCoordsPolyline(shape, path.getArray());
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            });
            self2.google.maps.event.addListener(path, "remove_at", function() {
              console.log("remove_at " + e.type);
              that.updateCoordsPolyline(shape, path.getArray());
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            });
            break;
        }
      },
      addTextBox: function(e, geoJson, id2, text, fontFamily, fontSize) {
        const shape = this.spawnShape(e, geoJson, id2, null, null, null, null, text, null, null, null, fontFamily, fontSize);
        shape.geoJson.properties.textId = id2;
        return shape;
      },
      setText: function(text, id2) {
        this.collection[id2].geoJson.properties.text = text;
      },
      findById: function(id2) {
        return this.collection[id2];
      },
      setSelection: function(shape) {
        self2.hasDocumentChangeValue = false;
        if (self2.selectedShape !== shape) {
          self2.clearSelection();
          self2.selectedShape = shape;
          shape.set("draggable", true);
          shape.set("editable", true);
        }
      },
      deleteSelected: function() {
        self2.hasDocumentChangeValue = false;
        if (self2.selectedShape) {
          const shape = self2.selectedShape;
          self2.clearSelection();
          shape.setMap(null);
          delete this.collection[shape.id];
        }
      },
      clearSelection: function() {
        self2.hasDocumentChangeValue = false;
        if (self2.selectedShape) {
          self2.selectedShape.set("draggable", false);
          self2.selectedShape.set("editable", false);
          self2.selectedShape = null;
        }
      },
      getGeoJson: function() {
        const geoJson = [];
        const dicShape = {};
        for (const k in this.collection) {
          if (this.collection.hasOwnProperty(k)) {
            const shape = this.collection[k];
            if (shape.realType === "MultiLineString" || shape.realType === "MultiPoint" || shape.realType === "MultiPolygon") {
              const coors = [];
              for (let i2 = 0; i2 < shape.geoJson.geometry.coordinates.length; i2++) {
                coors.push(shape.geoJson.geometry.coordinates[i2]);
              }
              if (shape.idGroup in dicShape) {
                const obj = dicShape[shape.idGroup];
                if (obj) {
                  obj.geometry.coordinates.push(coors);
                  obj.properties = shape.geoJson.properties;
                }
              } else {
                const jsonData = {
                  type: "Feature",
                  properties: shape.geoJson.properties,
                  geometry: {
                    type: shape.realType,
                    coordinates: [coors]
                  }
                };
                dicShape[shape.idGroup] = jsonData;
              }
            } else if (shape.realType === "Point" && shape.type === "circle" && self2.isDrawCircleAsPolygon) {
              const coords = sclUtilMap2.circleToPolygon(shape.geoJson.geometry.coordinates, shape.geoJson.properties.radius);
              const json = {
                type: "Feature",
                geometry: {
                  type: "Polygon",
                  coordinates: coords
                },
                properties: shape.geoJson.properties
              };
              json.properties.subType = "Circle";
              geoJson.push(json);
            } else {
              geoJson.push(shape.geoJson);
            }
          }
        }
        for (const key in dicShape) {
          if (dicShape.hasOwnProperty(key)) {
            geoJson.push(dicShape[key]);
          }
        }
        return geoJson;
      },
      updateCoordsPolygon: function(shape, path) {
        const newGeoJson = shape.geoJson;
        const newCoords = [];
        const len = path.getLength();
        for (let i2 = 0; i2 < len; i2++) {
          const xy = path.getAt(i2);
          newCoords.push([xy.lng(), xy.lat()]);
        }
        if (newCoords[0][0] !== newCoords[len - 1][0] || newCoords[0][1] !== newCoords[len - 1][1]) {
          newCoords.push([path.getAt(0).lng(), path.getAt(0).lat()]);
        }
        newGeoJson.geometry.coordinates[0] = newCoords;
        shape.geoJson = newGeoJson;
      },
      updateCoordsMultiPolygon: function(shape, path, idx) {
        const newGeoJson = shape.geoJson;
        const newCoords = [];
        const len = path.getLength();
        for (let i2 = 0; i2 < len; i2++) {
          const xy = path.getAt(i2);
          newCoords.push([xy.lng(), xy.lat()]);
        }
        if (newCoords[0][0] !== newCoords[len - 1][0] || newCoords[0][1] !== newCoords[len - 1][1]) {
          newCoords.push([path.getAt(0).lng(), path.getAt(0).lat()]);
        }
        newGeoJson.geometry.coordinates[idx][0] = newCoords;
        shape.geoJson = newGeoJson;
      },
      updateCoordsPolyline: function(shape, path) {
        const newCoords = [];
        for (let i2 = 0; i2 < path.length; i2++) {
          newCoords.push([path[i2].lng(), path[i2].lat()]);
        }
        shape.geoJson.geometry.coordinates = newCoords;
        if (shape.geoJson.properties.dimensionId !== null) {
          const pos0 = { lat: newCoords[0][1], lng: newCoords[0][0] };
          const pos = { lat: newCoords[newCoords.length - 1][1], lng: newCoords[newCoords.length - 1][0] };
          const distance2 = self2.google.maps.geometry.spherical.computeDistanceBetween(pos0, pos);
          shape.geoJson.properties.dimension = distance2;
        }
      },
      clearAllShape: function() {
        for (const k in this.collection) {
          if (this.collection.hasOwnProperty(k)) {
            const shapeId = this.collection[k].id;
            this.collection[k].setMap(null);
            delete this.collection[shapeId];
          }
        }
      }
    };
  }
  cacheIconForDrawing(iconInfo) {
    return new Promise((resolve, reject) => {
      const url = iconInfo.fileNo.indexOf("api/getFile") > -1 ? iconInfo.fileNo : `api/getFile/${iconInfo.fileNo}`;
      let result = {
        fileNo: url,
        imageAnchor: [0, 0]
      };
      try {
        let img = new Image();
        img.onload = () => {
          let anchor2 = [0.5, 0.5];
          if (Array.isArray(iconInfo.imageAnchor) && iconInfo.imageAnchor.length == 2) {
            anchor2 = iconInfo.imageAnchor;
          }
          const anchorX = img.width * anchor2[0];
          const anchorY = img.height * anchor2[1];
          result.imageAnchor = [anchorX, anchorY];
          let existed = false;
          for (let i2 = 0; i2 < this.iconAnchors.length; i2++) {
            if (this.iconAnchors[i2].fileNo === url) {
              existed = true;
              break;
            }
          }
          if (existed === false) {
            this.iconAnchors.push(result);
          }
          resolve(result);
        };
        img.src = url;
      } catch (err) {
        console.log(`*** load image error: ${JSON.stringify(iconInfo)}`);
        reject(result);
      }
    });
  }
  init(initObj, keyName) {
    return __async(this, null, function* () {
      __superGet(_SclMappingFunctionGoogleService.prototype, this, "init").call(this, initObj, keyName);
      this.defaultLat = initObj.defaultLat ? initObj.defaultLat : -37.8;
      this.defaultLon = initObj.defaultLon ? initObj.defaultLon : 144.9;
      this.defaultZoom = initObj.defaultZoom ? initObj.defaultZoom : 10;
      const scrollWheel = initObj.disableMouseWheel ? !initObj.disableMouseWheel : true;
      if (initObj.singleSelectMode) {
        this.funcSingleSelectMode = initObj.singleSelectMode;
      }
      if (initObj.singleSelectModeCluster) {
        this.singleSelectModeCluster = initObj.singleSelectModeCluster;
      }
      if (initObj.drawStartCluster) {
        this.drawStartCluster = initObj.drawStartCluster;
      }
      if (initObj.drawEndCluster) {
        this.drawEndCluster = initObj.drawEndCluster;
      }
      this.selectedAssets = [];
      if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
        this.mapDiv.addEventListener("click", this.mapDivOnClick.bind(this));
        this.mapDiv.addEventListener("mousemove", this.mapDivOnMouseMove.bind(this));
      }
      this.shapes = this.shapeModel();
      this.selectedFeatures = [];
      const map2 = new this.google.maps.Map(initObj.target, {
        center: { lat: this.defaultLat, lng: this.defaultLon },
        zoom: this.defaultZoom,
        scrollwheel: scrollWheel,
        zoomControl: true,
        mapTypeControl: true
      });
      this.map = map2;
      this.createLayers(initObj, this.map);
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        this.layerAssets[i2].setMap(this.map);
      }
      this.dicDrawShape = {};
      this.loadSaveData(initObj);
      const lstControlId = [];
      if (this.ActionControls.length > 0) {
        const mapHeight = this.map.getDiv().offsetHeight;
        for (let i2 = 0; i2 < this.ActionControls.length; i2++) {
          for (let j = 0; j < this.ActionControls[i2].childNodes.length; j++) {
            const cId = initObj.mapId + "_control" + j;
            this.ActionControls[i2].childNodes[j].id = cId;
            lstControlId.push(cId);
            if (this.isBottom) {
              this.ActionControls[i2].childNodes[j].style.display = "flex";
              const div = document.createElement("div");
              div.id = cId + "_div";
              div.classList.add("gg-custom-control-bottom");
              div.style.width = this.ActionControls[i2].childNodes[j].childNodes.length / 2 * this.drawToolButtonSize + "px";
              div.appendChild(this.ActionControls[i2].childNodes[j]);
              this.map.controls[this.google.maps.ControlPosition.BOTTOM_LEFT].push(div);
              this.divCustomControl = div;
            } else {
              const div = document.createElement("div");
              div.id = cId + "_div";
              div.style.marginLeft = "10px";
              div.classList.add("gg-custom-control");
              let h = 0;
              for (let k = 0; k < this.ActionControls[i2].childNodes[j].childNodes.length; k++) {
                if (this.ActionControls[i2].childNodes[j].childNodes[k].tagName.toLowerCase() === "label") {
                  h += this.drawToolButtonSize;
                }
              }
              div.style.height = h + "px";
              div.appendChild(this.ActionControls[i2].childNodes[j]);
              this.map.controls[this.google.maps.ControlPosition.LEFT_CENTER].push(div);
              this.divCustomControl = div;
            }
          }
        }
      }
      this.map.addListener("tilesloaded", this.onMapTilesloaded.bind(this, initObj));
      this.map.addListener("zoom_changed", this.onMapZoomChanged.bind(this));
      if (initObj.style === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
        this.styleAddress(null);
        if (typeof initObj.selectionStyle !== "undefined" && initObj.selectionStyle !== null) {
          this.selectionStyle = initObj.selectionStyle;
        }
        this.setLayerSelectAsset();
      } else if (initObj.style === 3) {
        if (typeof initObj.primaryAssetSelection !== "undefined" && initObj.primaryAssetSelection !== null) {
          this.primaryAssetSelection = initObj.primaryAssetSelection;
        }
        if (typeof initObj.secondaryAssetSelection !== "undefined" && initObj.secondaryAssetSelection !== null) {
          this.secondaryAssetSelection = initObj.secondaryAssetSelection;
        }
        this.addressImageAnchor = initObj.addressImageAnchor;
        this.primaryImageAnchor = initObj.primaryImageAnchor;
        this.secondaryImageAnchor = initObj.secondaryImageAnchor;
        this.styleAsset(null);
      }
      this.map.setOptions({ draggableCursor: "default" });
      this.map.addListener("idle", this.onMapIdle.bind(this));
      this.map.addListener("bounds_changed", this.onMapBoundsChanged.bind(this, initObj));
    });
  }
  loadSaveData(initObj) {
    return __async(this, null, function* () {
      if (this.drawIcons.length > 0) {
        for (let i2 = 0; i2 < this.drawIcons.length; i2++) {
          yield this.cacheIconForDrawing(this.drawIcons[i2]);
        }
      }
      if (initObj.formatGeoJSON && initObj.formatGeoJSON.features) {
        const featureJSON = initObj.formatGeoJSON.features;
        for (let i2 = 0; i2 < featureJSON.length; i2++) {
          const icon = featureJSON[i2].properties?.point;
          const anchor2 = featureJSON[i2].properties?.anchor ? featureJSON[i2].properties?.anchor : [0.5, 0.5];
          if (icon) {
            yield this.cacheIconForDrawing({ fileNo: icon, imageAnchor: anchor2 });
          }
        }
        this.checkAndDrawGeoJson(initObj.formatGeoJSON);
      }
    });
  }
  onMapTilesloaded(initObj) {
    console.log("%c tiles have been loaded", "color:blue");
    if (this.setupTooltipUI && typeof this.setupTooltipUI === "function") {
      this.setupTooltipUI();
      this.setupTooltipUI = null;
    }
    if (this.bounds != null) {
      this.map.fitBounds(this.bounds);
      this.map.setCenter(this.bounds.getCenter());
      this.map.panToBounds(this.bounds);
      if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
        if (this.fitCoordCount === 1) {
          let currentZoom = this.map.getZoom();
          currentZoom = currentZoom - 2;
          if (currentZoom < 0) {
            currentZoom = 1;
          }
          this.map.setZoom(currentZoom);
        }
      } else {
        let len = 0;
        if (initObj.formatGeoJSON && initObj.formatGeoJSON.features) {
          len = initObj.formatGeoJSON.features.length;
        }
        if (this.countPoint != null && initObj != null && initObj.formatGeoJSON.features.length === this.countPoint) {
          const pointZoom = this.map.getZoom() - 5 < 1 ? 5 : this.map.getZoom() - 5;
          this.map.setZoom(pointZoom);
        }
      }
      this.clampZoomFloor();
    }
    if (initObj.setupMapDone != null) {
      initObj.setupMapDone(true);
    }
    if (this.onTilesLoaded != null) {
      this.onTilesLoaded();
    }
    this.isMapReady = true;
    this.google.maps.event.clearListeners(this.map, "tilesloaded");
    this.setupZoomButton(initObj);
  }
  onMapZoomChanged() {
    const z = this.map.getZoom();
    if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP || this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET || this.type === SclMapConstantService.COMP_TYPE_BOUNDARY || this.type === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
      if (this.onTilesLoaded != null) {
        this.onTilesLoaded();
      }
      this.showHeatLayer(z);
    }
  }
  onMapIdle() {
    this.finishAddIcon();
    if (this.type !== SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
      setTimeout(() => {
        this.updateRotateScaleByZoom();
      }, 250);
    }
  }
  onMapBoundsChanged(initObj) {
    const fullscreen = this.checkFullScreen();
    this.isFullScreen = fullscreen.hasFullScreen;
    if (this.fullScreenEvent != null && typeof this.fullScreenEvent === "function") {
      this.fullScreenEvent(fullscreen.mapDivHeight, this.isFullScreen);
    }
    this.setupZoomButton(initObj);
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.showStylingSubMenu(null, false);
      this.updateMenuChildCss();
    }
  }
  checkFullScreen() {
    const childs = $2(this.map.getDiv()).children();
    const childLen = childs?.length;
    let hasFullScreen = false;
    let mapDivHeight = this.map.getDiv().clientHeight;
    let mapDivWidth = this.map.getDiv().clientWidth;
    for (let i2 = 0; i2 < childLen; i2++) {
      if (childs.eq(i2).height() == window.innerHeight && childs.eq(i2).width() == window.innerWidth) {
        hasFullScreen = true;
        mapDivHeight = window.innerHeight;
        mapDivWidth = window.innerWidth;
        break;
      }
    }
    return { hasFullScreen, mapDivHeight, mapDivWidth };
  }
  setupZoomButton(initObj) {
    if (this.findBtnZoomIn == null) {
      this.findBtnZoomIn = setInterval(() => this.setupBtnZoomIn(this, initObj), 200);
    }
    if (this.findBtnZoomOut == null) {
      this.findBtnZoomOut = setInterval(() => this.setupBtnZoomOut(this, initObj), 200);
    }
  }
  setupBtnZoomIn(self2, initObj) {
    self2.btnZoomIn = initObj.target.querySelector("[aria-label='Zoom in']");
    if (self2.btnZoomIn) {
      self2.btnZoomIn.id = initObj.target.id + "ZoomIn";
      self2.btnZoomIn.addEventListener("mouseover", () => {
        self2.btnZoomIn.setAttribute("title", "Zoom in (" + this.map.getZoom() + ")");
      });
      clearInterval(self2.findBtnZoomIn);
      self2.findBtnZoomIn = null;
      self2.findBtnZoomInCount = 0;
    } else {
      self2.findBtnZoomInCount++;
      if (self2.findBtnZoomInCount > self2.findBtnZoomLimit) {
        clearInterval(self2.findBtnZoomIn);
        self2.findBtnZoomIn = null;
        self2.findBtnZoomInCount = 0;
      }
    }
  }
  setupBtnZoomOut(self2, initObj) {
    self2.btnZoomOut = initObj.target.querySelector("[aria-label='Zoom out']");
    if (self2.btnZoomOut) {
      self2.btnZoomOut.id = initObj.target.id + "ZoomOut";
      self2.btnZoomOut.addEventListener("mouseover", () => {
        self2.btnZoomOut.setAttribute("title", "Zoom out (" + this.map.getZoom() + ")");
      });
      clearInterval(self2.findBtnZoomOut);
      self2.findBtnZoomOut = null;
      self2.findBtnZoomOutCount = 0;
    } else {
      self2.findBtnZoomOutCount++;
      if (self2.findBtnZoomOutCount > self2.findBtnZoomLimit) {
        clearInterval(self2.findBtnZoomOut);
        self2.findBtnZoomOut = null;
        self2.findBtnZoomOutCount = 0;
      }
    }
  }
  checkTransparenImgIsCluster(width, height) {
    let isCluster = false;
    for (let i2 = 0; i2 < this.clusterImageSize.length; i2++) {
      if (this.clusterImageSize[i2].width === width && this.clusterImageSize[i2].height === height) {
        isCluster = true;
        break;
      }
    }
    return isCluster;
  }
  // 14405
  hideImgTransparency(cb) {
    if (this.checkImgTransparent) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.checkImgTransparent = setInterval(() => {
      const lst = document.querySelectorAll('[src="https://maps.gstatic.com/mapfiles/transparent.png"]');
      if (lst && lst.length > 0) {
        let root = null;
        for (let i2 = 0; i2 < lst.length; i2++) {
          if (lst[i2].clientWidth === 16 || this.checkTransparenImgIsCluster(lst[i2].clientWidth, lst[i2].clientHeight)) {
            continue;
          }
          const parent = lst[i2].parentNode;
          root = parent.parentNode;
          if (root) {
            root.removeChild(parent);
          }
        }
        clearInterval(this.checkImgTransparent);
        this.checkImgTransparent = null;
        if (cb && typeof cb === "function") {
          cb();
        }
      } else {
        this.checkImgTransparentCount++;
        if (this.checkImgTransparentCount > 10) {
          clearInterval(this.checkImgTransparent);
          this.checkImgTransparent = null;
          this.checkImgTransparentCount = 0;
          if (cb && typeof cb === "function") {
            cb();
          }
        }
      }
    }, 200);
  }
  finishAddIcon() {
    if (this.updateLocationMarkers.length > 0) {
      if (!this.marker) {
        const geom = new this.google.maps.Data.Point(this.updateLocationMarkers[0].coor);
        this.marker = new this.google.maps.Data.Feature();
        this.marker.setGeometry(geom);
        if (this.markerImage != null) {
          this.marker.setProperty("icon", this.markerImage);
        }
        this.marker.setProperty("zIndex", this.layerIndexAddress);
        this.marker.setProperty("id", this.updateLocationMarkers[0].proId);
        this.marker.id = this.updateLocationMarkers[0].proId;
        this.layerAssets[this.layerIndexAddress].add(this.marker);
      }
      if (this.updateLocationMarkers && this.updateLocationMarkers.length > 0) {
        this.marker.setGeometry(new this.google.maps.Data.Point(this.updateLocationMarkers[this.updateLocationMarkers.length - 1].coor));
      }
      this.updateLocationMarkers = [];
    }
  }
  showHeatLayer(zoom) {
    for (const f in this.heatLayerConfig) {
      if (typeof this.heatLayerConfig[f].zoomLevel !== "undefined") {
        if (zoom < this.heatLayerConfig[f].zoomLevel) {
          this.layerAssets[f].setMap(null);
        } else {
          this.layerAssets[f].setMap(this.map);
        }
      }
    }
  }
  // use for sc-address-map
  removeSelectedAsset(id0) {
    let isRemove = false;
    for (let i2 = this.selectedFeatures.length - 1; i2 > -1; i2--) {
      const id2 = this.getFeatureId(this.selectedFeatures[i2]);
      if (id2 && id2.indexOf(id0) > -1) {
        this.layerAssets[this.layerIndexUser].remove(this.selectedFeatures[i2]);
        this.selectedFeatures.splice(i2, 1);
        isRemove = true;
        this.layerAssets[this.layerIndexUser].forEach((feature) => {
          const id3 = this.getFeatureId(feature);
          if (id3 && id3.indexOf(id0) > -1) {
            this.layerAssets[this.layerIndexUser].remove(feature);
          }
        });
      }
    }
    if (isRemove) {
      if (this.setDirtyFunction) {
        this.setDirtyFunction(this.selectedFeatures);
      }
    }
    return isRemove;
  }
  setLayerSelectAsset() {
    const self2 = this;
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (this.layerAssets[i2].get("isCluster")) {
        continue;
      }
      this.layerAssets[i2].addListener("click", function(event) {
        if (self2.multipleSelection) {
          if (!event || !event.feature) {
            return;
          }
          const layerDisplayOnly = self2.getFeatureProperty(event.feature, "layerDisplayOnly");
          if (layerDisplayOnly) {
            return;
          }
          if (self2.selectedFeatures == null) {
            self2.selectedFeatures = [];
          }
          const fs = self2.getFeaturesCollection({ feature: event.feature });
          if (fs.length > 0) {
            let isDirty = false;
            for (let j = 0; j < fs.length; j++) {
              const f = fs[j].feature;
              const fId = self2.getFeatureId(f);
              let added = false;
              for (let k = self2.selectedFeatures.length - 1; k > -1; k--) {
                const kId = self2.getFeatureId(self2.selectedFeatures[k]);
                if (kId === fId) {
                  added = true;
                  break;
                }
              }
              if (!added) {
                f.setProperty("zIndex", self2.layerIndexUser);
                self2.selectedFeatures.push(f);
                self2.layerAssets[self2.layerIndexUser].add(f);
                isDirty = true;
                break;
              }
            }
            if (isDirty && self2.setDirtyFunction) {
              self2.setDirtyFunction(self2.selectedFeatures);
            }
          }
        } else {
          if (self2.funcSingleSelectMode) {
            const pixel = self2.map.getProjection().fromLatLngToPoint(event.latLng);
            const id2 = self2.getFeatureId(event.feature);
            self2.funcSingleSelectMode({ id: id2, pixel });
          }
        }
      });
    }
    this.layerAssets[this.layerIndexUser].addListener("click", (event) => {
      if (this.multipleSelection) {
        let id0 = self2.getFeatureId(event.feature);
        if (id0 && id0.indexOf("_") > -1) {
          id0 = id0.split("_")[0];
        }
        this.removeSelectedAsset(id0);
      }
    });
  }
  setSelectAssetCluster(feature) {
    if (this.multipleSelection) {
      if (this.selectedFeatures == null) {
        this.selectedFeatures = [];
      }
      const fs = feature;
      if (fs.length > 0) {
        let isDirty = false;
        for (let j = 0; j < fs.length; j++) {
          const f = fs[j].feature;
          const layerDisplayOnly = this.getFeatureProperty(f, "layerDisplayOnly");
          if (layerDisplayOnly) {
            continue;
          }
          const fId = this.getFeatureId(f);
          let added = false;
          for (let k = this.selectedFeatures.length - 1; k > -1; k--) {
            const kId = this.getFeatureId(this.selectedFeatures[k]);
            if (kId === fId) {
              added = true;
              break;
            }
          }
          if (!added) {
            f.setProperty("zIndex", this.layerIndexUser);
            this.selectedFeatures.push(f);
            this.layerAssets[this.layerIndexUser].add(f);
            isDirty = true;
          }
        }
        if (isDirty && this.setDirtyFunction) {
          this.setDirtyFunction(this.selectedFeatures);
        }
      }
    } else {
      if (this.funcSingleSelectMode) {
        const pixel = this.map.getProjection().fromLatLngToPoint(feature.getPostion().latLng());
        const id2 = this.getFeatureId(feature);
        this.funcSingleSelectMode({ id: id2, pixel });
      }
    }
  }
  styleArrow(arrowHead) {
    if (arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT) {
      return {
        icon: {
          path: this.google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
          rotation: 180
        },
        offset: `0%`
      };
    } else if (arrowHead === SclMapConstantService.DRAWING_ARROW_HEAD_AT_LAST_POINT) {
      return {
        icon: {
          path: this.google.maps.SymbolPath.FORWARD_CLOSED_ARROW
        },
        offset: `100%`
      };
    }
    return {};
  }
  styleBoundary(color2) {
    return {
      fillColor: color2,
      strokeWeight: 1
    };
  }
  calculateSizeScaleInfo(scale5, originWidth, originHeight) {
    let scaledWidth = originWidth;
    let scaledHeight = originHeight;
    let top = 0;
    let left = 0;
    let isFlip = false;
    if ((0, import_lodash7.isNumber)(scale5) && scale5 != 1) {
      const value = Math.abs(scale5);
      scaledWidth *= value;
      scaledHeight *= value;
      left = scaledWidth * value;
      top = scaledHeight * value;
      if (scale5 < 0) {
        isFlip = true;
      }
    } else if ((0, import_lodash7.isArray)(scale5)) {
      if ((0, import_lodash7.isNumber)(scale5[0]) && scale5[0] != 1) {
        const value0 = Math.abs(scale5[0]);
        scaledWidth *= value0;
        left = scaledWidth * value0;
        if (scale5[0] < 0) {
          isFlip = true;
        }
      }
      if ((0, import_lodash7.isNumber)(scale5[1]) && scale5[1] != 1) {
        const value1 = Math.abs(scale5[1]);
        scaledHeight *= value1;
        top = scaledHeight * value1;
      }
    }
    return { scaledWidth, scaledHeight, top, left, isFlip };
  }
  iconScaleStop(idx, pIcon) {
    this.dynamicIconScale = this.dynamicIconScale.replace(pIcon + ";", "");
    const intervalId = this.dynamicIconScaleInterval[idx];
    clearInterval(intervalId);
    this.dynamicIconScaleInterval.splice(idx, 1);
    this.dynamicIconScaleCount.splice(idx, 1);
  }
  iconScaleStopAll() {
    this.dynamicIconScaleInterval.forEach((interval, i2) => {
      clearInterval(interval);
    });
    this.dynamicIconScale = "";
    this.dynamicIconScaleCount = [];
  }
  iconScale(pIcon, originWidth, originHeight, scaledWidth, scaledHeight, top, left, isFlip) {
    const isScale = scaledWidth != originWidth || scaledHeight != originHeight;
    if (this.dynamicIconScale.indexOf(pIcon) < 0 && (isScale || isFlip)) {
      this.dynamicIconScale += pIcon + ";";
      this.dynamicIconScaleCount.push(0);
      this.dynamicIconScaleInterval.push(setInterval(() => {
        const idx = this.dynamicIconScale.indexOf(pIcon);
        if (idx < 0) {
          console.log("%c Exception when scale asset " + pIcon, "color:blue");
          this.iconScaleStopAll();
        } else {
          if ($2(`img[src="${pIcon}"]`) && $2(`img[src="${pIcon}"]`).length > 0) {
            const css = $2(`img[src="${pIcon}"]`).attr("style");
            let doneScale = false;
            let doneFlip = false;
            let appendStyleScale = "";
            let appendStyleFlip = "";
            if (isScale) {
              const cssTop = $2(`img[src="${pIcon}"]`).css("margin-top");
              if (!cssTop || cssTop === "0px") {
                appendStyleScale = "width: " + scaledWidth + "px !important; height: " + scaledHeight + "px !important; margin-top: " + top + "px !important; margin-left: " + left + "px !important; max-width: " + scaledWidth + "px !important; max-height: " + scaledHeight + "px !important;";
                this.dynamicIconScaleCount[idx]++;
              } else {
                doneScale = true;
              }
            }
            if (isFlip) {
              if (css && css.indexOf("transform") > -1) {
                doneFlip = true;
              } else {
                appendStyleFlip = "-webkit-transform: scaleX(-1) !important; -moz-transform: scaleX(-1) !important; -ms-transform: scaleX(-1) !important; transform: scaleX(-1) !important;";
                this.dynamicIconScaleCount[idx]++;
              }
            }
            if (!doneScale || !doneFlip) {
              $2(`img[src="${pIcon}"]`).css("cssText", css + appendStyleScale + appendStyleFlip);
            }
            if (this.dynamicIconScaleCount[idx] > this.dynamicIconScaleLimit) {
              console.log("Out of limmit for setting scale for image has src = " + pIcon + ", css = " + css);
              console.log($2(`img[src="${pIcon}"]`));
              this.iconScaleStop(idx, pIcon);
            }
            if (isScale && doneScale && isFlip && doneFlip || isScale && doneScale && !isFlip || isFlip && doneFlip && !isScale) {
              this.iconScaleStop(idx, pIcon);
              const a = $2(`img[src="${pIcon}"]`).attr("style");
              const img = $2(`img[src="${pIcon}"]`);
            }
            if (isScale && doneScale && isFlip && doneFlip) {
              this.iconScaleStop(idx, pIcon);
            } else if (isScale && doneScale && !isFlip) {
              this.iconScaleStop(idx, pIcon);
            } else if (isFlip && doneFlip && !isScale) {
              this.iconScaleStop(idx, pIcon);
            }
          } else {
            console.log("Waiting google map init image has src = " + pIcon + "...");
            this.dynamicIconScaleCount[idx]++;
            if (this.dynamicIconScaleCount[idx] > this.dynamicIconScaleLimit) {
              console.log("Error when google map init image has src = " + pIcon);
              this.iconScaleStop(idx, pIcon);
            }
          }
        }
      }, 200));
    }
  }
  iconRotateStop(idx, pIcon) {
    this.dynamicIconRotate = this.dynamicIconRotate.replace(pIcon + ";", "");
    const intervalId = this.dynamicIconRotateInterval[idx];
    clearInterval(intervalId);
    this.dynamicIconRotateInterval.splice(idx, 1);
    this.dynamicIconRotateCount.splice(idx, 1);
  }
  iconRotateStopAll() {
    this.dynamicIconRotateInterval.forEach((interval, i2) => {
      clearInterval(interval);
    });
    this.dynamicIconRotate = "";
    this.dynamicIconRotateCount = [];
  }
  iconRotate(pIcon, rotation, id2) {
    if (this.dynamicIconRotate.indexOf(pIcon) < 0 && rotation && rotation != 0) {
      const cssRotate = "rotate(" + rotation + "deg)";
      this.dynamicIconRotate += pIcon + ";";
      this.dynamicIconRotateCount.push(0);
      this.dynamicIconRotateInterval.push(setInterval(() => {
        const idx = this.dynamicIconRotate.indexOf(pIcon);
        if (idx < 0) {
          console.log("%c Exception when rotating asset " + pIcon, "color:blue");
          this.iconRotateStopAll();
        } else {
          const parent = $2(`img[src="${pIcon}"]`).parent();
          const css = parent.attr("style");
          if (css && css.indexOf("transform") > -1) {
            this.iconRotateStop(idx, pIcon);
            if ($2(`#${id2}`).css("zIndex") < parent.css("zIndex")) {
              $2(`#${id2}`).css("zIndex", parent.css("zIndex") + 1);
            }
          } else {
            const appendRotate = "-webkit-transform: " + cssRotate + " !important;-moz-transform: " + cssRotate + " !important;-ms-transform: " + cssRotate + " !important;-o-transform: " + cssRotate + " !important;transform: " + cssRotate + " !important;";
            parent.css("cssText", css + appendRotate);
            this.dynamicIconRotateCount[idx]++;
            if (this.dynamicIconRotateCount[idx] > this.dynamicIconRotateLimit) {
              console.log("Out of limit for rotating image has src = " + pIcon);
              this.iconRotateStop(idx, pIcon);
            }
          }
        }
      }, 200));
    }
  }
  styleFeature(feature) {
    if (feature == null) {
      return {};
    }
    const p = this.getFeatureProperties(feature, [
      "color",
      "lineWidth",
      "type",
      "lineDash",
      "fillColor",
      "fillOpacity",
      "zIndex",
      "icon",
      "size",
      "anchor",
      "rotation",
      "scale",
      "scaledInfo",
      "id",
      "circle",
      "lineWidth",
      "fillColor"
    ]);
    const zIndex = p.zIndex;
    let color2 = "gray";
    const pColor = p.color;
    if (pColor) {
      color2 = pColor;
    }
    let strokeWeight = 2;
    const lineWidth = p.lineWidth;
    if (lineWidth) {
      strokeWeight = lineWidth;
    }
    const type = p.type;
    let aIcon = [];
    const lineDash = p.lineDash;
    if (lineDash && Array.isArray(lineDash) && lineDash.length > 1) {
      const lineSymbol = {
        path: `m 0 -${lineDash[0]} l 0 ${lineDash[0]}`,
        // dash length
        strokeOpacity: 1,
        scale: strokeWeight,
        strokeColor: color2,
        strokeWeight,
        fillColor: color2
      };
      aIcon = [{
        icon: lineSymbol,
        offset: "0",
        repeat: `${(lineDash[0] + lineDash[1]) * strokeWeight}px`
        // dash space
      }];
    }
    let fillColor = color2;
    const pFillColor = p.fillColor;
    if (pFillColor) {
      fillColor = pFillColor;
    }
    let fillOpa = 0;
    const pFillOpacity = p.fillOpacity;
    if (pFillOpacity) {
      fillOpa = pFillOpacity;
    }
    if (type === "MultiPoint") {
      const dot = {
        path: this.google.maps.SymbolPath.CIRCLE,
        strokeOpacity: 0.9,
        scale: 7,
        strokeColor: color2,
        strokeWeight,
        fillColor,
        fillOpacity: fillOpa
      };
      return {
        icon: dot,
        fillOpacity: fillOpa,
        fillColor: color2,
        strokeColor: color2,
        strokeWeight,
        zIndex
      };
    }
    let pIcon = p.icon;
    if (pIcon) {
      const iconIndex = this.cacheImageUrls.indexOf(pIcon);
      let objStyle = null;
      const size = p.size;
      if (iconIndex < 0) {
        console.log(`*** NULL STYLE HERE ************`);
        return null;
      }
      const image = this.cacheImages[iconIndex];
      let strBase64 = this.cacheImageBase64s[iconIndex];
      if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
        if (p.rotation && p.rotation != 0 || p.scale && p.scale != 1) {
          const isFlip = p.scale < 0 ? true : false;
          const infoId = pIcon + "#" + p.rotation + "#" + p.scale + "#" + isFlip;
          let infoIndex = this.cacheImageModifiedInfo.indexOf(infoId);
          if (infoIndex < 0) {
            return null;
          }
          strBase64 = this.cacheImageModifiedBase64[infoIndex];
          if (p.rotation != 0) {
            let size2 = image.width;
            if (image.width < image.height) {
              size2 = image.height;
            }
            image.width = size2;
            image.height = size2;
          }
          if (p.scale != 1) {
            image.width *= p.scale;
            image.height *= p.scale;
          }
        }
      }
      if (!size) {
        objStyle = {
          icon: strBase64,
          fillOpacity: fillOpa,
          fillColor: color2,
          strokeColor: color2,
          strokeWeight,
          zIndex
        };
        if (p.scale && !p.scaledInfo) {
          if (p.scaledInfo) {
            objStyle.icon.scaledSize = new this.google.maps.Size(p.scaledInfo.w, p.scaledInfo.h);
          } else {
            if (this.type === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
              p.scaledInfo = {
                w: image.width,
                h: image.height,
                top: 0,
                left: 0,
                isFlip: p.scale < 0 ? true : false
              };
              feature.setProperty("scaledInfo", p.scaledInfo);
            } else {
              const scaleInfo = this.calculateSizeScaleInfo(p.scale, image.width, image.height);
              if (scaleInfo.scaledWidth != image.width || scaleInfo.scaledHeight != image.height) {
                objStyle.icon.scaledSize = new this.google.maps.Size(scaleInfo.scaledWidth, scaleInfo.scaledHeight);
                p.scaledInfo = {
                  w: scaleInfo.scaledWidth,
                  h: scaleInfo.scaledHeight,
                  top: scaleInfo.top,
                  left: scaleInfo.left,
                  isFlip: scaleInfo.isFlip
                };
                feature.setProperty("scaledInfo", p.scaledInfo);
              }
            }
          }
        }
        feature.setProperty("size", [image.width, image.height]);
      } else {
        const anchorInfo = p.anchor;
        if (anchorInfo && anchorInfo.length > 1) {
          let anchorX = anchorInfo[0] * size[0];
          let anchorY = anchorInfo[1] * size[1];
          const aIconA = {
            url: strBase64,
            // url: pIcon,
            anchor: new this.google.maps.Point(anchorX, anchorY)
          };
          objStyle = {
            icon: aIconA,
            fillOpacity: fillOpa,
            fillColor: color2,
            strokeColor: color2,
            strokeWeight,
            zIndex
          };
        } else {
          objStyle = {
            icon: strBase64,
            fillOpacity: fillOpa,
            fillColor: color2,
            strokeColor: color2,
            strokeWeight,
            zIndex
          };
        }
        if (p.scale && p.scale != 1) {
          let scaledWidth = size[0];
          let scaledHeight = size[1];
          let top = 0;
          let left = 0;
          let isFlip = false;
          if (p.scaledInfo) {
            scaledWidth = p.scaledInfo.w;
            scaledHeight = p.scaledInfo.h;
            top = p.scaledInfo.top;
            left = p.scaledInfo.left;
            isFlip = p.scaledInfo.isFlip;
          } else {
            const scaleInfo = this.calculateSizeScaleInfo(p.scale, p.size[0], p.size[1]);
            scaledWidth = scaleInfo.scaledWidth;
            scaledHeight = scaleInfo.scaledHeight;
            top = scaleInfo.top;
            left = scaleInfo.left;
            isFlip = scaleInfo.isFlip;
            p.scaledInfo = {
              w: scaleInfo.scaledWidth,
              h: scaleInfo.scaledHeight,
              top: scaleInfo.top,
              left: scaleInfo.left,
              isFlip: scaleInfo.isFlip
            };
            feature.setProperty("scaledInfo", p.scaledInfo);
          }
          if (this.type !== SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
            this.iconScale(pIcon, size[0], size[1], scaledWidth, scaledHeight, top, left, isFlip);
          }
        }
      }
      if (this.type !== SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
        this.iconRotate(pIcon, p.rotation, p.id);
      }
      return objStyle;
    } else {
      let objStyle;
      if (aIcon.length > 0 && (type === "LineString" || type === "MultiLineString")) {
        objStyle = {
          icons: aIcon,
          fillColor,
          fillOpacity: fillOpa,
          strokeColor: color2,
          strokeWeight,
          strokeOpacity: 0,
          zIndex
        };
      } else {
        objStyle = {
          fillColor,
          fillOpacity: fillOpa,
          strokeColor: color2,
          strokeWeight,
          zIndex
        };
      }
      return objStyle;
    }
  }
  styleAddress(feature = null) {
    return this.styleFeature(feature);
  }
  styleStAddress(feature) {
    let color2 = "red";
    const p = this.getFeatureProperties(feature, ["color", "icon"]);
    const pColor = p.color;
    const pIcon = p.icon;
    if (pColor) {
      color2 = pColor;
    }
    if (pIcon) {
      return (
        /** @type {!this.google.maps.Data.StyleOptions} */
        {
          icon: pIcon,
          fillColor: color2,
          strokeColor: color2,
          strokeWeight: 1
        }
      );
    } else {
      return {
        fillColor: color2,
        strokeWeight: 1
      };
    }
  }
  styleAsset(feature) {
    return this.styleFeature(feature);
  }
  getRotationDegrees(obj) {
    const matrix = obj.css("-webkit-transform") || obj.css("-moz-transform") || obj.css("-ms-transform") || obj.css("-o-transform") || obj.css("transform");
    let angle = 0;
    if (matrix && matrix !== "none") {
      const values = matrix.split("(")[1].split(")")[0].split(",");
      const a = values[0];
      const b = values[1];
      angle = Math.round(Math.atan2(b, a) * (180 / Math.PI));
    } else {
      angle = 0;
    }
    return angle < 0 ? angle + 360 : angle;
  }
  // this.latLngToPixel = function(lat, lng, cb) {
  //     const ov = new this.google.maps.OverlayView();
  //     ov.draw = () => {
  //         const proj = ov.getProjection();
  //         const pixel = proj.fromLatLngToContainerPixel(new this.google.maps.LatLng(lat, lng));
  //         ov.setMap(null);
  //         cb(pixel);
  //     };
  //     ov.onAdd = function() {};
  //     ov.onRemove = function() {};
  //     ov.setMap(this.map);
  // };
  // this.pixelToLatLng = function(x, y, cb) {
  //     const ov = new this.google.maps.OverlayView();
  //     ov.draw = () => {
  //         const proj = ov.getProjection();
  //         const latLng = proj.fromContainerPixelToLatLng(new this.google.maps.Point(x, y));
  //         ov.setMap(null);
  //         cb(latLng);
  //     };
  //     ov.onAdd = function() {};
  //     ov.onRemove = function() {};
  //     ov.setMap(this.map);
  // };
  styleSelectedFunc(feature) {
    const fGeom = feature.getGeometry();
    const fType = fGeom.getType();
    const z = this.layerIndexUser;
    if (typeof this.selectionStyle !== "undefined" && this.selectionStyle !== null) {
      const p = this.getFeatureProperties(feature, ["color", "lineWidth", "lineDash", "icon", "anchor"]);
      const pColor = p.color;
      const lineWidth = p.lineWidth;
      const lineDash = p.lineDash;
      const pIcon = p.icon;
      const color2 = this.selectionStyle.selectionColor ? this.selectionStyle.selectionColor : pColor;
      const fillColor = this.selectionStyle.selectionFill ? this.selectionStyle.selectionFill : color2;
      const opacity = this.selectionStyle.selectionFillOpacity ? this.selectionStyle.selectionFillOpacity : 0.5;
      let strokeWeight = 2;
      if (lineWidth) {
        strokeWeight = lineWidth;
      }
      const fId = this.getFeatureId(feature);
      if (fType === "MultiPoint") {
        return (
          /** @type {!this.google.maps.Data.StyleOptions} */
          {
            icon: {
              path: this.google.maps.SymbolPath.CIRCLE,
              strokeOpacity: 0.9,
              scale: 7,
              strokeColor: color2,
              strokeWeight,
              fillColor,
              fillOpacity: opacity
            },
            fillOpacity: opacity,
            fillColor,
            strokeColor: color2,
            strokeWeight,
            zIndex: z
          }
        );
      }
      if (pIcon) {
        let icon = pIcon;
        let anchor2 = p.anchor;
        if (this.selectionStyle) {
          if (this.selectionStyle.selectionImageFileNo) {
            icon = this.selectionStyle.selectionImageFileNo;
          }
          if (this.selectionStyle.selectionImageAnchor) {
            anchor2 = this.selectionStyle.selectionImageAnchor;
          }
        }
        const iconIndex = this.cacheImageUrls.indexOf(icon);
        if (iconIndex < 0) {
          return null;
        }
        const strBase64 = this.cacheImageBase64s[iconIndex];
        const st1 = {
          icon: strBase64,
          zIndex: z
        };
        return st1;
      } else {
        const st = {
          fillColor,
          strokeColor: color2,
          strokeWeight,
          fillOpacity: opacity,
          strokeOpacity: 1,
          zIndex: z
        };
        if (fType === "LineString" || fType === "MultiLineString") {
          if (lineDash && Array.isArray(lineDash) && lineDash.length > 1) {
            const lineSymbol = {
              path: `m 0 -${lineDash[0]} l 0 ${lineDash[0]}`,
              // dash length,
              strokeOpacity: 1,
              scale: strokeWeight,
              strokeColor: color2,
              strokeWeight,
              fillColor: color2
            };
            st.icons = [{
              icon: lineSymbol,
              offset: "0",
              repeat: `${(lineDash[0] + lineDash[1]) * strokeWeight}px`
              // dash space
            }];
            st.strokeOpacity = 0;
          }
          return st;
        }
      }
    }
  }
  stylePrimaryAssetFunc(feature) {
    return this.styleSelectedAssetFunc(feature, this.primaryAssetSelection, this.layerIndexPrimary, SclMapConstantService.MAP_PRIMARY_ASSET, this.primaryImageAnchor, SclMapConstantService.MAP_PRIMARY_ASSET);
  }
  styleSecondaryAssetFunc(feature) {
    return this.styleSelectedAssetFunc(feature, this.secondaryAssetSelection, this.layerIndexSecondary, SclMapConstantService.MAP_SECONDARY_ASSET, this.secondaryImageAnchor, SclMapConstantService.MAP_SECONDARY_ASSET);
  }
  styleSelectedAssetFunc(feature, assetSelection, layerIndex, iconDefault, anchorDefault, assetType) {
    const fGeom = feature.getGeometry();
    const fType = fGeom.getType();
    const z = layerIndex;
    if (typeof assetSelection !== "undefined" && assetSelection !== null) {
      const p = this.getFeatureProperties(feature, [
        "lineWidth",
        "color",
        "zIndex",
        "lineDash",
        "icon",
        "anchor",
        "assetType",
        "primary",
        "secondary",
        "id"
      ]);
      let isPrimary = true;
      if (assetType === SclMapConstantService.MAP_PRIMARY_ASSET) {
        if (p.primary) {
          assetSelection.selectionImageFileNo = p.primary.image;
          assetSelection.selectionImageAnchor = p.primary.anchor;
          assetSelection.selectionImageRotation = p.primary.rotation;
          assetSelection.selectionColor = p.primary.color;
          assetSelection.selectionFill = p.primary.fillColor;
          assetSelection.selectionFillOpacity = p.primary.fillOpacity;
          assetSelection.selectionLineCap = p.primary.lineCap;
          assetSelection.selectionLineDash = p.primary.lineDash;
          assetSelection.selectionLineWidth = p.primary.lineWidth;
        } else if (!assetSelection.selectionImageFileNo) {
          assetSelection.selectionImageFileNo = SclMapConstantService.MAP_PRIMARY_ASSET;
        }
      } else if (assetType === SclMapConstantService.MAP_SECONDARY_ASSET) {
        isPrimary = false;
        if (p.secondary) {
          assetSelection.selectionImageFileNo = p.secondary.image;
          assetSelection.selectionImageAnchor = p.secondary.anchor;
          assetSelection.selectionImageRotation = p.secondary.rotation;
          assetSelection.selectionColor = p.secondary.color;
          assetSelection.selectionFill = p.secondary.fillColor;
          assetSelection.selectionFillOpacity = p.secondary.fillOpacity;
          assetSelection.selectionLineCap = p.secondary.lineCap;
          assetSelection.selectionLineDash = p.secondary.lineDash;
          assetSelection.selectionLineWidth = p.secondary.lineWidth;
        } else if (!assetSelection.selectionImageFileNo) {
          assetSelection.selectionImageFileNo = SclMapConstantService.MAP_SECONDARY_ASSET;
        }
      }
      assetSelection = sclUtilMap2.checkStyleValue(assetSelection, isPrimary);
      let strokeWeight = 2;
      let lineWidth = p.lineWidth;
      if (assetSelection.selectionLineWidth) {
        lineWidth = assetSelection.selectionLineWidth;
      }
      const pColor = p.color;
      const zIndex = p.zIndex;
      let lineDash = p.lineDash;
      if (assetSelection.selectionLineDash) {
        lineDash = assetSelection.selectionLineDash;
      }
      const pIcon = p.icon;
      if (lineWidth) {
        strokeWeight = lineWidth;
      }
      let color2 = assetSelection.selectionColor ? assetSelection.selectionColor : pColor;
      const fillColor = assetSelection.selectionFill ? assetSelection.selectionFill : color2;
      const opacity = assetSelection.selectionFillOpacity ? assetSelection.selectionFillOpacity : 0.5;
      if (fType === "MultiPoint") {
        return {
          icon: {
            path: this.google.maps.SymbolPath.CIRCLE,
            strokeOpacity: 0.9,
            scale: 7,
            strokeColor: color2,
            strokeWeight,
            fillColor,
            fillOpacity: opacity
          },
          fillOpacity: opacity,
          fillColor,
          strokeColor: color2,
          strokeWeight,
          zIndex
        };
      }
      if (pIcon) {
        let icon = pIcon;
        let anchor2 = p.anchor;
        let rotation = 0;
        const pAssetType = p.assetType;
        if (assetSelection) {
          if (assetSelection.selectionImageFileNo) {
            icon = assetSelection.selectionImageFileNo;
          }
          if (assetSelection.selectionImageAnchor) {
            anchor2 = assetSelection.selectionImageAnchor;
          }
          if (assetSelection.selectionImageRotation) {
            rotation = assetSelection.selectionImageRotation;
          }
        } else {
          if (icon === SclMapConstantService.MAP_PRIMARY_ASSET) {
            anchor2 = this.primaryImageAnchor;
          } else if (icon === SclMapConstantService.MAP_SECONDARY_ASSET) {
            anchor2 = this.secondaryImageAnchor;
          } else if (icon === SclMapConstantService.MAP_MARKER) {
            anchor2 = [0.5, 1];
          }
        }
        if (anchor2 === void 0 || anchor2 === null) {
          if (icon === SclMapConstantService.MAP_PRIMARY_ASSET || icon === SclMapConstantService.MAP_SECONDARY_ASSET || icon === SclMapConstantService.MAP_MARKER) {
            anchor2 = [0.5, 1];
          } else {
            if (typeof p.assetType !== "undefined" && p.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
              if (this.primaryImageAnchor !== void 0) {
                anchor2 = this.primaryImageAnchor;
              }
              if (p.primary) {
                anchor2 = p.primary.anchor;
              }
            } else if (typeof p.assetType !== "undefined" && p.assetType === SclMapConstantService.ASSET_SECONDARY_TYPE) {
              if (this.secondaryImageAnchor !== void 0) {
                anchor2 = this.secondaryImageAnchor;
              }
              if (p.secondary) {
                anchor2 = p.secondary.anchor;
              }
            } else {
              anchor2 = [0.5, 0.5];
            }
          }
        }
        icon = icon + "#" + p.id;
        const image = {
          url: icon
          // anchor: anchor,
          // origin: new this.google.maps.Point(0, 0)
        };
        const st = {
          icon: image,
          // fillColor: fillColor,
          // strokeColor: color,
          // strokeWeight: strokeWeight,
          // strokeOpacity: (fType == "LineString" ? 0 : 1),
          zIndex: z
        };
        this.iconRotate(icon, rotation, p.id);
        return st;
      } else {
        const st = {
          fillColor,
          strokeColor: color2,
          strokeWeight,
          strokeOpacity: 1,
          zIndex: z
        };
        if (fType === "LineString" || fType === "MultiLineString") {
          if (lineDash && Array.isArray(lineDash) && lineDash.length > 1) {
            const lineSymbol = {
              path: `m 0 -${lineDash[0]} l 0 ${lineDash[0]}`,
              // dash length,
              strokeOpacity: 1,
              scale: strokeWeight,
              strokeColor: color2,
              strokeWeight,
              fillColor: color2
            };
            st.icons = [{
              icon: lineSymbol,
              offset: "0",
              repeat: `${(lineDash[0] + lineDash[1]) * strokeWeight}px`
              // dash space
            }];
            st.strokeOpacity = 0;
          }
        }
        return st;
      }
    }
  }
  point2LatLng(point) {
    let topRight = this.map.getProjection().fromLatLngToPoint(this.map.getBounds().getNorthEast());
    let bottomLeft = this.map.getProjection().fromLatLngToPoint(this.map.getBounds().getSouthWest());
    let scale5 = Math.pow(2, this.map.getZoom());
    let worldPoint = new google.maps.Point(point.x / scale5 + bottomLeft.x, point.y / scale5 + topRight.y);
    return this.map.getProjection().fromPointToLatLng(worldPoint);
  }
  mapDivOnClick(e) {
    if (this.drawTypeSpecific === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT) {
      const offset2 = e?.target?.getClientRects()[0];
      if (offset2 && e?.clientX) {
        const point = {
          x: e?.clientX - offset2?.left,
          y: e?.clientY - offset2?.top
        };
        this.vertexes.push(point);
      }
      if (this.vertexes.length == 2) {
        const pos = this.point2LatLng(this.vertexes[0]);
        const color2 = this.isDrawModeSingle ? this.singleColorDraging : this.multiColorDraging;
        const end = this.vertexes[1];
        const start2 = this.vertexes[0];
        const endLatLng = this.point2LatLng(end);
        const startLatLng = this.point2LatLng(start2);
        const bearing = this.google.maps.geometry.spherical.computeHeading(endLatLng, startLatLng);
        if (this.arrow == null) {
          this.arrow = new this.google.maps.Marker({
            position: pos,
            icon: {
              path: this.google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
              fillColor: color2,
              strokeColor: color2,
              scale: this.lineWidthCurrentSelected ? this.lineWidthCurrentSelected : 2,
              rotation: bearing
            }
          });
          this.arrow.setMap(this.map);
        } else {
          this.arrow.setPosition(pos);
        }
      }
    } else if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION) {
      const offset2 = e?.target?.getClientRects()[0];
      if (offset2 && e?.clientX) {
        const point = {
          x: e?.clientX - offset2?.left,
          y: e?.clientY - offset2?.top
        };
        this.vertexes.push(point);
        if (this.vertexes.length == 1) {
          const pos = this.point2LatLng(this.vertexes[0]);
          const id2 = uuid3.v1();
          this.createDimensionFeature(id2, pos, null, this.fontCurrentSelected, this.fontSizeCurrentSelected);
        }
      }
    }
  }
  mapDivOnMouseMove(e) {
    if (this.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION) {
      const offset2 = e?.target?.getClientRects()[0];
      if (offset2 && e?.clientX && this.vertexes.length > 0 && this.currentDimensionId !== null) {
        const label = document.getElementById(`${this.currentDimensionId}_label`);
        if (label === null) {
          return;
        }
        const point = {
          x: e?.clientX - offset2?.left,
          y: e?.clientY - offset2?.top
        };
        this.vertexes.push(point);
        const pos0 = this.point2LatLng(this.vertexes[0]);
        const pos = this.point2LatLng(point);
        const distance2 = this.google.maps.geometry.spherical.computeDistanceBetween(pos0, pos);
        label.innerHTML = sclUtilMap2.formatDimension(distance2, this.dimensionsUnit, this.dimensionsPrecision);
      }
    }
  }
  interactionSelectMultiple(isActive, cb) {
  }
  addInteractionSnap() {
  }
  removeInteractionSnap() {
  }
  addInteractionDraw(drawStart, drawEnd) {
    if (drawStart != null && drawEnd != null) {
      for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
        if (this.layerAssets[i2].get("isCluster")) {
          continue;
        }
        this.layerAssets[i2].addListener("click", function(event) {
          const latLng = event.latLng;
          const obj = { latLng: [latLng.lng(), latLng.lat()], clickFeature: event.feature };
          drawStart(obj);
          drawEnd(obj);
        });
      }
    }
  }
  removeInteractionDraw() {
    if (this.drawingManager) {
      this.drawingManager.setDrawingMode(null);
    }
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.google.maps.event.clearListeners(this.layerAssets[i2], "click");
    }
  }
  clearSelection() {
    if (this.selectedShape) {
      this.selectedShape = null;
    }
  }
  setSelection(shape) {
    this.clearSelection();
    this.selectedShape = shape;
  }
  deselectAllControlBtn(currentBtnId) {
    if (this.shapes) {
      this.shapes.actionType = SclMapConstantService.DRAWING_ACTION_NA;
    }
    for (let i2 = 0; i2 < this.controlBtns.length; i2++) {
      if (!this.controlBtns[i2] || this.controlBtns[i2].id === currentBtnId) {
        continue;
      }
      this.controlBtns[i2].style.backgroundColor = "white";
    }
    this.drawingManager.setDrawingMode(null);
    this.vertexes = [];
    this.drawTypeSpecific = null;
  }
  modeAction(e) {
    this.hideDrawTools();
    this.showMenu(false);
    this.showMenuButton(true);
    this.showTooltip = true;
    this.deselectAllControlBtn(e.currentTarget.id);
    const cssOnlySingleMode = this.isDrawModeSingle ? "block" : "none";
    for (let i2 = 0; i2 < this.drawButtonsForOnlySingleMode.length; i2++) {
      this.drawButtonsForOnlySingleMode[i2].style.display = cssOnlySingleMode;
    }
    if (this.allowDrawingMode !== SclMapConstantService.DRAWING_MODE_ALL) {
      return;
    }
    if (this.isDrawModeSingle) {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Multi mode";
      }
      this.isDrawModeSingle = false;
      this.modeLabel.innerHTML = "layers";
    } else {
      if (e && e.currentTarget && e.currentTarget.title) {
        e.currentTarget.title = "Single mode";
      }
      this.isDrawModeSingle = true;
      this.modeLabel.innerHTML = "layers_clear";
    }
    this.drawingManager.markerOptions.icon.fillColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.markerOptions.icon.strokeColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.circleOptions.fillColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.circleOptions.strokeColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.polylineOptions.fillColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.polylineOptions.strokeColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.rectangleOptions.fillColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.rectangleOptions.strokeColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.polygonOptions.fillColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
    this.drawingManager.polygonOptions.strokeColor = this.isDrawModeSingle ? this.singleColor : this.multiColor;
  }
  selectAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showTooltip = true;
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_SELECT;
      this.showTooltip = false;
    }
    this.drawingManager.setDrawingMode(null);
  }
  updateMenuChildCss() {
    const fullscreen = this.checkFullScreen();
    const mapDivSize = this.isBottom ? fullscreen.mapDivHeight : fullscreen.mapDivWidth;
    this.updateDrawingSubMenuCss(mapDivSize);
  }
  showMenu(isShow) {
    if (!this.drawMenuChild) {
      return;
    }
    const displayBottom = this.isBottom ? "block" : "flex";
    const display = isShow ? displayBottom : "none";
    this.drawMenuChild.style.display = display;
    this.showMenuChilds(isShow);
    const cssOnlySingleMode = this.isDrawModeSingle ? "block" : "none";
    for (let i2 = 0; i2 < this.drawButtonsForOnlySingleMode.length; i2++) {
      this.drawButtonsForOnlySingleMode[i2].style.display = cssOnlySingleMode;
    }
    if (isShow) {
      this.updateMenuChildCss();
    }
  }
  menuAction(e) {
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showMenu(false);
      this.showTooltip = true;
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.actionType = SclMapConstantService.DRAWING_ACTION_MENU;
      this.showMenu(true);
      this.showTooltip = false;
    }
  }
  drawAction(e, drawingMode, drawTypeSpecific = null) {
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.drawingManager.setDrawingMode(null);
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      this.showMenu(true);
      this.hideDrawTools();
      this.showMenuButton(true);
    } else {
      e.currentTarget.style.backgroundColor = "grey";
      this.drawTypeSpecific = drawTypeSpecific;
      this.drawingManager.setDrawingMode(drawingMode);
      this.showMenu(false);
    }
  }
  pointAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.MARKER);
  }
  circleAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.CIRCLE);
  }
  polygonAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.POLYGON);
  }
  lineAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.POLYLINE);
  }
  boxAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.RECTANGLE);
  }
  colorAction(e) {
    super.colorAction(e);
    this.vertexes = [];
    this.drawTypeSpecific = null;
  }
  textAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.MARKER, "text");
  }
  arrowAtFirstPointAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.POLYLINE);
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_FIRST_POINT;
  }
  arrowAtLastPointAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.POLYLINE);
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ARROW_AT_LAST_POINT;
  }
  drawIconAction(e) {
    this.drawAction(e, this.google.maps.drawing.OverlayType.MARKER);
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_ICON;
  }
  dimensionAction(e) {
    if (!this.isDrawModeSingle) {
      return;
    }
    this.drawAction(e, this.google.maps.drawing.OverlayType.POLYLINE);
    this.drawTypeSpecific = SclMapConstantService.DRAWING_SPECIAL_DIMENSION;
  }
  deleteAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.deselectAllControlBtn(e.currentTarget.id);
    if (e.currentTarget.style.backgroundColor === "grey") {
      e.currentTarget.style.backgroundColor = "white";
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      if (this.shapes) {
        this.shapes.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      }
      this.showTooltip = true;
    } else {
      this.actionType = SclMapConstantService.DRAWING_ACTION_DELETE;
      e.currentTarget.style.backgroundColor = "grey";
      if (this.shapes) {
        this.shapes.actionType = SclMapConstantService.DRAWING_ACTION_DELETE;
        this.shapes.deleteSelected();
        this.shapes.setDirtyFunction = this.setDirtyFunction;
      }
      this.showTooltip = false;
    }
    if (this.setDirtyFunction) {
      this.setDirtyFunction();
    }
  }
  resetCheckLocationUI() {
    this.locationChecked = false;
    if (this.locationElementIcon) {
      this.locationElementIcon.setAttribute("class", "material-icons");
    }
  }
  locationAction(e) {
    this.hideDrawTools();
    this.showMenuButton(true);
    this.deselectAllControlBtn(e.currentTarget.id);
    if (this.locationChecked) {
      this.actionType = SclMapConstantService.DRAWING_ACTION_NA;
      if (this.locationElementIcon) {
        this.locationElementIcon.setAttribute("class", "material-icons");
      }
    } else {
      this.actionType = SclMapConstantService.DRAWING_ACTION_LOCATION;
      if (this.locationElementIcon) {
        this.locationElementIcon.setAttribute("class", "material-icons button-location-pulse");
      }
      if (this.getLocationFn && typeof this.getLocationFn === "function") {
        this.getLocationFn();
      }
    }
    this.locationChecked = !this.locationChecked;
  }
  addMapViewControl(element, mapViewLayers, compId, layerIds) {
  }
  // marker = M-point : 'mp', rectangle = M-polygon: 'mr', polygon = M-polygon: 'mo'
  // , polyline = M-line string : 'ml' , circle = M-point : 'mc'
  storeDrawMultiShape(key) {
    let count = 1;
    if (key in this.dicDrawShape) {
      count = this.dicDrawShape[key];
      count++;
      this.dicDrawShape[key] = count;
    } else {
      count = 1;
      this.dicDrawShape[key] = 1;
    }
    return count;
  }
  // this function for sc-boundary
  addControlDraw(compId, options, cb) {
    let layerIds = [];
    const color2 = this.isDrawModeSingle ? this.singleColorDraging : this.multiColorDraging;
    this.drawingManager = new this.google.maps.drawing.DrawingManager({
      drawingControl: false,
      drawingControlOptions: {
        position: this.google.maps.ControlPosition.LEFT_CENTER,
        drawingModes: ["marker", "circle", "polygon", "polyline", "rectangle"]
        // drawingModes: ['marker', 'polygon', 'polyline', 'rectangle']
      },
      markerOptions: {
        icon: {
          path: this.google.maps.SymbolPath.CIRCLE,
          fillColor: color2,
          fillOpacity: 0.6,
          strokeColor: color2,
          strokeOpacity: 0.9,
          strokeWeight: 1,
          scale: 7
        }
      },
      circleOptions: {
        strokeColor: color2,
        fillColor: color2
      },
      polylineOptions: { strokeColor: color2 },
      rectangleOptions: {
        strokeColor: color2,
        fillColor: color2
      },
      polygonOptions: {
        strokeColor: color2,
        fillColor: color2
      }
    });
    this.drawingManager.setMap(this.map);
    const self2 = this;
    this.google.maps.event.addListener(this.drawingManager, "drawingmode_changed", function() {
      self2.shapes.clearSelection();
      self2.actionType = SclMapConstantService.DRAWING_ACTION_EDIT;
      const currentDrawingMode = this.getDrawingMode();
      const color3 = self2.isDrawModeSingle ? self2.singleColorDraging : self2.multiColorDraging;
      const lineWidth = self2.lineWidthCurrentSelected ? self2.lineWidthCurrentSelected : null;
      switch (currentDrawingMode) {
        case google.maps.drawing.OverlayType.MARKER:
          self2.drawType = "Marker";
          break;
        case google.maps.drawing.OverlayType.CIRCLE:
          self2.drawType = "Point";
          self2.drawingManager.circleOptions.fillColor = color3;
          self2.drawingManager.circleOptions.strokeColor = color3;
          break;
        case google.maps.drawing.OverlayType.POLYLINE:
          self2.drawType = "LineString";
          self2.drawingManager.polylineOptions.fillColor = color3;
          self2.drawingManager.polylineOptions.strokeColor = color3;
          if (lineWidth) {
            self2.drawingManager.polylineOptions.strokeWeight = lineWidth;
          }
          break;
        case google.maps.drawing.OverlayType.POLYGON:
        case google.maps.drawing.OverlayType.RECTANGLE:
          self2.drawType = "Polygon";
          self2.drawingManager.polygonOptions.fillColor = color3;
          self2.drawingManager.polygonOptions.strokeColor = color3;
          if (lineWidth) {
            self2.drawingManager.polygonOptions.strokeWeight = lineWidth;
          }
          break;
        default:
          break;
      }
    });
    this.google.maps.event.addListener(this.drawingManager, "polylinecomplete", function(polyline) {
      console.log(`***** polylinecomplete`);
      if (self2.isDrawModeSingle) {
        polyline.setOptions({ strokeColor: self2.singleColor, fillColor: self2.singleColor });
      } else {
        polyline.setOptions({ strokeColor: self2.multiColor, fillColor: self2.multiColor });
      }
    });
    this.google.maps.event.addListener(this.drawingManager, "overlaycomplete", function(event) {
      self2.vertexes = [];
      if (self2.arrow) {
        self2.arrow.setMap(null);
        self2.arrow = null;
      }
      let id2 = (/* @__PURE__ */ new Date()).getTime() + "";
      let idGroup = null;
      let colorSaved = null;
      let color3 = self2.isDrawModeSingle ? self2.singleColor : self2.multiColor;
      if (self2.colorCurrentSelected) {
        color3 = self2.colorCurrentSelected;
        colorSaved = self2.colorCurrentSelected;
      }
      let lineWidthSave = null;
      let lineWidth = 2;
      if (self2.lineWidthCurrentSelected) {
        lineWidth = self2.lineWidthCurrentSelected;
        lineWidthSave = self2.lineWidthCurrentSelected;
      }
      let lineDash = self2.lineDashCurrentSelected ? self2.lineDashCurrentSelected : null;
      let arrowHead = self2.drawTypeSpecific === SclMapConstantService.DRAWING_ARROW_HEAD_AT_FIRST_POINT || self2.drawTypeSpecific === SclMapConstantService.DRAWING_ARROW_HEAD_AT_LAST_POINT ? self2.drawTypeSpecific : null;
      let icons = null;
      if (lineDash && Array.isArray(lineDash) && lineDash.length > 1) {
        icons = [
          {
            icon: {
              path: `m 0 -${lineDash[0]} l 0 ${lineDash[0]}`,
              // dash length
              strokeOpacity: 1,
              scale: lineWidth
            },
            offset: "0",
            repeat: `${lineDash[0] * lineDash[1] * lineWidth}px`
            // dash space
          }
        ];
      }
      switch (event.type) {
        case self2.google.maps.drawing.OverlayType.MARKER:
          event.overlay.icon.strokeColor = color3;
          event.overlay.icon.fillColor = color3;
          const m = new self2.google.maps.Data.Feature({
            geometry: new self2.google.maps.Data.Point(event.overlay.position)
          });
          if (!self2.isDrawModeSingle) {
            event.realType = "MultiPoint";
            idGroup = SclMapConstantService.DRAWING_MULTI_POINT;
            const count = self2.storeDrawMultiShape(idGroup);
            id2 = idGroup + "_" + count;
          } else {
            event.realType = "Marker";
          }
          if (self2.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX) {
            event.overlay.icon.strokeOpacity = 0;
            event.overlay.icon.fillOpacity = 0;
            event.realType = "Marker";
          }
          const iconImage = self2.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_ICON ? self2.iconCurrentSelected : null;
          m.toGeoJson(function(json) {
            if (self2.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_TEXT_BOX) {
              if (self2.allowCreateNewTextBox) {
                const id3 = uuid3.v1();
                self2.createTextBoxFeature(event, event.overlay.position, "", id3, true, json, self2.fontCurrentSelected, self2.fontSizeCurrentSelected);
              } else {
                console.log(`*** reset allowCreateNewTextBox`);
                self2.allowCreateNewTextBox = true;
              }
            } else {
              self2.shapes.add(event, json, id2, idGroup, colorSaved, lineWidthSave, lineDash, arrowHead, iconImage, self2.iconAnchorCurrentSelected, null, null);
              if (self2.setDirtyFunction) {
                self2.setDirtyFunction();
              }
            }
          });
          break;
        case self2.google.maps.drawing.OverlayType.RECTANGLE:
          event.overlay.fillColor = color3;
          event.overlay.strokeColor = color3;
          if (icons) {
            event.overlay.icons = icons;
            event.overlay.strokeOpacity = 0;
          }
          const b = event.overlay.getBounds(), p = [
            b.getSouthWest(),
            {
              lat: b.getSouthWest().lat(),
              lng: b.getNorthEast().lng()
            },
            b.getNorthEast(),
            {
              lng: b.getSouthWest().lng(),
              lat: b.getNorthEast().lat()
            }
          ];
          const r = new self2.google.maps.Data.Feature({
            geometry: new self2.google.maps.Data.Polygon([p])
          });
          if (!self2.isDrawModeSingle) {
            event.realType = "MultiPolygon";
            idGroup = SclMapConstantService.DRAWING_MULTI_RECTANGLE;
            const count = self2.storeDrawMultiShape(idGroup);
            id2 = idGroup + "_" + count;
          } else {
            event.realType = "Polygon";
          }
          r.toGeoJson(function(json) {
            self2.shapes.add(event, json, id2, idGroup, colorSaved, lineWidthSave, lineDash, arrowHead, null, null, null, null);
            if (self2.setDirtyFunction) {
              self2.setDirtyFunction();
            }
          });
          break;
        case self2.google.maps.drawing.OverlayType.POLYGON:
          event.overlay.fillColor = color3;
          event.overlay.strokeColor = color3;
          if (!self2.isDrawModeSingle) {
            event.realType = "MultiPolygon";
            idGroup = SclMapConstantService.DRAWING_MULTI_POLYGON;
            const count = self2.storeDrawMultiShape(idGroup);
            id2 = idGroup + "_" + count;
          } else {
            event.realType = "Polygon";
          }
          const p12 = new self2.google.maps.Data.Feature({
            geometry: new self2.google.maps.Data.Polygon([event.overlay.getPath().getArray()])
          });
          p12.toGeoJson(function(json) {
            self2.shapes.add(event, json, id2, idGroup, colorSaved, lineWidthSave, lineDash, arrowHead, null, null, null, null);
            if (self2.setDirtyFunction) {
              self2.setDirtyFunction();
            }
          });
          break;
        case self2.google.maps.drawing.OverlayType.POLYLINE:
          event.overlay.fillColor = color3;
          event.overlay.strokeColor = color3;
          let dimensionId = null;
          let dimensionValue = null;
          if (!self2.isDrawModeSingle) {
            event.realType = "MultiLineString";
            idGroup = SclMapConstantService.DRAWING_MULTI_LINE_STRING;
            const count = self2.storeDrawMultiShape(idGroup);
            id2 = idGroup + "_" + count;
          } else {
            event.realType = "LineString";
            if (self2.drawTypeSpecific === SclMapConstantService.DRAWING_SPECIAL_DIMENSION && self2.currentDimensionId != null) {
              dimensionId = self2.currentDimensionId;
              id2 = dimensionId;
              dimensionValue = parseFloat(self2.dimensionOverlays[self2.currentDimensionId].dimensionLabel.innerHTML?.replace(self2.dimensionsUnit, ""));
            }
          }
          const p22 = new self2.google.maps.Data.Feature({
            geometry: new self2.google.maps.Data.LineString(event.overlay.getPath().getArray())
          });
          p22.toGeoJson(function(json) {
            self2.shapes.add(event, json, id2, idGroup, colorSaved, lineWidthSave, lineDash, arrowHead, null, null, dimensionId, dimensionValue);
            if (self2.setDirtyFunction) {
              self2.setDirtyFunction();
            }
          });
          break;
        case self2.google.maps.drawing.OverlayType.CIRCLE:
          event.overlay.fillColor = color3;
          event.overlay.strokeColor = color3;
          const c = new self2.google.maps.Data.Feature({
            properties: {
              radius: event.overlay.getRadius()
            },
            geometry: new self2.google.maps.Data.Point(event.overlay.getCenter())
          });
          if (!self2.isDrawModeSingle) {
            event.realType = "MultiPoint";
            idGroup = SclMapConstantService.DRAWING_MULTI_CIRCLE;
            const count = self2.storeDrawMultiShape(idGroup);
            id2 = idGroup + "_" + count;
          } else {
            event.realType = "Point";
          }
          c.toGeoJson(function(json) {
            self2.shapes.add(event, json, id2, idGroup, colorSaved, lineWidthSave, lineDash, arrowHead, null, null, null, null);
            if (self2.setDirtyFunction) {
              self2.setDirtyFunction();
            }
          });
          break;
      }
    });
    this.drawingMenu = document.createElement("div");
    this.drawingMenu.id = compId + "_Drawing_Menu_";
    this.elementWrapperForBottomPosition = null;
    if (this.isBottom) {
      const mapActualView = $2(this.map.getDiv()).children().eq(1);
      if (!mapActualView || !mapActualView[0]) {
        console.log(`Google map library change it's rendering algorithm`);
        return;
      }
      this.elementWrapperForBottomPosition = mapActualView[0];
    }
    const css = {
      "background-color": "white",
      color: "black",
      width: this.drawToolButtonSize + "px",
      height: this.drawToolButtonSize + "px",
      border: "0px"
    };
    this.drawStylingButtonCss = (0, import_lodash7.cloneDeep)(css);
    this.drawStylingButtonCss["z-index"] = 200;
    this.cssIconDiv = {
      "height": `40px`,
      "width": `40px`,
      "margin-left": `-7px`,
      "margin-top": `-2px`,
      "position": `relative`
    };
    this.addDrawButtons(layerIds, compId, css, this.isBottom ? "draw-menu-gg-bottom" : "draw-menu-gg");
    this.drawingMenu.style.left = "10px";
    if (this.isBottom) {
      this.drawingMenu.style.marginBottom = "12px";
      this.drawingMenu.style.display = "flex";
      this.map.controls[this.google.maps.ControlPosition.BOTTOM_LEFT].push(this.drawingMenu);
    } else {
      this.drawingMenu.style.marginLeft = "10px";
      this.drawingMenu.style.display = "grid";
      this.map.controls[this.google.maps.ControlPosition.LEFT_CENTER].push(this.drawingMenu);
    }
    cb(layerIds);
  }
  addControl(ActionControl, element, options) {
    this.ActionControls.push(element);
  }
  setupControl(ActionControl) {
  }
  createTextBoxFeature(event, coor, textContent, id2, isEdit, markerJson, fontFamily, fontSize) {
    let fea = this.shapes.findById(id2);
    if (fea == null) {
      fea = this.shapes.addTextBox(event, markerJson, id2, textContent, fontFamily, fontSize);
    }
    let overlayIsAdded = false;
    const obj = document.getElementById(`${this.keyName}__text-container__${id2}}`);
    if (obj) {
      overlayIsAdded = true;
    }
    if (overlayIsAdded) {
      console.log(`This textbox ${id2} is added in map before`);
      return;
    }
    let container;
    let elemContent;
    let elemTextBox;
    const overlay = new this.google.maps.OverlayView();
    overlay.setMap(this.map);
    overlay.onAdd = () => {
      const mapHeight = this.mapDiv?.offsetHeight;
      const mapWidth = this.mapDiv?.offsetWidth;
      let textBoxSize = mapHeight;
      if (mapHeight > mapWidth) {
        textBoxSize = mapWidth;
      }
      textBoxSize /= 2;
      if (textBoxSize <= 0) {
        textBoxSize = 100;
      }
      container = document.createElement("div");
      container.id = `${this.keyName}__text-container__${id2}}`;
      container.className = "ol-popup";
      elemContent = document.createElement("div");
      elemContent.id = `${this.keyName}__text-content__${id2}}`;
      elemContent.className = "draw-text-content draw-text-google";
      elemContent.style.display = isEdit ? "none" : "block";
      container.appendChild(elemContent);
      elemTextBox = document.createElement("textarea");
      elemTextBox.id = `${this.keyName}__text-input__${id2}}`;
      elemTextBox.className = "draw-text-area draw-text-google";
      elemTextBox.style.width = `${textBoxSize}px`;
      elemTextBox.style["z-index"] = 100;
      elemTextBox.style.display = isEdit ? "block" : "none";
      elemTextBox.setAttribute("placeholder", "...");
      container.appendChild(elemTextBox);
      if (textContent) {
        elemContent.innerHTML = textContent;
        elemTextBox.value = textContent;
      }
      if (fontFamily) {
        elemContent.style["font-family"] = fontFamily;
        elemTextBox.style["font-family"] = fontFamily;
      }
      if (fontSize) {
        elemContent.style["font-size"] = fontSize;
        elemTextBox.style["font-size"] = fontSize;
      }
      const panes = overlay.getPanes();
      panes.floatPane.appendChild(container);
      const closeTextBoxFn = (e) => {
        elemContent.innerHTML = elemTextBox.value;
        elemContent.style.display = "block";
        elemTextBox.style.display = "none";
        this.hasDocumentChangeValue = false;
        this.shapes.setText(elemTextBox.value, id2);
        this.closeTextBox.style.display = "none";
        this.currentCloseTextBoxFn = null;
        this.currentTextBoxId = null;
        if (elemContent.innerHTML.trim().length == 0) {
          try {
            container.parentNode.removeChild(container);
          } catch (error3) {
          }
        }
        if (this.setDirtyFunction && typeof this.setDirtyFunction === "function") {
          this.setDirtyFunction();
        }
      };
      this.currentCloseTextBoxFn = isEdit ? closeTextBoxFn : null;
      this.currentTextBoxId = isEdit ? id2 : null;
      elemTextBox.onblur = (e) => {
        e.cancelBubble = true;
        e.stopPropagation && e.stopPropagation();
        if (this.isPressKeyEscape) {
          this.allowCreateNewTextBox = true;
          this.isPressKeyEscape = false;
        } else {
          this.allowCreateNewTextBox = false;
        }
        closeTextBoxFn(e);
      };
      elemTextBox.onclick = (e) => {
        e.cancelBubble = true;
        e.stopPropagation && e.stopPropagation();
        this.allowCreateNewTextBox = false;
      };
      container.onclick = (e) => {
        e.cancelBubble = true;
        e.stopPropagation && e.stopPropagation();
        elemTextBox.style.display = "block";
        this.closeTextBox.style.display = "block";
        elemContent.style.display = "none";
        this.currentCloseTextBoxFn = closeTextBoxFn;
        this.currentTextBoxId = id2;
        this.allowCreateNewTextBox = false;
      };
      elemTextBox.focus();
    };
    overlay.draw = () => {
      const overlayProjection = overlay.getProjection();
      const position = overlayProjection.fromLatLngToDivPixel(coor);
      container.style.left = position.x + "px";
      container.style.top = position.y + "px";
    };
  }
  updateDimensionPosition(id2) {
    const shape = this.shapes.collection[id2];
    let dataCoords = [];
    if (shape) {
      dataCoords = shape.geoJson.geometry.coordinates;
    } else if (this.vertexes.length > 0) {
      for (let i2 = 0; i2 < this.vertexes.length; i2++) {
        dataCoords.push([this.vertexes[i2].x, this.vertexes[i2].y]);
      }
    }
    const totalLength = sclUtilMap2.totalLen(dataCoords);
    const midDistance = totalLength / 2;
    const midPoint = sclUtilMap2.getPointByDistance(dataCoords, midDistance);
    if (Array.isArray(midPoint) && midPoint.length == 2) {
      const latLng = { lat: midPoint[1], lng: midPoint[0] };
      const overlayProjection = this.dimensionOverlays[id2].overlay?.getProjection();
      const position = overlayProjection.fromLatLngToDivPixel(latLng);
      this.dimensionOverlays[id2].dimensionContainer.style.left = position.x + "px";
      this.dimensionOverlays[id2].dimensionContainer.style.top = position.y + "px";
    }
    if (Array.isArray(dataCoords) && dataCoords.length > 1) {
      const pos0 = { lat: dataCoords[0][1], lng: dataCoords[0][0] };
      const pos = { lat: dataCoords[dataCoords.length - 1][1], lng: dataCoords[dataCoords.length - 1][0] };
      const distance2 = this.google.maps.geometry.spherical.computeDistanceBetween(pos0, pos);
      this.dimensionOverlays[id2].dimensionLabel.innerHTML = sclUtilMap2.formatDimension(distance2, this.dimensionsUnit, this.dimensionsPrecision);
    }
  }
  createDimensionFeature(id2, coor, dimensionValue, fontFamily, fontSize) {
    let overlayIsAdded = false;
    const obj = document.getElementById(id2);
    if (obj) {
      overlayIsAdded = true;
    }
    if (overlayIsAdded) {
      console.log(`This dimension ${id2} is added in map before`);
      this.updateDimensionPosition(id2);
      return;
    }
    let dimensionContainer;
    let dimensionLabel;
    const overlay = new this.google.maps.OverlayView();
    overlay.setMap(this.map);
    this.currentDimensionId = id2;
    overlay.onAdd = () => {
      dimensionContainer = document.createElement("div");
      dimensionContainer.id = id2;
      dimensionContainer.className = "ol-tooltip";
      const idLabel = `${id2}_label`;
      dimensionLabel = document.createElement("div");
      dimensionLabel.id = idLabel;
      dimensionLabel.style.display = "block";
      dimensionContainer.appendChild(dimensionLabel);
      const panes = overlay.getPanes();
      panes.floatPane.appendChild(dimensionContainer);
      this.dimensionOverlays[id2] = { overlay, dimensionContainer, dimensionLabel };
      if (dimensionValue !== null) {
        dimensionLabel.innerHTML = sclUtilMap2.formatDimension(dimensionValue, this.dimensionsUnit, this.dimensionsPrecision);
        dimensionContainer.className = "ol-tooltip";
      }
      const closeDimensionEditorFn = (e) => {
        this.dimensionEditorContainer.style.display = "none";
        dimensionLabel.style.display = "block";
        const value = parseFloat(this.dimensionEditorInput.value);
        dimensionLabel.innerHTML = sclUtilMap2.formatDimension(value, this.dimensionsUnit, this.dimensionsPrecision);
        this.shapes.collection[this.currentDimensionId].geoJson.properties.dimension = value;
        this.closeDimensionEditorFn = null;
        this.reCalculateDimensionFn = null;
        this.currentDimensionId = null;
        if (this.previousDimensionValue != value) {
          this.hasDocumentChangeValue = false;
          if (typeof this.setDirtyFunction === "function") {
            this.setDirtyFunction();
          }
        }
      };
      const reCalculateDimensionFn = (e) => {
        if (this.currentDimensionId === null) {
          console.log(`Click on dimension value to use this feature`);
          return;
        }
        const feature = this.shapes.collection[this.currentDimensionId];
        if (feature === null) {
          console.log(`There has no feature of ${this.currentDimensionId}`);
          return;
        }
        const dataCoord = feature.geoJson.geometry.coordinates;
        ;
        const pos0 = { lat: dataCoord[0][1], lng: dataCoord[0][0] };
        const pos = { lat: dataCoord[dataCoord.length - 1][1], lng: dataCoord[dataCoord.length - 1][0] };
        const distance2 = this.google.maps.geometry.spherical.computeDistanceBetween(pos0, pos);
        const distanceFormat = sclUtilMap2.formatDimension(distance2, this.dimensionsUnit, this.dimensionsPrecision);
        const label = this.dimensionOverlays[this.currentDimensionId].dimensionLabel;
        console.log(`**** re-calculate distance = ${distance2}, distanceFormat = ${distanceFormat}
                , label = `, label);
        this.dimensionEditorInput.value = distance2;
        label.innerHTML = distanceFormat;
      };
      dimensionContainer.onclick = (e) => {
        if (this.actionType == SclMapConstantService.DRAWING_ACTION_EDIT) {
          return;
        }
        console.log(`**** click dimensionContainer ${dimensionContainer.id}`);
        this.currentDimensionId = id2;
        e.cancelBubble = true;
        e.stopPropagation && e.stopPropagation();
        this.dimensionEditorContainer.style.display = "flex";
        dimensionLabel.style.display = "none";
        const containerPos = dimensionContainer.getBoundingClientRect();
        const containerHeight = dimensionContainer.offsetHeight / 2;
        const editorHeight = this.dimensionEditorContainer.offsetHeight;
        this.dimensionEditorContainer.style.top = `${containerPos.top - editorHeight - containerHeight}px`;
        this.dimensionEditorContainer.style.left = `${containerPos.left}px`;
        const content = dimensionLabel.innerHTML.replace(this.dimensionsUnit, "");
        this.previousDimensionValue = parseFloat(content);
        this.dimensionEditorInput.value = this.previousDimensionValue;
        this.closeDimensionEditorFn = closeDimensionEditorFn.bind(this);
        this.reCalculateDimensionFn = reCalculateDimensionFn.bind(this);
      };
    };
    overlay.draw = () => {
      const overlayProjection = overlay.getProjection();
      const position = overlayProjection.fromLatLngToDivPixel(coor);
      dimensionContainer.style.left = position.x + "px";
      dimensionContainer.style.top = position.y + "px";
      if (fontFamily) {
        dimensionContainer.style["font-family"] = fontFamily;
        dimensionLabel.style["font-family"] = fontFamily;
      }
      if (fontSize) {
        dimensionContainer.style["font-size"] = fontSize;
        dimensionLabel.style["font-size"] = fontSize;
      }
      this.updateDimensionPosition(id2);
    };
  }
  mapClickEvent(cb) {
    this.google.maps.event.addListener(this.map, "click", (evt) => {
      if (this.shapes) {
        this.shapes.clearSelection();
      }
      const latLng = evt.latLng;
      evt.latLng = { lat: latLng.lat(), lng: latLng.lng() };
      if (cb && typeof cb === "function") {
        cb(evt);
      }
    });
  }
  getPixelByLatLng(latLng) {
    const numTiles = 1 << this.map.getZoom();
    const projection = this.map.getProjection();
    const worldCoordinate = projection.fromLatLngToPoint(latLng);
    const pixelCoordinate = new this.google.maps.Point(worldCoordinate.x * numTiles, worldCoordinate.y * numTiles);
    const topLeft = new this.google.maps.LatLng(this.map.getBounds().getNorthEast().lat(), this.map.getBounds().getSouthWest().lng());
    const topLeftWorldCoordinate = projection.fromLatLngToPoint(topLeft);
    const topLeftPixelCoordinate = new this.google.maps.Point(topLeftWorldCoordinate.x * numTiles, topLeftWorldCoordinate.y * numTiles);
    return new this.google.maps.Point(pixelCoordinate.x - topLeftPixelCoordinate.x, pixelCoordinate.y - topLeftPixelCoordinate.y);
  }
  mapPointerMoveEvent(cb) {
    if (this.mouseOverAdded === false) {
      this.mouseOverAdded = true;
      const self2 = this;
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        if (this.layerAssets[i2].get("isCluster")) {
          continue;
        }
        this.layerAssets[i2].addListener("mouseover", function(event) {
          const pixelCoordinate = self2.getPixelByLatLng(event.latLng);
          const id2 = self2.getFeatureId(event.feature);
          if (self2.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
            let color2 = "#0099FF";
            if (self2.compActionType === "primary") {
              color2 = "LimeGreen";
            } else if (self2.compActionType === "secondary") {
              color2 = "black";
            } else {
              if (self2.toolTipOnFeatureHover && typeof self2.toolTipOnFeatureHover === "function") {
                self2.toolTipOnFeatureHover(event);
              }
            }
            const type = event.feature.getGeometry().getType();
            if (type === "Point") {
            } else if (type === "MultiPoint") {
              const icon = {
                path: self2.google.maps.SymbolPath.CIRCLE,
                strokeOpacity: 1,
                scale: 7,
                strokeColor: color2,
                strokeWeight: 1,
                fillColor: color2,
                fillOpacity: 0.5
              };
              self2.layerAssets[i2].overrideStyle(event.feature, { icon });
            } else {
              self2.layerAssets[i2].overrideStyle(event.feature, { strokeColor: color2 });
            }
          }
          if (cb && typeof cb === "function") {
            cb({ id: id2, pixel: [pixelCoordinate.x, pixelCoordinate.y] });
          }
        });
        if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
          this.layerAssets[i2].addListener("mouseout", function(event) {
            self2.layerAssets[i2].revertStyle();
          });
        }
      }
    }
  }
  updateLocation(lat, lon, id2, image, name, proId, isMapClick) {
    const position = new this.google.maps.LatLng(lat.toFixed(7), lon.toFixed(7));
    this.markerImage = image;
    this.updateLocationMarkers.push({ coor: position, id: id2, proId });
    if (!this.marker) {
      const geom = new this.google.maps.Data.Point(this.updateLocationMarkers[0].coor);
      this.marker = new this.google.maps.Data.Feature();
      this.marker.setGeometry(geom);
      if (this.markerImage != null) {
        this.marker.setProperty("icon", this.markerImage);
      }
      this.marker.setProperty("zIndex", this.layerIndexAddress);
      this.marker.setProperty("id", this.updateLocationMarkers[0].proId);
      this.marker.id = this.updateLocationMarkers[0].proId;
      this.layerAssets[this.layerIndexAddress].add(this.marker);
    }
    if (this.updateLocationMarkers && this.updateLocationMarkers.length > 0) {
      this.marker.setGeometry(new this.google.maps.Data.Point(this.updateLocationMarkers[this.updateLocationMarkers.length - 1].coor));
    }
    if (isMapClick === false) {
      const bounds = new this.google.maps.LatLngBounds();
      bounds.extend(position);
      this.map.fitBounds(bounds);
      this.map.setCenter(position);
      this.map.panToBounds(bounds);
    }
  }
  removeLocation(feature) {
    if (feature) {
      if (this.layerAssets[this.layerIndexAddress] !== null) {
        this.layerAssets[this.layerIndexAddress].remove(this.marker);
      }
    }
    this.marker = null;
  }
  zoomToLocation(lat, lon) {
    const position = new this.google.maps.LatLng(lat, lon);
    const bounds = new this.google.maps.LatLngBounds();
    bounds.extend(position);
    this.map.fitBounds(bounds);
    this.map.setCenter(position);
    this.map.panToBounds(bounds);
    let cZoom = this.map.getZoom();
    cZoom = cZoom - 2 <= 0 ? cZoom : cZoom - 2;
    this.map.setZoom(cZoom);
  }
  zoomToValue(zoomValue) {
    if (zoomValue) {
      this.map.setZoom(zoomValue);
    }
  }
  // 14781
  centerDefault() {
    const position = new this.google.maps.LatLng(this.defaultLat, this.defaultLon);
    this.map.setCenter(position);
  }
  // 14781
  fitLayers(layersIndexFit, hasDefaultCoord) {
    const bounds = new this.google.maps.LatLngBounds();
    if (hasDefaultCoord) {
      bounds.extend(new this.google.maps.LatLng(this.defaultLat, this.defaultLon));
    }
    for (let i2 = 0; i2 < layersIndexFit.length; i2++) {
      const idx = layersIndexFit[i2];
      if (this.isHeatLayer(idx)) {
        continue;
      }
      this.layerAssets[idx].forEach(function(feature) {
        const geom = feature.getGeometry();
        geom.forEachLatLng(function(latlng) {
          bounds.extend(latlng);
        });
      });
    }
    this.map.fitBounds(bounds, { duration: 0 });
  }
  fitLayerIndex(layersIndexFit) {
    const bounds = new this.google.maps.LatLngBounds();
    if (this.isHeatLayer(layersIndexFit)) {
      return;
    }
    this.layerAssets[layersIndexFit].forEach((feature) => {
      const geom = feature.getGeometry();
      geom.forEachLatLng((latlng) => {
        bounds.extend(latlng);
      });
    });
    this.map.fitBounds(bounds, { duration: 0 });
  }
  createMarkerAsset(lat, lon, id2, image, name, type) {
    const location2 = new this.google.maps.LatLng(lat, lon);
    let f = this.getFeatureById(id2);
    const properties2 = this.createPointProperty(location2, image, name, id2, null, null, null, null, null, null, null, null);
    if (type) {
      properties2.assetType = type;
    }
    properties2.id = id2;
    const geom = new this.google.maps.Data.Point(location2);
    if (type) {
      geom.assetType = type;
    }
    if (f == null) {
      geom.id = id2;
      f = new this.google.maps.Data.Feature();
      f.setGeometry(geom);
      f.id = id2;
      this.setFeatureProperties(f, properties2);
      this.storeSelectedAssets(f, void 0);
    } else {
      f.setGeometry(geom);
    }
    return location2;
  }
  getGEOJSON(cb) {
    const geoJson = { type: "FeatureCollection", features: [] };
    geoJson.features = this.shapes.getGeoJson();
    if (cb && typeof cb === "function") {
      cb(geoJson);
    }
  }
  transformEPSG(long, lat, from2, to) {
  }
  isHeatLayer(layerIndex) {
    if (layerIndex < this.layerAssets.length) {
      const isHeatMap = this.layerAssets[layerIndex].get("isHeatMap");
      if (isHeatMap) {
        return true;
      }
      return false;
    }
    return false;
  }
  fit(ConfigService3, maxZoom, initialZoomChange) {
    const bounds = new this.google.maps.LatLngBounds();
    let hasFeature = false;
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      try {
        if (this.layerAssets[i2].isCluster) {
          const features = this.layerAssets[i2].markers;
          features.forEach(function(feature) {
            const latlng = feature.position;
            if (latlng) {
              hasFeature = true;
              bounds.extend(latlng);
            }
          });
        } else {
          this.layerAssets[i2].forEach(function(feature) {
            const geom = feature.getGeometry();
            if (geom) {
              geom.forEachLatLng(function(latlng) {
                hasFeature = true;
                bounds.extend(latlng);
              });
            }
          });
        }
      } catch (err) {
        console.log(`**** Fit feature error happen in layer index = ${i2}`, err);
      }
    }
    this.map.fitBounds(bounds, { duration: 0 });
    if (hasFeature) {
      this.bounds = bounds;
    }
    if (initialZoomChange != null && initialZoomChange !== 0) {
      const self2 = this;
      const listener = this.google.maps.event.addListener(this.map, "idle", function() {
        console.log("%c idle 2 ", "color:blue");
        let currentZoom = self2.map.getZoom();
        currentZoom += initialZoomChange;
        self2.map.setZoom(currentZoom);
        self2.google.maps.event.removeListener(listener);
      });
    }
    this.clampZoomFloor();
  }
  fitCoords(coords) {
    if (!coords || coords.length === 0) {
      return;
    }
    this.bounds = new this.google.maps.LatLngBounds();
    this.fitCoordCount = coords.length;
    for (let i2 = 0; i2 < coords.length; i2++) {
      this.bounds.extend(new this.google.maps.LatLng(coords[i2][1], coords[i2][0]));
    }
    this.map.fitBounds(this.bounds, { duration: 0 });
    if (coords.length === 1) {
      let currentZoom = this.map.getZoom();
      currentZoom = currentZoom - 2;
      if (currentZoom < 0) {
        currentZoom = 1;
      }
      this.map.setZoom(currentZoom);
    }
    this.clampZoomFloor();
  }
  mapReadOnly(isReadOnly) {
  }
  getAllFeatures() {
    let features = [];
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      if (this.layerAssets[i2].isCluster) {
        const lst = this.layerAssets[i2].markers;
        if (lst && lst.length > 0) {
          for (let i3 = 0; i3 < lst.length; i3++) {
            features.push(lst[i3]);
          }
        }
      } else {
        this.layerAssets[i2].forEach(function(feature) {
          features.push(feature);
        });
      }
    }
    return features;
  }
  getDifference(a1, a2) {
    a1 = a1 > 0 ? a1 : 360 + a1;
    a2 = a2 > 0 ? a2 : 360 + a2;
    let angle = Math.abs(a1 - a2) + 180;
    if (angle > 180) {
      angle = 360 - angle;
    }
    return Math.abs(angle);
  }
  getBearings(point1, point2, point3) {
    const bearing1 = this.google.maps.geometry.spherical.computeHeading(point1, point2);
    const bearing2 = this.google.maps.geometry.spherical.computeHeading(point2, point3);
    const angle = this.getDifference(bearing1, bearing2);
    return angle;
  }
  rad(x) {
    return x * Math.PI / 180;
  }
  getDistance(p12, p22) {
    const R = 6378137;
    const dLat = this.rad(p22.lat() - p12.lat());
    const dLong = this.rad(p22.lng() - p12.lng());
    const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(this.rad(p12.lat())) * Math.cos(this.rad(p22.lat())) * Math.sin(dLong / 2) * Math.sin(dLong / 2);
    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
    const d = R * c;
    return d;
  }
  getFeaturesFromMap(features, clickedFeature, type, assetSelectionsAvailable) {
    let existedFeature;
    let clickedId = this.getFeatureId(clickedFeature);
    const p = this.getFeatureProperties(clickedFeature, ["layerDisplayOnly", "zIndex", "isCluster"]);
    const pId = this.getFeatureId(clickedFeature);
    const pLayerDisplayOnly = p.layerDisplayOnly;
    const zIndex = p.zIndex;
    const self2 = this;
    if (p.isCluster) {
      for (let i2 = 0; i2 < this.selectedAssets.length; i2++) {
        let sId = this.getFeatureId(this.selectedAssets[i2]);
        if (sId.indexOf(type) < 0) {
          continue;
        }
        if (sId === pId) {
          existedFeature = this.selectedAssets[i2];
          break;
        }
      }
      if (pLayerDisplayOnly || pId === "address") {
        return;
      }
      features.push(clickedFeature);
    } else {
      if (type === SclMapConstantService.ASSET_PRIMARY_TYPE) {
        if (clickedId && clickedId.indexOf("_secondary") < 0) {
          this.layerAssets[this.layerIndexPrimary].forEach(function(feature) {
            const fId = self2.getFeatureId(feature);
            if (fId === clickedId) {
              existedFeature = feature;
              return;
            }
          });
        } else {
          if (clickedId && clickedId.indexOf("_") > -1) {
            clickedId = clickedId.split("_")[0];
          }
          this.layerAssets[this.layerIndexPrimary].forEach(function(feature) {
            const fId = self2.getFeatureId(feature);
            if (fId && fId.indexOf(clickedId) > -1) {
              existedFeature = feature;
              return;
            }
          });
        }
        if (assetSelectionsAvailable == null && pLayerDisplayOnly) {
          return;
        } else {
          const iAssetSelectionsAvailable = assetSelectionsAvailable[zIndex - 1 < 0 ? 0 : zIndex - 1];
          let sType = type.replace("Asset", "");
          if (iAssetSelectionsAvailable != null && iAssetSelectionsAvailable.indexOf(sType) < 0) {
            if (sType != null && sType.trim().length > 0) {
              sType = sType.charAt(0).toUpperCase() + (sType != null && sType.trim().length > 1 ? sType.slice(1) : "");
            }
            console.log("sc-selected-asset: The assetSelectiosAvailable field is not set to allow " + sType + " selections for this layer");
            return;
          }
        }
        if (pLayerDisplayOnly || pId === "address") {
          return;
        }
        features.push(clickedFeature);
      } else if (type === SclMapConstantService.ASSET_SECONDARY_TYPE) {
        if (clickedId && clickedId.indexOf("_primary") < 0) {
          this.layerAssets[this.layerIndexSecondary].forEach(function(feature) {
            const fId = self2.getFeatureId(feature);
            if (fId === clickedId) {
              existedFeature = feature;
              return;
            }
          });
        } else {
          if (clickedId && clickedId.indexOf("_") > -1) {
            clickedId = clickedId.split("_")[0];
          }
          this.layerAssets[this.layerIndexSecondary].forEach(function(feature) {
            const fId = self2.getFeatureId(feature);
            if (fId && fId.indexOf(clickedId) > -1) {
              existedFeature = feature;
              return;
            }
          });
        }
        if (pLayerDisplayOnly || pId === "address") {
          return;
        }
        features.push(clickedFeature);
      }
    }
    return existedFeature;
  }
  getAssetProperties(feature, relatedFields, coordinates2, typeAsset, typeSelection) {
    let name = "";
    let id2 = this.getFeatureId(feature);
    if (id2.indexOf("_") > -1) {
      id2 = id2.split("_")[0];
    }
    const p = this.getFeatureProperties(feature, ["name", "type", "radius", "circleCenter"]);
    const pName = p.name;
    if (pName) {
      name = pName;
    }
    let type = p.type;
    const propertiesLinkAsset = {
      documentId: id2,
      name
    };
    const asset = {
      type: "Feature",
      properties: {
        type: typeAsset,
        linkAssets: []
      }
    };
    if (p.radius) {
      type = "Point";
      asset.properties.radius = p.radius;
      asset.properties.subType = "Circle";
    }
    if (!typeSelection || typeSelection === "featureCollection") {
      if (p.radius) {
        coordinates2 = p.circleCenter;
      }
      asset.geometry = {
        type: "Point",
        coordinates: coordinates2
        // [coordinates.lng(), coordinates.lat() ]
      };
    } else if (typeSelection !== "undefined" && typeSelection === SclMapConstantService.ASSET_SELECTION_MODE_ASSET) {
      const t = type;
      if (p.radius) {
        coordinates2 = p.circleCenter;
      }
      asset.geometry = {
        type: t,
        coordinates: coordinates2
        // [coordinates.lng(), coordinates.lat() ]
      };
    }
    if (!id2) {
      return "";
    }
    if (relatedFields) {
      for (const field in relatedFields) {
        if (relatedFields.hasOwnProperty(field)) {
          const value = this.getFeatureProperty(feature, field);
          if (value) {
            propertiesLinkAsset[field] = value;
          }
        }
      }
    }
    asset.properties.linkAssets.push(propertiesLinkAsset);
    return asset;
  }
  removeUnselectedAssetItem(existAsset, assets, type) {
    if (existAsset) {
      let isExist = false;
      let idExistAsset = existAsset.properties.linkAssets[0].documentId;
      if (idExistAsset && idExistAsset.indexOf("_") > -1) {
        idExistAsset = idExistAsset.split("_")[0];
      }
      for (let j = 0; j < assets.length; j++) {
        const item = assets[j];
        const idItem = item.properties.linkAssets[0].documentId;
        if (idItem && idItem.indexOf(idExistAsset) > -1) {
          assets.splice(j, 1);
          break;
        }
      }
      const len = this.selectedAssets.length;
      for (let i2 = len - 1; i2 > -1; i2--) {
        const f = this.selectedAssets[i2];
        const fId = this.getFeatureId(f);
        if (fId && fId.indexOf(idExistAsset) > -1) {
          try {
            f.setMap(null);
          } catch (err) {
            const isRemoved = false;
            const self2 = this;
            if (type === SclMapConstantService.ASSET_PRIMARY_TYPE) {
              this.layerAssets[this.layerIndexPrimary].forEach(function(fea) {
                const id2 = self2.getFeatureId(fea);
                if (id2 && id2.indexOf(idExistAsset) > -1) {
                  self2.layerAssets[self2.layerIndexPrimary].remove(fea);
                }
              });
            } else if (type === SclMapConstantService.ASSET_SECONDARY_TYPE) {
              this.layerAssets[this.layerIndexSecondary].forEach(function(fea) {
                const id2 = self2.getFeatureId(fea);
                if (id2 && id2.indexOf(idExistAsset) > -1) {
                  self2.layerAssets[self2.layerIndexSecondary].remove(fea);
                }
              });
            }
          }
          this.selectedAssets.splice(i2, 1);
          isExist = true;
          break;
        }
      }
      return isExist;
    }
    return false;
  }
  parseAssetsFromFeatures(features, assetField, coor, typeAsset, mode) {
    if (mode === SclMapConstantService.ASSET_SELECTION_MODE_ASSET) {
      const asset = this.getAssetProperties(features, assetField.relatedFields, coor, typeAsset, mode);
      return asset;
    } else {
      const assets = [];
      for (let i2 = 0; i2 < features.length; i2++) {
        const asset = this.getAssetProperties(features[i2], assetField.relatedFields, coor[i2], typeAsset, null);
        if (!asset) {
          return;
        }
        assets.push(asset);
      }
      return assets;
    }
  }
  getAllFeaturesSelected() {
    return this.selectedFeatures == null ? [] : this.selectedFeatures;
  }
  addInteractionSelect(currentSelected) {
    if (this.selectedFeatures == null || currentSelected != null && this.selectedFeatures.length !== currentSelected.length) {
      this.selectedFeatures = currentSelected;
    }
    const self2 = this;
    this.layerAssets[this.layerIndexUser].forEach(function(f) {
      self2.layerAssets[self2.layerIndexUser].overrideStyle(f, { zIndex: self2.layerIndexUser, visible: true });
    });
    for (let i2 = 0; i2 < this.selectedFeatures.length; i2++) {
      let id2 = this.getFeatureId(this.selectedFeatures[i2]);
      if (id2 && id2.indexOf("_") > -1) {
        id2 = id2.split("_")[0];
      }
      for (let j = 0; j < this.layerIndexFilter + 1; j++) {
        if (this.isHeatLayer(j) || this.layerAssets[j].get("isCluster")) {
          continue;
        }
        this.layerAssets[j].forEach(function(f) {
          const fId = self2.getFeatureId(f);
          if (fId && fId.indexOf(id2) > -1) {
            self2.layerAssets[j].overrideStyle(f, { zIndex: j });
          }
        });
      }
    }
    this.multipleSelection = true;
  }
  removeInteractionSelect() {
    this.multipleSelection = false;
    const self2 = this;
    this.layerAssets[this.layerIndexUser].forEach(function(f) {
      self2.layerAssets[self2.layerIndexUser].overrideStyle(f, { visible: false });
    });
    for (let i2 = 0; i2 < this.selectedFeatures.length; i2++) {
      let id2 = this.getFeatureId(this.selectedFeatures[i2]);
      if (id2 && id2.indexOf("_") > -1) {
        id2 = id2.split("_")[0];
      }
      for (let j = 0; j < this.layerIndexFilter + 1; j++) {
        if (this.isHeatLayer(j) || this.layerAssets[j].get("isCluster")) {
          continue;
        }
        this.layerAssets[j].forEach(function(f) {
          const fId = self2.getFeatureId(f);
          if (fId && fId.indexOf(id2) > -1) {
            self2.layerAssets[j].overrideStyle(f, { zIndex: j });
          }
        });
      }
    }
  }
  showLayer(options) {
    this.modeMultiple = options.isShow;
    if (options.isShow) {
      this.addInteractionSelect(options.currentSelected);
    } else {
      this.removeInteractionSelect();
    }
  }
  activeInteractionSelect(isActive) {
    this.multipleSelection = isActive;
  }
  drawActionDelete(event) {
  }
  drawActionProperties(evt) {
  }
  interactionSelect() {
  }
  interactionModify() {
  }
  createTextStyle_14313(label, pColor) {
    const fontFamily = label.labelFont === "" || label.labelFont == null ? "Open Sans" : label.labelFont;
    let sColor = pColor;
    if (label.labelColor !== void 0 && label.labelColor !== null && label.labelColor !== "") {
      sColor = label.labelColor;
    }
    const fontSize = label.labelFontSize === "" || label.labelFontSize == null ? "12px" : typeof label.labelFontSize === "string" ? label.labelFontSize.replace("px", "") + "px" : label.labelFontSize + "px";
    const baseline = label.labelTextBaseline === "" || label.labelTextBaseline == null ? "baseline" : label.labelTextBaseline + "";
    const fontWeight = label.labelFontWeight === "" || label.labelFontWeight == null ? "normal" : label.labelFontWeight;
    const strokeColor = label.labelOutlineColor === "" || label.labelOutlineColor == null ? "black" : label.labelOutlineColor;
    const strokeWidth = label.labelOutlineWidth === "" || label.labelOutlineWidth == null ? "2px" : label.labelOutlineWidth + "px";
    const rotation = label.labelRotation === "" || label.labelRotation == null ? 0 : label.labelRotation;
    let padding = label.labelPadding === "" || label.labelPadding == null ? void 0 : label.labelPadding;
    if (!padding) {
      padding = [0, 0, 0, 0];
    }
    const style2 = {
      "text-align": label.labelTextAlign,
      "vertical-align": baseline,
      color: sColor,
      "-webkit-text-stroke-color": strokeColor,
      "-webkit-text-stroke-width": strokeWidth,
      "font-family": fontFamily,
      "font-size": fontSize,
      "transform-origin": "0 0",
      transform: "rotate(" + parseFloat(rotation) + "deg)",
      "padding-top": padding[0] + "px",
      "padding-right": padding[1] + "px",
      "padding-bottom": padding[2] + "px",
      "padding-left": padding[3] + "px"
    };
    if (fontWeight === "bold") {
      style2["font-weight"] = fontWeight;
    } else {
      style2["font-style"] = fontWeight;
    }
    const offsetY = label.labelOffsetY === "" || label.labelOffsetY == null ? 0 : label.labelOffsetY;
    if (offsetY !== 0) {
      style2.position = "relative";
      style2.top = offsetY + "px";
    }
    return style2;
  }
  createTextStyle(label, pColor) {
    const fontFamily = label.labelFont ? label.labelFont : "Open Sans";
    let sColor = pColor;
    if (label.labelColor) {
      sColor = label.labelColor;
    }
    const fontSize = !label.labelFontSize ? "12px" : typeof label.labelFontSize === "string" ? label.labelFontSize.replace("px", "") + "px" : label.labelFontSize + "px";
    let fontWeight = label.labelFontWeight ? label.labelFontWeight : "normal";
    fontWeight = fontWeight.toLowerCase();
    const rotation = label.labelRotation ? label.labelRotation : 0;
    let padding = label.labelPadding === "" || label.labelPadding == null ? void 0 : label.labelPadding;
    if (!padding) {
      padding = [0, 0, 0, 0];
    }
    const strokeColor = label.labelOutlineColor ? label.labelOutlineColor : "black";
    const strokeWidth = !label.labelOutlineWidth ? "0px" : typeof label.labelOutlineWidth === "string" ? label.labelOutlineWidth.replace("px", "") + "px" : label.labelOutlineWidth + "px";
    const style2 = {
      display: "inline-block",
      "text-align": "" + label.labelTextAlign,
      "vertical-align": "" + (label.labelTextBaseline === "" || label.labelTextBaseline == null) ? "baseline" : label.labelTextBaseline + "",
      color: sColor,
      "-webkit-text-stroke-color": strokeColor,
      "-webkit-text-stroke-width": strokeWidth,
      "text-indent": "" + (label.labelOffsetX === "" || label.labelOffsetX == null) ? 0 : label.labelOffsetX + "px",
      "font-family": "" + fontFamily,
      "font-size": fontSize,
      "transform-origin": "0 0",
      transform: "rotate(" + parseFloat(rotation) + "deg)"
    };
    if (fontWeight === "bold") {
      style2["font-weight"] = fontWeight;
    } else {
      style2["font-style"] = fontWeight;
    }
    const offsetY = label.labelOffsetY === "" || label.labelOffsetY == null ? 0 : label.labelOffsetY;
    if (offsetY !== 0) {
      style2.position = "relative";
      style2.top = offsetY + "px";
    }
    return style2;
  }
  centerPoint(points) {
    const center = [0, 0];
    for (let i2 = 0; i2 < points.length; i2++) {
      center[0] += points[i2].lat;
      center[1] += points[i2].lng;
    }
    const totalPoint = points.length;
    center[0] = center[0] / totalPoint;
    center[1] = center[1] / totalPoint;
    return center;
  }
  createLabel(lat, lon, label, color2, id2) {
    const currentZoom = this.map.getZoom();
    const displayZoom = !label.labelDisplayZoom ? 9 : label.labelDisplayZoom > 17 ? 17 : label.labelDisplayZoom;
    const text = currentZoom < displayZoom ? "" : label.labelText ? label.labelText : "";
    const lb = new this.MarkerWithLabel({
      // map: this.map,
      position: new this.google.maps.LatLng(lat, lon),
      icon: "  ",
      // markerIcon,
      labelContent: text,
      labelAnchor: new this.google.maps.Point(18, 12),
      labelClass: "",
      // the CSS class for the label
      labelStyle: this.createTextStyle(label, color2),
      //
      labelInBackground: true
    });
    lb.label.labelDiv_.id = id2;
    lb.labelText = label.labelText;
    lb.labelDisplayZoom = label.labelDisplayZoom;
    return lb;
  }
  updateLabelAllLayers() {
    const currentZoom = this.map.getZoom();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      try {
        if (this.layerAssets[i2].get("isCluster")) {
          continue;
        }
        this.layerAssets[i2].forEach((fea) => {
          const lb = this.getFeatureProperty(fea, "lb");
          if (lb) {
            const displayZoom = !lb.labelDisplayZoom ? 9 : lb.labelDisplayZoom > 17 ? 17 : lb.labelDisplayZoom;
            const text = currentZoom < displayZoom ? "" : lb.labelText ? lb.labelText : "";
            lb.labelContent = text;
          }
        });
      } catch (err) {
        console.log(err);
      }
    }
  }
  updateRotateScaleByZoom() {
    const currentZoom = this.map.getZoom();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      try {
        if (this.layerAssets[i2].get("isCluster") || this.isHeatLayer(i2)) {
          continue;
        }
        this.layerAssets[i2].forEach((fea) => {
          const p = this.getFeatureProperties(fea, ["icon", "id", "rotation", "size", "scaledInfo", "lb"]);
          const pIcon = p.icon + "#" + p.id;
          if (p.lb) {
            const displayZoom = !p.lb.labelDisplayZoom ? 9 : p.lb.labelDisplayZoom > 17 ? 17 : p.lb.labelDisplayZoom;
            const text = currentZoom < displayZoom ? "" : p.lb.labelText ? p.lb.labelText : "";
            p.lb.labelContent = text;
          }
          if (p.rotation && p.rotation != 0) {
            this.iconRotate(pIcon, p.rotation, p.id);
          }
          if (p.scaledInfo) {
            this.iconScale(pIcon, p.size[0], p.size[1], p.scaledInfo.w, p.scaledInfo.h, p.scaledInfo.top, p.scaledInfo.left, p.scaledInfo.isFlip);
          }
        });
      } catch (err) {
        console.log(err);
      }
    }
  }
  traverseCoor(coor, obj) {
    if (Array.isArray(coor)) {
      for (let i2 = 0; i2 < coor.length; i2++) {
        if (Array.isArray(coor[i2])) {
          this.traverseCoor(coor[i2], obj);
        } else {
          if (isNaN(coor[i2])) {
            obj.hasNaN = true;
          } else {
            coor[i2] = Number(coor[i2]);
          }
        }
      }
    }
  }
  createFeatureCluster(coord, type, options) {
    let geom;
    let properties2;
    const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
    const url = options.url ? options.url : "";
    const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
    const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
    const lon = Number(coord[0]);
    const lat = Number(coord[1]);
    if (isNaN(lon) || isNaN(lat)) {
      return null;
    }
    const latLng = new this.google.maps.LatLng(lat, lon);
    let point = SclMapConstantService.MAP_MARKER;
    if (options.point) {
      point = options.point;
    }
    if (options.imageFileNo) {
      point = "/api/getFile/" + options.imageFileNo;
    }
    if (options.image) {
      point = options.image;
    }
    properties2 = this.createPointProperty(latLng, point, options.name, options.id, relatedAssets, options.color, options.layerDisplayOnly, options.tooltip, options.anchor, type, "", options.url);
    let clusterImageWidth = 18;
    let clusterImageHeight = 30;
    if (options.layer.clusterImageWidth) {
      clusterImageWidth = options.layer.clusterImageWidth;
    }
    if (options.layer.clusterImageHeight) {
      clusterImageHeight = options.layer.clusterImageHeight;
    }
    const markerImage = new this.google.maps.MarkerImage(point, new this.google.maps.Size(clusterImageWidth, clusterImageHeight));
    const feature = new this.google.maps.Marker({
      position: latLng,
      icon: markerImage
    });
    properties2.clusterImageWidth = clusterImageWidth;
    properties2.clusterImageHeight = clusterImageHeight;
    properties2.isCluster = true;
    if (options.rotation) {
      properties2.rotation = options.rotation;
    }
    if (options.scale) {
      properties2.scale = options.scale;
    }
    feature.setValues(properties2);
    this.google.maps.event.addListener(feature, "click", () => {
      const fs = [feature];
      const fId = feature.id;
      let id0 = fId;
      if (id0.indexOf("_") > -1) {
        id0 = id0.split("_")[0];
      }
      const lst = this.layerAssets[feature.zIndex].markers;
      for (let i2 = 0; i2 < lst.length; i2++) {
        const nId = lst[i2].id;
        if (nId === fId) {
          continue;
        }
        if (nId.indexOf(id0) > -1) {
          fs.push(lst[i2]);
        }
      }
      if (this.multipleSelection) {
        const isRemove = this.removeSelectedAsset(id0);
        if (isRemove) {
          return;
        }
      }
      if (this.singleSelectModeCluster && typeof this.singleSelectModeCluster === "function") {
        this.singleSelectModeCluster(fs);
      }
      const latLng2 = feature.getPosition();
      const obj = { latLng: [latLng2.lng(), latLng2.lat()], clickFeature: feature };
      if (this.drawStartCluster && typeof this.drawStartCluster === "function") {
        this.drawStartCluster(obj);
      }
      if (this.drawEndCluster && typeof this.drawEndCluster === "function") {
        this.drawEndCluster(obj);
      }
    });
    return feature;
  }
  createFeatureByType(coord, type, options) {
    let geom;
    let properties2;
    const relatedAssets = options.relatedAsset ? options.relatedAsset : "";
    const url = options.url ? options.url : "";
    const primaryMultiPopup = options.primaryMultiPopup ? options.primaryMultiPopup : "";
    const secondaryMultiPopup = options.secondaryMultiPopup ? options.secondaryMultiPopup : "";
    const radius = options.radius;
    if (type === "Point") {
      if (options.layerType === "cluster") {
        return this.createFeatureCluster(coord, type, options);
      } else {
        const lon = Number(coord[0]);
        const lat = Number(coord[1]);
        if (isNaN(lon) || isNaN(lat)) {
          return null;
        }
        const latLng = new this.google.maps.LatLng(lat, lon);
        let point = SclMapConstantService.MAP_MARKER;
        if (options.point) {
          point = options.point;
        }
        if (options.imageFileNo) {
          point = "/api/getFile/" + options.imageFileNo;
        }
        if (options.image) {
          point = options.image;
        }
        properties2 = this.createPointProperty(latLng, point, options.name, options.id, relatedAssets, options.color, options.layerDisplayOnly, options.tooltip, options.anchor, type, "", options.url);
        if (options.rotation) {
          properties2.rotation = options.rotation;
        }
        if (options.scale) {
          properties2.scale = options.scale;
        }
        geom = new this.google.maps.Data.Point(latLng);
        geom.id = options.id;
        if (typeof options.label !== void 0 && options.label != null) {
          properties2.lb = this.createLabel(lat, lon, options.label, options.color, options.id);
        }
      }
    } else {
      const hasNaN = false;
      const obj = { hasNaN };
      this.traverseCoor(coord, obj);
      if (obj.hasNaN) {
        return null;
      }
      if (options.layerType === "cluster") {
        type = "Point";
        const centerPoint = options.centerPoint;
        delete options.centerPoint;
        return this.createFeatureCluster(centerPoint, type, options);
      }
      let points = [];
      if (type === "MultiPoint") {
        for (let j = 0; j < coord.length; j++) {
          points.push({ lat: coord[j][1], lng: coord[j][0] });
        }
        geom = new this.google.maps.Data.MultiPoint(points);
      } else if (type === "LineString") {
        const elements = [];
        for (let i2 = 0; i2 < coord.length; i2++) {
          elements.push({ lat: coord[i2][1], lng: coord[i2][0] });
        }
        points = elements;
        geom = new this.google.maps.Data.LineString(elements);
      } else if (type === "MultiLineString") {
        const elements = [];
        for (let i2 = 0; i2 < coord.length; i2++) {
          const item = coord[i2];
          const part = [];
          for (let j = 0; j < item.length; j++) {
            part.push({ lat: item[j][1], lng: item[j][0] });
            points.push({ lat: item[j][1], lng: item[j][0] });
          }
          elements.push(part);
        }
        geom = new this.google.maps.Data.MultiLineString(elements);
      } else if (type === "Polygon") {
        const elements = [];
        for (let i2 = 0; i2 < coord.length; i2++) {
          const item = coord[i2];
          const part = [];
          for (let j = 0; j < item.length; j++) {
            part.push({ lat: item[j][1], lng: item[j][0] });
            points.push({ lat: item[j][1], lng: item[j][0] });
          }
          elements.push(part);
        }
        geom = new this.google.maps.Data.Polygon(elements);
      } else if (type === "MultiPolygon") {
        const elements = [];
        for (let i2 = 0; i2 < coord.length; i2++) {
          const item = coord[i2];
          const part = [];
          for (let j = 0; j < item.length; j++) {
            const jItem = item[j];
            const jPart = [];
            for (let k = 0; k < jItem.length; k++) {
              jPart.push({ lat: jItem[k][1], lng: jItem[k][0] });
              points.push({ lat: jItem[k][1], lng: jItem[k][0] });
            }
            part.push(jPart);
          }
          elements.push(part);
        }
        geom = new this.google.maps.Data.MultiPolygon(elements);
      }
      if (geom) {
        let color2 = "purple";
        if (options.color) {
          color2 = options.color;
        }
        properties2 = sclAssetLayers3.createLineProperties(options.layer, options.name, color2, options.id, options.tooltip, primaryMultiPopup, secondaryMultiPopup, options.layerDisplayOnly, relatedAssets, options.url);
        geom.id = options.id;
        if (typeof options.label !== void 0 && options.label != null) {
          const labelLatLng = this.centerPoint(points);
          properties2.lb = this.createLabel(labelLatLng[0], labelLatLng[1], options.label, color2, options.id);
        }
        if (type === "Polygon" && radius) {
          properties2.circleCenter = options.circleCenter;
          properties2.radius = radius;
          properties2.subType = "Circle";
        }
      }
    }
    const feature = new this.google.maps.Data.Feature();
    feature.setGeometry(geom);
    feature.id = options.id;
    this.setFeatureProperties(feature, properties2);
    return feature;
  }
  createPointProperty(latLng, image, name, id2, relatedAsset, color2, layerDisplayOnly, tooltip, anchor2, type, layerName, url) {
    const properties2 = {
      icon: image,
      name,
      id: id2
    };
    if (color2 != null) {
      properties2.color = color2;
    }
    if (tooltip != null) {
      properties2.tooltip = tooltip;
    }
    if (layerDisplayOnly != null) {
      properties2.layerDisplayOnly = layerDisplayOnly;
    }
    if (type != null) {
      properties2.type = type;
    }
    if (anchor2 != null) {
      properties2.anchor = anchor2;
    }
    if (layerName != null) {
      properties2.layerName = layerName;
    }
    if (url != null) {
      properties2.url = url;
    }
    if (relatedAsset != null) {
      for (const field in relatedAsset) {
        if (relatedAsset.hasOwnProperty(field)) {
          const value = relatedAsset[field];
          properties2[field] = value;
        }
      }
    }
    return properties2;
  }
  setFeatureProperties(feature, properties2) {
    if (feature.isCluster) {
      for (const p in properties2) {
        if (properties2.hasOwnProperty(p) && !feature.get(p)) {
          feature.set(p, properties2[p]);
        }
      }
    } else {
      for (const p in properties2) {
        if (properties2.hasOwnProperty(p)) {
          feature.setProperty(p, properties2[p]);
        }
      }
    }
  }
  resetFeatureProperties(feature, properties2) {
    feature.properties = properties2;
  }
  getFeatureProperty(feature, propertyName) {
    if (feature) {
      if (feature.isCluster) {
        return feature[propertyName];
      } else {
        return feature.getProperty(propertyName);
      }
    } else {
      return null;
    }
  }
  getFeatureProperties(feature, fieldNames) {
    const p = {};
    for (let i2 = 0; i2 < fieldNames.length; i2++) {
      p[fieldNames[i2]] = this.getFeatureProperty(feature, fieldNames[i2]);
    }
    return p;
  }
  getFeatureId(feature) {
    let id2 = feature.id;
    if (!id2) {
      id2 = feature.getId();
    }
    if (!id2) {
      id2 = feature.getProperty("id");
    }
    return id2;
  }
  setFeatureId(feature, id2) {
    feature.id = id2;
  }
  getFeatureGeomType(feature) {
    const geom = feature.getGeometry();
    const type = geom.getType();
    return type;
  }
  getFeatureById(id2) {
    let f = null;
    const self2 = this;
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      if (this.layerAssets[i2].get("isCluster")) {
        this.layerAssets[i2].markers.forEach(function(feature) {
          const fId = self2.getFeatureId(feature);
          if (fId === id2) {
            f = feature;
            return;
          }
        });
      } else {
        this.layerAssets[i2].forEach(function(feature) {
          const fId = self2.getFeatureId(feature);
          if (fId === id2) {
            f = feature;
            return;
          }
        });
      }
    }
    return f;
  }
  getFeatureByLayer(id2, layerIndex) {
    if (layerIndex > this.layerAssets.length - 1) {
      return null;
    }
    let f = null;
    if (this.isHeatLayer(layerIndex)) {
      return null;
    }
    const self2 = this;
    this.layerAssets[layerIndex].forEach(function(feature) {
      const fId = self2.getFeatureId(feature);
      if (fId === id2) {
        f = feature;
        return;
      }
    });
    return f;
  }
  // use for sc-address-map & sc-selected-asset
  getFeatureByPixel(pixel) {
    let f = null;
    if (typeof pixel.id === "undefined" || pixel.id === null) {
      return null;
    }
    const self2 = this;
    if (f == null) {
      for (let i2 = 0; i2 < this.layerIndexFilter + 1; i2++) {
        if (this.isHeatLayer(i2)) {
          continue;
        }
        if (this.layerAssets[i2].get("isCluster")) {
          const features = this.layerAssets[i2].markers;
          features.forEach((feature) => {
            const fId = this.getFeatureId(feature);
            if (fId === pixel.id) {
              f = feature;
              return;
            }
          });
        } else {
          this.layerAssets[i2].forEach(function(feature) {
            const fId = self2.getFeatureId(feature);
            if (fId === pixel.id) {
              f = feature;
              return;
            }
          });
        }
      }
    }
    return { feature: f, layerIdx: 0 };
  }
  featureClone(fea, layerIndex) {
    if (fea.isCluster) {
      const pos = fea.getPosition();
      const coords = [pos.lng(), pos.lat()];
      const p = this.getFeatureProperties(fea, [
        "clusterImageWidth",
        "clusterImageHeight",
        "imageFileNo",
        "name",
        "id",
        "color",
        "layerDisplayOnly",
        "anchor",
        "url",
        "tooltip",
        "label"
      ]);
      const layerClone = { clusterImageWidth: p.clusterImageWidth, clusterImageHeight: p.clusterImageHeight };
      const f = this.createFeatureByType(coords, "Point", {
        EPSG: null,
        imageFileNo: p.imageFileNo,
        name: p.name,
        id: p.id,
        color: p.color,
        layerDisplayOnly: p.layerDisplayOnly,
        anchor: p.anchor,
        url: p.url,
        layer: layerClone,
        tooltip: p.tooltip,
        point: SclMapConstantService.MAP_MARKER,
        label: p.label,
        layerType: "normal",
        layerIndex
      });
      return f;
    } else {
      return fea;
    }
  }
  getEventByPixel(pixel) {
  }
  addFeature(feature, layerIndex) {
    if (feature === null) {
      console.error("try to add feature NULL to layer");
      return;
    }
    if (this.layerAssets[layerIndex].get("isCluster")) {
      feature.set("zIndex", layerIndex);
      this.layerAssets[layerIndex].addMarker(feature);
    } else {
      this.layerAssets[layerIndex].add(feature);
      feature.setProperty("zIndex", layerIndex);
      const p = this.getFeatureProperties(feature, ["lb", "circle"]);
      const lb = p.lb;
      const circle = p.circle;
      if (lb) {
        if (lb.labelText && lb.labelText.trim().length > 0) {
          lb.label.labelDiv_.style.zIndex = layerIndex;
          lb.setMap(this.map);
        }
      }
      if (circle) {
        circle.setMap(this.map);
      }
    }
  }
  removeFeature(feature, layerIndex) {
    const self2 = this;
    const id2 = this.getFeatureId(feature);
    if (layerIndex) {
      if (layerIndex > this.layerAssets.length) {
        return;
      }
      this.layerAssets[layerIndex].forEach(function(f) {
        const fId = self2.getFeatureId(f);
        if (fId === id2) {
          self2.layerAssets[layerIndex].remove(feature);
          return;
        }
      });
    } else {
      try {
        feature.setMap(null);
      } catch (err) {
        for (let i2 = 1; i2 < this.layerIndexFilter + 1; i2++) {
          if (this.isHeatLayer(i2)) {
            continue;
          }
          if (this.layerAssets[i2].isCluster) {
            continue;
          } else {
            this.layerAssets[i2].forEach(function(f) {
              const fId = self2.getFeatureId(f);
              if (fId === id2) {
                self2.layerAssets[i2].remove(feature);
                return;
              }
            });
          }
        }
      }
    }
  }
  removeItemFromMap(id2) {
    const fea = this.getFeatureById(id2);
    if (fea) {
      const zIndex = this.getFeatureProperty(fea, "zIndex");
      if (zIndex) {
        this.removeFeature(fea, zIndex);
      }
    }
  }
  getMapSize() {
    const w = this.map.getDiv().offsetWidth;
    const h = this.map.getDiv().offsetHeight;
    return [w, h];
  }
  getBoundingBox(options) {
    const zoom = this.map.getZoom();
    const bounds = this.map.getBounds();
    if (bounds === void 0) {
      return null;
    } else {
      const northEast = bounds.getNorthEast();
      const southWest = bounds.getSouthWest();
      const left = southWest.lng();
      const bottom = southWest.lat();
      const top = northEast.lat();
      const right = northEast.lng();
      if (isNaN(left) || isNaN(bottom) || isNaN(top) || isNaN(right)) {
        return null;
      }
      let minLon = left;
      let maxLon = right;
      if (left > right) {
        minLon = right;
        maxLon = left;
      }
      let minLat = bottom;
      let maxLat = top;
      if (bottom > top) {
        minLat = top;
        maxLat = bottom;
      }
      return { minLon, maxLat, maxLon, minLat, zoom };
    }
  }
  addSearchAddress(apiKey, wrapper, cb) {
    const autocomplete = new this.google.maps.places.Autocomplete(wrapper, { types: ["geocode"] });
    this.google.maps.event.addListener(autocomplete, "place_changed", function() {
      const place = autocomplete.getPlace();
      const lat = place.geometry.location.lat();
      const lon = place.geometry.location.lng();
      if (cb && typeof cb === "function") {
        cb(place, lat, lon);
      }
    });
  }
  clearAllFeatures() {
    const self2 = this;
    for (let i2 = 1; i2 < this.layerIndexFilter + 1; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      this.layerAssets[i2].forEach((f) => {
        const lb = this.getFeatureProperty(f, "lb");
        if (lb) {
          lb.setMap(null);
        }
        self2.layerAssets[i2].remove(f);
      });
    }
  }
  clearAllFeaturesLayer(layerIndex) {
    if (layerIndex > this.layerAssets.length) {
      return;
    }
    const self2 = this;
    if (this.isHeatLayer(layerIndex)) {
      this.layerAssets[layerIndex].setMap(null);
    } else {
      if (this.layerAssets[layerIndex].get("isCluster")) {
        if (this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
          const lst = this.layerAssets[layerIndex].markers;
          if (lst && lst.length > 0) {
            this.layerAssets[layerIndex].removeMarkers(lst);
          }
        }
      } else {
        this.layerAssets[layerIndex].forEach((f) => {
          const lb = this.getFeatureProperty(f, "lb");
          if (lb) {
            lb.setMap(null);
          }
          self2.layerAssets[layerIndex].remove(f);
        });
      }
    }
  }
  mapMoveEnd(moveEndFunc) {
    if (this.type === SclMapConstantService.COMP_TYPE_BOUNDARY || this.type === SclMapConstantService.COMP_TYPE_STREET_ADDRESS || this.type === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
      this.map.addListener("zoom_changed", () => {
        console.log("%c zoom_changed ", "color:blue");
        if (moveEndFunc && typeof moveEndFunc === "function") {
          moveEndFunc();
        }
      });
    }
    this.google.maps.event.addListener(this.map, "dragend", () => {
      if (moveEndFunc && typeof moveEndFunc === "function") {
        moveEndFunc();
      }
    });
  }
  updateSize() {
  }
  getLatLngFromPixel(pixel) {
    return [];
  }
  getPixelFromCoordinate(coordinate) {
    const coor = coordinate;
    const lat = coor[1];
    const lng = coor[0];
    let siny = Math.sin(lat * Math.PI / 180);
    siny = Math.min(Math.max(siny, -0.9999), 0.9999);
    const TILE_SIZE = 256;
    const worldCoordinate = new this.google.maps.Point(TILE_SIZE * (0.5 + lng / 360), TILE_SIZE * (0.5 - Math.log((1 + siny) / (1 - siny)) / (4 * Math.PI)));
    const scale5 = 1 << this.map.getZoom();
    const pixel = [Math.floor(worldCoordinate.x * scale5), Math.floor(worldCoordinate.y * scale5)];
    return { coor, pixel };
  }
  checkClickFeatureIsExist(features, clickFeature, sType, assetSelectionsAvailable) {
    let existedFeature = this.getFeaturesFromMap(features, clickFeature, sType, assetSelectionsAvailable);
    if (existedFeature == null) {
      for (let i2 = 0; i2 < features.length; i2++) {
        const id2 = this.getFeatureProperty(features[i2], "id");
        if (id2 && id2.indexOf(sType) > -1) {
          existedFeature = features[i2];
          break;
        }
      }
    }
    return existedFeature;
  }
  findFeatureByClick(evt, sType, assetSelectionsAvailable) {
    const features = [];
    const obj = this.getPixelFromCoordinate(evt.latLng);
    let existedFeature;
    if (Array.isArray(evt.clickFeature)) {
      for (let i2 = 0; i2 < evt.clickFeature.length; i2++) {
        existedFeature = this.checkClickFeatureIsExist(features, evt.clickFeature[i2], sType, assetSelectionsAvailable);
      }
    } else {
      existedFeature = this.checkClickFeatureIsExist(features, evt.clickFeature, sType, assetSelectionsAvailable);
    }
    return { coor: obj.coor, pixel: obj.pixel, features, existedFeature };
  }
  storeSelectedAssets(feature, isPrimary) {
    const id2 = this.getFeatureId(feature);
    if (this.selectedAssets == null) {
      this.selectedAssets = [];
    }
    const len = this.selectedAssets.length;
    for (let i2 = 0; i2 < len; i2++) {
      if (this.selectedAssets[i2].id === id2) {
        const f = this.getFeatureById(id2);
        if (isPrimary == true) {
          feature.setProperty("zIndex", this.layerIndexPrimary);
          if (f == null) {
            this.layerAssets[this.layerIndexPrimary].add(feature);
          } else {
            this.layerAssets[this.layerIndexPrimary].remove(f);
            this.layerAssets[this.layerIndexPrimary].add(feature);
          }
        } else if (isPrimary == false) {
          feature.setProperty("zIndex", this.layerIndexSecondary);
          if (f == null) {
            this.layerAssets[this.layerIndexSecondary].add(feature);
          } else {
            this.layerAssets[this.layerIndexSecondary].remove(f);
            this.layerAssets[this.layerIndexSecondary].add(feature);
          }
        }
        this.selectedAssets[i2] = feature;
        return;
      }
    }
    this.selectedAssets.push(feature);
    if (isPrimary === void 0) {
      if (id2 && id2.indexOf("primary") > -1) {
        isPrimary = true;
      } else if (id2 && id2.indexOf("secondary") > -1) {
        isPrimary = false;
      }
    }
    if (isPrimary) {
      feature.setProperty("zIndex", this.layerIndexPrimary);
      this.layerAssets[this.layerIndexPrimary].add(feature);
    } else {
      feature.setProperty("zIndex", this.layerIndexSecondary);
      this.layerAssets[this.layerIndexSecondary].add(feature);
    }
  }
  updateStoredSelectedAssetVisualize(id2, handlebarsContext, primaryIcon, primaryAssetSelection, secondaryIcon, secondaryAssetSelection, handlebarAssetFn) {
    return __async(this, null, function* () {
      if (!this.selectedAssets) {
        return;
      }
      const len = this.selectedAssets.length;
      for (let i2 = 0; i2 < len; i2++) {
        const feature = this.selectedAssets[i2];
        const p = this.getFeatureProperties(feature, ["id", "assetType"]);
        ;
        let fId = p.id;
        if (fId.indexOf("_") > -1) {
          fId = fId.split("_")[0];
        }
        if (id2.indexOf(fId) > -1) {
          let isPrimary = false;
          if (p.assetType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
            isPrimary = true;
          }
          if (isPrimary) {
            const primary = yield handlebarAssetFn(handlebarsContext, primaryIcon, primaryAssetSelection, true);
            this.setFeatureProperties(feature, { primary });
            this.layerAssets[this.layerIndexPrimary].remove(feature);
            this.layerAssets[this.layerIndexPrimary].add(feature);
          } else {
            const secondary = yield handlebarAssetFn(handlebarsContext, secondaryIcon, secondaryAssetSelection, false);
            this.setFeatureProperties(feature, { secondary });
            this.layerAssets[this.layerIndexSecondary].remove(feature);
            this.layerAssets[this.layerIndexSecondary].add(feature);
          }
          break;
        }
      }
    });
  }
  removeSelectedAssetsById(id2) {
    const len = this.selectedAssets.length;
    let fId = id2;
    let sType = null;
    if (fId && fId.indexOf("primary") > -1) {
      fId = fId.split("_")[0];
      sType = SclMapConstantService.ASSET_PRIMARY_TYPE;
    } else if (fId && fId.indexOf("secondary") > -1) {
      fId = fId.split("_")[0];
      sType = SclMapConstantService.ASSET_SECONDARY_TYPE;
    }
    for (let i2 = len - 1; i2 > -1; i2--) {
      if (this.selectedAssets[i2].id && this.selectedAssets[i2].id.indexOf(sType) > -1 && this.selectedAssets[i2].id.indexOf(fId) > -1) {
        const f = this.selectedAssets[i2];
        const iId = this.getFeatureId(f);
        try {
          f.setMap(null);
        } catch (err) {
          const self2 = this;
          if (sType == null) {
            let isRemoved = false;
            this.layerAssets[this.layerIndexPrimary].forEach(function(fea) {
              const feaId = self2.getFeatureId(fea);
              if (feaId === iId) {
                self2.layerAssets[self2.layerIndexPrimary].remove(fea);
                isRemoved = true;
                return;
              }
            });
            if (isRemoved === false) {
              this.layerAssets[this.layerIndexSecondary].forEach(function(fea) {
                const feaId = self2.getFeatureId(fea);
                if (feaId === iId) {
                  self2.layerAssets[self2.layerIndexSecondary].remove(fea);
                  return;
                }
              });
            }
          } else {
            if (sType === SclMapConstantService.ASSET_PRIMARY_TYPE) {
              this.layerAssets[this.layerIndexPrimary].forEach(function(fea) {
                const feaId = self2.getFeatureId(fea);
                if (feaId && feaId.indexOf(fId) > -1) {
                  self2.layerAssets[self2.layerIndexPrimary].remove(fea);
                  return;
                }
              });
            } else {
              this.layerAssets[this.layerIndexSecondary].forEach(function(fea) {
                const feaId = self2.getFeatureId(fea);
                if (feaId && feaId.indexOf(fId) > -1) {
                  self2.layerAssets[self2.layerIndexSecondary].remove(fea);
                  return;
                }
              });
            }
          }
        }
        this.selectedAssets.splice(i2, 1);
        break;
      }
    }
  }
  removeLayerFeatures() {
    const self2 = this;
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      this.layerAssets[i2].forEach(function(feature) {
        self2.layerAssets[i2].remove(feature);
      });
    }
  }
  removeUnselectedAsset(assets, unSelectedAssetIds, type) {
    for (let i2 = 0; i2 < unSelectedAssetIds.length; i2++) {
      let priAsset = unSelectedAssetIds[i2];
      if (priAsset.indexOf("_") > -1) {
        priAsset = priAsset.split("_")[0];
      }
      for (let j = 0; j < assets.length; j++) {
        const id2 = assets[j].properties.linkAssets[0].documentId;
        if (id2 === priAsset) {
          this.removeSelectedAssetsById(id2 + "_" + type);
          assets.splice(j, 1);
        }
      }
    }
  }
  updateLayers(pLayerAssets) {
    this.removeLayerFeatures();
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.layerAssets[i2].setMap(null);
    }
    const obj = { layerAssets: pLayerAssets };
    this.createLayers(obj, null);
    for (let i2 = 1; i2 < this.layerAssets.length; i2++) {
      this.layerAssets[i2].setMap(this.map);
    }
    this.setLayerSelectAsset();
  }
  getFeaturesCollection(options) {
    const fs = [];
    const feature = options.feature;
    if (feature === null || typeof feature.getProperty !== "function") {
      return fs;
    }
    const id2 = this.getFeatureId(feature);
    const zIndex = this.getFeatureProperty(feature, "zIndex");
    fs.push({ feature, layerIdx: zIndex });
    if (id2 && id2.indexOf("_") < 0) {
      return fs;
    }
    const id0 = id2.split("_")[0];
    const self2 = this;
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2) || this.layerAssets[i2].get("isCluster")) {
        continue;
      }
      this.layerAssets[i2].forEach(function(f) {
        const fId = self2.getFeatureId(f);
        if (fId && fId !== id2 && fId.indexOf(id0) > -1) {
          fs.push({ feature: f, layerIdx: i2 });
        }
      });
    }
    return fs;
  }
  getFeaturesCollectionId(id2) {
    const fs = [];
    const self2 = this;
    for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
      if (this.isHeatLayer(i2)) {
        continue;
      }
      this.layerAssets[i2].forEach(function(f) {
        const fId = self2.getFeatureId(f);
        if (fId && fId.indexOf(id2) > -1) {
          let isExist = false;
          for (let k = 0; k < fs.length; k++) {
            if (self2.getFeatureId(fs[k]) === fId) {
              isExist = true;
              break;
            }
          }
          if (!isExist) {
            fs.push(f);
          }
        }
      });
    }
    return fs;
  }
  psmaStyleFunction(feature) {
    if (feature == null || feature.properties === null) {
      return {};
    }
    const fGeom = feature.getGeometry();
    const color2 = "gray";
    const type = feature.getProperty("type");
    const zIndex = feature.getProperty("zIndex");
    if (type === void 0 || type === "circle") {
      return (
        /** @type {!this.google.maps.Data.StyleOptions} */
        {
          fillOpacity: 1,
          strokeWeight: 2,
          zIndex
        }
      );
    } else {
      return (
        /** @type {!this.google.maps.Data.StyleOptions} */
        {
          fillColor: "rgba(255,255,255,0.4)",
          // white
          fillOpacity: 1,
          strokeColor: "#3399CC",
          // blue
          strokeWeight: 1,
          zIndex
        }
      );
    }
  }
  psmaCreateLayer(psmaPoints) {
    if (typeof this.psmaReverse === "undefined" || this.psmaReverse === null) {
      this.psmaReverse = {};
      this.layerAssets[this.layerIndexAddress].add(psmaPoints);
      this.psmaReverse.psmaSourceVector = this.layerAssets[this.layerIndexAddress];
      this.layerAssets[this.layerIndexAddress].setStyle(this.psmaStyleFunction.bind(this));
      this.psmaReverse.psmaLayer = this.layerAssets[this.layerIndexAddress];
      this.psmaReverse.isGoogle = true;
    }
    return this.psmaReverse;
  }
  psmaCreatePoint(coor, properties2, psmaPoints) {
    const options = {
      label: { labelText: properties2.description },
      color: "red"
    };
    const lb = this.createLabel(coor[1], coor[0], options.label, options.color, coor[1] + "_" + coor[0]);
    const latLng = new this.google.maps.LatLng(coor[1], coor[0]);
    const c = new this.google.maps.Circle({
      map: this.map,
      center: latLng,
      radius: 1,
      fillColor: "rgba(255, 127, 39, 1)",
      // orange
      strokeColor: "rgba(255, 0, 0, 1)",
      // red
      strokeWeight: 1.25
    });
    const f = new this.google.maps.Data.Feature();
    f.setGeometry(latLng);
    properties2.lb = lb;
    for (const p in properties2) {
      if (properties2.hasOwnProperty(p)) {
        f.setProperty(p, properties2[p]);
      }
    }
    psmaPoints.push(c);
    psmaPoints.push(f);
    return psmaPoints;
  }
  psmaCreatePointClick(coor, radius, psmaPoints) {
    const latLng = new this.google.maps.LatLng(coor[1], coor[0]);
    const circle = new this.google.maps.Circle({
      map: this.map,
      center: latLng,
      radius,
      fillOpacity: 0,
      strokeColor: "#3399CC",
      clickable: false
    });
    psmaPoints.push(this.marker);
    psmaPoints.push(circle);
    return psmaPoints;
  }
  psmaRemovePoint(psmaPoints, psmaSourceVector) {
    for (let i2 = 0; i2 < psmaPoints.length; ++i2) {
      if (psmaPoints[i2] == null) {
        continue;
      }
      if (psmaPoints[i2].j && psmaPoints[i2].j.properties && psmaPoints[i2].j.properties.lb) {
        psmaPoints[i2].j.properties.lb.setMap(null);
      }
      try {
        psmaSourceVector.remove(psmaPoints[i2]);
      } catch (err) {
        psmaPoints[i2].setMap(null);
      }
    }
    return { psmaPoints, psmaSourceVector };
  }
  psmaDistanceCoords(coorA, coorB) {
    const R = 6378137;
    const dLat = this.rad(coorB[1] - coorA[1]);
    const dLong = this.rad(coorB[0] - coorA[0]);
    const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(this.rad(coorA[1])) * Math.cos(this.rad(coorB[1])) * Math.sin(dLong / 2) * Math.sin(dLong / 2);
    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
    const d = R * c;
    return d;
  }
  positionView(lat, lon, zoom, EPSG) {
    lat = typeof lat !== "undefined" ? lat : 0;
    lon = typeof lon !== "undefined" ? lon : 0;
    zoom = typeof zoom !== "undefined" ? zoom : 2;
    EPSG = typeof EPSG !== "undefined" ? EPSG : "EPSG:3857";
    this.map.setZoom(zoom);
    this.map.setCenter(new this.google.maps.LatLng(lat, lon));
  }
  setCenterMapViewByCoordinates(bbox) {
    const southWest = new this.google.maps.LatLng(bbox[1][1], bbox[0][0]);
    const northEast = new this.google.maps.LatLng(bbox[0][1], bbox[1][0]);
    const bounds = new this.google.maps.LatLngBounds(southWest, northEast);
    this.map.fitBounds(bounds);
    this.map.setCenter(bounds.getCenter());
  }
  // 15262
  setCenter(lat, lon) {
    const center = new this.google.maps.LatLng(lat, lon);
    this.map.setCenter(center);
  }
  convertLatLngToPixel(latLng) {
    const scale5 = Math.pow(2, this.map.getZoom());
    const nw = new this.google.maps.LatLng(this.map.getBounds().getNorthEast().lat(), this.map.getBounds().getSouthWest().lng());
    const worldCoordinateNW = this.map.getProjection().fromLatLngToPoint(nw);
    const worldCoordinate = this.map.getProjection().fromLatLngToPoint(latLng);
    const pixelOffset = [
      Math.floor((worldCoordinate.x - worldCoordinateNW.x) * scale5),
      Math.floor((worldCoordinate.y - worldCoordinateNW.y) * scale5)
    ];
    return pixelOffset;
  }
  extendToCoordinate(coord) {
    const position = new this.google.maps.LatLng(coord[1], coord[0]);
    const bounds = new this.google.maps.LatLngBounds();
    bounds.extend(position);
    this.map.fitBounds(bounds, { duration: 0 });
  }
  getFeatureCoordinate(feature) {
    let coords = [];
    const coordArray = [];
    const tmpCoords = [];
    let type = null;
    try {
      const geom = (0, import_lodash7.cloneDeep)(feature.getGeometry());
      type = geom.getType();
      geom.forEachLatLng((latlng) => {
        tmpCoords.push([latlng.lng(), latlng.lat()]);
        coordArray.push([latlng.lng(), latlng.lat()]);
      });
      if (type === "MultiPoint") {
        coords = tmpCoords;
      } else {
        for (let i2 = 0; i2 < tmpCoords.length - 1; i2++) {
          coords.push([tmpCoords[i2], tmpCoords[i2 + 1]]);
        }
      }
    } catch (err) {
      console.log(`getFeatureCoordinate error: `, err);
    }
    return { coords, type, coordArray };
  }
};
_SclMappingFunctionGoogleService.\u0275fac = function SclMappingFunctionGoogleService_Factory(t) {
  return new (t || _SclMappingFunctionGoogleService)();
};
_SclMappingFunctionGoogleService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMappingFunctionGoogleService, factory: _SclMappingFunctionGoogleService.\u0275fac, providedIn: "root" });
var SclMappingFunctionGoogleService = _SclMappingFunctionGoogleService;

// projects/formbird-mapping/src/lib/scl-mapping-functions.service.ts
var isEqual = __toESM(require_isEqual());

// projects/formbird-sc-shared/src/lib/handlebars/sclHandlebars.ts
var Handlebars4 = __toESM(require_handlebars());
var compiledHandlebarsTemplates2 = {};
var defaultHelpers2 = [
  {
    name: "ifEquals",
    function: `function(arg1, arg2, options) {return (arg1 === arg2) ? options.fn(this) : options.inverse(this);}`
  },
  {
    name: "ifNotEquals",
    function: `function(arg1, arg2, options) {return (arg1 !== arg2) ? options.fn(this) : options.inverse(this);}`
  },
  {
    name: "switch",
    function: `function(value, options) {this.switch_value = value;this.switch_break = false; return options.fn(this);}`
  },
  {
    name: "case",
    function: `function(value, options) {if (value === this.switch_value) {this.switch_break = true;return options.fn(this);}}`
  },
  {
    name: "default",
    function: `function(value, options) {if (this.switch_break === false) {return value;}}`
  },
  {
    name: "dateFormat",
    function: `function(date, format, options) { return moment(date).format(format); }`
  },
  {
    name: "dateAdd",
    function: `function(date, amount, what, options) { return moment(date).add(amount, what).format(); }`
  },
  {
    name: "dateFromNow",
    function: `function(date, options) { return moment(date).fromNow(); }`
  },
  {
    name: "dateToNow",
    function: `function(date, options) { return moment(date).toNow(); }`
  },
  {
    name: "dateCalendar",
    function: `function(date, options) { return moment(date).calendar(); }`
  }
];
var sclHandlebars2 = /* @__PURE__ */ (() => {
  return {
    initHandlebars(helpers5) {
      for (let i2 = 0; i2 < defaultHelpers2.length; i2++) {
        if (typeof defaultHelpers2[i2].name === "string" && typeof defaultHelpers2[i2].function === "string") {
          let defaultHelps = new Function("return " + defaultHelpers2[i2].function)();
          Handlebars4.registerHelper(defaultHelpers2[i2].name, defaultHelps);
        }
      }
      if (typeof helpers5 !== "undefined" && helpers5 !== null) {
        for (const helper of helpers5) {
          if (typeof helper.name === "string" && typeof helper.function === "string") {
            let helpFunc2 = helper.function;
            if (typeof helpFunc2 === "string") {
              helpFunc2 = new Function("return " + helpFunc2)();
            }
            Handlebars4.registerHelper(helper.name, helpFunc2);
          }
        }
      }
    },
    defaultHelpers() {
      return defaultHelpers2;
    },
    checkRegistedHelpers(helpers5) {
      if (!helpers5) {
        return;
      }
      let isRegistered = true;
      for (let i2 = 0; i2 < helpers5.length; i2++) {
        if (typeof helpers5[i2].name === "string" && typeof helpers5[i2].function === "string") {
          if (!(helpers5[i2].name in Handlebars4.helpers)) {
            isRegistered = false;
            break;
          }
        }
      }
      if (!isRegistered) {
        sclHandlebars2.initHandlebars(helpers5);
      }
    },
    // throws an error instead of returning null
    processHandlebarsV2(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      if (handlebarsString == null || typeof handlebarsString === "undefined") {
        return "";
      }
      if ((typeof handlebarsString === "string" || handlebarsString instanceof String) && handlebarsString.indexOf("{{") < 0) {
        return handlebarsString;
      }
      sclHandlebars2.checkRegistedHelpers(helpers5);
      let hStr;
      if (typeof handlebarsString === "string") {
        hStr = handlebarsString;
      } else {
        hStr = JSON.stringify(handlebarsString);
      }
      if (!handlebarsContext) {
        handlebarsContext = {};
      }
      const invalidField = [
        "document",
        "doc",
        "account",
        "tpl",
        "componentDefinition",
        "results",
        "resultsCount",
        "resultsIndex",
        "result",
        "row"
      ];
      if (data) {
        if (Object(data) === data) {
          for (const f in data) {
            if (f === "queryResultDocument") {
              handlebarsContext.row = data[f];
              handlebarsContext.result = data[f];
              for (const j in data[f]) {
                if (data[f].hasOwnProperty(j)) {
                  if (invalidField.indexOf(j) > -1) {
                    console.log("Handlebars Context Error: the field " + j + " is already present in document documentId so could not be set. It's values will NOT be available to handlebars expressions. Please advise your Application Developer to not use this field name if possible");
                    continue;
                  }
                  handlebarsContext[j] = data[f][j];
                }
              }
            } else {
              if (handlebarsContext.hasOwnProperty(f)) {
                console.log("error : handlebarsString = " + handlebarsString + "\n	 data = " + JSON.stringify(data) + "\n	 handlebarsContext = " + JSON.stringify(handlebarsContext) + "\n	 helpers = " + JSON.stringify(helpers5));
                continue;
              }
              handlebarsContext[f] = data[f];
            }
          }
        } else {
          console.log("Handlebars Context Error: object " + data + " wasn't passed in and the parameters is being ignored");
        }
      }
      let result = null;
      try {
        let template;
        if (options?.handlebarsTemplateName && contextParams) {
          const templateKey = `${contextParams?.tpl?.documentId}_${contextParams?.tplItem?.name}_${options.handlebarsTemplateName}`;
          if (compiledHandlebarsTemplates2[templateKey]) {
            template = compiledHandlebarsTemplates2[templateKey];
          } else {
            template = Handlebars4.compile(hStr);
            compiledHandlebarsTemplates2[templateKey] = template;
          }
        } else {
          template = Handlebars4.compile(hStr);
        }
        result = template(handlebarsContext);
      } catch (err) {
        err.hStr = hStr;
        throw err;
      }
      return result;
    },
    // backward compatibility purposes because it's still used in a lot of areas: returns an null object
    processHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      let result = null;
      try {
        if (contextParams) {
          if (!handlebarsContext) {
            handlebarsContext = {};
          }
          handlebarsContext.document = contextParams.doc;
          handlebarsContext.doc = contextParams.doc;
          handlebarsContext.account = contextParams.account;
          handlebarsContext.tpl = contextParams.tpl;
          handlebarsContext.tplItem = contextParams.tplItem;
        }
        result = sclHandlebars2.processHandlebarsV2(handlebarsString, data, handlebarsContext, helpers5, contextParams, options);
      } catch (err) {
        console.error(err);
      }
      return result;
    },
    processIntHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      const hStr = sclHandlebars2.processHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options);
      if (hStr) {
        return parseInt(hStr, 0);
      } else {
        return 0;
      }
    },
    processFloatHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      const hStr = sclHandlebars2.processHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options);
      if (hStr) {
        return parseFloat(hStr);
      } else {
        return 0;
      }
    },
    processBooleanHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      return sclHandlebars2.processHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) === "true";
    },
    processArrayHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options) {
      let hStr = sclHandlebars2.processHandlebars(handlebarsString, data, handlebarsContext, helpers5, contextParams, options);
      if (hStr) {
        try {
          let arr = [];
          if (typeof hStr === "string" && hStr.indexOf(",") > -1) {
            if (hStr.indexOf("[") > -1) {
              hStr = hStr.replace("[", "");
            }
            if (hStr.indexOf("]") > -1) {
              hStr = hStr.replace("]", "");
            }
            const s = hStr.split(",");
            if (s?.length == 2 && (!isNaN(Number(s[0].trim())) && !isNaN(parseFloat(s[0].trim()))) && (!isNaN(Number(s[1].trim())) && !isNaN(parseFloat(s[1].trim())))) {
              arr = [parseFloat(s[0].trim()), parseFloat(s[1].trim())];
            }
          } else {
            const obj = JSON.parse(hStr);
            for (const i2 in obj) {
              if (obj.hasOwnProperty(i2)) {
                arr.push(obj[i2]);
              }
            }
          }
          return arr;
        } catch (err) {
          return null;
        }
      } else {
        return null;
      }
    }
  };
})();

// projects/formbird-mapping/src/lib/scl-mapping-functions.service.ts
var import_lodash8 = __toESM(require_lodash());

// projects/formbird-sc-shared/src/lib/scl-search-client.service.ts
var _SclSearchClientService = class _SclSearchClientService {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.executeComponentFunction = (options, resolve, reject) => __async(this, null, function* () {
      if (!options?.processHandlebars) {
        sclHandlebars2.initHandlebars(this.contextParams.componentDefinition.handlebarsHelpers);
        options.processHandlebars = sclHandlebars2.processHandlebars;
        options.handlebarsParams = this.contextParams;
      }
      this.searchClientService.executeComponentFunction(options, resolve, reject);
    });
    this.searchClientService = this.formbirdInjectorService.get("SearchClientService");
  }
  search(options) {
    if (!options?.processHandlebars && this.contextParams?.componentDefinition?.handlebarsHelpers) {
      sclHandlebars2.initHandlebars(this.contextParams.componentDefinition.handlebarsHelpers);
      options.processHandlebars = sclHandlebars2.processHandlebars;
      options.handlebarsParams = this.contextParams;
    }
    return this.searchClientService.search(options);
  }
  getDexieSearchFunction(options) {
    options.processHandlebars = sclHandlebars2.processHandlebars;
    options.handlebarsParams = this.contextParams;
    return this.searchClientService.getDexieSearchFunction(options);
  }
  getDefaultSearchProvider(context2) {
    this.contextParams = {
      document: context2.document,
      doc: context2.document,
      account: context2.account,
      // the account document from scope
      tpl: context2.template,
      template: context2.template,
      tplItem: context2.componentDefinition,
      // For BackCompatibility
      componentDefinition: context2.componentDefinition
      // the current components configuration details
    };
    return this.searchClientService.getDefaultSearchProvider(context2);
  }
  isDexieQuery(context2, queryName) {
    return this.searchClientService.isDexieQuery(context2, queryName);
  }
};
_SclSearchClientService.\u0275fac = function SclSearchClientService_Factory(t) {
  return new (t || _SclSearchClientService)(\u0275\u0275inject(FormbirdInjectorService));
};
_SclSearchClientService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclSearchClientService, factory: _SclSearchClientService.\u0275fac, providedIn: "root" });
var SclSearchClientService2 = _SclSearchClientService;

// projects/formbird-services/src/lib/services/injector/formbird-injector.service.ts
var _FormbirdInjectorService = class _FormbirdInjectorService {
  constructor() {
    this.injector = window.FormbirdServiceInjector;
    if (!this.injector) {
      const element = document.querySelectorAll("#bodyAngularJS div[ui-view]");
      this.injector = angular.element(element).injector();
      this.isAngularJS = true;
    }
  }
  get(serviceName) {
    return this.injector.get(serviceName);
  }
  isAngularJSCore() {
    return this.isAngularJS;
  }
};
_FormbirdInjectorService.\u0275fac = function FormbirdInjectorService_Factory(t) {
  return new (t || _FormbirdInjectorService)();
};
_FormbirdInjectorService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _FormbirdInjectorService, factory: _FormbirdInjectorService.\u0275fac, providedIn: "root" });
var FormbirdInjectorService2 = _FormbirdInjectorService;

// projects/formbird-services/src/lib/services/notification/notification.service.ts
var _NotificationService = class _NotificationService {
  constructor(injector) {
    this.injector = injector;
    this.ajsService = injector.get("NotificationService");
  }
  /**
   * Display toast messages
   */
  printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent) {
    return this.ajsService.printMessage(message, messageType, title, position, preventDuplicate, displayDesktopNotification, onClickFunction, timeOut, isPermanent);
  }
  success(message, title, displayDesktopNotification) {
    return this.ajsService.success(message, title, displayDesktopNotification);
  }
  error(message, title, displayDesktopNotification) {
    return this.ajsService.error(message, title, displayDesktopNotification);
  }
  warning(message, title, displayDesktopNotification) {
    return this.ajsService.warning(message, title, displayDesktopNotification);
  }
};
_NotificationService.\u0275fac = function NotificationService_Factory(t) {
  return new (t || _NotificationService)(\u0275\u0275inject(FormbirdInjectorService2));
};
_NotificationService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _NotificationService, factory: _NotificationService.\u0275fac, providedIn: "root" });
var NotificationService2 = _NotificationService;

// projects/formbird-mapping/src/lib/scl-mapping-functions.service.ts
var formbirdInjectorService = new FormbirdInjectorService();
var fileProviderService = formbirdInjectorService.get("FileProviderService");
var sclUtilMapService = new SclUtilMapService();
var sclMapViews5 = new SclMapViewsService();
var _SclMappingFunctionsService = class _SclMappingFunctionsService {
  constructor(httpClient, sclSearchClientService, cdRef, notificationService) {
    this.httpClient = httpClient;
    this.sclSearchClientService = sclSearchClientService;
    this.cdRef = cdRef;
    this.notificationService = notificationService;
    this.isGoogle = false;
    this.isInit = false;
    this.updateWatchFields = [];
    this.libName = "";
    this.updateWatchFieldsLayerKey = {};
    this.layersCount = 0;
    this.watchDocOldValue = {};
    this.assetIconResources = {};
    this.isOffline = false;
    this.currentLocation = null;
    this.updateAddress = null;
    this.visualizeSelectedAsset = [];
    this.loadAssetCounter = 0;
    this.intervalToolTipSetup = null;
    this.countIntervalTooltipSetup = 0;
    this.hasCustomControl = false;
    this.toolTipTimeout = void 0;
    this.tooltipsTimeout = null;
    this.isPopoverOpen = false;
    this.currentPopover = null;
    this.infoPosition = { left: "0px", top: "0px" };
    this.isPopupClusterOpen = false;
    this.compType = -1;
    this.mouseX = 0;
    this.mouseY = 0;
    this.lastEvt = null;
    this.isPopupRadioOpen = false;
    this.updateWatchFieldsLayer = {};
    this.hasUpdateWatchField = false;
    this.EPSG = "EPSG:3857";
    this.layerAssets = [];
    this.minZoomAsset = 0;
    this.maxZoomAsset = 0;
    this.currentBox = null;
    this.lstLoadedOriginFilter = [];
    this.lstLoadedOriginFilterAfterHandlebar = {};
    this.isRequesting = false;
    this.countFinishQueries = 0;
    this.showTiming = false;
    this.pageSize = 1e4;
    this.relatedAssetQuery = [];
    this.asyncDrawAsset = false;
    this.uwfFilterCalled = [];
    this.countUwfFilterDone = 0;
    this.hasResize = false;
    this.disableHandlebars = false;
    this.countAssetPoint = 0;
    this.relatedAsset = {};
    this.defaultImageAnchor = [0.5, 1];
    this.processPageSize = 20;
    this.disableProcessingOnLoad = false;
    this.countLoadingProcess = 0;
    this.popupAssetSelectionPrimaryText = "";
    this.popupAssetSelectionSecondaryText = "";
    this.currentLat = 0;
    this.currentLon = 0;
    this.hasMapDragging = false;
    this.subLabelTiming = "Unknow-Source";
    this.checkMapReadyFirstLoad = null;
    this.deleteAfterMaxZoom = false;
    this.hasBoundingBox = true;
    window.addEventListener("online", () => {
      if (this.currentLocation && this.currentLocation.length == 2 && typeof this.updateAddress === "function") {
        this.updateAddress(this.currentLocation[0], this.currentLocation[1]);
      }
      this.currentLocation = null;
      this.isOffline = false;
    });
    window.addEventListener("offline", () => {
      console.log("Became offline");
      this.isOffline = true;
    });
  }
  initLib(pInstance, libName, constructObj, cb, changeDocumentService, subs, document2) {
    this.changedDocumentService = changeDocumentService;
    this.subs = subs;
    this.document = document2;
    if (this.isInit) {
      return;
    }
    this.updateWatchFieldsObj = {};
    this.MapFunc = pInstance;
    this.isInit = true;
    this.isGoogle = false;
    this.libName = libName;
    if (libName === "google") {
      this.isGoogle = true;
      this.mapObj = new SclMappingFunctionGoogleService();
      this.mapObj.load(constructObj, (function() {
        if (cb && typeof cb === "function") {
          cb(this.mapObj);
        }
      }).bind(this));
    } else if (libName === "openlayers") {
      this.mapObj = new SclMappingFunctionOpenLayersService();
      this.mapObj.load((function() {
        if (cb && typeof cb === "function") {
          cb(this.mapObj);
        }
      }).bind(this));
    } else if (libName === "arcGIS") {
      this.mapObj = new SclMappingFunctionsArcGisService();
      this.mapObj.load((function() {
        if (cb && typeof cb === "function") {
          cb(this.mapObj);
        }
      }).bind(this));
    }
  }
  setupMap(pInstance, initObj, keyName) {
    this.MapFunc = pInstance;
    this.initObj = initObj;
    this.intervalToolTipSetup = this.initObj.intervalToolTipSetup;
    this.countIntervalTooltipSetup = this.initObj.countIntervalTooltipSetup;
    this.hasCustomControl = this.initObj.hasCustomControl;
    this.tooltipInfo = this.initObj.tooltipInfo;
    this.compType = this.initObj.style;
    this.componentDefinition = this.initObj.componentDefinition;
    this.keyName = this.initObj.keyName;
    initObj.getLocationFn = this.getLocation.bind(this);
    if (this.componentDefinition) {
      initObj.checkMapEmptyLogError = this.componentDefinition.checkMapEmptyLogError;
      if (this.componentDefinition.disableProcessingOnLoad) {
        this.disableProcessingOnLoad = this.componentDefinition.disableProcessingOnLoad;
      }
      if (this.componentDefinition.relatedFields) {
        for (const field in this.componentDefinition.relatedFields) {
          if (this.componentDefinition.relatedFields.hasOwnProperty(field)) {
            const fieldAsset = this.componentDefinition.relatedFields[field];
            this.relatedAsset[field] = fieldAsset;
            this.relatedAssetQuery.push(fieldAsset);
          }
        }
      }
      if (this.componentDefinition.processPageSize) {
        this.processPageSize = this.componentDefinition.processPageSize;
      }
      if (this.componentDefinition.layers) {
        let idx = 0;
        for (let i2 = this.componentDefinition.layers.length - 1; i2 > -1; i2--) {
          idx++;
          if (typeof this.componentDefinition.layers[i2].updateWatchFields !== "undefined") {
            for (let j = 0; j < this.componentDefinition.layers[i2].updateWatchFields.length; j++) {
              const key = this.componentDefinition.layers[i2].updateWatchFields[j];
              if (key in this.updateWatchFieldsLayer) {
                if (this.updateWatchFieldsLayer[key].indexOf(idx) > -1) {
                  continue;
                }
                this.updateWatchFieldsLayer[key].push(idx);
              } else {
                this.updateWatchFieldsLayer[key] = [idx];
              }
            }
            this.hasUpdateWatchField = true;
          }
        }
      }
      if (this.componentDefinition.deleteAfterMaxZoom) {
        this.deleteAfterMaxZoom = this.componentDefinition.deleteAfterMaxZoom;
      }
      if (this.componentDefinition.noBoundingBox) {
        this.hasBoundingBox = !this.componentDefinition.noBoundingBox;
      }
    }
    this.layersCount = this.layerAssets.length;
    this.mapObj?.init(initObj, keyName);
    this.updateWatchFieldsObj = {
      updateWatchFieldsLayer: this.updateWatchFieldsLayer,
      layers: this.componentDefinition.layers,
      layerAssets: this.layerAssets,
      watcherFunction: this.initObj.watcherFunction,
      searchLayerFunc: this.loadAssetUWF.bind(this)
    };
    if (this.updateWatchFieldsObj && this.updateWatchFieldsObj.updateWatchFieldsLayer) {
      for (const key in this.updateWatchFieldsObj.updateWatchFieldsLayer) {
        if (this.updateWatchFieldsObj.updateWatchFieldsLayer.hasOwnProperty(key)) {
          const docKey = key.replace("document.", "");
          if (this.watchDocOldValue.hasOwnProperty(docKey)) {
            this.watchDocOldValue[docKey] = null;
          }
        }
      }
    }
    this.updateWatchFields = [];
    this.createWatchField();
    this.creatWatchDocument();
  }
  fitCoords(geoJson) {
    if (!this.mapObj || !geoJson || geoJson.length === 0) {
      return;
    }
    const coorDatas = [];
    for (let i2 = 0; i2 < geoJson.length; i2++) {
      if (geoJson[i2].geometry && geoJson[i2].geometry.type && geoJson[i2].geometry.coordinates && geoJson[i2].geometry.coordinates.length > 0) {
        if (geoJson[i2].geometry.type === "Point") {
          coorDatas.push(geoJson[i2].geometry.coordinates);
        } else {
          this.traverseCoords(geoJson[i2].geometry.coordinates, coorDatas);
        }
      }
    }
    this.mapObj?.fitCoords(coorDatas);
  }
  // main function center of linestring
  getPointByDistance(pnts, distance2) {
    const tl = this.totalLen(pnts);
    let cl = 0;
    let ol;
    let result;
    const self2 = this;
    pnts.forEach(function(point, i2, points) {
      ol = cl;
      cl += i2 ? self2.lineLen([points[i2 - 1], point]) : 0;
      if (distance2 <= cl && distance2 > ol) {
        const dd = distance2 - ol;
        result = self2.pntOnLine([points[i2 - 1], point], dd);
      }
    });
    return result;
  }
  // returns a point on a single line (two points) using distance // line=[[x0,y0],[x1,y1]]
  pntOnLine(line, distance2) {
    const t = distance2 / this.lineLen(line);
    const xt = (1 - t) * line[0][0] + t * line[1][0];
    const yt = (1 - t) * line[0][1] + t * line[1][1];
    return [xt, yt];
  }
  // returns the total length of a linestring (multiple points) // pnts=[[x0,y0],[x1,y1],[x2,y2],...]
  totalLen(pnts) {
    let tl = 0;
    if (!pnts) {
      return;
    }
    const self2 = this;
    pnts.forEach(function(point, i2, points) {
      tl += i2 ? self2.lineLen([points[i2 - 1], point]) : 0;
    });
    return tl;
  }
  // returns the length of a line (two points) // line=[[x0,y0],[x1,y1]]
  lineLen(line) {
    if (!line || !Array.isArray(line) || line.length < 2) {
      return 0;
    }
    const xd = line[0][0] - line[1][0];
    const yd = line[0][1] - line[1][1];
    return Math.sqrt(xd * xd + yd * yd);
  }
  calculateCenter(polygon) {
    const PI = 22 / 7;
    let X = 0;
    let Y = 0;
    let Z3 = 0;
    for (let i2 = 0; i2 < polygon.length; i2++) {
      let lat1 = polygon[i2][1];
      let lon1 = polygon[i2][0];
      lat1 = lat1 * PI / 180;
      lon1 = lon1 * PI / 180;
      X += Math.cos(lat1) * Math.cos(lon1);
      Y += Math.cos(lat1) * Math.sin(lon1);
      Z3 += Math.sin(lat1);
    }
    let Lon = Math.atan2(Y, X);
    const Hyp = Math.sqrt(X * X + Y * Y);
    let Lat = Math.atan2(Z3, Hyp);
    Lat = Lat * 180 / PI;
    Lon = Lon * 180 / PI;
    return [Lon, Lat];
  }
  getCenterOfGeometry(coor, type) {
    if (type === "Point") {
      return coor;
    } else {
      const coorDatas = [];
      this.traverseCoords(coor, coorDatas);
      if (type === "LineString") {
        const totalLength = this.totalLen(coorDatas);
        const midDistance = totalLength / 2;
        return this.getPointByDistance(coorDatas, midDistance);
      } else {
        return this.calculateCenter(coorDatas);
      }
    }
  }
  // copy and modify from scope.sclUtilMap.isContainAsset
  isContainAsset(asset, assets) {
    if (!assets) {
      return false;
    }
    let id2 = asset.properties.linkAssets[0].documentId;
    if (id2 && id2.indexOf("_")) {
      id2 = id2.split("_")[0];
    }
    for (let i2 = 0; i2 < assets.length; i2++) {
      const ass = assets[i2];
      let idass = ass.properties.linkAssets[0].documentId;
      if (idass && idass.indexOf("_")) {
        idass = idass.split("_")[0];
      }
      if (idass.indexOf(id2) > -1 && asset.properties.type === ass.properties.type) {
        return true;
      }
    }
    return false;
  }
  addHeatmapData(weight, coorData, centerPoint, options, type) {
    if (!this.mapObj || !this.mapObj.heatDatas || !this.mapObj.lstHeatWeight) {
      return;
    }
    let isAdd = false;
    let k = 0;
    for (k = 0; k < this.mapObj.heatDatas.length; ++k) {
      if (this.mapObj.heatDatas[k].coorData[0] === coorData[0] && this.mapObj.heatDatas[k].coorData[1] === coorData[1]) {
        weight += this.mapObj.heatDatas[k].weight;
        isAdd = true;
        break;
      }
    }
    if (isAdd) {
      this.mapObj.heatDatas[k].weight = weight;
    } else {
      this.mapObj.heatDatas.push({ id: options.id, name: options.name, location: centerPoint, coorData, weight, type });
      this.mapObj.lstHeatWeight.push(weight);
    }
  }
  createHeatMapData(coordinates2, type, weight, isGoogleMap, options) {
    if (!this.mapObj || isGoogleMap && !this.mapObj.google) {
      return;
    }
    weight = weight == null ? 1 : parseFloat(weight);
    if (options.heatmapPoints === "Center") {
      let centerPoint = this.getCenterOfGeometry(coordinates2, type);
      const coorData = [centerPoint[0], centerPoint[1]];
      if (isGoogleMap) {
        centerPoint = new this.mapObj.google.maps.LatLng(centerPoint[1], centerPoint[0]);
      }
      this.addHeatmapData(weight, coorData, centerPoint, options, type);
    } else if (options.heatmapPoints === "Points") {
      let coorDatas = [];
      if (type === "Point") {
        coorDatas = [coordinates2];
      } else {
        this.traverseCoords(coordinates2, coorDatas);
      }
      for (let i2 = 0; i2 < coorDatas.length; ++i2) {
        let point = [coorDatas[i2][0], coorDatas[i2][1]];
        if (isGoogleMap) {
          point = new this.mapObj.google.maps.LatLng(coorDatas[i2][1], coorDatas[i2][0]);
        }
        this.addHeatmapData(weight, coorDatas[i2], point, options, type);
      }
    }
  }
  traverseCoords(coordinates2, coorDatas) {
    for (let i2 = 0; i2 < coordinates2.length; i2++) {
      if (isFinite(coordinates2[i2][0]) && isFinite(coordinates2[i2][1])) {
        coorDatas.push([coordinates2[i2][0], coordinates2[i2][1]]);
      } else {
        this.traverseCoords(coordinates2[i2], coorDatas);
      }
    }
  }
  // begin 14164: timing of drawing of "layers" sometimes some layers aren't showing
  createWatchField() {
    if (!this.updateWatchFieldsObj || !this.updateWatchFieldsObj.updateWatchFieldsLayer) {
      return;
    }
    for (const key in this.updateWatchFieldsObj.updateWatchFieldsLayer) {
      if (this.updateWatchFieldsObj.updateWatchFieldsLayer.hasOwnProperty(key)) {
        const docKey = key.replace("document.", "");
        if (key.indexOf("document.") > -1) {
          this.createWatchDoc(docKey);
        }
      }
    }
  }
  createWatchDoc(docKey) {
    if (this.updateWatchFields.indexOf("document." + docKey) > -1) {
      return;
    }
    this.updateWatchFields.push("document." + docKey);
    if (this.updateWatchFieldsLayerKey == null) {
      this.updateWatchFieldsLayerKey = {};
    }
    this.updateWatchFieldsLayerKey["document." + docKey] = [];
    for (let i2 = 0; i2 < this.layersCount; i2++) {
      this.updateWatchFieldsLayerKey["document." + docKey].push("");
    }
    const docKeySub = this.changedDocumentService.watch(docKey, this.document.documentId, { forceWatch: true }).subscribe((newValue) => {
      if (!isEqual(this.watchDocOldValue[docKey], newValue)) {
        this.watchDocOldValue[docKey] = (0, import_lodash8.cloneDeep)(newValue);
        this.document[docKey] = (0, import_lodash8.cloneDeep)(newValue);
        this.updateFilter("document." + docKey);
      }
    });
    this.subs.add(docKeySub);
  }
  creatWatchDocument() {
    if (!this.document || !this.document.documentId) {
      return;
    }
    const docSub = this.changedDocumentService.watchDocument(this.document.documentId).subscribe((newValue) => {
      if (this.updateWatchFieldsObj) {
        if (typeof this.updateWatchFieldsObj.watcherFunction === "function") {
          this.updateWatchFieldsObj.watcherFunction(newValue);
        }
        if (this.updateWatchFieldsObj.updateWatchFieldsLayer) {
          for (const key in this.updateWatchFieldsObj.updateWatchFieldsLayer) {
            if (this.updateWatchFieldsObj.updateWatchFieldsLayer.hasOwnProperty(key)) {
              const docKey = key.replace("document.", "");
              if (newValue.hasOwnProperty(docKey)) {
                this.createWatchDoc(docKey);
              }
            }
          }
        }
      }
      for (const key in newValue) {
        if (newValue.hasOwnProperty(key)) {
          const docKey = key.replace("document.", "");
          this.createWatchDoc(docKey);
        }
      }
    });
    this.subs.add(docSub);
  }
  updateFilter(key) {
    if (typeof this.updateWatchFieldsObj.layers === "undefined" || this.updateWatchFieldsObj.layers === null) {
      return;
    }
    if (key in this.updateWatchFieldsObj.updateWatchFieldsLayer) {
      for (let i2 = 0; i2 < this.updateWatchFieldsObj.updateWatchFieldsLayer[key].length; i2++) {
        const layerIndex = this.updateWatchFieldsObj.updateWatchFieldsLayer[key][i2];
        for (let j = 0; j < this.updateWatchFieldsObj.layerAssets.length; j++) {
          if (layerIndex === this.updateWatchFieldsObj.layerAssets[j].i) {
            this.mapObj?.clearAllFeaturesLayer(layerIndex);
            if (this.updateWatchFieldsObj.searchLayerFunc && typeof this.updateWatchFieldsObj.searchLayerFunc === "function") {
              this.updateWatchFieldsObj.searchLayerFunc({
                layer: this.updateWatchFieldsObj.layerAssets[j].layer,
                layerKey: key,
                layerIndex
              });
            }
            break;
          }
        }
      }
    }
  }
  // end 14164
  checkLayerKey(layerKey, layerFilter) {
    if (this.updateWatchFieldsLayerKey.hasOwnProperty(layerKey) && this.updateWatchFieldsLayerKey[layerKey].indexOf(layerFilter) > -1) {
      return true;
    }
    return false;
  }
  // 14934
  // old logic of sclMapRulesInterface
  setCurrentMapviewCoords(component, componentName, value) {
    const variable = "MapBoundingBox";
    const varName = component + "_" + componentName + "_" + variable;
    window[varName] = value;
  }
  getCurrentMapviewCoords(component, componentName) {
    const variable = "MapBoundingBox";
    const varName = component + "_" + componentName + "_" + variable;
    return window[varName];
  }
  getAssetIcon(imageFileNo) {
    const self2 = this;
    return new Promise((resolve, reject) => __async(this, null, function* () {
      if (self2.assetIconResources[imageFileNo]) {
        resolve(self2.assetIconResources[imageFileNo]);
      } else {
        try {
          const file = { fileNo: imageFileNo, fileName: "" };
          self2.assetIconResources[imageFileNo] = yield fileProviderService.getFileResources(file);
          resolve(self2.assetIconResources[imageFileNo]);
        } catch (err) {
          reject(err);
        }
      }
    }));
  }
  // 15828 : offline map
  getIcon(iconUrl) {
    return __async(this, null, function* () {
      let icon;
      let resources;
      try {
        resources = yield this.getAssetIcon(iconUrl);
        icon = resources ? resources.base64strData || resources.url : iconUrl;
      } catch (err) {
        console.log("****** error getFileResource : " + err.message);
        icon = iconUrl;
      }
      const idxApiGetFile = icon.indexOf("api/getFile");
      const idxHttp = icon.indexOf("http:");
      const idxHttps = icon.indexOf("https:");
      if (idxApiGetFile > -1 && (idxHttp > -1 || idxHttps > -1) && (idxApiGetFile < idxHttp || idxApiGetFile < idxHttps)) {
        if (idxHttp > -1) {
          icon = icon.substring(idxHttp, icon.length);
        } else if (idxHttps > -1) {
          icon = icon.substring(idxHttps, icon.length);
        }
      }
      if (icon !== null && icon.trim().length > 0) {
        const invalidChars = ["/", "\\"];
        let countInvalid = 0;
        for (let i2 = icon.length - 1; i2 > -1; i2--) {
          if (invalidChars.indexOf(icon.charAt(i2)) < 0) {
            break;
          }
          countInvalid++;
        }
        icon = icon.substring(0, icon.length - countInvalid);
      }
      return icon;
    });
  }
  showMap(fnShowMap) {
    setTimeout(() => {
      if (!this.mapObj) {
        return;
      }
      this.mapObj.updateSize();
      this.mapObj.heightMapInit = this.initObj.target.offsetHeight;
      if (this.libName === "openlayers") {
        this.mapObj.setupMapControl();
      }
      if (fnShowMap && typeof fnShowMap === "function") {
        fnShowMap();
      }
    }, 100);
  }
  updateLabelByZoom() {
    if (!this.mapObj) {
      return;
    }
    if (this.libName === "openlayers") {
      this.mapObj.updateLabelByZoom();
    }
  }
  updateLabelAllLayers() {
    if (!this.mapObj) {
      return;
    }
    if (this.libName === "google") {
      this.mapObj.updateLabelAllLayers();
    }
  }
  updateLabel(feature, label) {
    if (!this.mapObj) {
      return;
    }
    if (this.libName === "openlayers") {
      this.mapObj.updateLabel(feature, label);
    }
  }
  updateRotateScaleByZoom() {
    if (!this.mapObj) {
      return;
    }
    if (this.libName === "google") {
      this.mapObj.updateRotateScaleByZoom();
    }
  }
  project(p, a, b) {
    const atob2 = { x: b[0] - a[0], y: b[1] - a[1] };
    const atop = { x: p[0] - a[0], y: p[1] - a[1] };
    const len = atob2.x * atob2.x + atob2.y * atob2.y;
    let dot = atop.x * atob2.x + atop.y * atob2.y;
    const t = Math.min(1, Math.max(0, dot / len));
    dot = (b[0] - a[0]) * (p[1] - a[1]) - (b[1] - a[1]) * (p[0] - a[0]);
    const pX = a[0] + atob2.x * t;
    const pY = a[1] + atob2.y * t;
    return {
      point: {
        x: pX,
        y: pY
      },
      left: dot < 1,
      dot,
      t
    };
  }
  insidePolygon(point, vs) {
    var x = point[0], y = point[1];
    var inside = false;
    for (var i2 = 0, j = vs.length - 1; i2 < vs.length; j = i2++) {
      var xi = vs[i2][0], yi = vs[i2][1];
      var xj = vs[j][0], yj = vs[j][1];
      var intersect = yi > y != yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
      if (intersect)
        inside = !inside;
    }
    return inside;
  }
  isOnLine(currPoint, point1, point2) {
    const dxc = currPoint[0] - point1[0];
    const dyc = currPoint[1] - point1[1];
    const dxl = point2[0] - point1[0];
    const dyl = point2[1] - point1[1];
    let cross = dxc * dyl - dyc * dxl;
    if (cross != 0) {
      return false;
    }
    return true;
  }
  getNearestPointWithPolygon(coords, clickedPoint) {
    if (!this.mapObj) {
      return;
    }
    let a = coords[0][0];
    let b = coords[0][1];
    let min = this.project(clickedPoint, a, b);
    let distance2 = this.mapObj.psmaDistanceCoords(clickedPoint, [min.point.x, min.point.y]);
    for (let i2 = 0; i2 < coords.length; i2++) {
      const iMin = this.project(clickedPoint, coords[i2][0], coords[i2][1]);
      let iDistance = this.mapObj.psmaDistanceCoords(clickedPoint, [iMin.point.x, iMin.point.y]);
      if (iDistance < distance2 && !isNaN(iMin.point.x) && !isNaN(iMin.point.y)) {
        min = iMin;
        distance2 = iDistance;
      }
    }
    return [min.point.x, min.point.y];
  }
  getNearestPoint(feature, clickedPoint) {
    if (this.libName === "arcGIS") {
      return clickedPoint;
    }
    if (!this.mapObj) {
      return clickedPoint;
    }
    if (!feature || Array.isArray(feature) && feature.length == 0) {
      return clickedPoint;
    }
    if (this.libName === "google" && feature && Array.isArray(feature) && feature.length > 0) {
      feature = feature[0].feature;
    }
    const obj = this.mapObj.getFeatureCoordinate(feature);
    const coords = obj.coords;
    const coordArray = obj.coordArray;
    const type = obj.type;
    let isInsideShape = true;
    if (type !== "Point") {
      isInsideShape = this.insidePolygon(clickedPoint, coordArray);
    }
    if (isInsideShape) {
      return clickedPoint;
    }
    if ((type === "LineString" || type === "MultiLineString") && this.libName === "google") {
      return clickedPoint;
    }
    if (type == "Point") {
      return clickedPoint;
    } else if (type == "MultiPoint") {
      let min = coords[0];
      let distance2 = this.mapObj.psmaDistanceCoords(clickedPoint, min);
      for (let i2 = 0; i2 < coords.length; i2++) {
        let iDistance = this.mapObj.psmaDistanceCoords(clickedPoint, coords[i2]);
        if (iDistance < distance2) {
          min = coords[i2];
        }
      }
      return min;
    } else if (type == "LineString") {
      let isOnALine = false;
      for (let i2 = 0; i2 < coords.length; i2++) {
        isOnALine = this.isOnLine(clickedPoint, coords[i2][0], coords[i2][1]);
        if (isOnALine) {
          break;
        }
      }
      if (isOnALine) {
        return clickedPoint;
      }
      return this.getNearestPointWithPolygon(coords, clickedPoint);
    } else {
      return this.getNearestPointWithPolygon(coords, clickedPoint);
    }
  }
  tooltipOnFeatureHover(e, mapLibName) {
    if (!this.mapObj) {
      return;
    }
    let selectedFeatures = [];
    if (mapLibName === "openlayers") {
      if (e.target.getFeatures()) {
        selectedFeatures = e.target.getFeatures().array_;
      }
    } else if (mapLibName === "google") {
      selectedFeatures = [e.feature];
    } else {
      selectedFeatures = [e];
    }
    if (selectedFeatures && selectedFeatures.length > 0) {
      const selectedFeature = selectedFeatures[0];
      const existingTooltip = this.mapObj.getFeatureProperty(selectedFeature, "tooltip");
      if (!existingTooltip) {
        this.getTooltipData(selectedFeature);
      }
    }
  }
  getTooltipData(selectedFeature) {
    if (!this.mapObj) {
      return;
    }
    const p = this.mapObj.getFeatureProperties(selectedFeature, ["id", "zIndex"]);
    const hbObject = (0, import_lodash8.find)(this.tooltipHandleBarObjects, { id: p.id, layerIndex: p.zIndex });
    if (hbObject) {
      const popup = sclHandlebars2.processHandlebars(hbObject.tooltips, hbObject.handlebarsContext, null, null, hbObject.contextParams);
      this.mapObj.setFeatureProperties(selectedFeature, { tooltip: popup });
    }
  }
  cancelTooltipTimeout() {
    if (this.toolTipTimeout) {
      clearInterval(this.toolTipTimeout);
      this.toolTipTimeout = void 0;
    }
  }
  scheduleTooltip() {
    if (this.tooltipsTimeout != null) {
      this.toolTipTimeout = setInterval(() => {
        this.dismissPopover();
      }, this.tooltipsTimeout * 1e3);
    }
  }
  dismissPopover() {
    clearInterval(this.toolTipTimeout);
    this.toolTipTimeout = null;
    this.previousSelectedFeature = null;
    this.isPopoverOpen = false;
    this.focusPopup = false;
    this.currentPopover = null;
    if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
      this.tooltipInfo.nativeElement.innerHTML = "";
    }
    this.tooltipText = "";
    this.infoPosition = { left: "0px", top: "0px" };
    this.cdRef.detectChanges();
  }
  isContainFeature(id2, assets) {
    if (!assets) {
      return false;
    }
    for (let i2 = 0; i2 < assets.length; i2++) {
      const ass = assets[i2];
      if (id2.indexOf(ass.properties.linkAssets[0].documentId) > -1) {
        return true;
      }
    }
    return false;
  }
  showPopupClusters() {
    this.dismissPopover();
    let popover;
    if (this.divInfoCluster && this.divInfoCluster.nativeElement) {
      this.divInfoCluster.nativeElement.click();
      popover = this.divInfoCluster.nativeElement.querySelectorAll("div.popover")[0];
    }
    this.isPopupClusterOpen = true;
    if (popover && this.mapObj) {
      const lst = document.querySelectorAll('[content-exp="contentExp()"]');
      if (lst != null && lst.length > 0) {
        const item = lst[0];
        item.style.zIndex = this.mapObj.layerIndexTooltips;
      }
    }
  }
  resetupTooltipUI() {
    if (!this.mapObj) {
      return;
    }
    if (this.mapObj.setupTooltipUI && typeof this.mapObj.setupTooltipUI === "function") {
      this.setupTooltipUI();
      this.mapObj.setupTooltipUI = null;
    }
  }
  setupTooltipUI() {
    if (this.libName === "openlayers") {
      if (this.divInfo && this.divInfo.nativeElement) {
        this.targetMapElement.insertBefore(this.divInfo.nativeElement, this.targetMapElement.firstChild);
      }
      if (this.divInfo1 && this.divInfo1.nativeElement) {
        this.targetMapElement.insertBefore(this.divInfo1.nativeElement, this.targetMapElement.firstChild);
      }
    } else if (this.libName === "google") {
      if (!this.mapObj) {
        return;
      }
      if (this.mapObj.divCustomControl == null) {
        if (this.divInfo && this.divInfo.nativeElement) {
          this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo.nativeElement);
        }
        if (this.divInfo1 && this.divInfo1.nativeElement) {
          this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo1.nativeElement);
        }
      } else {
        this.mapObj.divCustomControl.style.zIndex = this.mapObj.layerIndexTooltips + 1;
        if (this.intervalToolTipSetup == null) {
          this.intervalToolTipSetup = setInterval(() => {
            if (this.mapObj.divCustomControl.parentElement != null) {
              if (this.divInfo && this.divInfo.nativeElement) {
                this.mapObj.divCustomControl.parentElement.appendChild(this.divInfo.nativeElement);
              }
              if (this.divInfo1 && this.divInfo1.nativeElement) {
                this.mapObj.divCustomControl.parentElement.appendChild(this.divInfo1.nativeElement);
              }
              clearInterval(this.intervalToolTipSetup);
              this.intervalToolTipSetup = null;
            } else {
              console.log("waiting for finish init custom control");
              this.countIntervalTooltipSetup++;
              if (this.countIntervalTooltipSetup > 10) {
                console.log("can't setup tooltip because the initialize of custom control can't finish");
                clearInterval(this.intervalToolTipSetup);
                this.intervalToolTipSetup = null;
                if (this.divInfo && this.divInfo.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo.nativeElement);
                }
                if (this.divInfo1 && this.divInfo1.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo1.nativeElement);
                }
              }
            }
          }, 100);
        }
      }
    } else {
      if (!this.mapObj) {
        return;
      }
      if (this.hasCustomControl == true) {
        if (this.intervalToolTipSetup == null) {
          this.intervalToolTipSetup = setInterval(() => {
            if (this.mapObj.divCustomControl != null) {
              if (this.mapObj.divCustomControl.parentElement && this.mapObj.divCustomControl.parentElement.parentElement && this.mapObj.divCustomControl.parentElement.parentElement.parentElement) {
                const parent3 = this.mapObj.divCustomControl.parentElement.parentElement.parentElement;
                if (this.divInfo && this.divInfo.nativeElement) {
                  parent3.appendChild(this.divInfo.nativeElement);
                }
                if (this.divInfo1 && this.divInfo1.nativeElement) {
                  parent3.appendChild(this.divInfo1.nativeElement);
                }
              } else {
                console.log("setup tooltip with element structure not as the same when implementing this logic. The z-index logic may not be the same");
                if (this.divInfo && this.divInfo.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo.nativeElement);
                }
                if (this.divInfo1 && this.divInfo1.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo1.nativeElement);
                }
              }
              clearInterval(this.intervalToolTipSetup);
              this.intervalToolTipSetup = null;
              if (this.divInfo && this.divInfo.nativeElement) {
                this.divInfo.nativeElement.style["pointer-events"] = "visible";
              }
              if (this.divInfo1 && this.divInfo1.nativeElement) {
                this.divInfo1.nativeElement.style["pointer-events"] = "visible";
              }
            } else {
              console.log("waiting for finish init custom control");
              this.countIntervalTooltipSetup++;
              if (this.countIntervalTooltipSetup > 10) {
                console.log("can't setup tooltip because the initialize of custom control can't finish");
                clearInterval(this.intervalToolTipSetup);
                this.intervalToolTipSetup = null;
                if (this.divInfo && this.divInfo.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo.nativeElement);
                  this.divInfo.nativeElement.style["pointer-events"] = "visible";
                }
                if (this.divInfo1 && this.divInfo1.nativeElement) {
                  this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo1.nativeElement);
                  this.divInfo1.nativeElement.style["pointer-events"] = "visible";
                }
              }
            }
          }, 100);
        }
      } else {
        console.log("setup tooltip with no custom control");
        if (this.divInfo && this.divInfo.nativeElement) {
          this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo.nativeElement);
          this.divInfo.nativeElement.style["pointer-events"] = "visible";
        }
        if (this.divInfo1 && this.divInfo1.nativeElement) {
          this.targetMapElement.firstChild.firstChild.appendChild(this.divInfo1.nativeElement);
          this.divInfo1.nativeElement.style["pointer-events"] = "visible";
        }
      }
    }
    if (this.divInfoCluster && this.divInfoCluster.nativeElement) {
      this.targetMapElement.insertBefore(this.divInfoCluster.nativeElement, this.targetMapElement.firstChild);
    }
  }
  hasMouseStopped(evt) {
    if (!this.mapObj) {
      return;
    }
    if (!this.mapObj.showTooltip) {
      this.dismissPopover();
      return;
    }
    const newMouseX = this.libName === "openlayers" ? evt.originalEvent.x : evt.pixel[0];
    const newMouseY = this.libName === "openlayers" ? evt.originalEvent.y : evt.pixel[1];
    if (newMouseX === this.mouseX && newMouseY === this.mouseY) {
      clearInterval(this.mouseStopInterval);
      this.mouseStopInterval = null;
      if (this.libName === "openlayers") {
        this.displayFeatureInfo(this.mapObj.getEventByPixel(this.lastEvt.originalEvent));
      } else {
        this.displayFeatureInfo(evt);
      }
    }
    this.mouseX = newMouseX;
    this.mouseY = newMouseY;
  }
  mapWatchStop() {
    if (!this.mapObj) {
      return;
    }
    const mapSize = this.mapObj.getMapSize();
    if (mapSize) {
      const mapWidth = mapSize[0];
      const mapHeight = mapSize[1];
      this.mapCenter = { x: mapWidth / 2, y: mapHeight / 2 };
    } else {
      console.log("Couldn't get size of map to enable tooltips");
    }
    this.tooltipRadioPosition = "top";
    this.infoRadioPosition = { left: "0px", top: "0px" };
    this.infoPosition = { left: "0px", top: "0px" };
    this.tooltipText = "";
    this.tooltipPosition = { left: "0px", top: "0px" };
    if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
      this.tooltipInfo.nativeElement.innerHTML = "";
    }
    this.focusPopup = false;
    this.isPopoverOpen = false;
    this.infoClusterPosition = { left: "0px", top: "0px" };
  }
  displayFeatureInfo(pixel) {
    if (this.isPopupRadioOpen || !this.mapObj) {
      return;
    }
    const obj = this.mapObj.getFeatureByPixel(pixel);
    if (obj == null) {
      return null;
    }
    const feature = obj.feature;
    if (feature == null) {
      return feature;
    }
    let shouldShow = false;
    this.pixelPopup = this.libName === "openlayers" ? pixel : pixel.pixel;
    let tooltip = this.mapObj.getFeatureProperty(feature, "tooltip");
    if (tooltip === null || tooltip === void 0) {
      this.getTooltipData(feature);
      tooltip = this.mapObj.getFeatureProperty(feature, "tooltip");
    }
    if (tooltip) {
      const isPopupShowed = false;
      if ((this.previousSelectedFeature == null || this.previousSelectedFeature !== feature) && (!this.focusPopup || !isPopupShowed)) {
        this.cancelTooltipTimeout();
        this.tooltipText = tooltip;
        if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
          this.tooltipInfo.nativeElement.innerHTML = tooltip;
        }
        this.previousSelectedFeature = feature;
        shouldShow = true;
        this.cdRef.detectChanges();
        this.setTooltipPosition(this.pixelPopup);
        this.scheduleTooltip();
      }
      if (!isPopupShowed && shouldShow) {
        this.showPopupTooltip();
      }
    }
    return feature;
  }
  setTooltipPosition(pixel) {
    if (!this.mapCenter || !this.mapCenter.x || !this.mapCenter.y) {
      this.getMapSize();
    }
    this.isToolTipScroll = false;
    if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
      this.tooltipInfo.nativeElement.style.height = "auto";
    }
    const featureLeftPos = pixel[0];
    const featureTopPos = pixel[1];
    this.infoPosition.left = featureLeftPos + "px";
    this.infoPosition.top = featureTopPos + "px";
    this.isPopoverOpen = true;
    let tooltipHorizontalPosition;
    let tooltipVerticalPosition;
    if (featureLeftPos < this.mapCenter.x) {
      tooltipHorizontalPosition = "left";
    } else {
      tooltipHorizontalPosition = "right";
    }
    if (featureTopPos < this.mapCenter.y) {
      tooltipVerticalPosition = "bottom";
    } else {
      tooltipVerticalPosition = "top";
    }
    let tipWidth = 0;
    let tipHeight = 0;
    if (this.divInfo && this.divInfo.nativeElement) {
      const divInfoPos = this.divInfo.nativeElement.getBoundingClientRect();
      tipWidth = divInfoPos.width;
      tipHeight = divInfoPos.height;
    }
    if (tipWidth === 0) {
      tipWidth = 276;
    }
    if (tipHeight === 0) {
      tipHeight = 68;
    }
    let tipPos = { left: 0, top: 0 };
    if (tooltipVerticalPosition === "top") {
      if (tooltipHorizontalPosition === "left") {
        tipPos = {
          left: featureLeftPos + 1,
          top: featureTopPos - tipHeight + 1
        };
      } else {
        tipPos = {
          left: featureLeftPos - tipWidth + 1,
          top: featureTopPos - tipHeight + 1
        };
      }
    } else {
      if (tooltipHorizontalPosition === "left") {
        tipPos = {
          left: featureLeftPos + 1,
          top: featureTopPos + 1
        };
      } else {
        tipPos = {
          left: featureLeftPos - tipWidth + 1,
          top: featureTopPos + 1
        };
      }
    }
    this.infoPosition.left = tipPos.left + "px";
    this.infoPosition.top = tipPos.top + "px";
    this.cdRef.detectChanges();
    let height = this.mapHeight;
    let infoPosTop = tipPos.top;
    let tooltipOffsetHeight = 0;
    if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
      tooltipOffsetHeight = this.tooltipInfo.nativeElement.offsetHeight;
    }
    if (tipPos.top > 0) {
      height = tipPos.top + tooltipOffsetHeight;
      infoPosTop = tipPos.top;
    } else {
      height = pixel[1] + tooltipOffsetHeight;
      infoPosTop = pixel[1];
    }
    if (height > this.mapHeight) {
      const h = this.mapHeight - pixel[1];
      if (this.tooltipInfo && this.tooltipInfo.nativeElement) {
        this.tooltipInfo.nativeElement.style.height = h + "px";
      }
      this.isToolTipScroll = true;
      this.infoPosition.top = infoPosTop + "px";
      this.cdRef.detectChanges();
    }
  }
  showPopupTooltip() {
    if (this.divInfo && this.divInfo.nativeElement) {
      $(this.divInfo).trigger("hover");
    }
    this.isPopoverOpen = true;
    let popover;
    if (this.divInfo && this.divInfo.nativeElement) {
      popover = $(this.divInfo.nativeElement)[0].querySelectorAll("div.popover-inner")[0];
    }
    this.currentPopover = popover;
    this.focusPopup = false;
    if (popover && this.mapObj) {
      const lst = document.querySelectorAll('[content-exp="contentExp()"]');
      if (lst != null && lst.length > 0) {
        const item = lst[0];
        item.style.zIndex = this.mapObj.layerIndexTooltips;
      }
      popover.style.zIndex = this.mapObj.layerIndexTooltips;
      popover.onmouseover = () => {
        this.focusPopup = true;
        this.cancelTooltipTimeout();
      };
      popover.onmouseout = () => {
        this.focusPopup = false;
        this.scheduleTooltip();
      };
    }
  }
  getMapSize() {
    if (!this.mapObj) {
      return;
    }
    const mapSize = this.mapObj.getMapSize();
    if (mapSize) {
      const mapWidth = mapSize[0];
      const mapHeight = mapSize[1];
      this.mapCenter = { x: mapWidth / 2, y: mapHeight / 2 };
    } else {
      console.log("Couldn't get size of map to enable tooltips");
    }
  }
  isInBoxLimit(lat, lon, systemMapLimit) {
    const box = {
      left: systemMapLimit[0][1],
      bottom: systemMapLimit[1][0],
      right: systemMapLimit[1][1],
      top: systemMapLimit[0][0]
    };
    if (box.bottom <= lat && lat <= box.top && box.left <= lon && lon <= box.right) {
      return true;
    }
    return false;
  }
  checkValidBoxWhenLoadAsset(boudingBox) {
    if (this.minZoomAsset !== 0 && this.maxZoomAsset !== 0 && (boudingBox == null || boudingBox.zoom <= this.minZoomAsset || boudingBox.zoom > this.maxZoomAsset)) {
      console.log("invalid bounding box");
      if (this.deleteAfterMaxZoom && boudingBox.zoom > this.maxZoomAsset) {
        this.mapObj?.clearAllFeatures();
      }
      return false;
    }
    return true;
  }
  loadAsset(fromSource, isFirstLoad, params) {
    if (!this.mapObj) {
      return;
    }
    const assetField = this.componentDefinition;
    let coor = null;
    let coorNext = null;
    if (this.hasBoundingBox) {
      const boudingBox = this.mapObj.getBoundingBox({ EPSG: this.EPSG });
      if (boudingBox == null) {
        return;
      }
      if (!this.checkValidBoxWhenLoadAsset(boudingBox)) {
        return;
      }
      if (this.currentBox != null && this.currentBox.minLon == boudingBox.minLon && this.currentBox.maxLat == boudingBox.maxLat && this.currentBox.maxLon == boudingBox.maxLon && this.currentBox.minLat == boudingBox.minLat) {
        console.log("don't load asset because the map current view port has not change");
        return;
      }
      this.currentBox = (0, import_lodash8.cloneDeep)(boudingBox);
      coor = [boudingBox.minLon, boudingBox.maxLat];
      coorNext = [boudingBox.maxLon, boudingBox.minLat];
    }
    this.lstLoadedOriginFilter = [];
    this.lstLoadedOriginFilterAfterHandlebar = {};
    if (this.layerAssets.length > 0) {
      if (this.requestId) {
        clearTimeout(this.requestId);
      }
      this.requestId = null;
      this.isRequesting = true;
      for (let i2 = 1; i2 < this.mapObj.layerIndexFilter + 1; i2++) {
        this.mapObj.clearAllFeaturesLayer(i2);
      }
      this.countFinishQueries = 0;
      let layerIdx = -1;
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        const isFilter = this.layerAssets[i2].isFilter;
        const layer = this.layerAssets[i2].layer;
        if (!isFilter) {
          layerIdx++;
        }
        if (layer.filter || layer.type === "dynamic") {
          const newFilter = sclHandlebars2.processHandlebars(layer.filter, null, null, null, this.contextParams);
          if (this.lstLoadedOriginFilter.indexOf(layer.filter) < 0) {
            this.lstLoadedOriginFilter.push(layer.filter);
            this.lstLoadedOriginFilterAfterHandlebar[i2] = newFilter;
          }
          if (this.showTiming) {
            if (isFilter) {
              console.log(`%c from: ${fromSource}, <user_config>.filter
              start time search filter ${(/* @__PURE__ */ new Date()).toISOString()}
              
	, query = ${newFilter}`, "color:green");
            } else {
              console.log(`%c from: ${fromSource}
              , start time for all query layer ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
            }
          }
          let query = layer.filter + (isFilter ? "_filter" : "_layer") + "_" + this.layerAssets[i2].i;
          this.searchMultiAssetMove(fromSource, coor, coorNext, newFilter, layer.geoJsonField, layer, query, layer, {
            pageSize: this.pageSize,
            layerDisplayOnly: layer.layerDisplayOnly
          }, this.loadAssetCb.bind(this, fromSource, layerIdx, isFilter, isFirstLoad));
        } else if (layer.type === "tile") {
          this.searchMultiAssetMove(fromSource, coor, coorNext, null, layer.geoJsonField, layer, null, layer, {
            pageSize: this.pageSize,
            layerDisplayOnly: layer.layerDisplayOnly
          }, this.loadAssetCb.bind(this, fromSource, layerIdx, isFilter, isFirstLoad));
        } else {
          this.countFinishQueries++;
          if (this.countFinishQueries === this.layerAssets.length) {
            if (this.showTiming) {
              if (isFilter) {
                console.log(`%c from: ${fromSource}
                end time search filter ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
              } else {
                console.log(`%c from: ${fromSource}, layer[${layerIdx}]
                  end time for all query layer ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
              }
            }
            if (this.compType === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.loadInitialMapView && typeof this.loadInitialMapView === "function") {
              this.loadInitialMapView();
            }
          }
        }
      }
    }
  }
  loadAssetCb(fromSource, i2, isFilter, isFirstLoad) {
    if (!this.mapObj) {
      return;
    }
    this.mapObj.updateSize();
    this.countFinishQueries++;
    if (this.countFinishQueries === this.layerAssets.length) {
      if (this.showTiming) {
        if (isFilter) {
          console.log(`%c from: ${fromSource}
             end time search filter ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
        } else {
          console.log(`%c from: ${fromSource}, layer[${i2}]
             end time for all query layer ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
        }
      }
      if (isFirstLoad) {
        if (this.compType === SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
          if (this.setPositionForAsset && typeof this.setPositionForAsset === "function") {
            this.setPositionForAsset();
          }
          if (this.setSelectedAssetVisualize && typeof this.setSelectedAssetVisualize === "function") {
            this.setSelectedAssetVisualize();
          }
        }
      }
      if (this.compType === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.loadInitialMapView && typeof this.loadInitialMapView === "function") {
        this.loadInitialMapView();
      }
    }
  }
  loadAssetUWF(data) {
    if (!this.mapObj) {
      return;
    }
    const layer = data.layer;
    const layerKey = data.layerKey;
    const layerIndex = data.layerIndex;
    if (typeof layer.filter == "undefined" || layer.filter === null) {
      console.log("filter is null");
      return;
    }
    if (layerIndex < 0) {
      console.log("invalid layer");
      return;
    }
    let coor = null;
    let coorNext = null;
    let boudingBox = null;
    if (this.hasBoundingBox) {
      boudingBox = this.mapObj.getBoundingBox({ EPSG: this.EPSG });
      if (boudingBox == null) {
        return;
      }
      if (!this.checkValidBoxWhenLoadAsset(boudingBox)) {
        return;
      }
      coor = [boudingBox.minLon, boudingBox.maxLat];
      coorNext = [boudingBox.maxLon, boudingBox.minLat];
    }
    let fromSource = "updateWatchFields";
    if (this.requestId) {
      clearTimeout(this.requestId);
    }
    this.requestId = null;
    this.isRequesting = true;
    let newFilter;
    if (this.uwfFilterCalled.length == 0) {
      this.countUwfFilterDone = 0;
    }
    if (this.uwfFilterCalled.indexOf(layer.filter) < 0) {
      this.uwfFilterCalled.push(layer.filter);
      if (this.showTiming) {
        console.log(`%c from: ${fromSource}
         start time for all query layer ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
      }
      newFilter = sclHandlebars2.processHandlebars(layer.filter, null, null, null, this.contextParams);
      this.searchMultiAssetMoveUpdate(fromSource, layerKey, layerIndex, coor, coorNext, newFilter, layer.geoJsonField, layer, layer.filter + "_layer_" + layerIndex, layer, this.loadAssetUWFLayerCb.bind(this, fromSource, layerIndex));
    }
    if (this.lstLoadedOriginFilter.indexOf(layer.filter) < 0) {
      this.lstLoadedOriginFilter.push(layer.filter);
      this.lstLoadedOriginFilterAfterHandlebar[layerKey] = newFilter;
    }
    if (this.hasResize === true) {
      this.hasResize = false;
      console.log("HAS RESIZE -> LOAD ASSET FROM UPDATE WATCH FIELD");
      if (this.hasBoundingBox) {
        this.currentBox = (0, import_lodash8.cloneDeep)(boudingBox);
      }
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        const layer1 = this.layerAssets[i2].layer;
        if (layer1.filter) {
          if (this.uwfFilterCalled.indexOf(layer1.filter) > -1) {
            continue;
          }
          this.uwfFilterCalled.push(layer1.filter);
          const idx = this.layerAssets[i2].i;
          this.mapObj.clearAllFeaturesLayer(idx);
          const newFilter2 = sclHandlebars2.processHandlebars(layer1.filter, null, null, null, this.contextParams);
          this.searchMultiAssetMoveUpdate(fromSource, layerKey, idx, coor, coorNext, newFilter2, layer1.geoJsonField, layer1, layer1.filter + "_layer_" + this.layerAssets[i2].i, layer1, this.loadAssetUWFOtherLayerCb.bind(this));
        } else {
          this.countUwfFilterDone++;
          if (this.countUwfFilterDone == this.uwfFilterCalled.length) {
            this.uwfFilterCalled = [];
          }
        }
      }
    } else {
      if (this.hasBoundingBox) {
        this.currentBox = JSON.parse(JSON.stringify(boudingBox));
      }
      for (let i2 = 0; i2 < this.layerAssets.length; i2++) {
        const layer1 = this.layerAssets[i2].layer;
        if (layer1.filter) {
          const newFilter2 = sclHandlebars2.processHandlebars(layer1.filter, null, null, null, this.contextParams);
          if ((this.lstLoadedOriginFilter.indexOf(layer1.filter) > -1 || this.uwfFilterCalled.indexOf(layer1.filter) > -1) && isEqual(this.lstLoadedOriginFilterAfterHandlebar[i2], newFilter2)) {
            continue;
          }
          this.lstLoadedOriginFilter.push(layer1.filter);
          this.lstLoadedOriginFilterAfterHandlebar[i2] = newFilter2;
          const idx = this.layerAssets[i2].i;
          this.mapObj.clearAllFeaturesLayer(idx);
          this.searchMultiAssetMoveUpdate(fromSource, layerKey, idx, coor, coorNext, newFilter2, layer1.geoJsonField, layer1, layer1.filter + "_layer_" + this.layerAssets[i2].i, layer1, this.loadAssetUWFOtherLayerCb.bind(this));
        }
      }
    }
  }
  loadAssetUWFOtherLayerCb() {
    this.countUwfFilterDone++;
    if (this.countUwfFilterDone == this.uwfFilterCalled.length) {
      this.uwfFilterCalled = [];
    }
  }
  loadAssetUWFLayerCb(fromSource, layerIndex) {
    if (!this.mapObj) {
      return;
    }
    this.mapObj.updateSize();
    if (this.showTiming) {
      console.log(`%c from: ${fromSource}, layer[${layerIndex}]
       end time for all query layer ${(/* @__PURE__ */ new Date()).toISOString()}`, "color:green");
    }
    this.countUwfFilterDone++;
    if (this.countUwfFilterDone == this.uwfFilterCalled.length) {
      this.uwfFilterCalled = [];
      if (this.compType === SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.loadInitialMapView && typeof this.loadInitialMapView === "function") {
        this.loadInitialMapView();
      }
    }
  }
  setupContext() {
    return {
      document: this.document,
      account: this.contextParams.account,
      template: this.contextParams.template,
      componentDefinition: this.componentDefinition
    };
  }
  setupSearchOptions(options, field, dataSource) {
    options.dataSource = dataSource;
    options.queryName = field.queryName;
    options.searchOfflineOnly = this.componentDefinition?.searchOptions?.searchOfflineOnly;
    return options;
  }
  searchMultiAssetMoveUpdate(fromSource, layerKey, layerIndex, coor, coorNext, filterLayer, geoJsonField, layer, query, field, cb) {
    if (layer.type === "dynamic") {
      this.searchWebService({
        layer,
        layerDisplayOnly: layer.layerDisplayOnly,
        isRefreshFeature: null,
        asset: null,
        primaryMultiPopup: null,
        secondaryMultiPopup: null
      }, cb);
    } else {
      const filter2 = sclUtilMapService.getQueryGeo(coor, coorNext, filterLayer, geoJsonField, this.hasBoundingBox);
      if (filter2) {
        let options = {
          page: 0,
          pageSize: this.pageSize,
          document: this.document,
          filter: filter2,
          layerKey,
          searchOptions: null,
          queryName: null,
          dataSource: null
        };
        let layerFilter = options.filter;
        if (typeof layerFilter !== "string") {
          layerFilter = JSON.stringify(options.filter);
        }
        this.updateWatchFieldsLayerKey[layerKey][layerIndex] = layerFilter;
        if (!field.queryName) {
          field.queryName = this.componentDefinition?.queryName;
        }
        const dataSource = this.sclSearchClientService.getDefaultSearchProvider(this.setupContext());
        if (field.queryName) {
          options = this.setupSearchOptions(options, field, dataSource);
        }
        this.searchAsset(fromSource, options, geoJsonField, layer, query, {}, cb);
      } else {
        console.error("filter is null because filterLayer is : ", filterLayer);
        if (cb && typeof cb === "function") {
          cb();
        }
      }
    }
  }
  drawAsset(params) {
    return __async(this, null, function* () {
      const i2 = params.i;
      const itemData = params.itemData;
      const geoJsonField = params.geoJsonField;
      const layerIndex = params.layerIndex;
      const layer = params.layer;
      const heatmapPoints = params.heatmapPoints;
      const isFit = params.isFit;
      const customData = params.customData;
      const tooltip = params.tooltip ? params.tooltip : layer.tooltips;
      const layerClone = params.layerClone;
      const layerDisplayOnly = params.layerDisplayOnly ? params.layerDisplayOnly : layer.layerDisplayOnly;
      const isRefreshFeature = params.isRefreshFeature;
      const getAssetPoint = params.getAssetPoint;
      const cb = params.cb;
      let needFit = isFit;
      let obj = {
        needFit
      };
      try {
        if (itemData[geoJsonField]) {
          if (itemData[geoJsonField].features) {
            for (let j = 0; j < itemData[geoJsonField].features.length; j++) {
              const featureData = itemData[geoJsonField].features[j];
              if (!featureData || !featureData.geometry || !featureData.geometry.coordinates) {
                continue;
              }
              let radius = null;
              let circleCenter = null;
              if (featureData.properties && featureData.properties.radius) {
                radius = featureData.properties.radius;
                circleCenter = featureData.geometry.coordinates;
              }
              const lat = featureData.geometry.coordinates[1];
              const lon = featureData.geometry.coordinates[0];
              if (lat === "" || lon === "" || !featureData.geometry.type) {
                continue;
              }
              let addressField = geoJsonField;
              if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.primaryAssetAddressField) {
                addressField = this.primaryAssetAddressField;
              }
              let asset = null;
              if (getAssetPoint && typeof getAssetPoint === "function") {
                asset = getAssetPoint(itemData, this.componentDefinition, SclMapConstantService.ASSET_PRIMARY_TYPE, addressField, this.componentDefinition.primaryAssetAddressSelection);
              }
              const dataId = itemData.documentId;
              const id2 = dataId + "_" + j + "_" + layerIndex;
              const type = featureData.geometry.type;
              const url = "form/" + dataId;
              let name = "";
              if (itemData.systemHeader && itemData.systemHeader.summaryName) {
                name = itemData.systemHeader.summaryName;
              }
              needFit = isFit;
              const label = {
                labelText: layer.labelText,
                labelTextAlign: layer.labelTextAlign,
                labelTextBaseline: layer.labelTextBaseline,
                labelColor: layer.labelColor,
                labelOutlineColor: layer.labelOutlineColor,
                labelOutlineWidth: layer.labelOutlineWidth,
                labelOffsetX: layer.labelOffsetX,
                labelOffsetY: layer.labelOffsetY,
                labelPlacement: layer.labelPlacement,
                labelMaxAngle: layer.labelMaxAngle,
                labelOverflow: layer.labelOverflow,
                labelRotationWithView: layer.labelRotationWithView,
                labelRotation: layer.labelRotation,
                labelPadding: layer.labelPadding,
                labelFont: layer.labelFont,
                labelFontWeight: layer.labelFontWeight,
                labelFontSize: layer.labelFontSize,
                labelDisplayZoom: layer.labelDisplayZoom
              };
              const handlebarsContext = {
                results: customData,
                resultsCount: customData.length,
                resultsIndex: i2,
                queryResultDocument: itemData
              };
              let rotation = sclUtilMapService.processLayerRotation(layer, layerIndex, this.componentDefinition, this.contextParams, handlebarsContext);
              let primaryMultiPopup = null;
              let secondaryMultiPopup = null;
              if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
                primaryMultiPopup = name;
                secondaryMultiPopup = name;
                if (this.popupAssetSelectionPrimaryText) {
                  primaryMultiPopup = sclHandlebars2.processHandlebars(this.popupAssetSelectionPrimaryText, handlebarsContext, null, null, this.contextParams, null);
                }
                if (this.popupAssetSelectionSecondaryText) {
                  secondaryMultiPopup = sclHandlebars2.processHandlebars(this.popupAssetSelectionSecondaryText, handlebarsContext, null, null, this.contextParams, null);
                }
              }
              obj = yield this.draw1Asset({
                handlebarsContext,
                layer,
                itemData,
                tooltip,
                layerClone,
                id: id2,
                docId: dataId,
                name,
                type,
                featureData,
                label,
                pImageFileNo: layer.imageFileNo,
                clusterImageFileNo: layer.clusterImageFileNo,
                layerDisplayOnly,
                url,
                layerIndex,
                isRefreshFeature,
                rotation,
                scale: 1,
                idCache: 0,
                radius,
                circleCenter,
                heatmapPoints,
                asset,
                // selected-asset
                primaryMultiPopup,
                // selected-asset
                secondaryMultiPopup,
                // selected-asset
                needFit
                // address-map
              });
              if (i2 == customData.length - 1 && typeof cb === "function") {
                cb();
              }
            }
          }
        }
      } catch (err) {
        console.log("err : " + err);
      }
      return obj;
    });
  }
  draw1Asset(params) {
    return __async(this, null, function* () {
      if (!this.mapObj) {
        return;
      }
      const handlebarsContext = params.handlebarsContext;
      const layer = params.layer;
      const itemData = params.itemData;
      const tooltip = params.tooltip;
      let layerClone = params.layerClone;
      const id2 = params.id;
      const docId = params.docId;
      const name = params.name;
      let type = params.type;
      const featureData = params.featureData;
      let label = params.label;
      const pImageFileNo = params.pImageFileNo;
      const clusterImageFileNo = params.clusterImageFileNo;
      const layerDisplayOnly = params.layerDisplayOnly;
      const url = params.url;
      const layerIndex = params.layerIndex;
      const isRefreshFeature = params.isRefreshFeature;
      const rotation = params.rotation;
      const scale5 = params.scale;
      const idCache = params.idCache;
      const radius = params.radius;
      const circleCenter = params.circleCenter;
      const heatmapPoints = params.heatmapPoints;
      const asset = params.asset;
      const primaryMultiPopup = params.primaryMultiPopup;
      const secondaryMultiPopup = params.secondaryMultiPopup;
      const needFit = params.needFit;
      let imageFileNo = sclHandlebars2.processHandlebars(pImageFileNo, handlebarsContext, null, null, this.contextParams, null);
      if (this.disableHandlebars === true) {
        imageFileNo = null;
      }
      if (layer.type === "cluster" && (typeof clusterImageFileNo !== "undefined" && clusterImageFileNo.trim() !== "")) {
        imageFileNo = sclHandlebars2.processHandlebars(clusterImageFileNo, handlebarsContext, null, null, this.contextParams, null);
      }
      if (this.libName === "openlayers") {
        if (imageFileNo.trim().length === 0) {
          imageFileNo = SclMapConstantService.MAP_MARKER;
        }
        try {
          imageFileNo = yield this.getIcon(imageFileNo);
        } catch (err) {
          console.log("error getFileResource : " + err.message);
        }
      }
      let centerPoint = null;
      if (layer.type !== "heatmap") {
        if (layer.type === "cluster" && type !== "Point") {
          centerPoint = this.getCenterOfGeometry(featureData.geometry.coordinates, type);
        }
        let imageUrl = imageFileNo;
        if (imageUrl) {
          if (imageUrl.indexOf("getFile") < 0 && imageUrl.indexOf("http") < 0 && imageUrl.indexOf("data:image") < 0) {
            imageUrl = "/api/getFile/" + imageUrl;
          }
          yield this.cacheImage(imageUrl);
          if (this.compType === SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
            const iconIndex = this.mapObj.cacheImageUrls.indexOf(imageUrl);
            let strBase64 = this.mapObj.cacheImageBase64s[iconIndex];
            if (iconIndex > -1 && (rotation && rotation != 0) || params.scale != 1) {
              const isFlip = scale5 < 0 ? true : false;
              const infoId = imageUrl + "#" + rotation + "#" + scale5 + "#" + isFlip;
              const infoIndex = this.mapObj.cacheImageModifiedInfo.indexOf(infoId);
              if (infoIndex < 0) {
                yield this.modifyImage(strBase64, rotation, scale5, isFlip, infoId);
              }
            }
          }
        }
      }
      if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET && this.featureCollections && this.featureCollections.features && Array.isArray(this.featureCollections.features) && this.featureCollections.features.length > 0) {
        for (let k = 0; k < this.featureCollections.features.length; k++) {
          const asset2 = this.featureCollections.features[k];
          if (!asset2.properties || !asset2.properties.type) {
            continue;
          }
          const type2 = asset2.properties.type;
          if (type2 !== "primaryAsset" && type2 !== "secondaryAsset") {
            continue;
          }
          let fId = id2;
          if (id2.indexOf("_") > -1) {
            fId = fId.split("_")[0];
          }
          if (fId == asset2.properties.linkAssets[0].documentId) {
            let isExisted = false;
            for (let m = 0; m < this.visualizeSelectedAsset.length; m++) {
              if (this.visualizeSelectedAsset[m].id == id2) {
                isExisted = true;
                break;
              }
            }
            if (!isExisted) {
              this.visualizeSelectedAsset.push({ id: id2, handlebarsContext });
            }
            break;
          }
        }
        yield this.setSelectedAssetVisualize();
      }
      if (type === "Point") {
        if (this.systemMapLimit) {
          if (featureData && featureData.geometry && featureData.geometry.coordinates) {
            const lon = featureData.geometry.coordinates[0];
            const lat = featureData.geometry.coordinates[1];
            const isValid = this.isInBoxLimit(lat, lon, this.systemMapLimit);
            if (!isValid) {
              console.log(`*** point is out of systemMapLimit, lon: ${lon}, lat: ${lat}, id: ${docId}`);
            }
          } else {
            console.log(`invalid asset location data, id: ${docId}`);
          }
        }
        this.countAssetPoint++;
      }
      if (radius && this.libName === "google") {
        featureData.properties.centerPoint = featureData.geometry.coordinates;
        const coords = sclUtilMapService.circleToPolygon(featureData.geometry.coordinates, radius);
        featureData.geometry.coordinates = coords;
        type = "Polygon";
        featureData.geometry.type = type;
      }
      const iRelatedAsset = {};
      for (const field in this.relatedAsset) {
        if (this.relatedAsset.hasOwnProperty(field)) {
          const fieldAsset = this.relatedAsset[field];
          iRelatedAsset[field] = fieldAsset;
          if (itemData.hasOwnProperty(fieldAsset) && itemData[fieldAsset]) {
            iRelatedAsset[field] = itemData[fieldAsset];
          }
        }
      }
      if (this.disableHandlebars === true) {
        label = null;
      } else {
        if (label) {
          label = sclUtilMapService.processHandlebarsOnLabel(this.componentDefinition, this.contextParams, label, handlebarsContext, layer, layerIndex, idCache);
        }
      }
      let pTooltip = "";
      if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP && tooltip && this.getToolTips && typeof this.getToolTips === "function") {
        pTooltip = this.getToolTips(tooltip, handlebarsContext);
      }
      let color2 = layer.color;
      if (this.disableHandlebars === false) {
        if (color2) {
          color2 = sclHandlebars2.processHandlebars(layer.color, handlebarsContext, null, null, this.contextParams, null);
        }
      }
      let anchor2 = layer.imageAnchor ? layer.imageAnchor : this.defaultImageAnchor;
      if (this.disableHandlebars === true) {
        layerClone.lineCap = null;
        layerClone.lineWidth = null;
        layerClone.lineDash = null;
        layerClone.fill = null;
        layerClone.fillOpacity = null;
      } else {
        anchor2 = sclUtilMapService.processHandlebarsOnVisualItem(this.componentDefinition, this.contextParams, layer.imageAnchor, layer.imageAnchorHandlebars, handlebarsContext, "array", null);
        if (!anchor2 && layer.imageAnchor) {
          anchor2 = layer.imageAnchor;
        }
        layerClone = sclUtilMapService.processHandlebarsOnLayer(this.componentDefinition, this.contextParams, layerClone, handlebarsContext, layer, layerIndex);
      }
      let fea;
      let fData;
      if (layer.type === "heatmap") {
        this.createHeatMapData(featureData.geometry.coordinates, type, itemData[layer.magnitudeField], this.libName === "google" ? true : false, {
          id: itemData.documentId,
          name,
          heatmapPoints
        });
      } else {
        const obj = this.createAndAddFeature(fea, fData, id2, featureData, type, imageFileNo, name, color2, layerDisplayOnly, anchor2, url, layerClone, pTooltip, label, layerIndex, centerPoint, rotation, scale5, docId, radius, circleCenter, iRelatedAsset, primaryMultiPopup, secondaryMultiPopup, asset, handlebarsContext, itemData, isRefreshFeature);
        fea = obj.fea;
        fData = obj.fData;
      }
      return { needFit, fea, fData, label };
    });
  }
  createAndAddFeature(fea, fData, id2, featureData, type, imageFileNo, name, color2, layerDisplayOnly, anchor2, url, layerClone, pTooltip, label, layerIndex, centerPoint, rotation, scale5, docId, radius, circleCenter, iRelatedAsset, primaryMultiPopup, secondaryMultiPopup, asset, handlebarsContext, itemData, isRefreshFeature) {
    fea = this.mapObj.getFeatureById(id2);
    fData = {
      featureData,
      type,
      imageFileNo,
      name,
      id: id2,
      color: color2,
      layerDisplayOnly,
      anchor: anchor2,
      url,
      layerClone,
      tooltip: pTooltip,
      label,
      layer: (0, import_lodash8.cloneDeep)(layerClone),
      layerIndex,
      centerPoint,
      rotation,
      scale: scale5,
      docId,
      radius,
      circleCenter,
      iRelatedAsset,
      primaryMultiPopup,
      secondaryMultiPopup,
      asset,
      handlebarsContext,
      itemData
    };
    if ((this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET || this.compType == SclMapConstantService.COMP_TYPE_STREET_ADDRESS || this.compType == SclMapConstantService.COMP_TYPE_BOUNDARY) && this.createFeature && typeof this.createFeature === "function") {
      const feature = this.createFeature(fData);
    }
    if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP && this.createNewFeature && typeof this.createNewFeature === "function" && this.updateExistedFeature && typeof this.updateExistedFeature === "function") {
      if (!fea) {
        this.createNewFeature(fData);
      } else {
        this.updateExistedFeature(fea, label, fData, isRefreshFeature);
      }
    }
    return { fea, fData };
  }
  checkValidQuery(options) {
    if (typeof options.layerKey !== "undefined" && !this.checkLayerKey(options.layerKey, options.filter)) {
      return false;
    }
    return true;
  }
  searchWebService(params, cb) {
    const layer = params.layer;
    const layerDisplayOnly = params.layerDisplayOnly;
    const isRefreshFeature = params.isRefreshFeature;
    const count = params.count;
    const isFit = params.isFit;
    const asset = params.asset;
    const primaryMultiPopup = params.primaryMultiPopup;
    const secondaryMultiPopup = params.secondaryMultiPopup;
    let layerIndex = -1;
    for (let li = 0; li < this.layerAssets.length; li++) {
      if (this.layerAssets[li].layer.filter === layer.filter && this.layerAssets[li].layer.type === layer.type) {
        layerIndex = this.layerAssets[li].i;
        break;
      }
    }
    if (layerIndex < 0) {
      console.log("invalid layerIndex of layer.filter = " + layer.filter);
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    const newFilter = sclHandlebars2.processHandlebars(layer.filter, null, null, null, this.contextParams);
    const funcName = layer.webServiceFunctionName;
    const webServiceName = layer.webServiceDocumentName;
    const p = {
      functionName: funcName,
      componentDocumentName: webServiceName,
      functionParameters: [newFilter, null, null, null]
    };
    this.httpClient.post("api/execute", p).subscribe((customData) => {
      if (customData && customData.length > 0) {
        const layerClone = (0, import_lodash8.cloneDeep)(layer);
        let heatmapPoints = typeof layer.heatmapPoints === "undefined" || layer.heatmapPoints === null ? "Center" : layer.heatmapPoints;
        if (heatmapPoints !== "Points") {
          heatmapPoints = "Center";
        }
        let countDrawed = 0;
        customData.forEach((item, i2) => __async(this, null, function* () {
          if (item && item.status == 1) {
            const itemData = item.result;
            const data = sclUtilMapService.processDynamicLayerData(layer, itemData, i2, layerIndex, customData, item.vehicle);
            if (this.disableHandlebars === true) {
              data.label = null;
            } else {
              if (data.label.labelText) {
                data.label.labelText = sclHandlebars2.processHandlebars(data.label.labelText, data.handlebarsContext, null, null, this.contextParams, { handlebarsTemplateName: `${layer.name}_${layerIndex}_${data.label.labelText}_labelText` });
              }
              data.label = sclUtilMapService.processHandlebarsOnLabel(this.componentDefinition, this.contextParams, data.label, data.handlebarsContext, layer, layerIndex, data.id);
            }
            const obj = yield this.draw1Asset({
              handlebarsContext: data.handlebarsContext,
              layer,
              i: i2,
              itemData: data.item,
              tooltip: data.tooltip,
              layerClone,
              id: data.id,
              docId: data.id,
              name: data.name,
              type: "Point",
              featureData: data.item,
              label: data.label,
              pImageFileNo: data.imageFileNo,
              clusterImageFileNo: null,
              layerDisplayOnly,
              url: data.url,
              layerIndex,
              dataId: data.dataId,
              isRefreshFeature,
              rotation: data.rotation,
              scale: data.scale,
              idCache: data.id,
              radius: null,
              circleCenter: null,
              heatmapPoints,
              asset,
              // selected-asset
              primaryMultiPopup,
              // selected-asset
              secondaryMultiPopup
              // selected-asset
            });
            countDrawed++;
            if (countDrawed == customData.length) {
              if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
                this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
              } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
                if (cb && typeof cb === "function") {
                  cb();
                }
              }
            }
          } else {
            if (item && item.result) {
              console.log(item.result.error);
              console.log(item.result.errorDetails);
            }
            if (item && item.error) {
              console.log(item.error);
              console.log(item.errorDetails);
            }
            countDrawed++;
            if (countDrawed == customData.length) {
              if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
                this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
              } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
                if (cb && typeof cb === "function") {
                  cb();
                }
              }
            }
          }
        }));
      } else {
        if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
          this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
        } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
          if (cb && typeof cb === "function") {
            cb();
          }
        }
      }
    }, (err) => {
      console.error("error query current location :");
      console.error(err);
      if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
        this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
      } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
        if (cb && typeof cb === "function") {
          cb();
        }
      }
    });
  }
  loadMapTiles(params, cb) {
    const layer = params.layer;
    const layerDisplayOnly = params.layerDisplayOnly;
    const isRefreshFeature = params.isRefreshFeature;
    const count = params.count;
    const isFit = params.isFit;
    const asset = params.asset;
    const primaryMultiPopup = params.primaryMultiPopup;
    const secondaryMultiPopup = params.secondaryMultiPopup;
    let layerIndex = -1;
    for (let li = 0; li < this.layerAssets.length; li++) {
      if (this.layerAssets[li].layer.filter === layer.filter && this.layerAssets[li].layer.type === layer.type) {
        layerIndex = this.layerAssets[li].i;
        break;
      }
    }
    if (layerIndex < 0) {
      console.log("invalid layerIndex of layer.filter = " + layer.filter);
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.httpClient.get(layer.url).subscribe((customData) => {
      if (customData && customData.features && customData.features.length > 0) {
        const layerClone = (0, import_lodash8.cloneDeep)(layer);
        let heatmapPoints = typeof layer.heatmapPoints === "undefined" || layer.heatmapPoints === null ? "Center" : layer.heatmapPoints;
        if (heatmapPoints !== "Points") {
          heatmapPoints = "Center";
        }
        let countDrawed = 0;
        customData = customData.features;
        customData.forEach((data, i2) => __async(this, null, function* () {
          if (data.properties) {
            for (let key in data.properties) {
              data[key] = data.properties[key];
            }
            delete data.properties;
          }
          if (!data.handlebarsContext) {
            data.handlebarsContext = {
              results: customData,
              resultsCount: customData.length,
              resultsIndex: i2,
              queryResultDocument: data
            };
          }
          if (this.disableHandlebars === true) {
            data.label = null;
          } else {
            if (data.label) {
              if (data.label.labelText) {
                data.label.labelText = sclHandlebars2.processHandlebars(data.label.labelText, data.handlebarsContext, null, null, this.contextParams, { handlebarsTemplateName: `${layer.name}_${layerIndex}_${data.label.labelText}_labelText` });
              }
              data.label = sclUtilMapService.processHandlebarsOnLabel(this.componentDefinition, this.contextParams, data.label, data.handlebarsContext, layer, layerIndex, data.id);
            }
          }
          const obj = yield this.draw1Asset({
            handlebarsContext: data.handlebarsContext,
            layer,
            i: i2,
            itemData: data,
            tooltip: data.tooltip,
            layerClone,
            id: data.id,
            docId: data.id,
            name: data.name,
            type: data.geometry.type,
            featureData: data,
            label: data.label,
            pImageFileNo: data.imageFileNo,
            clusterImageFileNo: null,
            layerDisplayOnly,
            url: data.url,
            layerIndex,
            dataId: data.id,
            isRefreshFeature,
            rotation: data.rotation,
            scale: data.scale,
            idCache: data.id,
            radius: null,
            circleCenter: null,
            heatmapPoints,
            asset,
            // selected-asset
            primaryMultiPopup,
            // selected-asset
            secondaryMultiPopup
            // selected-asset
          });
          countDrawed++;
          if (countDrawed == customData.length) {
            if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
              this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
            } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
              if (cb && typeof cb === "function") {
                cb();
              }
            }
          }
        }));
      } else {
        if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
          this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
        } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
          if (cb && typeof cb === "function") {
            cb();
          }
        }
      }
    }, (err) => {
      console.error("error query current location :");
      console.error(err);
      if (this.compType == SclMapConstantService.COMP_TYPE_ADDRESS_MAP) {
        this.finishSearchAsync(count, false, isFit, layer, layerIndex, cb);
      } else if (this.compType == SclMapConstantService.COMP_TYPE_SELECTED_ASSET) {
        if (cb && typeof cb === "function") {
          cb();
        }
      }
    });
  }
  getHandlerValue(data) {
    const qualityRegex = /{{{?(.*?)?[a-z]+.[a-z]*}?}}/g;
    let matches;
    const qualities = [];
    while (matches = qualityRegex.exec(data)) {
      const match0 = matches[0];
      const item = match0.replace("{{{", "").replace("}}}", "");
      qualities.push(item);
    }
    return qualities;
  }
  // 15358: dexie query and other search provider
  getDataWithSearchProvider(dataResult) {
    let data = {
      data: [],
      total: 0,
      isOtherSearch: false
    };
    const isOtherSearch = dataResult?.searchProvier && dataResult?.searchProvier !== "elastic";
    if (isOtherSearch) {
      data.data = dataResult?.data;
      data.total = dataResult?.total ? dataResult?.total : dataResult?.data?.length;
    } else {
      data.data = dataResult?.data?.hits?.hits;
      data.total = dataResult?.data?.hits?.total;
    }
    data.isOtherSearch = isOtherSearch;
    return data;
  }
  searchMultiAssetMove(fromSource, coor, coorNext, filterLayer, geoJsonField, layer, query, field, params, cb) {
    if (layer.type === "dynamic") {
      this.searchWebService({
        layer,
        layerDisplayOnly: layer.layerDisplayOnly,
        isRefreshFeature: null,
        asset: null,
        primaryMultiPopup: null,
        secondaryMultiPopup: null
      }, cb);
    } else if (layer.type === "tile") {
      this.loadMapTiles({ layer }, cb);
    } else {
      const filter2 = sclUtilMapService.getQueryGeo(coor, coorNext, filterLayer, geoJsonField, this.hasBoundingBox);
      if (filter2 && filter2 !== "null") {
        let options = {
          page: 0,
          pageSize: this.pageSize,
          document: this.document,
          filter: filter2,
          searchOptions: null,
          queryName: null,
          dataSource: null
        };
        if (!field.queryName) {
          field.queryName = this.componentDefinition?.queryName;
        }
        const dataSource = this.sclSearchClientService.getDefaultSearchProvider(this.setupContext());
        if (field.queryName) {
          options = this.setupSearchOptions(options, field, dataSource);
        }
        this.searchAsset(fromSource, options, geoJsonField, layer, query, {}, cb);
      } else {
        console.error("filter is null because filterLayer is : ", filterLayer);
        if (cb && typeof cb === "function") {
          cb();
        }
      }
    }
  }
  searchAsset(fromSource, options, geoJsonField, layer, query, params, cb) {
    this.loadAssetCounter++;
    const assetField = this.componentDefinition;
    let sf;
    let i2;
    if (!options.filter) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    if (options.filter === "") {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    options.sourceFilter = [geoJsonField, "documentId", "systemHeader.summaryName"];
    if (this.primaryAssetAddressField) {
      options.sourceFilter.push(this.primaryAssetAddressField);
    }
    if (this.primaryAssetGeometryField) {
      options.sourceFilter.push(this.primaryAssetGeometryField);
    }
    if (this.relatedAssetQuery.length > 0) {
      for (i2 = 0; i2 < this.relatedAssetQuery.length; i2++) {
        if (options.sourceFilter.indexOf(this.relatedAssetQuery[i2]) < 0) {
          options.sourceFilter.push(this.relatedAssetQuery[i2]);
        }
      }
    }
    if (typeof layer.tooltips !== void 0 && layer.tooltips !== null && layer.tooltips !== void 0) {
      sf = this.getHandlerValue(layer.tooltips);
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    if (typeof assetField.tooltips !== void 0 && assetField.tooltips !== null && assetField.tooltips !== void 0) {
      sf = this.getHandlerValue(assetField.tooltips);
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    if (layer.labelText) {
      sf = this.getHandlerValue(layer.labelText);
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    if (layer.labelTextHandlebars) {
      sf = this.getHandlerValue(layer.labelTextHandlebars);
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    if (typeof assetField.additionalQueryFields !== void 0 && assetField.additionalQueryFields !== null && assetField.additionalQueryFields !== void 0) {
      sf = assetField.additionalQueryFields;
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    if (typeof layer.additionalQueryFields !== void 0 && layer.additionalQueryFields !== null && layer.additionalQueryFields !== void 0) {
      sf = layer.additionalQueryFields;
      if (sf.length > 0) {
        for (i2 = 0; i2 < sf.length; i2++) {
          if (options.sourceFilter.indexOf(sf[i2]) < 0) {
            options.sourceFilter.push(sf[i2]);
          }
        }
      }
    }
    console.log("Layer search SourceFilter is : " + options.sourceFilter);
    const layerClone = (0, import_lodash8.cloneDeep)(layer);
    let heatmapPoints = typeof layer.heatmapPoints === "undefined" || layer.heatmapPoints === null ? "Center" : layer.heatmapPoints;
    if (heatmapPoints !== "Points") {
      heatmapPoints = "Center";
    }
    this.searchPagingAsync(fromSource, options, {
      geoJsonField,
      layer,
      query,
      layerClone,
      heatmapPoints
    }, cb);
  }
  searchPagingAsync(fromSource, options, params, cb) {
    const query = params.query;
    const layer = params.layer;
    let canFetchMore = false;
    let layerIndex = -1;
    let queryName = "";
    for (let li = 0; li < this.layerAssets.length; li++) {
      if (this.layerAssets[li].query === query && this.layerAssets[li].layer.type === layer.type) {
        layerIndex = this.layerAssets[li].i;
        queryName = this.layerAssets[li].layer.queryName;
        this.layerAssets[li].currentFilter = options.filter;
        break;
      }
    }
    if (layerIndex < 0) {
      console.info("layerIndex is invalid");
      if (cb && typeof cb === "function") {
        cb();
      }
    } else {
      const startTimeRequest = /* @__PURE__ */ new Date();
      if (this.showTiming) {
        console.log(` from: ${fromSource}, layer[${layerIndex}]
           start time request asset = ${startTimeRequest.toISOString()}
           
	, query = ${options.filter}
           
	, queryName = ${queryName}`);
      }
      this.sclSearchClientService.search(options).then((dataResult) => {
        if (this.showTiming) {
          const endTimeRequest = /* @__PURE__ */ new Date();
          const totalTimeRequest = (endTimeRequest - startTimeRequest) / 1e3;
          console.log(` from: ${fromSource}, layer[${layerIndex}]
            end time return asset = ${endTimeRequest.toISOString()}
            
	, start time = ${startTimeRequest.toISOString()}
            
	, total time = ${totalTimeRequest} (seconds)`);
        }
        let validQuery = false;
        for (let q = 0; q < this.layerAssets.length; q++) {
          if (isEqual(this.layerAssets[q].currentFilter, options.filter) && this.layerAssets[q].i == layerIndex) {
            validQuery = true;
            break;
          }
        }
        if (!validQuery) {
          console.log("Get data of invalid filter, layerIndex = " + layerIndex + "\n	, filter = " + options.filter);
          if (cb && typeof cb === "function") {
            cb();
          }
        } else {
          let data = this.getDataWithSearchProvider(dataResult);
          if (data.data.length > 0) {
            let resultCount = this.pageSize;
            if (this.pageSize > data.data.length) {
              resultCount = data.data.length;
            }
            const remain = data.total - resultCount;
            if (this.showTiming) {
              console.log(`%c fromSource: ${fromSource}, resultCount = ${resultCount}
               layer[${layerIndex}]
               
	, total = ${data.total}
               
	, remain = ${remain}`, "color:cyan");
            }
            params.layerIndex = layerIndex;
            params.options = options;
            if (this.asyncDrawAsset) {
              this.resultSearchPagingAsync(fromSource, this.parseDataAsync.bind(this), dataResult, params, remain, this.pageSize, canFetchMore, layer, layerIndex, options, cb);
            } else {
              this.resultSearchPagingAsync(fromSource, this.parseData.bind(this), dataResult, params, remain, this.pageSize, canFetchMore, layer, layerIndex, options, cb);
            }
          } else {
            canFetchMore = false;
            if (this.showTiming) {
              console.log(`%c from: ${fromSource}, layer[${layerIndex}]
               request asset return NO DATA`, "color:cyan");
            }
            this.finishSearch(canFetchMore, layer, layerIndex, cb);
          }
        }
      }, (err) => {
        console.error("error in Selected Asset search:" + err);
        console.error("|===> error filter = " + options.filter);
        if (this.showTiming) {
          const endTimeRequest = /* @__PURE__ */ new Date();
          console.log(` from: ${fromSource}, layer[${layerIndex}]
           end time return asset error = ${endTimeRequest.toISOString()}`);
        }
        if (cb && typeof cb === "function") {
          cb();
        }
      });
    }
  }
  parseDataAsync(data, params, cb) {
    const dataWithProviders = this.getDataWithSearchProvider(data);
    const customData = dataWithProviders.data;
    const isOtherSearch = dataWithProviders.isOtherSearch;
    const geoJsonField = params.geoJsonField;
    const layer = params.layer;
    const query = params.query;
    const layerIndex = params.layerIndex;
    const layerClone = params.layerClone;
    const heatmapPoints = params.heatmapPoints;
    if (customData && customData.length > 0 && layerIndex > -1) {
      const asyncIterable = {
        index: 0,
        len: customData.length,
        [Symbol.asyncIterator]() {
          return {
            current: this.index,
            last: this.len,
            next() {
              if (this.current < this.last) {
                const itemData = isOtherSearch ? customData[this.current] : customData[this.current]._source;
                this.mapFunc.drawAsset({
                  i: this.current,
                  itemData,
                  geoJsonField,
                  layerIndex,
                  layer,
                  heatmapPoints,
                  customData,
                  layerClone,
                  getAssetPoint: this.getAssetPoint.bind(this),
                  popupAssetSelectionPrimaryText: this.popupAssetSelectionPrimaryText,
                  popupAssetSelectionSecondaryText: this.popupAssetSelectionSecondaryText
                });
                return Promise.resolve({ value: this.current++, done: false });
              }
              if (cb && typeof cb === "function") {
                cb();
              }
              return Promise.resolve({ done: true });
            }
          };
        }
      };
      function main() {
        return __async(this, null, function* () {
        });
      }
      main().then((r) => {
      }).catch((err) => console.log(err));
    } else {
      if (cb && typeof cb === "function") {
        cb();
      }
    }
  }
  parseData(data, params, cb) {
    const dataWithProviders = this.getDataWithSearchProvider(data);
    const customData = dataWithProviders.data;
    const isOtherSearch = dataWithProviders.isOtherSearch;
    const geoJsonField = params.geoJsonField;
    const layer = params.layer;
    const query = params.query;
    const layerIndex = params.layerIndex;
    const layerClone = params.layerClone;
    const heatmapPoints = params.heatmapPoints;
    let i2 = 0;
    let isDraw = false;
    let start2 = 0;
    const end = this.processPageSize < customData.length ? this.processPageSize : customData.length;
    if (customData.length > 0 && layerIndex > -1) {
      YQ.processSearchResultsParallel(data, (itemData) => __async(this, null, function* () {
        const isValid = this.checkValidQuery(params.options);
        if (isValid) {
          if (i2 === start2) {
            isDraw = false;
          }
          if (!isDraw) {
            isDraw = true;
            let n = i2;
            for (let j = 0; j < end; j++) {
              n = j + i2;
              if (n > customData.length - 1) {
                break;
              }
              const iData = isOtherSearch ? customData[n] : customData[n]._source;
              this.drawAsset({
                i: n,
                itemData: iData,
                geoJsonField,
                layerIndex,
                layer,
                heatmapPoints,
                customData,
                layerClone,
                getAssetPoint: params.getAssetPoint,
                popupAssetSelectionPrimaryText: params.popupAssetSelectionPrimaryText,
                popupAssetSelectionSecondaryText: params.popupAssetSelectionSecondaryText,
                cb
              });
            }
            start2 = n + 1;
          }
        }
        i2++;
      }), () => {
        if (cb && typeof cb === "function") {
          cb();
        }
      });
    } else {
      if (cb && typeof cb === "function") {
        cb();
      }
    }
  }
  resultSearchPagingAsync(fromSource, parseDataFn, data, params, remain, pageSize, canFetchMore, layer, layerIndex, options, cb) {
    const self2 = this;
    const startTimeDraw = /* @__PURE__ */ new Date();
    parseDataFn(data, params, () => {
      if (remain > 0) {
        canFetchMore = true;
        const divide = Math.floor(remain / pageSize);
        let modulus = remain % pageSize;
        if (modulus > 0) {
          modulus = 1;
        }
        const len = divide + modulus;
        let countAsyncDone = len;
        if (this.showTiming) {
          console.log(`%c fromSource: ${fromSource} can fetch more, async len = ${len}`, "color:cyan");
        }
        const from2 = pageSize;
        const self3 = this;
        const asyncIterable = {
          index: 0,
          len,
          [Symbol.asyncIterator]() {
            return {
              current: this.index,
              last: this.len,
              next() {
                if (this.current < this.last) {
                  const subOp = (0, import_lodash8.cloneDeep)(options);
                  subOp.from = from2 * this.current + pageSize;
                  params.pageIndex = this.current;
                  subOp.pageIndex = this.current;
                  if (this.showTiming) {
                    if (layerIndex) {
                      console.log(` from: ${fromSource}, layer[${layerIndex}]
                             start time ${(/* @__PURE__ */ new Date()).toISOString()} for fetching data page: ${this.current}`);
                    } else {
                      console.log(` from: ${fromSource}
                              , start time ${(/* @__PURE__ */ new Date()).toISOString()} for fetching data page: ${this.current}
                              
	, query = ${JSON.stringify(options.filter)}`);
                    }
                  }
                  self3.sclSearchClientService.search(subOp).then((data1) => {
                    const startTimeDraw1 = /* @__PURE__ */ new Date();
                    if (self3.showTiming) {
                      console.log(` from: ${fromSource}, layer[${layerIndex}]
                                 end time ${startTimeDraw1.toISOString()}
                                  for fetching data page: ${subOp.pageIndex} & start time drawing asset`);
                    }
                    parseDataFn(data1, params, () => {
                      countAsyncDone--;
                      if (self3.showTiming) {
                        const endTimeDraw1 = /* @__PURE__ */ new Date();
                        console.log(` from: ${fromSource}, layer[${layerIndex}]
                                   end time drawing asset ${(/* @__PURE__ */ new Date()).toISOString()}
                                    of page: ${subOp.pageIndex}`);
                      }
                      if (countAsyncDone === 0) {
                        canFetchMore = false;
                        if (self3.showTiming) {
                          const endTimeDraw1 = /* @__PURE__ */ new Date();
                          const totalTimeDraw1 = (endTimeDraw1 - startTimeDraw1) / 1e3;
                          console.log(` from: ${fromSource}, layer[${layerIndex}]
                                         end time drawing asset ${endTimeDraw1.toISOString()}
                                        
	, start time = ${startTimeDraw1.toISOString()}
                                        , TOTAL TIME: ${totalTimeDraw1} (seconds)`);
                        }
                        self3.finishSearch(canFetchMore, layer, layerIndex, cb);
                      }
                    });
                  }, (err) => {
                    console.error("error in AddressMap:" + err);
                    if (self3.showTiming) {
                      console.log(`(error) from: ${fromSource}, layer[${layerIndex}]
                             end time ${(/* @__PURE__ */ new Date()).toISOString()}
                             for fetching data page: ${subOp.pageIndex}`);
                    }
                    countAsyncDone--;
                    if (countAsyncDone === 0) {
                      canFetchMore = false;
                      if (self3.showTiming) {
                        console.log(`(error) from: ${fromSource}, layer[${layerIndex}]
                                 end time subsequent request ${(/* @__PURE__ */ new Date()).toISOString()}`);
                      }
                      self3.finishSearch(canFetchMore, layer, layerIndex, cb);
                    }
                  });
                  return Promise.resolve({ value: this.current++, done: false });
                }
                return Promise.resolve({ done: true });
              }
            };
          }
        };
        function main() {
          return __async(this, null, function* () {
            try {
              for (var iter = __forAwait(asyncIterable), more, temp, error3; more = !(temp = yield iter.next()).done; more = false) {
                const num = temp.value;
              }
            } catch (temp) {
              error3 = [temp];
            } finally {
              try {
                more && (temp = iter.return) && (yield temp.call(iter));
              } finally {
                if (error3)
                  throw error3[0];
              }
            }
          });
        }
        main().then((r) => {
          console.log(r);
        }).catch((err) => console.log(err));
      } else {
        if (this.showTiming) {
          const endTimeDraw = /* @__PURE__ */ new Date();
          const totalTimeDraw = (endTimeDraw - startTimeDraw) / 1e3;
          console.log(` from: ${fromSource}, layer[${layerIndex}]
           end time drawing asset ${endTimeDraw.toISOString()}
          
	, start time: ${startTimeDraw.toISOString()}
          
	, total time: ${totalTimeDraw} (seconds)`);
        }
        canFetchMore = false;
        this.finishSearch(canFetchMore, layer, layerIndex, cb);
      }
    });
  }
  // the finishSearchAsync from selected-asset
  finishSearch(canFetchMore, layer, layerIndex, cb) {
    if (layer.type === "heatmap" && this.mapObj) {
      this.mapObj.createHeatMap(layerIndex);
    }
    if (!canFetchMore && cb && typeof cb === "function") {
      cb();
    }
  }
  currentLocationCheckboxClick(e) {
    e.stopPropagation();
    if (e.target.checked) {
      this.locationElementIcon.setAttribute("class", "material-icons ol-has-tooltip button-location-pulse");
      this.getLocation();
    }
  }
  addCurrentLocationCheckbox(keyName, element) {
    this.locationElementCheckboxId = keyName + "Location";
    const checkbox = sclMapViews5.createCheckbox(document, this.locationElementCheckboxId);
    this.locationElementIcon = document.createElement("i");
    this.locationElementIcon.setAttribute("class", "material-icons ol-has-tooltip");
    this.locationElementIcon.innerHTML = "my_location";
    this.locationElementLabel = sclMapViews5.createLabel(document, this.locationElementCheckboxId, null);
    this.locationElementLabel.setAttribute("class", "control-globe");
    this.locationElementLabel.appendChild(this.locationElementIcon);
    this.locationElementLabelId = this.locationElementCheckboxId + "_label";
    this.locationElementLabel.id = this.locationElementLabelId;
    checkbox.onclick = (e) => {
      $("#" + this.locationElementLabelId).css("background", "white");
      if (typeof this.currentLocationCheckBoxOnClick === "function") {
        this.currentLocationCheckBoxOnClick(this.currentLocationCheckboxClick.bind(this, e));
      }
    };
    element.appendChild(checkbox);
    element.appendChild(this.locationElementLabel);
  }
  resetCheckLocationUI() {
    if (this.compType === SclMapConstantService.COMP_TYPE_SELECTED_ASSET || this.compType === SclMapConstantService.COMP_TYPE_STREET_ADDRESS) {
      if (this.locationElementIcon) {
        this.locationElementIcon.setAttribute("class", "material-icons ol-has-tooltip");
      }
      const isChecked = $("#" + this.locationElementCheckboxId).is(":checked");
      if (this.locationElementCheckboxId && isChecked) {
        $("#" + this.locationElementCheckboxId).prop("checked", false);
      }
    } else if (this.compType === SclMapConstantService.COMP_TYPE_BOUNDARY) {
      this.mapObj.resetCheckLocationUI();
    }
  }
  getLocation() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(this.showPosition.bind(this), (err) => {
        this.resetCheckLocationUI();
        console.log(`ERROR code: (${err.code}) , message: ${err.message}`);
        if (err && err.message) {
          this.notificationService.error(err.message);
        }
      });
    }
  }
  showPosition(position) {
    if (this.geoAutoComplete != null) {
      this.geoAutoComplete.removeStreet(this.keyName);
    }
    if (this.addressId) {
      const fea = this.mapObj?.getFeatureById(this.addressId);
      if (fea) {
        this.mapObj?.removeFeature(fea);
      }
    }
    this.resetCheckLocationUI();
    this.currentLat = position.coords.latitude;
    this.currentLon = position.coords.longitude;
    this.currentLocation = [this.currentLat, this.currentLon];
    this.hasMapDragging = true;
    this.subLabelTiming = "Get-Current-Location";
    if (typeof this.updateAddress === "function") {
      this.updateAddress(this.currentLat, this.currentLon);
    }
    if (typeof this.updateMap === "function") {
      this.updateMap(this.currentLat, this.currentLon, false, true);
    }
  }
  actionAfterMapReady(actionFn) {
    if (!this.checkMapReadyFirstLoad) {
      this.checkMapReadyFirstLoad = setInterval(() => {
        if (this.mapObj?.isMapReady) {
          clearInterval(this.checkMapReadyFirstLoad);
          this.checkMapReadyFirstLoad = null;
          if (typeof actionFn === "function") {
            actionFn();
          }
        }
      }, 200);
    }
  }
  imageToBase64(url) {
    return new Promise((resolve, reject) => {
      var xhr2 = new XMLHttpRequest();
      xhr2.onload = function() {
        var reader = new FileReader();
        reader.onloadend = function() {
          const image = new Image();
          image.onload = () => {
            resolve({ base64: reader.result, image });
          };
          image.onerror = reject;
          image.src = url;
        };
        reader.readAsDataURL(xhr2.response);
      };
      xhr2.open("GET", url);
      xhr2.responseType = "blob";
      xhr2.send();
    });
  }
  cacheImage(url) {
    return new Promise((resolve, reject) => __async(this, null, function* () {
      try {
        if (!url) {
          resolve(true);
          return;
        }
        let iconIndex = this.mapObj.cacheImageUrls.indexOf(url);
        if (iconIndex < 0) {
          if (this.mapObj.cacheImageRequesting.indexOf(url) > -1) {
            const waitLoadingImage = setInterval(() => {
              iconIndex = this.mapObj.cacheImageUrls.indexOf(url);
              if (iconIndex > -1) {
                clearInterval(waitLoadingImage);
                resolve(true);
              }
            }, 200);
          } else {
            this.mapObj.cacheImageRequesting.push(url);
            const base64Obj = yield this.imageToBase64(url);
            this.mapObj.cacheImageRequesting.splice(url, 1);
            const base64 = base64Obj.base64;
            const image = base64Obj.image;
            this.mapObj.cacheImageUrls.push(url);
            this.mapObj.cacheImageBase64s.push(base64);
            this.mapObj.cacheImages.push(image);
            resolve(true);
          }
        } else {
          resolve(true);
        }
      } catch (err) {
        console.log(`**** caching image url: ${url}, error: `, err);
        reject(err);
      }
    }));
  }
  modifyBase64Image(base64origin, mode, value) {
    return new Promise((resolve, reject) => {
      if (!this.canvasRotate) {
        this.canvasRotate = document.createElement("canvas");
      }
      let base64 = base64origin;
      const img = new Image();
      img.onload = () => {
        const ctx = this.canvasRotate.getContext("2d");
        let dx = 0;
        let dy = 0;
        let width = img.width;
        let height = img.height;
        switch (mode) {
          case "rotate":
            if (value != 0) {
              let size = img.width;
              if (img.width < img.height) {
                size = img.height;
              }
              width = size;
              height = size;
              this.canvasRotate.width = width;
              this.canvasRotate.height = height;
              ctx.translate(this.canvasRotate.width / 2, this.canvasRotate.height / 2);
              ctx.rotate(value * Math.PI / 180);
              dx = img.width / -2;
              dy = img.height / -2;
              ctx.drawImage(img, dx, dy);
              base64 = this.canvasRotate.toDataURL("image/png");
            }
            break;
          case "scale":
            if (value != 1) {
              dx = 0;
              dy = 0;
              width *= Math.abs(value);
              height *= Math.abs(value);
              this.canvasRotate.width = width;
              this.canvasRotate.height = height;
              ctx.drawImage(img, dx, dy, width, height);
              base64 = this.canvasRotate.toDataURL("image/png");
            }
            break;
          case "flip":
            if (value) {
              this.canvasRotate.width = width;
              this.canvasRotate.height = height;
              dx = 0;
              dy = 0;
              ctx.translate(width, 0);
              ctx.scale(-1, 1);
              ctx.drawImage(img, dx, dy, width, height);
              base64 = this.canvasRotate.toDataURL("image/png");
            }
            break;
          default:
            break;
        }
        resolve(base64);
      };
      img.onerror = reject;
      img.src = base64origin;
    });
  }
  modifyImage(base64origin, rotate4, scale5, isFlip, infoId) {
    return new Promise((resolve, reject) => __async(this, null, function* () {
      try {
        let iconIndex = this.mapObj.cacheImageModifiedInfo.indexOf(infoId);
        if (iconIndex < 0) {
          if (this.mapObj.cacheImageModifiedInfoRequesting.indexOf(infoId) > -1) {
            const waitLoadingImage = setInterval(() => {
              iconIndex = this.mapObj.cacheImageModifiedInfo.indexOf(infoId);
              if (iconIndex > -1) {
                clearInterval(waitLoadingImage);
                resolve(true);
              }
            }, 200);
          } else {
            this.mapObj.cacheImageModifiedInfoRequesting.push(infoId);
            let base64Modified = base64origin;
            if (scale5 != 1) {
              base64Modified = yield this.modifyBase64Image(base64Modified, "scale", scale5);
            }
            if (isFlip) {
              base64Modified = yield this.modifyBase64Image(base64Modified, "flip", true);
            }
            if (rotate4 != 0) {
              base64Modified = yield this.modifyBase64Image(base64Modified, "rotate", rotate4);
            }
            this.mapObj.cacheImageModifiedInfoRequesting.splice(infoId);
            this.mapObj.cacheImageModifiedBase64.push(base64Modified);
            this.mapObj.cacheImageModifiedInfo.push(infoId);
            resolve(true);
          }
        } else {
          resolve(true);
        }
      } catch (err) {
        reject(err);
      }
    }));
  }
};
_SclMappingFunctionsService.\u0275fac = function SclMappingFunctionsService_Factory(t) {
  return new (t || _SclMappingFunctionsService)(\u0275\u0275inject(HttpClient), \u0275\u0275inject(SclSearchClientService2), \u0275\u0275inject(ChangeDetectorRef), \u0275\u0275inject(NotificationService2));
};
_SclMappingFunctionsService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMappingFunctionsService, factory: _SclMappingFunctionsService.\u0275fac, providedIn: "root" });
var SclMappingFunctionsService = _SclMappingFunctionsService;

// projects/formbird-sc-shared/src/lib/component-setup.service.ts
var _ComponentSetupService = class _ComponentSetupService {
  constructor() {
    this.formGroups = {};
  }
  setupStandardProperties(component) {
    const compDef = component.componentDefinition;
    if (compDef) {
      component.disabled = compDef.enabled === false;
    }
    component.elementName = component.fieldName;
    component.registeredControlName = component.fieldName + component.key;
  }
  /**
   * setup standard component variables. This can be called from the ngOnInit function of a component with:
   * this.componentService.setupStandardComponent(this);
   * @return the responsible control that holds the component value
   */
  setupStandardComponent(component, validators) {
    this.setupStandardProperties(component);
    const documentId = component.document.documentId;
    const formGroup = this.ensureFormGroupExisted(documentId);
    const compDef = component.componentDefinition;
    this.setupDefaultValidator(compDef, validators);
    const control = new UntypedFormControl({ value: component.fieldValue, disabled: this.isComponentDisabled(compDef) }, validators);
    return formGroup.registerControl(compDef.name + component.key, control);
  }
  setupControl(component, fieldName, fieldValue, validators) {
    const formGroup = this.ensureFormGroupExisted(component.document.documentId);
    const control = new UntypedFormControl(fieldValue, validators);
    return formGroup.registerControl(fieldName + component.key, control);
  }
  enableField(tplItem, formControl) {
    if (formControl) {
      if (tplItem.enabled === false) {
        formControl.disable({ emitEvent: false });
      } else {
        formControl.enable({ emitEvent: false });
      }
    }
  }
  enableFieldByFlag(enabled, formControl) {
    if (formControl) {
      if (enabled === false) {
        formControl.disable({ emitEvent: false });
      } else {
        formControl.enable({ emitEvent: false });
      }
    }
  }
  setupDefaultValidator(componentDefinition, validatorOpts) {
    validatorOpts = validatorOpts ? validatorOpts : [];
    if (componentDefinition.mandatory) {
      validatorOpts.push(Validators.required);
    }
  }
  isComponentDisabled(compDef) {
    return compDef.enabled === false;
  }
  ensureFormGroupExisted(documentId) {
    if (!this.formGroups[documentId]) {
      this.formGroups[documentId] = new UntypedFormGroup({});
    }
    return this.formGroups[documentId];
  }
  getControl(documentId, path) {
    if (this.formGroups[documentId]) {
      const formGroup = this.formGroups[documentId];
      return formGroup.get(path);
    }
    return null;
  }
};
_ComponentSetupService.\u0275fac = function ComponentSetupService_Factory(t) {
  return new (t || _ComponentSetupService)();
};
_ComponentSetupService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ComponentSetupService, factory: _ComponentSetupService.\u0275fac, providedIn: "root" });
var ComponentSetupService2 = _ComponentSetupService;

// projects/formbird-sc-shared/src/lib/components/abstract.component.ts
var MyErrorStateMatcher2 = class {
  isErrorState(control, form) {
    const isSubmitted = form && form.submitted;
    return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted));
  }
};
var _AbstractComponent = class _AbstractComponent {
  constructor(formbirdInjectorService2, changedDocumentService, componentSetupService, cdr) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.changedDocumentService = changedDocumentService;
    this.componentSetupService = componentSetupService;
    this.cdr = cdr;
    this.shouldNotifyCompInitializedInSuper = true;
    this.shouldDispatchEmptyFieldValue = true;
    this.subs = new Subscription();
    this.matcher = new MyErrorStateMatcher2();
    this.broadcastService = formbirdInjectorService2.get("BroadcastService");
  }
  ngOnInit() {
    this.setupComponent();
    this.initializeFieldValue();
    this.setupChangeDetection();
    if (this.shouldNotifyCompInitializedInSuper) {
      this.notifyComponentIntialized();
    }
  }
  ngOnDestroy() {
    this.subs.unsubscribe();
  }
  setupComponent() {
    this.formControl = this.componentSetupService.setupStandardComponent(this, this.validators);
    this.setFieldActivation(false);
  }
  setupChangeDetection(avoidDebounceTime) {
    if (this.fieldName) {
      const docSub = this.changedDocumentService.watch(this.fieldName, this.document.documentId, this.registeredControlName).subscribe((fieldValue) => {
        this.onFieldValueChanged(fieldValue);
      });
      this.subs.add(docSub);
    }
    const compSub = this.changedDocumentService.watchComponentDef(this.fieldName, this.template.documentId).subscribe((compDef) => {
      this.onComponentDefChanged(compDef);
    });
    this.subs.add(compSub);
    if (this.formControl) {
      let changeSub;
      if (avoidDebounceTime) {
        changeSub = this.formControl.valueChanges.subscribe((value) => {
          this.onControlValueChanged(value);
        });
      } else {
        changeSub = this.formControl.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
          this.onControlValueChanged(value);
        });
      }
      this.subs.add(changeSub);
    }
    this.setupDocumentCreatedDetection();
  }
  setFieldActivation(shouldDetectChanges) {
    this.componentSetupService.enableField(this.componentDefinition, this.formControl);
    this.detectChanges(shouldDetectChanges);
  }
  /**
   * Call this function to dispatch the field value change action to store
   */
  valueChanged(value) {
    this.fieldValue = value;
    this.changedDocumentService.valueChanged(this, value, this.registeredControlName);
  }
  /**
   * Call this function to set the field value into store. Param isInitValue is for initializing value and does not trigger undo/redo
   */
  dispatchChanged(isInitValue) {
    const documentId = this.document.documentId;
    const documentChangedInfo = {
      documentId,
      fieldName: this.fieldName,
      newValue: this.fieldValue,
      isInitValue
    };
    this.changedDocumentService.notifyDocumentChanged(documentChangedInfo);
  }
  detectChanges(shouldDetectChange) {
    if (shouldDetectChange !== false && !this.cdr.destroyed) {
      this.cdr.detectChanges();
    }
  }
  updateComponentDefChange(componentDefinition) {
    this.componentDefinition = componentDefinition;
  }
  /**
   * This function will be called once user interacts with the control that manages the field value in the component.
   */
  onControlValueChanged(value) {
    this.valueChanged(value);
  }
  /**
   * This function will be called once the template component definition in store gets changed.
   */
  onComponentDefChanged(componentDefinition) {
    console.log("Change detection on template: ", componentDefinition.name);
    this.updateComponentDefChange(componentDefinition);
    const disabled = componentDefinition.enabled === false;
    if (this.disabled !== disabled) {
      this.disabled = disabled;
      this.setFieldActivation();
    } else {
      this.detectChanges();
    }
  }
  /**
   * This function is used to compare the newValue to the component fieldValue to check if they are the same.
   * For most components, the field value is primary types (string, number, boolean...) but some complex ones the field value type is object so the component needs to override this function to check correctly.
   * @param newValue
   * @returns true if newValue equals to the component fieldValue
   */
  isEqualFieldValue(newValue) {
    return this.fieldValue === newValue;
  }
  /**
   * This function will be called once the field value in store gets changed.
   */
  onFieldValueChanged(fieldValue, shouldDetectChanges = true) {
    if (this.isEqualFieldValue(fieldValue)) {
      return;
    }
    console.log(`On field value changed for component: ${this.registeredControlName} - has label: ${this.componentDefinition["label"]}`);
    this.fieldValue = fieldValue;
    if (this.formControl) {
      this.formControl.patchValue(this.fieldValue, { emitEvent: false, onlySelf: true });
    }
    if (shouldDetectChanges) {
      this.detectChanges();
    }
  }
  setupDocumentCreatedDetection() {
    const docCreatedSub = this.broadcastService.on(ClientConstants.DOCUMENT_NEW).subscribe((documentInfo) => {
      this.onDocumentCreated(documentInfo);
      this.detectChanges();
    });
    this.subs.add(docCreatedSub);
  }
  /**
   * This function will be called to initialize field value such as: default value... once the New Document button's clicked to create a new document.
   * @param documentInfo includes documentId and unsavedDocumentListId
   */
  onDocumentCreated(documentInfo) {
    const document2 = documentInfo?.document;
    if (document2) {
      const unsavedDocumentListId = documentInfo?.unsavedDocumentListId;
      const documentId = document2.documentId;
      if (unsavedDocumentListId === this.formParameters.unsavedDocumentListId && this.document.documentId === documentId) {
        this.fieldValue = document2[this.fieldName];
        this.initializeFieldValue();
        this.notifyComponentIntialized();
      }
    }
  }
  /**
   * This function will initialize the field value including default value if needed
   */
  initializeFieldValue() {
  }
  /**
   * notify store the component has been initialized
   */
  notifyComponentIntialized() {
    this.changedDocumentService.notifyIntializedField(this, this.shouldDispatchEmptyFieldValue);
  }
  /**
   * Notify the component definition changes to store
   */
  notifyComponentDefChanged() {
  }
};
_AbstractComponent.\u0275fac = function AbstractComponent_Factory(t) {
  return new (t || _AbstractComponent)(\u0275\u0275directiveInject(FormbirdInjectorService), \u0275\u0275directiveInject(ChangedDocumentService), \u0275\u0275directiveInject(ComponentSetupService2), \u0275\u0275directiveInject(ChangeDetectorRef));
};
_AbstractComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _AbstractComponent, selectors: [["ng-component"]], inputs: { document: "document", fieldValue: "fieldValue", template: "template", fieldName: "fieldName", formParameters: "formParameters", key: "key", responsiveLayouts: "responsiveLayouts", message: "message", componentDefinition: "componentDefinition" }, decls: 0, vars: 0, template: function AbstractComponent_Template(rf, ctx) {
}, encapsulation: 2 });
var AbstractComponent2 = _AbstractComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(AbstractComponent2, { className: "AbstractComponent" });
})();

// projects/sc-street-address/src/app/street-address/street-address.component.ts
var import_lodash10 = __toESM(require_lodash());

// projects/formbird-mapping/src/lib/AddressDetails.ts
var AddressDetails = class {
  constructor() {
    this.properties = {};
    this.geometry = {};
    this.type = "Feature";
    this.properties = {
      type: "street",
      unitNo: "",
      streetNo: "",
      street: "",
      suburb: "",
      postcode: "",
      locationDescription: "",
      country: "",
      iconImage: "",
      iconSize: "",
      state: ""
    };
    this.geometry = {
      type: "Point",
      coordinates: []
    };
  }
};

// projects/formbird-mapping/src/lib/http.service.ts
var _HttpService = class _HttpService {
  constructor(http) {
    this.http = http;
  }
  // Handle API errors
  handleError(error3) {
    if (error3.error instanceof ErrorEvent) {
      console.error("An error occurred:", error3.error.message);
    } else {
      console.error(`Backend returned code ${error3.status}, body was: ${error3.error}`);
    }
    return throwError("Something bad happened; please try again later.");
  }
  errorHanlder(error3) {
    return throwError(error3.message || "Server Error");
  }
  // GET
  getAPI(link, variables, pHeaders) {
    const httpParams = new HttpParams();
    for (const field in variables) {
      if (variables.hasOwnProperty(field)) {
        httpParams.set(field, variables[field]);
      }
    }
    httpParams.set("responseType", "text");
    const options = { params: httpParams, headers: new HttpHeaders() };
    for (const field in pHeaders) {
      if (pHeaders.hasOwnProperty(field)) {
        options.headers = options.headers.set(field, pHeaders[field]);
      }
    }
    return this.http.get(link, options).pipe(retry(1), catchError(this.errorHanlder));
  }
  getHttpClient() {
    return this.http;
  }
};
_HttpService.\u0275fac = function HttpService_Factory(t) {
  return new (t || _HttpService)(\u0275\u0275inject(HttpClient));
};
_HttpService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _HttpService, factory: _HttpService.\u0275fac, providedIn: "root" });
var HttpService = _HttpService;

// projects/formbird-services/src/lib/services/config/config.service.ts
var _ConfigService = class _ConfigService {
  constructor() {
  }
  clientConfig() {
    return window["ftClientConfig"];
  }
};
_ConfigService.\u0275fac = function ConfigService_Factory(t) {
  return new (t || _ConfigService)();
};
_ConfigService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _ConfigService, factory: _ConfigService.\u0275fac, providedIn: "root" });
var ConfigService2 = _ConfigService;

// projects/formbird-mapping/src/lib/scl-map-geo-google.service.ts
var sclUtilMapService2 = new SclUtilMapService();
var googleMapLoaderService = new GoogleMapLoaderService();
var _SclMapGeoGoogleService = class _SclMapGeoGoogleService {
  constructor() {
    this.autocompleteUrl = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=";
    this.geocodeUrl = "https://maps.googleapis.com/maps/api/geocode/json?latlng=";
    this.googleLoader = null;
    this.waitTime = 5e3;
    this.loadLookup = false;
    this.intervalSetupLookUpCount = 0;
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    if (!this.apiKeyReverse) {
      this.apiKeyReverse = this.apiKey;
    }
    if (!this.apiKeyReverse) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("apiKey null");
      }
      return;
    }
    let link = this.geocodeUrl + coor[1] + "," + coor[0] + "&key=" + this.apiKeyReverse;
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data.status === "OK") {
        const datas = data.results[0];
        let streetData = new AddressDetails();
        streetData = sclUtilMapService2.fillGoogleAddress(datas, streetData);
        if (cb && typeof cb === "function") {
          cb(streetData, { lat: datas.geometry.location.lat, lng: datas.geometry.location.lng });
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          let errorMsg = "Google reverse Error";
          if (data !== null && data.error_message !== null) {
            errorMsg = data.error_message;
          }
          cbErr(errorMsg);
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Google reverse Error");
        }
      }
    });
  }
  setupLookUp() {
    const apiKey = this.apiKey;
    googleMapLoaderService.KEY = apiKey;
    googleMapLoaderService.LIBRARIES = "places,drawing,visualization";
    googleMapLoaderService.SENSOR = true;
    if (this.intervalSetupLookUp) {
      return;
    }
    this.intervalSetupLookUp = setInterval(() => {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
      if (this.autocompleteStreet) {
        clearInterval(this.intervalSetupLookUp);
        this.intervalSetupLookUp = null;
        this.intervalSetupLookUpCount = 0;
        googleMapLoaderService.load((google2) => {
          if (google2) {
            const autocompleteObj = new google2.maps.places.Autocomplete(this.autocompleteStreet, { types: ["geocode"] });
            google2.maps.event.addListener(autocompleteObj, "place_changed", () => {
              const place = autocompleteObj.getPlace();
              let streetData = new AddressDetails();
              streetData = sclUtilMapService2.fillGoogleAddress(place, streetData);
              if (this.cbSelectOption && typeof this.cbSelectOption === "function") {
                this.cbSelectOption(streetData);
              }
            });
          }
        }, (err) => {
          console.log(`**** LOAD GOOGLE MAP ERROR:`, err);
        });
      } else {
        this.intervalSetupLookUpCount++;
        if (this.intervalSetupLookUpCount > 11) {
          console.log("can't load google geo service because can't find autocomplete box");
          clearInterval(this.intervalSetupLookUp);
          this.intervalSetupLookUp = null;
          this.intervalSetupLookUpCount = 0;
        } else {
          console.log("waiting for autocomplete box loading..");
        }
      }
    }, 100);
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params invalid. [0] : autocompleteBox");
      }
      return;
    }
    if (this.apiKey == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("apiKey is null");
      }
      return;
    }
    if (this.googleLoader === null) {
      this.autocompleteBox = params[0];
      if (!this.loadLookup) {
        this.loadLookup = true;
        this.cbSelectOption = cbSelectOption;
        this.setupLookUp();
      }
    }
  }
  removeLookUp() {
    const id2 = this.initObj.keyName + "MapGeoGoogle";
    const lst = document.querySelectorAll("#" + id2);
    if (lst && lst.length > 0) {
      for (let i2 = 0; i2 < lst.length; i2++) {
        lst[i2].remove();
      }
    }
    this.autocompleteBox = null;
    this.googleLoader = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  getLinkOptions(link) {
    if (this.country) {
      link += "&country=" + this.country;
    }
    if (this.language) {
      link += "&lang=" + this.language;
    }
    return link;
  }
};
_SclMapGeoGoogleService.\u0275fac = function SclMapGeoGoogleService_Factory(t) {
  return new (t || _SclMapGeoGoogleService)();
};
_SclMapGeoGoogleService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoGoogleService, factory: _SclMapGeoGoogleService.\u0275fac, providedIn: "root" });
var SclMapGeoGoogleService = _SclMapGeoGoogleService;

// projects/formbird-mapping/src/lib/scl-map-geo-code-farm.service.ts
var _SclMapGeoCodeFarmService = class _SclMapGeoCodeFarmService {
  constructor() {
    this.autocompleteUrl = "https://www.geocode.farm/v3/json/forward/?addr=";
    this.geocodeUrl = "https://www.geocode.farm/v3/json/reverse/";
    this.apiKey = "a2338e05-e3cb425e93ad-109049bfb516";
    this.apiKeyReverse = "a2338e05-e3cb425e93ad-109049bfb516";
    this.waitTime = 5e3;
    this.preText = "";
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    let link = this.geocodeUrl + "?lat=" + coor[1] + "&lon=" + coor[0] + "&key=" + this.apiKeyReverse + "&count=1";
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.geocoding_results.STATUS.status === "SUCCESS") {
        const suggestions = data.geocoding_results.RESULTS[0];
        const address = suggestions.ADDRESS;
        const streetData = new AddressDetails();
        streetData.properties.streetNo = address.street_number;
        streetData.properties.street = address.street_name;
        streetData.properties.suburb = address.locality;
        streetData.properties.postcode = address.postal_code;
        streetData.properties.country = address.country;
        streetData.properties.state = address.admin_1;
        streetData.geometry.coordinates[0] = coor[0];
        streetData.geometry.coordinates[1] = coor[1];
        if (cb && typeof cb === "function") {
          cb(streetData, { lat: parseFloat(suggestions.COORDINATES.latitude), lng: parseFloat(suggestions.COORDINATES.longitude) });
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Codefarm reverse Error");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Codefarm reverse Error");
        }
      }
    });
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  removeLookUp() {
    const id2 = this.initObj.keyName + "MapGeoCodFarm";
    const lst = document.querySelectorAll("#" + id2);
    if (lst && lst.length > 0) {
      for (let i2 = 0; i2 < lst.length; i2++) {
        lst[i2].remove();
      }
    }
    this.autocompleteBox = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById("#" + this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  search(sPartialAddress, cb, cbErr, cbTimeout) {
    if (this.apiKey == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("apiKey is null");
      }
      return;
    }
    if (sPartialAddress == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("text is null");
      }
      return;
    }
    const results = [];
    const newText = sPartialAddress.trim();
    if (newText === this.preText) {
      if (cb && typeof cb === "function") {
        cb([]);
      }
      return;
    }
    this.preText = newText;
    if (newText.length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("text is less than 3 words");
      }
      return;
    }
    sPartialAddress += "&country=au&lang=en";
    let link = this.autocompleteUrl + sPartialAddress + "&key=" + this.apiKey;
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.geocoding_results && data.geocoding_results.STATUS.status === "SUCCESS") {
        const suggestions = data.geocoding_results.RESULTS;
        for (let i2 = 0; i2 < suggestions.length; i2++) {
          const predict = suggestions[i2];
          const sugg = {};
          sugg.street = predict.formatted_address;
          sugg.address = predict.ADDRESS;
          sugg.coordinates = predict.COORDINATES;
          results.push(sugg);
        }
        if (cb && typeof cb === "function") {
          cb(results);
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Codefarm lookup Error ");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Codefarm lookup Error ");
        }
      }
    });
  }
  selectionOption(tpl, model2, cb) {
    const address = tpl.address;
    const coordinates2 = tpl.coordinates;
    const obj = new AddressDetails();
    if (address.unitNo) {
      obj.properties.unitNo = address.unitNo;
    }
    obj.properties.streetNo = address.street_number;
    obj.properties.street = address.street_name;
    obj.properties.suburb = address.locality;
    obj.properties.postcode = address.postal_code;
    obj.properties.country = address.country;
    obj.properties.state = address.admin_1;
    const lat = parseFloat(coordinates2.latitude);
    const lon = parseFloat(coordinates2.longitude);
    obj.geometry.coordinates[0] = lon;
    obj.geometry.coordinates[1] = lat;
    if (cb && typeof cb === "function") {
      cb(obj);
    }
  }
  getLinkOptions(link) {
    if (this.country) {
      link += "&country=" + this.country;
    }
    if (this.language) {
      link += "&lang=" + this.language;
    }
    return link;
  }
};
_SclMapGeoCodeFarmService.\u0275fac = function SclMapGeoCodeFarmService_Factory(t) {
  return new (t || _SclMapGeoCodeFarmService)();
};
_SclMapGeoCodeFarmService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoCodeFarmService, factory: _SclMapGeoCodeFarmService.\u0275fac, providedIn: "root" });
var SclMapGeoCodeFarmService = _SclMapGeoCodeFarmService;

// projects/formbird-mapping/src/lib/scl-map-geo-here.service.ts
var _SclMapGeoHereService = class _SclMapGeoHereService {
  constructor() {
    this.autocompleteUrl = "https://geocoder.api.here.com/6.2/geocode.json";
    this.geocodeUrl = "https://reverse.geocoder.api.here.com/6.2/reversegeocode.json";
    this.appId = "UFP3Mq8ODsPalgiBwWVS";
    this.appCode = "8bZacaYx2CxDy1PUV3sN2w";
    this.waitTime = 5e3;
    this.radius = 50;
    this.preText = "";
    this.hasPrimaryAssetAddressLookup = false;
  }
  setSuburb(address) {
    const gotDistrict = address.Label.indexOf(address.District);
    const gotCity = address.Label.indexOf(address.City);
    if (gotDistrict >= 0 && gotCity >= 0) {
      if (gotDistrict < gotCity) {
        return address.City;
      } else {
        return address.District;
      }
    } else if (gotDistrict < 0) {
      return address.City;
    } else {
      return address.District;
    }
  }
  setupReverse(geo) {
    if (geo.radius) {
      this.radius = geo.radius;
    }
    if (geo.primaryAssetAddressLookupRadius) {
      this.primaryAssetAddressLookupRadius = geo.primaryAssetAddressLookupRadius;
    }
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    const lat = coor[1];
    const lon = coor[0];
    let radius = coor[2];
    if (this.hasPrimaryAssetAddressLookup === true) {
      radius = this.primaryAssetAddressLookupRadius;
    } else {
      radius = this.radius;
    }
    let link = this.geocodeUrl + "?app_id=" + this.appId + "&app_code=" + this.appCode + "&prox=" + lat + "," + lon + "," + radius + "&mode=retrieveAddresses&maxresults=1&gen=9";
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.Response && data.Response.View && data.Response.View.length > 0 && data.Response.View[0].Result && data.Response.View[0].Result.length > 0) {
        const suggestions = data.Response.View[0].Result[0];
        const address = suggestions.Location.Address;
        const streetData = new AddressDetails();
        streetData.properties.streetNo = address.HouseNumber;
        streetData.properties.street = address.Street;
        streetData.properties.suburb = this.setSuburb(address);
        streetData.properties.postcode = address.PostalCode;
        streetData.properties.country = address.Country;
        streetData.properties.state = address.State;
        streetData.geometry.coordinates[0] = lon;
        streetData.geometry.coordinates[1] = lat;
        if (cb && typeof cb === "function") {
          cb(streetData, {
            lat: suggestions.Location.DisplayPosition.Latitude,
            lng: suggestions.Location.DisplayPosition.Longitude
          });
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("here.com reverse address lookup Error");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("here.com reverse address lookup Error");
        }
      }
    });
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  removeLookUp() {
    const id2 = this.initObj.keyName + "MapGeoHere";
    const elem = document.getElementById(id2);
    if (elem) {
      elem.remove();
    }
    this.autocompleteBox = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  search(sPartialAddress, cb, cbErr, cbTimeout) {
    if (!this.appId) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("here.com address lookup: appId is null");
      }
      return;
    }
    if (!this.appCode) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("here.com address lookup: appCode is null");
      }
      return;
    }
    if (sPartialAddress == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("here.com address lookup: text is null");
      }
      return;
    }
    const results = [];
    const newText = sPartialAddress.trim();
    if (newText === this.preText) {
      if (cb && typeof cb === "function") {
        cb([]);
      }
      return;
    }
    this.preText = newText;
    if (newText.length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("here.com address lookup: text is less than 3 characters");
      }
      return;
    }
    let link = this.autocompleteUrl + "?app_id=" + this.appId + "&app_code=" + this.appCode + "&searchtext=" + sPartialAddress;
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.Response && data.Response.View && data.Response.View.length > 0) {
        const suggestions = data.Response.View[0].Result;
        for (let i2 = 0; i2 < suggestions.length; i2++) {
          const predict = suggestions[i2];
          const sugg = {};
          sugg.street = predict.Location.Address.Label;
          sugg.address = predict.Location.Address;
          sugg.coordinates = predict.Location.DisplayPosition;
          results.push(sugg);
        }
        if (cb && typeof cb === "function") {
          cb(results);
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("here.com address lookup Error ");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("here.com address lookup Error ");
        }
      }
    });
  }
  selectionOption(tpl, model2, cb) {
    const address = tpl.address;
    const coordinates2 = tpl.coordinates;
    const obj = new AddressDetails();
    obj.properties.streetNo = address.HouseNumber;
    obj.properties.street = address.Street;
    obj.properties.suburb = this.setSuburb(address);
    obj.properties.postcode = address.PostalCode;
    obj.properties.country = address.Country;
    obj.properties.state = address.State;
    const lat = parseFloat(coordinates2.Latitude);
    const lon = parseFloat(coordinates2.Longitude);
    obj.geometry.coordinates[0] = lon;
    obj.geometry.coordinates[1] = lat;
    if (cb && typeof cb === "function") {
      cb(obj);
    }
  }
  getLinkOptions(link) {
    if (this.state) {
      link += " " + this.state;
    }
    if (this.country) {
      link += " " + this.country;
    }
    return link;
  }
};
_SclMapGeoHereService.\u0275fac = function SclMapGeoHereService_Factory(t) {
  return new (t || _SclMapGeoHereService)();
};
_SclMapGeoHereService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoHereService, factory: _SclMapGeoHereService.\u0275fac, providedIn: "root" });
var SclMapGeoHereService = _SclMapGeoHereService;

// projects/formbird-mapping/src/lib/scl-map-geo-psma.service.ts
var _SclMapGeoPSMAService = class _SclMapGeoPSMAService {
  constructor(formbirdInjectorService2) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.autocompleteUrl = "https://api.psma.com.au/v1/predictive/address?query=";
    this.addressUrl = "https://api.psma.com.au/v1/predictive/address/";
    this.geocodeUrl = "https://api.psma.com.au/v1/addresses?radius=";
    this.geocodeUrlNext = "https://api.psma.com.au/v1/addresses/";
    this.apiKeyReverse = "z1mhEpstfwLdqzVTBAX1dkR5iVy6LaLq";
    this.waitTime = 5e3;
    this.reverseNoAddressIncrement = 0;
    this.reverseNoAddressRetry = 0;
    this.enableReverseRadiusDisplay = false;
    this.showReverseAddressPoint = 0;
    this.psmaRadius = 50;
    this.psmaHasStreetData = false;
    this.psmaAddressData = [];
    this.psmaAddressDetailUrl = "";
    this.dropPinSelectsAddres = false;
    this.reverseAddress = [];
    this.psmaPoints = [];
    this.psmaFinalRadius = 0;
    this.psmaOutOfRadius = [];
    this.psmaIndexAddress = -1;
    this.psmaCountGetGPS = 0;
    this.isFeatureRemoving = false;
    this.page = 1;
    this.callLookUp = false;
    this.preText = "";
    this.hasPrimaryAssetAddressLookup = false;
    this.notificationService = this.formbirdInjectorService.get("NotificationService");
  }
  setupReverse(geo) {
    if (geo.reverseNoAddressIncrement) {
      this.reverseNoAddressIncrement = geo.reverseNoAddressIncrement;
    }
    if (geo.reverseNoAddressRetry) {
      this.reverseNoAddressRetry = geo.reverseNoAddressRetry <= 0 ? 1 : geo.reverseNoAddressRetry + 1;
    }
    if (geo.enableReverseRadiusDisplay) {
      this.enableReverseRadiusDisplay = geo.enableReverseRadiusDisplay;
    }
    if (geo.showReverseAddressPoint) {
      this.showReverseAddressPoint = geo.showReverseAddressPoint;
    }
    if (geo.radius) {
      this.psmaRadius = geo.radius;
    }
    if (this.initObj.assetField.dropPinSelectsAddress && geo.dropPinSelectsAddress) {
      this.dropPinSelectsAddress = this.initObj.assetField.dropPinSelectsAddress;
    } else if (geo.addressDetailUrl) {
      this.psmaAddressDetailUrl = geo.addressDetailUrl;
    }
    if (geo.primaryAssetAddressLookupRadius) {
      this.primaryAssetAddressLookupRadius = geo.primaryAssetAddressLookupRadius;
    }
    this.count = this.reverseNoAddressRetry <= 0 ? 1 : this.reverseNoAddressRetry;
    this.reverseAddress = [];
    this.psmaFinalRadius = 0;
    this.psmaOutOfRadius = [];
    this.psmaIndexAddress = -1;
    this.psmaCountGetGPS = 0;
    this.isFeatureRemoving = false;
    this.psmaHasStreetData = false;
    this.psmaAddressData = [];
    this.callLookUp = false;
  }
  verifyObj(addressDetails) {
    const isNull = (strVal) => {
      if (!strVal || strVal === "null") {
        return false;
      } else {
        return true;
      }
    };
    const processData = {};
    processData.street_type = !isNull(addressDetails.streetType) ? "" : addressDetails.streetType;
    processData.street_suffix = !isNull(addressDetails.streetSuffix) ? "" : addressDetails.streetSuffix;
    processData.street_type_description = !isNull(addressDetails.streetTypeDescription) ? "" : addressDetails.streetTypeDescription;
    processData.street_number_2 = !isNull(addressDetails.streetNumber2) ? "" : addressDetails.streetNumber2;
    processData.unit_no = !isNull(addressDetails.complexUnitIdentifier) ? "" : addressDetails.complexUnitIdentifier;
    processData.complex_unit_type = !isNull(addressDetails.complexUnitType) ? "" : addressDetails.complexUnitType;
    processData.complex_level_type = !isNull(addressDetails.complexLevelType) ? "" : addressDetails.complexLevelType;
    processData.complex_level_number = !isNull(addressDetails.complexLevelNumber) ? "" : addressDetails.complexLevelNumber;
    processData.street_number_1 = !isNull(addressDetails.streetNumber1) ? "" : addressDetails.streetNumber1;
    processData.street_name = !isNull(addressDetails.streetName) ? "" : addressDetails.streetName;
    processData.locality_name = !isNull(addressDetails.localityName) ? "" : addressDetails.localityName;
    processData.postcode = !isNull(addressDetails.postcode) ? "" : addressDetails.postcode;
    processData.state_territory = !isNull(addressDetails.stateTerritory) ? "" : addressDetails.stateTerritory;
    processData.site_name = !isNull(addressDetails.siteName) ? "" : addressDetails.siteName;
    return processData;
  }
  updateStreetData(coor, addressData) {
    const streetData = new AddressDetails();
    streetData.properties.unitNo = addressData.unit_no;
    streetData.properties.streetNo = addressData.street_number_1 + (addressData.street_number_2 === "" ? "" : "-" + addressData.street_number_2).trim();
    streetData.properties.street = (addressData.street_name + " " + (addressData.street_type_description === "" ? addressData.street_type : addressData.street_type_description) + " " + (addressData.street_suffix === "" ? "" : addressData.street_suffix)).trim();
    streetData.properties.suburb = addressData.locality_name;
    streetData.properties.postcode = addressData.postcode;
    streetData.properties.state = addressData.state_territory;
    if (addressData.site_name) {
      streetData.properties.locationDescription = addressData.site_name;
    }
    if (addressData.complex_unit_type) {
      (streetData.properties.locationDescription += "\n" + addressData.complex_unit_type + " " + addressData.unit_no).trim();
    }
    if (addressData.complex_level_type) {
      (streetData.properties.locationDescription += "\n" + addressData.complex_level_type + " " + addressData.complex_level_number).trim();
    }
    if (coor != null) {
      streetData.geometry.coordinates[0] = coor[0];
      streetData.geometry.coordinates[1] = coor[1];
    }
    return streetData;
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    const lon = coor[0];
    const lat = coor[1];
    const radius = coor[2];
    if (coor.length < 4) {
      coor[3] = this.reverseNoAddressRetry <= 0 ? 1 : this.reverseNoAddressRetry;
    }
    const count = coor[3];
    const self2 = this;
    self2.lat = lat;
    self2.lon = lon;
    self2.count = count;
    self2.radius = 1;
    if (this.hasPrimaryAssetAddressLookup === true) {
      self2.radius = this.primaryAssetAddressLookupRadius;
    } else {
      self2.radius = radius;
    }
    if (this.enableReverseRadiusDisplay) {
      this.createLayer();
      this.removeFeatures(false);
    }
    for (let i2 = 0; i2 < this.psmaOutOfRadius.length; i2++) {
      const item = this.psmaOutOfRadius[i2];
      if (item.distance <= this.psmaFinalRadius) {
        this.createPoint(item.coor, item.index, item.distance);
      }
    }
    this.psmaOutOfRadius = [];
    if (this.enableReverseRadiusDisplay) {
      self2.createPointClick([self2.lon, self2.lat], self2.radius);
    }
    const reverseAddressText = [];
    const link = this.geocodeUrl + self2.radius + "&latLong=" + self2.lat + "," + self2.lon + "&page=" + this.page;
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }, { Authorization: this.apiKeyReverse }).subscribe((result) => {
      if (self2.callLookUp) {
        return;
      }
      const resData = result.data;
      if (resData) {
        if (resData.length > 0) {
          for (let i2 = 0; i2 < resData.length; i2++) {
            const item = resData[i2];
            if (item.addressId && self2.reverseAddress.indexOf(item.addressId) === -1) {
              self2.reverseAddress.push(item.addressId);
              reverseAddressText.push(item.formattedAddress);
            }
          }
          if (self2.psmaIndexAddress === -1) {
            self2.psmaIndexAddress = 1;
          }
          self2.psmaReversItem(resData[0].addressId, resData[0].formattedAddress, 1, [self2.lon, self2.lat], self2.radius, self2.count, self2.page, (function(pRadius, obj, addressDetails) {
            let finalRadius = 0;
            if (self2.hasPrimaryAssetAddressLookup === true) {
              finalRadius = self2.primaryAssetAddressLookupRadius;
            } else {
              finalRadius = (self2.psmaRadius < 1 ? 1 : self2.psmaRadius) + self2.reverseNoAddressIncrement * self2.reverseNoAddressRetry;
              if (finalRadius > 100) {
                finalRadius = 100;
              }
            }
            const verifiedObj = this.verifyObj(addressDetails);
            if (obj.distance <= finalRadius && obj.index === 1 && self2.psmaHasStreetData === false) {
              self2.psmaHasStreetData = true;
              const streetData = this.updateStreetData(self2.dropPinSelectsAddress === true ? obj.coor : coor, verifiedObj);
              if (cb && typeof cb === "function") {
                cb(streetData, { lat: obj.coor[1], lng: obj.coor[0] });
              }
            } else if (obj.distance > finalRadius && obj.index === 1 && self2.psmaHasStreetData === false && self2.count === 1) {
              let minDistance = obj.distance;
              let idx = obj.index;
              for (let i2 = 0; i2 < self2.psmaAddressData.length; i2++) {
                const item = self2.psmaAddressData[i2];
                if (minDistance > item.obj.distance) {
                  minDistance = item.obj.distance;
                  idx = obj.index;
                }
              }
              if (minDistance > finalRadius) {
                this.notificationService.warning("No address could be determined " + finalRadius + " metres from that point. Please try a different point, if you need an address.");
                if (cbErr && typeof cbErr === "function") {
                  cbErr();
                }
              } else {
                self2.psmaHasStreetData = true;
                addressDetails = self2.psmaAddressData[idx].addressDetails;
                const streetData = this.updateStreetData(self2.dropPinSelectsAddress === true ? obj.coor : null, verifiedObj);
                if (cb && typeof cb === "function") {
                  cb(streetData, { lat: obj.coor[1], lng: obj.coor[0] });
                }
              }
            }
          }).bind(this), () => {
            console.log("***** PSMA error undefined");
          });
          let allowDraw = false;
          if (self2.enableReverseRadiusDisplay) {
            if (self2.reverseAddress.length > self2.showReverseAddressPoint) {
              for (let i2 = self2.reverseAddress.length - 1; i2 > self2.showReverseAddressPoint - 1; --i2) {
                self2.reverseAddress.splice(i2, 1);
              }
              allowDraw = true;
            } else if (self2.reverseAddress.length < self2.showReverseAddressPoint && result.data && result.data.links && result.data.links.next) {
              self2.page++;
              self2.reverse([self2.lon, self2.lat, self2.radius, self2.count], cb, cbErr, cbTimeout);
              allowDraw = false;
            } else {
              allowDraw = true;
            }
          }
          if (allowDraw) {
            for (let i2 = 0; i2 < self2.reverseAddress.length; ++i2) {
              self2.psmaIndexAddress++;
              self2.psmaReversItem(self2.reverseAddress[i2], reverseAddressText[i2], self2.psmaIndexAddress, [self2.lon, self2.lat], self2.radius, self2.count, self2.page, (function(radius1, obj, addressDetails) {
                let idx = self2.psmaOutOfRadius.findIndex((item) => item.addressId === obj.addressId);
                if (obj.distance > radius1) {
                  if (idx < 0) {
                    self2.psmaOutOfRadius.push(obj);
                  }
                } else {
                  self2.createPoint(obj.coor, obj.index, obj.distance);
                }
                if (self2.psmaOutOfRadius.length === self2.reverseAddress.length && self2.count > 1) {
                  self2.count--;
                  self2.radius += self2.reverseNoAddressIncrement;
                  if (self2.radius > 100) {
                    self2.radius = 100;
                  }
                  self2.reverse([self2.lon, self2.lat, self2.radius, self2.count], cb, cbErr, cbTimeout);
                }
                idx = self2.psmaAddressData.findIndex((item) => item.obj.addressId === obj.addressId);
                if (idx < 0) {
                  self2.psmaAddressData.push({ obj, addressDetails });
                }
              }).bind(this), () => {
                console.log("***** PSMA error undefined");
              });
            }
          }
        } else if (self2.count > 1) {
          self2.radius += self2.reverseNoAddressIncrement;
          if (self2.radius > 100) {
            self2.radius = 100;
          }
          self2.count -= 1;
          self2.reverse([self2.lon, self2.lat, self2.radius, self2.count], cb, cbErr, cbTimeout);
        } else {
          let finalRadius = 0;
          if (self2.hasPrimaryAssetAddressLookup === true) {
            finalRadius = self2.primaryAssetAddressLookupRadius;
          } else {
            finalRadius = (self2.psmaRadius < 1 ? 1 : self2.psmaRadius) + self2.reverseNoAddressIncrement * self2.reverseNoAddressRetry;
            if (finalRadius > 100) {
              finalRadius = 100;
            }
          }
          this.notificationService.warning("No address could be determined " + finalRadius + " metres from that point. Please try a different point, if you need an address.");
          if (cbErr && typeof cbErr === "function") {
            cbErr();
          }
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PSMA reverse Error ");
        }
      }
    }, (error3) => {
      if (error3.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PSMA reverse Error " + error3);
        }
      }
    });
  }
  // new reverseItem function
  psmaReversItem(addressId, formattedAddress, index, coorCenter, radius, count, page, cb, cbErr) {
    const link = this.geocodeUrlNext + addressId + "/?include=geo,addressDetails";
    const self2 = this;
    this.initObj.httpService.getAPI(link, null, { Authorization: this.apiKeyReverse }).subscribe((dataResult) => {
      if (self2.callLookUp) {
        return;
      }
      if (dataResult && dataResult.geo) {
        const coor = dataResult.geo.geometry.coordinates;
        let distance2 = 0;
        distance2 = getDistance(coor, coorCenter);
        console.log("addressId = " + addressId + "\n	 - address text = " + formattedAddress + "\n	 - distance = " + distance2 + "\n	 - radius = " + radius + "\n	 - coor = " + coor + "\n	 - coorCenter = " + coorCenter);
        const obj = { coor, index, distance: distance2, addressId: dataResult.addressId };
        if (cb && typeof cb === "function") {
          cb(radius, obj, dataResult.addressDetails);
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PSMA reverse Item Error ");
        }
      }
    }, (error3) => {
      if (cbErr && typeof cbErr === "function") {
        cbErr("PSMA reverse Error " + error3);
      }
    });
  }
  psmaStyleFunction(feature, resolution) {
    if (typeof feature !== "object" || typeof feature.getProperties() === "undefined") {
      return null;
    }
    const description = feature.getProperties().description;
    const label = typeof description === "undefined" || description === null ? "" : description + "";
    const style2 = new Style_default({
      fill: new Fill_default({
        color: "rgba(255,255,255,0.4)"
      }),
      stroke: new Stroke_default({
        color: "#3399CC",
        width: 1.25
      }),
      text: new Text_default({
        font: "12px Arial",
        fill: new Fill_default({ color: "#000" }),
        stroke: new Stroke_default({
          color: "#fff",
          width: 2
        }),
        textBaseline: "top",
        // get the text from the feature - `this` is ol.Feature
        // and show only under certain resolution
        text: label
      }),
      image: new Circle_default({
        radius: 3,
        fill: new Fill_default({
          color: [255, 127, 39, 1]
        }),
        stroke: new Stroke_default({
          color: [255, 0, 0, 1],
          width: 1.5
        })
      }),
      zIndex: 1e4
    });
    return style2;
  }
  createLayer() {
    if (typeof this.initObj.mapFunc === "undefined" || this.initObj.mapFunc === null) {
      if (this.map == null) {
        console.log("Error create layer vector for openlayer map, map variable is null value, need to assign map variable");
        return;
      }
      if (this.psmaSourceVector == null) {
        this.psmaSourceVector = new Vector_default2({ features: this.psmaPoints });
      }
      if (this.psmaLayer == null) {
        const option = {
          title: "PSMA",
          // not support 6.15.1
          visible: true,
          source: this.psmaSourceVector,
          style: this.psmaStyleFunction
        };
        this.psmaLayer = new Vector_default(option);
      } else {
        this.map.removeLayer(this.psmaLayer);
      }
      this.map.addLayer(this.psmaLayer);
    } else {
      const obj = this.initObj.mapFunc.mapObj.psmaCreateLayer(this.psmaPoints);
      this.psmaSourceVector = obj.psmaSourceVector;
      this.psmaLayer = obj.psmaLayer;
    }
  }
  createPoint(coor, index, distance2) {
    if (this.isFeatureRemoving || this.callLookUp) {
      return;
    }
    const des = index + 1 + "";
    const properties2 = { description: des, coor };
    if (!this.psmaPoints) {
      this.psmaPoints = [];
    }
    if (typeof this.initObj.mapFunc === "undefined" || this.initObj.mapFunc === null) {
      const coorMap = transform(coor, "EPSG:4326", this.EPSG);
      const iconFeature = new Feature_default2(new Point_default(coorMap));
      iconFeature.setProperties(properties2);
      this.psmaPoints.push(iconFeature);
      this.psmaSourceVector.addFeature(iconFeature);
    } else {
      this.psmaPoints = this.initObj.mapFunc.mapObj.psmaCreatePoint(coor, properties2, this.psmaPoints);
    }
  }
  createPointClick(coor, radius) {
    if (this.isFeatureRemoving || this.callLookUp) {
      return;
    }
    if (!this.psmaPoints) {
      this.psmaPoints = [];
    }
    if (typeof this.initObj.mapFunc === "undefined" || this.initObj.mapFunc === null) {
      const circle4326 = circular(coor, radius);
      const circle3857 = circle4326.clone().transform("EPSG:4326", this.EPSG);
      const clickFeature = new Feature_default2(circle3857);
      this.psmaPoints.push(clickFeature);
      this.psmaSourceVector.addFeature(clickFeature);
    } else {
      this.psmaPoints = this.initObj.mapFunc.mapObj.psmaCreatePointClick(coor, radius, this.psmaPoints);
    }
  }
  removeFeatures(isRemove) {
    if (this.psmaPoints == null) {
      this.psmaPoints = [];
      return;
    }
    const obj = this.initObj.mapFunc.mapObj.psmaRemovePoint(this.psmaPoints, this.psmaSourceVector);
    this.psmaPoints = obj.psmaPoints;
    this.psmaSourceVector = obj.psmaSourceVector;
    this.psmaPoints = [];
    this.isFeatureRemoving = isRemove;
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    this.callLookUp = true;
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  removeLookUp() {
    const id2 = this.initObj.keyName + "MapGeoPSMA";
    const lst = document.querySelectorAll("#" + id2);
    if (lst && lst.length > 0) {
      for (let i2 = 0; i2 < lst.length; i2++) {
        lst[i2].remove();
      }
    }
    this.autocompleteBox = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (this.psmaPoints && this.psmaPoints.length > 0) {
      if (!this.psmaSourceVector) {
        const obj = this.initObj.mapFunc.mapObj.psmaCreateLayer(this.psmaPoints);
        this.psmaSourceVector = obj.psmaSourceVector;
      }
      this.psmaSourceVector.clear();
    }
    this.removeFeatures(true);
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  search(sPartialAddress, cb, cbErr, cbTimeout) {
    if (this.apiKey == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma address lookup: apiKey is null");
      }
      return;
    }
    if (sPartialAddress == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma address lookup: text is null");
      }
      return;
    }
    this.callLookUp = true;
    const newText = sPartialAddress.trim();
    if (newText === this.preText) {
      if (cb && typeof cb === "function") {
        cb(null);
      }
      return;
    }
    this.preText = newText;
    if (newText.length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma address lookup: text is less than 3 characters");
      }
      return;
    }
    let link = this.autocompleteUrl + sPartialAddress;
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }, { Authorization: this.apiKey }).subscribe((dataResult) => {
      if (dataResult && dataResult.suggest) {
        const suggestions = dataResult.suggest;
        const results = [];
        for (let i2 = 0; i2 < suggestions.length; i2++) {
          const predict = suggestions[i2];
          const sugg = {};
          sugg.street = predict.address;
          sugg.id = predict.id;
          results.push(sugg);
        }
        if (cb && typeof cb === "function") {
          cb(results);
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PSMA reverse Error ");
        }
      }
    }, (error3) => {
      if (error3.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PSMA Address Matching Error " + error3);
        }
      }
    });
  }
  selectionOption(tpl, model2, cb) {
    const link = this.addressUrl + tpl.id;
    this.callLookUp = true;
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }, { Authorization: this.apiKey }).subscribe((dataResult) => {
      if (dataResult != null && dataResult.address) {
        const obj = new AddressDetails();
        const properties2 = dataResult.address.properties;
        if (properties2.site_name) {
          obj.properties.locationDescription = properties2.site_name;
        }
        if (properties2.complex_unit_identifier) {
          obj.properties.unitNo = properties2.complex_unit_identifier;
          if (obj.properties.locationDescription) {
            obj.properties.locationDescription += "\n";
          }
          obj.properties.locationDescription += ((properties2.complex_unit_type_description ? properties2.complex_unit_type_description : properties2.complex_unit_type ? properties2.complex_unit_type : "") + " " + properties2.complex_unit_identifier).trim();
        }
        if (properties2.complex_level_number) {
          if (obj.properties.locationDescription) {
            obj.properties.locationDescription += "\n";
          }
          obj.properties.locationDescription += ((properties2.complex_level_type_description ? properties2.complex_level_type_description : properties2.complex_level_type ? properties2.complex_level_type : "") + " " + properties2.complex_level_number).trim();
        }
        obj.properties.locationDescription.trim();
        obj.properties.streetNo = properties2.street_number_1;
        if (typeof properties2.street_number_2 !== "undefined" && properties2.street_number_2 != null && properties2.street_number_2 !== "null" && properties2.street_number_2 !== "") {
          obj.properties.streetNo = obj.properties.streetNo + "-" + properties2.street_number_2;
        }
        let streetType = "";
        if (typeof properties2.street_type_description !== "undefined" && properties2.street_type_description !== null && properties2.street_type_description !== "null" && properties2.street_type_description !== "") {
          streetType = properties2.street_type_description;
        } else if (typeof properties2.street_type !== "undefined" && properties2.street_type !== null && properties2.street_type !== "null" && properties2.street_type !== "") {
          streetType = properties2.street_type;
        }
        obj.properties.street = (properties2.street_name + " " + streetType).trim();
        if (typeof properties2.street_suffix !== "undefined" && properties2.street_suffix !== null && properties2.street_suffix !== "null" && properties2.street_suffix !== "") {
          obj.properties.street = obj.properties.street + " " + properties2.street_suffix;
        }
        obj.properties.suburb = properties2.locality_name;
        obj.properties.postcode = properties2.postcode;
        obj.properties.state = properties2.state_territory;
        const lat = dataResult.address.geometry.coordinates[1];
        const lon = dataResult.address.geometry.coordinates[0];
        obj.geometry.coordinates[0] = lon;
        obj.geometry.coordinates[1] = lat;
        if (cb && typeof cb === "function") {
          cb(obj);
        }
      } else {
        if (cb && typeof cb === "function") {
          cb("PSMA reverse Error ");
        }
      }
    });
  }
  getLinkOptions(link) {
    if (this.state) {
      link += "&stateTerritory=" + this.state;
    }
    return link;
  }
};
_SclMapGeoPSMAService.\u0275fac = function SclMapGeoPSMAService_Factory(t) {
  return new (t || _SclMapGeoPSMAService)(\u0275\u0275inject(FormbirdInjectorService));
};
_SclMapGeoPSMAService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoPSMAService, factory: _SclMapGeoPSMAService.\u0275fac, providedIn: "root" });
var SclMapGeoPSMAService = _SclMapGeoPSMAService;

// projects/formbird-mapping/src/lib/scl-map-geo-psma-farm.service.ts
var _SclMapGeoPsmaFarmService = class _SclMapGeoPsmaFarmService {
  constructor() {
    this.preText = "";
    this.apiKey = "lGD0Y7HDCc6g1f6wkMZYQWHDlvMTy9ua";
    this.apiKeyReverse = "a2338e05-e3cb425e93ad-109049bfb516";
    this.waitTime = 5e3;
    this.autocompleteUrl = "https://api.psma.com.au/predictive/address?query=";
    this.addressUrl = "https://api.psma.com.au/predictive/address/";
    this.geocodeUrl = "https://www.geocode.farm/v3/json/reverse/";
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    let link = this.geocodeUrl + "?lat=" + coor[1] + "&lon=" + coor[0] + "&key=" + this.apiKeyReverse + "&count=1";
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.geocoding_results.STATUS.status === "SUCCESS") {
        const suggestions = data.geocoding_results.RESULTS[0];
        const address = suggestions.ADDRESS;
        const streetData = new AddressDetails();
        streetData.properties.streetNo = address.street_number;
        streetData.properties.street = address.street_name;
        streetData.properties.suburb = address.locality;
        streetData.properties.postcode = address.postal_code;
        streetData.properties.country = address.country;
        streetData.properties.state = address.admin_1;
        streetData.geometry.coordinates[0] = coor[0];
        streetData.geometry.coordinates[1] = coor[1];
        if (cb && typeof cb === "function") {
          cb(streetData, { lat: parseFloat(suggestions.COORDINATES.latitude), lng: parseFloat(suggestions.COORDINATES.longitude) });
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PsmaFarm reverse Error");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PsmaFarm reverse Error");
        }
      }
    });
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  search(sPartialAddress, cb, cbErr, cbTimeout) {
    if (this.apiKey == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma-farm address lookup: apiKey is null");
      }
      return;
    }
    if (sPartialAddress == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma-farm address lookup: text is null");
      }
      return;
    }
    const newText = sPartialAddress.trim();
    if (newText === this.preText) {
      if (cb && typeof cb === "function") {
        cb(null);
      }
      return;
    }
    this.preText = newText;
    if (newText.length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("psma-farm address lookup: text is less than 3 characters");
      }
      return;
    }
    const link = this.autocompleteUrl + sPartialAddress;
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }, { Authorization: this.apiKey }).subscribe((dataResult) => {
      if (dataResult && dataResult.suggest) {
        const suggestions = dataResult.suggest;
        const results = [];
        for (let i2 = 0; i2 < suggestions.length; i2++) {
          const predict = suggestions[i2];
          const sugg = {};
          sugg.street = predict.address;
          sugg.id = predict.id;
          results.push(sugg);
        }
        if (cb && typeof cb === "function") {
          cb(results);
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PsmaFarm lookup Error ");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("PsmaFarm lookup Error ");
        }
      }
    });
  }
  selectionOption(tpl, model2, cb) {
    const link = this.addressUrl + tpl.id;
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }, { Authorization: this.apiKey }).subscribe((dataResult) => {
      if (dataResult != null && dataResult.address) {
        const obj = new AddressDetails();
        const properties2 = dataResult.address.properties;
        if (properties2.site_name) {
          obj.properties.locationDescription = properties2.site_name;
        }
        if (properties2.complex_unit_identifier) {
          obj.properties.unitNo = properties2.complex_unit_identifier;
          if (obj.properties.locationDescription) {
            obj.properties.locationDescription += "\n";
          }
          obj.properties.locationDescription += ((properties2.complex_unit_type_description ? properties2.complex_unit_type_description : properties2.complex_unit_type ? properties2.complex_unit_type : "") + " " + properties2.complex_unit_identifier).trim();
        }
        if (properties2.complex_level_number) {
          if (obj.properties.locationDescription) {
            obj.properties.locationDescription += "\n";
          }
          obj.properties.locationDescription += ((properties2.complex_level_type_description ? properties2.complex_level_type_description : properties2.complex_level_type ? properties2.complex_level_type : "") + " " + properties2.complex_level_number).trim();
        }
        obj.properties.locationDescription.trim();
        obj.properties.streetNo = properties2.street_number_1;
        if (typeof properties2.street_number_2 !== "undefined" && properties2.street_number_2 !== null && properties2.street_number_2 !== "null" && properties2.street_number_2 !== "") {
          obj.properties.streetNo = obj.properties.streetNo + "-" + properties2.street_number_2;
        }
        let streetType = "";
        if (typeof properties2.street_type_description !== "undefined" && properties2.street_type_description !== null && properties2.street_type_description !== "null" && properties2.street_type_description !== "") {
          streetType = properties2.street_type_description;
        } else if (typeof properties2.street_type !== "undefined" && properties2.street_type !== null && properties2.street_type !== "null" && properties2.street_type !== "") {
          streetType = properties2.street_type;
        }
        obj.properties.street = (properties2.street_name + " " + streetType).trim();
        if (typeof properties2.street_suffix !== "undefined" && properties2.street_suffix !== null && properties2.street_suffix !== "null" && properties2.street_suffix !== "") {
          obj.properties.street = obj.properties.street + " " + properties2.street_suffix;
        }
        obj.properties.suburb = properties2.locality_name;
        obj.properties.postcode = properties2.postcode;
        obj.properties.state = properties2.state_territory;
        const lat = dataResult.address.geometry.coordinates[1];
        const lon = dataResult.address.geometry.coordinates[0];
        obj.geometry.coordinates[0] = lon;
        obj.geometry.coordinates[1] = lat;
        if (cb && typeof cb === "function") {
          cb(obj);
        }
      }
    });
  }
  getLinkOptions(link) {
    if (this.country) {
      link += "&country=" + this.country;
    }
    if (this.language) {
      link += "&lang=" + this.language;
    }
    return link;
  }
  removeFeatures(isRemove) {
    if (this.psmaPoints == null) {
      this.psmaPoints = [];
      return;
    }
    const obj = this.initObj.mapFunc.mapObj.psmaRemovePoint(this.psmaPoints, this.psmaSourceVector);
    this.psmaPoints = obj.psmaPoints;
    this.psmaSourceVector = obj.psmaSourceVector;
    this.psmaPoints = [];
    this.isFeatureRemoving = isRemove;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (this.psmaPoints && this.psmaPoints.length > 0) {
      if (!this.psmaSourceVector) {
        const obj = this.initObj.mapFunc.mapObj.psmaCreateLayer(this.psmaPoints);
        this.psmaSourceVector = obj.psmaSourceVector;
      }
      this.psmaSourceVector.clear();
    }
    this.removeFeatures(true);
    if (cb && typeof cb === "function") {
      cb();
    }
  }
};
_SclMapGeoPsmaFarmService.\u0275fac = function SclMapGeoPsmaFarmService_Factory(t) {
  return new (t || _SclMapGeoPsmaFarmService)();
};
_SclMapGeoPsmaFarmService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoPsmaFarmService, factory: _SclMapGeoPsmaFarmService.\u0275fac, providedIn: "root" });
var SclMapGeoPsmaFarmService = _SclMapGeoPsmaFarmService;

// projects/formbird-mapping/src/lib/scl-map-geo-vicmap.service.ts
var _SclMapGeoVicmapService = class _SclMapGeoVicmapService {
  constructor() {
    this.autocompleteUrl = "https://api.maps.vic.gov.au/vicmapapi/map/addressSearch?jsoncallback=data&format=json&addressLine=";
    this.geocodeUrl = "https://www.geocode.farm/v3/json/reverse/";
    this.apiKeyReverse = "a2338e05-e3cb425e93ad-109049bfb516";
    this.geocoderDefaultCountry = "Australia";
    this.geocoderDefaultState = "VIC";
    this.waitTime = 5e3;
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    let link = this.geocodeUrl + "?lat=" + coor[1] + "&lon=" + coor[0] + "&key=" + this.apiKeyReverse + "&count=1";
    link = this.getLinkOptions(link);
    this.initObj.httpService.getAPI(link, { timeout: this.waitTime }).subscribe((data) => {
      if (data && data.geocoding_results.STATUS.status === "SUCCESS") {
        const suggestions = data.geocoding_results.RESULTS[0];
        const address = suggestions.ADDRESS;
        const streetData = new AddressDetails();
        streetData.properties.streetNo = address.street_number;
        streetData.properties.street = address.street_name;
        streetData.properties.suburb = address.locality;
        streetData.properties.postcode = address.postal_code;
        streetData.properties.country = address.country;
        streetData.properties.state = address.admin_1;
        streetData.geometry.coordinates[0] = coor[0];
        streetData.geometry.coordinates[1] = coor[1];
        if (cb && typeof cb === "function") {
          cb(streetData, { lat: parseFloat(suggestions.COORDINATES.latitude), lng: parseFloat(suggestions.COORDINATES.longitude) });
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Vicmap reverse Error");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Vicmap reverse Error");
        }
      }
    });
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout) {
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  removeLookUpfunction() {
    const id2 = this.initObj.keyName + "MapGeoVicmap";
    const lst = document.querySelectorAll("#" + id2);
    if (lst && lst.length > 0) {
      for (let i2 = 0; i2 < lst.length; i2++) {
        lst[i2].remove();
      }
    }
    this.autocompleteBox = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  search(sPartialAddress, cb, cbErr, cbTimeout) {
    if (sPartialAddress == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("vicmap address lookup: text is null");
      }
      return;
    }
    if (sPartialAddress.trim().length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("vicmap address lookup: text is less than 3 characters");
      }
      return;
    }
    const link = this.autocompleteUrl + sPartialAddress.trim() + ", " + this.geocoderDefaultState + ", " + this.geocoderDefaultCountry;
    const options = {
      responseType: "text",
      timeout: this.waitTime
    };
    const httpClient = this.initObj.httpService.getHttpClient();
    httpClient.get(link, options).subscribe((addressResponse) => {
      if (addressResponse == null) {
        if (cbErr && typeof cbErr === "function") {
          cbErr("null data");
        }
        return;
      }
      addressResponse = addressResponse.replace("?(", "");
      addressResponse = addressResponse.substring(0, addressResponse.length - 2);
      const results = JSON.parse(addressResponse);
      const result = results.requestResult.result;
      if (result) {
        const results1 = [];
        for (let k = 0; k < result.length; k++) {
          const r = result[k];
          const p = r.address;
          for (let f = 0; f < p.length; f++) {
            const address = p[f];
            const sugg = {};
            sugg.street = address.addressLine;
            const res = address.pos[0].split(",");
            sugg.coordinates = {};
            sugg.coordinates.latitude = res[0];
            sugg.coordinates.longitude = res[1];
            sugg.address = {};
            if (address.unitNumberPrefix) {
              sugg.address.unitNo = address.unitNumberPrefix;
              sugg.address.unitNo += address.unitNumber;
            } else {
              sugg.address.unitNo = address.unitNumber;
            }
            sugg.address.street_number = address.thoroughfareNumberFrom;
            sugg.address.street_name = "";
            if (address.thoroughfareName) {
              sugg.address.street_name = address.thoroughfareName;
            }
            if (address.thoroughfareTrailingType) {
              sugg.address.street_name += " " + address.thoroughfareTrailingType;
            }
            sugg.address.locality = address.locality;
            sugg.address.postal_code = address.postcode;
            if (!address.country) {
              sugg.address.country = "Australia";
            }
            sugg.address.admin_1 = address.state;
            results1.push(sugg);
          }
        }
        if (results1.length > 0) {
          if (cb && typeof cb === "function") {
            cb(results1);
          }
        } else {
          if (cbErr && typeof cbErr === "function") {
            cbErr("Vicmap lookup Error ");
          }
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("search vicmap no data");
        }
      }
    }, (err) => {
      console.log(err);
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Vicmap lookup Error ");
        }
      }
    });
  }
  selectionOption(tpl, model2, cb) {
    const address = tpl.address;
    const coordinates2 = tpl.coordinates;
    const obj = new AddressDetails();
    if (address.unitNo) {
      obj.properties.unitNo = address.unitNo;
    }
    obj.properties.streetNo = address.street_number;
    obj.properties.street = address.street_name;
    obj.properties.suburb = address.locality;
    obj.properties.postcode = address.postal_code;
    obj.properties.country = address.country;
    obj.properties.state = address.admin_1;
    const lat = parseFloat(coordinates2.latitude);
    const lon = parseFloat(coordinates2.longitude);
    obj.geometry.coordinates[0] = lon;
    obj.geometry.coordinates[1] = lat;
    if (cb && typeof cb === "function") {
      cb(obj);
    }
  }
  getLinkOptions(link) {
    if (this.country) {
      link += "&country=" + this.country;
    }
    if (this.language) {
      link += "&lang=" + this.language;
    }
    return link;
  }
};
_SclMapGeoVicmapService.\u0275fac = function SclMapGeoVicmapService_Factory(t) {
  return new (t || _SclMapGeoVicmapService)();
};
_SclMapGeoVicmapService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoVicmapService, factory: _SclMapGeoVicmapService.\u0275fac, providedIn: "root" });
var SclMapGeoVicmapService = _SclMapGeoVicmapService;

// projects/formbird-mapping/src/lib/scl-map-geo-doc.service.ts
var sclUtilMapService3 = new SclUtilMapService();
var _SclMapGeoDocService = class _SclMapGeoDocService {
  constructor(sclSearchClientService) {
    this.sclSearchClientService = sclSearchClientService;
    this.waitTime = 5e3;
    this.radius = 50;
    this.preText = "";
    this.filter = "";
    this.lookUpCb = null;
    this.lookUpCbErr = null;
    this.lookUpCbSelectOption = null;
    this.lookUpCbRemoveStreet = null;
    this.dexieSearchFilter = null;
    this.queryName = null;
    this.relatedDocument = null;
  }
  setupReverse(geo) {
    if (geo.radius) {
      this.radius = geo.radius;
    }
  }
  buildSearchOption(filter2) {
    const options = {
      page: 0,
      pageSize: this.initObj.pageSize,
      document: this.initObj.document,
      filter: filter2,
      searchOptions: null,
      queryName: null,
      dataSource: null,
      sourceFilter: [this.geoJsonField, "documentId", "systemHeader.summaryName"]
    };
    if (this.queryName) {
      options.dataSource = this.sclSearchClientService.getDefaultSearchProvider(this);
      options.queryName = this.queryName;
      options.searchOfflineOnly = this.initObj?.assetField?.searchOptions?.searchOfflineOnly;
    }
    if (this.relatedDocument) {
      for (const field in this.relatedDocument) {
        if (this.relatedDocument.hasOwnProperty(field) && options.sourceFilter.indexOf(field) < 0) {
          options.sourceFilter.push(this.relatedDocument[field]);
        }
      }
    }
    return options;
  }
  reverse(coor, cb, cbErr, cbTimeout) {
    if (this.lookUpCb == null) {
      this.lookUpCb = this.initObj.lookUpCb;
    }
    if (this.lookUpCbErr == null) {
      this.lookUpCbErr = this.initObj.lookUpCbErr;
    }
    if (this.lookUpCbSelectOption == null) {
      this.lookUpCbSelectOption = this.initObj.lookUpCbSelectOption;
    }
    if (this.lookUpCbRemoveStreet == null) {
      this.lookUpCbRemoveStreet = this.initObj.lookUpCbRemoveStreet;
    }
    if (this.initObj.clearStreetSearchTextBox && typeof this.initObj.clearStreetSearchTextBox === "function") {
      this.initObj.clearStreetSearchTextBox(null);
    }
    const lat = coor[1];
    const lon = coor[0];
    let radius = coor[2];
    const coorNext = coor;
    if (this.filter.trim().length > 0) {
      const newFilter = sclHandlebars.processHandlebars(this.filter, null, null, null, this.initObj.contextParams);
      let hasBoundingBox = true;
      if (this.initObj?.assetField?.noBoundingBox) {
        hasBoundingBox = !this.initObj.assetField.noBoundingBox;
      }
      const filter2 = sclUtilMapService3.getQueryGeo(coor, coorNext, newFilter, this.geoJsonField, hasBoundingBox);
      const options = this.buildSearchOption(filter2);
      this.sclSearchClientService.search(options).then((data) => {
        if (data && data.data && data.data.hits && data.data.hits.hits && data.data.hits.hits.length > 0) {
          const customData = data.data.hits.hits;
          const suggestions = customData[0]._source;
          const streetData = new AddressDetails();
          let sugLon = lon;
          let sugLat = lat;
          if (suggestions && suggestions[this.geoJsonField] && suggestions[this.geoJsonField].features && suggestions[this.geoJsonField].features.length == 1) {
            if (suggestions[this.geoJsonField].features[0].properties) {
              const address = suggestions[this.geoJsonField].features[0].properties;
              streetData.properties.streetNo = address.streetNo;
              streetData.properties.street = address.street;
              streetData.properties.suburb = address.suburb;
              streetData.properties.postcode = address.postcode;
              streetData.properties.country = address.country;
              streetData.properties.state = address.state;
            }
            if (suggestions[this.geoJsonField].features[0].geometry && suggestions[this.geoJsonField].features[0].coordinates && suggestions[this.geoJsonField].features[0].coordinates.length == 2) {
              sugLon = suggestions[this.geoJsonField].features[0].coordinates[0];
              sugLat = suggestions[this.geoJsonField].features[0].coordinates[1];
            }
            streetData.geometry.coordinates[0] = lon;
            streetData.geometry.coordinates[1] = lat;
            streetData.objRelated = this.getRelatedField(suggestions);
            if (cb && typeof cb === "function") {
              cb(streetData, { lat: sugLat, lng: sugLon });
            }
          } else {
            if (cbErr && typeof cbErr === "function") {
              cbErr("There has no data");
            }
          }
        } else {
          if (cbErr && typeof cbErr === "function") {
            cbErr("There has no data");
          }
        }
      }, (err) => {
        if (err.status === -1) {
          if (cbTimeout && typeof cbTimeout === "function") {
            cbTimeout();
          }
        } else {
          if (cbErr && typeof cbErr === "function") {
            cbErr("DOC reverse address Error ");
          }
        }
      });
    } else {
      console.log("cant not run reverse function because filter is empty or is NULL");
    }
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, cbTimeout, customData) {
    this.lookUpCb = cb;
    this.lookUpCbErr = cbErr;
    this.lookUpCbSelectOption = cbSelectOption;
    this.lookUpCbRemoveStreet = cbRemoveStreet;
    if (params == null || params.length < 1) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("params is invalid, [0] : autocompleteBox");
      }
      return;
    }
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (params.length > 1) {
      this.search(params[1], cb, cbErr, cbTimeout);
    }
  }
  removeLookUp() {
    const id2 = this.initObj.keyName + "MapGeoDoc";
    const elem = document.getElementById(id2);
    if (elem) {
      elem.remove();
    }
    this.autocompleteBox = null;
  }
  removeStreet(cb) {
    if (this.autocompleteStreet == null) {
      this.autocompleteStreet = document.getElementById(this.initObj.keyName + "autocomplete");
    }
    if (this.autocompleteStreet == null) {
      if (cb && typeof cb === "function") {
        cb();
      }
      return;
    }
    this.autocompleteStreet.value = "";
    if (cb && typeof cb === "function") {
      cb();
    }
  }
  getObjectNotWildcardSummaryName(mustObject) {
    const mustSelected = [];
    mustObject.map((key, index) => {
      let isFoundSummaryName = false;
      if (key.wildcard) {
        for (const sss in key.wildcard) {
          if (sss === "systemHeader.summaryName.lcase") {
            isFoundSummaryName = true;
          } else {
            isFoundSummaryName = false;
          }
        }
      } else {
        isFoundSummaryName = false;
      }
      if (!isFoundSummaryName) {
        mustSelected.push(mustObject[index]);
      }
    });
    return mustSelected;
  }
  search(sPartialDocName, cb, cbErr, cbTimeout) {
    if (sPartialDocName == null) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("Text is NULL");
      }
      return;
    }
    const newText = sPartialDocName.trim();
    if (newText === this.preText) {
      if (cb && typeof cb === "function") {
        cb([]);
      }
      return;
    }
    this.preText = newText;
    if (newText.length < 3) {
      if (cbErr && typeof cbErr === "function") {
        cbErr("Text is less than 3 charcters");
      }
      return;
    }
    let filter2 = sclHandlebars.processHandlebars(this.filter, null, null, null, this.initObj.contextParams);
    if (typeof filter2 === "string") {
      filter2 = filter2.replace(/'/g, '"');
    }
    const filterObj = JSON.parse(filter2);
    if (filterObj.query.bool.should === void 0) {
      filterObj.query.bool.should = [];
    }
    if (filterObj.query.bool.must instanceof Object && filterObj.query.bool.must.constructor === Object) {
      const objMust = filterObj.query.bool.must;
      filterObj.query.bool.must = [];
      filterObj.query.bool.must.push(objMust);
    } else {
      if (filterObj.query.bool.must === void 0) {
        filterObj.query.bool.must = [];
      }
    }
    filterObj.query.bool.must = this.getObjectNotWildcardSummaryName(filterObj.query.bool.must);
    filterObj.query.bool.must.push({ wildcard: { "systemHeader.summaryName.lcase": "*" + newText.toLowerCase() + "*" } });
    filter2 = JSON.stringify(filterObj);
    const options = this.buildSearchOption(filter2);
    this.sclSearchClientService.search(options).then((data) => {
      if (data && data.data && data.data.hits && data.data.hits.hits && data.data.hits.hits.length > 0) {
        const customData = data.data.hits.hits;
        this.lookUpResultDataCb(customData, cb);
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("DOC address lookup Error ");
        }
      }
    }, (err) => {
      if (err.status === -1) {
        if (cbTimeout && typeof cbTimeout === "function") {
          cbTimeout();
        }
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("DOC address lookup Error ");
        }
      }
    });
  }
  lookUpResultDataCb(customData, cb) {
    const results = [];
    for (let i2 = 0; i2 < customData.length; i2++) {
      const item = customData[i2]._source;
      const sugg = {};
      sugg.street = item.systemHeader.summaryName;
      sugg.address = item;
      if (item[this.geoJsonField] && item[this.geoJsonField].features && item[this.geoJsonField].features.length > 0 && item[this.geoJsonField].features[0].geometry && item[this.geoJsonField].features[0].geometry.coordinates) {
        const lat = item[this.geoJsonField].features[0].geometry.coordinates[1];
        const lng = item[this.geoJsonField].features[0].geometry.coordinates[0];
        sugg.coordinates = {
          "Latitude": lat,
          "Longitude": lng
        };
      } else {
        console.log(sugg.street + " - " + item.documentId + " does not have geometry data");
      }
      results.push(sugg);
    }
    if (cb && typeof cb === "function") {
      cb(results);
    }
  }
  selectionOption(tpl, model2, cb) {
    const data = tpl.address;
    const coordinates2 = tpl.coordinates;
    const obj = new AddressDetails();
    if (data[this.geoJsonField] && data[this.geoJsonField].features && data[this.geoJsonField].features.length > 0 && data[this.geoJsonField].features[0].properties) {
      const address = data[this.geoJsonField].features[0].properties;
      obj.properties.streetNo = address.streetNo;
      obj.properties.street = address.street;
      obj.properties.suburb = address.suburb;
      obj.properties.postcode = address.postcode;
      obj.properties.country = address.country;
      obj.properties.state = address.state;
    }
    if (coordinates2) {
      const lat = parseFloat(coordinates2.Latitude);
      const lon = parseFloat(coordinates2.Longitude);
      obj.geometry.coordinates[0] = lon;
      obj.geometry.coordinates[1] = lat;
    }
    obj.objRelated = this.getRelatedField(data);
    if (this.lookUpCbSelectOption && typeof this.lookUpCbSelectOption === "function") {
      this.lookUpCbSelectOption(obj);
    }
  }
  getLinkOptions(link) {
    if (this.state) {
      link += " " + this.state;
    }
    if (this.country) {
      link += " " + this.country;
    }
    return link;
  }
  getRelatedField(addressData) {
    let relatedObj = null;
    if (this.relatedDocument) {
      for (const field in this.relatedDocument) {
        if (this.relatedDocument.hasOwnProperty(field)) {
          const dataField = this.relatedDocument[field];
          const value = addressData[dataField];
          if (value) {
            if (relatedObj == null) {
              relatedObj = {};
            }
            relatedObj[field] = value;
          }
        }
      }
    }
    return relatedObj;
  }
};
_SclMapGeoDocService.\u0275fac = function SclMapGeoDocService_Factory(t) {
  return new (t || _SclMapGeoDocService)(\u0275\u0275inject(SclSearchClientService));
};
_SclMapGeoDocService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoDocService, factory: _SclMapGeoDocService.\u0275fac, providedIn: "root" });
var SclMapGeoDocService = _SclMapGeoDocService;

// projects/formbird-mapping/src/lib/scl-map-geo.service.ts
var _SclMapGeoService = class _SclMapGeoService {
  constructor(formbirdInjectorService2, sclSearchClientService) {
    this.formbirdInjectorService = formbirdInjectorService2;
    this.sclSearchClientService = sclSearchClientService;
    this.providerLookUp = null;
    this.providerReverse = null;
    this.geoProviders = [];
    this.cbLookUp = null;
    this.cbLookUpErr = null;
    this.cbSelectOption = null;
    this.currentProviderLookUpIndex = 0;
    this.country = "";
    this.language = "";
    this.isInit = false;
    this.setTimeWait = 300;
    this.lookUpGoogle = false;
    this.sclMapGeoCodeFarmService = new SclMapGeoCodeFarmService();
    this.sclMapGeoGoogleService = new SclMapGeoGoogleService();
    this.sclMapGeoHereService = new SclMapGeoHereService();
    this.sclMapGeoPSMAService = new SclMapGeoPSMAService(formbirdInjectorService2);
    this.sclMapGeoPsmaFarmService = new SclMapGeoPsmaFarmService();
    this.sclMapGeoVicMapService = new SclMapGeoVicmapService();
    this.sclMapGeoDocService = new SclMapGeoDocService(sclSearchClientService);
  }
  init(geocodeSearchService, pInstance, map2, EPSG, options) {
    if (this.isInit) {
      return;
    }
    let googleIndex = -1;
    if (this.geoProviders === null) {
      this.geoProviders = [];
    }
    if (geocodeSearchService.length === 0) {
      this.geoProviders = [{
        name: "geocodefarm",
        apiKey: "a2338e05-e3cb425e93ad-109049bfb516",
        timeWait: 1e4
      }];
    } else {
      for (let i2 = 0; i2 < geocodeSearchService.length; ++i2) {
        this.geoProviders.push(geocodeSearchService[i2]);
        if (geocodeSearchService[i2].name === "google") {
          googleIndex = i2;
        }
      }
    }
    this.initObj = options;
    this.currentProviderReverseIndex = 0;
    this.currentProviderLookUpIndex = 0;
    if (geocodeSearchService.country) {
      this.country = geocodeSearchService.country;
    }
    if (geocodeSearchService.language) {
      this.language = geocodeSearchService.language;
    }
    this.MapGeo = pInstance;
    this.map = map2;
    this.EPSG = EPSG;
    this.isInit = true;
    if (googleIndex === 0) {
      this.instance(this.geoProviders[googleIndex]);
    }
  }
  instance(geo) {
    let provider = {};
    this.lookUpGoogle = false;
    switch (geo.name) {
      case "geocodefarm":
        provider = this.sclMapGeoCodeFarmService;
        break;
      case "google":
        provider = this.sclMapGeoGoogleService;
        this.lookUpGoogle = true;
        break;
      case "vicmap":
        provider = this.sclMapGeoVicMapService;
        break;
      case "psma":
        provider = this.sclMapGeoPSMAService;
        break;
      case "psmafarm":
        provider = this.sclMapGeoPsmaFarmService;
        break;
      case "here":
        provider = this.sclMapGeoHereService;
        break;
      case "doc":
        provider = this.sclMapGeoDocService;
        break;
      default:
        provider = this.sclMapGeoGoogleService;
        break;
    }
    provider.initObj = this.initObj;
    if (geo.apiKey) {
      provider.apiKey = geo.apiKey;
    }
    if (geo.apiKeyReverse) {
      provider.apiKeyReverse = geo.apiKeyReverse;
    }
    if (geo.timeWait) {
      provider.waitTime = geo.timeWait;
    }
    if (geo.country) {
      provider.country = geo.country;
    }
    if (geo.state) {
      provider.state = geo.state;
    }
    if (geo.language) {
      provider.language = geo.language;
    }
    if (geo.autocompleteUrl) {
      provider.autocompleteUrl = geo.autocompleteUrl;
    }
    if (geo.addressUrl) {
      provider.addressUrl = geo.addressUrl;
    }
    if (geo.geocodeUrl) {
      provider.geocodeUrl = geo.geocodeUrl;
    }
    if (geo.geocodeUrlNext) {
      provider.geocodeUrlNext = geo.geocodeUrlNext;
    }
    if (geo.appId) {
      provider.appId = geo.appId;
    }
    if (geo.appCode) {
      provider.appCode = geo.appCode;
    }
    if (geo.radius) {
      provider.radius = geo.radius;
    }
    if (geo.filter) {
      provider.filter = geo.filter;
    }
    if (geo.geoJsonField) {
      provider.geoJsonField = geo.geoJsonField;
    }
    if (geo.relatedDocument) {
      provider.relatedDocument = geo.relatedDocument;
    }
    if (geo.dexieSearchFilter) {
      provider.dexieSearchFilter = geo.dexieSearchFilter;
    }
    if (geo.queryName) {
      provider.queryName = geo.queryName;
    }
    provider.geo = geo;
    if (this.lookUpGoogle) {
      provider.loadLookup = true;
      provider.setupLookUp();
    }
    return provider;
  }
  reverse(coor, cb, cbErr) {
    const mapGeo = this;
    const pCoor = coor;
    const pCb = cb;
    const pCbErr = cbErr;
    if (this.providerReverse == null) {
      this.providerReverse = this.instance(this.geoProviders[this.currentProviderReverseIndex]);
    }
    if (this.providerReverse.geo.name === "psma") {
      this.providerReverse.map = this.map;
      this.providerReverse.EPSG = this.EPSG;
      if (this.providerReverse.geo.radius == null) {
        coor[2] = this.providerReverse.psmaRadius;
      } else {
        coor[2] = this.providerReverse.geo.radius < 1 ? 1 : this.providerReverse.geo.radius;
      }
      if (typeof this.providerReverse.geo.hasPrimaryAssetAddressLookup !== "undefined" && this.providerReverse.geo.hasPrimaryAssetAddressLookup !== null) {
        this.providerReverse.hasPrimaryAssetAddressLookup = this.providerReverse.geo.hasPrimaryAssetAddressLookup;
      }
      this.providerReverse.setupReverse(this.providerReverse.geo);
    } else if (this.providerReverse.geo.name === "here") {
      if (typeof this.providerReverse.geo.hasPrimaryAssetAddressLookup !== "undefined" && this.providerReverse.geo.hasPrimaryAssetAddressLookup !== null) {
        this.providerReverse.hasPrimaryAssetAddressLookup = this.providerReverse.geo.hasPrimaryAssetAddressLookup;
      }
      this.providerReverse.setupReverse(this.providerReverse.geo);
    }
    this.providerReverse.reverse(coor, cb, cbErr, function() {
      mapGeo.currentProviderReverseIndex++;
      if (mapGeo.currentProviderReverseIndex < mapGeo.geoProviders.length) {
        mapGeo.providerReverse = mapGeo.instance(mapGeo.geoProviders[mapGeo.currentProviderReverseIndex]);
        mapGeo.providerReverse.autocompleteBox = mapGeo.autocompleteBox;
        mapGeo.reverse(pCoor, pCb, pCbErr);
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("all time out");
        }
      }
    });
  }
  lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet) {
    if (this.geoProviders.length === 0) {
      this.geoProviders = [{
        name: "geocodefarm",
        apiKey: "a2338e05-e3cb425e93ad-109049bfb516",
        timeWait: 1e3
      }];
    }
    this.cbLookUp = cb;
    this.cbLookUpErr = cbErr;
    this.cbSelectOption = cbSelectOption;
    this.cbRemoveStreet = cbRemoveStreet;
    if (this.autocompleteBox == null) {
      this.autocompleteBox = params[0];
    }
    if (this.providerLookUp == null) {
      this.providerLookUp = this.instance(this.geoProviders[this.currentProviderLookUpIndex]);
    }
    const mapGeo = this;
    if (params[0] == null) {
      params[0] = this.autocompleteBox;
    }
    if (params.length > 1 && params[1].trim().length === 0) {
      return;
    }
    if (this.lookUpGoogle) {
      this.providerLookUp.cbSelectOption = cbSelectOption;
    }
    this.providerLookUp.lookUp(params, cb, cbErr, cbSelectOption, cbRemoveStreet, function() {
      mapGeo.currentProviderLookUpIndex++;
      if (mapGeo.currentProviderLookUpIndex < mapGeo.geoProviders.length) {
        const id2 = this.initObj.keyName + "LoadingProvider";
        const len = document.querySelectorAll("#" + id2).length;
        if (len === 0) {
          const child = document.createElement("div");
          child.setAttribute("id", id2);
          child.setAttribute("style", "float:left; position:relative; overflow:hidden; background-color: black; opacity: 0.2; width: 200px; text-align: center; border-radius: 10px;");
          child.innerHTML = '<span style="color:white; display:inline-block;">Loading ' + mapGeo.geoProviders[mapGeo.currentProviderLookUpIndex].name + " provider</span>";
          mapGeo.autocompleteBox.append(child);
        }
        setTimeout(() => {
          console.log("TODO finish waiting");
          const lst = document.querySelectorAll("#" + id2);
          if (lst && lst.length > 0) {
            for (let i2 = 0; i2 < lst.length; i2++) {
              lst[i2].remove();
            }
          }
          mapGeo.providerLookUp.removeLookUp();
          mapGeo.providerLookUp = mapGeo.instance(mapGeo.geoProviders[mapGeo.currentProviderLookUpIndex]);
          params[0] = mapGeo.autocompleteBox;
          mapGeo.lookUp(params, mapGeo.cbLookUp, mapGeo.cbLookUpErr, mapGeo.cbSelectOption, mapGeo.cbRemoveStreet);
        }, 1e3);
      } else {
        if (cbErr && typeof cbErr === "function") {
          cbErr("Address lookup for that text location has timed out.  Please try again.");
        }
      }
    });
  }
  selectionOption(tpl, model2) {
    if (this.providerLookUp == null) {
      return;
    }
    this.providerLookUp.selectionOption(tpl, model2, this.cbSelectOption);
  }
  removeStreet() {
    if (this.geoProviders.length === 0) {
      this.geoProviders = [{
        name: "geocodefarm",
        apiKey: "a2338e05-e3cb425e93ad-109049bfb516",
        timeWait: 1e3
      }];
    }
    if (this.providerLookUp == null) {
      this.providerLookUp = this.instance(this.geoProviders[this.currentProviderLookUpIndex]);
    }
    if (this.providerReverse && this.providerReverse.psmaPoints && this.providerReverse.psmaPoints.length > 0) {
      this.providerReverse.removeFeatures(true);
    }
    this.providerLookUp.removeStreet(this.cbRemoveStreet);
  }
  removeFeatures() {
    if (!this.isInit || this.geoProviders.length === 0 || this.providerReverse == null || this.providerReverse.geo.name !== "psma") {
      return;
    }
    this.providerReverse.removeFeatures(true);
  }
};
_SclMapGeoService.\u0275fac = function SclMapGeoService_Factory(t) {
  return new (t || _SclMapGeoService)(\u0275\u0275inject(FormbirdInjectorService), \u0275\u0275inject(SclSearchClientService));
};
_SclMapGeoService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _SclMapGeoService, factory: _SclMapGeoService.\u0275fac, providedIn: "root" });
var SclMapGeoService = _SclMapGeoService;

// projects/formbird-mapping/src/lib/geo-auto-complete/geo-auto-complete.component.ts
var _c08 = ["streetGeo"];
var _c16 = () => ({ "cursor": "not-allowed" });
function GeoAutocompleteComponent_div_0_mat_option_8_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "mat-option", 8);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const street_r3 = ctx.$implicit;
    \u0275\u0275property("value", street_r3);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", street_r3.street, " ");
  }
}
function GeoAutocompleteComponent_div_0_Template(rf, ctx) {
  if (rf & 1) {
    const _r1 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 2)(1, "button", 3);
    \u0275\u0275listener("click", function GeoAutocompleteComponent_div_0_Template_button_click_1_listener() {
      \u0275\u0275restoreView(_r1);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1.removeStreet(null));
    });
    \u0275\u0275elementStart(2, "mat-icon");
    \u0275\u0275text(3, "close");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(4, "mat-form-field", 4)(5, "input", 5);
    \u0275\u0275listener("input", function GeoAutocompleteComponent_div_0_Template_input_input_5_listener($event) {
      \u0275\u0275restoreView(_r1);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1.lookUp($event.target.value));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(6, "mat-autocomplete", 6, 0);
    \u0275\u0275listener("optionSelected", function GeoAutocompleteComponent_div_0_Template_mat_autocomplete_optionSelected_6_listener($event) {
      \u0275\u0275restoreView(_r1);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1.mapGeo.selectionOption($event.option.value));
    });
    \u0275\u0275template(8, GeoAutocompleteComponent_div_0_mat_option_8_Template, 2, 2, "mat-option", 7);
    \u0275\u0275elementEnd()();
  }
  if (rf & 2) {
    const autogeo_r4 = \u0275\u0275reference(7);
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("id", "btnRemove" + ctx_r1.keyName)("disabled", ctx_r1.disabled);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", ctx_r1.keyName + "InputAutoComplete")("matAutocomplete", autogeo_r4)("readonly", ctx_r1.disabled)("ngStyle", ctx_r1.disabled ? \u0275\u0275pureFunction0(8, _c16) : "");
    \u0275\u0275advance();
    \u0275\u0275property("displayWith", ctx_r1.getDisplayFn());
    \u0275\u0275advance(2);
    \u0275\u0275property("ngForOf", ctx_r1.streets);
  }
}
function GeoAutocompleteComponent_div_1_Template(rf, ctx) {
  if (rf & 1) {
    const _r5 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 2)(1, "button", 3);
    \u0275\u0275listener("click", function GeoAutocompleteComponent_div_1_Template_button_click_1_listener() {
      \u0275\u0275restoreView(_r5);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1.mapGeo.removeStreet());
    });
    \u0275\u0275elementStart(2, "mat-icon");
    \u0275\u0275text(3, "close");
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(4, "mat-form-field", 4)(5, "input", 9);
    \u0275\u0275listener("input", function GeoAutocompleteComponent_div_1_Template_input_input_5_listener($event) {
      \u0275\u0275restoreView(_r5);
      const ctx_r1 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r1.lookUp($event.target.value));
    });
    \u0275\u0275elementEnd()()();
  }
  if (rf & 2) {
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("id", "ggRemove" + ctx_r1.keyName)("disabled", ctx_r1.disabled);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", ctx_r1.keyName + "autocomplete")("readonly", ctx_r1.disabled)("ngStyle", ctx_r1.disabled ? \u0275\u0275pureFunction0(5, _c16) : "");
  }
}
var _GeoAutocompleteComponent = class _GeoAutocompleteComponent {
  constructor(cdRef, httpService, changedDocumentService, formbirdInjectorService2, sclSearchClientService) {
    this.cdRef = cdRef;
    this.httpService = httpService;
    this.changedDocumentService = changedDocumentService;
    this.formbirdInjectorService = formbirdInjectorService2;
    this.sclSearchClientService = sclSearchClientService;
    this.autocompleteBox = {};
    this.getStreetData = new EventEmitter();
    this.removeStreetCb = new EventEmitter();
    this.lookUpResultCb = new EventEmitter();
    this.lookUpErrorCb = new EventEmitter();
    this.init = new EventEmitter();
    this.currentStreetData = "";
    this.streets = [];
    this.isGoogle = false;
    this.checkMapReadyCount = 0;
    this.subs = new Subscription();
    this.broadcastService = this.formbirdInjectorService.get("BroadcastService");
    this.mapGeo = new SclMapGeoService(formbirdInjectorService2, sclSearchClientService);
  }
  ngOnDestroy() {
    this.subs.unsubscribe();
  }
  ngOnInit() {
  }
  ngAfterViewInit() {
    if (this.isReady) {
      return;
    }
    this.isReady = setInterval(() => {
      if (this.isParentReady === true) {
        console.log("done loading parent component !!!");
        clearInterval(this.isReady);
        this.isReady = null;
        this.initialize();
      } else {
        this.checkMapReadyCount++;
        if (this.checkMapReadyCount > 11) {
          console.log("can't init geo-component because parent component can't finish loading !!!");
          clearInterval(this.isReady);
          this.isReady = null;
        } else {
          console.log("waiting for parent component finish loading... ");
        }
      }
    }, 100);
  }
  ngOnChanges(changes) {
    if (changes.autoCompleteBox) {
      this.autocompleteBox = changes.autoCompleteBox.currentValue;
    }
    if (changes.mapGeo) {
      this.mapGeo = changes.mapGeo.currentValue;
    }
    if (changes.keyName) {
      this.keyName = changes.keyName.currentValue;
    }
    if (changes.disabled) {
      this.disabled = changes.disabled.currentValue;
    }
  }
  getDisplayFn() {
    return (val) => val ? val.street : val;
  }
  lookUp(value) {
    this.streets = [];
    this.mapGeo.lookUp([this.autocompleteBox, value], this.lookUpCb.bind(this), this.lookUpCbErr.bind(this), this.lookUpCbSelectOption.bind(this), this.lookUpCbRemoveStreet.bind(this));
  }
  lookUpCb(results) {
    if (results == null) {
      return;
    }
    this.streets = results.filter((street) => {
      street.street.toLowerCase().includes(this.currentStreetData);
      return street;
    });
    this.trigger._onChange("");
    this.trigger.openPanel();
    this.cdRef.detectChanges();
    this.lookUpResultCb.emit();
  }
  lookUpCbErr(err) {
    console.log("error = " + err);
    this.lookUpErrorCb.emit();
  }
  lookUpCbSelectOption(streetData) {
    if (this.mapGeo != null) {
      this.mapGeo.removeFeatures();
    }
    if (streetData == null) {
      return;
    }
    this.getStreetData.emit(streetData);
  }
  lookUpCbRemoveStreet() {
    this.removeStreetCb.emit();
  }
  initialize() {
    if (Array.isArray(this.geocodeSearchService) && this.geocodeSearchService.length > 0 && this.geocodeSearchService[0].name === "google") {
      this.isGoogle = true;
    }
    if (this.EPSG === "undefined" || this.EPSG == null) {
      this.EPSG = "EPSG:3857";
    }
    this.mapGeo.init(this.geocodeSearchService, this.mapGeo, this.map, this.EPSG, {
      keyName: this.keyName,
      assetField: this.componentDefinition,
      httpService: this.httpService,
      mapFunc: this.mapFunc,
      contextParams: this.contextParams,
      lookUpCb: this.lookUpCb.bind(this),
      lookUpCbErr: this.lookUpCbErr.bind(this),
      lookUpCbSelectOption: this.lookUpCbSelectOption.bind(this),
      lookUpCbRemoveStreet: this.lookUpCbRemoveStreet.bind(this),
      pageSize: this.pageSize,
      document: this.document,
      clearStreetSearchTextBox: this.clearStreetSearchTextBox.bind(this)
    });
    this.init.emit({ geoAutoComplete: this });
    this.watchReadOnly();
    const formResetSub = this.broadcastService.on("formReset").subscribe(() => {
      this.clearInputData(null);
      this.cdRef.detectChanges();
    });
  }
  clearInputData(keyName) {
    this.currentStreetData = "";
    this.streets = [];
    this.clearStreetSearchTextBox(keyName);
  }
  removeStreet(keyName) {
    if (this.disabled == true) {
      return;
    }
    this.clearInputData(keyName);
    if (this.mapGeo) {
      this.mapGeo.cbRemoveStreet = this.removeStreetCbFunc.bind(this);
      this.mapGeo.removeStreet();
    }
    this.cdRef.detectChanges();
  }
  removeStreetCbFunc() {
    this.removeStreetCb.emit();
    this.mapGeo.cbRemoveStreet = null;
  }
  // 15295
  watchReadOnly() {
    const compSub = this.changedDocumentService.watchComponentDef(this.fieldName, this.template.documentId).subscribe((componentDefinition) => {
      this.disabled = componentDefinition?.enabled === false;
      this.cdRef.detectChanges();
    });
    this.subs.add(compSub);
  }
  clearStreetSearchTextBox(keyName) {
    let iput = document.getElementById(this.keyName + "InputAutoComplete");
    if (keyName) {
      iput = document.getElementById(keyName + "InputAutoComplete");
    }
    if (iput) {
      iput.value = "";
    }
    let iputGG = document.getElementById(this.keyName + "autocomplete");
    if (keyName) {
      iputGG = document.getElementById(keyName + "autocomplete");
    }
    if (iputGG) {
      iputGG.value = "";
    }
  }
};
_GeoAutocompleteComponent.\u0275fac = function GeoAutocompleteComponent_Factory(t) {
  return new (t || _GeoAutocompleteComponent)(\u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(HttpService), \u0275\u0275directiveInject(ChangedDocumentService), \u0275\u0275directiveInject(FormbirdInjectorService), \u0275\u0275directiveInject(SclSearchClientService));
};
_GeoAutocompleteComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _GeoAutocompleteComponent, selectors: [["geo-auto-complete"]], viewQuery: function GeoAutocompleteComponent_Query(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275viewQuery(MatAutocompleteTrigger, 5);
    \u0275\u0275viewQuery(_c08, 7);
  }
  if (rf & 2) {
    let _t;
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.trigger = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.streetGeo = _t.first);
  }
}, inputs: { disabled: "disabled", keyName: "keyName", autocompleteBox: "autocompleteBox", geocodeSearchService: "geocodeSearchService", map: "map", EPSG: "EPSG", mapFunc: "mapFunc", componentDefinition: "componentDefinition", isParentReady: "isParentReady", contextParams: "contextParams", pageSize: "pageSize", document: "document", template: "template", fieldName: "fieldName" }, outputs: { getStreetData: "getStreetData", removeStreetCb: "removeStreetCb", lookUpResultCb: "lookUpResultCb", lookUpErrorCb: "lookUpErrorCb", init: "init" }, features: [\u0275\u0275NgOnChangesFeature], decls: 2, vars: 2, consts: [["autogeo", "matAutocomplete"], ["class", "clear-auto-complete-wrap", 4, "ngIf"], [1, "clear-auto-complete-wrap"], ["type", "button", "mat-button", "", 1, "close-icon", 3, "click", "id", "disabled"], ["appearance", "standard"], ["matInput", "", "placeholder", "Search address", "name", "streetGeo", 3, "input", "id", "matAutocomplete", "readonly", "ngStyle"], [1, "ft-geo-auto-complete", 3, "optionSelected", "displayWith"], [3, "value", 4, "ngFor", "ngForOf"], [3, "value"], ["matInput", "", "placeholder", "Search", "type", "text", 1, "form-control-geo-auto-complete", "mat-input-element", 3, "input", "id", "readonly", "ngStyle"]], template: function GeoAutocompleteComponent_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, GeoAutocompleteComponent_div_0_Template, 9, 9, "div", 1)(1, GeoAutocompleteComponent_div_1_Template, 6, 6, "div", 1);
  }
  if (rf & 2) {
    \u0275\u0275property("ngIf", !(ctx.mapGeo == null ? null : ctx.mapGeo.lookUpGoogle));
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx.mapGeo == null ? null : ctx.mapGeo.lookUpGoogle);
  }
}, dependencies: [NgForOf, NgIf, NgStyle, MatFormField, MatInput, MatAutocomplete, MatOption, MatAutocompleteTrigger, MatIcon, MatButton], styles: ["/* projects/formbird-mapping/src/lib/geo-auto-complete/geo-auto-complete.component.scss */\n.clear-auto-complete-wrap {\n  width: 100%;\n  position: relative;\n}\n.clear-auto-complete-wrap > button {\n  position: absolute;\n  top: -25px;\n  right: 0;\n  z-index: 999;\n  min-width: unset !important;\n  width: 32px;\n  height: auto;\n  padding: 0;\n}\n.clear-auto-complete-wrap > button .mat-icon {\n  height: 16px !important;\n  width: 16px !important;\n  font-size: 16px !important;\n}\n.selectedAsset .clear-auto-complete-wrap > button {\n  top: -25px;\n}\n.ft-geo-auto-complete {\n  margin-top: -20px;\n}\n/*# sourceMappingURL=geo-auto-complete.component.css.map */\n"], encapsulation: 2 });
var GeoAutocompleteComponent = _GeoAutocompleteComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(GeoAutocompleteComponent, { className: "GeoAutocompleteComponent" });
})();

// projects/formbird-mapping/src/lib/street-data/street-data.component.ts
var import_lodash9 = __toESM(require_lodash());
var _c09 = ["eUnitNo"];
var _c17 = ["eStreetNo"];
var _c24 = ["eStreetName"];
var _c34 = ["eSuburbTown"];
var _c44 = ["eState"];
var _c54 = ["eCountry"];
var _c64 = ["ePostCode"];
var _c73 = ["eLocationDescription"];
var _c82 = ["eLatitude"];
var _c92 = ["eLongitude"];
var _StreetDataComponent = class _StreetDataComponent {
  get streetDataStr() {
    return this.strStreetData;
  }
  set streetDataStr(value) {
    this.strStreetData = value;
    if (!this.streetData[this.keyName]) {
      this.streetData[this.keyName] = {};
    }
    try {
      this.streetData[this.keyName] = JSON.parse(this.strStreetData);
    } catch (err) {
      this.streetData[this.keyName] = null;
    }
    this.evtSetStreetDataStr.emit();
    this.cdRef.detectChanges();
  }
  constructor(cdRef, componentSetupService, changedDocumentService) {
    this.cdRef = cdRef;
    this.componentSetupService = componentSetupService;
    this.changedDocumentService = changedDocumentService;
    this.evtInit = new EventEmitter();
    this.evtSetStreetDataStr = new EventEmitter();
    this.evtPropertyValueChange = new EventEmitter();
    this.evtValueChangedAddress = new EventEmitter();
    this.evtCoordinateValueChange = new EventEmitter();
    this.strStreetData = "";
    this.disableMandatory = false;
    this.disableCoordinate = false;
    this.checkMapReadyCount = 0;
    this.previousValidCoors = ["", ""];
    this.subs = new Subscription();
  }
  ngOnDestroy() {
    this.subs.unsubscribe();
  }
  ngOnInit() {
    this.streetData = {};
    this.streetData[this.keyName] = new AddressDetails();
    this.setupControls();
    this.setupChangeDetection();
    this.initialize();
  }
  ngAfterViewInit() {
  }
  ngOnChanges(changes) {
  }
  getDisplayFn() {
    return (val) => val ? val.street : val;
  }
  initialize() {
    this.evtInit.emit({ streetDataComp: this });
    this.watchFieldChange();
  }
  setupControls() {
    this.formControlUnitNo = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_unitNo", this.streetData[this.keyName]?.properties?.unitNo ? this.streetData[this.keyName]?.properties?.unitNo : "", null);
    this.formControlStreetNo = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_streetNo", this.streetData[this.keyName]?.properties?.streetNo ? this.streetData[this.keyName]?.properties?.streetNo : "", null);
    this.formControlStreetName = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_streetName", this.streetData[this.keyName]?.properties?.street ? this.streetData[this.keyName]?.properties?.street : "", null);
    this.formControlSuburb = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_suburb", this.streetData[this.keyName]?.properties?.suburb ? this.streetData[this.keyName]?.properties?.suburb : "", null);
    this.formControlState = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_state", this.streetData[this.keyName]?.properties?.state ? this.streetData[this.keyName]?.properties?.state : "", null);
    this.formControlCountry = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_country", this.streetData[this.keyName]?.properties?.country ? this.streetData[this.keyName]?.properties?.country : "", null);
    this.formControlPostcode = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_postcode", this.streetData[this.keyName]?.properties?.postcode ? this.streetData[this.keyName]?.properties?.postcode : "", null);
    this.formControlLocationDescription = this.componentSetupService.setupControl(this.parentComponent, this.registeredControlName + "_locationDescription", this.streetData[this.keyName]?.properties?.locationDescription ? this.streetData[this.keyName]?.properties?.locationDescription : "", null);
  }
  setupChangeDetection() {
    const subUnitNo = this.formControlUnitNo.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("unitNo", value);
    });
    this.subs.add(subUnitNo);
    const subStreetNo = this.formControlStreetNo.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("streetNo", value);
    });
    this.subs.add(subStreetNo);
    const subStreetName = this.formControlStreetName.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("streetName", value);
    });
    this.subs.add(subStreetName);
    const subSuburb = this.formControlSuburb.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("suburb", value);
    });
    this.subs.add(subSuburb);
    const subState = this.formControlState.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("state", value);
    });
    this.subs.add(subState);
    const subCountry = this.formControlCountry.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("country", value);
    });
    this.subs.add(subCountry);
    const subPostcode = this.formControlPostcode.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("postcode", value);
    });
    this.subs.add(subPostcode);
    const subLocationDescription = this.formControlLocationDescription.valueChanges.pipe(debounceTime(ClientConstants.VALIDATION_INTERVAL_TIME)).subscribe((value) => {
      this.valueChangedAddress("locationDescription", value);
    });
    this.subs.add(subLocationDescription);
  }
  valueChangedAddress(type, $event) {
    let hasChange = true;
    switch (type) {
      case "unitNo":
        this.streetData[this.keyName].properties.unitNo = this.formControlUnitNo.value;
        break;
      case "streetNo":
        this.streetData[this.keyName].properties.streetNo = this.formControlStreetNo.value;
        break;
      case "streetName":
        this.streetData[this.keyName].properties.street = this.formControlStreetName.value;
        break;
      case "suburb":
        this.streetData[this.keyName].properties.suburb = this.formControlSuburb.value;
        break;
      case "state":
        this.streetData[this.keyName].properties.state = this.formControlState.value;
        break;
      case "country":
        this.streetData[this.keyName].properties.country = this.formControlCountry.value;
        break;
      case "postcode":
        this.streetData[this.keyName].properties.postcode = this.formControlPostcode.value;
        break;
      case "locationDescription":
        this.streetData[this.keyName].properties.locationDescription = this.formControlLocationDescription.value;
        break;
      default:
        hasChange = false;
        break;
    }
    if (hasChange) {
      this.streetDataStr = JSON.stringify(this.streetData[this.keyName]);
      this.evtValueChangedAddress.emit();
    }
  }
  watchFieldChange() {
    const compSub = this.changedDocumentService.watchComponentDef(this.fieldName, this.template.documentId).subscribe((componentDefinition) => {
      this.disabled = componentDefinition?.enabled === false;
      this.cdRef.detectChanges();
    });
    this.subs.add(compSub);
  }
  propertyValueChange(event, name) {
    const st = this.streetData[this.keyName];
    const value = event.target.value;
    if (!(0, import_lodash9.isEqual)(st.properties[name], value)) {
      st.properties[name] = value;
      if (!st.geometry || !st.geometry.coordinates || st.geometry.coordinates.length < 2 || st.geometry.coordinates[0] == 0 && st.geometry.coordinates[1] == 0) {
        console.log("delete geometry");
        delete st.geometry;
        this.previousValidCoors = ["", ""];
      }
      this.streetDataStr = JSON.stringify(st);
      this.evtPropertyValueChange.emit();
    }
  }
  coordinateValueChange(event, index) {
    const newValue = Number(event.target.value);
    const st = this.streetData[this.keyName];
    if (isNaN(newValue)) {
      console.log("typing invalid latitude");
      event.target.value = this.previousValidCoors[index];
      return;
    }
    if (st.geometry) {
      if (st.geometry.coordinates) {
        if (st.geometry.coordinates.length == 0) {
          if (event.target.value.trim().length == 0) {
            return;
          }
          st.geometry.coordinates = [0, 0];
          this.previousValidCoors = ["0", "0"];
        }
      } else {
        st.geometry.coordinates = [0, 0];
        this.previousValidCoors = ["0", "0"];
      }
    } else {
      st.geometry = {
        type: "Point",
        coordinates: [0, 0]
      };
      this.previousValidCoors = ["0", "0"];
    }
    if (!(0, import_lodash9.isEqual)(st.geometry.coordinates[index], newValue)) {
      st.geometry.coordinates[index] = newValue;
      this.previousValidCoors[index] = event.target.value;
      if (event.target.value.trim.length == 0 && st.geometry && st.geometry.coordinates && st.geometry.coordinates.length > 1 && st.geometry.coordinates[0] == 0 && st.geometry.coordinates[1] == 0) {
        console.log("delete geometry");
        const st2 = this.streetData[this.keyName];
        delete st2.geometry;
        this.previousValidCoors = ["", ""];
      }
      this.streetDataStr = JSON.stringify(st);
      this.evtCoordinateValueChange.emit();
    }
  }
  bindStreetData(hideAddress) {
    if (hideAddress === true || !this.streetData[this.keyName]) {
      return;
    }
    if (this.streetData[this.keyName].properties) {
      if (this.streetData[this.keyName].properties.unitNo) {
        this.eUnitNo.nativeElement.value = this.streetData[this.keyName].properties.unitNo;
      } else {
        this.eUnitNo.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.streetNo) {
        this.eStreetNo.nativeElement.value = this.streetData[this.keyName].properties.streetNo;
      } else {
        this.eStreetNo.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.street) {
        this.eStreetName.nativeElement.value = this.streetData[this.keyName].properties.street;
      } else {
        this.eStreetName.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.suburb) {
        this.eSuburbTown.nativeElement.value = this.streetData[this.keyName].properties.suburb;
      } else {
        this.eSuburbTown.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.state) {
        this.eState.nativeElement.value = this.streetData[this.keyName].properties.state;
      } else {
        this.eState.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.country) {
        this.eCountry.nativeElement.value = this.streetData[this.keyName].properties.country;
      } else {
        this.eCountry.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.postcode) {
        this.ePostCode.nativeElement.value = this.streetData[this.keyName].properties.postcode;
      } else {
        this.ePostCode.nativeElement.value = "";
      }
      if (this.streetData[this.keyName].properties.locationDescription) {
        this.eLocationDescription.nativeElement.value = this.streetData[this.keyName].properties.locationDescription;
      } else {
        this.eLocationDescription.nativeElement.value = "";
      }
    }
    if (this.streetData[this.keyName].geometry && this.streetData[this.keyName].geometry.coordinates.length === 2) {
      this.eLatitude.nativeElement.value = this.streetData[this.keyName].geometry.coordinates[1];
      this.eLongitude.nativeElement.value = this.streetData[this.keyName].geometry.coordinates[0];
    } else {
      this.eLatitude.nativeElement.value = "";
      this.eLongitude.nativeElement.value = "";
    }
    this.previousValidCoors = [this.eLongitude.nativeElement.value, this.eLatitude.nativeElement.value];
  }
};
_StreetDataComponent.\u0275fac = function StreetDataComponent_Factory(t) {
  return new (t || _StreetDataComponent)(\u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(ComponentSetupService), \u0275\u0275directiveInject(ChangedDocumentService));
};
_StreetDataComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _StreetDataComponent, selectors: [["street-data"]], viewQuery: function StreetDataComponent_Query(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275viewQuery(_c09, 5);
    \u0275\u0275viewQuery(_c17, 5);
    \u0275\u0275viewQuery(_c24, 5);
    \u0275\u0275viewQuery(_c34, 5);
    \u0275\u0275viewQuery(_c44, 5);
    \u0275\u0275viewQuery(_c54, 5);
    \u0275\u0275viewQuery(_c64, 5);
    \u0275\u0275viewQuery(_c73, 5);
    \u0275\u0275viewQuery(_c82, 5);
    \u0275\u0275viewQuery(_c92, 5);
  }
  if (rf & 2) {
    let _t;
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eUnitNo = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eStreetNo = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eStreetName = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eSuburbTown = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eState = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eCountry = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.ePostCode = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eLocationDescription = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eLatitude = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.eLongitude = _t.first);
  }
}, inputs: { disabled: "disabled", keyName: "keyName", isParentReady: "isParentReady", fieldName: "fieldName", template: "template", registeredControlName: "registeredControlName", parentComponent: "parentComponent", streetDataStr: "streetDataStr" }, outputs: { evtInit: "evtInit", evtSetStreetDataStr: "evtSetStreetDataStr", evtPropertyValueChange: "evtPropertyValueChange", evtValueChangedAddress: "evtValueChangedAddress", evtCoordinateValueChange: "evtCoordinateValueChange" }, features: [\u0275\u0275NgOnChangesFeature], decls: 35, vars: 38, consts: [["eUnitNo", ""], ["eStreetNo", ""], ["eStreetName", ""], ["eSuburbTown", ""], ["eState", ""], ["eCountry", ""], ["ePostCode", ""], ["eLocationDescription", ""], ["eLatitude", ""], ["eLongitude", ""], [1, "street-panel"], ["appearance", "standard", "FloatLabelType", "never", 1, "ft-address-unit-num"], ["matInput", "", "placeholder", "Unit#", 3, "blur", "id", "name", "readonly", "formControl"], ["appearance", "standard", 1, "ft-address-street-num"], ["matInput", "", "placeholder", "Street#", 3, "blur", "id", "name", "readonly", "formControl"], ["appearance", "standard", 1, "ft-address-street-name"], ["matInput", "", "placeholder", "Street Name", 3, "blur", "id", "name", "readonly", "formControl"], [1, "suburb-state-panel", "f-flex", "f-flex-row", "f-flex-wrap"], ["appearance", "standard", 1, "ft-address-suburb"], ["matInput", "", "placeholder", "Suburb / Town", 3, "blur", "id", "name", "readonly", "formControl"], ["appearance", "standard", 1, "ft-address-state"], ["matInput", "", "placeholder", "State", 3, "blur", "name", "id", "readonly", "formControl"], [1, "country-postcode-panel", "f-flex", "f-flex-row", "f-flex-wrap"], ["appearance", "standard", 1, "ft-address-post-code-country"], ["matInput", "", "placeholder", "Country", 3, "blur", "id", "name", "readonly", "formControl"], ["appearance", "standard", 1, "ft-address-post-code"], ["matInput", "", "placeholder", "Postcode", 3, "blur", "id", "name", "readonly", "formControl"], [1, "description-lat-lon-panel", "f-flex", "f-flex-row", "f-flex-wrap"], ["appearance", "standard", 1, "ft-address-description"], ["matInput", "", "placeholder", "Location Description", 3, "blur", "id", "name", "readonly", "formControl"], [1, "lat-lon-panel", "f-flex", "f-flex-column"], ["appearance", "standard", 1, "ft-address-long-lat"], ["matInput", "", "placeholder", "Latitude", 3, "blur", "id", "name", "readonly"], ["matInput", "", "placeholder", "Longitude", 3, "blur", "id", "name", "readonly"]], template: function StreetDataComponent_Template(rf, ctx) {
  if (rf & 1) {
    const _r1 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 10)(1, "mat-form-field", 11)(2, "input", 12, 0);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_2_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "unitNo"));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(4, "mat-form-field", 13)(5, "input", 14, 1);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_5_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "streetNo"));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(7, "mat-form-field", 15)(8, "input", 16, 2);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_8_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "street"));
    });
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(10, "div", 17)(11, "mat-form-field", 18)(12, "input", 19, 3);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_12_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "suburb"));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(14, "mat-form-field", 20)(15, "input", 21, 4);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_15_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "state"));
    });
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(17, "div", 22)(18, "mat-form-field", 23)(19, "input", 24, 5);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_19_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "country"));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(21, "mat-form-field", 25)(22, "input", 26, 6);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_22_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "postcode"));
    });
    \u0275\u0275elementEnd()()();
    \u0275\u0275elementStart(24, "div", 27)(25, "mat-form-field", 28)(26, "textarea", 29, 7);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_textarea_blur_26_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.propertyValueChange($event, "locationDescription"));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(28, "div", 30)(29, "mat-form-field", 31)(30, "input", 32, 8);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_30_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.coordinateValueChange($event, 1));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(32, "mat-form-field", 31)(33, "input", 33, 9);
    \u0275\u0275listener("blur", function StreetDataComponent_Template_input_blur_33_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.coordinateValueChange($event, 0));
    });
    \u0275\u0275elementEnd()()()();
  }
  if (rf & 2) {
    \u0275\u0275advance(2);
    \u0275\u0275property("id", "unitNo" + ctx.keyName)("name", ctx.keyName + "unitNumD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlUnitNo);
    \u0275\u0275advance(3);
    \u0275\u0275property("id", "streetNo" + ctx.keyName)("name", ctx.keyName + "streetD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlStreetNo);
    \u0275\u0275advance(3);
    \u0275\u0275property("id", "streetName" + ctx.keyName)("name", ctx.keyName + "streetNameD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlStreetName);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", "suburbTown" + ctx.keyName)("name", ctx.keyName + "subUrbTownD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlSuburb);
    \u0275\u0275advance(3);
    \u0275\u0275property("name", ctx.keyName + "stateD")("id", "state" + ctx.keyName)("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlState);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", "country" + ctx.keyName)("name", ctx.keyName + "countryD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlCountry);
    \u0275\u0275advance(3);
    \u0275\u0275property("id", "postCode" + ctx.keyName)("name", ctx.keyName + "postcodeD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlPostcode);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", "locationDescription" + ctx.keyName)("name", ctx.keyName + "descriptionAddressD")("readonly", ctx.disabled || ctx.disableMandatory)("formControl", ctx.formControlLocationDescription);
    \u0275\u0275advance(4);
    \u0275\u0275property("id", "latitudeId" + ctx.keyName)("name", ctx.keyName + "latitudeD")("readonly", ctx.disabled || ctx.disableCoordinate);
    \u0275\u0275advance(3);
    \u0275\u0275property("id", "longtitudeId" + ctx.keyName)("name", ctx.keyName + "longitudeD")("readonly", ctx.disabled || ctx.disableCoordinate);
  }
}, dependencies: [DefaultValueAccessor, NgControlStatus, FormControlDirective, MatFormField, MatInput], encapsulation: 2 });
var StreetDataComponent = _StreetDataComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(StreetDataComponent, { className: "StreetDataComponent" });
})();

// projects/formbird-sc-shared/src/lib/components/validation/validation-message.component.ts
function ValidationMessageComponent_div_0_span_1_Template2(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "span", 4);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = \u0275\u0275nextContext().$implicit;
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1(" ", validator_r1.text, " ");
  }
}
function ValidationMessageComponent_div_0_mat_icon_2_Template2(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "mat-icon", 5);
    \u0275\u0275text(1, "error");
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = \u0275\u0275nextContext().$implicit;
    \u0275\u0275attribute("aria-label", validator_r1.text);
  }
}
function ValidationMessageComponent_div_0_Template2(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 1);
    \u0275\u0275template(1, ValidationMessageComponent_div_0_span_1_Template2, 2, 1, "span", 2)(2, ValidationMessageComponent_div_0_mat_icon_2_Template2, 2, 1, "mat-icon", 3);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const validator_r1 = ctx.$implicit;
    const ctx_r1 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r1.validatorValue[ctx_r1.documentId] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName][validator_r1.name]);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r1.validatorValue[ctx_r1.documentId] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName] && ctx_r1.validatorValue[ctx_r1.documentId][ctx_r1.fieldName][validator_r1.name]);
  }
}
var _ValidationMessageComponent = class _ValidationMessageComponent {
  constructor(validationService, broadcastService, cdr) {
    this.validationService = validationService;
    this.broadcastService = broadcastService;
    this.cdr = cdr;
    this.subscriptions = new Subscription();
  }
  loadData() {
    const self2 = this;
    if (!self2.model || !self2.componentDefinition) {
      console.warn("No model or template item provided for component.");
      return;
    }
    self2.fieldName = self2.componentDefinition.name;
    self2.documentId = self2.model.documentId;
    self2.validators = self2.validationService.loadValidators(self2.componentDefinition, self2.fieldName);
    self2.validatorValue = self2.validationService.validationCtrlValues;
    const subscription = self2.broadcastService.on(ClientConstants.VALIDATE_FORM_FIELDS).subscribe((value) => {
      if (value && value.documentId === self2.documentId && value.fieldName === self2.fieldName) {
        this.cdr.detectChanges();
      }
    });
    self2.subscriptions.add(subscription);
  }
  ngOnInit() {
    this.loadData();
  }
  ngOnDestroy() {
    this.subscriptions.unsubscribe();
  }
};
_ValidationMessageComponent.\u0275fac = function ValidationMessageComponent_Factory(t) {
  return new (t || _ValidationMessageComponent)(\u0275\u0275directiveInject(ValidationService), \u0275\u0275directiveInject(BroadcastService), \u0275\u0275directiveInject(ChangeDetectorRef));
};
_ValidationMessageComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _ValidationMessageComponent, selectors: [["ft-validation-display"]], inputs: { model: "model", componentDefinition: "componentDefinition" }, decls: 1, vars: 1, consts: [["class", "validator", 4, "ngFor", "ngForOf"], [1, "validator"], ["class", "mat-error", "role", "alert", 4, "ngIf"], ["class", "ft-validation-icon-error mat-error", "attr.aria-hidden", "false", 4, "ngIf"], ["role", "alert", 1, "mat-error"], ["attr.aria-hidden", "false", 1, "ft-validation-icon-error", "mat-error"]], template: function ValidationMessageComponent_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, ValidationMessageComponent_div_0_Template2, 3, 2, "div", 0);
  }
  if (rf & 2) {
    \u0275\u0275property("ngForOf", ctx.validators);
  }
}, dependencies: [NgForOf, NgIf, MatIcon], styles: ["/* projects/formbird-sc-shared/src/lib/components/validation/validation-message.component.scss */\n@media screen and (max-width: 520.98px) {\n  .ft-component-wrap .mat-mdc-form-field {\n    margin-bottom: 0;\n  }\n  .ft-component-wrap .mat-mdc-form-field .mat-mdc-text-field-wrapper {\n    padding-bottom: 1.25em;\n  }\n  .ft-component-wrap .mat-mdc-form-field .mdc-line-ripple {\n    bottom: 1.25em;\n  }\n  .ft-component-wrap .mat-mdc-form-field-subscript-wrapper {\n    display: block;\n  }\n}\n@media screen and (max-width: 600.98px) {\n  #ft-wrapper {\n    margin: 0 !important;\n  }\n}\n.validator {\n  position: relative;\n  display: block;\n}\n.validator > .mat-error:not(.ft-validation-icon-error) {\n  font-size: 75%;\n  padding-top: 10px;\n  color: #f24133;\n}\n.validator > .mat-error:not(.ft-validation-icon-error) + .ft-validation-icon-error {\n  color: #f24133;\n  position: absolute;\n  right: 0;\n  bottom: 38px;\n}\n@media col-xs {\n  .validator {\n    margin-top: -15px;\n    margin-bottom: 15px;\n  }\n  .validator > .mat-error:not(.ft-validation-icon-error) {\n    font-size: 75%;\n    padding-top: 0;\n  }\n}\n/*# sourceMappingURL=validation-message.component.css.map */\n"], encapsulation: 3, changeDetection: 0 });
var ValidationMessageComponent2 = _ValidationMessageComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ValidationMessageComponent2, { className: "ValidationMessageComponent" });
})();

// projects/formbird-mapping/src/lib/sanitizing/sanitizing.component.ts
var _SanitizeHtmlPipe = class _SanitizeHtmlPipe {
  constructor(_sanitizer) {
    this._sanitizer = _sanitizer;
  }
  transform(v) {
    return this._sanitizer.bypassSecurityTrustHtml(v);
  }
};
_SanitizeHtmlPipe.\u0275fac = function SanitizeHtmlPipe_Factory(t) {
  return new (t || _SanitizeHtmlPipe)(\u0275\u0275directiveInject(DomSanitizer, 16));
};
_SanitizeHtmlPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({ name: "sanitizeHtml", type: _SanitizeHtmlPipe, pure: true });
var SanitizeHtmlPipe = _SanitizeHtmlPipe;

// projects/sc-street-address/src/app/street-address/street-address.component.ts
var _c010 = ["info"];
var _c18 = ["info1"];
var _c25 = ["infoCluster"];
var _c35 = ["tooltipInfo"];
function StreetAddressComponent_div_26_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "div", 29);
    \u0275\u0275pipe(1, "sanitizeHtml");
  }
  if (rf & 2) {
    const post_r3 = ctx.$implicit;
    \u0275\u0275property("innerHtml", \u0275\u0275pipeBind1(1, 1, post_r3), \u0275\u0275sanitizeHtml);
  }
}
function StreetAddressComponent_div_34_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "div", 29);
    \u0275\u0275pipe(1, "sanitizeHtml");
  }
  if (rf & 2) {
    const post_r4 = ctx.$implicit;
    \u0275\u0275property("innerHtml", \u0275\u0275pipeBind1(1, 1, post_r4), \u0275\u0275sanitizeHtml);
  }
}
var _StreetAddressComponent = class _StreetAddressComponent extends AbstractComponent2 {
  constructor(formbirdInjectorService2, httpService, cdRef, changedDocumentService, componentSetupService, sclUtilMapService4, sclMapViews6, httpClient, notificationService, configService, sclSearchClientService) {
    super(formbirdInjectorService2, changedDocumentService, componentSetupService, cdRef);
    this.formbirdInjectorService = formbirdInjectorService2;
    this.httpService = httpService;
    this.cdRef = cdRef;
    this.changedDocumentService = changedDocumentService;
    this.componentSetupService = componentSetupService;
    this.sclUtilMapService = sclUtilMapService4;
    this.sclMapViews = sclMapViews6;
    this.httpClient = httpClient;
    this.notificationService = notificationService;
    this.configService = configService;
    this.sclSearchClientService = sclSearchClientService;
    this.isComponentReady = false;
    this.fullWidthClass = "streetAddress-fullwidth";
    this.disableMouseWheel = false;
    this.results = {};
    this.current = null;
    this.timeDelay = 1e3;
    this.timeOutDelay = 1e3;
    this.apiKey = "a2338e05-e3cb425e93ad-109049bfb516";
    this.geocodeURL = "https://www.geocode.farm/v3/json/reverse/";
    this.isGoogleGeocodeService = false;
    this.geocodeSearchService = [];
    this.debounce = SclMapConstantService.DEFAULT_SEARCH_DELAY;
    this.searchMinLength = SclMapConstantService.DEFAULT_SEARCH_LENGTH;
    this.fullWidth = true;
    this.centerOnReverse = false;
    this.searchZoom = false;
    this.mapLibName = "openlayers";
    this.googleKey = null;
    this.controls = [];
    this.layerIds = [];
    this.geoJsonField = "";
    this.loadAssetCounter = 0;
    this.layersRedraw = false;
    this.intervalToolTipSetup = null;
    this.countIntervalTooltipSetup = 0;
    this.hasCustomControl = false;
    this.isPopupClusterOpen = false;
    this.clusterList = [];
    this.clusterMarkersClicked = [];
    this.toolTipTimeout = void 0;
    this.tooltipsTimeout = null;
    this.currentPopover = null;
    this.toolTipZIndex = 100;
    this.postList = [];
    this.hasOnFieldValueChange = false;
    this.loggedInUserService = this.formbirdInjectorService.get("LoggedInUserService");
    this.mapFunc = new SclMappingFunctionsService(httpClient, sclSearchClientService, cdRef, notificationService);
    this.mapFunc.createFeature = this.createFeature.bind(this);
    this.mapFunc.updateAddress = this.updateAddress.bind(this);
    this.mapFunc.updateMap = this.updateMap.bind(this);
    this.mapFunc.currentLocationCheckBoxOnClick = this.currentLocationCheckBoxOnClick.bind(this);
  }
  ngOnInit() {
    if (this.configService.clientConfig().searchDelay) {
      this.debounce = this.configService.clientConfig().searchDelay;
    }
    this.mapFunc.tooltipHandleBarObjects = [];
    if (this.componentDefinition) {
      this.componentSetupService.setupStandardProperties(this);
      this.fullWidthClass = this.componentDefinition.fullWidth ? "streetAddress-fullwidth" : "streetAddress-not-fullwidth";
      this.disableSave = false;
      if (!(typeof this.componentDefinition.disableSave === "undefined" || this.componentDefinition.disableSave === null)) {
        this.disableSave = this.componentDefinition.disableSave;
      }
      this.fieldName = this.componentDefinition.name;
      if (this.componentDefinition.searchDelay) {
        this.debounce = this.componentDefinition.searchDelay;
      }
      if (this.componentDefinition.searchMinLength) {
        this.searchMinLength = this.componentDefinition.searchMinLength;
      }
      if (this.componentDefinition.disableMouseWheel) {
        this.disableMouseWheel = this.componentDefinition.disableMouseWheel;
      }
      if (this.componentDefinition.countryCode) {
        this.countryCode = this.componentDefinition.countryCode;
      }
      if (this.componentDefinition.geocodeSearchService) {
        this.geocodeSearchService = this.componentDefinition.geocodeSearchService;
      }
      if (this.componentDefinition.mapParameters) {
        this.mapParameters = this.componentDefinition.mapParameters;
        if (this.mapParameters.EPSG) {
          this.mapFunc.EPSG = this.mapParameters.EPSG;
        }
        if (this.mapParameters.searchZoom) {
          this.searchZoom = this.mapParameters.searchZoom;
        }
      }
      if (this.componentDefinition.positionMandatory) {
        this.positionMandatory = this.componentDefinition.positionMandatory;
      }
      if (typeof this.componentDefinition.mandatoryValuesArray === "undefined" || this.componentDefinition.mandatoryValuesArray === null || this.componentDefinition.mandatoryValuesArray.length === 0) {
        this.componentDefinition.mandatoryValuesArray = [
          {
            name: "Please enter or select a valid address that contains a Street Name",
            jsonPathQuery: "$..features[?(@.properties.street)]"
          },
          {
            name: "Please enter or select a valid address that contains a Suburb",
            jsonPathQuery: "$..features[?(@.properties.suburb)]"
          }
        ];
      }
      if (typeof this.componentDefinition.fullWidth !== void 0 && this.componentDefinition.fullWidth !== null) {
        this.fullWidth = this.componentDefinition.fullWidth;
      }
      if (this.componentDefinition.zoomFloor) {
        this.zoomFloor = this.componentDefinition.zoomFloor;
      }
      if (this.componentDefinition.centerOnReverse) {
        this.centerOnReverse = this.componentDefinition.centerOnReverse;
      }
      this.mapFunc.mapHeight = "180";
      let height;
      if (this.componentDefinition.heightNum && this.componentDefinition.heightNum > 0 && !isNaN(this.componentDefinition.heightNum)) {
        height = 180 * this.componentDefinition.heightNum;
        const docHeight = document.body.scrollHeight;
        if (height > docHeight - 180) {
          height = docHeight - 180;
        }
        this.mapFunc.mapHeight = height;
      } else {
        height = 180;
        this.mapFunc.mapHeight = "180";
      }
      if (this.componentDefinition.layers) {
        let idx = 0;
        for (let i2 = this.componentDefinition.layers.length - 1; i2 > -1; i2--) {
          idx++;
          if (typeof this.componentDefinition.layers[i2].updateWatchFields !== "undefined") {
            for (let j = 0; j < this.componentDefinition.layers[i2].updateWatchFields.length; j++) {
              const key = this.componentDefinition.layers[i2].updateWatchFields[j];
              if (key in this.mapFunc.updateWatchFieldsLayer) {
                if (this.mapFunc.updateWatchFieldsLayer[key].indexOf(idx) > -1) {
                  continue;
                }
                this.mapFunc.updateWatchFieldsLayer[key].push(idx);
              } else {
                this.mapFunc.updateWatchFieldsLayer[key] = [idx];
              }
            }
            this.mapFunc.hasUpdateWatchField = true;
          }
          let isHeatMap = false;
          if (this.componentDefinition.layers[i2].type && this.componentDefinition.layers[i2].type === "heatmap") {
            isHeatMap = true;
          }
          this.mapFunc.layerAssets.push({
            query: this.componentDefinition.layers[i2].filter + "_layer_" + idx,
            i: idx,
            isHeatMap,
            layer: this.componentDefinition.layers[i2],
            isFilter: false,
            currentFilter: this.componentDefinition.layers[i2].filter,
            features: []
          });
        }
      }
      if (this.componentDefinition.geoJsonField) {
        this.geoJsonField = this.componentDefinition.geoJsonField;
      }
      if (this.componentDefinition.filter) {
        const layerIndex = this.componentDefinition.layers ? this.componentDefinition.layers.length + 1 : 1;
        const layerFilter = this.sclUtilMapService.buildFilterObj(this.componentDefinition, this.geoJsonField);
        this.mapFunc.layerAssets.push({
          query: this.componentDefinition.filter + "_filter_" + layerIndex,
          i: layerIndex,
          isHeatMap: false,
          layer: layerFilter,
          isFilter: true,
          currentFilter: this.componentDefinition.filter,
          features: []
        });
      }
      if (this.componentDefinition.maxZoom) {
        this.mapFunc.maxZoomAsset = this.componentDefinition.maxZoom;
      }
      if (this.componentDefinition.minZoom) {
        this.mapFunc.minZoomAsset = this.componentDefinition.minZoom;
      }
      if (this.componentDefinition.showTiming) {
        this.mapFunc.showTiming = this.componentDefinition.showTiming;
      }
      if (!(typeof this.componentDefinition.tooltipsTimeout === "undefined" || this.componentDefinition.tooltipsTimeout === null)) {
        this.tooltipsTimeout = this.componentDefinition.tooltipsTimeout;
      }
    }
    if (this.mapLibName === "google") {
      this.mapFunc.maxZoomAsset = 20;
      this.mapFunc.minZoomAsset = 15;
    } else if (this.mapLibName === "openlayers") {
      this.mapFunc.maxZoomAsset = 16;
      this.mapFunc.minZoomAsset = 9;
    }
    if (this.componentDefinition.queryPageSize) {
      this.mapFunc.pageSize = this.componentDefinition.queryPageSize;
    }
    if (!(typeof this.componentDefinition.disableHandlebars === "undefined" || this.componentDefinition.disableHandlebars === null)) {
      this.mapFunc.disableHandlebars = this.componentDefinition.disableHandlebars;
    }
    if (this.componentDefinition.layersRedraw) {
      this.layersRedraw = this.componentDefinition.layersRedraw;
    }
    sclHandlebars2.initHandlebars(this.componentDefinition.handlebarsHelpers);
    this.mapFunc.addressId = this.template.documentId;
    this.mapFunc.contextParams = {
      doc: this.document,
      account: this.loggedInUserService.user.account,
      tpl: this.template,
      tplItem: this.componentDefinition
    };
    this.keyName = this.fieldName + this.template.documentId;
    this.setupChangeDetection();
    const panelSub = this.broadcastService.on("panel-comp-def-updated").subscribe((data) => {
      console.log("On panel component def updated.......", data);
      if (data?.startKey < this.key && this.key < data?.endKey) {
        if (this.componentDefinition.visible !== false) {
          if (this.mapLibName === "openlayers" && this.mapFunc) {
            this.mapFunc.showMap();
            console.log("Show Map called.");
          }
        }
      }
    });
    this.subs.add(panelSub);
    const docSub = this.changedDocumentService.watchDocument(this.document.documentId).subscribe((doc) => {
      this.document = doc;
      this.mapFunc.contextParams.doc = doc;
    });
    this.subs.add(docSub);
    this.watchDocument = new BehaviorSubject(this.featureCollections);
    const featureSub = this.watchDocument.subscribe((obj) => {
      this.watchDoc(obj);
    });
    this.subs.add(featureSub);
  }
  // end ngOnInit
  onFieldValueChanged(fieldValue) {
    if ((0, import_lodash10.isEqual)(this.fieldValue, fieldValue)) {
      console.log("watch document, OLD = NEW");
      return;
    }
    this.fieldValue = (0, import_lodash10.cloneDeep)(fieldValue);
    console.log("****** watch document, fieldValue = " + fieldValue);
    this.watchDoc(this.fieldValue);
    if (!fieldValue) {
      this.removeStreet();
    }
  }
  onComponentDefChanged(componentDefinition) {
    super.onComponentDefChanged(componentDefinition);
    if (typeof componentDefinition.visible === "undefined" || componentDefinition.visible === null || componentDefinition.visible) {
      if (this.mapLibName === "openlayers") {
        this.mapFunc.showMap();
      }
    }
  }
  ngAfterViewInit() {
    this.initMap();
  }
  // end ngAfterViewInit
  ngOnChanges(changes) {
    console.log(changes);
  }
  setupChangeDetection() {
    super.setupChangeDetection();
  }
  initMap() {
    this.mapFunc.divInfo = this.divInfo;
    this.mapFunc.divInfo1 = this.divInfo1;
    this.mapFunc.divInfoCluster = this.divInfoCluster;
    if (this.mapParameters) {
      this.defaultLat = this.mapParameters.defaultLat;
      this.defaultLon = this.mapParameters.defaultLon;
      this.defaultZoom = this.mapParameters.defaultZoom;
      if (this.mapParameters.mapViews) {
        for (let i2 = 0; i2 < this.mapParameters.mapViews.length; ++i2) {
          if (this.mapParameters.mapViews[i2].serverType === "google") {
            this.mapLibName = "google";
            this.googleKey = typeof this.mapParameters.mapViews[i2].apiKey === "undefined" || this.mapParameters.mapViews[i2].apiKey === null ? null : this.mapParameters.mapViews[i2].apiKey;
            if (this.googleKey == null) {
              console.error("Google map key is null");
            }
            break;
          }
        }
      } else {
        this.mapParameters.mapViews = SclMapConstantService.DEFAULT_MAP_PARAMETERS.mapViews;
      }
    } else {
      this.mapParameters = SclMapConstantService.DEFAULT_MAP_PARAMETERS;
    }
    const streetWrapper = document.getElementById(this.keyName + "StreetWrapper");
    const mapWrapper = document.getElementById(this.keyName + "MapWrapper");
    if (this.fullWidth === false) {
      if (streetWrapper != null) {
        streetWrapper.style.width = "100%";
      }
      if (mapWrapper != null) {
        mapWrapper.style.width = "100%";
      }
    }
    const mapId = this.keyName + "gblMap";
    const targetMap = document.getElementById(mapId);
    const divWrapper = document.getElementById(this.keyName + "MapWrapper");
    this.mapFunc.targetMapElement = targetMap;
    const self2 = this;
    this.mapFunc.initLib(this.mapFunc, this.mapLibName, { googleKey: this.googleKey }, (mapObj) => {
      console.log("****************** init map done ******************* ");
      this.isComponentReady = true;
      this.cdRef.detectChanges();
      this.mapFunc.mapObj = mapObj;
      this.multilayers = this.mapFunc.mapObj.multiLayers(this.mapParameters.mapViews);
      const addSelectAction = (element) => {
        const checkbox = this.sclMapViews.createCheckbox(document, this.keyName + "Select");
        checkbox.onclick = () => {
          this.isEditable = !this.isEditable;
        };
        element.appendChild(checkbox);
        const iSpan = document.createElement("i");
        iSpan.setAttribute("class", "material-icons");
        iSpan.innerHTML = "mode_edit";
        const label = this.sclMapViews.createLabel(document, this.keyName + "Select", null);
        label.setAttribute("class", "control-pencil");
        label.appendChild(iSpan);
        element.appendChild(label);
      };
      const ActionControl = function(ctrlOptions) {
        const options = ctrlOptions || {};
        const element = document.createElement("div");
        const controlElement = document.createElement("div");
        if (self2.mapLibName) {
          controlElement.className = "gg-control check-group select-action ol-control custom-control";
        } else {
          controlElement.className = "check-group select-action ol-control custom-control";
        }
        addSelectAction(controlElement);
        self2.mapFunc.addCurrentLocationCheckbox(self2.keyName, controlElement);
        element.appendChild(controlElement);
        if (self2.multilayers && self2.multilayers.length > 1 && self2.mapLibName !== "google") {
          self2.mapFunc.mapObj.addMapViewControl(element, self2.multilayers, self2.keyName, self2.layerIds);
        }
        self2.mapFunc.mapObj.layersRedraw = this.layersRedraw;
        self2.mapFunc.mapObj.layersRedrawCount = (self2.componentDefinition.layers ? self2.componentDefinition.layers.length : 0) + (self2.componentDefinition.filter ? 1 : 0);
        self2.mapFunc.mapObj.addControl(this, element, options);
        self2.mapFunc.mapObj.elementCtrl = controlElement;
      };
      this.mapFunc.mapObj.setupControl(ActionControl);
      this.controls.push(new ActionControl({}));
      this.mapFunc.setupMap(this.mapFunc, {
        configService: this.configService,
        target: this.mapFunc.targetMapElement,
        disableMouseWheel: this.disableMouseWheel,
        divWrapper,
        defaultLon: this.defaultLon,
        defaultLat: this.defaultLat,
        defaultZoom: this.defaultZoom,
        EPSG: this.mapFunc.EPSG,
        minResolution: this.mapParameters.minResolution,
        maxResolution: this.mapParameters.maxResolution,
        layers: this.multilayers,
        layerAssets: this.mapFunc.layerAssets,
        controls: this.controls,
        style: SclMapConstantService.COMP_TYPE_STREET_ADDRESS,
        mapId,
        setDirty: this.setDocDirty.bind(this),
        zoomFloor: this.zoomFloor,
        componentDefinition: this.componentDefinition,
        intervalToolTipSetup: this.intervalToolTipSetup,
        countIntervalTooltipSetup: this.countIntervalTooltipSetup,
        hasCustomControl: this.hasCustomControl,
        setupTooltipUI: this.mapFunc.setupTooltipUI.bind(this.mapFunc),
        toolTipOnFeatureHover: (e) => {
          this.mapFunc.tooltipOnFeatureHover(e, this.mapLibName);
        },
        tooltipInfo: this.tooltipInfo,
        cdRef: this.cdRef,
        watcherFunction: (doc) => {
          if (!(0, import_lodash10.isEqual)(this.document, doc)) {
            this.document = doc;
            this.mapFunc.contextParams.doc = this.document;
          } else {
            console.log("happenning watch document but new Value = old Value");
          }
        }
      }, this.keyName);
      this.toolTipZIndex = this.mapFunc.mapObj.layerIndexTooltips;
      if (this.isMapReady == null) {
        this.isMapReady = setInterval(() => {
          if (this.mapFunc.mapObj.isMapReady) {
            this.mapFunc.resetupTooltipUI();
            clearInterval(this.isMapReady);
            this.isMapReady = null;
            if (!this.mapFunc.disableProcessingOnLoad) {
              this.loadAsset("mapReady", true);
            }
            this.mapFunc.mapObj.mapMoveEnd(this.onMoveEnd.bind(this));
          }
        }, 200);
      }
      this.autoCompleteBox = document.getElementById(this.keyName + "GeoAutoComplete");
      this.mapFunc.mapObj.mapClickEvent((evt) => {
        if (!this.isEditable) {
          return;
        }
        if (this.isEditable) {
          const lat = evt.latLng.lat;
          const lng = evt.latLng.lng;
          const coor = [lng, lat];
          this.addData();
          let st = new AddressDetails();
          st.geometry.coordinates[0] = lng;
          st.geometry.coordinates[1] = lat;
          if (this.streetDataComp) {
            this.streetDataComp.streetData[this.keyName] = new AddressDetails();
            this.streetDataComp.streetData[this.keyName].geometry.coordinates[0] = lng;
            this.streetDataComp.streetData[this.keyName].geometry.coordinates[1] = lat;
            this.streetDataComp.streetDataStr = JSON.stringify(st);
          }
          this.updateMap(lat, lng, true, this.centerOnReverse);
          this.mapFunc.mapObj.zoomToValue(this.searchZoom);
          this.mapGeo.reverse([lng, lat], (streetData) => {
            if (streetData == null) {
              return;
            }
            st = streetData;
            if (this.streetDataComp) {
              this.streetDataComp.streetData[this.keyName] = streetData;
              this.streetDataComp.streetDataStr = JSON.stringify(st);
            }
            this.correctData();
            if (lat != null && lng != null) {
              this.updateMap(lat, lng, true, this.centerOnReverse);
            }
            this.setDocDirty();
            this.mapFunc.mapObj.zoomToValue(this.searchZoom);
            this.resetPostionMandatory();
          }, (err) => {
            console.log("error = " + err);
            this.notificationService.error(err);
          });
        }
      });
      if (!this.fieldValue) {
        if (this.streetDataComp) {
          this.streetDataComp.streetData[this.keyName] = new AddressDetails();
        }
      } else if (this.fieldValue.features) {
        this.featureCollections = (0, import_lodash10.cloneDeep)(this.fieldValue);
        this.resetPostionMandatory();
      }
      this.setPositionForAsset();
      this.setInteract();
      this.mapFunc.actionAfterMapReady(this.setFieldActivation.bind(this));
      this.mapFunc.mapObj.mapPointerMoveEvent((evt) => {
        if (evt.dragging) {
          return;
        }
        this.mapFunc.lastEvt = evt;
        if (!this.mapFunc.mouseStopInterval && (!this.mapFunc.focusPopup || !this.mapFunc.currentPopover)) {
          this.mapFunc.mouseStopInterval = setInterval(() => {
            this.mapFunc.hasMouseStopped(evt);
          }, 450);
        }
      });
    }, this.changedDocumentService, this.subs, this.document);
    $3(this.mapFunc.targetMapElement).on("mouseleave", this.onMapMouseLeave.bind(this));
  }
  // end initMap function
  onMapMouseLeave() {
    if (this.mapFunc.isPopoverOpen) {
      this.mapFunc.dismissPopover();
    }
  }
  onMoveEnd(evt) {
    if (this.isMapReady == null) {
      this.isMapReady = setInterval(this.mapReady.bind(this), 200);
    }
  }
  mapReady() {
    if (this.mapFunc.mapObj.isMapReady) {
      this.mapFunc.resetupTooltipUI();
      clearInterval(this.isMapReady);
      this.isMapReady = null;
      this.loadAsset("mapMoveEnd", false);
    }
  }
  // begin logic for geo-auto-complete
  initGeoAutoComplete(e) {
    this.mapFunc.geoAutoComplete = e.geoAutoComplete;
    this.mapGeo = this.mapFunc.geoAutoComplete.mapGeo;
  }
  // end logic for geo-auto-complete
  addHeader() {
    if (this.featureCollections == null) {
      const header = {
        type: "FeatureCollection",
        features: []
      };
      this.featureCollections = header;
    }
  }
  updateValue() {
    this.featureCollections.features = [];
    if (this.streetDataComp && this.streetDataComp.streetData && this.streetDataComp.streetData[this.keyName]) {
      if (!(0, import_lodash10.isEqual)(this.streetDataComp.streetData[this.keyName], SclMapConstantService.STREET)) {
        const st = (0, import_lodash10.cloneDeep)(this.streetDataComp.streetData[this.keyName]);
        this.sclUtilMapService.streetDataRemoveEmpty(st);
        this.featureCollections.features.push(st);
      }
    }
  }
  setDocDirty() {
    if (this.disableSave) {
      return;
    }
    this.addHeader();
    this.updateValue();
  }
  updateAddress(lat, lng) {
    this.addHeader();
    lat = parseFloat(lat);
    lng = parseFloat(lng);
    let st = this.streetDataComp?.streetData[this.keyName];
    if (!st) {
      st = new AddressDetails();
    }
    if (!st.geometry || !st.geometry.coordinates) {
      st.geometry = {
        coordinates: [],
        type: "Point"
      };
    }
    st.geometry.coordinates[0] = lng;
    st.geometry.coordinates[1] = lat;
    if (this.streetDataComp) {
      this.streetDataComp.streetDataStr = JSON.stringify(st);
    }
    this.updateMap(lat, lng, true, true);
    if (this.mapGeo) {
      this.mapGeo.reverse([lng, lat], (streetData) => {
        if (streetData) {
          st = streetData;
        }
        if (this.streetDataComp) {
          this.streetDataComp.streetDataStr = JSON.stringify(st);
        }
      }, (err) => {
        console.log("error = " + err);
      });
    } else {
      const link = this.sclUtilMapService.getGeocodeCoordinate(this.geocodeURL, lat, lng, this.componentDefinition, this.apiKey);
      this.httpClient.get(link).subscribe((res) => {
        const data = res;
        if (data && data.geocoding_results.STATUS.status === "SUCCESS") {
          const suggestions = data.geocoding_results.RESULTS[0];
          const address = suggestions.ADDRESS;
          st.properties.streetNo = address.street_number;
          st.properties.street = address.street_name;
          st.properties.suburb = address.locality;
          st.properties.postcode = address.postal_code;
          st.properties.country = address.country;
          st.properties.state = address.admin_1;
          st.geometry.coordinates[0] = lng;
          st.geometry.coordinates[1] = lat;
          if (this.streetDataComp) {
            this.streetDataComp.streetDataStr = JSON.stringify(st);
          }
        }
      }, (error3) => {
        console.log("Error : " + error3);
        this.notificationService.warning("GeoCodeFarm Address Reverse is not functioning. Please contact your System Administrator");
      });
    }
  }
  updateMap(lat, long, isMapClick, isZoomToLocation) {
    this.mapFunc.mapObj.updateLocation(lat, long, this.mapFunc.addressId, SclMapConstantService.MAP_MARKER, "address", this.mapFunc.addressId, isMapClick);
    if (isZoomToLocation) {
      this.mapFunc.mapObj.zoomToLocation(lat, long);
    }
  }
  currentLocationCheckBoxOnClick(locationFn) {
    if (this.disabled) {
      return;
    }
    locationFn();
  }
  // draw selected asset on map when save document
  setPositionForAsset() {
    if (this.featureCollections && this.featureCollections.features) {
      this.isLoadSavedDocument = true;
      if (this.streetDataComp) {
        this.streetDataComp.streetData[this.keyName] = this.featureCollections.features[0];
        this.checkStreetGeometry();
        if (this.streetDataComp.streetData && this.streetDataComp.streetData[this.keyName] && this.streetDataComp.streetData[this.keyName].geometry) {
          if (this.streetDataComp.streetData[this.keyName].geometry.coordinates[0] || this.streetDataComp.streetData[this.keyName].geometry.coordinates[1]) {
            this.updateMap(this.streetDataComp.streetData[this.keyName].geometry.coordinates[1], this.streetDataComp.streetData[this.keyName].geometry.coordinates[0], false, true);
          }
          this.streetDataComp.bindStreetData(false);
        }
      }
      this.mapFunc.fitCoords(this.featureCollections.features);
      this.isLoadSavedDocument = false;
      this.cdRef.detectChanges();
    }
  }
  onGetStreetData(streetData) {
    this.streetDataComp.streetDataStr = JSON.stringify(streetData);
    this.streetDataComp.streetData[this.keyName] = new AddressDetails();
    if (this.mapGeo != null) {
      this.mapGeo.removeFeatures();
    }
    if (streetData == null) {
      return;
    }
    this.streetDataComp.streetData[this.keyName] = streetData;
    this.cdRef.detectChanges();
    this.correctData();
    const lat = streetData.geometry.coordinates[1];
    const lng = streetData.geometry.coordinates[0];
    if (lat && lng) {
      this.updateMap(lat, lng, false, true);
      this.mapFunc.mapObj.zoomToValue(this.searchZoom);
    }
    this.resetPostionMandatory();
  }
  correctData() {
    if (this.featureCollections == null) {
      const header = {
        type: "FeatureCollection",
        features: []
      };
      this.featureCollections = header;
      return;
    }
    const data = this.featureCollections.features[0];
    this.featureCollections.features[0] = new AddressDetails();
    this.sclUtilMapService.streetDataRemoveEmpty(this.featureCollections.features[0]);
    if (!data) {
      return;
    }
    let properties2;
    if (data.properties) {
      const geo = data.geometry;
      if (typeof geo !== "undefined" && geo !== null) {
        geo.type = "Point";
        data.geometry = geo;
      }
      if (data.geometry && data.geometry.coordinates && data.geometry.coordinates.length === 0) {
        delete data.geometry;
      }
      if (data.geometry) {
        if (!data.geometry.coordinates[0] || isNaN(data.geometry.coordinates[0]) || isNaN(data.geometry.coordinates[1])) {
          delete data.geometry;
        }
      }
      properties2 = data.properties;
      properties2.type = "street";
      data.properties = properties2;
      data.type = "Feature";
      this.sclUtilMapService.streetDataRemoveEmpty(data);
      this.featureCollections.features[0] = data;
    }
  }
  onRemoveStreetCb() {
    if (this.disabled) {
      return;
    }
    const fea = this.mapFunc.mapObj.getFeatureById(this.mapFunc.addressId);
    if (fea) {
      this.removeStreet();
    }
    this.streetDataComp.streetDataStr = null;
  }
  removeStreet() {
    const fea = this.mapFunc.mapObj.getFeatureById(this.mapFunc.addressId);
    this.mapFunc.mapObj.removeLocation(fea);
    this.resetAddressData();
  }
  resetAddressData() {
    if (!this.streetDataComp) {
      return;
    }
    if (!this.streetDataComp.streetData) {
      this.streetDataComp.streetData = {};
      this.streetDataComp.streetData[this.keyName] = new AddressDetails();
      this.addData();
    }
    this.streetDataComp.streetData[this.keyName].properties.unitNo = "";
    this.streetDataComp.streetData[this.keyName].properties.streetNo = "";
    this.streetDataComp.streetData[this.keyName].properties.street = "";
    this.streetDataComp.streetData[this.keyName].properties.suburb = "";
    this.streetDataComp.streetData[this.keyName].properties.state = "";
    this.streetDataComp.streetData[this.keyName].properties.country = "";
    this.streetDataComp.streetData[this.keyName].properties.postcode = "";
    this.streetDataComp.streetData[this.keyName].properties.locationDescription = "";
    if (this.streetDataComp.streetData[this.keyName].geometry) {
      const geometry2 = {
        type: "Point",
        coordinates: []
      };
      this.streetDataComp.streetData[this.keyName].geometry = geometry2;
    }
    this.streetDataComp.bindStreetData(false);
  }
  addData() {
    if (!this.streetDataComp) {
      return;
    }
    const fullVal = new AddressDetails();
    this.streetDataComp.streetData[this.keyName] = fullVal;
  }
  checkStreetGeometry() {
    if (this.streetDataComp && !this.streetDataComp.streetData[this.keyName].geometry) {
      const geometry2 = {
        type: "Point",
        coordinates: []
      };
      const st = this.streetDataComp.streetData[this.keyName];
      st.geometry = geometry2;
      this.streetDataComp.streetDataStr = JSON.stringify(st);
    }
  }
  watchDoc(newValue) {
    if (!newValue || !this.mapFunc || !this.mapFunc.mapObj) {
      return;
    }
    this.checkScopeValue(this.featureCollections);
    this.checkScopeValue(newValue);
    if (!(0, import_lodash10.isEqual)(this.featureCollections, newValue)) {
      const value = (0, import_lodash10.cloneDeep)(newValue);
      this.valueChanged(newValue);
      this.featureCollections = value;
      let streetData;
      if (!newValue) {
        this.removeStreet();
        return;
      }
      const length = newValue?.features?.length;
      for (let i2 = 0; i2 < length; i2++) {
        const asset = (0, import_lodash10.cloneDeep)(newValue.features[i2]);
        if (asset.properties.type === "street") {
          if (typeof asset.geometry === "undefined" || asset.geometry === null || asset.geometry.coordinates.length === 0) {
            continue;
          }
          streetData = asset;
          this.checkStreetGeometry();
          this.resetPostionMandatory();
          this.mapFunc?.geoAutoComplete?.clearStreetSearchTextBox(this.keyName);
          this.updateMap(asset.geometry.coordinates[1], asset.geometry.coordinates[0], false, true);
        }
      }
      let previouseStreetData = this.streetDataComp ? this.streetDataComp.streetData[this.keyName] : null;
      if (streetData && !(0, import_lodash10.isEqual)(previouseStreetData, streetData)) {
        if (!this.streetDataComp) {
          this.hasOnFieldValueChange = true;
          this.streetDataInit = streetData;
        } else {
          this.streetDataComp.streetDataStr = JSON.stringify(streetData);
        }
      }
    }
  }
  valueChanged(value) {
    if (value && value.features && value.features.length == 0) {
      value = null;
    }
    if (!(0, import_lodash10.isEqual)(this.fieldValue, value)) {
      super.valueChanged(value);
      console.log("valueChanged finish");
    }
  }
  checkScopeValue(scopeValue) {
    if (scopeValue && scopeValue.features && scopeValue.features.length > 0 && scopeValue.features[0].properties.type === "street" && typeof scopeValue.features[0].properties.country === "undefined" && typeof scopeValue.features[0].properties.iconImage === "undefined" && typeof scopeValue.features[0].properties.iconSize === "undefined" && typeof scopeValue.features[0].properties.locationDescription === "undefined" && typeof scopeValue.features[0].properties.postcode === "undefined" && typeof scopeValue.features[0].properties.street === "undefined" && typeof scopeValue.features[0].properties.streetNo === "undefined" && typeof scopeValue.features[0].properties.suburb === "undefined" && typeof scopeValue.features[0].properties.unitNo === "undefined") {
      scopeValue.features[0].properties.unitNo = "";
      scopeValue.features[0].properties.streetNo = "";
      scopeValue.features[0].properties.street = "";
      scopeValue.features[0].properties.state = "";
      scopeValue.features[0].properties.suburb = "";
      scopeValue.features[0].properties.postcode = "";
      scopeValue.features[0].properties.locationDescription = "";
      scopeValue.features[0].properties.country = "";
      scopeValue.features[0].properties.iconImage = "";
      scopeValue.features[0].properties.iconSize = "";
      if (scopeValue.features[0].geometry && scopeValue.features[0].geometry.coordinates && scopeValue.features[0].geometry.coordinates.length === 0) {
        delete scopeValue.features[0].geometry;
      }
      if (scopeValue.features[0].geometry) {
        if (!scopeValue.features[0].geometry.coordinates[0] || isNaN(scopeValue.features[0].geometry.coordinates[0]) || isNaN(scopeValue.features[0].geometry.coordinates[1])) {
          delete scopeValue.features[0].geometry;
        }
      }
    }
  }
  setFieldActivation() {
    const mapElement = this.mapFunc.targetMapElement;
    const label = $3(mapElement).find("label");
    const input2 = $3(mapElement).find("input");
    if (this.disabled) {
      input2.map((index, elem) => {
        if (this.layerIds.indexOf(elem.id) < 0) {
          $3(elem).prop("disabled", true).attr("style", "cursor:not-allowed;");
        }
      });
      label.map((index, elem) => {
        if (this.layerIds.indexOf(elem.htmlFor) < 0) {
          $3(elem).prop("disabled", true).attr("style", "cursor:not-allowed;");
        }
      });
      $3('div[class*="disable-element"]').css({ opacity: "0.92", cursor: "not-allowed", "pointer-events": "none" });
    } else {
      input2.map((index, elem) => {
        $3(elem).prop("disabled", false).attr("style", "cursor:pointer;");
      });
      label.map((index, elem) => {
        $3(elem).prop("disabled", false).attr("style", "cursor:pointer;");
      });
      $3('div[class*="disable-element"]').css({ opacity: "1", cursor: "", "pointer-events": "" });
    }
  }
  // //0011229:Watch function trigger updateSize  if map image is not displayed when visible=false.
  watchVisible(newValue, oldValue) {
    if (!(0, import_lodash10.isEqual)(oldValue, newValue)) {
      if (newValue) {
        $3("#divAddress" + this.keyName).removeClass("ng-hide");
        this.mapFunc.mapObj.updateSize();
      }
    }
  }
  showToolTip(tooltip, formFieldContainer, labelContainer) {
    return labelContainer.offsetWidth <= formFieldContainer._elementRef.nativeElement.scrollWidth;
  }
  toggleTooltip(tooltip) {
    tooltip.toggle();
  }
  resetPostionMandatory() {
    if (this.positionMandatory && this.streetDataComp) {
      this.streetDataComp.disableMandatory = false;
      this.cdRef.detectChanges();
    }
  }
  setInteract() {
    if (this.mapLibName === "openlayers") {
      this.mapFunc.mapObj.selectInteraction();
    }
  }
  selectAssetPopup() {
  }
  getHTMLClusterMarkers(features) {
    if (features === void 0 || features.length === 0) {
      return;
    }
    this.clusterList = [];
    let isDisplayOnly = true;
    let currentAssets;
    for (let i2 = 0; i2 < features.length; i2++) {
      const feature = features[i2];
      const properties2 = this.mapFunc.mapObj.getFeatureProperties(feature, ["name", "id", "layerDisplayOnly", "url"]);
      const name = properties2.name;
      const docId = properties2.id;
      const exist = this.mapFunc.isContainFeature(docId, currentAssets);
      let check = "";
      if (exist) {
        check = "checked";
      }
      const id2 = this.keyName + i2 + "cluster";
      const cbName = this.keyName + "cluster";
      let html = "";
      html += "<span id =  '" + docId + "'>" + name + "</span>";
      this.allowSelectAsset = isDisplayOnly;
      this.clusterList.push(html);
    }
    this.mapFunc.showPopupClusters();
    this.cdRef.detectChanges();
  }
  closeClusterPopup(isMultiMode) {
    if (isMultiMode) {
      const id2 = this.keyName + "cluster";
      const assets = [];
      const selectedFeatures = [];
      const selectedAssetIds = [];
      const unSelectedAssetIds = [];
      const assetsCoord = [];
      const coor = this.mapFunc.mapObj.getLatLngFromPixel(this.mapFunc.pixelPopup);
      let street = null;
      let feaType = "LineString";
      const cboxes = document.getElementsByName(id2);
      const len = cboxes.length;
      for (let i2 = 0; i2 < len; i2++) {
        const iCb = cboxes[i2];
        if (iCb.checked) {
          selectedAssetIds.push(iCb.value);
        } else {
          unSelectedAssetIds.push(iCb.value);
        }
      }
      for (let i2 = 0; i2 < selectedAssetIds.length; i2++) {
        const fea = this.mapFunc.mapObj.getFeatureById(selectedAssetIds[i2]);
        if (fea) {
          let type = "primaryAsset";
          const pro = this.mapFunc.mapObj.getFeatureProperties(fea, ["street", "type", "coorData"]);
          street = pro.street;
          feaType = pro.type;
          if (feaType === "Point") {
            const loc = pro.coorData;
            assetsCoord.push(loc);
          } else {
            assetsCoord.push(coor);
          }
        }
      }
      this.clusterList = [];
    }
    this.isPopupClusterOpen = false;
    this.mapFunc.infoClusterPosition = { left: "0px", top: "0px" };
    this.cdRef.detectChanges();
  }
  loadAsset(fromSource, isFirstLoad) {
    this.mapFunc.loadAsset(fromSource, isFirstLoad, {});
  }
  createFeature(params) {
    const featureData = params.featureData;
    const type = params.type;
    const imageFileNo = params.imageFileNo;
    const name = params.name;
    const id2 = params.id;
    const color2 = params.color;
    const layerDisplayOnly = params.layerDisplayOnly;
    const anchor2 = params.anchor;
    const layerClone = params.layerClone;
    const tooltip = params.tooltip;
    const label = params.label;
    const layer = params.layer;
    const layerIndex = params.layerIndex;
    const centerPoint = params.centerPoint;
    const rotation = params.rotation;
    const scale5 = params.scale;
    const radius = params.radius;
    const circleCenter = params.circleCenter;
    const handlebarsContext = params.handlebarsContext;
    const itemData = params.itemData;
    const primaryMultiPopup = params.primaryMultiPopup;
    const secondaryMultiPopup = params.secondaryMultiPopup;
    const asset = params.asset;
    const feature = this.mapFunc.mapObj.createFeatureByType(featureData.geometry.coordinates, type, {
      EPSG: this.mapFunc.EPSG,
      imageFileNo,
      name,
      id: id2,
      color: color2,
      layerDisplayOnly,
      anchor: anchor2,
      url: null,
      layer: (0, import_lodash10.cloneDeep)(layerClone),
      primaryMultiPopup,
      secondaryMultiPopup,
      label,
      layerType: layer.type,
      layerIndex,
      centerPoint,
      rotation,
      scale: scale5,
      radius,
      circleCenter
    });
    if (feature === null) {
      return null;
    }
    this.mapFunc.mapObj.setFeatureProperties(feature, {
      type,
      coorData: featureData.geometry.coordinates,
      itemData
    });
    const fea = this.mapFunc.mapObj.getFeatureById(id2);
    if (!fea) {
      this.mapFunc.mapObj.addFeature(feature, layerIndex);
      let hbObject;
      hbObject = {};
      hbObject.id = this.mapFunc.mapObj.getFeatureId(feature);
      hbObject.tooltips = layer.tooltips;
      hbObject.layerIndex = layerIndex;
      if (tooltip) {
        hbObject.tooltips = tooltip;
      }
      hbObject.handlebarsContext = handlebarsContext;
      hbObject.contextParams = this.mapFunc.contextParams;
      if (!(0, import_lodash10.find)(this.mapFunc.tooltipHandleBarObjects, { id: id2, layerIndex })) {
        this.mapFunc.tooltipHandleBarObjects.push(hbObject);
      }
      if (this.layersRedraw === true) {
        if (layerIndex in this.mapFunc.mapObj.assetOfLayers) {
          this.mapFunc.mapObj.assetOfLayers[layerIndex].push(feature);
        } else {
          this.mapFunc.mapObj.assetOfLayers[layerIndex] = [feature];
        }
      }
    }
    return feature;
  }
  // street-data events
  onStreetDataComponentInit(e) {
    this.streetDataComp = e.streetDataComp;
    if (this.positionMandatory) {
      this.streetDataComp.disableMandatory = true;
      this.streetDataComp.disableCoordinate = true;
      this.cdRef.detectChanges();
    }
    if (this.hasOnFieldValueChange) {
      this.streetDataComp.streetDataStr = JSON.stringify(this.streetDataInit);
      this.hasOnFieldValueChange = false;
      this.streetDataInit = null;
    }
  }
  onSetStreetDataStr() {
    this.addHeader();
    this.updateValue();
    if (!this.isLoadSavedDocument) {
      const json = (0, import_lodash10.cloneDeep)(this.featureCollections);
      this.valueChanged(json);
    }
    this.streetDataComp.bindStreetData(false);
  }
  onPropertyValueChange() {
  }
  onValueChangedAddress() {
    this.setDocDirty();
  }
  onCoordinateValueChange() {
    this.correctData();
    this.setDocDirty();
  }
};
_StreetAddressComponent.\u0275fac = function StreetAddressComponent_Factory(t) {
  return new (t || _StreetAddressComponent)(\u0275\u0275directiveInject(FormbirdInjectorService2), \u0275\u0275directiveInject(HttpService), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(ChangedDocumentService), \u0275\u0275directiveInject(ComponentSetupService2), \u0275\u0275directiveInject(SclUtilMapService), \u0275\u0275directiveInject(SclMapViewsService), \u0275\u0275directiveInject(HttpClient), \u0275\u0275directiveInject(NotificationService2), \u0275\u0275directiveInject(ConfigService2), \u0275\u0275directiveInject(SclSearchClientService2));
};
_StreetAddressComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _StreetAddressComponent, selectors: [["ng-component"]], viewQuery: function StreetAddressComponent_Query(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275viewQuery(_c010, 5);
    \u0275\u0275viewQuery(_c18, 5);
    \u0275\u0275viewQuery(_c25, 5);
    \u0275\u0275viewQuery(_c35, 5);
  }
  if (rf & 2) {
    let _t;
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.divInfo = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.divInfo1 = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.divInfoCluster = _t.first);
    \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.tooltipInfo = _t.first);
  }
}, inputs: { responsiveLayouts: "responsiveLayouts" }, features: [\u0275\u0275InheritDefinitionFeature, \u0275\u0275NgOnChangesFeature], decls: 42, vars: 92, consts: [["formFieldContainer", ""], ["labelContainer", ""], ["tooltip", "matTooltip"], ["info", ""], ["tooltipInfo", ""], ["info1", ""], ["radioPopupInfo", ""], ["infoCluster", ""], ["clusterPopupInfo", ""], [3, "id"], ["floatLabel", "always", "appearance", "none", 1, "street-address-wrapper", "map-label"], [3, "click"], [1, "labelToolTipContainer", 3, "matTooltip", "matTooltipDisabled"], ["matInput", "", 3, "hidden", "id", "name"], [1, "address-map-row", "street-address", "f-flex", "f-flex-row"], [1, "ft-address-left-panel", "address-panel"], [1, "left-panel-address", "f-flex", "f-flex-row", "f-flex-wrap"], [2, "width", "100%", 3, "id"], [3, "getStreetData", "removeStreetCb", "init", "autocompleteBox", "keyName", "disabled", "geocodeSearchService", "EPSG", "mapFunc", "componentDefinition", "isParentReady", "template", "fieldName"], [3, "evtInit", "evtSetStreetDataStr", "evtPropertyValueChange", "evtValueChangedAddress", "evtCoordinateValueChange", "keyName", "disabled", "isParentReady", "document", "template", "fieldName", "registeredControlName", "parentComponent"], ["id", "info", 1, "map-popover"], [1, "popover-inner"], ["id", "info1", 1, "map-popover"], [3, "innerHtml", 4, "ngFor", "ngForOf"], ["type", "button", 1, "btn", 2, "color", "black", 3, "click", "hidden"], ["id", "infoCluster", 1, "map-popover"], [1, "map-panel", "ft-map-wrap", 3, "id"], [2, "width", "100%", "height", "100%", "position", "relative", 3, "id"], [3, "model", "componentDefinition"], [3, "innerHtml"]], template: function StreetAddressComponent_Template(rf, ctx) {
  if (rf & 1) {
    const _r1 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 9)(1, "mat-form-field", 10, 0)(3, "mat-label", 11, 1);
    \u0275\u0275listener("click", function StreetAddressComponent_Template_mat_label_click_3_listener() {
      \u0275\u0275restoreView(_r1);
      const tooltip_r2 = \u0275\u0275reference(7);
      return \u0275\u0275resetView(ctx.toggleTooltip(tooltip_r2));
    });
    \u0275\u0275text(5);
    \u0275\u0275elementEnd();
    \u0275\u0275element(6, "div", 12, 2)(8, "input", 13);
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(9, "div", 14)(10, "div", 15)(11, "div", 16)(12, "div", 17)(13, "geo-auto-complete", 18);
    \u0275\u0275listener("getStreetData", function StreetAddressComponent_Template_geo_auto_complete_getStreetData_13_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onGetStreetData($event));
    })("removeStreetCb", function StreetAddressComponent_Template_geo_auto_complete_removeStreetCb_13_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onRemoveStreetCb());
    })("init", function StreetAddressComponent_Template_geo_auto_complete_init_13_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.initGeoAutoComplete($event));
    });
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(14, "div", 17)(15, "street-data", 19);
    \u0275\u0275listener("evtInit", function StreetAddressComponent_Template_street_data_evtInit_15_listener($event) {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onStreetDataComponentInit($event));
    })("evtSetStreetDataStr", function StreetAddressComponent_Template_street_data_evtSetStreetDataStr_15_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onSetStreetDataStr());
    })("evtPropertyValueChange", function StreetAddressComponent_Template_street_data_evtPropertyValueChange_15_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onPropertyValueChange());
    })("evtValueChangedAddress", function StreetAddressComponent_Template_street_data_evtValueChangedAddress_15_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onValueChangedAddress());
    })("evtCoordinateValueChange", function StreetAddressComponent_Template_street_data_evtCoordinateValueChange_15_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.onCoordinateValueChange());
    });
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(16, "div", 20, 3)(18, "div", 21);
    \u0275\u0275element(19, "div", 9, 4);
    \u0275\u0275elementEnd()();
    \u0275\u0275elementStart(21, "div", 22, 5)(23, "div", 21)(24, "div", 9, 6);
    \u0275\u0275template(26, StreetAddressComponent_div_26_Template, 2, 3, "div", 23);
    \u0275\u0275elementStart(27, "button", 24);
    \u0275\u0275listener("click", function StreetAddressComponent_Template_button_click_27_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.selectAssetPopup());
    });
    \u0275\u0275text(28, "OK");
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(29, "div", 25, 7)(31, "div", 21)(32, "div", 9, 8);
    \u0275\u0275template(34, StreetAddressComponent_div_34_Template, 2, 3, "div", 23);
    \u0275\u0275elementStart(35, "button", 24);
    \u0275\u0275listener("click", function StreetAddressComponent_Template_button_click_35_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.closeClusterPopup(false));
    });
    \u0275\u0275text(36, "Close");
    \u0275\u0275elementEnd();
    \u0275\u0275elementStart(37, "button", 24);
    \u0275\u0275listener("click", function StreetAddressComponent_Template_button_click_37_listener() {
      \u0275\u0275restoreView(_r1);
      return \u0275\u0275resetView(ctx.closeClusterPopup(true));
    });
    \u0275\u0275text(38, "OK");
    \u0275\u0275elementEnd()()()();
    \u0275\u0275elementStart(39, "div", 26);
    \u0275\u0275element(40, "div", 27);
    \u0275\u0275elementEnd()()();
    \u0275\u0275element(41, "ft-validation-display", 28);
  }
  if (rf & 2) {
    const formFieldContainer_r5 = \u0275\u0275reference(2);
    const labelContainer_r6 = \u0275\u0275reference(4);
    const tooltip_r2 = \u0275\u0275reference(7);
    \u0275\u0275classMap(ctx.fullWidthClass + " streetAddress gbl-street-address map-common-wrap");
    \u0275\u0275propertyInterpolate2("id", "divStreetAddress", ctx.fieldName, "", ctx.key, "");
    \u0275\u0275advance(3);
    \u0275\u0275classMap((ctx.componentDefinition == null ? null : ctx.componentDefinition.mandatory) ? "mandatory" : "");
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate1(" ", ctx.componentDefinition == null ? null : ctx.componentDefinition.label, " ");
    \u0275\u0275advance();
    \u0275\u0275propertyInterpolate("matTooltip", ctx.componentDefinition.label);
    \u0275\u0275property("matTooltipDisabled", ctx.showToolTip(tooltip_r2, formFieldContainer_r5, labelContainer_r6));
    \u0275\u0275advance(2);
    \u0275\u0275property("hidden", true)("id", ctx.componentDefinition == null ? null : ctx.componentDefinition.name)("name", ctx.componentDefinition == null ? null : ctx.componentDefinition.name);
    \u0275\u0275advance(4);
    \u0275\u0275classMap(ctx.keyName + "GeoAutoComplete");
    \u0275\u0275property("id", ctx.keyName + "GeoAutoComplete");
    \u0275\u0275advance();
    \u0275\u0275property("autocompleteBox", ctx.autoCompleteBox)("keyName", ctx.keyName)("disabled", ctx.disabled)("geocodeSearchService", ctx.geocodeSearchService)("EPSG", ctx.mapFunc == null ? null : ctx.mapFunc.EPSG)("mapFunc", ctx.mapFunc)("componentDefinition", ctx.componentDefinition)("isParentReady", ctx.isComponentReady)("template", ctx.template)("fieldName", ctx.fieldName);
    \u0275\u0275advance();
    \u0275\u0275property("id", ctx.keyName + "StreetDataWrapper");
    \u0275\u0275advance();
    \u0275\u0275property("keyName", ctx.keyName)("disabled", ctx.disabled)("isParentReady", ctx.isComponentReady)("document", ctx.document)("template", ctx.template)("fieldName", ctx.fieldName)("registeredControlName", ctx.registeredControlName)("parentComponent", ctx);
    \u0275\u0275advance();
    \u0275\u0275styleProp("left", ctx.mapFunc == null ? null : ctx.mapFunc.infoPosition.left)("top", ctx.mapFunc == null ? null : ctx.mapFunc.infoPosition.top)("display", (ctx.mapFunc == null ? null : ctx.mapFunc.isPopoverOpen) ? "table" : "none")("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance();
    \u0275\u0275classMap((ctx.mapFunc == null ? null : ctx.mapFunc.isToolTipScroll) ? "tooltip-scroll popover-content" : "popover-content");
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275property("id", ctx.keyName + "tooltipInfo");
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("left", ctx.mapFunc == null ? null : ctx.mapFunc.infoRadioPosition == null ? null : ctx.mapFunc.infoRadioPosition.left)("top", ctx.mapFunc == null ? null : ctx.mapFunc.infoRadioPosition == null ? null : ctx.mapFunc.infoRadioPosition.top)("display", (ctx.mapFunc == null ? null : ctx.mapFunc.isPopupRadioOpen) ? "table" : "none")("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance();
    \u0275\u0275classMap(ctx.isRadioPopupScroll ? "tooltip-scroll popover-content" : "popover-content");
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275property("id", ctx.keyName + "radioPopupInfo");
    \u0275\u0275advance(2);
    \u0275\u0275property("ngForOf", ctx.postList);
    \u0275\u0275advance();
    \u0275\u0275property("hidden", ctx.disablePopupOkButton);
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("left", ctx.mapFunc == null ? null : ctx.mapFunc.infoClusterPosition == null ? null : ctx.mapFunc.infoClusterPosition.left)("top", ctx.mapFunc == null ? null : ctx.mapFunc.infoClusterPosition == null ? null : ctx.mapFunc.infoClusterPosition.top)("display", ctx.isPopupClusterOpen ? "table" : "none")("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275advance();
    \u0275\u0275classMap(ctx.isClusterPopupScroll ? "tooltip-scroll popover-content" : "popover-content");
    \u0275\u0275styleProp("z-index", ctx.toolTipZIndex);
    \u0275\u0275property("id", ctx.keyName + "clusterPopupInfo");
    \u0275\u0275advance(2);
    \u0275\u0275property("ngForOf", ctx.clusterList);
    \u0275\u0275advance();
    \u0275\u0275property("hidden", !ctx.allowSelectAsset);
    \u0275\u0275advance(2);
    \u0275\u0275property("hidden", ctx.allowSelectAsset);
    \u0275\u0275advance(2);
    \u0275\u0275styleProp("height", ctx.mapFunc == null ? null : ctx.mapFunc.mapHeight, "px");
    \u0275\u0275property("id", ctx.keyName + "MapWrapper");
    \u0275\u0275advance();
    \u0275\u0275property("id", ctx.keyName + "gblMap");
    \u0275\u0275advance();
    \u0275\u0275property("model", ctx.document)("componentDefinition", ctx.componentDefinition);
  }
}, dependencies: [NgForOf, MatFormField, MatLabel, MatInput, MatTooltip, GeoAutocompleteComponent, StreetDataComponent, ValidationMessageComponent2, SanitizeHtmlPipe], styles: ['/* projects/sc-street-address/src/app/street-address/street-address.component.scss */\n.f-flex {\n  display: -webkit-box !important;\n  display: -ms-flexbox !important;\n  display: flex !important;\n}\n.f-flex-inline {\n  display: -webkit-inline-box !important;\n  display: -ms-inline-flexbox !important;\n  display: inline-flex !important;\n}\n.f-flex-row {\n  -webkit-box-orient: horizontal !important;\n  -webkit-box-direction: normal !important;\n  -ms-flex-direction: row !important;\n  flex-direction: row !important;\n}\n.f-flex-row-reverse {\n  -webkit-box-orient: horizontal !important;\n  -webkit-box-direction: reverse !important;\n  -ms-flex-direction: row-reverse !important;\n  flex-direction: row-reverse !important;\n}\n.f-flex-column {\n  -webkit-box-orient: vertical !important;\n  -webkit-box-direction: normal !important;\n  -ms-flex-direction: column !important;\n  flex-direction: column !important;\n}\n.f-flex-col-reverse {\n  -webkit-box-orient: vertical !important;\n  -webkit-box-direction: reverse !important;\n  -ms-flex-direction: column-reverse !important;\n  flex-direction: column-reverse !important;\n}\n.f-flex-wrap {\n  -ms-flex-wrap: wrap !important;\n  flex-wrap: wrap !important;\n}\n.f-flex-no-wrap {\n  -ms-flex-wrap: nowrap !important;\n  flex-wrap: nowrap !important;\n}\n.f-flex-wrap-reverse {\n  -ms-flex-wrap: wrap-reverse !important;\n  flex-wrap: wrap-reverse !important;\n}\n.f-flex-justify-start {\n  -webkit-box-pack: start !important;\n  -ms-flex-pack: start !important;\n  justify-content: flex-start !important;\n}\n.f-flex-justify-end {\n  -webkit-box-pack: end !important;\n  -ms-flex-pack: end !important;\n  justify-content: flex-end !important;\n}\n.f-flex-justify-center {\n  -webkit-box-pack: center !important;\n  -ms-flex-pack: center !important;\n  justify-content: center !important;\n}\n.f-flex-justify-space-between {\n  -webkit-box-pack: justify !important;\n  -ms-flex-pack: justify !important;\n  justify-content: space-between !important;\n}\n.f-flex-justify-space-around {\n  -ms-flex-pack: distribute !important;\n  justify-content: space-around !important;\n}\n.f-flex-justify-space-evenly {\n  -webkit-box-pack: space-evenly !important;\n  -ms-flex-pack: space-evenly !important;\n  justify-content: space-evenly !important;\n}\n.f-flex-align-items-stretch {\n  -webkit-box-align: stretch !important;\n  -ms-flex-align: stretch !important;\n  align-items: stretch !important;\n}\n.f-flex-align-items-start {\n  -webkit-box-align: start !important;\n  -ms-flex-align: start !important;\n  align-items: flex-start !important;\n}\n.f-flex-align-items-end {\n  -webkit-box-align: end !important;\n  -ms-flex-align: end !important;\n  align-items: flex-end !important;\n}\n.f-flex-align-items-center {\n  -webkit-box-align: center !important;\n  -ms-flex-align: center !important;\n  align-items: center !important;\n}\n.f-flex-align-items-baseline {\n  -webkit-box-align: baseline !important;\n  -ms-flex-align: baseline !important;\n  align-items: baseline !important;\n}\n.f-flex-align-content-start {\n  -ms-flex-line-pack: start !important;\n  align-content: flex-start !important;\n}\n.f-flex-align-content-end {\n  -ms-flex-line-pack: end !important;\n  align-content: flex-end !important;\n}\n.f-flex-align-content-center {\n  -ms-flex-line-pack: center !important;\n  align-content: center !important;\n}\n.f-flex-align-content-stretch {\n  -ms-flex-line-pack: stretch !important;\n  align-content: stretch !important;\n}\n.f-flex-align-content-between {\n  -ms-flex-line-pack: justify !important;\n  align-content: space-between !important;\n}\n.f-flex-align-content-around {\n  -ms-flex-line-pack: distribute !important;\n  align-content: space-around !important;\n}\n.f-flex-align-content-space-evenly {\n  -ms-flex-line-pack: space-evenly !important;\n  align-content: space-evenly !important;\n}\n.f-flex-align-self-auto {\n  -ms-flex-item-align: auto !important;\n  -ms-grid-row-align: auto !important;\n  align-self: auto !important;\n}\n.f-flex-align-self-start {\n  -ms-flex-item-align: start !important;\n  align-self: flex-start !important;\n}\n.f-flex-align-self-end {\n  -ms-flex-item-align: end !important;\n  align-self: flex-end !important;\n}\n.f-flex-align-self-center {\n  -ms-flex-item-align: center !important;\n  -ms-grid-row-align: center !important;\n  align-self: center !important;\n}\n.f-flex-align-self-baseline {\n  -ms-flex-item-align: baseline !important;\n  align-self: baseline !important;\n}\n.f-flex-align-self-stretch {\n  -ms-flex-item-align: stretch !important;\n  -ms-grid-row-align: stretch !important;\n  align-self: stretch !important;\n}\n.f-vertical-align-middle {\n  display: -ms-flexbox;\n  display: -webkit-flex;\n  display: flex;\n  -ms-flex-align: center;\n  -webkit-align-items: center;\n  -webkit-box-align: center;\n  align-items: center;\n}\n.break-text {\n  overflow-wrap: break-word;\n  word-wrap: break-word;\n  -ms-word-break: break-all;\n  word-break: break-all;\n  word-break: break-word;\n  -ms-hyphens: auto;\n  -moz-hyphens: auto;\n  -webkit-hyphens: auto;\n  hyphens: auto;\n}\n@media screen and (max-width: 599px) {\n  .f-hide-xs {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 600px) and (max-width: 959px) {\n  .f-hide-sm {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 960px) and (max-width: 1279px) {\n  .f-hide-md {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 1280px) and (max-width: 1919px) {\n  .f-hide-lg {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 1920px) and (max-width: 5000px) {\n  .f-hide-xl {\n    display: none !important;\n  }\n}\n@media screen and (max-width: 599px) {\n  .f-hide-lt-sm {\n    display: none !important;\n  }\n}\n@media screen and (max-width: 959px) {\n  .f-hide-lt-md {\n    display: none !important;\n  }\n}\n@media screen and (max-width: 1279px) {\n  .f-hide-lt-lg {\n    display: none !important;\n  }\n}\n@media screen and (max-width: 1919px) {\n  .f-hide-lt-xl {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 600px) {\n  .f-hide-gt-xs {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 960px) {\n  .f-hide-gt-sm {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 1280px) {\n  .f-hide-gt-md {\n    display: none !important;\n  }\n}\n@media screen and (min-width: 1920px) {\n  .f-hide-gt-lg {\n    display: none !important;\n  }\n}\n@media screen and (max-width: 520.98px) {\n  .ft-component-wrap .mat-mdc-form-field {\n    margin-bottom: 0;\n  }\n  .ft-component-wrap .mat-mdc-form-field .mat-mdc-text-field-wrapper {\n    padding-bottom: 1.25em;\n  }\n  .ft-component-wrap .mat-mdc-form-field .mdc-line-ripple {\n    bottom: 1.25em;\n  }\n  .ft-component-wrap .mat-mdc-form-field-subscript-wrapper {\n    display: block;\n  }\n}\n@media screen and (max-width: 600.98px) {\n  #ft-wrapper {\n    margin: 0 !important;\n  }\n}\n.ol-box {\n  box-sizing: border-box;\n  border-radius: 2px;\n  border: 1.5px solid rgb(179, 197, 219);\n  background-color: rgba(255, 255, 255, 0.4);\n}\n.ol-mouse-position {\n  top: 8px;\n  right: 8px;\n  position: absolute;\n}\n.ol-scale-line {\n  background: rgba(0, 60, 136, 0.3);\n  border-radius: 4px;\n  bottom: 8px;\n  left: 8px;\n  padding: 2px;\n  position: absolute;\n}\n.ol-scale-line-inner {\n  border: 1px solid #eee;\n  border-top: none;\n  color: #eee;\n  font-size: 10px;\n  text-align: center;\n  margin: 1px;\n  will-change: contents, width;\n  transition: all 0.25s;\n}\n.ol-scale-singlebar-even {\n  background-color: #000000;\n}\n.ol-scale-singlebar-odd {\n  background-color: #ffffff;\n}\n.ol-scale-bar {\n  position: absolute;\n  bottom: 8px;\n  left: 8px;\n}\n.ol-scale-step-marker {\n  width: 1px;\n  height: 15px;\n  background-color: #000000;\n  float: right;\n  z-index: 10;\n}\n.ol-scale-step-text {\n  position: absolute;\n  bottom: -5px;\n  font-size: 12px;\n  z-index: 11;\n  color: #000000;\n  text-shadow:\n    -2px 0 #FFFFFF,\n    0 2px #FFFFFF,\n    2px 0 #FFFFFF,\n    0 -2px #FFFFFF;\n}\n.ol-scale-text {\n  position: absolute;\n  font-size: 14px;\n  text-align: center;\n  bottom: 25px;\n  color: #000000;\n  text-shadow:\n    -2px 0 #FFFFFF,\n    0 2px #FFFFFF,\n    2px 0 #FFFFFF,\n    0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n  position: relative;\n  height: 10px;\n  z-index: 9;\n  box-sizing: border-box;\n  border: 1px solid black;\n}\n.ol-unsupported {\n  display: none;\n}\n.ol-viewport,\n.ol-unselectable {\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.ol-viewport canvas {\n  all: unset;\n}\n.ol-selectable {\n  -webkit-touch-callout: default;\n  -webkit-user-select: text;\n  -moz-user-select: text;\n  -ms-user-select: text;\n  user-select: text;\n}\n.ol-grabbing {\n  cursor: -webkit-grabbing;\n  cursor: -moz-grabbing;\n  cursor: grabbing;\n}\n.ol-grab {\n  cursor: move;\n  cursor: -webkit-grab;\n  cursor: -moz-grab;\n  cursor: grab;\n}\n.ol-control {\n  position: absolute;\n  background-color: rgba(255, 255, 255, 0.4);\n  border-radius: 4px;\n  padding: 2px;\n}\n.ol-control:hover {\n  background-color: rgba(255, 255, 255, 0.6);\n}\n.ol-zoom {\n  top: 0.5em;\n  left: 0.5em;\n}\n.ol-rotate {\n  top: 0.5em;\n  right: 0.5em;\n  transition: opacity 0.25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n  opacity: 0;\n  visibility: hidden;\n  transition: opacity 0.25s linear, visibility 0s linear 0.25s;\n}\n.ol-zoom-extent {\n  top: 4.643em;\n  left: 0.5em;\n}\n.ol-full-screen {\n  right: 0.5em;\n  top: 0.5em;\n}\n.ol-control button {\n  display: block;\n  margin: 1px;\n  padding: 0;\n  color: white;\n  font-weight: bold;\n  text-decoration: none;\n  font-size: inherit;\n  text-align: center;\n  height: 1.375em;\n  width: 1.375em;\n  line-height: 0.4em;\n  background-color: rgba(0, 60, 136, 0.5);\n  border: none;\n  border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n  border: none;\n  padding: 0;\n}\n.ol-zoom-extent button {\n  line-height: 1.4em;\n}\n.ol-compass {\n  display: block;\n  font-weight: normal;\n  font-size: 1.2em;\n  will-change: transform;\n}\n.ol-touch .ol-control button {\n  font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n  top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n  text-decoration: none;\n  background-color: rgba(0, 60, 136, 0.7);\n}\n.ol-zoom .ol-zoom-in {\n  border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n  border-radius: 0 0 2px 2px;\n}\n.ol-attribution {\n  text-align: right;\n  bottom: 0.5em;\n  right: 0.5em;\n  max-width: calc(100% - 1.3em);\n  display: flex;\n  flex-flow: row-reverse;\n  align-items: center;\n}\n.ol-attribution a {\n  color: rgba(0, 60, 136, 0.7);\n  text-decoration: none;\n}\n.ol-attribution ul {\n  margin: 0;\n  padding: 1px 0.5em;\n  color: #000;\n  text-shadow: 0 0 2px #fff;\n  font-size: 12px;\n}\n.ol-attribution li {\n  display: inline;\n  list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n  content: " ";\n}\n.ol-attribution img {\n  max-height: 2em;\n  max-width: inherit;\n  vertical-align: middle;\n}\n.ol-attribution button {\n  flex-shrink: 0;\n}\n.ol-attribution.ol-collapsed ul {\n  display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n  background: rgba(255, 255, 255, 0.8);\n}\n.ol-attribution.ol-uncollapsible {\n  bottom: 0;\n  right: 0;\n  border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n  margin-top: -0.2em;\n  max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n  display: none;\n}\n.ol-zoomslider {\n  top: 4.5em;\n  left: 0.5em;\n  height: 200px;\n}\n.ol-zoomslider button {\n  position: relative;\n  height: 10px;\n}\n.ol-touch .ol-zoomslider {\n  top: 5.5em;\n}\n.ol-overviewmap {\n  left: 0.5em;\n  bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n  bottom: 0;\n  left: 0;\n  border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n  display: block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n  border: 1px solid #7b98bc;\n  height: 150px;\n  margin: 2px;\n  width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button {\n  bottom: 2px;\n  left: 2px;\n  position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n  display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n  background: rgba(255, 255, 255, 0.8);\n}\n.ol-overviewmap-box {\n  border: 2px dotted rgba(0, 60, 136, 0.7);\n}\n.ol-overviewmap .ol-overviewmap-box:hover {\n  cursor: move;\n}\n.map-common-wrap .map-label .mat-form-field-infix {\n  padding: 0.5em 0;\n}\n.map-common-wrap > .mat-form-field + div {\n  margin-top: -26px;\n  margin-bottom: 10px;\n}\n.map-common-wrap input.form-control {\n  border-bottom: 1px solid #949494;\n}\n.map-common-wrap textarea.form-control {\n  min-height: 60px;\n  border-bottom: 1px solid #949494;\n}\n.map-common-wrap .ui-select-match input[type=search] {\n  color: #160d29;\n}\n.map-common-wrap .select-action {\n  position: absolute;\n  background: rgba(255, 255, 255, 0.4);\n  left: 10px;\n}\n.map-common-wrap .select-action button {\n  display: block;\n  color: white;\n  background: rgba(0, 60, 136, 0.5);\n}\n.map-common-wrap .select-action > button,\n.map-common-wrap .select-action > div {\n  position: relative;\n  padding: 0;\n  line-height: normal;\n  height: 40px;\n}\n.map-common-wrap .select-action .primary-position .secondary-position > button {\n  margin-top: 2px;\n}\n.map-common-wrap .abc-def {\n  color: red;\n}\n.map-common-wrap .ft-address-left-panel .form-control {\n  color: #160d29;\n}\n.map-common-wrap #info {\n  position: absolute;\n  z-index: 100;\n  display: block;\n  width: 220px;\n}\n.map-common-wrap #info1 {\n  position: absolute;\n  z-index: 100;\n  width: 220px;\n}\n.map-common-wrap .control-globe {\n  height: 26px;\n  padding: 0;\n}\n.map-common-wrap .control-pencil {\n  height: 26px;\n  padding: 0;\n}\n.map-common-wrap .ft-address-description textarea.form-control {\n  min-height: 67px;\n}\n.map-common-wrap .btn-default-focus {\n  border: 0px;\n  box-shadow: none;\n  outline: 0px;\n}\n.map-common-wrap .map-wrapper .map {\n  height: 268px;\n}\n.map-common-wrap .radio-group,\n.map-common-wrap .check-group {\n  overflow: hidden;\n  max-width: 100%;\n}\n.map-common-wrap .check-group {\n  display: grid;\n}\n.map-common-wrap .radio-group input[type=radio],\n.map-common-wrap .check-group input[type=checkbox] {\n  position: absolute;\n  visibility: hidden;\n  display: none;\n}\n.map-common-wrap .radio-group label,\n.map-common-wrap .check-group label {\n  font-size: 22px;\n  color: #9a929e;\n  display: inline-block;\n  cursor: pointer;\n  font-weight: normal;\n  margin-bottom: 0;\n  line-height: normal;\n  -webkit-box-flex: 1;\n  -ms-flex-positive: 1;\n  flex-grow: 1;\n  -ms-flex-negative: 1;\n  flex-shrink: 1;\n  -ms-flex-preferred-size: auto;\n  flex-basis: auto;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n.map-common-wrap .radio-group input[type=radio] + label:last-of-type,\n.map-common-wrap .check-group input[type=checkbox] + label:last-of-type {\n  border-right: 0 !important;\n}\n.map-common-wrap .radio-group input[type=radio] + label:first-of-type,\n.map-common-wrap .check-group input[type=checkbox] + label:first-of-type {\n  border-left: 0 !important;\n}\n.map-common-wrap .radio-group input[type=radio]:checked + label,\n.map-common-wrap .check-group input[type=checkbox]:checked + label {\n  color: black;\n  background: grey;\n  width: 40px;\n  height: 40px;\n  text-align: center;\n}\n.map-common-wrap .radio-group input[type=radio]:not(:checked):hover + label,\n.map-common-wrap .check-group input[type=checkbox]:not(:checked):hover + label {\n  background-color: lightgrey;\n}\n.map-common-wrap .radio-group input[type=radio]:not(:checked) + label,\n.map-common-wrap .check-group input[type=checkbox]:not(:checked) + label {\n  background: white;\n  color: black;\n  width: 40px;\n  height: 40px;\n  text-align: center;\n}\n.map-common-wrap .radio-group input[type=radio]:not(:checked) + label i,\n.map-common-wrap .check-group input[type=checkbox]:not(:checked) + label i {\n  vertical-align: -webkit-baseline-middle;\n  color: black;\n}\n.map-common-wrap .popover-content a {\n  color: #ececec;\n}\n.map-common-wrap .ui-select-match-item {\n  white-space: normal;\n  text-decoration: none;\n  margin-top: 0;\n  font-size: 14px;\n  outline: 0;\n  margin: 0 3px 3px 0;\n  color: rgba(0, 0, 0, 0.87);\n  position: relative;\n  padding: 4px 15px;\n  box-shadow: none;\n  border: none;\n  border-radius: 2px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0;\n  will-change: box-shadow, transform;\n  transition:\n    box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1),\n    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),\n    color 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n  cursor: pointer;\n  background: 0 0;\n  line-height: 1.5;\n  text-align: center;\n  vertical-align: middle;\n  touch-action: manipulation;\n  -webkit-user-select: none;\n  user-select: none;\n  display: flex;\n  align-items: center;\n  z-index: 1;\n}\n.map-common-wrap .ui-select-match-item a {\n  text-decoration: none;\n}\n.map-common-wrap .close {\n  font-weight: 700;\n  color: #000;\n  text-shadow: 0 1px 0 #fff;\n  opacity: 0.2;\n  top: -0.3em;\n  position: relative;\n  font-size: inherit;\n}\n.map-common-wrap .custom-control {\n  padding-left: 0rem !important;\n}\n.map-common-wrap .ol-zoom {\n  top: auto;\n  left: auto;\n  bottom: 0.5em;\n  right: 0.5em;\n}\n.map-common-wrap .ol-zoom.my-new-class-name {\n  background: white;\n}\n.map-common-wrap .ol-control {\n  background-color: rgb(255, 255, 255);\n}\n.map-common-wrap .ol-control.custom-control button {\n  font-family: "Glyphicons Halflings";\n  font-weight: lighter;\n  text-align: center;\n}\n.map-common-wrap .ol-control button {\n  width: 40px;\n  height: 40px;\n  background-color: white;\n  color: black;\n}\n.map-common-wrap a[href^="http://maps.google.com/maps"] {\n  display: none !important;\n}\n.map-common-wrap a[href^="https://maps.google.com/maps"] {\n  display: none !important;\n}\n.map-common-wrap .gmnoprint a,\n.map-common-wrap .gmnoprint span,\n.map-common-wrap .gm-style-cc {\n  display: none;\n}\n.map-common-wrap input.ui-select-search {\n  background-color: transparent !important;\n  border: none;\n  outline: 0;\n  height: 1.666666em;\n  margin-bottom: 3px;\n}\n.map-common-wrap .mat-form-field {\n  width: 100%;\n}\n.map-common-wrap textarea {\n  height: 48px;\n}\n.map-common-wrap .get-auto-wrapper {\n  width: 100%;\n}\n.map-common-wrap .mat-form-field-infix {\n  padding: 0;\n  top: -1.5em;\n}\n.map-common-wrap .mat-form-field-wrapper {\n  padding-bottom: 0;\n  margin-bottom: 0;\n}\n.map-common-wrap .mat-form-field-subscript-wrapper {\n  display: none;\n}\n.map-common-wrap .mat-form-field-flex {\n  padding-top: 0 !important;\n}\n.map-common-wrap .ft-map-wrap {\n  width: 50%;\n}\n.map-common-wrap .ft-map-wrap > div {\n  height: 100%;\n  width: 100%;\n}\n.map-common-wrap .static-label-container {\n  height: 14.5px;\n}\n.map-common-wrap .static-label-container .mat-form-field-infix {\n  top: -14px;\n  padding-top: 4px !important;\n}\n.map-common-wrap .gis-control {\n  position: relative;\n  left: 0px;\n}\n.map-common-wrap .esri-component {\n  box-shadow: none !important;\n}\n.map-common-wrap .gis-custom-control {\n  position: relative;\n  left: 0px;\n}\n.map-common-wrap .ft-address-autocomplete {\n  position: relative;\n  min-height: 1px;\n}\n.map-common-wrap .material-icons {\n  vertical-align: -webkit-baseline-middle;\n}\n.map-common-wrap.sc-selected-asset-fullwidth {\n  width: 100%;\n}\n.map-common-wrap.sc-selected-asset-fullwidth > div:nth-child(2) {\n  display: flex;\n}\n.map-common-wrap > .mat-form-field {\n  margin-top: 20px;\n}\n.map-common-wrap .street-panel {\n  width: 100%;\n  display: flex;\n  gap: 20px;\n}\n.map-common-wrap .mat-form-field {\n  margin-bottom: 0;\n}\n.map-common-wrap .mat-form-field .mat-form-field-underline {\n  bottom: 1.34375em;\n}\n.map-common-wrap .ft-address-left-panel {\n  width: calc(50% - 20px);\n  margin-right: 20px;\n  margin-bottom: 0 !important;\n}\n.map-common-wrap .ft-address-left-panel .left-panel-address {\n  flex-flow: wrap;\n}\n.map-common-wrap .suburb-state-panel {\n  width: 100%;\n}\n.map-common-wrap .suburb-state-panel .mat-form-field-wrapper {\n  width: 100%;\n}\n.map-common-wrap .suburb-state-panel .mat-form-field:first-of-type {\n  margin-right: 20px;\n  width: calc(50% - 20px);\n}\n.map-common-wrap .suburb-state-panel .mat-form-field {\n  width: 50%;\n}\n.map-common-wrap .country-postcode-panel {\n  width: 100%;\n}\n.map-common-wrap .country-postcode-panel .mat-form-field {\n  width: calc(50% - 20px);\n}\n.map-common-wrap .country-postcode-panel .mat-form-field:first-of-type {\n  margin-right: 20px;\n}\n.map-common-wrap .country-postcode-panel .mat-form-field:nth-of-type(2) {\n  width: 50%;\n}\n.map-common-wrap .description-lat-lon-panel {\n  width: 100%;\n}\n.map-common-wrap .description-lat-lon-panel .mat-form-field {\n  width: calc(50% - 20px);\n}\n.map-common-wrap .description-lat-lon-panel .mat-form-field:first-of-type {\n  margin-right: 20px;\n}\n.map-common-wrap .description-lat-lon-panel .lat-lon-panel {\n  width: 50%;\n}\n.map-common-wrap .description-lat-lon-panel .lat-lon-panel .mat-form-field {\n  width: 100%;\n}\n.map-common-wrap .gg-custom-control-bottom {\n  height: 55px;\n}\n.map-common-wrap .gg-custom-control {\n  width: 55px;\n}\n.map-common-wrap .gg-custom-control .gg-control {\n  flex-direction: column;\n}\n.map-common-wrap .gg-custom-control-left-center {\n  display: grid !important;\n}\n.map-common-wrap .popupAsset {\n  cursor: auto;\n}\n.map-common-wrap .draw-menu {\n  position: absolute;\n  left: 40px;\n  top: 0px;\n}\n.map-common-wrap .draw-menu button {\n  display: inline;\n}\n.map-common-wrap .draw-menu-bottom {\n  position: absolute;\n  left: 0px;\n}\n.map-common-wrap .draw-menu-bottom button {\n  display: inline;\n}\n.map-common-wrap .draw-menu-gg {\n  position: absolute;\n  left: 40px;\n  top: 80px;\n}\n.map-common-wrap .draw-menu-gg button {\n  display: inline;\n}\n.map-common-wrap .draw-menu-gg-bottom {\n  position: absolute;\n  left: 80px;\n}\n.map-common-wrap .draw-menu-gg-bottom button {\n  display: inline;\n}\n.map-common-wrap .button-location-pulse {\n  background: rgba(255, 255, 255, 0);\n  border: none;\n  box-shadow: 0 0 0 0 rgba(104, 104, 104, 0.7);\n  border-radius: 50%;\n  background-size: cover;\n  background-repeat: no-repeat;\n  cursor: pointer;\n  -webkit-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1);\n  -moz-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1);\n  -ms-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1);\n  animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1);\n}\n.map-common-wrap .button-location-pulse-stop {\n  -webkit-animation: none;\n  -moz-animation: none;\n  -ms-animation: none;\n  animation: none;\n}\n@-webkit-keyframes pulse {\n  to {\n    box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);\n  }\n}\n@-moz-keyframes pulse {\n  to {\n    box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);\n  }\n}\n@-ms-keyframes pulse {\n  to {\n    box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);\n  }\n}\n@keyframes pulse {\n  to {\n    box-shadow: 0 0 0 15px rgba(232, 76, 61, 0);\n  }\n}\n.map-common-wrap .draw-color-wrapper-horizontal {\n  position: absolute;\n  bottom: 1px;\n  margin-left: 10px;\n  background-color: white;\n}\n.map-common-wrap .draw-color-wrapper-vertical {\n  position: absolute;\n  background-color: white;\n}\n.map-common-wrap .draw-line-width-wrapper-horizontal {\n  position: absolute;\n  bottom: 1px;\n  margin-left: 20px;\n  background-color: white;\n}\n.map-common-wrap .draw-line-dash-wrapper-horizontal {\n  position: absolute;\n  bottom: 0px;\n  margin-left: 10px;\n  background-color: white;\n}\n.map-common-wrap .draw-icon-wrapper-horizontal {\n  position: absolute;\n  bottom: 1px;\n  margin-left: 20px;\n  background-color: white;\n}\n.map-common-wrap .draw-icon-button-icon {\n  max-height: 40px;\n  max-width: 40px;\n  width: auto;\n  height: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  margin: auto;\n}\n.map-common-wrap .draw-font-wrapper-horizontal {\n  position: absolute;\n  bottom: 1px;\n  background-color: white;\n}\n.map-common-wrap .ol-popup {\n  position: absolute;\n  background-color: white;\n  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n  padding: 5px;\n  border-radius: 10px;\n  border: 1px solid #cccccc;\n  display: flex;\n  justify-content: center;\n}\n.map-common-wrap .draw-text-area {\n  box-sizing: border-box;\n  width: 100%;\n  height: 100%;\n  border: 1px solid black;\n}\n.map-common-wrap .draw-text-content {\n  border: 1px solid black;\n  padding: 5px;\n}\n.map-common-wrap .draw-text-google {\n  white-space: pre-wrap;\n}\n.map-common-wrap .ol-tooltip {\n  position: relative;\n  cursor: default;\n  -webkit-user-select: none;\n  user-select: none;\n}\n.map-common-wrap .ft-address-unit-num {\n  width: calc(25% - 20px);\n}\n.map-common-wrap .ft-address-street-num {\n  width: calc(25% - 20px);\n}\n.map-common-wrap .ft-address-street-name {\n  width: 50%;\n}\n.ft-dynamic-container .map-common-wrap .address-map-row {\n  flex-direction: column !important;\n}\n@media screen and (max-width: 991.98px) {\n  .map-common-wrap > .mat-form-field {\n    margin-top: 40px;\n  }\n  .ft-component-wrap .map-common-wrap .mat-form-field .mat-form-field-wrapper {\n    padding-bottom: 0;\n  }\n  .map-common-wrap.sc-selected-asset-fullwidth > div:nth-child(2),\n  .address-map-row.street-address,\n  .address-map-row.boundary {\n    display: block;\n    flex-direction: column !important;\n  }\n  .map-panel.boundary {\n    width: 100%;\n  }\n}\n@media screen and (max-width: 767.98px) {\n  .map-common-wrap .ft-address-left-panel,\n  .map-common-wrap .ft-map-wrap {\n    width: 100%;\n  }\n  .map-common-wrap .street-panel {\n    flex-flow: wrap !important;\n  }\n}\n@media screen and (min-width: 992px) {\n  .ft-dynamic-container .ft-address-left-panel,\n  .ft-dynamic-container .map-panel {\n    width: 100%;\n    margin: 0;\n  }\n}\n.map-common-wrap .ft-address-left-panel {\n  width: 100%;\n}\n.map-common-wrap .ft-address-left-panel .ft-address-street-name {\n  max-width: 50%;\n}\n.map-common-wrap .ft-map-wrap {\n  width: 100%;\n}\n@media screen and (min-width: 570px) and (max-width: 767.98px) {\n  .street-panel .ft-address-street-name .mat-form-field-infix {\n    border-top: 0.84375em solid transparent;\n  }\n}\n.map-popover {\n  color: #ececec;\n  line-height: 1em;\n  background: rgba(101, 101, 101, 0.9);\n  border: none;\n  border-radius: 2px;\n  box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);\n  display: table;\n}\n.popover-content {\n  padding: 9px 14px;\n}\n.popover-inner {\n  display: table-row;\n}\n.tooltip-scroll {\n  overflow-y: scroll;\n}\n@media print {\n  *,\n  :after,\n  :before,\n  .mandatory mat-label {\n    color: #000 !important;\n    text-shadow: none !important;\n    background: 0 0 !important;\n    box-shadow: none !important;\n  }\n  a,\n  a:visited {\n    text-decoration: underline;\n  }\n  a[href]:after {\n    content: " (" attr(href) ")";\n  }\n  abbr[title]:after {\n    content: " (" attr(title) ")";\n  }\n  a[href^="#"]:after,\n  a[href^="javascript:"]:after {\n    content: "";\n  }\n  blockquote,\n  pre {\n    border: 1px solid #999;\n    page-break-inside: avoid;\n  }\n  thead {\n    display: table-header-group;\n  }\n  img,\n  tr {\n    page-break-inside: avoid;\n  }\n  img {\n    max-width: 100% !important;\n  }\n  h2,\n  h3,\n  p {\n    orphans: 3;\n    widows: 3;\n  }\n  h2,\n  h3 {\n    page-break-after: avoid;\n  }\n  .navbar {\n    display: none;\n  }\n  .btn > .caret,\n  .dropup > .btn > .caret {\n    border-top-color: #000 !important;\n  }\n  .label {\n    border: 1px solid #000;\n  }\n  .table {\n    border-collapse: collapse !important;\n  }\n  .table td,\n  .table th {\n    background-color: #fff !important;\n  }\n  .table-bordered td,\n  .table-bordered th {\n    border: 1px solid #ddd !important;\n  }\n  .visible-print {\n    display: block !important;\n  }\n  table.visible-print {\n    display: table !important;\n  }\n  tr.visible-print {\n    display: table-row !important;\n  }\n  td.visible-print,\n  th.visible-print {\n    display: table-cell !important;\n  }\n  .visible-print-block {\n    display: block !important;\n  }\n  .visible-print-inline {\n    display: inline !important;\n  }\n  .visible-print-inline-block {\n    display: inline-block !important;\n  }\n  .hidden-print {\n    display: none !important;\n  }\n  .mat-form-field-appearance-legacy.mat-form-field-can-float .mat-input-server:focus + .mat-form-field-label-wrapper .mat-form-field-label,\n  .mat-form-field-appearance-legacy.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label {\n    -webkit-transform: translateY(-1.28122em) scale(0.75);\n    transform: translateY(-1.28122em) scale(0.75);\n  }\n  .mat-form-field-appearance-legacy.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill + .mat-form-field-label-wrapper .mat-form-field-label {\n    -webkit-transform: translateY(-1.28121em) scale(0.75);\n    transform: translateY(-1.28121em) scale(0.75);\n  }\n  .mat-form-field-appearance-legacy.mat-form-field-can-float .mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper .mat-form-field-label {\n    -webkit-transform: translateY(-1.2812em) scale(0.75);\n    transform: translateY(-1.2812em) scale(0.75);\n  }\n  body {\n    min-height: 0;\n    height: 100% !important;\n    overflow: visible !important;\n    display: block !important;\n    margin: 0 auto;\n    line-height: 1em;\n    word-spacing: 1px;\n    letter-spacing: 0.2px;\n    font:\n      14px "Times New Roman",\n      Times,\n      serif;\n    background: #fff;\n    color: #000;\n    width: 100%;\n  }\n  .mainContent,\n  .templateWrap,\n  body {\n    overflow-x: visible !important;\n    overflow-y: visible !important;\n    position: inherit;\n    float: none;\n  }\n  h1 {\n    font:\n      28px "Times New Roman",\n      Times,\n      serif;\n  }\n  h2 {\n    font:\n      24px "Times New Roman",\n      Times,\n      serif;\n  }\n  h3 {\n    font:\n      20px "Times New Roman",\n      Times,\n      serif;\n  }\n  a:link,\n  a:visited {\n    background: 0 0;\n    color: #333;\n    text-decoration: none;\n  }\n  a[href]:after {\n    content: "" !important;\n  }\n  a[href^="http://"] {\n    color: #000;\n  }\n  .container-fluid {\n    margin: inherit;\n    padding: inherit;\n  }\n  #ft-wrapper {\n    padding: 0;\n    margin: 0;\n    height: auto;\n    overflow: inherit;\n  }\n  .summaryName-wrapper {\n    display: block !important;\n  }\n  .summaryName {\n    height: auto !important;\n    margin: 0;\n    padding: 0 !important;\n    line-height: normal;\n  }\n  .ft-components-wrapper {\n    padding: 0;\n  }\n  .form-control {\n    border: 0;\n    outline: 0;\n    box-shadow: none;\n    padding: 0;\n    background: 0 0;\n    font-weight: 400;\n    font-size: inherit;\n    color: #000 !important;\n    overflow: visible;\n  }\n  .form-control.nobug {\n    transition: none;\n  }\n  #email {\n    width: 60% !important;\n  }\n  .control-label {\n    float: left;\n    font-weight: 700;\n    padding-top: 2px !important;\n  }\n  .mandatory .control-label {\n    color: inherit !important;\n  }\n  .mandatory .control-label:after {\n    content: ":";\n  }\n  #toast-container,\n  .input-group-btn,\n  .label-abbr abbr::after,\n  .sweet-alert {\n    display: none;\n  }\n  .label-abbr abbr[title] {\n    border: 0;\n  }\n  label:not(.checkbox-inline):after {\n    content: ":";\n    margin-left: 3px;\n    position: initial;\n  }\n  .checkbox label:after,\n  label:empty:after {\n    content: "";\n  }\n  .mandatory:after {\n    top: 0;\n  }\n  label:empty {\n    display: none;\n  }\n  label.checklist:after,\n  label:empty:after,\n  label[value=" "]:after {\n    content: "";\n  }\n  label[for=addressValidation],\n  label[for=attachment],\n  label[for=propertyHistory],\n  nav.navbar {\n    display: none !important;\n    visibility: hidden !important;\n  }\n  .ft-checklist {\n    float: left;\n  }\n  .checkbox-wrap .checkbox,\n  .ft-checklist > label {\n    position: relative;\n    top: -3px;\n  }\n  select::-ms-expand {\n    display: none;\n  }\n  select,\n  textarea {\n    -webkit-appearance: none;\n    -moz-appearance: none;\n    resize: none;\n  }\n  #description {\n    border: none;\n    font-weight: 400;\n    color: #000 !important;\n  }\n  .ft-party-firstname,\n  .ft-party-lastname,\n  .ft-party-salutation {\n    float: left !important;\n    width: auto !important;\n  }\n  .ft-party-firstname .form-control,\n  .ft-party-lastname .form-control,\n  .ft-party-salutation .form-control {\n    background: 0 0;\n  }\n  .navbar-block span {\n    padding: 0 !important;\n    margin: 0 !important;\n  }\n  .navbar-block:nth-of-type(1),\n  button {\n    display: none !important;\n  }\n  a[href]:after {\n    content: none !important;\n  }\n  input:placeholder-shown {\n    display: none;\n  }\n  textarea:placeholder-shown {\n    display: none;\n  }\n  #commandbar-wrapper {\n    position: relative;\n    top: 0;\n  }\n  .img-print-position {\n    margin-top: -40px !important;\n  }\n  .ui-select-match-close {\n    display: none;\n  }\n  .ft-related-document {\n    padding: 0;\n  }\n  .ft-related-document .ui-select-match-item {\n    border: 0;\n  }\n  .ft-related-document span > a {\n    text-decoration: none;\n    font-size: 14px;\n  }\n  .dropdownjs:after {\n    display: none;\n  }\n  .form-group.label-floating label.control-label,\n  .form-group.label-static label.control-label {\n    color: inherit;\n    top: -28px !important;\n    font-size: inherit;\n  }\n  .ui-select-multiple.ui-select-bootstrap .ui-select-match-item {\n    padding: 0 !important;\n    margin: 0 !important;\n  }\n  .note-box-copy {\n    font-size: inherit;\n    margin: 0;\n    padding: 4px 0 0;\n  }\n  .note-comment-wrap .note,\n  .note-comment-wrap .notepaper,\n  .note-comment-wrap .notepaper:after,\n  .note-comment-wrap .notepaper:before,\n  .note-comment-wrap blockquote {\n    border: 0;\n  }\n  .ft-component-wrap {\n    page-break-after: avoid !important;\n  }\n  .ft-panel-wrap .panel-collapsed,\n  .ft-panel-wrap .sc-panel-body,\n  .ft-panel-wrap .ft-panel-body {\n    max-height: none !important;\n    display: block !important;\n    height: auto !important;\n    overflow: visible !important;\n    opacity: 1 !important;\n    line-height: 1 !important;\n  }\n  .mat-form-field-label-wrapper {\n    height: 28px !important;\n  }\n  .related-document-chips-wrapper {\n    height: 40px !important;\n  }\n}\n.ft-dynamic-container .streetAddress .clear-auto-complete-wrap > button {\n  top: -20px;\n}\n.streetAddress input:read-only {\n  cursor: not-allowed;\n}\n.streetAddress textarea:read-only {\n  cursor: not-allowed;\n}\n/*# sourceMappingURL=street-address.component.css.map */\n'], encapsulation: 2, changeDetection: 0 });
var StreetAddressComponent = _StreetAddressComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(StreetAddressComponent, { className: "StreetAddressComponent" });
})();

// node_modules/@angular/animations/fesm2022/browser.mjs
var LINE_START = "\n - ";
function invalidTimingValue(exp) {
  return new RuntimeError(3e3, ngDevMode && `The provided timing value "${exp}" is invalid.`);
}
function negativeStepValue() {
  return new RuntimeError(3100, ngDevMode && "Duration values below 0 are not allowed for this animation step.");
}
function negativeDelayValue() {
  return new RuntimeError(3101, ngDevMode && "Delay values below 0 are not allowed for this animation step.");
}
function invalidStyleParams(varName) {
  return new RuntimeError(3001, ngDevMode && `Unable to resolve the local animation param ${varName} in the given list of values`);
}
function invalidParamValue(varName) {
  return new RuntimeError(3003, ngDevMode && `Please provide a value for the animation param ${varName}`);
}
function invalidNodeType(nodeType) {
  return new RuntimeError(3004, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);
}
function invalidCssUnitValue(userProvidedProperty, value) {
  return new RuntimeError(3005, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
}
function invalidTrigger() {
  return new RuntimeError(3006, ngDevMode && "animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))");
}
function invalidDefinition() {
  return new RuntimeError(3007, ngDevMode && "only state() and transition() definitions can sit inside of a trigger()");
}
function invalidState(metadataName, missingSubs) {
  return new RuntimeError(3008, ngDevMode && `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(", ")}`);
}
function invalidStyleValue(value) {
  return new RuntimeError(3002, ngDevMode && `The provided style string value ${value} is not allowed.`);
}
function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
  return new RuntimeError(3010, ngDevMode && `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
}
function invalidKeyframes() {
  return new RuntimeError(3011, ngDevMode && `keyframes() must be placed inside of a call to animate()`);
}
function invalidOffset() {
  return new RuntimeError(3012, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);
}
function keyframeOffsetsOutOfOrder() {
  return new RuntimeError(3200, ngDevMode && `Please ensure that all keyframe offsets are in order`);
}
function keyframesMissingOffsets() {
  return new RuntimeError(3202, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);
}
function invalidStagger() {
  return new RuntimeError(3013, ngDevMode && `stagger() can only be used inside of query()`);
}
function invalidQuery(selector) {
  return new RuntimeError(3014, ngDevMode && `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
}
function invalidExpression(expr) {
  return new RuntimeError(3015, ngDevMode && `The provided transition expression "${expr}" is not supported`);
}
function invalidTransitionAlias(alias) {
  return new RuntimeError(3016, ngDevMode && `The transition alias value "${alias}" is not supported`);
}
function triggerBuildFailed(name, errors) {
  return new RuntimeError(3404, ngDevMode && `The animation trigger "${name}" has failed to build due to the following errors:
 - ${errors.map((err) => err.message).join("\n - ")}`);
}
function animationFailed(errors) {
  return new RuntimeError(3502, ngDevMode && `Unable to animate due to the following errors:${LINE_START}${errors.map((err) => err.message).join(LINE_START)}`);
}
function registerFailed(errors) {
  return new RuntimeError(3503, ngDevMode && `Unable to build the animation due to the following errors: ${errors.map((err) => err.message).join("\n")}`);
}
function missingOrDestroyedAnimation() {
  return new RuntimeError(3300, ngDevMode && "The requested animation doesn't exist or has already been destroyed");
}
function createAnimationFailed(errors) {
  return new RuntimeError(3504, ngDevMode && `Unable to create the animation due to the following errors:${errors.map((err) => err.message).join("\n")}`);
}
function missingPlayer(id2) {
  return new RuntimeError(3301, ngDevMode && `Unable to find the timeline player referenced by ${id2}`);
}
function missingTrigger(phase, name) {
  return new RuntimeError(3302, ngDevMode && `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn't exist!`);
}
function missingEvent(name) {
  return new RuntimeError(3303, ngDevMode && `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
}
function unsupportedTriggerEvent(phase, name) {
  return new RuntimeError(3400, ngDevMode && `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
}
function unregisteredTrigger(name) {
  return new RuntimeError(3401, ngDevMode && `The provided animation trigger "${name}" has not been registered!`);
}
function triggerTransitionsFailed(errors) {
  return new RuntimeError(3402, ngDevMode && `Unable to process animations due to the following failed trigger transitions
 ${errors.map((err) => err.message).join("\n")}`);
}
function transitionFailed(name, errors) {
  return new RuntimeError(3505, ngDevMode && `@${name} has failed due to:
 ${errors.map((err) => err.message).join("\n- ")}`);
}
var ANIMATABLE_PROP_SET = /* @__PURE__ */ new Set(["-moz-outline-radius", "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright", "-moz-outline-radius-topleft", "-moz-outline-radius-topright", "-ms-grid-columns", "-ms-grid-rows", "-webkit-line-clamp", "-webkit-text-fill-color", "-webkit-text-stroke", "-webkit-text-stroke-color", "accent-color", "all", "backdrop-filter", "background", "background-color", "background-position", "background-size", "block-size", "border", "border-block-end", "border-block-end-color", "border-block-end-width", "border-block-start", "border-block-start-color", "border-block-start-width", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-width", "border-color", "border-end-end-radius", "border-end-start-radius", "border-image-outset", "border-image-slice", "border-image-width", "border-inline-end", "border-inline-end-color", "border-inline-end-width", "border-inline-start", "border-inline-start-color", "border-inline-start-width", "border-left", "border-left-color", "border-left-width", "border-radius", "border-right", "border-right-color", "border-right-width", "border-start-end-radius", "border-start-start-radius", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-width", "border-width", "bottom", "box-shadow", "caret-color", "clip", "clip-path", "color", "column-count", "column-gap", "column-rule", "column-rule-color", "column-rule-width", "column-width", "columns", "filter", "flex", "flex-basis", "flex-grow", "flex-shrink", "font", "font-size", "font-size-adjust", "font-stretch", "font-variation-settings", "font-weight", "gap", "grid-column-gap", "grid-gap", "grid-row-gap", "grid-template-columns", "grid-template-rows", "height", "inline-size", "input-security", "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline", "inset-inline-end", "inset-inline-start", "left", "letter-spacing", "line-clamp", "line-height", "margin", "margin-block-end", "margin-block-start", "margin-bottom", "margin-inline-end", "margin-inline-start", "margin-left", "margin-right", "margin-top", "mask", "mask-border", "mask-position", "mask-size", "max-block-size", "max-height", "max-inline-size", "max-lines", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width", "object-position", "offset", "offset-anchor", "offset-distance", "offset-path", "offset-position", "offset-rotate", "opacity", "order", "outline", "outline-color", "outline-offset", "outline-width", "padding", "padding-block-end", "padding-block-start", "padding-bottom", "padding-inline-end", "padding-inline-start", "padding-left", "padding-right", "padding-top", "perspective", "perspective-origin", "right", "rotate", "row-gap", "scale", "scroll-margin", "scroll-margin-block", "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom", "scroll-margin-inline", "scroll-margin-inline-end", "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right", "scroll-margin-top", "scroll-padding", "scroll-padding-block", "scroll-padding-block-end", "scroll-padding-block-start", "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end", "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right", "scroll-padding-top", "scroll-snap-coordinate", "scroll-snap-destination", "scrollbar-color", "shape-image-threshold", "shape-margin", "shape-outside", "tab-size", "text-decoration", "text-decoration-color", "text-decoration-thickness", "text-emphasis", "text-emphasis-color", "text-indent", "text-shadow", "text-underline-offset", "top", "transform", "transform-origin", "translate", "vertical-align", "visibility", "width", "word-spacing", "z-index", "zoom"]);
function optimizeGroupPlayer(players) {
  switch (players.length) {
    case 0:
      return new NoopAnimationPlayer();
    case 1:
      return players[0];
    default:
      return new AnimationGroupPlayer(players);
  }
}
function normalizeKeyframes$1(normalizer, keyframes, preStyles = /* @__PURE__ */ new Map(), postStyles = /* @__PURE__ */ new Map()) {
  const errors = [];
  const normalizedKeyframes = [];
  let previousOffset = -1;
  let previousKeyframe = null;
  keyframes.forEach((kf) => {
    const offset2 = kf.get("offset");
    const isSameOffset = offset2 == previousOffset;
    const normalizedKeyframe = isSameOffset && previousKeyframe || /* @__PURE__ */ new Map();
    kf.forEach((val, prop) => {
      let normalizedProp = prop;
      let normalizedValue = val;
      if (prop !== "offset") {
        normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);
        switch (normalizedValue) {
          case \u0275PRE_STYLE:
            normalizedValue = preStyles.get(prop);
            break;
          case AUTO_STYLE:
            normalizedValue = postStyles.get(prop);
            break;
          default:
            normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);
            break;
        }
      }
      normalizedKeyframe.set(normalizedProp, normalizedValue);
    });
    if (!isSameOffset) {
      normalizedKeyframes.push(normalizedKeyframe);
    }
    previousKeyframe = normalizedKeyframe;
    previousOffset = offset2;
  });
  if (errors.length) {
    throw animationFailed(errors);
  }
  return normalizedKeyframes;
}
function listenOnPlayer(player, eventName, event, callback) {
  switch (eventName) {
    case "start":
      player.onStart(() => callback(event && copyAnimationEvent(event, "start", player)));
      break;
    case "done":
      player.onDone(() => callback(event && copyAnimationEvent(event, "done", player)));
      break;
    case "destroy":
      player.onDestroy(() => callback(event && copyAnimationEvent(event, "destroy", player)));
      break;
  }
}
function copyAnimationEvent(e, phaseName, player) {
  const totalTime = player.totalTime;
  const disabled = player.disabled ? true : false;
  const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == void 0 ? e.totalTime : totalTime, disabled);
  const data = e["_data"];
  if (data != null) {
    event["_data"] = data;
  }
  return event;
}
function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = "", totalTime = 0, disabled) {
  return {
    element,
    triggerName,
    fromState,
    toState,
    phaseName,
    totalTime,
    disabled: !!disabled
  };
}
function getOrSetDefaultValue(map2, key, defaultValue) {
  let value = map2.get(key);
  if (!value) {
    map2.set(key, value = defaultValue);
  }
  return value;
}
function parseTimelineCommand(command) {
  const separatorPos = command.indexOf(":");
  const id2 = command.substring(1, separatorPos);
  const action = command.slice(separatorPos + 1);
  return [id2, action];
}
var documentElement = /* @__PURE__ */ (() => typeof document === "undefined" ? null : document.documentElement)();
function getParentElement(element) {
  const parent = element.parentNode || element.host || null;
  if (parent === documentElement) {
    return null;
  }
  return parent;
}
function containsVendorPrefix(prop) {
  return prop.substring(1, 6) == "ebkit";
}
var _CACHED_BODY = null;
var _IS_WEBKIT = false;
function validateStyleProperty(prop) {
  if (!_CACHED_BODY) {
    _CACHED_BODY = getBodyNode() || {};
    _IS_WEBKIT = _CACHED_BODY.style ? "WebkitAppearance" in _CACHED_BODY.style : false;
  }
  let result = true;
  if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
    result = prop in _CACHED_BODY.style;
    if (!result && _IS_WEBKIT) {
      const camelProp = "Webkit" + prop.charAt(0).toUpperCase() + prop.slice(1);
      result = camelProp in _CACHED_BODY.style;
    }
  }
  return result;
}
function validateWebAnimatableStyleProperty(prop) {
  return ANIMATABLE_PROP_SET.has(prop);
}
function getBodyNode() {
  if (typeof document != "undefined") {
    return document.body;
  }
  return null;
}
function containsElement(elm1, elm2) {
  while (elm2) {
    if (elm2 === elm1) {
      return true;
    }
    elm2 = getParentElement(elm2);
  }
  return false;
}
function invokeQuery(element, selector, multi) {
  if (multi) {
    return Array.from(element.querySelectorAll(selector));
  }
  const elem = element.querySelector(selector);
  return elem ? [elem] : [];
}
var _NoopAnimationDriver = class _NoopAnimationDriver {
  /**
   * @returns Whether `prop` is a valid CSS property
   */
  validateStyleProperty(prop) {
    return validateStyleProperty(prop);
  }
  /**
   *
   * @returns Whether elm1 contains elm2.
   */
  containsElement(elm1, elm2) {
    return containsElement(elm1, elm2);
  }
  /**
   * @returns Rhe parent of the given element or `null` if the element is the `document`
   */
  getParentElement(element) {
    return getParentElement(element);
  }
  /**
   * @returns The result of the query selector on the element. The array will contain up to 1 item
   *     if `multi` is  `false`.
   */
  query(element, selector, multi) {
    return invokeQuery(element, selector, multi);
  }
  /**
   * @returns The `defaultValue` or empty string
   */
  computeStyle(element, prop, defaultValue) {
    return defaultValue || "";
  }
  /**
   * @returns An `NoopAnimationPlayer`
   */
  animate(element, keyframes, duration, delay2, easing, previousPlayers = [], scrubberAccessRequested) {
    return new NoopAnimationPlayer(duration, delay2);
  }
};
_NoopAnimationDriver.\u0275fac = function NoopAnimationDriver_Factory(t) {
  return new (t || _NoopAnimationDriver)();
};
_NoopAnimationDriver.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NoopAnimationDriver,
  factory: _NoopAnimationDriver.\u0275fac
});
var NoopAnimationDriver = _NoopAnimationDriver;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NoopAnimationDriver, [{
    type: Injectable
  }], null, null);
})();
var _AnimationDriver = class _AnimationDriver {
};
_AnimationDriver.NOOP = new NoopAnimationDriver();
var AnimationDriver = _AnimationDriver;
var AnimationStyleNormalizer = class {
};
var ONE_SECOND = 1e3;
var SUBSTITUTION_EXPR_START = "{{";
var SUBSTITUTION_EXPR_END = "}}";
var ENTER_CLASSNAME = "ng-enter";
var LEAVE_CLASSNAME = "ng-leave";
var NG_TRIGGER_CLASSNAME = "ng-trigger";
var NG_TRIGGER_SELECTOR = ".ng-trigger";
var NG_ANIMATING_CLASSNAME = "ng-animating";
var NG_ANIMATING_SELECTOR = ".ng-animating";
function resolveTimingValue(value) {
  if (typeof value == "number") return value;
  const matches = value.match(/^(-?[\.\d]+)(m?s)/);
  if (!matches || matches.length < 2) return 0;
  return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
}
function _convertTimeValueToMS(value, unit) {
  switch (unit) {
    case "s":
      return value * ONE_SECOND;
    default:
      return value;
  }
}
function resolveTiming(timings, errors, allowNegativeValues) {
  return timings.hasOwnProperty("duration") ? timings : parseTimeExpression(timings, errors, allowNegativeValues);
}
function parseTimeExpression(exp, errors, allowNegativeValues) {
  const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
  let duration;
  let delay2 = 0;
  let easing = "";
  if (typeof exp === "string") {
    const matches = exp.match(regex);
    if (matches === null) {
      errors.push(invalidTimingValue(exp));
      return {
        duration: 0,
        delay: 0,
        easing: ""
      };
    }
    duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
    const delayMatch = matches[3];
    if (delayMatch != null) {
      delay2 = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
    }
    const easingVal = matches[5];
    if (easingVal) {
      easing = easingVal;
    }
  } else {
    duration = exp;
  }
  if (!allowNegativeValues) {
    let containsErrors = false;
    let startIndex = errors.length;
    if (duration < 0) {
      errors.push(negativeStepValue());
      containsErrors = true;
    }
    if (delay2 < 0) {
      errors.push(negativeDelayValue());
      containsErrors = true;
    }
    if (containsErrors) {
      errors.splice(startIndex, 0, invalidTimingValue(exp));
    }
  }
  return {
    duration,
    delay: delay2,
    easing
  };
}
function normalizeKeyframes(keyframes) {
  if (!keyframes.length) {
    return [];
  }
  if (keyframes[0] instanceof Map) {
    return keyframes;
  }
  return keyframes.map((kf) => new Map(Object.entries(kf)));
}
function setStyles(element, styles, formerStyles) {
  styles.forEach((val, prop) => {
    const camelProp = dashCaseToCamelCase(prop);
    if (formerStyles && !formerStyles.has(prop)) {
      formerStyles.set(prop, element.style[camelProp]);
    }
    element.style[camelProp] = val;
  });
}
function eraseStyles(element, styles) {
  styles.forEach((_, prop) => {
    const camelProp = dashCaseToCamelCase(prop);
    element.style[camelProp] = "";
  });
}
function normalizeAnimationEntry(steps) {
  if (Array.isArray(steps)) {
    if (steps.length == 1) return steps[0];
    return sequence(steps);
  }
  return steps;
}
function validateStyleParams(value, options, errors) {
  const params = options.params || {};
  const matches = extractStyleParams(value);
  if (matches.length) {
    matches.forEach((varName) => {
      if (!params.hasOwnProperty(varName)) {
        errors.push(invalidStyleParams(varName));
      }
    });
  }
}
var PARAM_REGEX = new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, "g");
function extractStyleParams(value) {
  let params = [];
  if (typeof value === "string") {
    let match2;
    while (match2 = PARAM_REGEX.exec(value)) {
      params.push(match2[1]);
    }
    PARAM_REGEX.lastIndex = 0;
  }
  return params;
}
function interpolateParams(value, params, errors) {
  const original = `${value}`;
  const str2 = original.replace(PARAM_REGEX, (_, varName) => {
    let localVal = params[varName];
    if (localVal == null) {
      errors.push(invalidParamValue(varName));
      localVal = "";
    }
    return localVal.toString();
  });
  return str2 == original ? value : str2;
}
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
function dashCaseToCamelCase(input2) {
  return input2.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
}
function camelCaseToDashCase2(input2) {
  return input2.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
function allowPreviousPlayerStylesMerge(duration, delay2) {
  return duration === 0 || delay2 === 0;
}
function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
  if (previousStyles.size && keyframes.length) {
    let startingKeyframe = keyframes[0];
    let missingStyleProps = [];
    previousStyles.forEach((val, prop) => {
      if (!startingKeyframe.has(prop)) {
        missingStyleProps.push(prop);
      }
      startingKeyframe.set(prop, val);
    });
    if (missingStyleProps.length) {
      for (let i2 = 1; i2 < keyframes.length; i2++) {
        let kf = keyframes[i2];
        missingStyleProps.forEach((prop) => kf.set(prop, computeStyle(element, prop)));
      }
    }
  }
  return keyframes;
}
function visitDslNode(visitor, node, context2) {
  switch (node.type) {
    case AnimationMetadataType.Trigger:
      return visitor.visitTrigger(node, context2);
    case AnimationMetadataType.State:
      return visitor.visitState(node, context2);
    case AnimationMetadataType.Transition:
      return visitor.visitTransition(node, context2);
    case AnimationMetadataType.Sequence:
      return visitor.visitSequence(node, context2);
    case AnimationMetadataType.Group:
      return visitor.visitGroup(node, context2);
    case AnimationMetadataType.Animate:
      return visitor.visitAnimate(node, context2);
    case AnimationMetadataType.Keyframes:
      return visitor.visitKeyframes(node, context2);
    case AnimationMetadataType.Style:
      return visitor.visitStyle(node, context2);
    case AnimationMetadataType.Reference:
      return visitor.visitReference(node, context2);
    case AnimationMetadataType.AnimateChild:
      return visitor.visitAnimateChild(node, context2);
    case AnimationMetadataType.AnimateRef:
      return visitor.visitAnimateRef(node, context2);
    case AnimationMetadataType.Query:
      return visitor.visitQuery(node, context2);
    case AnimationMetadataType.Stagger:
      return visitor.visitStagger(node, context2);
    default:
      throw invalidNodeType(node.type);
  }
}
function computeStyle(element, prop) {
  return window.getComputedStyle(element)[prop];
}
var DIMENSIONAL_PROP_SET = /* @__PURE__ */ new Set(["width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "left", "top", "bottom", "right", "fontSize", "outlineWidth", "outlineOffset", "paddingTop", "paddingLeft", "paddingBottom", "paddingRight", "marginTop", "marginLeft", "marginBottom", "marginRight", "borderRadius", "borderWidth", "borderTopWidth", "borderLeftWidth", "borderRightWidth", "borderBottomWidth", "textIndent", "perspective"]);
var WebAnimationsStyleNormalizer = class extends AnimationStyleNormalizer {
  normalizePropertyName(propertyName, errors) {
    return dashCaseToCamelCase(propertyName);
  }
  normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) {
    let unit = "";
    const strVal = value.toString().trim();
    if (DIMENSIONAL_PROP_SET.has(normalizedProperty) && value !== 0 && value !== "0") {
      if (typeof value === "number") {
        unit = "px";
      } else {
        const valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/);
        if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
          errors.push(invalidCssUnitValue(userProvidedProperty, value));
        }
      }
    }
    return strVal + unit;
  }
};
function createListOfWarnings(warnings) {
  const LINE_START2 = "\n - ";
  return `${LINE_START2}${warnings.filter(Boolean).map((warning) => warning).join(LINE_START2)}`;
}
function warnTriggerBuild(name, warnings) {
  (typeof ngDevMode === "undefined" || ngDevMode) && console.warn(`The animation trigger "${name}" has built with the following warnings:${createListOfWarnings(warnings)}`);
}
function warnRegister(warnings) {
  (typeof ngDevMode === "undefined" || ngDevMode) && console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`);
}
function pushUnrecognizedPropertiesWarning(warnings, props) {
  if (props.length) {
    warnings.push(`The following provided properties are not recognized: ${props.join(", ")}`);
  }
}
var ANY_STATE = "*";
function parseTransitionExpr(transitionValue, errors) {
  const expressions2 = [];
  if (typeof transitionValue == "string") {
    transitionValue.split(/\s*,\s*/).forEach((str2) => parseInnerTransitionStr(str2, expressions2, errors));
  } else {
    expressions2.push(transitionValue);
  }
  return expressions2;
}
function parseInnerTransitionStr(eventStr, expressions2, errors) {
  if (eventStr[0] == ":") {
    const result = parseAnimationAlias(eventStr, errors);
    if (typeof result == "function") {
      expressions2.push(result);
      return;
    }
    eventStr = result;
  }
  const match2 = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
  if (match2 == null || match2.length < 4) {
    errors.push(invalidExpression(eventStr));
    return expressions2;
  }
  const fromState = match2[1];
  const separator = match2[2];
  const toState = match2[3];
  expressions2.push(makeLambdaFromStates(fromState, toState));
  const isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;
  if (separator[0] == "<" && !isFullAnyStateExpr) {
    expressions2.push(makeLambdaFromStates(toState, fromState));
  }
  return;
}
function parseAnimationAlias(alias, errors) {
  switch (alias) {
    case ":enter":
      return "void => *";
    case ":leave":
      return "* => void";
    case ":increment":
      return (fromState, toState) => parseFloat(toState) > parseFloat(fromState);
    case ":decrement":
      return (fromState, toState) => parseFloat(toState) < parseFloat(fromState);
    default:
      errors.push(invalidTransitionAlias(alias));
      return "* => *";
  }
}
var TRUE_BOOLEAN_VALUES = /* @__PURE__ */ new Set(["true", "1"]);
var FALSE_BOOLEAN_VALUES = /* @__PURE__ */ new Set(["false", "0"]);
function makeLambdaFromStates(lhs, rhs) {
  const LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);
  const RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);
  return (fromState, toState) => {
    let lhsMatch = lhs == ANY_STATE || lhs == fromState;
    let rhsMatch = rhs == ANY_STATE || rhs == toState;
    if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === "boolean") {
      lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);
    }
    if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === "boolean") {
      rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);
    }
    return lhsMatch && rhsMatch;
  };
}
var SELF_TOKEN = ":self";
var SELF_TOKEN_REGEX = new RegExp(`s*${SELF_TOKEN}s*,?`, "g");
function buildAnimationAst(driver, metadata, errors, warnings) {
  return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);
}
var ROOT_SELECTOR = "";
var AnimationAstBuilderVisitor = class {
  constructor(_driver) {
    this._driver = _driver;
  }
  build(metadata, errors, warnings) {
    const context2 = new AnimationAstBuilderContext(errors);
    this._resetContextStyleTimingState(context2);
    const ast = visitDslNode(this, normalizeAnimationEntry(metadata), context2);
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      if (context2.unsupportedCSSPropertiesFound.size) {
        pushUnrecognizedPropertiesWarning(warnings, [...context2.unsupportedCSSPropertiesFound.keys()]);
      }
    }
    return ast;
  }
  _resetContextStyleTimingState(context2) {
    context2.currentQuerySelector = ROOT_SELECTOR;
    context2.collectedStyles = /* @__PURE__ */ new Map();
    context2.collectedStyles.set(ROOT_SELECTOR, /* @__PURE__ */ new Map());
    context2.currentTime = 0;
  }
  visitTrigger(metadata, context2) {
    let queryCount = context2.queryCount = 0;
    let depCount = context2.depCount = 0;
    const states = [];
    const transitions = [];
    if (metadata.name.charAt(0) == "@") {
      context2.errors.push(invalidTrigger());
    }
    metadata.definitions.forEach((def) => {
      this._resetContextStyleTimingState(context2);
      if (def.type == AnimationMetadataType.State) {
        const stateDef = def;
        const name = stateDef.name;
        name.toString().split(/\s*,\s*/).forEach((n) => {
          stateDef.name = n;
          states.push(this.visitState(stateDef, context2));
        });
        stateDef.name = name;
      } else if (def.type == AnimationMetadataType.Transition) {
        const transition2 = this.visitTransition(def, context2);
        queryCount += transition2.queryCount;
        depCount += transition2.depCount;
        transitions.push(transition2);
      } else {
        context2.errors.push(invalidDefinition());
      }
    });
    return {
      type: AnimationMetadataType.Trigger,
      name: metadata.name,
      states,
      transitions,
      queryCount,
      depCount,
      options: null
    };
  }
  visitState(metadata, context2) {
    const styleAst = this.visitStyle(metadata.styles, context2);
    const astParams = metadata.options && metadata.options.params || null;
    if (styleAst.containsDynamicStyles) {
      const missingSubs = /* @__PURE__ */ new Set();
      const params = astParams || {};
      styleAst.styles.forEach((style2) => {
        if (style2 instanceof Map) {
          style2.forEach((value) => {
            extractStyleParams(value).forEach((sub) => {
              if (!params.hasOwnProperty(sub)) {
                missingSubs.add(sub);
              }
            });
          });
        }
      });
      if (missingSubs.size) {
        context2.errors.push(invalidState(metadata.name, [...missingSubs.values()]));
      }
    }
    return {
      type: AnimationMetadataType.State,
      name: metadata.name,
      style: styleAst,
      options: astParams ? {
        params: astParams
      } : null
    };
  }
  visitTransition(metadata, context2) {
    context2.queryCount = 0;
    context2.depCount = 0;
    const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context2);
    const matchers = parseTransitionExpr(metadata.expr, context2.errors);
    return {
      type: AnimationMetadataType.Transition,
      matchers,
      animation,
      queryCount: context2.queryCount,
      depCount: context2.depCount,
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitSequence(metadata, context2) {
    return {
      type: AnimationMetadataType.Sequence,
      steps: metadata.steps.map((s) => visitDslNode(this, s, context2)),
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitGroup(metadata, context2) {
    const currentTime = context2.currentTime;
    let furthestTime = 0;
    const steps = metadata.steps.map((step) => {
      context2.currentTime = currentTime;
      const innerAst = visitDslNode(this, step, context2);
      furthestTime = Math.max(furthestTime, context2.currentTime);
      return innerAst;
    });
    context2.currentTime = furthestTime;
    return {
      type: AnimationMetadataType.Group,
      steps,
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitAnimate(metadata, context2) {
    const timingAst = constructTimingAst(metadata.timings, context2.errors);
    context2.currentAnimateTimings = timingAst;
    let styleAst;
    let styleMetadata = metadata.styles ? metadata.styles : style({});
    if (styleMetadata.type == AnimationMetadataType.Keyframes) {
      styleAst = this.visitKeyframes(styleMetadata, context2);
    } else {
      let styleMetadata2 = metadata.styles;
      let isEmpty4 = false;
      if (!styleMetadata2) {
        isEmpty4 = true;
        const newStyleData = {};
        if (timingAst.easing) {
          newStyleData["easing"] = timingAst.easing;
        }
        styleMetadata2 = style(newStyleData);
      }
      context2.currentTime += timingAst.duration + timingAst.delay;
      const _styleAst = this.visitStyle(styleMetadata2, context2);
      _styleAst.isEmptyStep = isEmpty4;
      styleAst = _styleAst;
    }
    context2.currentAnimateTimings = null;
    return {
      type: AnimationMetadataType.Animate,
      timings: timingAst,
      style: styleAst,
      options: null
    };
  }
  visitStyle(metadata, context2) {
    const ast = this._makeStyleAst(metadata, context2);
    this._validateStyleAst(ast, context2);
    return ast;
  }
  _makeStyleAst(metadata, context2) {
    const styles = [];
    const metadataStyles = Array.isArray(metadata.styles) ? metadata.styles : [metadata.styles];
    for (let styleTuple of metadataStyles) {
      if (typeof styleTuple === "string") {
        if (styleTuple === AUTO_STYLE) {
          styles.push(styleTuple);
        } else {
          context2.errors.push(invalidStyleValue(styleTuple));
        }
      } else {
        styles.push(new Map(Object.entries(styleTuple)));
      }
    }
    let containsDynamicStyles = false;
    let collectedEasing = null;
    styles.forEach((styleData) => {
      if (styleData instanceof Map) {
        if (styleData.has("easing")) {
          collectedEasing = styleData.get("easing");
          styleData.delete("easing");
        }
        if (!containsDynamicStyles) {
          for (let value of styleData.values()) {
            if (value.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {
              containsDynamicStyles = true;
              break;
            }
          }
        }
      }
    });
    return {
      type: AnimationMetadataType.Style,
      styles,
      easing: collectedEasing,
      offset: metadata.offset,
      containsDynamicStyles,
      options: null
    };
  }
  _validateStyleAst(ast, context2) {
    const timings = context2.currentAnimateTimings;
    let endTime = context2.currentTime;
    let startTime = context2.currentTime;
    if (timings && startTime > 0) {
      startTime -= timings.duration + timings.delay;
    }
    ast.styles.forEach((tuple) => {
      if (typeof tuple === "string") return;
      tuple.forEach((value, prop) => {
        if (typeof ngDevMode === "undefined" || ngDevMode) {
          if (!this._driver.validateStyleProperty(prop)) {
            tuple.delete(prop);
            context2.unsupportedCSSPropertiesFound.add(prop);
            return;
          }
        }
        const collectedStyles = context2.collectedStyles.get(context2.currentQuerySelector);
        const collectedEntry = collectedStyles.get(prop);
        let updateCollectedStyle = true;
        if (collectedEntry) {
          if (startTime != endTime && startTime >= collectedEntry.startTime && endTime <= collectedEntry.endTime) {
            context2.errors.push(invalidParallelAnimation(prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime));
            updateCollectedStyle = false;
          }
          startTime = collectedEntry.startTime;
        }
        if (updateCollectedStyle) {
          collectedStyles.set(prop, {
            startTime,
            endTime
          });
        }
        if (context2.options) {
          validateStyleParams(value, context2.options, context2.errors);
        }
      });
    });
  }
  visitKeyframes(metadata, context2) {
    const ast = {
      type: AnimationMetadataType.Keyframes,
      styles: [],
      options: null
    };
    if (!context2.currentAnimateTimings) {
      context2.errors.push(invalidKeyframes());
      return ast;
    }
    const MAX_KEYFRAME_OFFSET = 1;
    let totalKeyframesWithOffsets = 0;
    const offsets = [];
    let offsetsOutOfOrder = false;
    let keyframesOutOfRange = false;
    let previousOffset = 0;
    const keyframes = metadata.steps.map((styles) => {
      const style2 = this._makeStyleAst(styles, context2);
      let offsetVal = style2.offset != null ? style2.offset : consumeOffset(style2.styles);
      let offset2 = 0;
      if (offsetVal != null) {
        totalKeyframesWithOffsets++;
        offset2 = style2.offset = offsetVal;
      }
      keyframesOutOfRange = keyframesOutOfRange || offset2 < 0 || offset2 > 1;
      offsetsOutOfOrder = offsetsOutOfOrder || offset2 < previousOffset;
      previousOffset = offset2;
      offsets.push(offset2);
      return style2;
    });
    if (keyframesOutOfRange) {
      context2.errors.push(invalidOffset());
    }
    if (offsetsOutOfOrder) {
      context2.errors.push(keyframeOffsetsOutOfOrder());
    }
    const length = metadata.steps.length;
    let generatedOffset = 0;
    if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {
      context2.errors.push(keyframesMissingOffsets());
    } else if (totalKeyframesWithOffsets == 0) {
      generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);
    }
    const limit = length - 1;
    const currentTime = context2.currentTime;
    const currentAnimateTimings = context2.currentAnimateTimings;
    const animateDuration = currentAnimateTimings.duration;
    keyframes.forEach((kf, i2) => {
      const offset2 = generatedOffset > 0 ? i2 == limit ? 1 : generatedOffset * i2 : offsets[i2];
      const durationUpToThisFrame = offset2 * animateDuration;
      context2.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;
      currentAnimateTimings.duration = durationUpToThisFrame;
      this._validateStyleAst(kf, context2);
      kf.offset = offset2;
      ast.styles.push(kf);
    });
    return ast;
  }
  visitReference(metadata, context2) {
    return {
      type: AnimationMetadataType.Reference,
      animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context2),
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitAnimateChild(metadata, context2) {
    context2.depCount++;
    return {
      type: AnimationMetadataType.AnimateChild,
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitAnimateRef(metadata, context2) {
    return {
      type: AnimationMetadataType.AnimateRef,
      animation: this.visitReference(metadata.animation, context2),
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitQuery(metadata, context2) {
    const parentSelector = context2.currentQuerySelector;
    const options = metadata.options || {};
    context2.queryCount++;
    context2.currentQuery = metadata;
    const [selector, includeSelf] = normalizeSelector(metadata.selector);
    context2.currentQuerySelector = parentSelector.length ? parentSelector + " " + selector : selector;
    getOrSetDefaultValue(context2.collectedStyles, context2.currentQuerySelector, /* @__PURE__ */ new Map());
    const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context2);
    context2.currentQuery = null;
    context2.currentQuerySelector = parentSelector;
    return {
      type: AnimationMetadataType.Query,
      selector,
      limit: options.limit || 0,
      optional: !!options.optional,
      includeSelf,
      animation,
      originalSelector: metadata.selector,
      options: normalizeAnimationOptions(metadata.options)
    };
  }
  visitStagger(metadata, context2) {
    if (!context2.currentQuery) {
      context2.errors.push(invalidStagger());
    }
    const timings = metadata.timings === "full" ? {
      duration: 0,
      delay: 0,
      easing: "full"
    } : resolveTiming(metadata.timings, context2.errors, true);
    return {
      type: AnimationMetadataType.Stagger,
      animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context2),
      timings,
      options: null
    };
  }
};
function normalizeSelector(selector) {
  const hasAmpersand = selector.split(/\s*,\s*/).find((token) => token == SELF_TOKEN) ? true : false;
  if (hasAmpersand) {
    selector = selector.replace(SELF_TOKEN_REGEX, "");
  }
  selector = selector.replace(/@\*/g, NG_TRIGGER_SELECTOR).replace(/@\w+/g, (match2) => NG_TRIGGER_SELECTOR + "-" + match2.slice(1)).replace(/:animating/g, NG_ANIMATING_SELECTOR);
  return [selector, hasAmpersand];
}
function normalizeParams(obj) {
  return obj ? __spreadValues({}, obj) : null;
}
var AnimationAstBuilderContext = class {
  constructor(errors) {
    this.errors = errors;
    this.queryCount = 0;
    this.depCount = 0;
    this.currentTransition = null;
    this.currentQuery = null;
    this.currentQuerySelector = null;
    this.currentAnimateTimings = null;
    this.currentTime = 0;
    this.collectedStyles = /* @__PURE__ */ new Map();
    this.options = null;
    this.unsupportedCSSPropertiesFound = /* @__PURE__ */ new Set();
  }
};
function consumeOffset(styles) {
  if (typeof styles == "string") return null;
  let offset2 = null;
  if (Array.isArray(styles)) {
    styles.forEach((styleTuple) => {
      if (styleTuple instanceof Map && styleTuple.has("offset")) {
        const obj = styleTuple;
        offset2 = parseFloat(obj.get("offset"));
        obj.delete("offset");
      }
    });
  } else if (styles instanceof Map && styles.has("offset")) {
    const obj = styles;
    offset2 = parseFloat(obj.get("offset"));
    obj.delete("offset");
  }
  return offset2;
}
function constructTimingAst(value, errors) {
  if (value.hasOwnProperty("duration")) {
    return value;
  }
  if (typeof value == "number") {
    const duration = resolveTiming(value, errors).duration;
    return makeTimingAst(duration, 0, "");
  }
  const strValue = value;
  const isDynamic = strValue.split(/\s+/).some((v) => v.charAt(0) == "{" && v.charAt(1) == "{");
  if (isDynamic) {
    const ast = makeTimingAst(0, 0, "");
    ast.dynamic = true;
    ast.strValue = strValue;
    return ast;
  }
  const timings = resolveTiming(strValue, errors);
  return makeTimingAst(timings.duration, timings.delay, timings.easing);
}
function normalizeAnimationOptions(options) {
  if (options) {
    options = __spreadValues({}, options);
    if (options["params"]) {
      options["params"] = normalizeParams(options["params"]);
    }
  } else {
    options = {};
  }
  return options;
}
function makeTimingAst(duration, delay2, easing) {
  return {
    duration,
    delay: delay2,
    easing
  };
}
function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay2, easing = null, subTimeline = false) {
  return {
    type: 1,
    element,
    keyframes,
    preStyleProps,
    postStyleProps,
    duration,
    delay: delay2,
    totalTime: duration + delay2,
    easing,
    subTimeline
  };
}
var ElementInstructionMap = class {
  constructor() {
    this._map = /* @__PURE__ */ new Map();
  }
  get(element) {
    return this._map.get(element) || [];
  }
  append(element, instructions) {
    let existingInstructions = this._map.get(element);
    if (!existingInstructions) {
      this._map.set(element, existingInstructions = []);
    }
    existingInstructions.push(...instructions);
  }
  has(element) {
    return this._map.has(element);
  }
  clear() {
    this._map.clear();
  }
};
var ONE_FRAME_IN_MILLISECONDS = 1;
var ENTER_TOKEN = ":enter";
var ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, "g");
var LEAVE_TOKEN = ":leave";
var LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, "g");
function buildAnimationTimelines(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles = /* @__PURE__ */ new Map(), finalStyles = /* @__PURE__ */ new Map(), options, subInstructions, errors = []) {
  return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors);
}
var AnimationTimelineBuilderVisitor = class {
  buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors = []) {
    subInstructions = subInstructions || new ElementInstructionMap();
    const context2 = new AnimationTimelineContext(driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []);
    context2.options = options;
    const delay2 = options.delay ? resolveTimingValue(options.delay) : 0;
    context2.currentTimeline.delayNextStep(delay2);
    context2.currentTimeline.setStyles([startingStyles], null, context2.errors, options);
    visitDslNode(this, ast, context2);
    const timelines = context2.timelines.filter((timeline) => timeline.containsAnimation());
    if (timelines.length && finalStyles.size) {
      let lastRootTimeline;
      for (let i2 = timelines.length - 1; i2 >= 0; i2--) {
        const timeline = timelines[i2];
        if (timeline.element === rootElement) {
          lastRootTimeline = timeline;
          break;
        }
      }
      if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) {
        lastRootTimeline.setStyles([finalStyles], null, context2.errors, options);
      }
    }
    return timelines.length ? timelines.map((timeline) => timeline.buildKeyframes()) : [createTimelineInstruction(rootElement, [], [], [], 0, delay2, "", false)];
  }
  visitTrigger(ast, context2) {
  }
  visitState(ast, context2) {
  }
  visitTransition(ast, context2) {
  }
  visitAnimateChild(ast, context2) {
    const elementInstructions = context2.subInstructions.get(context2.element);
    if (elementInstructions) {
      const innerContext = context2.createSubContext(ast.options);
      const startTime = context2.currentTimeline.currentTime;
      const endTime = this._visitSubInstructions(elementInstructions, innerContext, innerContext.options);
      if (startTime != endTime) {
        context2.transformIntoNewTimeline(endTime);
      }
    }
    context2.previousNode = ast;
  }
  visitAnimateRef(ast, context2) {
    const innerContext = context2.createSubContext(ast.options);
    innerContext.transformIntoNewTimeline();
    this._applyAnimationRefDelays([ast.options, ast.animation.options], context2, innerContext);
    this.visitReference(ast.animation, innerContext);
    context2.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);
    context2.previousNode = ast;
  }
  _applyAnimationRefDelays(animationsRefsOptions, context2, innerContext) {
    for (const animationRefOptions of animationsRefsOptions) {
      const animationDelay = animationRefOptions?.delay;
      if (animationDelay) {
        const animationDelayValue = typeof animationDelay === "number" ? animationDelay : resolveTimingValue(interpolateParams(animationDelay, animationRefOptions?.params ?? {}, context2.errors));
        innerContext.delayNextStep(animationDelayValue);
      }
    }
  }
  _visitSubInstructions(instructions, context2, options) {
    const startTime = context2.currentTimeline.currentTime;
    let furthestTime = startTime;
    const duration = options.duration != null ? resolveTimingValue(options.duration) : null;
    const delay2 = options.delay != null ? resolveTimingValue(options.delay) : null;
    if (duration !== 0) {
      instructions.forEach((instruction) => {
        const instructionTimings = context2.appendInstructionToTimeline(instruction, duration, delay2);
        furthestTime = Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);
      });
    }
    return furthestTime;
  }
  visitReference(ast, context2) {
    context2.updateOptions(ast.options, true);
    visitDslNode(this, ast.animation, context2);
    context2.previousNode = ast;
  }
  visitSequence(ast, context2) {
    const subContextCount = context2.subContextCount;
    let ctx = context2;
    const options = ast.options;
    if (options && (options.params || options.delay)) {
      ctx = context2.createSubContext(options);
      ctx.transformIntoNewTimeline();
      if (options.delay != null) {
        if (ctx.previousNode.type == AnimationMetadataType.Style) {
          ctx.currentTimeline.snapshotCurrentStyles();
          ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
        }
        const delay2 = resolveTimingValue(options.delay);
        ctx.delayNextStep(delay2);
      }
    }
    if (ast.steps.length) {
      ast.steps.forEach((s) => visitDslNode(this, s, ctx));
      ctx.currentTimeline.applyStylesToKeyframe();
      if (ctx.subContextCount > subContextCount) {
        ctx.transformIntoNewTimeline();
      }
    }
    context2.previousNode = ast;
  }
  visitGroup(ast, context2) {
    const innerTimelines = [];
    let furthestTime = context2.currentTimeline.currentTime;
    const delay2 = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;
    ast.steps.forEach((s) => {
      const innerContext = context2.createSubContext(ast.options);
      if (delay2) {
        innerContext.delayNextStep(delay2);
      }
      visitDslNode(this, s, innerContext);
      furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
      innerTimelines.push(innerContext.currentTimeline);
    });
    innerTimelines.forEach((timeline) => context2.currentTimeline.mergeTimelineCollectedStyles(timeline));
    context2.transformIntoNewTimeline(furthestTime);
    context2.previousNode = ast;
  }
  _visitTiming(ast, context2) {
    if (ast.dynamic) {
      const strValue = ast.strValue;
      const timingValue = context2.params ? interpolateParams(strValue, context2.params, context2.errors) : strValue;
      return resolveTiming(timingValue, context2.errors);
    } else {
      return {
        duration: ast.duration,
        delay: ast.delay,
        easing: ast.easing
      };
    }
  }
  visitAnimate(ast, context2) {
    const timings = context2.currentAnimateTimings = this._visitTiming(ast.timings, context2);
    const timeline = context2.currentTimeline;
    if (timings.delay) {
      context2.incrementTime(timings.delay);
      timeline.snapshotCurrentStyles();
    }
    const style2 = ast.style;
    if (style2.type == AnimationMetadataType.Keyframes) {
      this.visitKeyframes(style2, context2);
    } else {
      context2.incrementTime(timings.duration);
      this.visitStyle(style2, context2);
      timeline.applyStylesToKeyframe();
    }
    context2.currentAnimateTimings = null;
    context2.previousNode = ast;
  }
  visitStyle(ast, context2) {
    const timeline = context2.currentTimeline;
    const timings = context2.currentAnimateTimings;
    if (!timings && timeline.hasCurrentStyleProperties()) {
      timeline.forwardFrame();
    }
    const easing = timings && timings.easing || ast.easing;
    if (ast.isEmptyStep) {
      timeline.applyEmptyStep(easing);
    } else {
      timeline.setStyles(ast.styles, easing, context2.errors, context2.options);
    }
    context2.previousNode = ast;
  }
  visitKeyframes(ast, context2) {
    const currentAnimateTimings = context2.currentAnimateTimings;
    const startTime = context2.currentTimeline.duration;
    const duration = currentAnimateTimings.duration;
    const innerContext = context2.createSubContext();
    const innerTimeline = innerContext.currentTimeline;
    innerTimeline.easing = currentAnimateTimings.easing;
    ast.styles.forEach((step) => {
      const offset2 = step.offset || 0;
      innerTimeline.forwardTime(offset2 * duration);
      innerTimeline.setStyles(step.styles, step.easing, context2.errors, context2.options);
      innerTimeline.applyStylesToKeyframe();
    });
    context2.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);
    context2.transformIntoNewTimeline(startTime + duration);
    context2.previousNode = ast;
  }
  visitQuery(ast, context2) {
    const startTime = context2.currentTimeline.currentTime;
    const options = ast.options || {};
    const delay2 = options.delay ? resolveTimingValue(options.delay) : 0;
    if (delay2 && (context2.previousNode.type === AnimationMetadataType.Style || startTime == 0 && context2.currentTimeline.hasCurrentStyleProperties())) {
      context2.currentTimeline.snapshotCurrentStyles();
      context2.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
    }
    let furthestTime = startTime;
    const elms = context2.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context2.errors);
    context2.currentQueryTotal = elms.length;
    let sameElementTimeline = null;
    elms.forEach((element, i2) => {
      context2.currentQueryIndex = i2;
      const innerContext = context2.createSubContext(ast.options, element);
      if (delay2) {
        innerContext.delayNextStep(delay2);
      }
      if (element === context2.element) {
        sameElementTimeline = innerContext.currentTimeline;
      }
      visitDslNode(this, ast.animation, innerContext);
      innerContext.currentTimeline.applyStylesToKeyframe();
      const endTime = innerContext.currentTimeline.currentTime;
      furthestTime = Math.max(furthestTime, endTime);
    });
    context2.currentQueryIndex = 0;
    context2.currentQueryTotal = 0;
    context2.transformIntoNewTimeline(furthestTime);
    if (sameElementTimeline) {
      context2.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);
      context2.currentTimeline.snapshotCurrentStyles();
    }
    context2.previousNode = ast;
  }
  visitStagger(ast, context2) {
    const parentContext = context2.parentContext;
    const tl = context2.currentTimeline;
    const timings = ast.timings;
    const duration = Math.abs(timings.duration);
    const maxTime = duration * (context2.currentQueryTotal - 1);
    let delay2 = duration * context2.currentQueryIndex;
    let staggerTransformer = timings.duration < 0 ? "reverse" : timings.easing;
    switch (staggerTransformer) {
      case "reverse":
        delay2 = maxTime - delay2;
        break;
      case "full":
        delay2 = parentContext.currentStaggerTime;
        break;
    }
    const timeline = context2.currentTimeline;
    if (delay2) {
      timeline.delayNextStep(delay2);
    }
    const startingTime = timeline.currentTime;
    visitDslNode(this, ast.animation, context2);
    context2.previousNode = ast;
    parentContext.currentStaggerTime = tl.currentTime - startingTime + (tl.startTime - parentContext.currentTimeline.startTime);
  }
};
var DEFAULT_NOOP_PREVIOUS_NODE = {};
var AnimationTimelineContext = class _AnimationTimelineContext {
  constructor(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) {
    this._driver = _driver;
    this.element = element;
    this.subInstructions = subInstructions;
    this._enterClassName = _enterClassName;
    this._leaveClassName = _leaveClassName;
    this.errors = errors;
    this.timelines = timelines;
    this.parentContext = null;
    this.currentAnimateTimings = null;
    this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
    this.subContextCount = 0;
    this.options = {};
    this.currentQueryIndex = 0;
    this.currentQueryTotal = 0;
    this.currentStaggerTime = 0;
    this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);
    timelines.push(this.currentTimeline);
  }
  get params() {
    return this.options.params;
  }
  updateOptions(options, skipIfExists) {
    if (!options) return;
    const newOptions = options;
    let optionsToUpdate = this.options;
    if (newOptions.duration != null) {
      optionsToUpdate.duration = resolveTimingValue(newOptions.duration);
    }
    if (newOptions.delay != null) {
      optionsToUpdate.delay = resolveTimingValue(newOptions.delay);
    }
    const newParams = newOptions.params;
    if (newParams) {
      let paramsToUpdate = optionsToUpdate.params;
      if (!paramsToUpdate) {
        paramsToUpdate = this.options.params = {};
      }
      Object.keys(newParams).forEach((name) => {
        if (!skipIfExists || !paramsToUpdate.hasOwnProperty(name)) {
          paramsToUpdate[name] = interpolateParams(newParams[name], paramsToUpdate, this.errors);
        }
      });
    }
  }
  _copyOptions() {
    const options = {};
    if (this.options) {
      const oldParams = this.options.params;
      if (oldParams) {
        const params = options["params"] = {};
        Object.keys(oldParams).forEach((name) => {
          params[name] = oldParams[name];
        });
      }
    }
    return options;
  }
  createSubContext(options = null, element, newTime) {
    const target = element || this.element;
    const context2 = new _AnimationTimelineContext(this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));
    context2.previousNode = this.previousNode;
    context2.currentAnimateTimings = this.currentAnimateTimings;
    context2.options = this._copyOptions();
    context2.updateOptions(options);
    context2.currentQueryIndex = this.currentQueryIndex;
    context2.currentQueryTotal = this.currentQueryTotal;
    context2.parentContext = this;
    this.subContextCount++;
    return context2;
  }
  transformIntoNewTimeline(newTime) {
    this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
    this.currentTimeline = this.currentTimeline.fork(this.element, newTime);
    this.timelines.push(this.currentTimeline);
    return this.currentTimeline;
  }
  appendInstructionToTimeline(instruction, duration, delay2) {
    const updatedTimings = {
      duration: duration != null ? duration : instruction.duration,
      delay: this.currentTimeline.currentTime + (delay2 != null ? delay2 : 0) + instruction.delay,
      easing: ""
    };
    const builder = new SubTimelineBuilder(this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);
    this.timelines.push(builder);
    return updatedTimings;
  }
  incrementTime(time) {
    this.currentTimeline.forwardTime(this.currentTimeline.duration + time);
  }
  delayNextStep(delay2) {
    if (delay2 > 0) {
      this.currentTimeline.delayNextStep(delay2);
    }
  }
  invokeQuery(selector, originalSelector, limit, includeSelf, optional, errors) {
    let results = [];
    if (includeSelf) {
      results.push(this.element);
    }
    if (selector.length > 0) {
      selector = selector.replace(ENTER_TOKEN_REGEX, "." + this._enterClassName);
      selector = selector.replace(LEAVE_TOKEN_REGEX, "." + this._leaveClassName);
      const multi = limit != 1;
      let elements = this._driver.query(this.element, selector, multi);
      if (limit !== 0) {
        elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) : elements.slice(0, limit);
      }
      results.push(...elements);
    }
    if (!optional && results.length == 0) {
      errors.push(invalidQuery(originalSelector));
    }
    return results;
  }
};
var TimelineBuilder = class _TimelineBuilder {
  constructor(_driver, element, startTime, _elementTimelineStylesLookup) {
    this._driver = _driver;
    this.element = element;
    this.startTime = startTime;
    this._elementTimelineStylesLookup = _elementTimelineStylesLookup;
    this.duration = 0;
    this.easing = null;
    this._previousKeyframe = /* @__PURE__ */ new Map();
    this._currentKeyframe = /* @__PURE__ */ new Map();
    this._keyframes = /* @__PURE__ */ new Map();
    this._styleSummary = /* @__PURE__ */ new Map();
    this._localTimelineStyles = /* @__PURE__ */ new Map();
    this._pendingStyles = /* @__PURE__ */ new Map();
    this._backFill = /* @__PURE__ */ new Map();
    this._currentEmptyStepKeyframe = null;
    if (!this._elementTimelineStylesLookup) {
      this._elementTimelineStylesLookup = /* @__PURE__ */ new Map();
    }
    this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);
    if (!this._globalTimelineStyles) {
      this._globalTimelineStyles = this._localTimelineStyles;
      this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);
    }
    this._loadKeyframe();
  }
  containsAnimation() {
    switch (this._keyframes.size) {
      case 0:
        return false;
      case 1:
        return this.hasCurrentStyleProperties();
      default:
        return true;
    }
  }
  hasCurrentStyleProperties() {
    return this._currentKeyframe.size > 0;
  }
  get currentTime() {
    return this.startTime + this.duration;
  }
  delayNextStep(delay2) {
    const hasPreStyleStep = this._keyframes.size === 1 && this._pendingStyles.size;
    if (this.duration || hasPreStyleStep) {
      this.forwardTime(this.currentTime + delay2);
      if (hasPreStyleStep) {
        this.snapshotCurrentStyles();
      }
    } else {
      this.startTime += delay2;
    }
  }
  fork(element, currentTime) {
    this.applyStylesToKeyframe();
    return new _TimelineBuilder(this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup);
  }
  _loadKeyframe() {
    if (this._currentKeyframe) {
      this._previousKeyframe = this._currentKeyframe;
    }
    this._currentKeyframe = this._keyframes.get(this.duration);
    if (!this._currentKeyframe) {
      this._currentKeyframe = /* @__PURE__ */ new Map();
      this._keyframes.set(this.duration, this._currentKeyframe);
    }
  }
  forwardFrame() {
    this.duration += ONE_FRAME_IN_MILLISECONDS;
    this._loadKeyframe();
  }
  forwardTime(time) {
    this.applyStylesToKeyframe();
    this.duration = time;
    this._loadKeyframe();
  }
  _updateStyle(prop, value) {
    this._localTimelineStyles.set(prop, value);
    this._globalTimelineStyles.set(prop, value);
    this._styleSummary.set(prop, {
      time: this.currentTime,
      value
    });
  }
  allowOnlyTimelineStyles() {
    return this._currentEmptyStepKeyframe !== this._currentKeyframe;
  }
  applyEmptyStep(easing) {
    if (easing) {
      this._previousKeyframe.set("easing", easing);
    }
    for (let [prop, value] of this._globalTimelineStyles) {
      this._backFill.set(prop, value || AUTO_STYLE);
      this._currentKeyframe.set(prop, AUTO_STYLE);
    }
    this._currentEmptyStepKeyframe = this._currentKeyframe;
  }
  setStyles(input2, easing, errors, options) {
    if (easing) {
      this._previousKeyframe.set("easing", easing);
    }
    const params = options && options.params || {};
    const styles = flattenStyles(input2, this._globalTimelineStyles);
    for (let [prop, value] of styles) {
      const val = interpolateParams(value, params, errors);
      this._pendingStyles.set(prop, val);
      if (!this._localTimelineStyles.has(prop)) {
        this._backFill.set(prop, this._globalTimelineStyles.get(prop) ?? AUTO_STYLE);
      }
      this._updateStyle(prop, val);
    }
  }
  applyStylesToKeyframe() {
    if (this._pendingStyles.size == 0) return;
    this._pendingStyles.forEach((val, prop) => {
      this._currentKeyframe.set(prop, val);
    });
    this._pendingStyles.clear();
    this._localTimelineStyles.forEach((val, prop) => {
      if (!this._currentKeyframe.has(prop)) {
        this._currentKeyframe.set(prop, val);
      }
    });
  }
  snapshotCurrentStyles() {
    for (let [prop, val] of this._localTimelineStyles) {
      this._pendingStyles.set(prop, val);
      this._updateStyle(prop, val);
    }
  }
  getFinalKeyframe() {
    return this._keyframes.get(this.duration);
  }
  get properties() {
    const properties2 = [];
    for (let prop in this._currentKeyframe) {
      properties2.push(prop);
    }
    return properties2;
  }
  mergeTimelineCollectedStyles(timeline) {
    timeline._styleSummary.forEach((details1, prop) => {
      const details0 = this._styleSummary.get(prop);
      if (!details0 || details1.time > details0.time) {
        this._updateStyle(prop, details1.value);
      }
    });
  }
  buildKeyframes() {
    this.applyStylesToKeyframe();
    const preStyleProps = /* @__PURE__ */ new Set();
    const postStyleProps = /* @__PURE__ */ new Set();
    const isEmpty4 = this._keyframes.size === 1 && this.duration === 0;
    let finalKeyframes = [];
    this._keyframes.forEach((keyframe, time) => {
      const finalKeyframe = new Map([...this._backFill, ...keyframe]);
      finalKeyframe.forEach((value, prop) => {
        if (value === \u0275PRE_STYLE) {
          preStyleProps.add(prop);
        } else if (value === AUTO_STYLE) {
          postStyleProps.add(prop);
        }
      });
      if (!isEmpty4) {
        finalKeyframe.set("offset", time / this.duration);
      }
      finalKeyframes.push(finalKeyframe);
    });
    const preProps = [...preStyleProps.values()];
    const postProps = [...postStyleProps.values()];
    if (isEmpty4) {
      const kf0 = finalKeyframes[0];
      const kf1 = new Map(kf0);
      kf0.set("offset", 0);
      kf1.set("offset", 1);
      finalKeyframes = [kf0, kf1];
    }
    return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);
  }
};
var SubTimelineBuilder = class extends TimelineBuilder {
  constructor(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe = false) {
    super(driver, element, timings.delay);
    this.keyframes = keyframes;
    this.preStyleProps = preStyleProps;
    this.postStyleProps = postStyleProps;
    this._stretchStartingKeyframe = _stretchStartingKeyframe;
    this.timings = {
      duration: timings.duration,
      delay: timings.delay,
      easing: timings.easing
    };
  }
  containsAnimation() {
    return this.keyframes.length > 1;
  }
  buildKeyframes() {
    let keyframes = this.keyframes;
    let {
      delay: delay2,
      duration,
      easing
    } = this.timings;
    if (this._stretchStartingKeyframe && delay2) {
      const newKeyframes = [];
      const totalTime = duration + delay2;
      const startingGap = delay2 / totalTime;
      const newFirstKeyframe = new Map(keyframes[0]);
      newFirstKeyframe.set("offset", 0);
      newKeyframes.push(newFirstKeyframe);
      const oldFirstKeyframe = new Map(keyframes[0]);
      oldFirstKeyframe.set("offset", roundOffset(startingGap));
      newKeyframes.push(oldFirstKeyframe);
      const limit = keyframes.length - 1;
      for (let i2 = 1; i2 <= limit; i2++) {
        let kf = new Map(keyframes[i2]);
        const oldOffset = kf.get("offset");
        const timeAtKeyframe = delay2 + oldOffset * duration;
        kf.set("offset", roundOffset(timeAtKeyframe / totalTime));
        newKeyframes.push(kf);
      }
      duration = totalTime;
      delay2 = 0;
      easing = "";
      keyframes = newKeyframes;
    }
    return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay2, easing, true);
  }
};
function roundOffset(offset2, decimalPoints = 3) {
  const mult = Math.pow(10, decimalPoints - 1);
  return Math.round(offset2 * mult) / mult;
}
function flattenStyles(input2, allStyles) {
  const styles = /* @__PURE__ */ new Map();
  let allProperties;
  input2.forEach((token) => {
    if (token === "*") {
      allProperties ??= allStyles.keys();
      for (let prop of allProperties) {
        styles.set(prop, AUTO_STYLE);
      }
    } else {
      for (let [prop, val] of token) {
        styles.set(prop, val);
      }
    }
  });
  return styles;
}
function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, totalTime, errors) {
  return {
    type: 0,
    element,
    triggerName,
    isRemovalTransition,
    fromState,
    fromStyles,
    toState,
    toStyles,
    timelines,
    queriedElements,
    preStyleProps,
    postStyleProps,
    totalTime,
    errors
  };
}
var EMPTY_OBJECT = {};
var AnimationTransitionFactory = class {
  constructor(_triggerName, ast, _stateStyles) {
    this._triggerName = _triggerName;
    this.ast = ast;
    this._stateStyles = _stateStyles;
  }
  match(currentState, nextState, element, params) {
    return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);
  }
  buildStyles(stateName, params, errors) {
    let styler = this._stateStyles.get("*");
    if (stateName !== void 0) {
      styler = this._stateStyles.get(stateName?.toString()) || styler;
    }
    return styler ? styler.buildStyles(params, errors) : /* @__PURE__ */ new Map();
  }
  build(driver, element, currentState, nextState, enterClassName, leaveClassName, currentOptions, nextOptions, subInstructions, skipAstBuild) {
    const errors = [];
    const transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;
    const currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;
    const currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);
    const nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;
    const nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);
    const queriedElements = /* @__PURE__ */ new Set();
    const preStyleMap = /* @__PURE__ */ new Map();
    const postStyleMap = /* @__PURE__ */ new Map();
    const isRemoval = nextState === "void";
    const animationOptions = {
      params: applyParamDefaults(nextAnimationParams, transitionAnimationParams),
      delay: this.ast.options?.delay
    };
    const timelines = skipAstBuild ? [] : buildAnimationTimelines(driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);
    let totalTime = 0;
    timelines.forEach((tl) => {
      totalTime = Math.max(tl.duration + tl.delay, totalTime);
    });
    if (errors.length) {
      return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors);
    }
    timelines.forEach((tl) => {
      const elm = tl.element;
      const preProps = getOrSetDefaultValue(preStyleMap, elm, /* @__PURE__ */ new Set());
      tl.preStyleProps.forEach((prop) => preProps.add(prop));
      const postProps = getOrSetDefaultValue(postStyleMap, elm, /* @__PURE__ */ new Set());
      tl.postStyleProps.forEach((prop) => postProps.add(prop));
      if (elm !== element) {
        queriedElements.add(elm);
      }
    });
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      checkNonAnimatableInTimelines(timelines, this._triggerName, driver);
    }
    return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, [...queriedElements.values()], preStyleMap, postStyleMap, totalTime);
  }
};
function checkNonAnimatableInTimelines(timelines, triggerName, driver) {
  if (!driver.validateAnimatableStyleProperty) {
    return;
  }
  const allowedNonAnimatableProps = /* @__PURE__ */ new Set([
    // 'easing' is a utility/synthetic prop we use to represent
    // easing functions, it represents a property of the animation
    // which is not animatable but different values can be used
    // in different steps
    "easing"
  ]);
  const invalidNonAnimatableProps = /* @__PURE__ */ new Set();
  timelines.forEach(({
    keyframes
  }) => {
    const nonAnimatablePropsInitialValues = /* @__PURE__ */ new Map();
    keyframes.forEach((keyframe) => {
      const entriesToCheck = Array.from(keyframe.entries()).filter(([prop]) => !allowedNonAnimatableProps.has(prop));
      for (const [prop, value] of entriesToCheck) {
        if (!driver.validateAnimatableStyleProperty(prop)) {
          if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) {
            const propInitialValue = nonAnimatablePropsInitialValues.get(prop);
            if (propInitialValue !== value) {
              invalidNonAnimatableProps.add(prop);
            }
          } else {
            nonAnimatablePropsInitialValues.set(prop, value);
          }
        }
      }
    });
  });
  if (invalidNonAnimatableProps.size > 0) {
    console.warn(`Warning: The animation trigger "${triggerName}" is attempting to animate the following not animatable properties: ` + Array.from(invalidNonAnimatableProps).join(", ") + "\n(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)");
  }
}
function oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) {
  return matchFns.some((fn) => fn(currentState, nextState, element, params));
}
function applyParamDefaults(userParams, defaults4) {
  const result = __spreadValues({}, defaults4);
  Object.entries(userParams).forEach(([key, value]) => {
    if (value != null) {
      result[key] = value;
    }
  });
  return result;
}
var AnimationStateStyles = class {
  constructor(styles, defaultParams, normalizer) {
    this.styles = styles;
    this.defaultParams = defaultParams;
    this.normalizer = normalizer;
  }
  buildStyles(params, errors) {
    const finalStyles = /* @__PURE__ */ new Map();
    const combinedParams = applyParamDefaults(params, this.defaultParams);
    this.styles.styles.forEach((value) => {
      if (typeof value !== "string") {
        value.forEach((val, prop) => {
          if (val) {
            val = interpolateParams(val, combinedParams, errors);
          }
          const normalizedProp = this.normalizer.normalizePropertyName(prop, errors);
          val = this.normalizer.normalizeStyleValue(prop, normalizedProp, val, errors);
          finalStyles.set(prop, val);
        });
      }
    });
    return finalStyles;
  }
};
function buildTrigger(name, ast, normalizer) {
  return new AnimationTrigger(name, ast, normalizer);
}
var AnimationTrigger = class {
  constructor(name, ast, _normalizer) {
    this.name = name;
    this.ast = ast;
    this._normalizer = _normalizer;
    this.transitionFactories = [];
    this.states = /* @__PURE__ */ new Map();
    ast.states.forEach((ast2) => {
      const defaultParams = ast2.options && ast2.options.params || {};
      this.states.set(ast2.name, new AnimationStateStyles(ast2.style, defaultParams, _normalizer));
    });
    balanceProperties(this.states, "true", "1");
    balanceProperties(this.states, "false", "0");
    ast.transitions.forEach((ast2) => {
      this.transitionFactories.push(new AnimationTransitionFactory(name, ast2, this.states));
    });
    this.fallbackTransition = createFallbackTransition(name, this.states, this._normalizer);
  }
  get containsQueries() {
    return this.ast.queryCount > 0;
  }
  matchTransition(currentState, nextState, element, params) {
    const entry = this.transitionFactories.find((f) => f.match(currentState, nextState, element, params));
    return entry || null;
  }
  matchStyles(currentState, params, errors) {
    return this.fallbackTransition.buildStyles(currentState, params, errors);
  }
};
function createFallbackTransition(triggerName, states, normalizer) {
  const matchers = [(fromState, toState) => true];
  const animation = {
    type: AnimationMetadataType.Sequence,
    steps: [],
    options: null
  };
  const transition2 = {
    type: AnimationMetadataType.Transition,
    animation,
    matchers,
    options: null,
    queryCount: 0,
    depCount: 0
  };
  return new AnimationTransitionFactory(triggerName, transition2, states);
}
function balanceProperties(stateMap, key1, key2) {
  if (stateMap.has(key1)) {
    if (!stateMap.has(key2)) {
      stateMap.set(key2, stateMap.get(key1));
    }
  } else if (stateMap.has(key2)) {
    stateMap.set(key1, stateMap.get(key2));
  }
}
var EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();
var TimelineAnimationEngine = class {
  constructor(bodyNode, _driver, _normalizer) {
    this.bodyNode = bodyNode;
    this._driver = _driver;
    this._normalizer = _normalizer;
    this._animations = /* @__PURE__ */ new Map();
    this._playersById = /* @__PURE__ */ new Map();
    this.players = [];
  }
  register(id2, metadata) {
    const errors = [];
    const warnings = [];
    const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
    if (errors.length) {
      throw registerFailed(errors);
    } else {
      if (warnings.length) {
        warnRegister(warnings);
      }
      this._animations.set(id2, ast);
    }
  }
  _buildPlayer(i2, preStyles, postStyles) {
    const element = i2.element;
    const keyframes = normalizeKeyframes$1(this._normalizer, i2.keyframes, preStyles, postStyles);
    return this._driver.animate(element, keyframes, i2.duration, i2.delay, i2.easing, [], true);
  }
  create(id2, element, options = {}) {
    const errors = [];
    const ast = this._animations.get(id2);
    let instructions;
    const autoStylesMap = /* @__PURE__ */ new Map();
    if (ast) {
      instructions = buildAnimationTimelines(this._driver, element, ast, ENTER_CLASSNAME, LEAVE_CLASSNAME, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), options, EMPTY_INSTRUCTION_MAP, errors);
      instructions.forEach((inst) => {
        const styles = getOrSetDefaultValue(autoStylesMap, inst.element, /* @__PURE__ */ new Map());
        inst.postStyleProps.forEach((prop) => styles.set(prop, null));
      });
    } else {
      errors.push(missingOrDestroyedAnimation());
      instructions = [];
    }
    if (errors.length) {
      throw createAnimationFailed(errors);
    }
    autoStylesMap.forEach((styles, element2) => {
      styles.forEach((_, prop) => {
        styles.set(prop, this._driver.computeStyle(element2, prop, AUTO_STYLE));
      });
    });
    const players = instructions.map((i2) => {
      const styles = autoStylesMap.get(i2.element);
      return this._buildPlayer(i2, /* @__PURE__ */ new Map(), styles);
    });
    const player = optimizeGroupPlayer(players);
    this._playersById.set(id2, player);
    player.onDestroy(() => this.destroy(id2));
    this.players.push(player);
    return player;
  }
  destroy(id2) {
    const player = this._getPlayer(id2);
    player.destroy();
    this._playersById.delete(id2);
    const index = this.players.indexOf(player);
    if (index >= 0) {
      this.players.splice(index, 1);
    }
  }
  _getPlayer(id2) {
    const player = this._playersById.get(id2);
    if (!player) {
      throw missingPlayer(id2);
    }
    return player;
  }
  listen(id2, element, eventName, callback) {
    const baseEvent = makeAnimationEvent(element, "", "", "");
    listenOnPlayer(this._getPlayer(id2), eventName, baseEvent, callback);
    return () => {
    };
  }
  command(id2, element, command, args) {
    if (command == "register") {
      this.register(id2, args[0]);
      return;
    }
    if (command == "create") {
      const options = args[0] || {};
      this.create(id2, element, options);
      return;
    }
    const player = this._getPlayer(id2);
    switch (command) {
      case "play":
        player.play();
        break;
      case "pause":
        player.pause();
        break;
      case "reset":
        player.reset();
        break;
      case "restart":
        player.restart();
        break;
      case "finish":
        player.finish();
        break;
      case "init":
        player.init();
        break;
      case "setPosition":
        player.setPosition(parseFloat(args[0]));
        break;
      case "destroy":
        this.destroy(id2);
        break;
    }
  }
};
var QUEUED_CLASSNAME = "ng-animate-queued";
var QUEUED_SELECTOR = ".ng-animate-queued";
var DISABLED_CLASSNAME = "ng-animate-disabled";
var DISABLED_SELECTOR = ".ng-animate-disabled";
var STAR_CLASSNAME = "ng-star-inserted";
var STAR_SELECTOR = ".ng-star-inserted";
var EMPTY_PLAYER_ARRAY = [];
var NULL_REMOVAL_STATE = {
  namespaceId: "",
  setForRemoval: false,
  setForMove: false,
  hasAnimation: false,
  removedBeforeQueried: false
};
var NULL_REMOVED_QUERIED_STATE = {
  namespaceId: "",
  setForMove: false,
  setForRemoval: false,
  hasAnimation: false,
  removedBeforeQueried: true
};
var REMOVAL_FLAG = "__ng_removed";
var StateValue = class {
  get params() {
    return this.options.params;
  }
  constructor(input2, namespaceId = "") {
    this.namespaceId = namespaceId;
    const isObj = input2 && input2.hasOwnProperty("value");
    const value = isObj ? input2["value"] : input2;
    this.value = normalizeTriggerValue(value);
    if (isObj) {
      const _a56 = input2, {
        value: value2
      } = _a56, options = __objRest(_a56, [
        "value"
      ]);
      this.options = options;
    } else {
      this.options = {};
    }
    if (!this.options.params) {
      this.options.params = {};
    }
  }
  absorbOptions(options) {
    const newParams = options.params;
    if (newParams) {
      const oldParams = this.options.params;
      Object.keys(newParams).forEach((prop) => {
        if (oldParams[prop] == null) {
          oldParams[prop] = newParams[prop];
        }
      });
    }
  }
};
var VOID_VALUE = "void";
var DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);
var AnimationTransitionNamespace = class {
  constructor(id2, hostElement, _engine) {
    this.id = id2;
    this.hostElement = hostElement;
    this._engine = _engine;
    this.players = [];
    this._triggers = /* @__PURE__ */ new Map();
    this._queue = [];
    this._elementListeners = /* @__PURE__ */ new Map();
    this._hostClassName = "ng-tns-" + id2;
    addClass(hostElement, this._hostClassName);
  }
  listen(element, name, phase, callback) {
    if (!this._triggers.has(name)) {
      throw missingTrigger(phase, name);
    }
    if (phase == null || phase.length == 0) {
      throw missingEvent(name);
    }
    if (!isTriggerEventValid(phase)) {
      throw unsupportedTriggerEvent(phase, name);
    }
    const listeners = getOrSetDefaultValue(this._elementListeners, element, []);
    const data = {
      name,
      phase,
      callback
    };
    listeners.push(data);
    const triggersWithStates = getOrSetDefaultValue(this._engine.statesByElement, element, /* @__PURE__ */ new Map());
    if (!triggersWithStates.has(name)) {
      addClass(element, NG_TRIGGER_CLASSNAME);
      addClass(element, NG_TRIGGER_CLASSNAME + "-" + name);
      triggersWithStates.set(name, DEFAULT_STATE_VALUE);
    }
    return () => {
      this._engine.afterFlush(() => {
        const index = listeners.indexOf(data);
        if (index >= 0) {
          listeners.splice(index, 1);
        }
        if (!this._triggers.has(name)) {
          triggersWithStates.delete(name);
        }
      });
    };
  }
  register(name, ast) {
    if (this._triggers.has(name)) {
      return false;
    } else {
      this._triggers.set(name, ast);
      return true;
    }
  }
  _getTrigger(name) {
    const trigger2 = this._triggers.get(name);
    if (!trigger2) {
      throw unregisteredTrigger(name);
    }
    return trigger2;
  }
  trigger(element, triggerName, value, defaultToFallback = true) {
    const trigger2 = this._getTrigger(triggerName);
    const player = new TransitionAnimationPlayer(this.id, triggerName, element);
    let triggersWithStates = this._engine.statesByElement.get(element);
    if (!triggersWithStates) {
      addClass(element, NG_TRIGGER_CLASSNAME);
      addClass(element, NG_TRIGGER_CLASSNAME + "-" + triggerName);
      this._engine.statesByElement.set(element, triggersWithStates = /* @__PURE__ */ new Map());
    }
    let fromState = triggersWithStates.get(triggerName);
    const toState = new StateValue(value, this.id);
    const isObj = value && value.hasOwnProperty("value");
    if (!isObj && fromState) {
      toState.absorbOptions(fromState.options);
    }
    triggersWithStates.set(triggerName, toState);
    if (!fromState) {
      fromState = DEFAULT_STATE_VALUE;
    }
    const isRemoval = toState.value === VOID_VALUE;
    if (!isRemoval && fromState.value === toState.value) {
      if (!objEquals(fromState.params, toState.params)) {
        const errors = [];
        const fromStyles = trigger2.matchStyles(fromState.value, fromState.params, errors);
        const toStyles = trigger2.matchStyles(toState.value, toState.params, errors);
        if (errors.length) {
          this._engine.reportError(errors);
        } else {
          this._engine.afterFlush(() => {
            eraseStyles(element, fromStyles);
            setStyles(element, toStyles);
          });
        }
      }
      return;
    }
    const playersOnElement = getOrSetDefaultValue(this._engine.playersByElement, element, []);
    playersOnElement.forEach((player2) => {
      if (player2.namespaceId == this.id && player2.triggerName == triggerName && player2.queued) {
        player2.destroy();
      }
    });
    let transition2 = trigger2.matchTransition(fromState.value, toState.value, element, toState.params);
    let isFallbackTransition = false;
    if (!transition2) {
      if (!defaultToFallback) return;
      transition2 = trigger2.fallbackTransition;
      isFallbackTransition = true;
    }
    this._engine.totalQueuedPlayers++;
    this._queue.push({
      element,
      triggerName,
      transition: transition2,
      fromState,
      toState,
      player,
      isFallbackTransition
    });
    if (!isFallbackTransition) {
      addClass(element, QUEUED_CLASSNAME);
      player.onStart(() => {
        removeClass(element, QUEUED_CLASSNAME);
      });
    }
    player.onDone(() => {
      let index = this.players.indexOf(player);
      if (index >= 0) {
        this.players.splice(index, 1);
      }
      const players = this._engine.playersByElement.get(element);
      if (players) {
        let index2 = players.indexOf(player);
        if (index2 >= 0) {
          players.splice(index2, 1);
        }
      }
    });
    this.players.push(player);
    playersOnElement.push(player);
    return player;
  }
  deregister(name) {
    this._triggers.delete(name);
    this._engine.statesByElement.forEach((stateMap) => stateMap.delete(name));
    this._elementListeners.forEach((listeners, element) => {
      this._elementListeners.set(element, listeners.filter((entry) => {
        return entry.name != name;
      }));
    });
  }
  clearElementCache(element) {
    this._engine.statesByElement.delete(element);
    this._elementListeners.delete(element);
    const elementPlayers = this._engine.playersByElement.get(element);
    if (elementPlayers) {
      elementPlayers.forEach((player) => player.destroy());
      this._engine.playersByElement.delete(element);
    }
  }
  _signalRemovalForInnerTriggers(rootElement, context2) {
    const elements = this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true);
    elements.forEach((elm) => {
      if (elm[REMOVAL_FLAG]) return;
      const namespaces = this._engine.fetchNamespacesByElement(elm);
      if (namespaces.size) {
        namespaces.forEach((ns) => ns.triggerLeaveAnimation(elm, context2, false, true));
      } else {
        this.clearElementCache(elm);
      }
    });
    this._engine.afterFlushAnimationsDone(() => elements.forEach((elm) => this.clearElementCache(elm)));
  }
  triggerLeaveAnimation(element, context2, destroyAfterComplete, defaultToFallback) {
    const triggerStates = this._engine.statesByElement.get(element);
    const previousTriggersValues = /* @__PURE__ */ new Map();
    if (triggerStates) {
      const players = [];
      triggerStates.forEach((state2, triggerName) => {
        previousTriggersValues.set(triggerName, state2.value);
        if (this._triggers.has(triggerName)) {
          const player = this.trigger(element, triggerName, VOID_VALUE, defaultToFallback);
          if (player) {
            players.push(player);
          }
        }
      });
      if (players.length) {
        this._engine.markElementAsRemoved(this.id, element, true, context2, previousTriggersValues);
        if (destroyAfterComplete) {
          optimizeGroupPlayer(players).onDone(() => this._engine.processLeaveNode(element));
        }
        return true;
      }
    }
    return false;
  }
  prepareLeaveAnimationListeners(element) {
    const listeners = this._elementListeners.get(element);
    const elementStates = this._engine.statesByElement.get(element);
    if (listeners && elementStates) {
      const visitedTriggers = /* @__PURE__ */ new Set();
      listeners.forEach((listener) => {
        const triggerName = listener.name;
        if (visitedTriggers.has(triggerName)) return;
        visitedTriggers.add(triggerName);
        const trigger2 = this._triggers.get(triggerName);
        const transition2 = trigger2.fallbackTransition;
        const fromState = elementStates.get(triggerName) || DEFAULT_STATE_VALUE;
        const toState = new StateValue(VOID_VALUE);
        const player = new TransitionAnimationPlayer(this.id, triggerName, element);
        this._engine.totalQueuedPlayers++;
        this._queue.push({
          element,
          triggerName,
          transition: transition2,
          fromState,
          toState,
          player,
          isFallbackTransition: true
        });
      });
    }
  }
  removeNode(element, context2) {
    const engine = this._engine;
    if (element.childElementCount) {
      this._signalRemovalForInnerTriggers(element, context2);
    }
    if (this.triggerLeaveAnimation(element, context2, true)) return;
    let containsPotentialParentTransition = false;
    if (engine.totalAnimations) {
      const currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];
      if (currentPlayers && currentPlayers.length) {
        containsPotentialParentTransition = true;
      } else {
        let parent = element;
        while (parent = parent.parentNode) {
          const triggers = engine.statesByElement.get(parent);
          if (triggers) {
            containsPotentialParentTransition = true;
            break;
          }
        }
      }
    }
    this.prepareLeaveAnimationListeners(element);
    if (containsPotentialParentTransition) {
      engine.markElementAsRemoved(this.id, element, false, context2);
    } else {
      const removalFlag = element[REMOVAL_FLAG];
      if (!removalFlag || removalFlag === NULL_REMOVAL_STATE) {
        engine.afterFlush(() => this.clearElementCache(element));
        engine.destroyInnerAnimations(element);
        engine._onRemovalComplete(element, context2);
      }
    }
  }
  insertNode(element, parent) {
    addClass(element, this._hostClassName);
  }
  drainQueuedTransitions(microtaskId) {
    const instructions = [];
    this._queue.forEach((entry) => {
      const player = entry.player;
      if (player.destroyed) return;
      const element = entry.element;
      const listeners = this._elementListeners.get(element);
      if (listeners) {
        listeners.forEach((listener) => {
          if (listener.name == entry.triggerName) {
            const baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);
            baseEvent["_data"] = microtaskId;
            listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);
          }
        });
      }
      if (player.markedForDestroy) {
        this._engine.afterFlush(() => {
          player.destroy();
        });
      } else {
        instructions.push(entry);
      }
    });
    this._queue = [];
    return instructions.sort((a, b) => {
      const d0 = a.transition.ast.depCount;
      const d1 = b.transition.ast.depCount;
      if (d0 == 0 || d1 == 0) {
        return d0 - d1;
      }
      return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;
    });
  }
  destroy(context2) {
    this.players.forEach((p) => p.destroy());
    this._signalRemovalForInnerTriggers(this.hostElement, context2);
  }
};
var TransitionAnimationEngine = class {
  /** @internal */
  _onRemovalComplete(element, context2) {
    this.onRemovalComplete(element, context2);
  }
  constructor(bodyNode, driver, _normalizer) {
    this.bodyNode = bodyNode;
    this.driver = driver;
    this._normalizer = _normalizer;
    this.players = [];
    this.newHostElements = /* @__PURE__ */ new Map();
    this.playersByElement = /* @__PURE__ */ new Map();
    this.playersByQueriedElement = /* @__PURE__ */ new Map();
    this.statesByElement = /* @__PURE__ */ new Map();
    this.disabledNodes = /* @__PURE__ */ new Set();
    this.totalAnimations = 0;
    this.totalQueuedPlayers = 0;
    this._namespaceLookup = {};
    this._namespaceList = [];
    this._flushFns = [];
    this._whenQuietFns = [];
    this.namespacesByHostElement = /* @__PURE__ */ new Map();
    this.collectedEnterElements = [];
    this.collectedLeaveElements = [];
    this.onRemovalComplete = (element, context2) => {
    };
  }
  get queuedPlayers() {
    const players = [];
    this._namespaceList.forEach((ns) => {
      ns.players.forEach((player) => {
        if (player.queued) {
          players.push(player);
        }
      });
    });
    return players;
  }
  createNamespace(namespaceId, hostElement) {
    const ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);
    if (this.bodyNode && this.driver.containsElement(this.bodyNode, hostElement)) {
      this._balanceNamespaceList(ns, hostElement);
    } else {
      this.newHostElements.set(hostElement, ns);
      this.collectEnterElement(hostElement);
    }
    return this._namespaceLookup[namespaceId] = ns;
  }
  _balanceNamespaceList(ns, hostElement) {
    const namespaceList = this._namespaceList;
    const namespacesByHostElement = this.namespacesByHostElement;
    const limit = namespaceList.length - 1;
    if (limit >= 0) {
      let found = false;
      let ancestor = this.driver.getParentElement(hostElement);
      while (ancestor) {
        const ancestorNs = namespacesByHostElement.get(ancestor);
        if (ancestorNs) {
          const index = namespaceList.indexOf(ancestorNs);
          namespaceList.splice(index + 1, 0, ns);
          found = true;
          break;
        }
        ancestor = this.driver.getParentElement(ancestor);
      }
      if (!found) {
        namespaceList.unshift(ns);
      }
    } else {
      namespaceList.push(ns);
    }
    namespacesByHostElement.set(hostElement, ns);
    return ns;
  }
  register(namespaceId, hostElement) {
    let ns = this._namespaceLookup[namespaceId];
    if (!ns) {
      ns = this.createNamespace(namespaceId, hostElement);
    }
    return ns;
  }
  registerTrigger(namespaceId, name, trigger2) {
    let ns = this._namespaceLookup[namespaceId];
    if (ns && ns.register(name, trigger2)) {
      this.totalAnimations++;
    }
  }
  destroy(namespaceId, context2) {
    if (!namespaceId) return;
    this.afterFlush(() => {
    });
    this.afterFlushAnimationsDone(() => {
      const ns = this._fetchNamespace(namespaceId);
      this.namespacesByHostElement.delete(ns.hostElement);
      const index = this._namespaceList.indexOf(ns);
      if (index >= 0) {
        this._namespaceList.splice(index, 1);
      }
      ns.destroy(context2);
      delete this._namespaceLookup[namespaceId];
    });
  }
  _fetchNamespace(id2) {
    return this._namespaceLookup[id2];
  }
  fetchNamespacesByElement(element) {
    const namespaces = /* @__PURE__ */ new Set();
    const elementStates = this.statesByElement.get(element);
    if (elementStates) {
      for (let stateValue of elementStates.values()) {
        if (stateValue.namespaceId) {
          const ns = this._fetchNamespace(stateValue.namespaceId);
          if (ns) {
            namespaces.add(ns);
          }
        }
      }
    }
    return namespaces;
  }
  trigger(namespaceId, element, name, value) {
    if (isElementNode(element)) {
      const ns = this._fetchNamespace(namespaceId);
      if (ns) {
        ns.trigger(element, name, value);
        return true;
      }
    }
    return false;
  }
  insertNode(namespaceId, element, parent, insertBefore) {
    if (!isElementNode(element)) return;
    const details = element[REMOVAL_FLAG];
    if (details && details.setForRemoval) {
      details.setForRemoval = false;
      details.setForMove = true;
      const index = this.collectedLeaveElements.indexOf(element);
      if (index >= 0) {
        this.collectedLeaveElements.splice(index, 1);
      }
    }
    if (namespaceId) {
      const ns = this._fetchNamespace(namespaceId);
      if (ns) {
        ns.insertNode(element, parent);
      }
    }
    if (insertBefore) {
      this.collectEnterElement(element);
    }
  }
  collectEnterElement(element) {
    this.collectedEnterElements.push(element);
  }
  markElementAsDisabled(element, value) {
    if (value) {
      if (!this.disabledNodes.has(element)) {
        this.disabledNodes.add(element);
        addClass(element, DISABLED_CLASSNAME);
      }
    } else if (this.disabledNodes.has(element)) {
      this.disabledNodes.delete(element);
      removeClass(element, DISABLED_CLASSNAME);
    }
  }
  removeNode(namespaceId, element, context2) {
    if (isElementNode(element)) {
      const ns = namespaceId ? this._fetchNamespace(namespaceId) : null;
      if (ns) {
        ns.removeNode(element, context2);
      } else {
        this.markElementAsRemoved(namespaceId, element, false, context2);
      }
      const hostNS = this.namespacesByHostElement.get(element);
      if (hostNS && hostNS.id !== namespaceId) {
        hostNS.removeNode(element, context2);
      }
    } else {
      this._onRemovalComplete(element, context2);
    }
  }
  markElementAsRemoved(namespaceId, element, hasAnimation, context2, previousTriggersValues) {
    this.collectedLeaveElements.push(element);
    element[REMOVAL_FLAG] = {
      namespaceId,
      setForRemoval: context2,
      hasAnimation,
      removedBeforeQueried: false,
      previousTriggersValues
    };
  }
  listen(namespaceId, element, name, phase, callback) {
    if (isElementNode(element)) {
      return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);
    }
    return () => {
    };
  }
  _buildInstruction(entry, subTimelines, enterClassName, leaveClassName, skipBuildAst) {
    return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName, leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst);
  }
  destroyInnerAnimations(containerElement) {
    let elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);
    elements.forEach((element) => this.destroyActiveAnimationsForElement(element));
    if (this.playersByQueriedElement.size == 0) return;
    elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);
    elements.forEach((element) => this.finishActiveQueriedAnimationOnElement(element));
  }
  destroyActiveAnimationsForElement(element) {
    const players = this.playersByElement.get(element);
    if (players) {
      players.forEach((player) => {
        if (player.queued) {
          player.markedForDestroy = true;
        } else {
          player.destroy();
        }
      });
    }
  }
  finishActiveQueriedAnimationOnElement(element) {
    const players = this.playersByQueriedElement.get(element);
    if (players) {
      players.forEach((player) => player.finish());
    }
  }
  whenRenderingDone() {
    return new Promise((resolve) => {
      if (this.players.length) {
        return optimizeGroupPlayer(this.players).onDone(() => resolve());
      } else {
        resolve();
      }
    });
  }
  processLeaveNode(element) {
    const details = element[REMOVAL_FLAG];
    if (details && details.setForRemoval) {
      element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;
      if (details.namespaceId) {
        this.destroyInnerAnimations(element);
        const ns = this._fetchNamespace(details.namespaceId);
        if (ns) {
          ns.clearElementCache(element);
        }
      }
      this._onRemovalComplete(element, details.setForRemoval);
    }
    if (element.classList?.contains(DISABLED_CLASSNAME)) {
      this.markElementAsDisabled(element, false);
    }
    this.driver.query(element, DISABLED_SELECTOR, true).forEach((node) => {
      this.markElementAsDisabled(node, false);
    });
  }
  flush(microtaskId = -1) {
    let players = [];
    if (this.newHostElements.size) {
      this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element));
      this.newHostElements.clear();
    }
    if (this.totalAnimations && this.collectedEnterElements.length) {
      for (let i2 = 0; i2 < this.collectedEnterElements.length; i2++) {
        const elm = this.collectedEnterElements[i2];
        addClass(elm, STAR_CLASSNAME);
      }
    }
    if (this._namespaceList.length && (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {
      const cleanupFns = [];
      try {
        players = this._flushAnimations(cleanupFns, microtaskId);
      } finally {
        for (let i2 = 0; i2 < cleanupFns.length; i2++) {
          cleanupFns[i2]();
        }
      }
    } else {
      for (let i2 = 0; i2 < this.collectedLeaveElements.length; i2++) {
        const element = this.collectedLeaveElements[i2];
        this.processLeaveNode(element);
      }
    }
    this.totalQueuedPlayers = 0;
    this.collectedEnterElements.length = 0;
    this.collectedLeaveElements.length = 0;
    this._flushFns.forEach((fn) => fn());
    this._flushFns = [];
    if (this._whenQuietFns.length) {
      const quietFns = this._whenQuietFns;
      this._whenQuietFns = [];
      if (players.length) {
        optimizeGroupPlayer(players).onDone(() => {
          quietFns.forEach((fn) => fn());
        });
      } else {
        quietFns.forEach((fn) => fn());
      }
    }
  }
  reportError(errors) {
    throw triggerTransitionsFailed(errors);
  }
  _flushAnimations(cleanupFns, microtaskId) {
    const subTimelines = new ElementInstructionMap();
    const skippedPlayers = [];
    const skippedPlayersMap = /* @__PURE__ */ new Map();
    const queuedInstructions = [];
    const queriedElements = /* @__PURE__ */ new Map();
    const allPreStyleElements = /* @__PURE__ */ new Map();
    const allPostStyleElements = /* @__PURE__ */ new Map();
    const disabledElementsSet = /* @__PURE__ */ new Set();
    this.disabledNodes.forEach((node) => {
      disabledElementsSet.add(node);
      const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true);
      for (let i3 = 0; i3 < nodesThatAreDisabled.length; i3++) {
        disabledElementsSet.add(nodesThatAreDisabled[i3]);
      }
    });
    const bodyNode = this.bodyNode;
    const allTriggerElements = Array.from(this.statesByElement.keys());
    const enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements);
    const enterNodeMapIds = /* @__PURE__ */ new Map();
    let i2 = 0;
    enterNodeMap.forEach((nodes, root) => {
      const className = ENTER_CLASSNAME + i2++;
      enterNodeMapIds.set(root, className);
      nodes.forEach((node) => addClass(node, className));
    });
    const allLeaveNodes = [];
    const mergedLeaveNodes = /* @__PURE__ */ new Set();
    const leaveNodesWithoutAnimations = /* @__PURE__ */ new Set();
    for (let i3 = 0; i3 < this.collectedLeaveElements.length; i3++) {
      const element = this.collectedLeaveElements[i3];
      const details = element[REMOVAL_FLAG];
      if (details && details.setForRemoval) {
        allLeaveNodes.push(element);
        mergedLeaveNodes.add(element);
        if (details.hasAnimation) {
          this.driver.query(element, STAR_SELECTOR, true).forEach((elm) => mergedLeaveNodes.add(elm));
        } else {
          leaveNodesWithoutAnimations.add(element);
        }
      }
    }
    const leaveNodeMapIds = /* @__PURE__ */ new Map();
    const leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes));
    leaveNodeMap.forEach((nodes, root) => {
      const className = LEAVE_CLASSNAME + i2++;
      leaveNodeMapIds.set(root, className);
      nodes.forEach((node) => addClass(node, className));
    });
    cleanupFns.push(() => {
      enterNodeMap.forEach((nodes, root) => {
        const className = enterNodeMapIds.get(root);
        nodes.forEach((node) => removeClass(node, className));
      });
      leaveNodeMap.forEach((nodes, root) => {
        const className = leaveNodeMapIds.get(root);
        nodes.forEach((node) => removeClass(node, className));
      });
      allLeaveNodes.forEach((element) => {
        this.processLeaveNode(element);
      });
    });
    const allPlayers = [];
    const erroneousTransitions = [];
    for (let i3 = this._namespaceList.length - 1; i3 >= 0; i3--) {
      const ns = this._namespaceList[i3];
      ns.drainQueuedTransitions(microtaskId).forEach((entry) => {
        const player = entry.player;
        const element = entry.element;
        allPlayers.push(player);
        if (this.collectedEnterElements.length) {
          const details = element[REMOVAL_FLAG];
          if (details && details.setForMove) {
            if (details.previousTriggersValues && details.previousTriggersValues.has(entry.triggerName)) {
              const previousValue = details.previousTriggersValues.get(entry.triggerName);
              const triggersWithStates = this.statesByElement.get(entry.element);
              if (triggersWithStates && triggersWithStates.has(entry.triggerName)) {
                const state2 = triggersWithStates.get(entry.triggerName);
                state2.value = previousValue;
                triggersWithStates.set(entry.triggerName, state2);
              }
            }
            player.destroy();
            return;
          }
        }
        const nodeIsOrphaned = !bodyNode || !this.driver.containsElement(bodyNode, element);
        const leaveClassName = leaveNodeMapIds.get(element);
        const enterClassName = enterNodeMapIds.get(element);
        const instruction = this._buildInstruction(entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned);
        if (instruction.errors && instruction.errors.length) {
          erroneousTransitions.push(instruction);
          return;
        }
        if (nodeIsOrphaned) {
          player.onStart(() => eraseStyles(element, instruction.fromStyles));
          player.onDestroy(() => setStyles(element, instruction.toStyles));
          skippedPlayers.push(player);
          return;
        }
        if (entry.isFallbackTransition) {
          player.onStart(() => eraseStyles(element, instruction.fromStyles));
          player.onDestroy(() => setStyles(element, instruction.toStyles));
          skippedPlayers.push(player);
          return;
        }
        const timelines = [];
        instruction.timelines.forEach((tl) => {
          tl.stretchStartingKeyframe = true;
          if (!this.disabledNodes.has(tl.element)) {
            timelines.push(tl);
          }
        });
        instruction.timelines = timelines;
        subTimelines.append(element, instruction.timelines);
        const tuple = {
          instruction,
          player,
          element
        };
        queuedInstructions.push(tuple);
        instruction.queriedElements.forEach((element2) => getOrSetDefaultValue(queriedElements, element2, []).push(player));
        instruction.preStyleProps.forEach((stringMap, element2) => {
          if (stringMap.size) {
            let setVal = allPreStyleElements.get(element2);
            if (!setVal) {
              allPreStyleElements.set(element2, setVal = /* @__PURE__ */ new Set());
            }
            stringMap.forEach((_, prop) => setVal.add(prop));
          }
        });
        instruction.postStyleProps.forEach((stringMap, element2) => {
          let setVal = allPostStyleElements.get(element2);
          if (!setVal) {
            allPostStyleElements.set(element2, setVal = /* @__PURE__ */ new Set());
          }
          stringMap.forEach((_, prop) => setVal.add(prop));
        });
      });
    }
    if (erroneousTransitions.length) {
      const errors = [];
      erroneousTransitions.forEach((instruction) => {
        errors.push(transitionFailed(instruction.triggerName, instruction.errors));
      });
      allPlayers.forEach((player) => player.destroy());
      this.reportError(errors);
    }
    const allPreviousPlayersMap = /* @__PURE__ */ new Map();
    const animationElementMap = /* @__PURE__ */ new Map();
    queuedInstructions.forEach((entry) => {
      const element = entry.element;
      if (subTimelines.has(element)) {
        animationElementMap.set(element, element);
        this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);
      }
    });
    skippedPlayers.forEach((player) => {
      const element = player.element;
      const previousPlayers = this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);
      previousPlayers.forEach((prevPlayer) => {
        getOrSetDefaultValue(allPreviousPlayersMap, element, []).push(prevPlayer);
        prevPlayer.destroy();
      });
    });
    const replaceNodes = allLeaveNodes.filter((node) => {
      return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);
    });
    const postStylesMap = /* @__PURE__ */ new Map();
    const allLeaveQueriedNodes = cloakAndComputeStyles(postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE);
    allLeaveQueriedNodes.forEach((node) => {
      if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {
        replaceNodes.push(node);
      }
    });
    const preStylesMap = /* @__PURE__ */ new Map();
    enterNodeMap.forEach((nodes, root) => {
      cloakAndComputeStyles(preStylesMap, this.driver, new Set(nodes), allPreStyleElements, \u0275PRE_STYLE);
    });
    replaceNodes.forEach((node) => {
      const post = postStylesMap.get(node);
      const pre = preStylesMap.get(node);
      postStylesMap.set(node, new Map([...post?.entries() ?? [], ...pre?.entries() ?? []]));
    });
    const rootPlayers = [];
    const subPlayers = [];
    const NO_PARENT_ANIMATION_ELEMENT_DETECTED = {};
    queuedInstructions.forEach((entry) => {
      const {
        element,
        player,
        instruction
      } = entry;
      if (subTimelines.has(element)) {
        if (disabledElementsSet.has(element)) {
          player.onDestroy(() => setStyles(element, instruction.toStyles));
          player.disabled = true;
          player.overrideTotalTime(instruction.totalTime);
          skippedPlayers.push(player);
          return;
        }
        let parentWithAnimation = NO_PARENT_ANIMATION_ELEMENT_DETECTED;
        if (animationElementMap.size > 1) {
          let elm = element;
          const parentsToAdd = [];
          while (elm = elm.parentNode) {
            const detectedParent = animationElementMap.get(elm);
            if (detectedParent) {
              parentWithAnimation = detectedParent;
              break;
            }
            parentsToAdd.push(elm);
          }
          parentsToAdd.forEach((parent) => animationElementMap.set(parent, parentWithAnimation));
        }
        const innerPlayer = this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);
        player.setRealPlayer(innerPlayer);
        if (parentWithAnimation === NO_PARENT_ANIMATION_ELEMENT_DETECTED) {
          rootPlayers.push(player);
        } else {
          const parentPlayers = this.playersByElement.get(parentWithAnimation);
          if (parentPlayers && parentPlayers.length) {
            player.parentPlayer = optimizeGroupPlayer(parentPlayers);
          }
          skippedPlayers.push(player);
        }
      } else {
        eraseStyles(element, instruction.fromStyles);
        player.onDestroy(() => setStyles(element, instruction.toStyles));
        subPlayers.push(player);
        if (disabledElementsSet.has(element)) {
          skippedPlayers.push(player);
        }
      }
    });
    subPlayers.forEach((player) => {
      const playersForElement = skippedPlayersMap.get(player.element);
      if (playersForElement && playersForElement.length) {
        const innerPlayer = optimizeGroupPlayer(playersForElement);
        player.setRealPlayer(innerPlayer);
      }
    });
    skippedPlayers.forEach((player) => {
      if (player.parentPlayer) {
        player.syncPlayerEvents(player.parentPlayer);
      } else {
        player.destroy();
      }
    });
    for (let i3 = 0; i3 < allLeaveNodes.length; i3++) {
      const element = allLeaveNodes[i3];
      const details = element[REMOVAL_FLAG];
      removeClass(element, LEAVE_CLASSNAME);
      if (details && details.hasAnimation) continue;
      let players = [];
      if (queriedElements.size) {
        let queriedPlayerResults = queriedElements.get(element);
        if (queriedPlayerResults && queriedPlayerResults.length) {
          players.push(...queriedPlayerResults);
        }
        let queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);
        for (let j = 0; j < queriedInnerElements.length; j++) {
          let queriedPlayers = queriedElements.get(queriedInnerElements[j]);
          if (queriedPlayers && queriedPlayers.length) {
            players.push(...queriedPlayers);
          }
        }
      }
      const activePlayers = players.filter((p) => !p.destroyed);
      if (activePlayers.length) {
        removeNodesAfterAnimationDone(this, element, activePlayers);
      } else {
        this.processLeaveNode(element);
      }
    }
    allLeaveNodes.length = 0;
    rootPlayers.forEach((player) => {
      this.players.push(player);
      player.onDone(() => {
        player.destroy();
        const index = this.players.indexOf(player);
        this.players.splice(index, 1);
      });
      player.play();
    });
    return rootPlayers;
  }
  afterFlush(callback) {
    this._flushFns.push(callback);
  }
  afterFlushAnimationsDone(callback) {
    this._whenQuietFns.push(callback);
  }
  _getPreviousPlayers(element, isQueriedElement, namespaceId, triggerName, toStateValue) {
    let players = [];
    if (isQueriedElement) {
      const queriedElementPlayers = this.playersByQueriedElement.get(element);
      if (queriedElementPlayers) {
        players = queriedElementPlayers;
      }
    } else {
      const elementPlayers = this.playersByElement.get(element);
      if (elementPlayers) {
        const isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE;
        elementPlayers.forEach((player) => {
          if (player.queued) return;
          if (!isRemovalAnimation && player.triggerName != triggerName) return;
          players.push(player);
        });
      }
    }
    if (namespaceId || triggerName) {
      players = players.filter((player) => {
        if (namespaceId && namespaceId != player.namespaceId) return false;
        if (triggerName && triggerName != player.triggerName) return false;
        return true;
      });
    }
    return players;
  }
  _beforeAnimationBuild(namespaceId, instruction, allPreviousPlayersMap) {
    const triggerName = instruction.triggerName;
    const rootElement = instruction.element;
    const targetNameSpaceId = instruction.isRemovalTransition ? void 0 : namespaceId;
    const targetTriggerName = instruction.isRemovalTransition ? void 0 : triggerName;
    for (const timelineInstruction of instruction.timelines) {
      const element = timelineInstruction.element;
      const isQueriedElement = element !== rootElement;
      const players = getOrSetDefaultValue(allPreviousPlayersMap, element, []);
      const previousPlayers = this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);
      previousPlayers.forEach((player) => {
        const realPlayer = player.getRealPlayer();
        if (realPlayer.beforeDestroy) {
          realPlayer.beforeDestroy();
        }
        player.destroy();
        players.push(player);
      });
    }
    eraseStyles(rootElement, instruction.fromStyles);
  }
  _buildAnimation(namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {
    const triggerName = instruction.triggerName;
    const rootElement = instruction.element;
    const allQueriedPlayers = [];
    const allConsumedElements = /* @__PURE__ */ new Set();
    const allSubElements = /* @__PURE__ */ new Set();
    const allNewPlayers = instruction.timelines.map((timelineInstruction) => {
      const element = timelineInstruction.element;
      allConsumedElements.add(element);
      const details = element[REMOVAL_FLAG];
      if (details && details.removedBeforeQueried) return new NoopAnimationPlayer(timelineInstruction.duration, timelineInstruction.delay);
      const isQueriedElement = element !== rootElement;
      const previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY).map((p) => p.getRealPlayer())).filter((p) => {
        const pp = p;
        return pp.element ? pp.element === element : false;
      });
      const preStyles = preStylesMap.get(element);
      const postStyles = postStylesMap.get(element);
      const keyframes = normalizeKeyframes$1(this._normalizer, timelineInstruction.keyframes, preStyles, postStyles);
      const player2 = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);
      if (timelineInstruction.subTimeline && skippedPlayersMap) {
        allSubElements.add(element);
      }
      if (isQueriedElement) {
        const wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);
        wrappedPlayer.setRealPlayer(player2);
        allQueriedPlayers.push(wrappedPlayer);
      }
      return player2;
    });
    allQueriedPlayers.forEach((player2) => {
      getOrSetDefaultValue(this.playersByQueriedElement, player2.element, []).push(player2);
      player2.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player2.element, player2));
    });
    allConsumedElements.forEach((element) => addClass(element, NG_ANIMATING_CLASSNAME));
    const player = optimizeGroupPlayer(allNewPlayers);
    player.onDestroy(() => {
      allConsumedElements.forEach((element) => removeClass(element, NG_ANIMATING_CLASSNAME));
      setStyles(rootElement, instruction.toStyles);
    });
    allSubElements.forEach((element) => {
      getOrSetDefaultValue(skippedPlayersMap, element, []).push(player);
    });
    return player;
  }
  _buildPlayer(instruction, keyframes, previousPlayers) {
    if (keyframes.length > 0) {
      return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);
    }
    return new NoopAnimationPlayer(instruction.duration, instruction.delay);
  }
};
var TransitionAnimationPlayer = class {
  constructor(namespaceId, triggerName, element) {
    this.namespaceId = namespaceId;
    this.triggerName = triggerName;
    this.element = element;
    this._player = new NoopAnimationPlayer();
    this._containsRealPlayer = false;
    this._queuedCallbacks = /* @__PURE__ */ new Map();
    this.destroyed = false;
    this.parentPlayer = null;
    this.markedForDestroy = false;
    this.disabled = false;
    this.queued = true;
    this.totalTime = 0;
  }
  setRealPlayer(player) {
    if (this._containsRealPlayer) return;
    this._player = player;
    this._queuedCallbacks.forEach((callbacks, phase) => {
      callbacks.forEach((callback) => listenOnPlayer(player, phase, void 0, callback));
    });
    this._queuedCallbacks.clear();
    this._containsRealPlayer = true;
    this.overrideTotalTime(player.totalTime);
    this.queued = false;
  }
  getRealPlayer() {
    return this._player;
  }
  overrideTotalTime(totalTime) {
    this.totalTime = totalTime;
  }
  syncPlayerEvents(player) {
    const p = this._player;
    if (p.triggerCallback) {
      player.onStart(() => p.triggerCallback("start"));
    }
    player.onDone(() => this.finish());
    player.onDestroy(() => this.destroy());
  }
  _queueEvent(name, callback) {
    getOrSetDefaultValue(this._queuedCallbacks, name, []).push(callback);
  }
  onDone(fn) {
    if (this.queued) {
      this._queueEvent("done", fn);
    }
    this._player.onDone(fn);
  }
  onStart(fn) {
    if (this.queued) {
      this._queueEvent("start", fn);
    }
    this._player.onStart(fn);
  }
  onDestroy(fn) {
    if (this.queued) {
      this._queueEvent("destroy", fn);
    }
    this._player.onDestroy(fn);
  }
  init() {
    this._player.init();
  }
  hasStarted() {
    return this.queued ? false : this._player.hasStarted();
  }
  play() {
    !this.queued && this._player.play();
  }
  pause() {
    !this.queued && this._player.pause();
  }
  restart() {
    !this.queued && this._player.restart();
  }
  finish() {
    this._player.finish();
  }
  destroy() {
    this.destroyed = true;
    this._player.destroy();
  }
  reset() {
    !this.queued && this._player.reset();
  }
  setPosition(p) {
    if (!this.queued) {
      this._player.setPosition(p);
    }
  }
  getPosition() {
    return this.queued ? 0 : this._player.getPosition();
  }
  /** @internal */
  triggerCallback(phaseName) {
    const p = this._player;
    if (p.triggerCallback) {
      p.triggerCallback(phaseName);
    }
  }
};
function deleteOrUnsetInMap(map2, key, value) {
  let currentValues = map2.get(key);
  if (currentValues) {
    if (currentValues.length) {
      const index = currentValues.indexOf(value);
      currentValues.splice(index, 1);
    }
    if (currentValues.length == 0) {
      map2.delete(key);
    }
  }
  return currentValues;
}
function normalizeTriggerValue(value) {
  return value != null ? value : null;
}
function isElementNode(node) {
  return node && node["nodeType"] === 1;
}
function isTriggerEventValid(eventName) {
  return eventName == "start" || eventName == "done";
}
function cloakElement(element, value) {
  const oldValue = element.style.display;
  element.style.display = value != null ? value : "none";
  return oldValue;
}
function cloakAndComputeStyles(valuesMap, driver, elements, elementPropsMap, defaultStyle) {
  const cloakVals = [];
  elements.forEach((element) => cloakVals.push(cloakElement(element)));
  const failedElements = [];
  elementPropsMap.forEach((props, element) => {
    const styles = /* @__PURE__ */ new Map();
    props.forEach((prop) => {
      const value = driver.computeStyle(element, prop, defaultStyle);
      styles.set(prop, value);
      if (!value || value.length == 0) {
        element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;
        failedElements.push(element);
      }
    });
    valuesMap.set(element, styles);
  });
  let i2 = 0;
  elements.forEach((element) => cloakElement(element, cloakVals[i2++]));
  return failedElements;
}
function buildRootMap(roots, nodes) {
  const rootMap = /* @__PURE__ */ new Map();
  roots.forEach((root) => rootMap.set(root, []));
  if (nodes.length == 0) return rootMap;
  const NULL_NODE = 1;
  const nodeSet = new Set(nodes);
  const localRootMap = /* @__PURE__ */ new Map();
  function getRoot(node) {
    if (!node) return NULL_NODE;
    let root = localRootMap.get(node);
    if (root) return root;
    const parent = node.parentNode;
    if (rootMap.has(parent)) {
      root = parent;
    } else if (nodeSet.has(parent)) {
      root = NULL_NODE;
    } else {
      root = getRoot(parent);
    }
    localRootMap.set(node, root);
    return root;
  }
  nodes.forEach((node) => {
    const root = getRoot(node);
    if (root !== NULL_NODE) {
      rootMap.get(root).push(node);
    }
  });
  return rootMap;
}
function addClass(element, className) {
  element.classList?.add(className);
}
function removeClass(element, className) {
  element.classList?.remove(className);
}
function removeNodesAfterAnimationDone(engine, element, players) {
  optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));
}
function flattenGroupPlayers(players) {
  const finalPlayers = [];
  _flattenGroupPlayersRecur(players, finalPlayers);
  return finalPlayers;
}
function _flattenGroupPlayersRecur(players, finalPlayers) {
  for (let i2 = 0; i2 < players.length; i2++) {
    const player = players[i2];
    if (player instanceof AnimationGroupPlayer) {
      _flattenGroupPlayersRecur(player.players, finalPlayers);
    } else {
      finalPlayers.push(player);
    }
  }
}
function objEquals(a, b) {
  const k1 = Object.keys(a);
  const k2 = Object.keys(b);
  if (k1.length != k2.length) return false;
  for (let i2 = 0; i2 < k1.length; i2++) {
    const prop = k1[i2];
    if (!b.hasOwnProperty(prop) || a[prop] !== b[prop]) return false;
  }
  return true;
}
function replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) {
  const postEntry = allPostStyleElements.get(element);
  if (!postEntry) return false;
  let preEntry = allPreStyleElements.get(element);
  if (preEntry) {
    postEntry.forEach((data) => preEntry.add(data));
  } else {
    allPreStyleElements.set(element, postEntry);
  }
  allPostStyleElements.delete(element);
  return true;
}
var AnimationEngine = class {
  constructor(doc, _driver, _normalizer) {
    this._driver = _driver;
    this._normalizer = _normalizer;
    this._triggerCache = {};
    this.onRemovalComplete = (element, context2) => {
    };
    this._transitionEngine = new TransitionAnimationEngine(doc.body, _driver, _normalizer);
    this._timelineEngine = new TimelineAnimationEngine(doc.body, _driver, _normalizer);
    this._transitionEngine.onRemovalComplete = (element, context2) => this.onRemovalComplete(element, context2);
  }
  registerTrigger(componentId, namespaceId, hostElement, name, metadata) {
    const cacheKey = componentId + "-" + name;
    let trigger2 = this._triggerCache[cacheKey];
    if (!trigger2) {
      const errors = [];
      const warnings = [];
      const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
      if (errors.length) {
        throw triggerBuildFailed(name, errors);
      }
      if (warnings.length) {
        warnTriggerBuild(name, warnings);
      }
      trigger2 = buildTrigger(name, ast, this._normalizer);
      this._triggerCache[cacheKey] = trigger2;
    }
    this._transitionEngine.registerTrigger(namespaceId, name, trigger2);
  }
  register(namespaceId, hostElement) {
    this._transitionEngine.register(namespaceId, hostElement);
  }
  destroy(namespaceId, context2) {
    this._transitionEngine.destroy(namespaceId, context2);
  }
  onInsert(namespaceId, element, parent, insertBefore) {
    this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);
  }
  onRemove(namespaceId, element, context2) {
    this._transitionEngine.removeNode(namespaceId, element, context2);
  }
  disableAnimations(element, disable2) {
    this._transitionEngine.markElementAsDisabled(element, disable2);
  }
  process(namespaceId, element, property, value) {
    if (property.charAt(0) == "@") {
      const [id2, action] = parseTimelineCommand(property);
      const args = value;
      this._timelineEngine.command(id2, element, action, args);
    } else {
      this._transitionEngine.trigger(namespaceId, element, property, value);
    }
  }
  listen(namespaceId, element, eventName, eventPhase, callback) {
    if (eventName.charAt(0) == "@") {
      const [id2, action] = parseTimelineCommand(eventName);
      return this._timelineEngine.listen(id2, element, action, callback);
    }
    return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);
  }
  flush(microtaskId = -1) {
    this._transitionEngine.flush(microtaskId);
  }
  get players() {
    return [...this._transitionEngine.players, ...this._timelineEngine.players];
  }
  whenRenderingDone() {
    return this._transitionEngine.whenRenderingDone();
  }
  afterFlushAnimationsDone(cb) {
    this._transitionEngine.afterFlushAnimationsDone(cb);
  }
};
function packageNonAnimatableStyles(element, styles) {
  let startStyles = null;
  let endStyles = null;
  if (Array.isArray(styles) && styles.length) {
    startStyles = filterNonAnimatableStyles(styles[0]);
    if (styles.length > 1) {
      endStyles = filterNonAnimatableStyles(styles[styles.length - 1]);
    }
  } else if (styles instanceof Map) {
    startStyles = filterNonAnimatableStyles(styles);
  }
  return startStyles || endStyles ? new SpecialCasedStyles(element, startStyles, endStyles) : null;
}
var _SpecialCasedStyles = class _SpecialCasedStyles {
  constructor(_element, _startStyles, _endStyles) {
    this._element = _element;
    this._startStyles = _startStyles;
    this._endStyles = _endStyles;
    this._state = 0;
    let initialStyles = _SpecialCasedStyles.initialStylesByElement.get(_element);
    if (!initialStyles) {
      _SpecialCasedStyles.initialStylesByElement.set(_element, initialStyles = /* @__PURE__ */ new Map());
    }
    this._initialStyles = initialStyles;
  }
  start() {
    if (this._state < 1) {
      if (this._startStyles) {
        setStyles(this._element, this._startStyles, this._initialStyles);
      }
      this._state = 1;
    }
  }
  finish() {
    this.start();
    if (this._state < 2) {
      setStyles(this._element, this._initialStyles);
      if (this._endStyles) {
        setStyles(this._element, this._endStyles);
        this._endStyles = null;
      }
      this._state = 1;
    }
  }
  destroy() {
    this.finish();
    if (this._state < 3) {
      _SpecialCasedStyles.initialStylesByElement.delete(this._element);
      if (this._startStyles) {
        eraseStyles(this._element, this._startStyles);
        this._endStyles = null;
      }
      if (this._endStyles) {
        eraseStyles(this._element, this._endStyles);
        this._endStyles = null;
      }
      setStyles(this._element, this._initialStyles);
      this._state = 3;
    }
  }
};
_SpecialCasedStyles.initialStylesByElement = /* @__PURE__ */ new WeakMap();
var SpecialCasedStyles = _SpecialCasedStyles;
function filterNonAnimatableStyles(styles) {
  let result = null;
  styles.forEach((val, prop) => {
    if (isNonAnimatableStyle(prop)) {
      result = result || /* @__PURE__ */ new Map();
      result.set(prop, val);
    }
  });
  return result;
}
function isNonAnimatableStyle(prop) {
  return prop === "display" || prop === "position";
}
var WebAnimationsPlayer = class {
  constructor(element, keyframes, options, _specialStyles) {
    this.element = element;
    this.keyframes = keyframes;
    this.options = options;
    this._specialStyles = _specialStyles;
    this._onDoneFns = [];
    this._onStartFns = [];
    this._onDestroyFns = [];
    this._initialized = false;
    this._finished = false;
    this._started = false;
    this._destroyed = false;
    this._originalOnDoneFns = [];
    this._originalOnStartFns = [];
    this.time = 0;
    this.parentPlayer = null;
    this.currentSnapshot = /* @__PURE__ */ new Map();
    this._duration = options["duration"];
    this._delay = options["delay"] || 0;
    this.time = this._duration + this._delay;
  }
  _onFinish() {
    if (!this._finished) {
      this._finished = true;
      this._onDoneFns.forEach((fn) => fn());
      this._onDoneFns = [];
    }
  }
  init() {
    this._buildPlayer();
    this._preparePlayerBeforeStart();
  }
  _buildPlayer() {
    if (this._initialized) return;
    this._initialized = true;
    const keyframes = this.keyframes;
    this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options);
    this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : /* @__PURE__ */ new Map();
    const onFinish = () => this._onFinish();
    this.domPlayer.addEventListener("finish", onFinish);
    this.onDestroy(() => {
      this.domPlayer.removeEventListener("finish", onFinish);
    });
  }
  _preparePlayerBeforeStart() {
    if (this._delay) {
      this._resetDomPlayerState();
    } else {
      this.domPlayer.pause();
    }
  }
  _convertKeyframesToObject(keyframes) {
    const kfs = [];
    keyframes.forEach((frame) => {
      kfs.push(Object.fromEntries(frame));
    });
    return kfs;
  }
  /** @internal */
  _triggerWebAnimation(element, keyframes, options) {
    return element.animate(this._convertKeyframesToObject(keyframes), options);
  }
  onStart(fn) {
    this._originalOnStartFns.push(fn);
    this._onStartFns.push(fn);
  }
  onDone(fn) {
    this._originalOnDoneFns.push(fn);
    this._onDoneFns.push(fn);
  }
  onDestroy(fn) {
    this._onDestroyFns.push(fn);
  }
  play() {
    this._buildPlayer();
    if (!this.hasStarted()) {
      this._onStartFns.forEach((fn) => fn());
      this._onStartFns = [];
      this._started = true;
      if (this._specialStyles) {
        this._specialStyles.start();
      }
    }
    this.domPlayer.play();
  }
  pause() {
    this.init();
    this.domPlayer.pause();
  }
  finish() {
    this.init();
    if (this._specialStyles) {
      this._specialStyles.finish();
    }
    this._onFinish();
    this.domPlayer.finish();
  }
  reset() {
    this._resetDomPlayerState();
    this._destroyed = false;
    this._finished = false;
    this._started = false;
    this._onStartFns = this._originalOnStartFns;
    this._onDoneFns = this._originalOnDoneFns;
  }
  _resetDomPlayerState() {
    if (this.domPlayer) {
      this.domPlayer.cancel();
    }
  }
  restart() {
    this.reset();
    this.play();
  }
  hasStarted() {
    return this._started;
  }
  destroy() {
    if (!this._destroyed) {
      this._destroyed = true;
      this._resetDomPlayerState();
      this._onFinish();
      if (this._specialStyles) {
        this._specialStyles.destroy();
      }
      this._onDestroyFns.forEach((fn) => fn());
      this._onDestroyFns = [];
    }
  }
  setPosition(p) {
    if (this.domPlayer === void 0) {
      this.init();
    }
    this.domPlayer.currentTime = p * this.time;
  }
  getPosition() {
    return +(this.domPlayer.currentTime ?? 0) / this.time;
  }
  get totalTime() {
    return this._delay + this._duration;
  }
  beforeDestroy() {
    const styles = /* @__PURE__ */ new Map();
    if (this.hasStarted()) {
      const finalKeyframe = this._finalKeyframe;
      finalKeyframe.forEach((val, prop) => {
        if (prop !== "offset") {
          styles.set(prop, this._finished ? val : computeStyle(this.element, prop));
        }
      });
    }
    this.currentSnapshot = styles;
  }
  /** @internal */
  triggerCallback(phaseName) {
    const methods = phaseName === "start" ? this._onStartFns : this._onDoneFns;
    methods.forEach((fn) => fn());
    methods.length = 0;
  }
};
var WebAnimationsDriver = class {
  validateStyleProperty(prop) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      return validateStyleProperty(prop);
    }
    return true;
  }
  validateAnimatableStyleProperty(prop) {
    if (typeof ngDevMode === "undefined" || ngDevMode) {
      const cssProp = camelCaseToDashCase2(prop);
      return validateWebAnimatableStyleProperty(cssProp);
    }
    return true;
  }
  containsElement(elm1, elm2) {
    return containsElement(elm1, elm2);
  }
  getParentElement(element) {
    return getParentElement(element);
  }
  query(element, selector, multi) {
    return invokeQuery(element, selector, multi);
  }
  computeStyle(element, prop, defaultValue) {
    return computeStyle(element, prop);
  }
  animate(element, keyframes, duration, delay2, easing, previousPlayers = []) {
    const fill = delay2 == 0 ? "both" : "forwards";
    const playerOptions = {
      duration,
      delay: delay2,
      fill
    };
    if (easing) {
      playerOptions["easing"] = easing;
    }
    const previousStyles = /* @__PURE__ */ new Map();
    const previousWebAnimationPlayers = previousPlayers.filter((player) => player instanceof WebAnimationsPlayer);
    if (allowPreviousPlayerStylesMerge(duration, delay2)) {
      previousWebAnimationPlayers.forEach((player) => {
        player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val));
      });
    }
    let _keyframes = normalizeKeyframes(keyframes).map((styles) => new Map(styles));
    _keyframes = balancePreviousStylesIntoKeyframes(element, _keyframes, previousStyles);
    const specialStyles = packageNonAnimatableStyles(element, _keyframes);
    return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles);
  }
};
var ANIMATION_PREFIX = "@";
var DISABLE_ANIMATIONS_FLAG = "@.disabled";
var BaseAnimationRenderer = class {
  constructor(namespaceId, delegate, engine, _onDestroy) {
    this.namespaceId = namespaceId;
    this.delegate = delegate;
    this.engine = engine;
    this._onDestroy = _onDestroy;
    this.\u0275type = 0;
  }
  get data() {
    return this.delegate.data;
  }
  destroyNode(node) {
    this.delegate.destroyNode?.(node);
  }
  destroy() {
    this.engine.destroy(this.namespaceId, this.delegate);
    this.engine.afterFlushAnimationsDone(() => {
      queueMicrotask(() => {
        this.delegate.destroy();
      });
    });
    this._onDestroy?.();
  }
  createElement(name, namespace) {
    return this.delegate.createElement(name, namespace);
  }
  createComment(value) {
    return this.delegate.createComment(value);
  }
  createText(value) {
    return this.delegate.createText(value);
  }
  appendChild(parent, newChild) {
    this.delegate.appendChild(parent, newChild);
    this.engine.onInsert(this.namespaceId, newChild, parent, false);
  }
  insertBefore(parent, newChild, refChild, isMove = true) {
    this.delegate.insertBefore(parent, newChild, refChild);
    this.engine.onInsert(this.namespaceId, newChild, parent, isMove);
  }
  removeChild(parent, oldChild, isHostElement) {
    this.engine.onRemove(this.namespaceId, oldChild, this.delegate);
  }
  selectRootElement(selectorOrNode, preserveContent) {
    return this.delegate.selectRootElement(selectorOrNode, preserveContent);
  }
  parentNode(node) {
    return this.delegate.parentNode(node);
  }
  nextSibling(node) {
    return this.delegate.nextSibling(node);
  }
  setAttribute(el, name, value, namespace) {
    this.delegate.setAttribute(el, name, value, namespace);
  }
  removeAttribute(el, name, namespace) {
    this.delegate.removeAttribute(el, name, namespace);
  }
  addClass(el, name) {
    this.delegate.addClass(el, name);
  }
  removeClass(el, name) {
    this.delegate.removeClass(el, name);
  }
  setStyle(el, style2, value, flags) {
    this.delegate.setStyle(el, style2, value, flags);
  }
  removeStyle(el, style2, flags) {
    this.delegate.removeStyle(el, style2, flags);
  }
  setProperty(el, name, value) {
    if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {
      this.disableAnimations(el, !!value);
    } else {
      this.delegate.setProperty(el, name, value);
    }
  }
  setValue(node, value) {
    this.delegate.setValue(node, value);
  }
  listen(target, eventName, callback) {
    return this.delegate.listen(target, eventName, callback);
  }
  disableAnimations(element, value) {
    this.engine.disableAnimations(element, value);
  }
};
var AnimationRenderer = class extends BaseAnimationRenderer {
  constructor(factory2, namespaceId, delegate, engine, onDestroy) {
    super(namespaceId, delegate, engine, onDestroy);
    this.factory = factory2;
    this.namespaceId = namespaceId;
  }
  setProperty(el, name, value) {
    if (name.charAt(0) == ANIMATION_PREFIX) {
      if (name.charAt(1) == "." && name == DISABLE_ANIMATIONS_FLAG) {
        value = value === void 0 ? true : !!value;
        this.disableAnimations(el, value);
      } else {
        this.engine.process(this.namespaceId, el, name.slice(1), value);
      }
    } else {
      this.delegate.setProperty(el, name, value);
    }
  }
  listen(target, eventName, callback) {
    if (eventName.charAt(0) == ANIMATION_PREFIX) {
      const element = resolveElementFromTarget(target);
      let name = eventName.slice(1);
      let phase = "";
      if (name.charAt(0) != ANIMATION_PREFIX) {
        [name, phase] = parseTriggerCallbackName(name);
      }
      return this.engine.listen(this.namespaceId, element, name, phase, (event) => {
        const countId = event["_data"] || -1;
        this.factory.scheduleListenerCallback(countId, callback, event);
      });
    }
    return this.delegate.listen(target, eventName, callback);
  }
};
function resolveElementFromTarget(target) {
  switch (target) {
    case "body":
      return document.body;
    case "document":
      return document;
    case "window":
      return window;
    default:
      return target;
  }
}
function parseTriggerCallbackName(triggerName) {
  const dotIndex = triggerName.indexOf(".");
  const trigger2 = triggerName.substring(0, dotIndex);
  const phase = triggerName.slice(dotIndex + 1);
  return [trigger2, phase];
}
var AnimationRendererFactory = class {
  constructor(delegate, engine, _zone) {
    this.delegate = delegate;
    this.engine = engine;
    this._zone = _zone;
    this._currentId = 0;
    this._microtaskId = 1;
    this._animationCallbacksBuffer = [];
    this._rendererCache = /* @__PURE__ */ new Map();
    this._cdRecurDepth = 0;
    engine.onRemovalComplete = (element, delegate2) => {
      const parentNode = delegate2?.parentNode(element);
      if (parentNode) {
        delegate2.removeChild(parentNode, element);
      }
    };
  }
  createRenderer(hostElement, type) {
    const EMPTY_NAMESPACE_ID = "";
    const delegate = this.delegate.createRenderer(hostElement, type);
    if (!hostElement || !type?.data?.["animation"]) {
      const cache2 = this._rendererCache;
      let renderer = cache2.get(delegate);
      if (!renderer) {
        const onRendererDestroy = () => cache2.delete(delegate);
        renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine, onRendererDestroy);
        cache2.set(delegate, renderer);
      }
      return renderer;
    }
    const componentId = type.id;
    const namespaceId = type.id + "-" + this._currentId;
    this._currentId++;
    this.engine.register(namespaceId, hostElement);
    const registerTrigger = (trigger2) => {
      if (Array.isArray(trigger2)) {
        trigger2.forEach(registerTrigger);
      } else {
        this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger2.name, trigger2);
      }
    };
    const animationTriggers = type.data["animation"];
    animationTriggers.forEach(registerTrigger);
    return new AnimationRenderer(this, namespaceId, delegate, this.engine);
  }
  begin() {
    this._cdRecurDepth++;
    if (this.delegate.begin) {
      this.delegate.begin();
    }
  }
  _scheduleCountTask() {
    queueMicrotask(() => {
      this._microtaskId++;
    });
  }
  /** @internal */
  scheduleListenerCallback(count, fn, data) {
    if (count >= 0 && count < this._microtaskId) {
      this._zone.run(() => fn(data));
      return;
    }
    const animationCallbacksBuffer = this._animationCallbacksBuffer;
    if (animationCallbacksBuffer.length == 0) {
      queueMicrotask(() => {
        this._zone.run(() => {
          animationCallbacksBuffer.forEach((tuple) => {
            const [fn2, data2] = tuple;
            fn2(data2);
          });
          this._animationCallbacksBuffer = [];
        });
      });
    }
    animationCallbacksBuffer.push([fn, data]);
  }
  end() {
    this._cdRecurDepth--;
    if (this._cdRecurDepth == 0) {
      this._zone.runOutsideAngular(() => {
        this._scheduleCountTask();
        this.engine.flush(this._microtaskId);
      });
    }
    if (this.delegate.end) {
      this.delegate.end();
    }
  }
  whenRenderingDone() {
    return this.engine.whenRenderingDone();
  }
};

// node_modules/@angular/platform-browser/fesm2022/animations.mjs
var _InjectableAnimationEngine = class _InjectableAnimationEngine extends AnimationEngine {
  // The `ApplicationRef` is injected here explicitly to force the dependency ordering.
  // Since the `ApplicationRef` should be created earlier before the `AnimationEngine`, they
  // both have `ngOnDestroy` hooks and `flush()` must be called after all views are destroyed.
  constructor(doc, driver, normalizer) {
    super(doc, driver, normalizer);
  }
  ngOnDestroy() {
    this.flush();
  }
};
_InjectableAnimationEngine.\u0275fac = function InjectableAnimationEngine_Factory(t) {
  return new (t || _InjectableAnimationEngine)(\u0275\u0275inject(DOCUMENT2), \u0275\u0275inject(AnimationDriver), \u0275\u0275inject(AnimationStyleNormalizer));
};
_InjectableAnimationEngine.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _InjectableAnimationEngine,
  factory: _InjectableAnimationEngine.\u0275fac
});
var InjectableAnimationEngine = _InjectableAnimationEngine;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InjectableAnimationEngine, [{
    type: Injectable
  }], () => [{
    type: Document,
    decorators: [{
      type: Inject,
      args: [DOCUMENT2]
    }]
  }, {
    type: AnimationDriver
  }, {
    type: AnimationStyleNormalizer
  }], null);
})();
function instantiateDefaultStyleNormalizer() {
  return new WebAnimationsStyleNormalizer();
}
function instantiateRendererFactory(renderer, engine, zone) {
  return new AnimationRendererFactory(renderer, engine, zone);
}
var SHARED_ANIMATION_PROVIDERS = [{
  provide: AnimationStyleNormalizer,
  useFactory: instantiateDefaultStyleNormalizer
}, {
  provide: AnimationEngine,
  useClass: InjectableAnimationEngine
}, {
  provide: RendererFactory2,
  useFactory: instantiateRendererFactory,
  deps: [DomRendererFactory2, AnimationEngine, NgZone]
}];
var BROWSER_ANIMATIONS_PROVIDERS = [{
  provide: AnimationDriver,
  useFactory: () => new WebAnimationsDriver()
}, {
  provide: ANIMATION_MODULE_TYPE,
  useValue: "BrowserAnimations"
}, ...SHARED_ANIMATION_PROVIDERS];
var BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{
  provide: AnimationDriver,
  useClass: NoopAnimationDriver
}, {
  provide: ANIMATION_MODULE_TYPE,
  useValue: "NoopAnimations"
}, ...SHARED_ANIMATION_PROVIDERS];
var _BrowserAnimationsModule = class _BrowserAnimationsModule {
  /**
   * Configures the module based on the specified object.
   *
   * @param config Object used to configure the behavior of the `BrowserAnimationsModule`.
   * @see {@link BrowserAnimationsModuleConfig}
   *
   * @usageNotes
   * When registering the `BrowserAnimationsModule`, you can use the `withConfig`
   * function as follows:
   * ```
   * @NgModule({
   *   imports: [BrowserAnimationsModule.withConfig(config)]
   * })
   * class MyNgModule {}
   * ```
   */
  static withConfig(config2) {
    return {
      ngModule: _BrowserAnimationsModule,
      providers: config2.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS : BROWSER_ANIMATIONS_PROVIDERS
    };
  }
};
_BrowserAnimationsModule.\u0275fac = function BrowserAnimationsModule_Factory(t) {
  return new (t || _BrowserAnimationsModule)();
};
_BrowserAnimationsModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _BrowserAnimationsModule
});
_BrowserAnimationsModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: BROWSER_ANIMATIONS_PROVIDERS,
  imports: [BrowserModule]
});
var BrowserAnimationsModule = _BrowserAnimationsModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserAnimationsModule, [{
    type: NgModule,
    args: [{
      exports: [BrowserModule],
      providers: BROWSER_ANIMATIONS_PROVIDERS
    }]
  }], null, null);
})();
var _NoopAnimationsModule = class _NoopAnimationsModule {
};
_NoopAnimationsModule.\u0275fac = function NoopAnimationsModule_Factory(t) {
  return new (t || _NoopAnimationsModule)();
};
_NoopAnimationsModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _NoopAnimationsModule
});
_NoopAnimationsModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,
  imports: [BrowserModule]
});
var NoopAnimationsModule = _NoopAnimationsModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NoopAnimationsModule, [{
    type: NgModule,
    args: [{
      exports: [BrowserModule],
      providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS
    }]
  }], null, null);
})();

// projects/formbird-mapping/src/lib/sanitizing/sanitizing.module.ts
var _SanitizingModule = class _SanitizingModule {
  static forRoot() {
    return {
      ngModule: _SanitizingModule
    };
  }
};
_SanitizingModule.\u0275fac = function SanitizingModule_Factory(t) {
  return new (t || _SanitizingModule)();
};
_SanitizingModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _SanitizingModule });
_SanitizingModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
var SanitizingModule = _SanitizingModule;

// projects/formbird-mapping/src/lib/geo-auto-complete/geo-auto-complete.module.ts
var _GeoAutoCompleteModule = class _GeoAutoCompleteModule {
  constructor() {
  }
};
_GeoAutoCompleteModule.\u0275fac = function GeoAutoCompleteModule_Factory(t) {
  return new (t || _GeoAutoCompleteModule)();
};
_GeoAutoCompleteModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _GeoAutoCompleteModule });
_GeoAutoCompleteModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [
  BrowserAnimationsModule,
  FormsModule,
  ReactiveFormsModule,
  MatFormFieldModule,
  MatInputModule,
  MatAutocompleteModule,
  MatIconModule,
  MatButtonModule,
  SanitizingModule
] });
var GeoAutoCompleteModule = _GeoAutoCompleteModule;

// node_modules/@ng-select/ng-select/fesm2022/ng-select-ng-select.mjs
var _c011 = ["content"];
var _c19 = ["scroll"];
var _c26 = ["padding"];
var _c36 = ["*"];
var _c45 = (a0) => ({
  searchTerm: a0
});
function NgDropdownPanelComponent_div_0_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 6);
    \u0275\u0275elementContainer(1, 7);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("ngTemplateOutlet", ctx_r0.headerTemplate)("ngTemplateOutletContext", \u0275\u0275pureFunction1(2, _c45, ctx_r0.filterValue));
  }
}
function NgDropdownPanelComponent_div_8_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 8);
    \u0275\u0275elementContainer(1, 7);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r0 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("ngTemplateOutlet", ctx_r0.footerTemplate)("ngTemplateOutletContext", \u0275\u0275pureFunction1(2, _c45, ctx_r0.filterValue));
  }
}
var _c55 = ["searchInput"];
var _c65 = ["clearButton"];
var _c74 = (a0, a1, a2) => ({
  item: a0,
  clear: a1,
  label: a2
});
var _c83 = (a0, a1) => ({
  items: a0,
  clear: a1
});
var _c93 = (a0, a1, a2, a3) => ({
  item: a0,
  item$: a1,
  index: a2,
  searchTerm: a3
});
function NgSelectComponent_ng_container_4_div_1_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    const _r2 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "span", 22);
    \u0275\u0275listener("click", function NgSelectComponent_ng_container_4_div_1_ng_template_1_Template_span_click_0_listener() {
      \u0275\u0275restoreView(_r2);
      const item_r3 = \u0275\u0275nextContext().$implicit;
      const ctx_r3 = \u0275\u0275nextContext(2);
      return \u0275\u0275resetView(ctx_r3.unselect(item_r3));
    });
    \u0275\u0275text(1, "\xD7");
    \u0275\u0275elementEnd();
    \u0275\u0275element(2, "span", 23);
  }
  if (rf & 2) {
    const item_r3 = \u0275\u0275nextContext().$implicit;
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275advance(2);
    \u0275\u0275property("ngItemLabel", item_r3.label)("escape", ctx_r3.escapeHTML);
  }
}
function NgSelectComponent_ng_container_4_div_1_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_container_4_div_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 20);
    \u0275\u0275template(1, NgSelectComponent_ng_container_4_div_1_ng_template_1_Template, 3, 2, "ng-template", null, 1, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_container_4_div_1_ng_template_3_Template, 0, 0, "ng-template", 21);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const item_r3 = ctx.$implicit;
    const defaultLabelTemplate_r5 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275classProp("ng-value-disabled", item_r3.disabled);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.labelTemplate || defaultLabelTemplate_r5)("ngTemplateOutletContext", \u0275\u0275pureFunction3(4, _c74, item_r3.value, ctx_r3.clearItem, item_r3.label));
  }
}
function NgSelectComponent_ng_container_4_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementContainerStart(0);
    \u0275\u0275template(1, NgSelectComponent_ng_container_4_div_1_Template, 4, 8, "div", 19);
    \u0275\u0275elementContainerEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext();
    \u0275\u0275advance();
    \u0275\u0275property("ngForOf", ctx_r3.selectedItems)("ngForTrackBy", ctx_r3.trackByOption);
  }
}
function NgSelectComponent_5_ng_template_0_Template(rf, ctx) {
}
function NgSelectComponent_5_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275template(0, NgSelectComponent_5_ng_template_0_Template, 0, 0, "ng-template", 21);
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext();
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.multiLabelTemplate)("ngTemplateOutletContext", \u0275\u0275pureFunction2(2, _c83, ctx_r3.selectedValues, ctx_r3.clearItem));
  }
}
function NgSelectComponent_ng_container_9_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "div", 25);
  }
}
function NgSelectComponent_ng_container_9_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_container_9_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementContainerStart(0);
    \u0275\u0275template(1, NgSelectComponent_ng_container_9_ng_template_1_Template, 1, 0, "ng-template", null, 2, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_container_9_ng_template_3_Template, 0, 0, "ng-template", 24);
    \u0275\u0275elementContainerEnd();
  }
  if (rf & 2) {
    const defaultLoadingSpinnerTemplate_r7 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext();
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.loadingSpinnerTemplate || defaultLoadingSpinnerTemplate_r7);
  }
}
function NgSelectComponent_span_10_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "span", 26, 3)(2, "span", 27);
    \u0275\u0275text(3, "\xD7");
    \u0275\u0275elementEnd()();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext();
    \u0275\u0275propertyInterpolate("title", ctx_r3.clearAllText);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_div_2_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275element(0, "span", 32);
  }
  if (rf & 2) {
    const item_r10 = \u0275\u0275nextContext().$implicit;
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275property("ngItemLabel", item_r10.label)("escape", ctx_r3.escapeHTML);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_div_2_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_dropdown_panel_13_div_2_Template(rf, ctx) {
  if (rf & 1) {
    const _r9 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 31);
    \u0275\u0275listener("click", function NgSelectComponent_ng_dropdown_panel_13_div_2_Template_div_click_0_listener() {
      const item_r10 = \u0275\u0275restoreView(_r9).$implicit;
      const ctx_r3 = \u0275\u0275nextContext(2);
      return \u0275\u0275resetView(ctx_r3.toggleItem(item_r10));
    })("mouseover", function NgSelectComponent_ng_dropdown_panel_13_div_2_Template_div_mouseover_0_listener() {
      const item_r10 = \u0275\u0275restoreView(_r9).$implicit;
      const ctx_r3 = \u0275\u0275nextContext(2);
      return \u0275\u0275resetView(ctx_r3.onItemHover(item_r10));
    });
    \u0275\u0275template(1, NgSelectComponent_ng_dropdown_panel_13_div_2_ng_template_1_Template, 1, 2, "ng-template", null, 4, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_dropdown_panel_13_div_2_ng_template_3_Template, 0, 0, "ng-template", 21);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const item_r10 = ctx.$implicit;
    const defaultOptionTemplate_r11 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275classProp("ng-option-disabled", item_r10.disabled)("ng-option-selected", item_r10.selected)("ng-optgroup", item_r10.children)("ng-option", !item_r10.children)("ng-option-child", !!item_r10.parent)("ng-option-marked", item_r10 === ctx_r3.itemsList.markedItem);
    \u0275\u0275attribute("role", item_r10.children ? "group" : "option")("aria-selected", item_r10.selected)("id", item_r10 == null ? null : item_r10.htmlId);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", item_r10.children ? ctx_r3.optgroupTemplate || defaultOptionTemplate_r11 : ctx_r3.optionTemplate || defaultOptionTemplate_r11)("ngTemplateOutletContext", \u0275\u0275pureFunction4(17, _c93, item_r10.value, item_r10, item_r10.index, ctx_r3.searchTerm));
  }
}
function NgSelectComponent_ng_dropdown_panel_13_div_3_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "span")(1, "span", 34);
    \u0275\u0275text(2);
    \u0275\u0275elementEnd();
    \u0275\u0275text(3);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext(3);
    \u0275\u0275advance(2);
    \u0275\u0275textInterpolate(ctx_r3.addTagText);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate1('"', ctx_r3.searchTerm, '"');
  }
}
function NgSelectComponent_ng_dropdown_panel_13_div_3_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_dropdown_panel_13_div_3_Template(rf, ctx) {
  if (rf & 1) {
    const _r12 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "div", 33);
    \u0275\u0275listener("mouseover", function NgSelectComponent_ng_dropdown_panel_13_div_3_Template_div_mouseover_0_listener() {
      \u0275\u0275restoreView(_r12);
      const ctx_r3 = \u0275\u0275nextContext(2);
      return \u0275\u0275resetView(ctx_r3.itemsList.unmarkItem());
    })("click", function NgSelectComponent_ng_dropdown_panel_13_div_3_Template_div_click_0_listener() {
      \u0275\u0275restoreView(_r12);
      const ctx_r3 = \u0275\u0275nextContext(2);
      return \u0275\u0275resetView(ctx_r3.selectTag());
    });
    \u0275\u0275template(1, NgSelectComponent_ng_dropdown_panel_13_div_3_ng_template_1_Template, 4, 2, "ng-template", null, 5, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_dropdown_panel_13_div_3_ng_template_3_Template, 0, 0, "ng-template", 21);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const defaultTagTemplate_r13 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275classProp("ng-option-marked", !ctx_r3.itemsList.markedItem);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.tagTemplate || defaultTagTemplate_r13)("ngTemplateOutletContext", \u0275\u0275pureFunction1(4, _c45, ctx_r3.searchTerm));
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_4_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 35);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext(3);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(ctx_r3.notFoundText);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_4_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_4_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementContainerStart(0);
    \u0275\u0275template(1, NgSelectComponent_ng_dropdown_panel_13_ng_container_4_ng_template_1_Template, 2, 1, "ng-template", null, 6, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_dropdown_panel_13_ng_container_4_ng_template_3_Template, 0, 0, "ng-template", 21);
    \u0275\u0275elementContainerEnd();
  }
  if (rf & 2) {
    const defaultNotFoundTemplate_r14 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.notFoundTemplate || defaultNotFoundTemplate_r14)("ngTemplateOutletContext", \u0275\u0275pureFunction1(2, _c45, ctx_r3.searchTerm));
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_5_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 35);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext(3);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(ctx_r3.typeToSearchText);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_5_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_5_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementContainerStart(0);
    \u0275\u0275template(1, NgSelectComponent_ng_dropdown_panel_13_ng_container_5_ng_template_1_Template, 2, 1, "ng-template", null, 7, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_dropdown_panel_13_ng_container_5_ng_template_3_Template, 0, 0, "ng-template", 24);
    \u0275\u0275elementContainerEnd();
  }
  if (rf & 2) {
    const defaultTypeToSearchTemplate_r15 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.typeToSearchTemplate || defaultTypeToSearchTemplate_r15);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_6_ng_template_1_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementStart(0, "div", 35);
    \u0275\u0275text(1);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext(3);
    \u0275\u0275advance();
    \u0275\u0275textInterpolate(ctx_r3.loadingText);
  }
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_6_ng_template_3_Template(rf, ctx) {
}
function NgSelectComponent_ng_dropdown_panel_13_ng_container_6_Template(rf, ctx) {
  if (rf & 1) {
    \u0275\u0275elementContainerStart(0);
    \u0275\u0275template(1, NgSelectComponent_ng_dropdown_panel_13_ng_container_6_ng_template_1_Template, 2, 1, "ng-template", null, 8, \u0275\u0275templateRefExtractor)(3, NgSelectComponent_ng_dropdown_panel_13_ng_container_6_ng_template_3_Template, 0, 0, "ng-template", 21);
    \u0275\u0275elementContainerEnd();
  }
  if (rf & 2) {
    const defaultLoadingTextTemplate_r16 = \u0275\u0275reference(2);
    const ctx_r3 = \u0275\u0275nextContext(2);
    \u0275\u0275advance(3);
    \u0275\u0275property("ngTemplateOutlet", ctx_r3.loadingTextTemplate || defaultLoadingTextTemplate_r16)("ngTemplateOutletContext", \u0275\u0275pureFunction1(2, _c45, ctx_r3.searchTerm));
  }
}
function NgSelectComponent_ng_dropdown_panel_13_Template(rf, ctx) {
  if (rf & 1) {
    const _r8 = \u0275\u0275getCurrentView();
    \u0275\u0275elementStart(0, "ng-dropdown-panel", 28);
    \u0275\u0275listener("update", function NgSelectComponent_ng_dropdown_panel_13_Template_ng_dropdown_panel_update_0_listener($event) {
      \u0275\u0275restoreView(_r8);
      const ctx_r3 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r3.viewPortItems = $event);
    })("scroll", function NgSelectComponent_ng_dropdown_panel_13_Template_ng_dropdown_panel_scroll_0_listener($event) {
      \u0275\u0275restoreView(_r8);
      const ctx_r3 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r3.scroll.emit($event));
    })("scrollToEnd", function NgSelectComponent_ng_dropdown_panel_13_Template_ng_dropdown_panel_scrollToEnd_0_listener($event) {
      \u0275\u0275restoreView(_r8);
      const ctx_r3 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r3.scrollToEnd.emit($event));
    })("outsideClick", function NgSelectComponent_ng_dropdown_panel_13_Template_ng_dropdown_panel_outsideClick_0_listener() {
      \u0275\u0275restoreView(_r8);
      const ctx_r3 = \u0275\u0275nextContext();
      return \u0275\u0275resetView(ctx_r3.close());
    });
    \u0275\u0275elementContainerStart(1);
    \u0275\u0275template(2, NgSelectComponent_ng_dropdown_panel_13_div_2_Template, 4, 22, "div", 29)(3, NgSelectComponent_ng_dropdown_panel_13_div_3_Template, 4, 6, "div", 30);
    \u0275\u0275elementContainerEnd();
    \u0275\u0275template(4, NgSelectComponent_ng_dropdown_panel_13_ng_container_4_Template, 4, 4, "ng-container", 12)(5, NgSelectComponent_ng_dropdown_panel_13_ng_container_5_Template, 4, 1, "ng-container", 12)(6, NgSelectComponent_ng_dropdown_panel_13_ng_container_6_Template, 4, 4, "ng-container", 12);
    \u0275\u0275elementEnd();
  }
  if (rf & 2) {
    const ctx_r3 = \u0275\u0275nextContext();
    \u0275\u0275classProp("ng-select-multiple", ctx_r3.multiple);
    \u0275\u0275property("virtualScroll", ctx_r3.virtualScroll)("bufferAmount", ctx_r3.bufferAmount)("appendTo", ctx_r3.appendTo)("position", ctx_r3.dropdownPosition)("headerTemplate", ctx_r3.headerTemplate)("footerTemplate", ctx_r3.footerTemplate)("filterValue", ctx_r3.searchTerm)("items", ctx_r3.itemsList.filteredItems)("markedItem", ctx_r3.itemsList.markedItem)("ngClass", ctx_r3.appendTo ? ctx_r3.classes : null)("id", ctx_r3.dropdownId);
    \u0275\u0275advance(2);
    \u0275\u0275property("ngForOf", ctx_r3.viewPortItems)("ngForTrackBy", ctx_r3.trackByOption);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r3.showAddTag);
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r3.showNoItemsFound());
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r3.showTypeToSearch());
    \u0275\u0275advance();
    \u0275\u0275property("ngIf", ctx_r3.loading && ctx_r3.itemsList.filteredItems.length === 0);
  }
}
var unescapedHTMLExp = /[&<>"']/g;
var hasUnescapedHTMLExp = RegExp(unescapedHTMLExp.source);
var htmlEscapes = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
};
function escapeHTML(value) {
  return value && hasUnescapedHTMLExp.test(value) ? value.replace(unescapedHTMLExp, (chr) => htmlEscapes[chr]) : value;
}
function isDefined(value) {
  return value !== void 0 && value !== null;
}
function isObject(value) {
  return typeof value === "object" && isDefined(value);
}
function isPromise3(value) {
  return value instanceof Promise;
}
function isFunction4(value) {
  return value instanceof Function;
}
var _NgItemLabelDirective = class _NgItemLabelDirective {
  constructor(element) {
    this.element = element;
    this.escape = true;
  }
  ngOnChanges(changes) {
    this.element.nativeElement.innerHTML = this.escape ? escapeHTML(this.ngItemLabel) : this.ngItemLabel;
  }
};
_NgItemLabelDirective.\u0275fac = function NgItemLabelDirective_Factory(t) {
  return new (t || _NgItemLabelDirective)(\u0275\u0275directiveInject(ElementRef));
};
_NgItemLabelDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgItemLabelDirective,
  selectors: [["", "ngItemLabel", ""]],
  inputs: {
    ngItemLabel: "ngItemLabel",
    escape: "escape"
  },
  features: [\u0275\u0275NgOnChangesFeature]
});
var NgItemLabelDirective = _NgItemLabelDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgItemLabelDirective, [{
    type: Directive,
    args: [{
      selector: "[ngItemLabel]"
    }]
  }], () => [{
    type: ElementRef
  }], {
    ngItemLabel: [{
      type: Input
    }],
    escape: [{
      type: Input
    }]
  });
})();
var _NgOptionTemplateDirective = class _NgOptionTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgOptionTemplateDirective.\u0275fac = function NgOptionTemplateDirective_Factory(t) {
  return new (t || _NgOptionTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgOptionTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgOptionTemplateDirective,
  selectors: [["", "ng-option-tmp", ""]]
});
var NgOptionTemplateDirective = _NgOptionTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptionTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-option-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgOptgroupTemplateDirective = class _NgOptgroupTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgOptgroupTemplateDirective.\u0275fac = function NgOptgroupTemplateDirective_Factory(t) {
  return new (t || _NgOptgroupTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgOptgroupTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgOptgroupTemplateDirective,
  selectors: [["", "ng-optgroup-tmp", ""]]
});
var NgOptgroupTemplateDirective = _NgOptgroupTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptgroupTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-optgroup-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgLabelTemplateDirective = class _NgLabelTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgLabelTemplateDirective.\u0275fac = function NgLabelTemplateDirective_Factory(t) {
  return new (t || _NgLabelTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgLabelTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgLabelTemplateDirective,
  selectors: [["", "ng-label-tmp", ""]]
});
var NgLabelTemplateDirective = _NgLabelTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLabelTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-label-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgMultiLabelTemplateDirective = class _NgMultiLabelTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgMultiLabelTemplateDirective.\u0275fac = function NgMultiLabelTemplateDirective_Factory(t) {
  return new (t || _NgMultiLabelTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgMultiLabelTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgMultiLabelTemplateDirective,
  selectors: [["", "ng-multi-label-tmp", ""]]
});
var NgMultiLabelTemplateDirective = _NgMultiLabelTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgMultiLabelTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-multi-label-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgHeaderTemplateDirective = class _NgHeaderTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgHeaderTemplateDirective.\u0275fac = function NgHeaderTemplateDirective_Factory(t) {
  return new (t || _NgHeaderTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgHeaderTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgHeaderTemplateDirective,
  selectors: [["", "ng-header-tmp", ""]]
});
var NgHeaderTemplateDirective = _NgHeaderTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgHeaderTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-header-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgFooterTemplateDirective = class _NgFooterTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgFooterTemplateDirective.\u0275fac = function NgFooterTemplateDirective_Factory(t) {
  return new (t || _NgFooterTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgFooterTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgFooterTemplateDirective,
  selectors: [["", "ng-footer-tmp", ""]]
});
var NgFooterTemplateDirective = _NgFooterTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgFooterTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-footer-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgNotFoundTemplateDirective = class _NgNotFoundTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgNotFoundTemplateDirective.\u0275fac = function NgNotFoundTemplateDirective_Factory(t) {
  return new (t || _NgNotFoundTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgNotFoundTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgNotFoundTemplateDirective,
  selectors: [["", "ng-notfound-tmp", ""]]
});
var NgNotFoundTemplateDirective = _NgNotFoundTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgNotFoundTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-notfound-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgTypeToSearchTemplateDirective = class _NgTypeToSearchTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgTypeToSearchTemplateDirective.\u0275fac = function NgTypeToSearchTemplateDirective_Factory(t) {
  return new (t || _NgTypeToSearchTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgTypeToSearchTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgTypeToSearchTemplateDirective,
  selectors: [["", "ng-typetosearch-tmp", ""]]
});
var NgTypeToSearchTemplateDirective = _NgTypeToSearchTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTypeToSearchTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-typetosearch-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgLoadingTextTemplateDirective = class _NgLoadingTextTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgLoadingTextTemplateDirective.\u0275fac = function NgLoadingTextTemplateDirective_Factory(t) {
  return new (t || _NgLoadingTextTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgLoadingTextTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgLoadingTextTemplateDirective,
  selectors: [["", "ng-loadingtext-tmp", ""]]
});
var NgLoadingTextTemplateDirective = _NgLoadingTextTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLoadingTextTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-loadingtext-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgTagTemplateDirective = class _NgTagTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgTagTemplateDirective.\u0275fac = function NgTagTemplateDirective_Factory(t) {
  return new (t || _NgTagTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgTagTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgTagTemplateDirective,
  selectors: [["", "ng-tag-tmp", ""]]
});
var NgTagTemplateDirective = _NgTagTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTagTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-tag-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
var _NgLoadingSpinnerTemplateDirective = class _NgLoadingSpinnerTemplateDirective {
  constructor(template) {
    this.template = template;
  }
};
_NgLoadingSpinnerTemplateDirective.\u0275fac = function NgLoadingSpinnerTemplateDirective_Factory(t) {
  return new (t || _NgLoadingSpinnerTemplateDirective)(\u0275\u0275directiveInject(TemplateRef));
};
_NgLoadingSpinnerTemplateDirective.\u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
  type: _NgLoadingSpinnerTemplateDirective,
  selectors: [["", "ng-loadingspinner-tmp", ""]]
});
var NgLoadingSpinnerTemplateDirective = _NgLoadingSpinnerTemplateDirective;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLoadingSpinnerTemplateDirective, [{
    type: Directive,
    args: [{
      selector: "[ng-loadingspinner-tmp]"
    }]
  }], () => [{
    type: TemplateRef
  }], null);
})();
function newId() {
  return "axxxxxxxxxxx".replace(/[x]/g, () => {
    const val = Math.random() * 16 | 0;
    return val.toString(16);
  });
}
var diacritics = {
  "\u24B6": "A",
  "\uFF21": "A",
  "\xC0": "A",
  "\xC1": "A",
  "\xC2": "A",
  "\u1EA6": "A",
  "\u1EA4": "A",
  "\u1EAA": "A",
  "\u1EA8": "A",
  "\xC3": "A",
  "\u0100": "A",
  "\u0102": "A",
  "\u1EB0": "A",
  "\u1EAE": "A",
  "\u1EB4": "A",
  "\u1EB2": "A",
  "\u0226": "A",
  "\u01E0": "A",
  "\xC4": "A",
  "\u01DE": "A",
  "\u1EA2": "A",
  "\xC5": "A",
  "\u01FA": "A",
  "\u01CD": "A",
  "\u0200": "A",
  "\u0202": "A",
  "\u1EA0": "A",
  "\u1EAC": "A",
  "\u1EB6": "A",
  "\u1E00": "A",
  "\u0104": "A",
  "\u023A": "A",
  "\u2C6F": "A",
  "\uA732": "AA",
  "\xC6": "AE",
  "\u01FC": "AE",
  "\u01E2": "AE",
  "\uA734": "AO",
  "\uA736": "AU",
  "\uA738": "AV",
  "\uA73A": "AV",
  "\uA73C": "AY",
  "\u24B7": "B",
  "\uFF22": "B",
  "\u1E02": "B",
  "\u1E04": "B",
  "\u1E06": "B",
  "\u0243": "B",
  "\u0182": "B",
  "\u0181": "B",
  "\u24B8": "C",
  "\uFF23": "C",
  "\u0106": "C",
  "\u0108": "C",
  "\u010A": "C",
  "\u010C": "C",
  "\xC7": "C",
  "\u1E08": "C",
  "\u0187": "C",
  "\u023B": "C",
  "\uA73E": "C",
  "\u24B9": "D",
  "\uFF24": "D",
  "\u1E0A": "D",
  "\u010E": "D",
  "\u1E0C": "D",
  "\u1E10": "D",
  "\u1E12": "D",
  "\u1E0E": "D",
  "\u0110": "D",
  "\u018B": "D",
  "\u018A": "D",
  "\u0189": "D",
  "\uA779": "D",
  "\u01F1": "DZ",
  "\u01C4": "DZ",
  "\u01F2": "Dz",
  "\u01C5": "Dz",
  "\u24BA": "E",
  "\uFF25": "E",
  "\xC8": "E",
  "\xC9": "E",
  "\xCA": "E",
  "\u1EC0": "E",
  "\u1EBE": "E",
  "\u1EC4": "E",
  "\u1EC2": "E",
  "\u1EBC": "E",
  "\u0112": "E",
  "\u1E14": "E",
  "\u1E16": "E",
  "\u0114": "E",
  "\u0116": "E",
  "\xCB": "E",
  "\u1EBA": "E",
  "\u011A": "E",
  "\u0204": "E",
  "\u0206": "E",
  "\u1EB8": "E",
  "\u1EC6": "E",
  "\u0228": "E",
  "\u1E1C": "E",
  "\u0118": "E",
  "\u1E18": "E",
  "\u1E1A": "E",
  "\u0190": "E",
  "\u018E": "E",
  "\u24BB": "F",
  "\uFF26": "F",
  "\u1E1E": "F",
  "\u0191": "F",
  "\uA77B": "F",
  "\u24BC": "G",
  "\uFF27": "G",
  "\u01F4": "G",
  "\u011C": "G",
  "\u1E20": "G",
  "\u011E": "G",
  "\u0120": "G",
  "\u01E6": "G",
  "\u0122": "G",
  "\u01E4": "G",
  "\u0193": "G",
  "\uA7A0": "G",
  "\uA77D": "G",
  "\uA77E": "G",
  "\u24BD": "H",
  "\uFF28": "H",
  "\u0124": "H",
  "\u1E22": "H",
  "\u1E26": "H",
  "\u021E": "H",
  "\u1E24": "H",
  "\u1E28": "H",
  "\u1E2A": "H",
  "\u0126": "H",
  "\u2C67": "H",
  "\u2C75": "H",
  "\uA78D": "H",
  "\u24BE": "I",
  "\uFF29": "I",
  "\xCC": "I",
  "\xCD": "I",
  "\xCE": "I",
  "\u0128": "I",
  "\u012A": "I",
  "\u012C": "I",
  "\u0130": "I",
  "\xCF": "I",
  "\u1E2E": "I",
  "\u1EC8": "I",
  "\u01CF": "I",
  "\u0208": "I",
  "\u020A": "I",
  "\u1ECA": "I",
  "\u012E": "I",
  "\u1E2C": "I",
  "\u0197": "I",
  "\u24BF": "J",
  "\uFF2A": "J",
  "\u0134": "J",
  "\u0248": "J",
  "\u24C0": "K",
  "\uFF2B": "K",
  "\u1E30": "K",
  "\u01E8": "K",
  "\u1E32": "K",
  "\u0136": "K",
  "\u1E34": "K",
  "\u0198": "K",
  "\u2C69": "K",
  "\uA740": "K",
  "\uA742": "K",
  "\uA744": "K",
  "\uA7A2": "K",
  "\u24C1": "L",
  "\uFF2C": "L",
  "\u013F": "L",
  "\u0139": "L",
  "\u013D": "L",
  "\u1E36": "L",
  "\u1E38": "L",
  "\u013B": "L",
  "\u1E3C": "L",
  "\u1E3A": "L",
  "\u0141": "L",
  "\u023D": "L",
  "\u2C62": "L",
  "\u2C60": "L",
  "\uA748": "L",
  "\uA746": "L",
  "\uA780": "L",
  "\u01C7": "LJ",
  "\u01C8": "Lj",
  "\u24C2": "M",
  "\uFF2D": "M",
  "\u1E3E": "M",
  "\u1E40": "M",
  "\u1E42": "M",
  "\u2C6E": "M",
  "\u019C": "M",
  "\u24C3": "N",
  "\uFF2E": "N",
  "\u01F8": "N",
  "\u0143": "N",
  "\xD1": "N",
  "\u1E44": "N",
  "\u0147": "N",
  "\u1E46": "N",
  "\u0145": "N",
  "\u1E4A": "N",
  "\u1E48": "N",
  "\u0220": "N",
  "\u019D": "N",
  "\uA790": "N",
  "\uA7A4": "N",
  "\u01CA": "NJ",
  "\u01CB": "Nj",
  "\u24C4": "O",
  "\uFF2F": "O",
  "\xD2": "O",
  "\xD3": "O",
  "\xD4": "O",
  "\u1ED2": "O",
  "\u1ED0": "O",
  "\u1ED6": "O",
  "\u1ED4": "O",
  "\xD5": "O",
  "\u1E4C": "O",
  "\u022C": "O",
  "\u1E4E": "O",
  "\u014C": "O",
  "\u1E50": "O",
  "\u1E52": "O",
  "\u014E": "O",
  "\u022E": "O",
  "\u0230": "O",
  "\xD6": "O",
  "\u022A": "O",
  "\u1ECE": "O",
  "\u0150": "O",
  "\u01D1": "O",
  "\u020C": "O",
  "\u020E": "O",
  "\u01A0": "O",
  "\u1EDC": "O",
  "\u1EDA": "O",
  "\u1EE0": "O",
  "\u1EDE": "O",
  "\u1EE2": "O",
  "\u1ECC": "O",
  "\u1ED8": "O",
  "\u01EA": "O",
  "\u01EC": "O",
  "\xD8": "O",
  "\u01FE": "O",
  "\u0186": "O",
  "\u019F": "O",
  "\uA74A": "O",
  "\uA74C": "O",
  "\u01A2": "OI",
  "\uA74E": "OO",
  "\u0222": "OU",
  "\u24C5": "P",
  "\uFF30": "P",
  "\u1E54": "P",
  "\u1E56": "P",
  "\u01A4": "P",
  "\u2C63": "P",
  "\uA750": "P",
  "\uA752": "P",
  "\uA754": "P",
  "\u24C6": "Q",
  "\uFF31": "Q",
  "\uA756": "Q",
  "\uA758": "Q",
  "\u024A": "Q",
  "\u24C7": "R",
  "\uFF32": "R",
  "\u0154": "R",
  "\u1E58": "R",
  "\u0158": "R",
  "\u0210": "R",
  "\u0212": "R",
  "\u1E5A": "R",
  "\u1E5C": "R",
  "\u0156": "R",
  "\u1E5E": "R",
  "\u024C": "R",
  "\u2C64": "R",
  "\uA75A": "R",
  "\uA7A6": "R",
  "\uA782": "R",
  "\u24C8": "S",
  "\uFF33": "S",
  "\u1E9E": "S",
  "\u015A": "S",
  "\u1E64": "S",
  "\u015C": "S",
  "\u1E60": "S",
  "\u0160": "S",
  "\u1E66": "S",
  "\u1E62": "S",
  "\u1E68": "S",
  "\u0218": "S",
  "\u015E": "S",
  "\u2C7E": "S",
  "\uA7A8": "S",
  "\uA784": "S",
  "\u24C9": "T",
  "\uFF34": "T",
  "\u1E6A": "T",
  "\u0164": "T",
  "\u1E6C": "T",
  "\u021A": "T",
  "\u0162": "T",
  "\u1E70": "T",
  "\u1E6E": "T",
  "\u0166": "T",
  "\u01AC": "T",
  "\u01AE": "T",
  "\u023E": "T",
  "\uA786": "T",
  "\uA728": "TZ",
  "\u24CA": "U",
  "\uFF35": "U",
  "\xD9": "U",
  "\xDA": "U",
  "\xDB": "U",
  "\u0168": "U",
  "\u1E78": "U",
  "\u016A": "U",
  "\u1E7A": "U",
  "\u016C": "U",
  "\xDC": "U",
  "\u01DB": "U",
  "\u01D7": "U",
  "\u01D5": "U",
  "\u01D9": "U",
  "\u1EE6": "U",
  "\u016E": "U",
  "\u0170": "U",
  "\u01D3": "U",
  "\u0214": "U",
  "\u0216": "U",
  "\u01AF": "U",
  "\u1EEA": "U",
  "\u1EE8": "U",
  "\u1EEE": "U",
  "\u1EEC": "U",
  "\u1EF0": "U",
  "\u1EE4": "U",
  "\u1E72": "U",
  "\u0172": "U",
  "\u1E76": "U",
  "\u1E74": "U",
  "\u0244": "U",
  "\u24CB": "V",
  "\uFF36": "V",
  "\u1E7C": "V",
  "\u1E7E": "V",
  "\u01B2": "V",
  "\uA75E": "V",
  "\u0245": "V",
  "\uA760": "VY",
  "\u24CC": "W",
  "\uFF37": "W",
  "\u1E80": "W",
  "\u1E82": "W",
  "\u0174": "W",
  "\u1E86": "W",
  "\u1E84": "W",
  "\u1E88": "W",
  "\u2C72": "W",
  "\u24CD": "X",
  "\uFF38": "X",
  "\u1E8A": "X",
  "\u1E8C": "X",
  "\u24CE": "Y",
  "\uFF39": "Y",
  "\u1EF2": "Y",
  "\xDD": "Y",
  "\u0176": "Y",
  "\u1EF8": "Y",
  "\u0232": "Y",
  "\u1E8E": "Y",
  "\u0178": "Y",
  "\u1EF6": "Y",
  "\u1EF4": "Y",
  "\u01B3": "Y",
  "\u024E": "Y",
  "\u1EFE": "Y",
  "\u24CF": "Z",
  "\uFF3A": "Z",
  "\u0179": "Z",
  "\u1E90": "Z",
  "\u017B": "Z",
  "\u017D": "Z",
  "\u1E92": "Z",
  "\u1E94": "Z",
  "\u01B5": "Z",
  "\u0224": "Z",
  "\u2C7F": "Z",
  "\u2C6B": "Z",
  "\uA762": "Z",
  "\u24D0": "a",
  "\uFF41": "a",
  "\u1E9A": "a",
  "\xE0": "a",
  "\xE1": "a",
  "\xE2": "a",
  "\u1EA7": "a",
  "\u1EA5": "a",
  "\u1EAB": "a",
  "\u1EA9": "a",
  "\xE3": "a",
  "\u0101": "a",
  "\u0103": "a",
  "\u1EB1": "a",
  "\u1EAF": "a",
  "\u1EB5": "a",
  "\u1EB3": "a",
  "\u0227": "a",
  "\u01E1": "a",
  "\xE4": "a",
  "\u01DF": "a",
  "\u1EA3": "a",
  "\xE5": "a",
  "\u01FB": "a",
  "\u01CE": "a",
  "\u0201": "a",
  "\u0203": "a",
  "\u1EA1": "a",
  "\u1EAD": "a",
  "\u1EB7": "a",
  "\u1E01": "a",
  "\u0105": "a",
  "\u2C65": "a",
  "\u0250": "a",
  "\uA733": "aa",
  "\xE6": "ae",
  "\u01FD": "ae",
  "\u01E3": "ae",
  "\uA735": "ao",
  "\uA737": "au",
  "\uA739": "av",
  "\uA73B": "av",
  "\uA73D": "ay",
  "\u24D1": "b",
  "\uFF42": "b",
  "\u1E03": "b",
  "\u1E05": "b",
  "\u1E07": "b",
  "\u0180": "b",
  "\u0183": "b",
  "\u0253": "b",
  "\u24D2": "c",
  "\uFF43": "c",
  "\u0107": "c",
  "\u0109": "c",
  "\u010B": "c",
  "\u010D": "c",
  "\xE7": "c",
  "\u1E09": "c",
  "\u0188": "c",
  "\u023C": "c",
  "\uA73F": "c",
  "\u2184": "c",
  "\u24D3": "d",
  "\uFF44": "d",
  "\u1E0B": "d",
  "\u010F": "d",
  "\u1E0D": "d",
  "\u1E11": "d",
  "\u1E13": "d",
  "\u1E0F": "d",
  "\u0111": "d",
  "\u018C": "d",
  "\u0256": "d",
  "\u0257": "d",
  "\uA77A": "d",
  "\u01F3": "dz",
  "\u01C6": "dz",
  "\u24D4": "e",
  "\uFF45": "e",
  "\xE8": "e",
  "\xE9": "e",
  "\xEA": "e",
  "\u1EC1": "e",
  "\u1EBF": "e",
  "\u1EC5": "e",
  "\u1EC3": "e",
  "\u1EBD": "e",
  "\u0113": "e",
  "\u1E15": "e",
  "\u1E17": "e",
  "\u0115": "e",
  "\u0117": "e",
  "\xEB": "e",
  "\u1EBB": "e",
  "\u011B": "e",
  "\u0205": "e",
  "\u0207": "e",
  "\u1EB9": "e",
  "\u1EC7": "e",
  "\u0229": "e",
  "\u1E1D": "e",
  "\u0119": "e",
  "\u1E19": "e",
  "\u1E1B": "e",
  "\u0247": "e",
  "\u025B": "e",
  "\u01DD": "e",
  "\u24D5": "f",
  "\uFF46": "f",
  "\u1E1F": "f",
  "\u0192": "f",
  "\uA77C": "f",
  "\u24D6": "g",
  "\uFF47": "g",
  "\u01F5": "g",
  "\u011D": "g",
  "\u1E21": "g",
  "\u011F": "g",
  "\u0121": "g",
  "\u01E7": "g",
  "\u0123": "g",
  "\u01E5": "g",
  "\u0260": "g",
  "\uA7A1": "g",
  "\u1D79": "g",
  "\uA77F": "g",
  "\u24D7": "h",
  "\uFF48": "h",
  "\u0125": "h",
  "\u1E23": "h",
  "\u1E27": "h",
  "\u021F": "h",
  "\u1E25": "h",
  "\u1E29": "h",
  "\u1E2B": "h",
  "\u1E96": "h",
  "\u0127": "h",
  "\u2C68": "h",
  "\u2C76": "h",
  "\u0265": "h",
  "\u0195": "hv",
  "\u24D8": "i",
  "\uFF49": "i",
  "\xEC": "i",
  "\xED": "i",
  "\xEE": "i",
  "\u0129": "i",
  "\u012B": "i",
  "\u012D": "i",
  "\xEF": "i",
  "\u1E2F": "i",
  "\u1EC9": "i",
  "\u01D0": "i",
  "\u0209": "i",
  "\u020B": "i",
  "\u1ECB": "i",
  "\u012F": "i",
  "\u1E2D": "i",
  "\u0268": "i",
  "\u0131": "i",
  "\u24D9": "j",
  "\uFF4A": "j",
  "\u0135": "j",
  "\u01F0": "j",
  "\u0249": "j",
  "\u24DA": "k",
  "\uFF4B": "k",
  "\u1E31": "k",
  "\u01E9": "k",
  "\u1E33": "k",
  "\u0137": "k",
  "\u1E35": "k",
  "\u0199": "k",
  "\u2C6A": "k",
  "\uA741": "k",
  "\uA743": "k",
  "\uA745": "k",
  "\uA7A3": "k",
  "\u24DB": "l",
  "\uFF4C": "l",
  "\u0140": "l",
  "\u013A": "l",
  "\u013E": "l",
  "\u1E37": "l",
  "\u1E39": "l",
  "\u013C": "l",
  "\u1E3D": "l",
  "\u1E3B": "l",
  "\u017F": "l",
  "\u0142": "l",
  "\u019A": "l",
  "\u026B": "l",
  "\u2C61": "l",
  "\uA749": "l",
  "\uA781": "l",
  "\uA747": "l",
  "\u01C9": "lj",
  "\u24DC": "m",
  "\uFF4D": "m",
  "\u1E3F": "m",
  "\u1E41": "m",
  "\u1E43": "m",
  "\u0271": "m",
  "\u026F": "m",
  "\u24DD": "n",
  "\uFF4E": "n",
  "\u01F9": "n",
  "\u0144": "n",
  "\xF1": "n",
  "\u1E45": "n",
  "\u0148": "n",
  "\u1E47": "n",
  "\u0146": "n",
  "\u1E4B": "n",
  "\u1E49": "n",
  "\u019E": "n",
  "\u0272": "n",
  "\u0149": "n",
  "\uA791": "n",
  "\uA7A5": "n",
  "\u01CC": "nj",
  "\u24DE": "o",
  "\uFF4F": "o",
  "\xF2": "o",
  "\xF3": "o",
  "\xF4": "o",
  "\u1ED3": "o",
  "\u1ED1": "o",
  "\u1ED7": "o",
  "\u1ED5": "o",
  "\xF5": "o",
  "\u1E4D": "o",
  "\u022D": "o",
  "\u1E4F": "o",
  "\u014D": "o",
  "\u1E51": "o",
  "\u1E53": "o",
  "\u014F": "o",
  "\u022F": "o",
  "\u0231": "o",
  "\xF6": "o",
  "\u022B": "o",
  "\u1ECF": "o",
  "\u0151": "o",
  "\u01D2": "o",
  "\u020D": "o",
  "\u020F": "o",
  "\u01A1": "o",
  "\u1EDD": "o",
  "\u1EDB": "o",
  "\u1EE1": "o",
  "\u1EDF": "o",
  "\u1EE3": "o",
  "\u1ECD": "o",
  "\u1ED9": "o",
  "\u01EB": "o",
  "\u01ED": "o",
  "\xF8": "o",
  "\u01FF": "o",
  "\u0254": "o",
  "\uA74B": "o",
  "\uA74D": "o",
  "\u0275": "o",
  "\u01A3": "oi",
  "\u0223": "ou",
  "\uA74F": "oo",
  "\u24DF": "p",
  "\uFF50": "p",
  "\u1E55": "p",
  "\u1E57": "p",
  "\u01A5": "p",
  "\u1D7D": "p",
  "\uA751": "p",
  "\uA753": "p",
  "\uA755": "p",
  "\u24E0": "q",
  "\uFF51": "q",
  "\u024B": "q",
  "\uA757": "q",
  "\uA759": "q",
  "\u24E1": "r",
  "\uFF52": "r",
  "\u0155": "r",
  "\u1E59": "r",
  "\u0159": "r",
  "\u0211": "r",
  "\u0213": "r",
  "\u1E5B": "r",
  "\u1E5D": "r",
  "\u0157": "r",
  "\u1E5F": "r",
  "\u024D": "r",
  "\u027D": "r",
  "\uA75B": "r",
  "\uA7A7": "r",
  "\uA783": "r",
  "\u24E2": "s",
  "\uFF53": "s",
  "\xDF": "s",
  "\u015B": "s",
  "\u1E65": "s",
  "\u015D": "s",
  "\u1E61": "s",
  "\u0161": "s",
  "\u1E67": "s",
  "\u1E63": "s",
  "\u1E69": "s",
  "\u0219": "s",
  "\u015F": "s",
  "\u023F": "s",
  "\uA7A9": "s",
  "\uA785": "s",
  "\u1E9B": "s",
  "\u24E3": "t",
  "\uFF54": "t",
  "\u1E6B": "t",
  "\u1E97": "t",
  "\u0165": "t",
  "\u1E6D": "t",
  "\u021B": "t",
  "\u0163": "t",
  "\u1E71": "t",
  "\u1E6F": "t",
  "\u0167": "t",
  "\u01AD": "t",
  "\u0288": "t",
  "\u2C66": "t",
  "\uA787": "t",
  "\uA729": "tz",
  "\u24E4": "u",
  "\uFF55": "u",
  "\xF9": "u",
  "\xFA": "u",
  "\xFB": "u",
  "\u0169": "u",
  "\u1E79": "u",
  "\u016B": "u",
  "\u1E7B": "u",
  "\u016D": "u",
  "\xFC": "u",
  "\u01DC": "u",
  "\u01D8": "u",
  "\u01D6": "u",
  "\u01DA": "u",
  "\u1EE7": "u",
  "\u016F": "u",
  "\u0171": "u",
  "\u01D4": "u",
  "\u0215": "u",
  "\u0217": "u",
  "\u01B0": "u",
  "\u1EEB": "u",
  "\u1EE9": "u",
  "\u1EEF": "u",
  "\u1EED": "u",
  "\u1EF1": "u",
  "\u1EE5": "u",
  "\u1E73": "u",
  "\u0173": "u",
  "\u1E77": "u",
  "\u1E75": "u",
  "\u0289": "u",
  "\u24E5": "v",
  "\uFF56": "v",
  "\u1E7D": "v",
  "\u1E7F": "v",
  "\u028B": "v",
  "\uA75F": "v",
  "\u028C": "v",
  "\uA761": "vy",
  "\u24E6": "w",
  "\uFF57": "w",
  "\u1E81": "w",
  "\u1E83": "w",
  "\u0175": "w",
  "\u1E87": "w",
  "\u1E85": "w",
  "\u1E98": "w",
  "\u1E89": "w",
  "\u2C73": "w",
  "\u24E7": "x",
  "\uFF58": "x",
  "\u1E8B": "x",
  "\u1E8D": "x",
  "\u24E8": "y",
  "\uFF59": "y",
  "\u1EF3": "y",
  "\xFD": "y",
  "\u0177": "y",
  "\u1EF9": "y",
  "\u0233": "y",
  "\u1E8F": "y",
  "\xFF": "y",
  "\u1EF7": "y",
  "\u1E99": "y",
  "\u1EF5": "y",
  "\u01B4": "y",
  "\u024F": "y",
  "\u1EFF": "y",
  "\u24E9": "z",
  "\uFF5A": "z",
  "\u017A": "z",
  "\u1E91": "z",
  "\u017C": "z",
  "\u017E": "z",
  "\u1E93": "z",
  "\u1E95": "z",
  "\u01B6": "z",
  "\u0225": "z",
  "\u0240": "z",
  "\u2C6C": "z",
  "\uA763": "z",
  "\u0386": "\u0391",
  "\u0388": "\u0395",
  "\u0389": "\u0397",
  "\u038A": "\u0399",
  "\u03AA": "\u0399",
  "\u038C": "\u039F",
  "\u038E": "\u03A5",
  "\u03AB": "\u03A5",
  "\u038F": "\u03A9",
  "\u03AC": "\u03B1",
  "\u03AD": "\u03B5",
  "\u03AE": "\u03B7",
  "\u03AF": "\u03B9",
  "\u03CA": "\u03B9",
  "\u0390": "\u03B9",
  "\u03CC": "\u03BF",
  "\u03CD": "\u03C5",
  "\u03CB": "\u03C5",
  "\u03B0": "\u03C5",
  "\u03C9": "\u03C9",
  "\u03C2": "\u03C3"
};
function stripSpecialChars(text) {
  const match2 = (a) => diacritics[a] || a;
  return text.replace(/[^\u0000-\u007E]/g, match2);
}
var ItemsList = class {
  constructor(_ngSelect, _selectionModel) {
    this._ngSelect = _ngSelect;
    this._selectionModel = _selectionModel;
    this._items = [];
    this._filteredItems = [];
    this._markedIndex = -1;
  }
  get items() {
    return this._items;
  }
  get filteredItems() {
    return this._filteredItems;
  }
  get markedIndex() {
    return this._markedIndex;
  }
  get selectedItems() {
    return this._selectionModel.value;
  }
  get markedItem() {
    return this._filteredItems[this._markedIndex];
  }
  get noItemsToSelect() {
    return this._ngSelect.hideSelected && this._items.length === this.selectedItems.length;
  }
  get maxItemsSelected() {
    return this._ngSelect.multiple && this._ngSelect.maxSelectedItems <= this.selectedItems.length;
  }
  get lastSelectedItem() {
    let i2 = this.selectedItems.length - 1;
    for (; i2 >= 0; i2--) {
      const item = this.selectedItems[i2];
      if (!item.disabled) {
        return item;
      }
    }
    return null;
  }
  setItems(items) {
    this._items = items.map((item, index) => this.mapItem(item, index));
    if (this._ngSelect.groupBy) {
      this._groups = this._groupBy(this._items, this._ngSelect.groupBy);
      this._items = this._flatten(this._groups);
    } else {
      this._groups = /* @__PURE__ */ new Map();
      this._groups.set(void 0, this._items);
    }
    this._filteredItems = [...this._items];
  }
  select(item) {
    if (item.selected || this.maxItemsSelected) {
      return;
    }
    const multiple = this._ngSelect.multiple;
    if (!multiple) {
      this.clearSelected();
    }
    this._selectionModel.select(item, multiple, this._ngSelect.selectableGroupAsModel);
    if (this._ngSelect.hideSelected) {
      this._hideSelected(item);
    }
  }
  unselect(item) {
    if (!item.selected) {
      return;
    }
    this._selectionModel.unselect(item, this._ngSelect.multiple);
    if (this._ngSelect.hideSelected && isDefined(item.index) && this._ngSelect.multiple) {
      this._showSelected(item);
    }
  }
  findItem(value) {
    let findBy;
    if (this._ngSelect.compareWith) {
      findBy = (item) => this._ngSelect.compareWith(item.value, value);
    } else if (this._ngSelect.bindValue) {
      findBy = (item) => !item.children && this.resolveNested(item.value, this._ngSelect.bindValue) === value;
    } else {
      findBy = (item) => item.value === value || !item.children && item.label && item.label === this.resolveNested(value, this._ngSelect.bindLabel);
    }
    return this._items.find((item) => findBy(item));
  }
  addItem(item) {
    const option = this.mapItem(item, this._items.length);
    this._items.push(option);
    this._filteredItems.push(option);
    return option;
  }
  clearSelected(keepDisabled = false) {
    this._selectionModel.clear(keepDisabled);
    this._items.forEach((item) => {
      item.selected = keepDisabled && item.selected && item.disabled;
      item.marked = false;
    });
    if (this._ngSelect.hideSelected) {
      this.resetFilteredItems();
    }
  }
  findByLabel(term) {
    term = stripSpecialChars(term).toLocaleLowerCase();
    return this.filteredItems.find((item) => {
      const label = stripSpecialChars(item.label).toLocaleLowerCase();
      return label.substr(0, term.length) === term;
    });
  }
  filter(term) {
    if (!term) {
      this.resetFilteredItems();
      return;
    }
    this._filteredItems = [];
    term = this._ngSelect.searchFn ? term : stripSpecialChars(term).toLocaleLowerCase();
    const match2 = this._ngSelect.searchFn || this._defaultSearchFn;
    const hideSelected = this._ngSelect.hideSelected;
    for (const key of Array.from(this._groups.keys())) {
      const matchedItems = [];
      for (const item of this._groups.get(key)) {
        if (hideSelected && (item.parent && item.parent.selected || item.selected)) {
          continue;
        }
        const searchItem = this._ngSelect.searchFn ? item.value : item;
        if (match2(term, searchItem)) {
          matchedItems.push(item);
        }
      }
      if (matchedItems.length > 0) {
        const [last2] = matchedItems.slice(-1);
        if (last2.parent) {
          const head = this._items.find((x) => x === last2.parent);
          this._filteredItems.push(head);
        }
        this._filteredItems.push(...matchedItems);
      }
    }
  }
  resetFilteredItems() {
    if (this._filteredItems.length === this._items.length) {
      return;
    }
    if (this._ngSelect.hideSelected && this.selectedItems.length > 0) {
      this._filteredItems = this._items.filter((x) => !x.selected);
    } else {
      this._filteredItems = this._items;
    }
  }
  unmarkItem() {
    this._markedIndex = -1;
  }
  markNextItem() {
    this._stepToItem(1);
  }
  markPreviousItem() {
    this._stepToItem(-1);
  }
  markItem(item) {
    this._markedIndex = this._filteredItems.indexOf(item);
  }
  markSelectedOrDefault(markDefault) {
    if (this._filteredItems.length === 0) {
      return;
    }
    const lastMarkedIndex = this._getLastMarkedIndex();
    if (lastMarkedIndex > -1) {
      this._markedIndex = lastMarkedIndex;
    } else {
      this._markedIndex = markDefault ? this.filteredItems.findIndex((x) => !x.disabled) : -1;
    }
  }
  resolveNested(option, key) {
    if (!isObject(option)) {
      return option;
    }
    if (key.indexOf(".") === -1) {
      return option[key];
    } else {
      const keys = key.split(".");
      let value = option;
      for (let i2 = 0, len = keys.length; i2 < len; ++i2) {
        if (value == null) {
          return null;
        }
        value = value[keys[i2]];
      }
      return value;
    }
  }
  mapItem(item, index) {
    const label = isDefined(item.$ngOptionLabel) ? item.$ngOptionLabel : this.resolveNested(item, this._ngSelect.bindLabel);
    const value = isDefined(item.$ngOptionValue) ? item.$ngOptionValue : item;
    return {
      index,
      label: isDefined(label) ? label.toString() : "",
      value,
      disabled: item.disabled,
      htmlId: `${this._ngSelect.dropdownId}-${index}`
    };
  }
  mapSelectedItems() {
    const multiple = this._ngSelect.multiple;
    for (const selected of this.selectedItems) {
      const value = this._ngSelect.bindValue ? this.resolveNested(selected.value, this._ngSelect.bindValue) : selected.value;
      const item = isDefined(value) ? this.findItem(value) : null;
      this._selectionModel.unselect(selected, multiple);
      this._selectionModel.select(item || selected, multiple, this._ngSelect.selectableGroupAsModel);
    }
    if (this._ngSelect.hideSelected) {
      this._filteredItems = this.filteredItems.filter((x) => this.selectedItems.indexOf(x) === -1);
    }
  }
  _showSelected(item) {
    this._filteredItems.push(item);
    if (item.parent) {
      const parent = item.parent;
      const parentExists = this._filteredItems.find((x) => x === parent);
      if (!parentExists) {
        this._filteredItems.push(parent);
      }
    } else if (item.children) {
      for (const child of item.children) {
        child.selected = false;
        this._filteredItems.push(child);
      }
    }
    this._filteredItems = [...this._filteredItems.sort((a, b) => a.index - b.index)];
  }
  _hideSelected(item) {
    this._filteredItems = this._filteredItems.filter((x) => x !== item);
    if (item.parent) {
      const children = item.parent.children;
      if (children.every((x) => x.selected)) {
        this._filteredItems = this._filteredItems.filter((x) => x !== item.parent);
      }
    } else if (item.children) {
      this._filteredItems = this.filteredItems.filter((x) => x.parent !== item);
    }
  }
  _defaultSearchFn(search, opt) {
    const label = stripSpecialChars(opt.label).toLocaleLowerCase();
    return label.indexOf(search) > -1;
  }
  _getNextItemIndex(steps) {
    if (steps > 0) {
      return this._markedIndex >= this._filteredItems.length - 1 ? 0 : this._markedIndex + 1;
    }
    return this._markedIndex <= 0 ? this._filteredItems.length - 1 : this._markedIndex - 1;
  }
  _stepToItem(steps) {
    if (this._filteredItems.length === 0 || this._filteredItems.every((x) => x.disabled)) {
      return;
    }
    this._markedIndex = this._getNextItemIndex(steps);
    if (this.markedItem.disabled) {
      this._stepToItem(steps);
    }
  }
  _getLastMarkedIndex() {
    if (this._ngSelect.hideSelected) {
      return -1;
    }
    if (this._markedIndex > -1 && this.markedItem === void 0) {
      return -1;
    }
    const selectedIndex = this._filteredItems.indexOf(this.lastSelectedItem);
    if (this.lastSelectedItem && selectedIndex < 0) {
      return -1;
    }
    return Math.max(this.markedIndex, selectedIndex);
  }
  _groupBy(items, prop) {
    const groups = /* @__PURE__ */ new Map();
    if (items.length === 0) {
      return groups;
    }
    if (Array.isArray(items[0].value[prop])) {
      for (const item of items) {
        const children = (item.value[prop] || []).map((x, index) => this.mapItem(x, index));
        groups.set(item, children);
      }
      return groups;
    }
    const isFnKey = isFunction4(this._ngSelect.groupBy);
    const keyFn = (item) => {
      const key = isFnKey ? prop(item.value) : item.value[prop];
      return isDefined(key) ? key : void 0;
    };
    for (const item of items) {
      const key = keyFn(item);
      const group2 = groups.get(key);
      if (group2) {
        group2.push(item);
      } else {
        groups.set(key, [item]);
      }
    }
    return groups;
  }
  _flatten(groups) {
    const isGroupByFn = isFunction4(this._ngSelect.groupBy);
    const items = [];
    for (const key of Array.from(groups.keys())) {
      let i2 = items.length;
      if (key === void 0) {
        const withoutGroup = groups.get(void 0) || [];
        items.push(...withoutGroup.map((x) => {
          x.index = i2++;
          return x;
        }));
        continue;
      }
      const isObjectKey = isObject(key);
      const parent = {
        label: isObjectKey ? "" : String(key),
        children: void 0,
        parent: null,
        index: i2++,
        disabled: !this._ngSelect.selectableGroup,
        htmlId: newId()
      };
      const groupKey = isGroupByFn ? this._ngSelect.bindLabel : this._ngSelect.groupBy;
      const groupValue = this._ngSelect.groupValue || (() => {
        if (isObjectKey) {
          return key.value;
        }
        return {
          [groupKey]: key
        };
      });
      const children = groups.get(key).map((x) => {
        x.parent = parent;
        x.children = void 0;
        x.index = i2++;
        return x;
      });
      parent.children = children;
      parent.value = groupValue(key, children.map((x) => x.value));
      items.push(parent);
      items.push(...children);
    }
    return items;
  }
};
var KeyCode;
(function(KeyCode2) {
  KeyCode2[KeyCode2["Tab"] = 9] = "Tab";
  KeyCode2[KeyCode2["Enter"] = 13] = "Enter";
  KeyCode2[KeyCode2["Esc"] = 27] = "Esc";
  KeyCode2[KeyCode2["Space"] = 32] = "Space";
  KeyCode2[KeyCode2["ArrowUp"] = 38] = "ArrowUp";
  KeyCode2[KeyCode2["ArrowDown"] = 40] = "ArrowDown";
  KeyCode2[KeyCode2["Backspace"] = 8] = "Backspace";
})(KeyCode || (KeyCode = {}));
var _NgDropdownPanelService = class _NgDropdownPanelService {
  constructor() {
    this._dimensions = {
      itemHeight: 0,
      panelHeight: 0,
      itemsPerViewport: 0
    };
  }
  get dimensions() {
    return this._dimensions;
  }
  calculateItems(scrollPos, itemsLength, buffer3) {
    const d = this._dimensions;
    const scrollHeight = d.itemHeight * itemsLength;
    const scrollTop = Math.max(0, scrollPos);
    const indexByScrollTop = scrollTop / scrollHeight * itemsLength;
    let end = Math.min(itemsLength, Math.ceil(indexByScrollTop) + (d.itemsPerViewport + 1));
    const maxStartEnd = end;
    const maxStart = Math.max(0, maxStartEnd - d.itemsPerViewport);
    let start2 = Math.min(maxStart, Math.floor(indexByScrollTop));
    let topPadding = d.itemHeight * Math.ceil(start2) - d.itemHeight * Math.min(start2, buffer3);
    topPadding = !isNaN(topPadding) ? topPadding : 0;
    start2 = !isNaN(start2) ? start2 : -1;
    end = !isNaN(end) ? end : -1;
    start2 -= buffer3;
    start2 = Math.max(0, start2);
    end += buffer3;
    end = Math.min(itemsLength, end);
    return {
      topPadding,
      scrollHeight,
      start: start2,
      end
    };
  }
  setDimensions(itemHeight, panelHeight) {
    const itemsPerViewport = Math.max(1, Math.floor(panelHeight / itemHeight));
    this._dimensions = {
      itemHeight,
      panelHeight,
      itemsPerViewport
    };
  }
  getScrollTo(itemTop, itemHeight, lastScroll) {
    const {
      panelHeight
    } = this.dimensions;
    const itemBottom = itemTop + itemHeight;
    const top = lastScroll;
    const bottom = top + panelHeight;
    if (panelHeight >= itemBottom && lastScroll === itemTop) {
      return null;
    }
    if (itemBottom > bottom) {
      return top + itemBottom - bottom;
    } else if (itemTop <= top) {
      return itemTop;
    }
    return null;
  }
};
_NgDropdownPanelService.\u0275fac = function NgDropdownPanelService_Factory(t) {
  return new (t || _NgDropdownPanelService)();
};
_NgDropdownPanelService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NgDropdownPanelService,
  factory: _NgDropdownPanelService.\u0275fac
});
var NgDropdownPanelService = _NgDropdownPanelService;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgDropdownPanelService, [{
    type: Injectable
  }], null, null);
})();
var CSS_POSITIONS = ["top", "right", "bottom", "left"];
var SCROLL_SCHEDULER2 = typeof requestAnimationFrame !== "undefined" ? animationFrameScheduler : asapScheduler;
var _NgDropdownPanelComponent = class _NgDropdownPanelComponent {
  constructor(_renderer, _zone, _panelService, _elementRef, _document2) {
    this._renderer = _renderer;
    this._zone = _zone;
    this._panelService = _panelService;
    this._document = _document2;
    this.items = [];
    this.position = "auto";
    this.virtualScroll = false;
    this.filterValue = null;
    this.update = new EventEmitter();
    this.scroll = new EventEmitter();
    this.scrollToEnd = new EventEmitter();
    this.outsideClick = new EventEmitter();
    this._destroy$ = new Subject();
    this._scrollToEndFired = false;
    this._updateScrollHeight = false;
    this._lastScrollPosition = 0;
    this._dropdown = _elementRef.nativeElement;
  }
  get currentPosition() {
    return this._currentPosition;
  }
  get itemsLength() {
    return this._itemsLength;
  }
  set itemsLength(value) {
    if (value !== this._itemsLength) {
      this._itemsLength = value;
      this._onItemsLengthChanged();
    }
  }
  get _startOffset() {
    if (this.markedItem) {
      const {
        itemHeight,
        panelHeight
      } = this._panelService.dimensions;
      const offset2 = this.markedItem.index * itemHeight;
      return panelHeight > offset2 ? 0 : offset2;
    }
    return 0;
  }
  ngOnInit() {
    this._select = this._dropdown.parentElement;
    this._virtualPadding = this.paddingElementRef.nativeElement;
    this._scrollablePanel = this.scrollElementRef.nativeElement;
    this._contentPanel = this.contentElementRef.nativeElement;
    this._handleScroll();
    this._handleOutsideClick();
    this._appendDropdown();
    this._setupMousedownListener();
  }
  ngOnChanges(changes) {
    if (changes.items) {
      const change = changes.items;
      this._onItemsChange(change.currentValue, change.firstChange);
    }
  }
  ngOnDestroy() {
    this._destroy$.next();
    this._destroy$.complete();
    this._destroy$.unsubscribe();
    if (this.appendTo) {
      this._renderer.removeChild(this._dropdown.parentNode, this._dropdown);
    }
  }
  scrollTo(option, startFromOption = false) {
    if (!option) {
      return;
    }
    const index = this.items.indexOf(option);
    if (index < 0 || index >= this.itemsLength) {
      return;
    }
    let scrollTo;
    if (this.virtualScroll) {
      const itemHeight = this._panelService.dimensions.itemHeight;
      scrollTo = this._panelService.getScrollTo(index * itemHeight, itemHeight, this._lastScrollPosition);
    } else {
      const item = this._dropdown.querySelector(`#${option.htmlId}`);
      const lastScroll = startFromOption ? item.offsetTop : this._lastScrollPosition;
      scrollTo = this._panelService.getScrollTo(item.offsetTop, item.clientHeight, lastScroll);
    }
    if (isDefined(scrollTo)) {
      this._scrollablePanel.scrollTop = scrollTo;
    }
  }
  scrollToTag() {
    const panel = this._scrollablePanel;
    panel.scrollTop = panel.scrollHeight - panel.clientHeight;
  }
  adjustPosition() {
    this._updateYPosition();
  }
  _handleDropdownPosition() {
    this._currentPosition = this._calculateCurrentPosition(this._dropdown);
    if (CSS_POSITIONS.includes(this._currentPosition)) {
      this._updateDropdownClass(this._currentPosition);
    } else {
      this._updateDropdownClass("bottom");
    }
    if (this.appendTo) {
      this._updateYPosition();
    }
    this._dropdown.style.opacity = "1";
  }
  _updateDropdownClass(currentPosition) {
    CSS_POSITIONS.forEach((position) => {
      const REMOVE_CSS_CLASS = `ng-select-${position}`;
      this._renderer.removeClass(this._dropdown, REMOVE_CSS_CLASS);
      this._renderer.removeClass(this._select, REMOVE_CSS_CLASS);
    });
    const ADD_CSS_CLASS = `ng-select-${currentPosition}`;
    this._renderer.addClass(this._dropdown, ADD_CSS_CLASS);
    this._renderer.addClass(this._select, ADD_CSS_CLASS);
  }
  _handleScroll() {
    this._zone.runOutsideAngular(() => {
      fromEvent(this.scrollElementRef.nativeElement, "scroll").pipe(takeUntil(this._destroy$), auditTime(0, SCROLL_SCHEDULER2)).subscribe((e) => {
        const path = e.path || e.composedPath && e.composedPath();
        if (!path || path.length === 0 && !e.target) {
          return;
        }
        const scrollTop = !path || path.length === 0 ? e.target.scrollTop : path[0].scrollTop;
        this._onContentScrolled(scrollTop);
      });
    });
  }
  _handleOutsideClick() {
    if (!this._document) {
      return;
    }
    this._zone.runOutsideAngular(() => {
      merge(fromEvent(this._document, "touchstart", {
        capture: true
      }), fromEvent(this._document, "mousedown", {
        capture: true
      })).pipe(takeUntil(this._destroy$)).subscribe(($event) => this._checkToClose($event));
    });
  }
  _checkToClose($event) {
    if (this._select.contains($event.target) || this._dropdown.contains($event.target)) {
      return;
    }
    const path = $event.path || $event.composedPath && $event.composedPath();
    if ($event.target && $event.target.shadowRoot && path && path[0] && this._select.contains(path[0])) {
      return;
    }
    this._zone.run(() => this.outsideClick.emit());
  }
  _onItemsChange(items, firstChange) {
    this.items = items || [];
    this._scrollToEndFired = false;
    this.itemsLength = items.length;
    if (this.virtualScroll) {
      this._updateItemsRange(firstChange);
    } else {
      this._setVirtualHeight();
      this._updateItems(firstChange);
    }
  }
  _updateItems(firstChange) {
    this.update.emit(this.items);
    if (firstChange === false) {
      return;
    }
    this._zone.runOutsideAngular(() => {
      Promise.resolve().then(() => {
        const panelHeight = this._scrollablePanel.clientHeight;
        this._panelService.setDimensions(0, panelHeight);
        this._handleDropdownPosition();
        this.scrollTo(this.markedItem, firstChange);
      });
    });
  }
  _updateItemsRange(firstChange) {
    this._zone.runOutsideAngular(() => {
      this._measureDimensions().then(() => {
        if (firstChange) {
          this._renderItemsRange(this._startOffset);
          this._handleDropdownPosition();
        } else {
          this._renderItemsRange();
        }
      });
    });
  }
  _onContentScrolled(scrollTop) {
    if (this.virtualScroll) {
      this._renderItemsRange(scrollTop);
    }
    this._lastScrollPosition = scrollTop;
    this._fireScrollToEnd(scrollTop);
  }
  _updateVirtualHeight(height) {
    if (this._updateScrollHeight) {
      this._virtualPadding.style.height = `${height}px`;
      this._updateScrollHeight = false;
    }
  }
  _setVirtualHeight() {
    if (!this._virtualPadding) {
      return;
    }
    this._virtualPadding.style.height = `0px`;
  }
  _onItemsLengthChanged() {
    this._updateScrollHeight = true;
  }
  _renderItemsRange(scrollTop = null) {
    if (scrollTop && this._lastScrollPosition === scrollTop) {
      return;
    }
    scrollTop = scrollTop || this._scrollablePanel.scrollTop;
    const range2 = this._panelService.calculateItems(scrollTop, this.itemsLength, this.bufferAmount);
    this._updateVirtualHeight(range2.scrollHeight);
    this._contentPanel.style.transform = `translateY(${range2.topPadding}px)`;
    this._zone.run(() => {
      this.update.emit(this.items.slice(range2.start, range2.end));
      this.scroll.emit({
        start: range2.start,
        end: range2.end
      });
    });
    if (isDefined(scrollTop) && this._lastScrollPosition === 0) {
      this._scrollablePanel.scrollTop = scrollTop;
      this._lastScrollPosition = scrollTop;
    }
  }
  _measureDimensions() {
    if (this._panelService.dimensions.itemHeight > 0 || this.itemsLength === 0) {
      return Promise.resolve(this._panelService.dimensions);
    }
    const [first2] = this.items;
    this.update.emit([first2]);
    return Promise.resolve().then(() => {
      const option = this._dropdown.querySelector(`#${first2.htmlId}`);
      const optionHeight = option.clientHeight;
      this._virtualPadding.style.height = `${optionHeight * this.itemsLength}px`;
      const panelHeight = this._scrollablePanel.clientHeight;
      this._panelService.setDimensions(optionHeight, panelHeight);
      return this._panelService.dimensions;
    });
  }
  _fireScrollToEnd(scrollTop) {
    if (this._scrollToEndFired || scrollTop === 0) {
      return;
    }
    const padding = this.virtualScroll ? this._virtualPadding : this._contentPanel;
    if (scrollTop + this._dropdown.clientHeight >= padding.clientHeight - 1) {
      this._zone.run(() => this.scrollToEnd.emit());
      this._scrollToEndFired = true;
    }
  }
  _calculateCurrentPosition(dropdownEl) {
    if (this.position !== "auto") {
      return this.position;
    }
    const selectRect = this._select.getBoundingClientRect();
    const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
    const offsetTop = selectRect.top + window.pageYOffset;
    const height = selectRect.height;
    const dropdownHeight = dropdownEl.getBoundingClientRect().height;
    if (offsetTop + height + dropdownHeight > scrollTop + document.documentElement.clientHeight) {
      return "top";
    } else {
      return "bottom";
    }
  }
  _appendDropdown() {
    if (!this.appendTo) {
      return;
    }
    this._parent = document.querySelector(this.appendTo);
    if (!this._parent) {
      throw new Error(`appendTo selector ${this.appendTo} did not found any parent element`);
    }
    this._updateXPosition();
    this._parent.appendChild(this._dropdown);
  }
  _updateXPosition() {
    const select2 = this._select.getBoundingClientRect();
    const parent = this._parent.getBoundingClientRect();
    const offsetLeft = select2.left - parent.left;
    this._dropdown.style.left = offsetLeft + "px";
    this._dropdown.style.width = select2.width + "px";
    this._dropdown.style.minWidth = select2.width + "px";
  }
  _updateYPosition() {
    const select2 = this._select.getBoundingClientRect();
    const parent = this._parent.getBoundingClientRect();
    const delta = select2.height;
    if (this._currentPosition === "top") {
      const offsetBottom = parent.bottom - select2.bottom;
      this._dropdown.style.bottom = offsetBottom + delta + "px";
      this._dropdown.style.top = "auto";
    } else if (this._currentPosition === "bottom") {
      const offsetTop = select2.top - parent.top;
      this._dropdown.style.top = offsetTop + delta + "px";
      this._dropdown.style.bottom = "auto";
    }
  }
  _setupMousedownListener() {
    this._zone.runOutsideAngular(() => {
      fromEvent(this._dropdown, "mousedown").pipe(takeUntil(this._destroy$)).subscribe((event) => {
        const target = event.target;
        if (target.tagName === "INPUT") {
          return;
        }
        event.preventDefault();
      });
    });
  }
};
_NgDropdownPanelComponent.\u0275fac = function NgDropdownPanelComponent_Factory(t) {
  return new (t || _NgDropdownPanelComponent)(\u0275\u0275directiveInject(Renderer2), \u0275\u0275directiveInject(NgZone), \u0275\u0275directiveInject(NgDropdownPanelService), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(DOCUMENT2, 8));
};
_NgDropdownPanelComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _NgDropdownPanelComponent,
  selectors: [["ng-dropdown-panel"]],
  viewQuery: function NgDropdownPanelComponent_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(_c011, 7, ElementRef);
      \u0275\u0275viewQuery(_c19, 7, ElementRef);
      \u0275\u0275viewQuery(_c26, 7, ElementRef);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.contentElementRef = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.scrollElementRef = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.paddingElementRef = _t.first);
    }
  },
  inputs: {
    items: "items",
    markedItem: "markedItem",
    position: "position",
    appendTo: "appendTo",
    bufferAmount: "bufferAmount",
    virtualScroll: "virtualScroll",
    headerTemplate: "headerTemplate",
    footerTemplate: "footerTemplate",
    filterValue: "filterValue"
  },
  outputs: {
    update: "update",
    scroll: "scroll",
    scrollToEnd: "scrollToEnd",
    outsideClick: "outsideClick"
  },
  features: [\u0275\u0275NgOnChangesFeature],
  ngContentSelectors: _c36,
  decls: 9,
  vars: 6,
  consts: [["scroll", ""], ["padding", ""], ["content", ""], ["class", "ng-dropdown-header", 4, "ngIf"], ["role", "listbox", 1, "ng-dropdown-panel-items", "scroll-host"], ["class", "ng-dropdown-footer", 4, "ngIf"], [1, "ng-dropdown-header"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "ng-dropdown-footer"]],
  template: function NgDropdownPanelComponent_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275template(0, NgDropdownPanelComponent_div_0_Template, 2, 4, "div", 3);
      \u0275\u0275elementStart(1, "div", 4, 0);
      \u0275\u0275element(3, "div", null, 1);
      \u0275\u0275elementStart(5, "div", null, 2);
      \u0275\u0275projection(7);
      \u0275\u0275elementEnd()();
      \u0275\u0275template(8, NgDropdownPanelComponent_div_8_Template, 2, 4, "div", 5);
    }
    if (rf & 2) {
      \u0275\u0275property("ngIf", ctx.headerTemplate);
      \u0275\u0275advance(3);
      \u0275\u0275classProp("total-padding", ctx.virtualScroll);
      \u0275\u0275advance(2);
      \u0275\u0275classProp("scrollable-content", ctx.virtualScroll && ctx.items.length);
      \u0275\u0275advance(3);
      \u0275\u0275property("ngIf", ctx.footerTemplate);
    }
  },
  dependencies: [NgIf, NgTemplateOutlet],
  encapsulation: 2,
  changeDetection: 0
});
var NgDropdownPanelComponent = _NgDropdownPanelComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgDropdownPanelComponent, [{
    type: Component,
    args: [{
      changeDetection: ChangeDetectionStrategy.OnPush,
      encapsulation: ViewEncapsulation$1.None,
      selector: "ng-dropdown-panel",
      template: `
        <div *ngIf="headerTemplate" class="ng-dropdown-header">
            <ng-container [ngTemplateOutlet]="headerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }"></ng-container>
        </div>
        <div #scroll role="listbox" class="ng-dropdown-panel-items scroll-host">
            <div #padding [class.total-padding]="virtualScroll"></div>
            <div #content [class.scrollable-content]="virtualScroll && items.length">
                <ng-content></ng-content>
            </div>
        </div>
        <div *ngIf="footerTemplate" class="ng-dropdown-footer">
            <ng-container [ngTemplateOutlet]="footerTemplate" [ngTemplateOutletContext]="{ searchTerm: filterValue }"></ng-container>
        </div>
    `
    }]
  }], () => [{
    type: Renderer2
  }, {
    type: NgZone
  }, {
    type: NgDropdownPanelService
  }, {
    type: ElementRef
  }, {
    type: void 0,
    decorators: [{
      type: Optional
    }, {
      type: Inject,
      args: [DOCUMENT2]
    }]
  }], {
    items: [{
      type: Input
    }],
    markedItem: [{
      type: Input
    }],
    position: [{
      type: Input
    }],
    appendTo: [{
      type: Input
    }],
    bufferAmount: [{
      type: Input
    }],
    virtualScroll: [{
      type: Input
    }],
    headerTemplate: [{
      type: Input
    }],
    footerTemplate: [{
      type: Input
    }],
    filterValue: [{
      type: Input
    }],
    update: [{
      type: Output
    }],
    scroll: [{
      type: Output
    }],
    scrollToEnd: [{
      type: Output
    }],
    outsideClick: [{
      type: Output
    }],
    contentElementRef: [{
      type: ViewChild,
      args: ["content", {
        read: ElementRef,
        static: true
      }]
    }],
    scrollElementRef: [{
      type: ViewChild,
      args: ["scroll", {
        read: ElementRef,
        static: true
      }]
    }],
    paddingElementRef: [{
      type: ViewChild,
      args: ["padding", {
        read: ElementRef,
        static: true
      }]
    }]
  });
})();
var _NgOptionComponent = class _NgOptionComponent {
  get disabled() {
    return this._disabled;
  }
  set disabled(value) {
    this._disabled = this._isDisabled(value);
  }
  constructor(elementRef) {
    this.elementRef = elementRef;
    this.stateChange$ = new Subject();
    this._disabled = false;
  }
  get label() {
    return (this.elementRef.nativeElement.textContent || "").trim();
  }
  ngOnChanges(changes) {
    if (changes.disabled) {
      this.stateChange$.next({
        value: this.value,
        disabled: this._disabled
      });
    }
  }
  ngAfterViewChecked() {
    if (this.label !== this._previousLabel) {
      this._previousLabel = this.label;
      this.stateChange$.next({
        value: this.value,
        disabled: this._disabled,
        label: this.elementRef.nativeElement.innerHTML
      });
    }
  }
  ngOnDestroy() {
    this.stateChange$.complete();
  }
  _isDisabled(value) {
    return value != null && `${value}` !== "false";
  }
};
_NgOptionComponent.\u0275fac = function NgOptionComponent_Factory(t) {
  return new (t || _NgOptionComponent)(\u0275\u0275directiveInject(ElementRef));
};
_NgOptionComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _NgOptionComponent,
  selectors: [["ng-option"]],
  inputs: {
    value: "value",
    disabled: "disabled"
  },
  features: [\u0275\u0275NgOnChangesFeature],
  ngContentSelectors: _c36,
  decls: 1,
  vars: 0,
  template: function NgOptionComponent_Template(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275projectionDef();
      \u0275\u0275projection(0);
    }
  },
  encapsulation: 2,
  changeDetection: 0
});
var NgOptionComponent = _NgOptionComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptionComponent, [{
    type: Component,
    args: [{
      selector: "ng-option",
      changeDetection: ChangeDetectionStrategy.OnPush,
      template: `<ng-content></ng-content>`
    }]
  }], () => [{
    type: ElementRef
  }], {
    value: [{
      type: Input
    }],
    disabled: [{
      type: Input
    }]
  });
})();
var _NgSelectConfig = class _NgSelectConfig {
  constructor() {
    this.notFoundText = "No items found";
    this.typeToSearchText = "Type to search";
    this.addTagText = "Add item";
    this.loadingText = "Loading...";
    this.clearAllText = "Clear all";
    this.disableVirtualScroll = true;
    this.openOnEnter = true;
    this.appearance = "underline";
  }
};
_NgSelectConfig.\u0275fac = function NgSelectConfig_Factory(t) {
  return new (t || _NgSelectConfig)();
};
_NgSelectConfig.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _NgSelectConfig,
  factory: _NgSelectConfig.\u0275fac,
  providedIn: "root"
});
var NgSelectConfig = _NgSelectConfig;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSelectConfig, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var _ConsoleService = class _ConsoleService {
  warn(message) {
    console.warn(message);
  }
};
_ConsoleService.\u0275fac = function ConsoleService_Factory(t) {
  return new (t || _ConsoleService)();
};
_ConsoleService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
  token: _ConsoleService,
  factory: _ConsoleService.\u0275fac,
  providedIn: "root"
});
var ConsoleService = _ConsoleService;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ConsoleService, [{
    type: Injectable,
    args: [{
      providedIn: "root"
    }]
  }], null, null);
})();
var SELECTION_MODEL_FACTORY = new InjectionToken("ng-select-selection-model");
var _NgSelectComponent = class _NgSelectComponent {
  get items() {
    return this._items;
  }
  set items(value) {
    if (value === null) {
      value = [];
    }
    this._itemsAreUsed = true;
    this._items = value;
  }
  get compareWith() {
    return this._compareWith;
  }
  set compareWith(fn) {
    if (fn !== void 0 && fn !== null && !isFunction4(fn)) {
      throw Error("`compareWith` must be a function.");
    }
    this._compareWith = fn;
  }
  get clearSearchOnAdd() {
    if (isDefined(this._clearSearchOnAdd)) {
      return this._clearSearchOnAdd;
    } else if (isDefined(this.config.clearSearchOnAdd)) {
      return this.config.clearSearchOnAdd;
    }
    return this.closeOnSelect;
  }
  set clearSearchOnAdd(value) {
    this._clearSearchOnAdd = value;
  }
  get deselectOnClick() {
    if (isDefined(this._deselectOnClick)) {
      return this._deselectOnClick;
    } else if (isDefined(this.config.deselectOnClick)) {
      return this.config.deselectOnClick;
    }
    return this.multiple;
  }
  set deselectOnClick(value) {
    this._deselectOnClick = value;
  }
  get disabled() {
    return this.readonly || this._disabled;
  }
  get filtered() {
    return !!this.searchTerm && this.searchable || this._isComposing;
  }
  get single() {
    return !this.multiple;
  }
  get _editableSearchTerm() {
    return this.editableSearchTerm && !this.multiple;
  }
  constructor(classes, autoFocus, config2, newSelectionModel, _elementRef, _cd, _console) {
    this.classes = classes;
    this.autoFocus = autoFocus;
    this.config = config2;
    this._cd = _cd;
    this._console = _console;
    this.markFirst = true;
    this.dropdownPosition = "auto";
    this.loading = false;
    this.closeOnSelect = true;
    this.hideSelected = false;
    this.selectOnTab = false;
    this.bufferAmount = 4;
    this.selectableGroup = false;
    this.selectableGroupAsModel = true;
    this.searchFn = null;
    this.trackByFn = null;
    this.clearOnBackspace = true;
    this.labelForId = null;
    this.inputAttrs = {};
    this.readonly = false;
    this.searchWhileComposing = true;
    this.minTermLength = 0;
    this.editableSearchTerm = false;
    this.keyDownFn = (_) => true;
    this.multiple = false;
    this.addTag = false;
    this.searchable = true;
    this.clearable = true;
    this.isOpen = false;
    this.blurEvent = new EventEmitter();
    this.focusEvent = new EventEmitter();
    this.changeEvent = new EventEmitter();
    this.openEvent = new EventEmitter();
    this.closeEvent = new EventEmitter();
    this.searchEvent = new EventEmitter();
    this.clearEvent = new EventEmitter();
    this.addEvent = new EventEmitter();
    this.removeEvent = new EventEmitter();
    this.scroll = new EventEmitter();
    this.scrollToEnd = new EventEmitter();
    this.useDefaultClass = true;
    this.viewPortItems = [];
    this.searchTerm = null;
    this.dropdownId = newId();
    this.escapeHTML = true;
    this._items = [];
    this._defaultLabel = "label";
    this._pressedKeys = [];
    this._isComposing = false;
    this._destroy$ = new Subject();
    this._keyPress$ = new Subject();
    this._onChange = (_) => {
    };
    this._onTouched = () => {
    };
    this.clearItem = (item) => {
      const option = this.selectedItems.find((x) => x.value === item);
      this.unselect(option);
    };
    this.trackByOption = (_, item) => {
      if (this.trackByFn) {
        return this.trackByFn(item.value);
      }
      return item;
    };
    this._mergeGlobalConfig(config2);
    this.itemsList = new ItemsList(this, newSelectionModel());
    this.element = _elementRef.nativeElement;
  }
  get selectedItems() {
    return this.itemsList.selectedItems;
  }
  get selectedValues() {
    return this.selectedItems.map((x) => x.value);
  }
  get hasValue() {
    return this.selectedItems.length > 0;
  }
  get currentPanelPosition() {
    if (this.dropdownPanel) {
      return this.dropdownPanel.currentPosition;
    }
    return void 0;
  }
  ngOnInit() {
    this._handleKeyPresses();
    this._setInputAttributes();
  }
  ngOnChanges(changes) {
    if (changes.multiple) {
      this.itemsList.clearSelected();
    }
    if (changes.items) {
      this._setItems(changes.items.currentValue || []);
    }
    if (changes.isOpen) {
      this._manualOpen = isDefined(changes.isOpen.currentValue);
    }
  }
  ngAfterViewInit() {
    if (!this._itemsAreUsed) {
      this.escapeHTML = false;
      this._setItemsFromNgOptions();
    }
    if (isDefined(this.autoFocus)) {
      this.focus();
    }
  }
  ngOnDestroy() {
    this._destroy$.next();
    this._destroy$.complete();
  }
  handleKeyDown($event) {
    const keyCode = KeyCode[$event.which];
    if (keyCode) {
      if (this.keyDownFn($event) === false) {
        return;
      }
      this.handleKeyCode($event);
    } else if ($event.key && $event.key.length === 1) {
      this._keyPress$.next($event.key.toLocaleLowerCase());
    }
  }
  handleKeyCode($event) {
    const target = $event.target;
    if (this.clearButton && this.clearButton.nativeElement === target) {
      this.handleKeyCodeClear($event);
    } else {
      this.handleKeyCodeInput($event);
    }
  }
  handleKeyCodeInput($event) {
    switch ($event.which) {
      case KeyCode.ArrowDown:
        this._handleArrowDown($event);
        break;
      case KeyCode.ArrowUp:
        this._handleArrowUp($event);
        break;
      case KeyCode.Space:
        this._handleSpace($event);
        break;
      case KeyCode.Enter:
        this._handleEnter($event);
        break;
      case KeyCode.Tab:
        this._handleTab($event);
        break;
      case KeyCode.Esc:
        this.close();
        $event.preventDefault();
        break;
      case KeyCode.Backspace:
        this._handleBackspace();
        break;
    }
  }
  handleKeyCodeClear($event) {
    switch ($event.which) {
      case KeyCode.Enter:
        this.handleClearClick();
        $event.preventDefault();
        break;
    }
  }
  handleMousedown($event) {
    const target = $event.target;
    if (target.tagName !== "INPUT") {
      $event.preventDefault();
    }
    if (target.classList.contains("ng-clear-wrapper")) {
      this.handleClearClick();
      return;
    }
    if (target.classList.contains("ng-arrow-wrapper")) {
      this.handleArrowClick();
      return;
    }
    if (target.classList.contains("ng-value-icon")) {
      return;
    }
    if (!this.focused) {
      this.focus();
    }
    if (this.searchable) {
      this.open();
    } else {
      this.toggle();
    }
  }
  handleArrowClick() {
    if (this.isOpen) {
      this.close();
    } else {
      this.open();
    }
  }
  handleClearClick() {
    if (this.hasValue) {
      this.itemsList.clearSelected(true);
      this._updateNgModel();
    }
    this._clearSearch();
    this.focus();
    this.clearEvent.emit();
    this._onSelectionChanged();
  }
  clearModel() {
    if (!this.clearable) {
      return;
    }
    this.itemsList.clearSelected();
    this._updateNgModel();
  }
  writeValue(value) {
    this.itemsList.clearSelected();
    this._handleWriteValue(value);
    this._cd.markForCheck();
  }
  registerOnChange(fn) {
    this._onChange = fn;
  }
  registerOnTouched(fn) {
    this._onTouched = fn;
  }
  setDisabledState(state2) {
    this._disabled = state2;
    this._cd.markForCheck();
  }
  toggle() {
    if (!this.isOpen) {
      this.open();
    } else {
      this.close();
    }
  }
  open() {
    if (this.disabled || this.isOpen || this._manualOpen) {
      return;
    }
    if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {
      return;
    }
    this.isOpen = true;
    this.itemsList.markSelectedOrDefault(this.markFirst);
    this.openEvent.emit();
    if (!this.searchTerm) {
      this.focus();
    }
    this.detectChanges();
  }
  close() {
    if (!this.isOpen || this._manualOpen) {
      return;
    }
    this.isOpen = false;
    this._isComposing = false;
    if (!this._editableSearchTerm) {
      this._clearSearch();
    } else {
      this.itemsList.resetFilteredItems();
    }
    this.itemsList.unmarkItem();
    this._onTouched();
    this.closeEvent.emit();
    this._cd.markForCheck();
  }
  toggleItem(item) {
    if (!item || item.disabled || this.disabled) {
      return;
    }
    if (this.deselectOnClick && item.selected) {
      this.unselect(item);
    } else {
      this.select(item);
    }
    if (this._editableSearchTerm) {
      this._setSearchTermFromItems();
    }
    this._onSelectionChanged();
  }
  select(item) {
    if (!item.selected) {
      this.itemsList.select(item);
      if (this.clearSearchOnAdd && !this._editableSearchTerm) {
        this._clearSearch();
      }
      this._updateNgModel();
      if (this.multiple) {
        this.addEvent.emit(item.value);
      }
    }
    if (this.closeOnSelect || this.itemsList.noItemsToSelect) {
      this.close();
    }
  }
  focus() {
    this.searchInput.nativeElement.focus();
  }
  blur() {
    this.searchInput.nativeElement.blur();
  }
  unselect(item) {
    if (!item) {
      return;
    }
    this.itemsList.unselect(item);
    this.focus();
    this._updateNgModel();
    this.removeEvent.emit(item.value);
  }
  selectTag() {
    let tag;
    if (isFunction4(this.addTag)) {
      tag = this.addTag(this.searchTerm);
    } else {
      tag = this._primitive ? this.searchTerm : {
        [this.bindLabel]: this.searchTerm
      };
    }
    const handleTag = (item) => this._isTypeahead || !this.isOpen ? this.itemsList.mapItem(item, null) : this.itemsList.addItem(item);
    if (isPromise3(tag)) {
      tag.then((item) => this.select(handleTag(item))).catch(() => {
      });
    } else if (tag) {
      this.select(handleTag(tag));
    }
  }
  showClear() {
    return this.clearable && (this.hasValue || this.searchTerm) && !this.disabled;
  }
  focusOnClear() {
    this.blur();
    if (this.clearButton) {
      this.clearButton.nativeElement.focus();
    }
  }
  get showAddTag() {
    if (!this._validTerm) {
      return false;
    }
    const term = this.searchTerm.toLowerCase().trim();
    return this.addTag && !this.itemsList.filteredItems.some((x) => x.label.toLowerCase() === term) && (!this.hideSelected && this.isOpen || !this.selectedItems.some((x) => x.label.toLowerCase() === term)) && !this.loading;
  }
  showNoItemsFound() {
    const empty = this.itemsList.filteredItems.length === 0;
    return (empty && !this._isTypeahead && !this.loading || empty && this._isTypeahead && this._validTerm && !this.loading) && !this.showAddTag;
  }
  showTypeToSearch() {
    const empty = this.itemsList.filteredItems.length === 0;
    return empty && this._isTypeahead && !this._validTerm && !this.loading;
  }
  onCompositionStart() {
    this._isComposing = true;
  }
  onCompositionEnd(term) {
    this._isComposing = false;
    if (this.searchWhileComposing) {
      return;
    }
    this.filter(term);
  }
  filter(term) {
    if (this._isComposing && !this.searchWhileComposing) {
      return;
    }
    this.searchTerm = term;
    if (this._isTypeahead && (this._validTerm || this.minTermLength === 0)) {
      this.typeahead.next(term);
    }
    if (!this._isTypeahead) {
      this.itemsList.filter(this.searchTerm);
      if (this.isOpen) {
        this.itemsList.markSelectedOrDefault(this.markFirst);
      }
    }
    this.searchEvent.emit({
      term,
      items: this.itemsList.filteredItems.map((x) => x.value)
    });
    this.open();
  }
  onInputFocus($event) {
    if (this.focused) {
      return;
    }
    if (this._editableSearchTerm) {
      this._setSearchTermFromItems();
    }
    this.element.classList.add("ng-select-focused");
    this.focusEvent.emit($event);
    this.focused = true;
  }
  onInputBlur($event) {
    this.element.classList.remove("ng-select-focused");
    this.blurEvent.emit($event);
    if (!this.isOpen && !this.disabled) {
      this._onTouched();
    }
    if (this._editableSearchTerm) {
      this._setSearchTermFromItems();
    }
    this.focused = false;
  }
  onItemHover(item) {
    if (item.disabled) {
      return;
    }
    this.itemsList.markItem(item);
  }
  detectChanges() {
    if (!this._cd.destroyed) {
      this._cd.detectChanges();
    }
  }
  _setSearchTermFromItems() {
    const selected = this.selectedItems && this.selectedItems[0];
    this.searchTerm = selected && selected.label || null;
  }
  _setItems(items) {
    const firstItem = items[0];
    this.bindLabel = this.bindLabel || this._defaultLabel;
    this._primitive = isDefined(firstItem) ? !isObject(firstItem) : this._primitive || this.bindLabel === this._defaultLabel;
    this.itemsList.setItems(items);
    if (items.length > 0 && this.hasValue) {
      this.itemsList.mapSelectedItems();
    }
    if (this.isOpen && isDefined(this.searchTerm) && !this._isTypeahead) {
      this.itemsList.filter(this.searchTerm);
    }
    if (this._isTypeahead || this.isOpen) {
      this.itemsList.markSelectedOrDefault(this.markFirst);
    }
  }
  _setItemsFromNgOptions() {
    const mapNgOptions = (options) => {
      this.items = options.map((option) => ({
        $ngOptionValue: option.value,
        $ngOptionLabel: option.elementRef.nativeElement.innerHTML,
        disabled: option.disabled
      }));
      this.itemsList.setItems(this.items);
      if (this.hasValue) {
        this.itemsList.mapSelectedItems();
      }
      this.detectChanges();
    };
    const handleOptionChange = () => {
      const changedOrDestroyed = merge(this.ngOptions.changes, this._destroy$);
      merge(...this.ngOptions.map((option) => option.stateChange$)).pipe(takeUntil(changedOrDestroyed)).subscribe((option) => {
        const item = this.itemsList.findItem(option.value);
        item.disabled = option.disabled;
        item.label = option.label || item.label;
        this._cd.detectChanges();
      });
    };
    this.ngOptions.changes.pipe(startWith(this.ngOptions), takeUntil(this._destroy$)).subscribe((options) => {
      this.bindLabel = this._defaultLabel;
      mapNgOptions(options);
      handleOptionChange();
    });
  }
  _isValidWriteValue(value) {
    if (!isDefined(value) || this.multiple && value === "" || Array.isArray(value) && value.length === 0) {
      return false;
    }
    const validateBinding = (item) => {
      if (!isDefined(this.compareWith) && isObject(item) && this.bindValue) {
        this._console.warn(`Setting object(${JSON.stringify(item)}) as your model with bindValue is not allowed unless [compareWith] is used.`);
        return false;
      }
      return true;
    };
    if (this.multiple) {
      if (!Array.isArray(value)) {
        this._console.warn("Multiple select ngModel should be array.");
        return false;
      }
      return value.every((item) => validateBinding(item));
    } else {
      return validateBinding(value);
    }
  }
  _handleWriteValue(ngModel) {
    if (!this._isValidWriteValue(ngModel)) {
      return;
    }
    const select2 = (val) => {
      let item = this.itemsList.findItem(val);
      if (item) {
        this.itemsList.select(item);
      } else {
        const isValObject = isObject(val);
        const isPrimitive = !isValObject && !this.bindValue;
        if (isValObject || isPrimitive) {
          this.itemsList.select(this.itemsList.mapItem(val, null));
        } else if (this.bindValue) {
          item = {
            [this.bindLabel]: null,
            [this.bindValue]: val
          };
          this.itemsList.select(this.itemsList.mapItem(item, null));
        }
      }
    };
    if (this.multiple) {
      ngModel.forEach((item) => select2(item));
    } else {
      select2(ngModel);
    }
  }
  _handleKeyPresses() {
    if (this.searchable) {
      return;
    }
    this._keyPress$.pipe(takeUntil(this._destroy$), tap((letter) => this._pressedKeys.push(letter)), debounceTime(200), filter(() => this._pressedKeys.length > 0), map(() => this._pressedKeys.join(""))).subscribe((term) => {
      const item = this.itemsList.findByLabel(term);
      if (item) {
        if (this.isOpen) {
          this.itemsList.markItem(item);
          this._scrollToMarked();
          this._cd.markForCheck();
        } else {
          this.select(item);
        }
      }
      this._pressedKeys = [];
    });
  }
  _setInputAttributes() {
    const input2 = this.searchInput.nativeElement;
    const attributes = __spreadValues({
      type: "text",
      autocorrect: "off",
      autocapitalize: "off",
      autocomplete: this.labelForId ? "off" : this.dropdownId
    }, this.inputAttrs);
    for (const key of Object.keys(attributes)) {
      input2.setAttribute(key, attributes[key]);
    }
  }
  _updateNgModel() {
    const model2 = [];
    for (const item of this.selectedItems) {
      if (this.bindValue) {
        let value = null;
        if (item.children) {
          const groupKey = this.groupValue ? this.bindValue : this.groupBy;
          value = item.value[groupKey || this.groupBy];
        } else {
          value = this.itemsList.resolveNested(item.value, this.bindValue);
        }
        model2.push(value);
      } else {
        model2.push(item.value);
      }
    }
    const selected = this.selectedItems.map((x) => x.value);
    if (this.multiple) {
      this._onChange(model2);
      this.changeEvent.emit(selected);
    } else {
      this._onChange(isDefined(model2[0]) ? model2[0] : null);
      this.changeEvent.emit(selected[0]);
    }
    this._cd.markForCheck();
  }
  _clearSearch() {
    if (!this.searchTerm) {
      return;
    }
    this._changeSearch(null);
    this.itemsList.resetFilteredItems();
  }
  _changeSearch(searchTerm) {
    this.searchTerm = searchTerm;
    if (this._isTypeahead) {
      this.typeahead.next(searchTerm);
    }
  }
  _scrollToMarked() {
    if (!this.isOpen || !this.dropdownPanel) {
      return;
    }
    this.dropdownPanel.scrollTo(this.itemsList.markedItem);
  }
  _scrollToTag() {
    if (!this.isOpen || !this.dropdownPanel) {
      return;
    }
    this.dropdownPanel.scrollToTag();
  }
  _onSelectionChanged() {
    if (this.isOpen && this.deselectOnClick && this.appendTo) {
      this._cd.detectChanges();
      this.dropdownPanel.adjustPosition();
    }
  }
  _handleTab($event) {
    if (this.isOpen === false) {
      if (this.showClear()) {
        this.focusOnClear();
        $event.preventDefault();
      } else if (!this.addTag) {
        return;
      }
    }
    if (this.selectOnTab) {
      if (this.itemsList.markedItem) {
        this.toggleItem(this.itemsList.markedItem);
        $event.preventDefault();
      } else if (this.showAddTag) {
        this.selectTag();
        $event.preventDefault();
      } else {
        this.close();
      }
    } else {
      this.close();
    }
  }
  _handleEnter($event) {
    if (this.isOpen || this._manualOpen) {
      if (this.itemsList.markedItem) {
        this.toggleItem(this.itemsList.markedItem);
      } else if (this.showAddTag) {
        this.selectTag();
      }
    } else if (this.openOnEnter) {
      this.open();
    } else {
      return;
    }
    $event.preventDefault();
  }
  _handleSpace($event) {
    if (this.isOpen || this._manualOpen) {
      return;
    }
    this.open();
    $event.preventDefault();
  }
  _handleArrowDown($event) {
    if (this._nextItemIsTag(1)) {
      this.itemsList.unmarkItem();
      this._scrollToTag();
    } else {
      this.itemsList.markNextItem();
      this._scrollToMarked();
    }
    this.open();
    $event.preventDefault();
  }
  _handleArrowUp($event) {
    if (!this.isOpen) {
      return;
    }
    if (this._nextItemIsTag(-1)) {
      this.itemsList.unmarkItem();
      this._scrollToTag();
    } else {
      this.itemsList.markPreviousItem();
      this._scrollToMarked();
    }
    $event.preventDefault();
  }
  _nextItemIsTag(nextStep) {
    const nextIndex = this.itemsList.markedIndex + nextStep;
    return this.addTag && this.searchTerm && this.itemsList.markedItem && (nextIndex < 0 || nextIndex === this.itemsList.filteredItems.length);
  }
  _handleBackspace() {
    if (this.searchTerm || !this.clearable || !this.clearOnBackspace || !this.hasValue) {
      return;
    }
    if (this.multiple) {
      this.unselect(this.itemsList.lastSelectedItem);
    } else {
      this.clearModel();
    }
  }
  get _isTypeahead() {
    return this.typeahead && this.typeahead.observers.length > 0;
  }
  get _validTerm() {
    const term = this.searchTerm && this.searchTerm.trim();
    return term && term.length >= this.minTermLength;
  }
  _mergeGlobalConfig(config2) {
    this.placeholder = this.placeholder || config2.placeholder;
    this.notFoundText = this.notFoundText || config2.notFoundText;
    this.typeToSearchText = this.typeToSearchText || config2.typeToSearchText;
    this.addTagText = this.addTagText || config2.addTagText;
    this.loadingText = this.loadingText || config2.loadingText;
    this.clearAllText = this.clearAllText || config2.clearAllText;
    this.virtualScroll = isDefined(this.virtualScroll) ? this.virtualScroll : isDefined(config2.disableVirtualScroll) ? !config2.disableVirtualScroll : false;
    this.openOnEnter = isDefined(this.openOnEnter) ? this.openOnEnter : config2.openOnEnter;
    this.appendTo = this.appendTo || config2.appendTo;
    this.bindValue = this.bindValue || config2.bindValue;
    this.bindLabel = this.bindLabel || config2.bindLabel;
    this.appearance = this.appearance || config2.appearance;
  }
};
_NgSelectComponent.\u0275fac = function NgSelectComponent_Factory(t) {
  return new (t || _NgSelectComponent)(\u0275\u0275injectAttribute("class"), \u0275\u0275injectAttribute("autofocus"), \u0275\u0275directiveInject(NgSelectConfig), \u0275\u0275directiveInject(SELECTION_MODEL_FACTORY), \u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(ChangeDetectorRef), \u0275\u0275directiveInject(ConsoleService));
};
_NgSelectComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
  type: _NgSelectComponent,
  selectors: [["ng-select"]],
  contentQueries: function NgSelectComponent_ContentQueries(rf, ctx, dirIndex) {
    if (rf & 1) {
      \u0275\u0275contentQuery(dirIndex, NgOptionTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgOptgroupTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgLabelTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgMultiLabelTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgHeaderTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgFooterTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgNotFoundTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgTypeToSearchTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgLoadingTextTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgTagTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgLoadingSpinnerTemplateDirective, 5, TemplateRef);
      \u0275\u0275contentQuery(dirIndex, NgOptionComponent, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.optionTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.optgroupTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.labelTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.multiLabelTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.headerTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.footerTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.notFoundTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.typeToSearchTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.loadingTextTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.tagTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.loadingSpinnerTemplate = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.ngOptions = _t);
    }
  },
  viewQuery: function NgSelectComponent_Query(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275viewQuery(NgDropdownPanelComponent, 5);
      \u0275\u0275viewQuery(_c55, 7);
      \u0275\u0275viewQuery(_c65, 5);
    }
    if (rf & 2) {
      let _t;
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.dropdownPanel = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.searchInput = _t.first);
      \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.clearButton = _t.first);
    }
  },
  hostVars: 20,
  hostBindings: function NgSelectComponent_HostBindings(rf, ctx) {
    if (rf & 1) {
      \u0275\u0275listener("keydown", function NgSelectComponent_keydown_HostBindingHandler($event) {
        return ctx.handleKeyDown($event);
      });
    }
    if (rf & 2) {
      \u0275\u0275classProp("ng-select-typeahead", ctx.typeahead)("ng-select-multiple", ctx.multiple)("ng-select-taggable", ctx.addTag)("ng-select-searchable", ctx.searchable)("ng-select-clearable", ctx.clearable)("ng-select-opened", ctx.isOpen)("ng-select", ctx.useDefaultClass)("ng-select-disabled", ctx.disabled)("ng-select-filtered", ctx.filtered)("ng-select-single", ctx.single);
    }
  },
  inputs: {
    bindLabel: "bindLabel",
    bindValue: "bindValue",
    markFirst: "markFirst",
    placeholder: "placeholder",
    notFoundText: "notFoundText",
    typeToSearchText: "typeToSearchText",
    addTagText: "addTagText",
    loadingText: "loadingText",
    clearAllText: "clearAllText",
    appearance: "appearance",
    dropdownPosition: "dropdownPosition",
    appendTo: "appendTo",
    loading: "loading",
    closeOnSelect: "closeOnSelect",
    hideSelected: "hideSelected",
    selectOnTab: "selectOnTab",
    openOnEnter: "openOnEnter",
    maxSelectedItems: "maxSelectedItems",
    groupBy: "groupBy",
    groupValue: "groupValue",
    bufferAmount: "bufferAmount",
    virtualScroll: "virtualScroll",
    selectableGroup: "selectableGroup",
    selectableGroupAsModel: "selectableGroupAsModel",
    searchFn: "searchFn",
    trackByFn: "trackByFn",
    clearOnBackspace: "clearOnBackspace",
    labelForId: "labelForId",
    inputAttrs: "inputAttrs",
    tabIndex: "tabIndex",
    readonly: "readonly",
    searchWhileComposing: "searchWhileComposing",
    minTermLength: "minTermLength",
    editableSearchTerm: "editableSearchTerm",
    keyDownFn: "keyDownFn",
    typeahead: "typeahead",
    multiple: "multiple",
    addTag: "addTag",
    searchable: "searchable",
    clearable: "clearable",
    isOpen: "isOpen",
    items: "items",
    compareWith: "compareWith",
    clearSearchOnAdd: "clearSearchOnAdd",
    deselectOnClick: "deselectOnClick"
  },
  outputs: {
    blurEvent: "blur",
    focusEvent: "focus",
    changeEvent: "change",
    openEvent: "open",
    closeEvent: "close",
    searchEvent: "search",
    clearEvent: "clear",
    addEvent: "add",
    removeEvent: "remove",
    scroll: "scroll",
    scrollToEnd: "scrollToEnd"
  },
  features: [\u0275\u0275ProvidersFeature([{
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => _NgSelectComponent),
    multi: true
  }, NgDropdownPanelService]), \u0275\u0275NgOnChangesFeature],
  decls: 14,
  vars: 19,
  consts: [["searchInput", ""], ["defaultLabelTemplate", ""], ["defaultLoadingSpinnerTemplate", ""], ["clearButton", ""], ["defaultOptionTemplate", ""], ["defaultTagTemplate", ""], ["defaultNotFoundTemplate", ""], ["defaultTypeToSearchTemplate", ""], ["defaultLoadingTextTemplate", ""], [1, "ng-select-container", 3, "mousedown"], [1, "ng-value-container"], [1, "ng-placeholder"], [4, "ngIf"], ["role", "combobox", "aria-haspopup", "listbox", 1, "ng-input"], ["aria-autocomplete", "list", 3, "input", "compositionstart", "compositionend", "focus", "blur", "change", "readOnly", "disabled", "value"], ["class", "ng-clear-wrapper", "tabindex", "0", 3, "title", 4, "ngIf"], [1, "ng-arrow-wrapper"], [1, "ng-arrow"], ["class", "ng-dropdown-panel", "role", "listbox", "aria-label", "Options list", 3, "virtualScroll", "bufferAmount", "appendTo", "position", "headerTemplate", "footerTemplate", "filterValue", "items", "markedItem", "ng-select-multiple", "ngClass", "id", "update", "scroll", "scrollToEnd", "outsideClick", 4, "ngIf"], ["class", "ng-value", 3, "ng-value-disabled", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "ng-value"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["aria-hidden", "true", 1, "ng-value-icon", "left", 3, "click"], [1, "ng-value-label", 3, "ngItemLabel", "escape"], [3, "ngTemplateOutlet"], [1, "ng-spinner-loader"], ["tabindex", "0", 1, "ng-clear-wrapper", 3, "title"], ["aria-hidden", "true", 1, "ng-clear"], ["role", "listbox", "aria-label", "Options list", 1, "ng-dropdown-panel", 3, "update", "scroll", "scrollToEnd", "outsideClick", "virtualScroll", "bufferAmount", "appendTo", "position", "headerTemplate", "footerTemplate", "filterValue", "items", "markedItem", "ngClass", "id"], ["class", "ng-option", 3, "ng-option-disabled", "ng-option-selected", "ng-optgroup", "ng-option", "ng-option-child", "ng-option-marked", "click", "mouseover", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "ng-option", "role", "option", 3, "ng-option-marked", "mouseover", "click", 4, "ngIf"], [1, "ng-option", 3, "click", "mouseover"], [1, "ng-option-label", 3, "ngItemLabel", "escape"], ["role", "option", 1, "ng-option", 3, "mouseover", "click"], [1, "ng-tag-label"], [1, "ng-option", "ng-option-disabled"]],
  template: function NgSelectComponent_Template(rf, ctx) {
    if (rf & 1) {
      const _r1 = \u0275\u0275getCurrentView();
      \u0275\u0275elementStart(0, "div", 9);
      \u0275\u0275listener("mousedown", function NgSelectComponent_Template_div_mousedown_0_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx.handleMousedown($event));
      });
      \u0275\u0275elementStart(1, "div", 10)(2, "div", 11);
      \u0275\u0275text(3);
      \u0275\u0275elementEnd();
      \u0275\u0275template(4, NgSelectComponent_ng_container_4_Template, 2, 2, "ng-container", 12)(5, NgSelectComponent_5_Template, 1, 5, null, 12);
      \u0275\u0275elementStart(6, "div", 13)(7, "input", 14, 0);
      \u0275\u0275listener("input", function NgSelectComponent_Template_input_input_7_listener() {
        \u0275\u0275restoreView(_r1);
        const searchInput_r6 = \u0275\u0275reference(8);
        return \u0275\u0275resetView(ctx.filter(searchInput_r6.value));
      })("compositionstart", function NgSelectComponent_Template_input_compositionstart_7_listener() {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx.onCompositionStart());
      })("compositionend", function NgSelectComponent_Template_input_compositionend_7_listener() {
        \u0275\u0275restoreView(_r1);
        const searchInput_r6 = \u0275\u0275reference(8);
        return \u0275\u0275resetView(ctx.onCompositionEnd(searchInput_r6.value));
      })("focus", function NgSelectComponent_Template_input_focus_7_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx.onInputFocus($event));
      })("blur", function NgSelectComponent_Template_input_blur_7_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView(ctx.onInputBlur($event));
      })("change", function NgSelectComponent_Template_input_change_7_listener($event) {
        \u0275\u0275restoreView(_r1);
        return \u0275\u0275resetView($event.stopPropagation());
      });
      \u0275\u0275elementEnd()()();
      \u0275\u0275template(9, NgSelectComponent_ng_container_9_Template, 4, 1, "ng-container", 12)(10, NgSelectComponent_span_10_Template, 4, 1, "span", 15);
      \u0275\u0275elementStart(11, "span", 16);
      \u0275\u0275element(12, "span", 17);
      \u0275\u0275elementEnd()();
      \u0275\u0275template(13, NgSelectComponent_ng_dropdown_panel_13_Template, 7, 19, "ng-dropdown-panel", 18);
    }
    if (rf & 2) {
      \u0275\u0275classProp("ng-appearance-outline", ctx.appearance === "outline")("ng-has-value", ctx.hasValue);
      \u0275\u0275advance(3);
      \u0275\u0275textInterpolate(ctx.placeholder);
      \u0275\u0275advance();
      \u0275\u0275property("ngIf", (!ctx.multiLabelTemplate || !ctx.multiple) && ctx.selectedItems.length > 0);
      \u0275\u0275advance();
      \u0275\u0275property("ngIf", ctx.multiple && ctx.multiLabelTemplate && ctx.selectedValues.length > 0);
      \u0275\u0275advance();
      \u0275\u0275attribute("aria-expanded", ctx.isOpen)("aria-owns", ctx.isOpen ? ctx.dropdownId : null);
      \u0275\u0275advance();
      \u0275\u0275property("readOnly", !ctx.searchable || ctx.itemsList.maxItemsSelected)("disabled", ctx.disabled)("value", ctx.searchTerm ? ctx.searchTerm : "");
      \u0275\u0275attribute("id", ctx.labelForId)("tabindex", ctx.tabIndex)("aria-activedescendant", ctx.isOpen ? ctx.itemsList == null ? null : ctx.itemsList.markedItem == null ? null : ctx.itemsList.markedItem.htmlId : null)("aria-controls", ctx.isOpen ? ctx.dropdownId : null);
      \u0275\u0275advance(2);
      \u0275\u0275property("ngIf", ctx.loading);
      \u0275\u0275advance();
      \u0275\u0275property("ngIf", ctx.showClear());
      \u0275\u0275advance(3);
      \u0275\u0275property("ngIf", ctx.isOpen);
    }
  },
  dependencies: [NgClass, NgForOf, NgIf, NgTemplateOutlet, NgDropdownPanelComponent, NgItemLabelDirective],
  styles: ['@charset "UTF-8";.ng-select{position:relative;display:block;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:"\\200b"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}\n'],
  encapsulation: 2,
  changeDetection: 0
});
var NgSelectComponent = _NgSelectComponent;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSelectComponent, [{
    type: Component,
    args: [{
      selector: "ng-select",
      providers: [{
        provide: NG_VALUE_ACCESSOR,
        useExisting: forwardRef(() => NgSelectComponent),
        multi: true
      }, NgDropdownPanelService],
      encapsulation: ViewEncapsulation$1.None,
      changeDetection: ChangeDetectionStrategy.OnPush,
      template: `<div
    (mousedown)="handleMousedown($event)"
    [class.ng-appearance-outline]="appearance === 'outline'"
    [class.ng-has-value]="hasValue"
    class="ng-select-container">

    <div class="ng-value-container">
        <div class="ng-placeholder">{{placeholder}}</div>

        <ng-container *ngIf="(!multiLabelTemplate  || !multiple ) && selectedItems.length > 0">
            <div [class.ng-value-disabled]="item.disabled" class="ng-value" *ngFor="let item of selectedItems; trackBy: trackByOption">
                <ng-template #defaultLabelTemplate>
                    <span class="ng-value-icon left" (click)="unselect(item);" aria-hidden="true">\xD7</span>
                    <span class="ng-value-label" [ngItemLabel]="item.label" [escape]="escapeHTML"></span>
                </ng-template>

                <ng-template
                    [ngTemplateOutlet]="labelTemplate || defaultLabelTemplate"
                    [ngTemplateOutletContext]="{ item: item.value, clear: clearItem, label: item.label }">
                </ng-template>
            </div>
        </ng-container>

        <ng-template *ngIf="multiple && multiLabelTemplate && selectedValues.length > 0"
                [ngTemplateOutlet]="multiLabelTemplate"
                [ngTemplateOutletContext]="{ items: selectedValues, clear: clearItem }">
        </ng-template>

        <div class="ng-input"
            role="combobox" 
            [attr.aria-expanded]="isOpen" 
            [attr.aria-owns]="isOpen ? dropdownId : null" 
            aria-haspopup="listbox">

            <input #searchInput
                   [attr.id]="labelForId"
                   [attr.tabindex]="tabIndex"
                   [readOnly]="!searchable || itemsList.maxItemsSelected"
                   [disabled]="disabled"
                   [value]="searchTerm ? searchTerm : ''"
                   (input)="filter(searchInput.value)"
                   (compositionstart)="onCompositionStart()"
                   (compositionend)="onCompositionEnd(searchInput.value)"
                   (focus)="onInputFocus($event)"
                   (blur)="onInputBlur($event)"
                   (change)="$event.stopPropagation()"
                   [attr.aria-activedescendant]="isOpen ? itemsList?.markedItem?.htmlId : null"
                   aria-autocomplete="list"
                   [attr.aria-controls]="isOpen ? dropdownId : null">
        </div>
    </div>

    <ng-container *ngIf="loading">
        <ng-template #defaultLoadingSpinnerTemplate>
            <div class="ng-spinner-loader"></div>
        </ng-template>

        <ng-template
            [ngTemplateOutlet]="loadingSpinnerTemplate || defaultLoadingSpinnerTemplate">
        </ng-template>
    </ng-container>

    <span *ngIf="showClear()" class="ng-clear-wrapper" tabindex="0" title="{{clearAllText}}" #clearButton>
        <span class="ng-clear" aria-hidden="true">\xD7</span>
    </span>

    <span class="ng-arrow-wrapper">
        <span class="ng-arrow"></span>
    </span>
</div>

<ng-dropdown-panel *ngIf="isOpen"
                   class="ng-dropdown-panel"
                   [virtualScroll]="virtualScroll"
                   [bufferAmount]="bufferAmount"
                   [appendTo]="appendTo"
                   [position]="dropdownPosition"
                   [headerTemplate]="headerTemplate"
                   [footerTemplate]="footerTemplate"
                   [filterValue]="searchTerm"
                   [items]="itemsList.filteredItems"
                   [markedItem]="itemsList.markedItem"
                   (update)="viewPortItems = $event"
                   (scroll)="scroll.emit($event)"
                   (scrollToEnd)="scrollToEnd.emit($event)"
                   (outsideClick)="close()"
                   [class.ng-select-multiple]="multiple"
                   [ngClass]="appendTo ? classes : null"
                   [id]="dropdownId"
                   role="listbox"
                   aria-label="Options list">

    <ng-container>
        <div class="ng-option" [attr.role]="item.children ? 'group' : 'option'" (click)="toggleItem(item)" (mouseover)="onItemHover(item)"
                *ngFor="let item of viewPortItems; trackBy: trackByOption"
                [class.ng-option-disabled]="item.disabled"
                [class.ng-option-selected]="item.selected"
                [class.ng-optgroup]="item.children"
                [class.ng-option]="!item.children"
                [class.ng-option-child]="!!item.parent"
                [class.ng-option-marked]="item === itemsList.markedItem"
                [attr.aria-selected]="item.selected"
                [attr.id]="item?.htmlId">

            <ng-template #defaultOptionTemplate>
                <span class="ng-option-label" [ngItemLabel]="item.label" [escape]="escapeHTML"></span>
            </ng-template>

            <ng-template
                [ngTemplateOutlet]="item.children ? (optgroupTemplate || defaultOptionTemplate) : (optionTemplate || defaultOptionTemplate)"
                [ngTemplateOutletContext]="{ item: item.value, item$:item, index: item.index, searchTerm: searchTerm }">
            </ng-template>
        </div>

        <div class="ng-option" [class.ng-option-marked]="!itemsList.markedItem" (mouseover)="itemsList.unmarkItem()" role="option" (click)="selectTag()" *ngIf="showAddTag">
            <ng-template #defaultTagTemplate>
                <span><span class="ng-tag-label">{{addTagText}}</span>"{{searchTerm}}"</span>
            </ng-template>

            <ng-template
                [ngTemplateOutlet]="tagTemplate || defaultTagTemplate"
                [ngTemplateOutletContext]="{ searchTerm: searchTerm }">
            </ng-template>
        </div>
    </ng-container>

    <ng-container *ngIf="showNoItemsFound()">
        <ng-template #defaultNotFoundTemplate>
            <div class="ng-option ng-option-disabled">{{notFoundText}}</div>
        </ng-template>

        <ng-template
            [ngTemplateOutlet]="notFoundTemplate || defaultNotFoundTemplate"
            [ngTemplateOutletContext]="{ searchTerm: searchTerm }">
        </ng-template>
    </ng-container>

    <ng-container *ngIf="showTypeToSearch()">
        <ng-template #defaultTypeToSearchTemplate>
            <div class="ng-option ng-option-disabled">{{typeToSearchText}}</div>
        </ng-template>

        <ng-template
            [ngTemplateOutlet]="typeToSearchTemplate || defaultTypeToSearchTemplate">
        </ng-template>
    </ng-container>

    <ng-container *ngIf="loading && itemsList.filteredItems.length === 0">
        <ng-template #defaultLoadingTextTemplate>
            <div class="ng-option ng-option-disabled">{{loadingText}}</div>
        </ng-template>

        <ng-template
            [ngTemplateOutlet]="loadingTextTemplate || defaultLoadingTextTemplate"
            [ngTemplateOutletContext]="{ searchTerm: searchTerm }">
        </ng-template>
    </ng-container>

</ng-dropdown-panel>
`,
      styles: ['@charset "UTF-8";.ng-select{position:relative;display:block;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:flex;outline:none;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;transform:translateZ(0);animation:load8 .8s infinite linear}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@keyframes load8{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .ng-option-label:empty:before{content:"\\200b"}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}\n']
    }]
  }], () => [{
    type: void 0,
    decorators: [{
      type: Attribute,
      args: ["class"]
    }]
  }, {
    type: void 0,
    decorators: [{
      type: Attribute,
      args: ["autofocus"]
    }]
  }, {
    type: NgSelectConfig
  }, {
    type: void 0,
    decorators: [{
      type: Inject,
      args: [SELECTION_MODEL_FACTORY]
    }]
  }, {
    type: ElementRef
  }, {
    type: ChangeDetectorRef
  }, {
    type: ConsoleService
  }], {
    bindLabel: [{
      type: Input
    }],
    bindValue: [{
      type: Input
    }],
    markFirst: [{
      type: Input
    }],
    placeholder: [{
      type: Input
    }],
    notFoundText: [{
      type: Input
    }],
    typeToSearchText: [{
      type: Input
    }],
    addTagText: [{
      type: Input
    }],
    loadingText: [{
      type: Input
    }],
    clearAllText: [{
      type: Input
    }],
    appearance: [{
      type: Input
    }],
    dropdownPosition: [{
      type: Input
    }],
    appendTo: [{
      type: Input
    }],
    loading: [{
      type: Input
    }],
    closeOnSelect: [{
      type: Input
    }],
    hideSelected: [{
      type: Input
    }],
    selectOnTab: [{
      type: Input
    }],
    openOnEnter: [{
      type: Input
    }],
    maxSelectedItems: [{
      type: Input
    }],
    groupBy: [{
      type: Input
    }],
    groupValue: [{
      type: Input
    }],
    bufferAmount: [{
      type: Input
    }],
    virtualScroll: [{
      type: Input
    }],
    selectableGroup: [{
      type: Input
    }],
    selectableGroupAsModel: [{
      type: Input
    }],
    searchFn: [{
      type: Input
    }],
    trackByFn: [{
      type: Input
    }],
    clearOnBackspace: [{
      type: Input
    }],
    labelForId: [{
      type: Input
    }],
    inputAttrs: [{
      type: Input
    }],
    tabIndex: [{
      type: Input
    }],
    readonly: [{
      type: Input
    }],
    searchWhileComposing: [{
      type: Input
    }],
    minTermLength: [{
      type: Input
    }],
    editableSearchTerm: [{
      type: Input
    }],
    keyDownFn: [{
      type: Input
    }],
    typeahead: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-typeahead"]
    }],
    multiple: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-multiple"]
    }],
    addTag: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-taggable"]
    }],
    searchable: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-searchable"]
    }],
    clearable: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-clearable"]
    }],
    isOpen: [{
      type: Input
    }, {
      type: HostBinding,
      args: ["class.ng-select-opened"]
    }],
    items: [{
      type: Input
    }],
    compareWith: [{
      type: Input
    }],
    clearSearchOnAdd: [{
      type: Input
    }],
    deselectOnClick: [{
      type: Input
    }],
    blurEvent: [{
      type: Output,
      args: ["blur"]
    }],
    focusEvent: [{
      type: Output,
      args: ["focus"]
    }],
    changeEvent: [{
      type: Output,
      args: ["change"]
    }],
    openEvent: [{
      type: Output,
      args: ["open"]
    }],
    closeEvent: [{
      type: Output,
      args: ["close"]
    }],
    searchEvent: [{
      type: Output,
      args: ["search"]
    }],
    clearEvent: [{
      type: Output,
      args: ["clear"]
    }],
    addEvent: [{
      type: Output,
      args: ["add"]
    }],
    removeEvent: [{
      type: Output,
      args: ["remove"]
    }],
    scroll: [{
      type: Output,
      args: ["scroll"]
    }],
    scrollToEnd: [{
      type: Output,
      args: ["scrollToEnd"]
    }],
    optionTemplate: [{
      type: ContentChild,
      args: [NgOptionTemplateDirective, {
        read: TemplateRef
      }]
    }],
    optgroupTemplate: [{
      type: ContentChild,
      args: [NgOptgroupTemplateDirective, {
        read: TemplateRef
      }]
    }],
    labelTemplate: [{
      type: ContentChild,
      args: [NgLabelTemplateDirective, {
        read: TemplateRef
      }]
    }],
    multiLabelTemplate: [{
      type: ContentChild,
      args: [NgMultiLabelTemplateDirective, {
        read: TemplateRef
      }]
    }],
    headerTemplate: [{
      type: ContentChild,
      args: [NgHeaderTemplateDirective, {
        read: TemplateRef
      }]
    }],
    footerTemplate: [{
      type: ContentChild,
      args: [NgFooterTemplateDirective, {
        read: TemplateRef
      }]
    }],
    notFoundTemplate: [{
      type: ContentChild,
      args: [NgNotFoundTemplateDirective, {
        read: TemplateRef
      }]
    }],
    typeToSearchTemplate: [{
      type: ContentChild,
      args: [NgTypeToSearchTemplateDirective, {
        read: TemplateRef
      }]
    }],
    loadingTextTemplate: [{
      type: ContentChild,
      args: [NgLoadingTextTemplateDirective, {
        read: TemplateRef
      }]
    }],
    tagTemplate: [{
      type: ContentChild,
      args: [NgTagTemplateDirective, {
        read: TemplateRef
      }]
    }],
    loadingSpinnerTemplate: [{
      type: ContentChild,
      args: [NgLoadingSpinnerTemplateDirective, {
        read: TemplateRef
      }]
    }],
    dropdownPanel: [{
      type: ViewChild,
      args: [forwardRef(() => NgDropdownPanelComponent)]
    }],
    searchInput: [{
      type: ViewChild,
      args: ["searchInput", {
        static: true
      }]
    }],
    clearButton: [{
      type: ViewChild,
      args: ["clearButton"]
    }],
    ngOptions: [{
      type: ContentChildren,
      args: [NgOptionComponent, {
        descendants: true
      }]
    }],
    useDefaultClass: [{
      type: HostBinding,
      args: ["class.ng-select"]
    }],
    disabled: [{
      type: HostBinding,
      args: ["class.ng-select-disabled"]
    }],
    filtered: [{
      type: HostBinding,
      args: ["class.ng-select-filtered"]
    }],
    single: [{
      type: HostBinding,
      args: ["class.ng-select-single"]
    }],
    handleKeyDown: [{
      type: HostListener,
      args: ["keydown", ["$event"]]
    }]
  });
})();
function DefaultSelectionModelFactory() {
  return new DefaultSelectionModel();
}
var DefaultSelectionModel = class {
  constructor() {
    this._selected = [];
  }
  get value() {
    return this._selected;
  }
  select(item, multiple, groupAsModel) {
    item.selected = true;
    if (!item.children || !multiple && groupAsModel) {
      this._selected.push(item);
    }
    if (multiple) {
      if (item.parent) {
        const childrenCount = item.parent.children.length;
        const selectedCount = item.parent.children.filter((x) => x.selected).length;
        item.parent.selected = childrenCount === selectedCount;
      } else if (item.children) {
        this._setChildrenSelectedState(item.children, true);
        this._removeChildren(item);
        if (groupAsModel && this._activeChildren(item)) {
          this._selected = [...this._selected.filter((x) => x.parent !== item), item];
        } else {
          this._selected = [...this._selected, ...item.children.filter((x) => !x.disabled)];
        }
      }
    }
  }
  unselect(item, multiple) {
    this._selected = this._selected.filter((x) => x !== item);
    item.selected = false;
    if (multiple) {
      if (item.parent && item.parent.selected) {
        const children = item.parent.children;
        this._removeParent(item.parent);
        this._removeChildren(item.parent);
        this._selected.push(...children.filter((x) => x !== item && !x.disabled));
        item.parent.selected = false;
      } else if (item.children) {
        this._setChildrenSelectedState(item.children, false);
        this._removeChildren(item);
      }
    }
  }
  clear(keepDisabled) {
    this._selected = keepDisabled ? this._selected.filter((x) => x.disabled) : [];
  }
  _setChildrenSelectedState(children, selected) {
    for (const child of children) {
      if (child.disabled) {
        continue;
      }
      child.selected = selected;
    }
  }
  _removeChildren(parent) {
    this._selected = [...this._selected.filter((x) => x.parent !== parent), ...parent.children.filter((x) => x.parent === parent && x.disabled && x.selected)];
  }
  _removeParent(parent) {
    this._selected = this._selected.filter((x) => x !== parent);
  }
  _activeChildren(item) {
    return item.children.every((x) => !x.disabled || x.selected);
  }
};
var _NgSelectModule = class _NgSelectModule {
};
_NgSelectModule.\u0275fac = function NgSelectModule_Factory(t) {
  return new (t || _NgSelectModule)();
};
_NgSelectModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
  type: _NgSelectModule
});
_NgSelectModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
  providers: [{
    provide: SELECTION_MODEL_FACTORY,
    useValue: DefaultSelectionModelFactory
  }],
  imports: [CommonModule]
});
var NgSelectModule = _NgSelectModule;
(() => {
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSelectModule, [{
    type: NgModule,
    args: [{
      declarations: [NgDropdownPanelComponent, NgOptionComponent, NgSelectComponent, NgOptgroupTemplateDirective, NgOptionTemplateDirective, NgLabelTemplateDirective, NgMultiLabelTemplateDirective, NgHeaderTemplateDirective, NgFooterTemplateDirective, NgNotFoundTemplateDirective, NgTypeToSearchTemplateDirective, NgLoadingTextTemplateDirective, NgTagTemplateDirective, NgLoadingSpinnerTemplateDirective, NgItemLabelDirective],
      imports: [CommonModule],
      exports: [NgSelectComponent, NgOptionComponent, NgOptgroupTemplateDirective, NgOptionTemplateDirective, NgLabelTemplateDirective, NgMultiLabelTemplateDirective, NgHeaderTemplateDirective, NgFooterTemplateDirective, NgNotFoundTemplateDirective, NgTypeToSearchTemplateDirective, NgLoadingTextTemplateDirective, NgTagTemplateDirective, NgLoadingSpinnerTemplateDirective],
      providers: [{
        provide: SELECTION_MODEL_FACTORY,
        useValue: DefaultSelectionModelFactory
      }]
    }]
  }], null, null);
})();

// projects/formbird-services/src/lib/constants/ClientConstants.ts
var ClientConstants2 = {
  // Used for the search filter
  FILTER: "filter",
  FILTERED_QUERY: "queryToBeFiltered",
  HTTP_STATUS_LOGIN_REJECTED: 401,
  OPERATION_TYPE_POST: "POST",
  // HTTP Post (insert) operation
  OPERATION_TYPE_PUT: "PUT",
  // HTTP Put (update) operation
  OPERATION_TYPE_DELETE: "DELETE",
  // HTTP Delete operation
  LAST_ENTERED_STATE_URL: "LastEnteredStateUrl",
  URL_EQUAL_REPLACEMENT_STRING: "fttf",
  // element ids
  TOGGLE_ID_LEFT: "left_close",
  // broadcasts
  DOCUMENT_NEW: "document:new",
  DOCUMENT_LOADED: "document:loaded",
  DOCUMENT_LOAD_ERROR: "document:loadError",
  VALIDATE_FORM_FIELDS: "document:validateFormFields",
  DOCUMENT_FORM_UPDATED: "document:formUpdated",
  PRESAVE_DOCUMENT_FORM_RESET: "document:preSaveDocumentReset",
  URL_CLICKED: "url:clicked",
  FORM_DIRTY_UPDATED: "formDirty",
  SPINNER_UPDATED: "showSpinner",
  // validation
  VALIDATION_INTERVAL_TIME: 500,
  // 500 milliseconds
  VALIDATION_REQUIRED_KEY: "required",
  VALIDATION_REQUIRED_MESSAGE: "This field is required.",
  VALIDATION_MIN_LENGTH_KEY: "hasMinLength",
  VALIDATION_MIN_LENGTH_MESSAGE: "This field is required at least %s characters long.",
  VALIDATION_MAX_LENGTH_KEY: "hasMaxLength",
  VALIDATION_MAX_LENGTH_MESSAGE: "This field is required max %s characters long.",
  CHANGED_DOCUMENT_LIST_ID_KEY: "___DOCUMENT_LIST_ID___",
  FILE_SENT_EVENT_NAME: "FileSentEventName",
  LOCAL_STORAGE_OFFLINE_STATUS_KEY: "OfflineStatus",
  ANGULAR_COMPONENT_SUFFIX: "-ng"
};

// package.json
var package_default = {
  name: "@formbird/angular-elements",
  version: "7.1.28",
  files: [
    "README.md",
    "LICENSE",
    "package.json",
    "dist/sc-components",
    "dist/mapping-components",
    "dist/ace-components",
    "dist/sc-signature",
    "dist/sc-markdown",
    "dist/monaco-components",
    "dist/sc-panel-collapse"
  ],
  scripts: {
    ng: "ng",
    build: "ng build",
    dist: "gulp dist",
    test: "ng test",
    lint: "ng lint",
    e2e: "ng e2e",
    "deploy:plain-components": "npx lerna run deploy",
    "deploy-watch": "gulp deploy-watch",
    "build:formbird": "rm -rf dist && ng build formbird-services && ng build formbird-sc-shared && ng build formbird-mapping && ng build mapping-components",
    "clean:target": "rm -rf ../fieldtec-web/server/public/vendor/custom-component-modules/sc-components",
    "copy:sc-comp": "cp -R dist/sc-components ../fieldtec-web/server/public/vendor/custom-component-modules",
    "copy:comp": "yarn copy:sc-comp && cp -R components/ ../fieldtec-web/server/public/vendor/custom-component-modules/sc-components",
    "build:comp": "yarn build:formbird && ng build sc-components",
    "analyze:comp": "webpack-bundle-analyzer -m static dist/sc-components/stats.json",
    "deploy:comp": "yarn build:comp && yarn clean:target && yarn copy:comp",
    "build:prod:comp": "yarn build:formbird && ng build sc-components --configuration production",
    "deploy:prod:comp": "yarn build:prod:comp && yarn clean:target && yarn copy:comp",
    "build:textbox": "yarn build:formbird && ng build sc-text-box --stats-json --configuration production",
    "deploy:textbox": "yarn build:textbox && yarn clean:target && cp -R dist/sc-text-box ../fieldtec-web/server/public/vendor/custom-component-modules/sc-components",
    "analyze:textbox": "webpack-bundle-analyzer -m static dist/sc-text-box/stats.json",
    "build:notecomment": "yarn build:formbird && ng build sc-note-comment --stats-json --configuration production",
    "deploy:notecomment": "yarn build:notecomment && yarn clean:target && cp -R dist/sc-note-comment ../fieldtec-web/server/public/vendor/custom-component-modules/sc-components",
    "install-all": "cp -R dist/* ../fieldtec-web/server/public/vendor/custom-component-modules"
  },
  dependencies: {
    "@angular/animations": "^18.0.0-rc.1",
    "@angular/cdk": "^18.0.0-rc.1",
    "@angular/common": "^18.0.0-rc.1",
    "@angular/compiler": "^18.0.0-rc.1",
    "@angular/core": "^18.0.0-rc.1",
    "@angular/elements": "^18.0.0-rc.1",
    "@angular/forms": "^18.0.0-rc.1",
    "@angular/localize": "^18.0.0-rc.1",
    "@angular/material": "^18.0.0-rc.1",
    "@angular/platform-browser": "^18.0.0-rc.1",
    "@angular/platform-browser-dynamic": "^18.0.0-rc.1",
    "@angular/router": "^18.0.0-rc.1",
    "@formbird/angular-shared": "../fieldtec-web-signals/dist/@formbird/angular-shared",
    "@formbird/geoscape-sqlite": "^0.0.7",
    "@formbird/services": "../fieldtec-web-signals/dist/@formbird/services",
    "@formbird/shared": "../fieldtec-web-signals/projects/shared",
    "@formbird/styles": "../fieldtec-web-signals/projects/styles",
    "@formbird/types": "../fieldtec-web-signals/projects/types",
    "@googlemaps/markerclusterer": "^2.5.2",
    "@guh-md/editor": "0.1.10",
    "@ng-select/ng-select": "^12.0.7",
    "@opentok/client": "^2.18.0",
    "@types/c3": "^0.7.4",
    "@types/elasticsearch": "^5.0.40",
    "@types/geojson": "7946.0.7",
    "@types/jquery": "^3.3.38",
    "@types/openlayers": "4.6.17",
    "@videogular/ngx-videogular": "5.0.1",
    "ace-builds": "^1.4.14",
    "angular-file": "^3.4.0",
    browserlist: "^1.0.1",
    bson: "4.0.2",
    c3: "^0.7.20",
    copyfiles: "^2.4.1",
    "cross-spawn": "^7.0.3",
    "datatables.net-dt": "1.12.1",
    "date-fns": "^2.27.0",
    dexie: "^2.0.4",
    "esri-loader": "^2.13.0",
    "file-loader": "^6.2.0",
    flatpickr: "^4.6.2",
    "froala-editor": "4.0.17",
    gulp: "^4.0.2",
    "gulp-bump": "^3.2.0",
    "gulp-git": "^2.10.1",
    "gulp-util": "^3.0.8",
    handlebars: "^4.2.0",
    immer: "^7.0.1",
    jquery: "3.5.1",
    jsonpath: "^1.0.2",
    jsqr: "^1.2.0",
    lerna: "^4.0.0",
    loadjs: "4.2.0",
    lodash: "^4.17.15",
    "lodash.clonedeep": "3.0.2",
    markerwithlabel: "^2.0.2",
    "material-design-icons": "^3.0.1",
    moment: "^2.24.0",
    "ngx-lightbox": "^3.0.0",
    notyf: "^3.6.0",
    numeral: "^2.0.6",
    ol: "^6.15.1",
    "ol-mapbox-style": "^8.2.0",
    opentok: "^2.10.0",
    path: "^0.12.7",
    "pdfjs-dist": "^2.14.305",
    pdfmake: "0.3.0-beta.2",
    "postcss-loader": "^3.0.0",
    proj4: "2.6.0",
    qrcode: "^1.4.4",
    redux: "4.0.1",
    "redux-devtools-extension": "2.13.8",
    "require-dir": "^1.2.0",
    rfc6902: "^3.0.4",
    rxjs: "^7.8.1",
    "sass-loader": "^10.0.0",
    semver: "^7.3.2",
    signature_pad: "^4.0.0",
    "socket.io-client": "4.3.2",
    tsickle: "0.39.1",
    tslib: "^2.3.1",
    yargs: "^15.4.1",
    "zone.js": "~0.13.1"
  },
  devDependencies: {
    "@angular-devkit/build-angular": "^18.0.0-rc.2",
    "@angular/cli": "^18.0.0-rc.1",
    "@angular/compiler-cli": "^18.0.0-rc.1",
    "@angular/language-service": "^18.0.0-rc.1",
    "@babel/core": "^7.7.4",
    "@types/google.maps": "^3.54.10",
    "@types/node": "^18.18.0",
    "@types/supercluster": "^7.1.3",
    "babel-loader": "^8.0.6",
    del: "2.2.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    karma: "~6.3.4",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "ng-packagr": "^18.0.0-rc.0",
    prettier: "2.0.5",
    "ts-loader": "8.0.14",
    "ts-node": "~7.0.0",
    tslint: "~6.1.3",
    typescript: "~5.4.2",
    webpack: "5.14.0",
    "webpack-bundle-analyzer": "^3.7.0",
    "webpack-cli": "4.9.1"
  },
  browser: {
    crypto: false,
    fs: false,
    module: false,
    path: false
  },
  license: "SEE LICENSE in LICENSE"
};

// projects/formbird-mapping/src/lib/street-data/street-data.module.ts
var _StreetDataModule = class _StreetDataModule {
  constructor() {
  }
};
_StreetDataModule.\u0275fac = function StreetDataModule_Factory(t) {
  return new (t || _StreetDataModule)();
};
_StreetDataModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _StreetDataModule });
_StreetDataModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [
  BrowserAnimationsModule,
  FormsModule,
  ReactiveFormsModule,
  MatFormFieldModule,
  MatInputModule,
  MatIconModule,
  MatButtonModule
] });
var StreetDataModule = _StreetDataModule;

// projects/formbird-sc-shared/src/lib/component-setup.module.ts
var _ComponentSetupModule = class _ComponentSetupModule {
};
_ComponentSetupModule.\u0275fac = function ComponentSetupModule_Factory(t) {
  return new (t || _ComponentSetupModule)();
};
_ComponentSetupModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ComponentSetupModule });
_ComponentSetupModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ providers: [ComponentSetupService2], imports: [CommonModule, FormbirdServicesModule] });
var ComponentSetupModule2 = _ComponentSetupModule;

// projects/formbird-sc-shared/src/lib/components/validation/validation-message.module.ts
var _ValidationMessageModule = class _ValidationMessageModule {
};
_ValidationMessageModule.\u0275fac = function ValidationMessageModule_Factory(t) {
  return new (t || _ValidationMessageModule)();
};
_ValidationMessageModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ValidationMessageModule });
_ValidationMessageModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [CommonModule, MatIconModule, MatAutocompleteModule] });
var ValidationMessageModule2 = _ValidationMessageModule;

// projects/formbird-sc-shared/src/lib/services/custom-element.service.ts
var _CustomElementService = class _CustomElementService {
  constructor(fbInjectorService) {
    this.fbInjectorService = fbInjectorService;
    this.convertToCustomElement = (component, selector, injector, angularSuffix, version, options) => {
      if (angularSuffix && this.fbInjectorService.isAngularJSCore()) {
        selector += angularSuffix;
      }
      if (!version) {
        version = "NOT-SET";
      }
      if (!customElements.get(selector)) {
        const scComponent = createCustomElement(component, { injector });
        const connectedCallback = scComponent.prototype.connectedCallback || function() {
        };
        scComponent.prototype.connectedCallback = function() {
          this.setAttribute("fb-component-version", version);
          if (options) {
            this.setAttribute("is-static-panel", options.isStaticPanel);
          }
          connectedCallback.call(this);
        };
        customElements.define(selector, scComponent);
      }
    };
  }
};
_CustomElementService.\u0275fac = function CustomElementService_Factory(t) {
  return new (t || _CustomElementService)(\u0275\u0275inject(FormbirdInjectorService));
};
_CustomElementService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _CustomElementService, factory: _CustomElementService.\u0275fac, providedIn: "root" });
var CustomElementService2 = _CustomElementService;

// projects/sc-street-address/src/app/street-address/street-address.module.ts
var _StreetAddressModule = class _StreetAddressModule {
  constructor(injector, customElementService) {
    this.injector = injector;
    this.customElementService = customElementService;
    customElementService.convertToCustomElement(StreetAddressComponent, "sc-street-address", this.injector, ClientConstants2.ANGULAR_COMPONENT_SUFFIX, package_default.version);
    customElementService.convertToCustomElement(StreetAddressComponent, "sc-street-address-web-component", this.injector, null, package_default.version);
  }
};
_StreetAddressModule.\u0275fac = function StreetAddressModule_Factory(t) {
  return new (t || _StreetAddressModule)(\u0275\u0275inject(Injector), \u0275\u0275inject(CustomElementService2));
};
_StreetAddressModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _StreetAddressModule });
_StreetAddressModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [
  CommonModule,
  FormsModule,
  ReactiveFormsModule,
  MatFormFieldModule,
  MatInputModule,
  MatAutocompleteModule,
  MatButtonModule,
  MatTooltipModule,
  // LabelModule,
  HttpClientModule,
  GeoAutoCompleteModule,
  SanitizingModule,
  NgSelectModule,
  StreetDataModule,
  ComponentSetupModule2,
  ValidationMessageModule2
] });
var StreetAddressModule = _StreetAddressModule;

// projects/sc-street-address/src/app/app.module.ts
var _AppModule = class _AppModule {
  constructor() {
  }
  // ngDoBootstrap needs to do nothing when exporting custom elements so that the normal Angular app bootstrap doesn't take place
  ngDoBootstrap() {
  }
};
_AppModule.\u0275fac = function AppModule_Factory(t) {
  return new (t || _AppModule)();
};
_AppModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _AppModule });
_AppModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [
  CommonModule,
  StreetAddressModule
] });
var AppModule = _AppModule;

// projects/sc-street-address/src/environments/environment.ts
var environment = {
  production: false
};

// projects/sc-street-address/src/main.ts
if (environment.production) {
  enableProdMode();
}
platformBrowser().bootstrapModule(AppModule).catch((err) => console.error(err));
/*! Bundled license information:

jquery/dist/jquery.js:
  (*!
   * jQuery JavaScript Library v3.5.1
   * https://jquery.com/
   *
   * Includes Sizzle.js
   * https://sizzlejs.com/
   *
   * Copyright JS Foundation and other contributors
   * Released under the MIT license
   * https://jquery.org/license
   *
   * Date: 2020-05-04T22:49Z
   *)

ieee754/index.js:
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)

moment/moment.js:
  (*! moment.js *)
  (*! version : 2.30.1 *)
  (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
  (*! license : MIT *)
  (*! momentjs.com *)

lodash/lodash.js:
  (**
   * @license
   * Lodash <https://lodash.com/>
   * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   *)

markerwithlabel/index.js:
  (*!
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *)

@angular/core/fesm2022/primitives/signals.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/core/fesm2022/core.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/core/fesm2022/core.mjs:
  (*!
   * @license
   * Copyright Google LLC All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   *)

@angular/core/fesm2022/core.mjs:
  (*!
   * @license
   * Copyright Google LLC All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   *)

@angular/core/fesm2022/core.mjs:
  (*!
   * @license
   * Copyright Google LLC All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   *)

@angular/core/fesm2022/core.mjs:
  (*!
   * @license
   * Copyright Google LLC All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   *)

@angular/core/fesm2022/core.mjs:
  (*!
   * @license
   * Copyright Google LLC All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   *)

@angular/common/fesm2022/common.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/common/fesm2022/http.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/platform-browser/fesm2022/platform-browser.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/forms/fesm2022/forms.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/animations/fesm2022/animations.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/elements/fesm2022/elements.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@googlemaps/markerclusterer/dist/index.esm.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** *)

@angular/animations/fesm2022/browser.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)

@angular/platform-browser/fesm2022/animations.mjs:
  (**
   * @license Angular v18.0.0-rc.1
   * (c) 2010-2024 Google LLC. https://angular.io/
   * License: MIT
   *)
*/
//# sourceMappingURL=main.js.map
